decocms 3.9.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/client/assets/{AlertCircle-dzvWxujb.js → AlertCircle-Dm12nF6o.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CBMu0EOf.js → ArrowUpRight-GdT2goj_.js} +1 -1
  3. package/dist/client/assets/{Check-BTi6aK2O.js → Check-o-zUju1W.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-C24wnP2Z.js → CheckCircle-BkEI7gFR.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BZRrL23D.js → ChevronDown-CNy49i0W.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-DEtz4dkO.js → ChevronLeft-BswR_fSO.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-Ddjtetki.js → ChevronRight-BgIn57eH.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-DhRFiyWk.js → ChevronUp-CItZiPxX.js} +1 -1
  9. package/dist/client/assets/{Container-DqZ7iXxp.js → Container-BI041HGs.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DmUaYhK2.js → DotsVertical-DpyQCfpE.js} +1 -1
  11. package/dist/client/assets/{Eye-D-e14RXi.js → Eye-CwmAmEba.js} +1 -1
  12. package/dist/client/assets/{FilterLines-Ceib5U8s.js → FilterLines-_2tlTach.js} +1 -1
  13. package/dist/client/assets/{Globe01-D0-2dr7e.js → Globe01-BQiH4pzR.js} +1 -1
  14. package/dist/client/assets/{HardDrive-iB6HZdkm.js → HardDrive-BExU4NVN.js} +1 -1
  15. package/dist/client/assets/{Key01-DJjMsflU.js → Key01-BVH8DPhU.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-DC99mmKb.js → LayoutLeft-DNYnEEyq.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-BpZEkrD7.js → LinkExternal01-XNIU6-cE.js} +1 -1
  18. package/dist/client/assets/{Monitor01-C8q7RxXu.js → Monitor01-20Eh6WBW.js} +1 -1
  19. package/dist/client/assets/{Palette-C1AASxx2.js → Palette-vdpnI3pe.js} +1 -1
  20. package/dist/client/assets/{Play-BHXb_TUr.js → Play-DitjUfoa.js} +1 -1
  21. package/dist/client/assets/{Plus-DTBFvoZ4.js → Plus-BFGy0Ag-.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-BDUToMVd.js → RefreshCcw01-86h90ufT.js} +1 -1
  23. package/dist/client/assets/{SearchMd-CbQiai92.js → SearchMd-DcUQwid2.js} +1 -1
  24. package/dist/client/assets/{Settings02-Bu96rwA_.js → Settings02-CK5ZrDud.js} +1 -1
  25. package/dist/client/assets/{Shield01-knE-M4LE.js → Shield01-DymXSrLL.js} +1 -1
  26. package/dist/client/assets/{Star01-CVzgxp1x.js → Star01-DH1c5eP5.js} +1 -1
  27. package/dist/client/assets/{Stars01-CDWeKJ6M.js → Stars01-9ek2YoUP.js} +1 -1
  28. package/dist/client/assets/{Stars02-XWO6H1Re.js → Stars02-CON7obeQ.js} +1 -1
  29. package/dist/client/assets/{Sun-CbEJ7xkn.js → Sun-BLdidlza.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-Dc6vSFgX.js → SwitchHorizontal01-K-7T5m4d.js} +1 -1
  31. package/dist/client/assets/{Tool01-B6ELFGh-.js → Tool01-D2UZ1Vs-.js} +1 -1
  32. package/dist/client/assets/{Trash01-4Ps74tkv.js → Trash01-Cx3OtqBr.js} +1 -1
  33. package/dist/client/assets/{Upload01-CnrDySm1.js → Upload01-5227NVpL.js} +1 -1
  34. package/dist/client/assets/{User01-BA7YwKC-.js → User01-Dm1O7yuK.js} +1 -1
  35. package/dist/client/assets/{Users01-DvcVTQ1g.js → Users01-D9KQz9Jg.js} +1 -1
  36. package/dist/client/assets/{Users03-BkEliyJ2.js → Users03-DcPZW8td.js} +1 -1
  37. package/dist/client/assets/{X-Ch1EyNal.js → X-BQQplvP0.js} +1 -1
  38. package/dist/client/assets/{XCircle-BKXSa_VQ.js → XCircle-h_tDVdAY.js} +1 -1
  39. package/dist/client/assets/{XClose-D_AWgVIk.js → XClose-DRKdv4XS.js} +1 -1
  40. package/dist/client/assets/{Zap-C_lJ1cEb.js → Zap-B0rZ1Af9.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-rvBlc1j-.js → ZapSquare-BZ8deXpK.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-Dk_N18Ki.js → ZoomOut-CpLnwBO_.js} +1 -1
  43. package/dist/client/assets/{access-gate-jSqFnrGs.js → access-gate-GaKCibnP.js} +1 -1
  44. package/dist/client/assets/{accordion-C4Pme2EY.js → accordion-CuBTPd53.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-cOeaGNML.js → add-section-modal-CiPuF_Ea.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-qbK6YAO9.js → agent-capabilities-9LqLzAxM.js} +1 -1
  47. package/dist/client/assets/{agent-icon-B_Sssulg.js → agent-icon-zrokvqQM.js} +1 -1
  48. package/dist/client/assets/{agent-icons-D51AFvhI.js → agent-icons-Dv-0lh0p.js} +1 -1
  49. package/dist/client/assets/{agents-list-C2B7x1Is.js → agents-list-D3enC4oc.js} +1 -1
  50. package/dist/client/assets/{ai-providers-ogKn3dAb.js → ai-providers-DJq0PZPq.js} +1 -1
  51. package/dist/client/assets/{alert-D5REShaT.js → alert-aloz1Luc.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-6ai-9HnX.js → alert-dialog-BoYEsobC.js} +1 -1
  53. package/dist/client/assets/app-editor-52tpi3rq.js +1 -0
  54. package/dist/client/assets/{auth-catchall-BnCKrsj9.js → auth-catchall-CKECVnSc.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-YnzLUagi.js → auth-split-layout-BXyV4B-B.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BWubsYMA.js → automation-list-row-CCDkT_lb.js} +1 -1
  57. package/dist/client/assets/{automation-runs-BB3z--MX.js → automation-runs-C41UnlIL.js} +1 -1
  58. package/dist/client/assets/{automations-DNOJ2JTp.js → automations-DINiWlko.js} +1 -1
  59. package/dist/client/assets/{avatar-O1JcTGgG.js → avatar-CFgeYzCR.js} +1 -1
  60. package/dist/client/assets/{badge-BvUmM76z.js → badge-BoRJ8tO_.js} +1 -1
  61. package/dist/client/assets/{brand-context-BxqAXCTz.js → brand-context-CPjIHvVh.js} +1 -1
  62. package/dist/client/assets/{buckets-DxKR4O3e.js → buckets-CoK7HZf8.js} +1 -1
  63. package/dist/client/assets/{calendar-DPPkP_2t.js → calendar-CNghNFxX.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-H04-IMSf.js → capability-load-error-CZ-9nVZ5.js} +1 -1
  65. package/dist/client/assets/{card-fKzJiL4z.js → card-BXlKgMlf.js} +1 -1
  66. package/dist/client/assets/{chat-context-BmIMIbdZ.js → chat-context-DV1OjViY.js} +1 -1
  67. package/dist/client/assets/{checkbox-BBA-baQg.js → checkbox-B-gaLjHk.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-VydTLV_L.js → cli-auth-success-d78Hzgue.js} +1 -1
  69. package/dist/client/assets/{collection-detail-CzKfKNSD.js → collection-detail-JuRvgARK.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-w5gZgVyn.js → collection-display-button-BB9GNATL.js} +1 -1
  71. package/dist/client/assets/{collection-search-DZy7ZGM2.js → collection-search-lmVdsLrv.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-BtKHdP44.js → collection-table-wrapper-Ch_XvI-y.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BWubNGTM.js → collection-tabs-C3D4x7Aa.js} +1 -1
  74. package/dist/client/assets/{collections-_mVHVGxv.js → collections-BKr8aq5N.js} +1 -1
  75. package/dist/client/assets/{command-eY3hMYWt.js → command-BFycs2Kb.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-1K3-qmT6.js → connect-desktop-dialog-RVZBNR1K.js} +1 -1
  77. package/dist/client/assets/{connection-card-BiKxhszY.js → connection-card-CAaHV4Vz.js} +1 -1
  78. package/dist/client/assets/{connection-detail-DiC5wG3m.js → connection-detail-PVPF5bbg.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-qNlMv9lf.js → connection-form-helpers-D45HQd6Q.js} +1 -1
  80. package/dist/client/assets/{connections-CwFwHTK-.js → connections-BvC0Sjf_.js} +1 -1
  81. package/dist/client/assets/{constants-DVPpd9QA.js → constants-D6Bbr6AT.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-BSh6nGrY.js → decopilot-sse-pool-Ce0jkp4a.js} +1 -1
  83. package/dist/client/assets/{dialog-zrSzj7TD.js → dialog-CB0bO41l.js} +1 -1
  84. package/dist/client/assets/{domain-settings-C0r5hJdO.js → domain-settings-Ca-ULuYt.js} +1 -1
  85. package/dist/client/assets/{drawer-BOKSr-JQ.js → drawer-DFvei-xn.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-Dp0AYb5Q.js → dropdown-menu-Ci6fdZ_l.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-BqbhGwCQ.js → dynamic-plugin-layout-2yoEhZn7.js} +1 -1
  88. package/dist/client/assets/{empty-state-CMCikW75.js → empty-state-CmBBVqmb.js} +1 -1
  89. package/dist/client/assets/{empty-state-C-Vzaz3T.js → empty-state-DgETnZaU.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-DqaNlLEE.js → extract-connection-data-cVoEqyD8.js} +1 -1
  91. package/dist/client/assets/{features-DY0OBwI_.js → features-BIUoz6y9.js} +1 -1
  92. package/dist/client/assets/{file-explorer-c1AF4n2J.js → file-explorer-BhsF_niW.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-BPZ9mx_j.js → file-type-icon-DFx7UFpB.js} +1 -1
  94. package/dist/client/assets/{files-3Db0Ok-v.js → files-CwoEB6jc.js} +1 -1
  95. package/dist/client/assets/{form-DwvvaWfd.js → form-Ct0PcXXO.js} +1 -1
  96. package/dist/client/assets/{general-BSTtek3u.js → general-DX7bk_55.js} +1 -1
  97. package/dist/client/assets/{generate-id-Lwmt2FKL.js → generate-id-DYV1EuhB.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-BSS2HO9c.js → github-repo-picker-CnntksDO.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-ziMK8DeX.js → header-tab-button-B8QItw7F.js} +1 -1
  100. package/dist/client/assets/{hover-card-B1oYmeeS.js → hover-card-8wJLJ7yd.js} +1 -1
  101. package/dist/client/assets/{image-field-Xt_fxRp4.js → image-field-ChNUl-O1.js} +1 -1
  102. package/dist/client/assets/{index-DZT3k4JB.js → index-BACP8eL8.js} +1 -1
  103. package/dist/client/assets/{index-BhbqsWj0.js → index-BYYtwaPd.js} +1 -1
  104. package/dist/client/assets/{index-BgCi7oO5.js → index-BcVgCuba.js} +1 -1
  105. package/dist/client/assets/{index-Bdaabwwx.js → index-BsO26Vey.js} +1 -1
  106. package/dist/client/assets/{index-CFbzjrDU.js → index-Bu3pftwN.js} +4 -4
  107. package/dist/client/assets/{index-C34u6PSm.js → index-BvwjdL6f.js} +1 -1
  108. package/dist/client/assets/{index-C6H2oubI.js → index-BvzS7IRp.js} +1 -1
  109. package/dist/client/assets/{index-Dkg-XbjX.js → index-C9u7t1jZ.js} +1 -1
  110. package/dist/client/assets/{index-CM4eUM9Q.js → index-D9kgGhq4.js} +3 -3
  111. package/dist/client/assets/{index-CTWR9OEI.js → index-DEy5aba-.js} +1 -1
  112. package/dist/client/assets/{index-Bno4hQSS.js → index-DIAuQeIa.js} +1 -1
  113. package/dist/client/assets/{index-Bn2oEJye.js → index-DnwFIrqI.js} +1 -1
  114. package/dist/client/assets/{index-B55sS7_E.js → index-DxocBsWJ.js} +1 -1
  115. package/dist/client/assets/{index-CSkdTWYd.js → index-HSc5X2s9.js} +1 -1
  116. package/dist/client/assets/{index-tJpcknvZ.js → index-cadeU-4K.js} +1 -1
  117. package/dist/client/assets/{index-redirect-Cg0BDQlK.js → index-redirect-FdtMY7HX.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-UgK429qS.js → infiniteQueryObserver-BaYvuSQm.js} +1 -1
  119. package/dist/client/assets/{input-DwZNdPHy.js → input-D8kdtiC4.js} +1 -1
  120. package/dist/client/assets/{integration-icon-CBe2H1CK.js → integration-icon-DOYIIElF.js} +1 -1
  121. package/dist/client/assets/{label-4oCFH30G.js → label-BpJD7y8S.js} +1 -1
  122. package/dist/client/assets/{layout-DVfJUzzq.js → layout-DtZU5vn4.js} +1 -1
  123. package/dist/client/assets/{login-okezlysx.js → login-BuVPc8ii.js} +1 -1
  124. package/dist/client/assets/{members-CLERhO5A.js → members-DgzAyfl8.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-CB_L5Q_g.js → monaco-editor-Da7GwOd2.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-CmyF_9mp.js → monitoring-stats-row-DMC3Qfgg.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-BXG4NwZh.js → oauth-callback-B8N9yuZ3.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-BnPVO-sU.js → oauth-callback-ai-provider-DGlvLqV2.js} +1 -1
  129. package/dist/client/assets/{onboarding-BSqDKN4n.js → onboarding-CsqQa1Du.js} +1 -1
  130. package/dist/client/assets/{org-install-F0Blx0ik.js → org-install-DbQVBTAF.js} +1 -1
  131. package/dist/client/assets/{org-layout-BSF2eWwr.js → org-layout-B-dSShI_.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-Cy8OWL63.js → org-plugin-layout-D8dv4iOR.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-DsSfrFx2.js → page-seo-form-DMPm2Bc_.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-BJhopuAk.js +1 -0
  135. package/dist/client/assets/{pair-BUKInYHO.js → pair-DyoQ9qQT.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-BFoUX648.js → plugin-empty-state-DAyYlyt1.js} +1 -1
  137. package/dist/client/assets/{plugin-header-DQzSP9ZF.js → plugin-header-D36KN-4q.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-B7RnS0gK.js → plugin-layout-D6jOpYTL.js} +1 -1
  139. package/dist/client/assets/{popover-pbPJblFP.js → popover-Ar-4ozUT.js} +1 -1
  140. package/dist/client/assets/{post-editor-Ct8uL9lS.js → post-editor-MIJGliNT.js} +1 -1
  141. package/dist/client/assets/{primitives-D4DINGOQ.js → primitives-Dt2PbGWi.js} +1 -1
  142. package/dist/client/assets/{profile-GChqLjKK.js → profile-D_3mUpNq.js} +1 -1
  143. package/dist/client/assets/project-app-view-BwtXgdHT.js +1 -0
  144. package/dist/client/assets/record-editor-DG5YEX5v.js +1 -0
  145. package/dist/client/assets/{registry-layout-BUzClddy.js → registry-layout-DfdkwuGZ.js} +1 -1
  146. package/dist/client/assets/registry-pvkHql8r.js +2 -0
  147. package/dist/client/assets/{require-capability-D0GS6z32.js → require-capability-C9yFB8dG.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DHWUJ_wT.js → required-auth-layout-DFiOpH8z.js} +1 -1
  149. package/dist/client/assets/{reset-password-BS1iqoj0.js → reset-password-BsH_SanI.js} +1 -1
  150. package/dist/client/assets/{resizable-DhLCux-y.js → resizable-CqxuHIEF.js} +1 -1
  151. package/dist/client/assets/{roles-BNQvS-Ms.js → roles-ChKgj-1r.js} +1 -1
  152. package/dist/client/assets/{save-status-D1nMYaPA.js → save-status-CjyNK6PA.js} +1 -1
  153. package/dist/client/assets/{schema-form-BHbbVGcy.js → schema-form-C7LQIu-l.js} +1 -1
  154. package/dist/client/assets/{scroll-area-DMpuHtIE.js → scroll-area-B0QeeQ1W.js} +1 -1
  155. package/dist/client/assets/{search-input-Br9hH5ca.js → search-input-zYIhXOXh.js} +1 -1
  156. package/dist/client/assets/{secrets-wDf_j2Pb.js → secrets-Bs_qBrY_.js} +1 -1
  157. package/dist/client/assets/{sections-editor-C0HkgTTy.js → sections-editor-oX0PTrIX.js} +1 -1
  158. package/dist/client/assets/{select-DUB_e2wA.js → select-BMTzbu3R.js} +1 -1
  159. package/dist/client/assets/{select-model-n2hGgZkG.js → select-model-C8-Qol6g.js} +1 -1
  160. package/dist/client/assets/{seo-editor-C9Aqp93i.js → seo-editor-BmXWSA0f.js} +1 -1
  161. package/dist/client/assets/settings-layout-CDKbGpOq.js +1 -0
  162. package/dist/client/assets/{settings-section-c0dyQilc.js → settings-section-DkCaCHjL.js} +1 -1
  163. package/dist/client/assets/{sheet-CQuYX4pr.js → sheet-BcNA728n.js} +1 -1
  164. package/dist/client/assets/{shell-controls-haAPWYdb.js → shell-controls-DyxUm0QJ.js} +1 -1
  165. package/dist/client/assets/{shell-layout-iqX4bmcb.js → shell-layout-pG6XpLJU.js} +1 -1
  166. package/dist/client/assets/shell-route-loading-DdwIEVqN.js +1 -0
  167. package/dist/client/assets/{sidebar-CUicHm9C.js → sidebar-Bk2jzyI-.js} +1 -1
  168. package/dist/client/assets/{skeleton-CaDhIMN5.js → skeleton-FanER5WJ.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-DHLq9Pb_.js → sortable.esm-C8q-C7LS.js} +1 -1
  170. package/dist/client/assets/{spinner-d6yvFwOg.js → spinner-Bniq-hdg.js} +1 -1
  171. package/dist/client/assets/{sso-k1LlLt2L.js → sso-9cC4498A.js} +1 -1
  172. package/dist/client/assets/{store-COFkGwT_.js → store-2muMuSWw.js} +1 -1
  173. package/dist/client/assets/store-registry-C1k5PTr5.js +2 -0
  174. package/dist/client/assets/{switch-CEixFBdL.js → switch-Mi9vrG7L.js} +1 -1
  175. package/dist/client/assets/{tab-id-DvasrPZC.js → tab-id-DoHEKhGX.js} +1 -1
  176. package/dist/client/assets/{table-BwGGIiJ5.js → table-DSgZcufa.js} +1 -1
  177. package/dist/client/assets/{tabs-Bo7dHK4T.js → tabs-DjiD-oR_.js} +1 -1
  178. package/dist/client/assets/{task-status-Cu-l7Iv4.js → task-status-jQFHPQ2F.js} +1 -1
  179. package/dist/client/assets/{textarea-DHyB0Smt.js → textarea-B24VAXi2.js} +1 -1
  180. package/dist/client/assets/{toggle-group-calkhzKZ.js → toggle-group-BGMT9i62.js} +1 -1
  181. package/dist/client/assets/{toolbar-NS6fUdLE.js → toolbar-FU-ITy2s.js} +1 -1
  182. package/dist/client/assets/{tools-list-CHRbHPAT.js → tools-list-yUD9btG4.js} +1 -1
  183. package/dist/client/assets/{tooltip-c0JCK6eh.js → tooltip-M08maXcg.js} +1 -1
  184. package/dist/client/assets/{types-BqTbtprH.js → types-C_6yTm2K.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-ClrNZ9KV.js → use-ai-providers-DgHf7F2h.js} +1 -1
  186. package/dist/client/assets/{use-automations-D_GOMI0Y.js → use-automations-DkHpblle.js} +1 -1
  187. package/dist/client/assets/{use-capability-D2Lekzsm.js → use-capability-COb_RW9L.js} +1 -1
  188. package/dist/client/assets/{use-collections-BdrLE9lf.js → use-collections-Dx8F5dop.js} +1 -1
  189. package/dist/client/assets/{use-connection-Bna7-Lpr.js → use-connection-fZwsgZBE.js} +1 -1
  190. package/dist/client/assets/{use-copy-9jbZNRel.js → use-copy-ND5nyTQq.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-BrzNeIRQ.js → use-create-virtual-mcp-DlD4WTZG.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-BZksQLwZ.js → use-debounced-autosave-DVgUt2Pb.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-B9QWDFwu.js → use-delete-connection-BayYbiEc.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-mDsJFR6O.js → use-file-configs-D4ueLTwx.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-BmCBqG2s.js → use-infinite-scroll-DxKK_1jX.js} +1 -1
  196. package/dist/client/assets/{use-list-state-5PGktjrQ.js → use-list-state-CcbSUP67.js} +1 -1
  197. package/dist/client/assets/{use-mcp-prompts-zOwt9lRN.js → use-mcp-prompts-DwWf_cps.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-CVwEyvG9.js → use-mcp-tools-DPaUEjUC.js} +1 -1
  199. package/dist/client/assets/{use-members-BpSAkPCJ.js → use-members-BGhv-lqQ.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-CLGcl9A6.js → use-navigate-to-agent-ImCQRVux.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-NzYQ0X0A.js → use-org-auth-client-BnMgTkv9.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-CM2A8YLV.js → use-org-sso-BtiGW1BY.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-BY_DCVFa.js → use-organization-roles-Dsopt3rB.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-oXVZ3xqu.js → use-organization-settings-DcOZmJjR.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-C77RjnzI.js → use-registry-connections-Bued1bGX.js} +1 -1
  206. package/dist/client/assets/{use-secrets-TPJVmW_G.js → use-secrets-CJfkQ1kY.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-CM-eJHCl.js → use-status-sounds-D0RgrQqN.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-CIGO_mC0.js → use-view-mode-DN94zRym.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-BA-W1Vhc.js → use-virtual-mcp-C7J9vBIx.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-moOazGP7.js +1 -0
  211. package/dist/client/assets/{useRouterState-wqO08_go.js → useRouterState-iQdkmhiX.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-CoKhcfdG.js +1 -0
  213. package/dist/client/assets/{user-CctTJX2g.js → user-BPEhSyTs.js} +1 -1
  214. package/dist/client/assets/{view-mode-toggle-DvvzCaLm.js → view-mode-toggle-m2Gtbg0D.js} +1 -1
  215. package/dist/client/assets/workflow-detail-qHQDG7Ax.js +1 -0
  216. package/dist/client/assets/{workflow-CijEnEyN.js → workflow-y0X9IGbY.js} +1 -1
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +380 -380
  219. package/dist/server/server.js +244 -244
  220. package/package.json +1 -1
  221. package/dist/client/assets/app-editor-CNQX0fRz.js +0 -1
  222. package/dist/client/assets/page-seo-sheet-51vZvU9M.js +0 -1
  223. package/dist/client/assets/project-app-view-hOIqQC_C.js +0 -1
  224. package/dist/client/assets/record-editor-BrKRPPKj.js +0 -1
  225. package/dist/client/assets/registry-DKsLffG0.js +0 -2
  226. package/dist/client/assets/settings-layout-CBNchIFt.js +0 -1
  227. package/dist/client/assets/shell-route-loading-4HloIA9a.js +0 -1
  228. package/dist/client/assets/store-registry-Krrosx15.js +0 -2
  229. package/dist/client/assets/useInfiniteQuery-CNKhmBjK.js +0 -1
  230. package/dist/client/assets/useSuspenseInfiniteQuery-ojQaNUtI.js +0 -1
  231. package/dist/client/assets/workflow-detail-7ioCF-1N.js +0 -1
@@ -1 +1 @@
1
- import{aq as st,ar as me,as as it,at as nt,au as Ae,F as pe,av as rt,aw as ot,r as L,ax as lt,ay as at,az as ct,aA as dt,aB as je,aC as mt,aD as ut,aE as ft,e as $,j as i,q as V,c as K,l as Me,aF as xe,o as W,K as oe,n as le,a as ht,v as pt,E as xt,b as gt,B as we}from"./index-CM4eUM9Q.js";import{u as ge}from"./tooltip-c0JCK6eh.js";import{i as bt,u as ee,S as Le,g as yt}from"./constants-DVPpd9QA.js";import{a as vt,b as jt,v as wt,u as Nt}from"./use-virtual-mcp-BA-W1Vhc.js";import{i as St}from"./Check-BTi6aK2O.js";import{X as _t,A as Y,Z as Ct,r as Tt,c as Et}from"./agent-icon-B_Sssulg.js";import{s as be}from"./Plus-DTBFvoZ4.js";import{i as ze}from"./X-Ch1EyNal.js";import{u as kt,b as It,h as $t,C as ne}from"./agent-capabilities-qbK6YAO9.js";import{u as At,c as Mt}from"./chat-context-BmIMIbdZ.js";import{N as Lt}from"./agent-icons-D51AFvhI.js";import{u as Oe,a as re,K as Re,P as De,D as Pe,c as zt,S as Ot,v as Rt,b as Dt,C as Pt,s as Ht,d as Ut,e as Bt,f as Ft}from"./sortable.esm-DHLq9Pb_.js";import{u as He,a as Ue,o as Qt}from"./use-organization-settings-oXVZ3xqu.js";import{c as ye,u as Wt,h as qt}from"./shell-layout-iqX4bmcb.js";import{I as Kt}from"./input-DwZNdPHy.js";import{S as Xt}from"./scroll-area-DMpuHtIE.js";import{S as Gt,c as Vt,d as Zt,a as Jt,b as Yt}from"./sheet-CQuYX4pr.js";import{S as H}from"./skeleton-CaDhIMN5.js";import{t as Be}from"./ChevronDown-BZRrL23D.js";import{d as Fe}from"./ZoomOut-Dk_N18Ki.js";import{g as es,M as ts}from"./types-BqTbtprH.js";import{I as ss}from"./integration-icon-CBe2H1CK.js";import{u as is}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Qe,P as ns,e as rs,s as os,g as ls}from"./pair-BUKInYHO.js";import{a as as}from"./XCircle-BKXSa_VQ.js";import{g as cs}from"./use-mcp-prompts-zOwt9lRN.js";import{u as ds,w as ms}from"./tab-id-DvasrPZC.js";import{D as us,a as fs,b as hs,h as ps,c as Ne,d as xs}from"./dropdown-menu-Dp0AYb5Q.js";import{s as gs}from"./Trash01-4Ps74tkv.js";import{a as bs,u as ys}from"./use-ai-providers-ClrNZ9KV.js";import{a as vs}from"./toolbar-NS6fUdLE.js";import"./use-collections-BdrLE9lf.js";import"./AlertCircle-dzvWxujb.js";import"./Tool01-B6ELFGh-.js";import"./SwitchHorizontal01-Dc6vSFgX.js";import"./RefreshCcw01-BDUToMVd.js";import"./ArrowUpRight-CBMu0EOf.js";import"./ZapSquare-rvBlc1j-.js";import"./Users03-BkEliyJ2.js";import"./CheckCircle-C24wnP2Z.js";import"./ChevronLeft-DEtz4dkO.js";import"./ChevronRight-Ddjtetki.js";import"./ChevronUp-DhRFiyWk.js";import"./DotsVertical-DmUaYhK2.js";import"./Container-DqZ7iXxp.js";import"./Eye-D-e14RXi.js";import"./Globe01-D0-2dr7e.js";import"./FilterLines-Ceib5U8s.js";import"./Star01-CVzgxp1x.js";import"./Palette-C1AASxx2.js";import"./HardDrive-iB6HZdkm.js";import"./Stars02-XWO6H1Re.js";import"./Key01-DJjMsflU.js";import"./LayoutLeft-DC99mmKb.js";import"./LinkExternal01-BpZEkrD7.js";import"./Monitor01-C8q7RxXu.js";import"./Sun-CbEJ7xkn.js";import"./Play-BHXb_TUr.js";import"./SearchMd-CbQiai92.js";import"./Settings02-Bu96rwA_.js";import"./Shield01-knE-M4LE.js";import"./Stars01-CDWeKJ6M.js";import"./Upload01-CnrDySm1.js";import"./User01-BA7YwKC-.js";import"./Users01-DvcVTQ1g.js";import"./XClose-D_AWgVIk.js";import"./Zap-C_lJ1cEb.js";import"./spinner-d6yvFwOg.js";import"./dialog-zrSzj7TD.js";import"./drawer-BOKSr-JQ.js";import"./collection-search-DZy7ZGM2.js";import"./form-DwvvaWfd.js";import"./label-4oCFH30G.js";import"./select-DUB_e2wA.js";import"./tabs-Bo7dHK4T.js";import"./toggle-group-calkhzKZ.js";import"./connect-desktop-dialog-1K3-qmT6.js";import"./popover-pbPJblFP.js";import"./command-eY3hMYWt.js";import"./index-C6H2oubI.js";import"./useInfiniteQuery-CNKhmBjK.js";import"./infiniteQueryObserver-UgK429qS.js";import"./index-DZT3k4JB.js";import"./question-004-sINsf4GQ.js";import"./checkbox-BBA-baQg.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-O1JcTGgG.js";import"./settings-section-c0dyQilc.js";import"./card-fKzJiL4z.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BiKxhszY.js";import"./use-registry-connections-C77RjnzI.js";import"./use-connection-Bna7-Lpr.js";import"./extract-connection-data-DqaNlLEE.js";import"./generate-id-Lwmt2FKL.js";import"./collections-_mVHVGxv.js";import"./collection-tabs-BWubNGTM.js";import"./badge-BvUmM76z.js";import"./textarea-DHyB0Smt.js";import"./connection-form-helpers-qNlMv9lf.js";import"./use-infinite-scroll-BmCBqG2s.js";import"./useSuspenseInfiniteQuery-ojQaNUtI.js";import"./required-auth-layout-DHWUJ_wT.js";import"./useRouterState-wqO08_go.js";import"./use-org-sso-CM2A8YLV.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-9jbZNRel.js";import"./file-type-icon-BPZ9mx_j.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-CLGcl9A6.js";import"./decopilot-sse-pool-BSh6nGrY.js";import"./create-sse-subscription-BS5983N4.js";function Se(s,e){const t=new Set(e);return s.filter(r=>!t.has(r))}function js(s,e,t){const r=s.slice(0);return r[e]=t,r}var ws=class extends st{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(s,e,t){super(),this.#n=s,this.#i=t,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(s=>{s.subscribe(e=>{this.#f(s,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(s=>{s.destroy()})}setQueries(s,e){this.#r=s,this.#i=e,me.batch(()=>{const t=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),l=n.map(m=>m.getCurrentResult()),o=t.length!==n.length,c=n.some((m,u)=>m!==t[u]),a=o||c,d=a?!0:l.some((m,u)=>{const p=this.#e[u];return!p||!it(m,p)});!a&&!d||(a&&(this.#c=r,this.#t=n),this.#e=l,this.hasListeners()&&(a&&(Se(t,n).forEach(m=>{m.destroy()}),Se(n,t).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(s=>s.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(s,e){const t=this.#u(s),r=t.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),n=t.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>this.#m(l??r,e,n),()=>this.#d(r,t)]}#d(s,e){return e.map((t,r)=>{const n=s[r];return t.defaultedQueryOptions.notifyOnChangeProps?n:t.observer.trackResult(n,l=>{e.forEach(o=>{o.observer.trackProp(l)})})})}#m(s,e,t){if(e){const r=this.#a,n=t!==void 0&&r!==void 0&&(r.length!==t.length||t.some((l,o)=>l!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,t!==void 0&&(this.#a=t),this.#s=nt(this.#s,e(s))),this.#s}return s}#p(){return this.#i?.combine!==void 0&&this.#t.some((s,e)=>s.options.suspense&&this.#e[e]?.data===void 0)}#u(s){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const l=e.get(n);l?l.push(r):e.set(n,[r])});const t=[];return s.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ae(this.#n,n);t.push({defaultedQueryOptions:n,observer:o})}),t}#f(s,e){const t=this.#t.indexOf(s);t!==-1&&(this.#e=js(this.#e,t,e),this.#h())}#h(){if(this.hasListeners()){const s=this.#d(this.#e,this.#c),e=this.#p(),t=this.#s,r=e?t:this.#m(s,this.#i?.combine);(e||t!==r)&&me.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function Ns({queries:s,...e},t){const r=pe(t),n=rt(),l=ot(),o=L.useMemo(()=>s.map(x=>{const f=r.defaultQueryOptions(x);return f._optimisticResults=n?"isRestoring":"optimistic",f}),[s,r,n]);o.forEach(x=>{lt(x);const f=r.getQueryCache().get(x.queryHash);at(x,l,f)}),ct(l);const[c]=L.useState(()=>new ws(r,o,e)),[a,d,m]=c.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;L.useSyncExternalStore(L.useCallback(x=>u?c.subscribe(me.batchCalls(x)):dt,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),L.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const g=a.some((x,f)=>je(o[f],x))?a.flatMap((x,f)=>{const h=o[f];if(h&&je(h,x)){const y=new Ae(r,h);return mt(h,y,l)}return[]}):[];if(g.length>0)throw Promise.all(g);const b=a.find((x,f)=>{const h=o[f];return h&&ut({result:x,errorResetBoundary:l,throwOnError:h.throwOnError,query:r.getQueryCache().get(h.queryHash),suspense:h.suspense})});if(b?.error)throw b.error;return d(m())}function Ss(s,e){return Ns({...s,queries:s.queries.map(t=>({...t,suspense:!0,throwOnError:ft,enabled:!0,placeholderData:void 0}))},e)}const te=8;function _s(s){const e=$.c(16),{open:t,onOpenChange:r}=s,[n,l]=L.useState("");let o,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Gt,{children:"Manage home"}),c=i.jsx(Vt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=c):(o=e[0],c=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(_t,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=x=>l(x.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Zt,{className:"px-5 py-4 border-b border-border",children:[o,c,i.jsxs("div",{className:"relative mt-3",children:[a,i.jsx(Kt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Ys,{}),e[6]=u):u=e[6];let p;e[7]!==n?(p=i.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(L.Suspense,{fallback:u,children:i.jsx(Ts,{search:n})})})}),e[7]=n,e[8]=p):p=e[8];let g;e[9]!==m||e[10]!==p?(g=i.jsxs(Jt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,p]}),e[9]=m,e[10]=p,e[11]=g):g=e[11];let b;return e[12]!==r||e[13]!==t||e[14]!==g?(b=i.jsx(Yt,{open:t,onOpenChange:r,children:g}),e[12]=r,e[13]=t,e[14]=g,e[15]=b):b=e[15],b}function Cs(s){const e=$.c(32),{org:t}=V(),r=He();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const l=n,o=Ue(),c=jt(),a=pe();let d;e[2]!==t||e[3]!==a?(d=()=>a.refetchQueries({queryKey:oe.homeNextActions(t.slug),type:"active"}),e[2]=t,e[3]=a,e[4]=d):d=e[4];const m=d;let u;e[5]!==l?(u=S=>l.includes(S),e[5]=l,e[6]=u):u=e[6];const p=u;let g;e[7]!==l||e[8]!==s?(g=s?l.filter(S=>s.has(S)).length:l.length,e[7]=l,e[8]=s,e[9]=g):g=e[9];const x=g>=te;let f;e[10]!==x||e[11]!==p||e[12]!==o?(f=S=>p(S)||x?Promise.resolve():o.apply(E=>E.includes(S)?null:[...E,S]),e[10]=x,e[11]=p,e[12]=o,e[13]=f):f=e[13];const h=f;let y;e[14]!==o?(y=S=>o.apply(E=>E.filter(k=>k!==S)),e[14]=o,e[15]=y):y=e[15];const w=y;let v;e[16]!==o?(v=S=>o.apply(()=>S),e[16]=o,e[17]=v):v=e[17];const j=v;let N;e[18]!==c||e[19]!==x||e[20]!==p||e[21]!==m||e[22]!==o?(N=async(S,E)=>{await c.update.mutateAsync({id:S.id,data:{metadata:E}}),!p(S.id)&&!x&&await o.apply(k=>k.includes(S.id)?null:[...k,S.id]),await m()},e[18]=c,e[19]=x,e[20]=p,e[21]=m,e[22]=o,e[23]=N):N=e[23];const _=N;let T;return e[24]!==h||e[25]!==x||e[26]!==l||e[27]!==p||e[28]!==w||e[29]!==j||e[30]!==_?(T={homeIds:l,isOnHome:p,atLimit:x,addAgent:h,removeAgent:w,reorder:j,saveAgentMetadata:_},e[24]=h,e[25]=x,e[26]=l,e[27]=p,e[28]=w,e[29]=j,e[30]=_,e[31]=T):T=e[31],T}function Ts(s){const e=$.c(21),{search:t}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=vt(r);let l;e[1]!==n?(l=new Set(n.map(As)),e[1]=n,e[2]=l):l=e[2];const o=Cs(l);let c,a,d;if(e[3]!==n||e[4]!==o||e[5]!==t){const x=new Map(n.map($s));c=t.trim().toLowerCase();const f=y=>!c||y.title?.toLowerCase().includes(c);a=o.homeIds.map(y=>x.get(y)).filter(Is).filter(f);let h;e[9]!==o?(h=y=>!o.isOnHome(y.id),e[9]=o,e[10]=h):h=e[10],d=n.filter(ks).filter(h).filter(f).sort(Es),e[3]=n,e[4]=o,e[5]=t,e[6]=c,e[7]=a,e[8]=d}else c=e[6],a=e[7],d=e[8];const m=d;let u;e[11]!==o||e[12]!==a?(u=i.jsx(Ms,{home:o,agents:a}),e[11]=o,e[12]=a,e[13]=u):u=e[13];const p=!!c;let g;e[14]!==m||e[15]!==o||e[16]!==p?(g=i.jsx(Os,{home:o,agents:m,hasSearch:p}),e[14]=m,e[15]=o,e[16]=p,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=i.jsxs(i.Fragment,{children:[u,g]}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}function Es(s,e){return(s.title??"").localeCompare(e.title??"")}function ks(s){return s.id&&!bt(s.id)}function Is(s){return!!s}function $s(s){return[s.id,s]}function As(s){return s.id}function We(s){const e=$.c(7),{title:t,hint:r}=s;let n;e[0]!==t?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t}),e[0]=t,e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let o;return e[4]!==n||e[5]!==l?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,l]}),e[4]=n,e[5]=l,e[6]=o):o=e[6],o}function Ms(s){const e=$.c(14),{home:t,agents:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={coordinateGetter:Ht},e[1]=l):l=e[1];const o=Oe(re(De,n),re(Re,l));let c;e[2]!==t?(c=g=>{const{active:b,over:x}=g;if(!x||b.id===x.id)return;const f=t.homeIds,h=f.indexOf(b.id),y=f.indexOf(x.id);h===-1||y===-1||t.reorder(Ut([...f],h,y)).catch(zs)},e[2]=t,e[3]=c):c=e[3];const a=c,d=`${t.homeIds.length}/${te}`;let m;e[4]!==d?(m=i.jsx(We,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==t||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(Pe,{sensors:o,collisionDetection:zt,onDragEnd:a,children:i.jsx(Ot,{items:r.map(Ls),strategy:Rt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(g=>i.jsx(Ds,{agent:g,home:t},g.id))})})}),e[6]=r,e[7]=a,e[8]=t,e[9]=o,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function Ls(s){return s.id}function zs(){return W.error("Couldn't reorder home — please try again.")}function Os(s){const e=$.c(6),{home:t,agents:r,hasSearch:n}=s,[l,o]=L.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==t||e[3]!==l){const a=r.slice(0,l);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(We,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:a.map(m=>i.jsx(Us,{agent:m,home:t},m.id))}),r.length>l&&i.jsxs("button",{type:"button",onClick:()=>o(Rs),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-l,")"]})]})]}),e[0]=r,e[1]=n,e[2]=t,e[3]=l,e[4]=c}else c=e[4];return c}function Rs(s){return s+20}function qe(s){const e=xe(s.metadata?.ui).filter(l=>!!l.resourceUri).length,t=s.metadata?.ui?.homePrompts,r=Array.isArray(t)?t.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Ds(s){const e=$.c(57),{agent:t,home:r}=s,[n,l]=L.useState(!1);let o;e[0]!==t.id?(o={id:t.id},e[0]=t.id,e[1]=o):o=e[1];const{attributes:c,listeners:a,setNodeRef:d,transform:m,transition:u,isDragging:p}=Dt(o),g=qe(t)||"Quick access";let b;e[2]!==m?(b=Pt.Transform.toString(m),e[2]=m,e[3]=b):b=e[3];const x=p?.5:void 0,f=p?100:void 0;let h;e[4]!==b||e[5]!==x||e[6]!==f||e[7]!==u?(h={transform:b,transition:u,opacity:x,zIndex:f},e[4]=b,e[5]=x,e[6]=f,e[7]=u,e[8]=h):h=e[8];const y=h,w=p&&"shadow-lg";let v;e[9]!==w?(v=K("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const j=`Drag to reorder ${t.title??t.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Fe,{size:14}),e[11]=N):N=e[11];let _;e[12]!==c||e[13]!==a||e[14]!==j?(_=i.jsx("button",{type:"button",...c,...a,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":j,children:N}),e[12]=c,e[13]=a,e[14]=j,e[15]=_):_=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>l(Hs),e[16]=T):T=e[16];const S=t.title??t.id;let E;e[17]!==t.icon||e[18]!==S?(E=i.jsx(Y,{icon:t.icon,name:S,size:"sm"}),e[17]=t.icon,e[18]=S,e[19]=E):E=e[19];const k=t.title??t.id;let C;e[20]!==k?(C=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:k}),e[20]=k,e[21]=C):C=e[21];let I;e[22]!==g?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:g}),e[22]=g,e[23]=I):I=e[23];let A;e[24]!==C||e[25]!==I?(A=i.jsxs("div",{className:"min-w-0 flex-1",children:[C,I]}),e[24]=C,e[25]=I,e[26]=A):A=e[26];const D=n&&"rotate-180";let z;e[27]!==D?(z=K("shrink-0 text-muted-foreground transition-transform",D),e[27]=D,e[28]=z):z=e[28];let O;e[29]!==z?(O=i.jsx(Be,{size:16,className:z}),e[29]=z,e[30]=O):O=e[30];let Q;e[31]!==n||e[32]!==E||e[33]!==A||e[34]!==O?(Q=i.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[E,A,O]}),e[31]=n,e[32]=E,e[33]=A,e[34]=O,e[35]=Q):Q=e[35];let M;e[36]!==t.id||e[37]!==r?(M=()=>r.removeAgent(t.id).catch(Ps),e[36]=t.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${t.title??t.id} from home`;let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(ze,{size:14}),e[39]=P):P=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:P}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let U;e[43]!==_||e[44]!==Q||e[45]!==R?(U=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[_,Q,R]}),e[43]=_,e[44]=Q,e[45]=R,e[46]=U):U=e[46];let B;e[47]!==t||e[48]!==n||e[49]!==r?(B=n&&i.jsx(Ke,{agent:t,home:r}),e[47]=t,e[48]=n,e[49]=r,e[50]=B):B=e[50];let q;return e[51]!==d||e[52]!==y||e[53]!==U||e[54]!==B||e[55]!==v?(q=i.jsxs("div",{ref:d,style:y,className:v,children:[U,B]}),e[51]=d,e[52]=y,e[53]=U,e[54]=B,e[55]=v,e[56]=q):q=e[56],q}function Ps(){return W.error("Couldn't remove from home — please try again.")}function Hs(s){return!s}function Us({agent:s,home:e}){const[t,r]=L.useState(!1),[n,l]=L.useState(!1),o=qe(s),c=async()=>{if(!e.atLimit){l(!0);try{await e.addAgent(s.id)}catch{W.error("Couldn't add to home — please try again.")}finally{l(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":t,children:[i.jsx(Y,{icon:s.icon,name:s.title??s.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.title??s.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(Be,{size:16,className:K("shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:n?i.jsx(Me,{size:12,className:"animate-spin"}):i.jsx(be,{size:14})})]}),t&&i.jsx(Ke,{agent:s,home:e})]})}function Ke(s){const e=$.c(26),{agent:t,home:r}=s;let n,l,o,c,a,d,m;if(e[0]!==t||e[1]!==r){const f=xe(t.metadata?.ui);let h;e[9]!==t.connections?(h=(t.connections??[]).map(Fs).sort(),e[9]=t.connections,e[10]=h):h=e[10];const y=h;l=t.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Ws,o=t,c=r,a=y,d=new Set(f.map(Bs)),e[0]=t,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c,e[6]=a,e[7]=d,e[8]=m}else n=e[2],l=e[3],o=e[4],c=e[5],a=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==d?(u=i.jsx(n,{agent:o,home:c,connectionIds:a,pinnedResourceUris:d}),e[11]=n,e[12]=o,e[13]=c,e[14]=a,e[15]=d,e[16]=u):u=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Qs,{}),e[17]=p):p=e[17];const g=l??null;let b;e[18]!==t||e[19]!==r||e[20]!==g?(b=i.jsx(L.Suspense,{fallback:p,children:i.jsx(Ks,{agent:t,home:r,curated:g})}),e[18]=t,e[19]=r,e[20]=g,e[21]=b):b=e[21];let x;return e[22]!==m||e[23]!==u||e[24]!==b?(x=i.jsxs("div",{className:m,children:[u,b]}),e[22]=m,e[23]=u,e[24]=b,e[25]=x):x=e[25],x}function Bs(s){return s.resourceUri}function Fs(s){return s.connection_id}function Qs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),s[0]=e):e=s[0],e}function Ws({agent:s,home:e,connectionIds:t,pinnedResourceUris:r}){const{org:n}=V(),l=ee({connectionId:Le,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:c}=le({queryKey:oe.projectConnectionDetails(s.id,t),enabled:t.length>0,queryFn:async()=>(await Promise.all(t.map(async d=>{try{const m=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),{item:u}=is(m),p=(u?.tools??[]).flatMap(g=>{const b=es(g._meta);return b?[{name:g.name,description:g.description,resourceUri:b}]:[]});return{id:d,title:u?.title??d,icon:u?.icon??null,uiTools:p}}catch{return{id:d,title:d,icon:null,uiTools:[]}}}))).filter(d=>d.uiTools.length>0)});return t.length===0?null:c?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(a=>a.uiTools.map(d=>i.jsx(qs,{agent:s,home:e,connection:a,tool:d,isPinned:r.has(d.resourceUri)},`${a.id}:${d.name}`)))})}function qs({agent:s,home:e,connection:t,tool:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=xe(s.metadata?.ui),d=n?a.filter(u=>u.resourceUri!==r.resourceUri):[...a,{connectionId:t.id,resourceUri:r.resourceUri}],m={...s.metadata??{},ui:{...s.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle tile",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(ss,{icon:t.icon,name:t.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Qe(r.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Xe(s){const e=$.c(11),{isPinned:t,submitting:r,onClick:n,label:l}=s,o=t?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==o?(c=K("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==r?(a=r?i.jsx(Me,{size:12,className:"animate-spin"}):t?i.jsx(Ct,{size:14}):i.jsx(be,{size:14}),e[2]=t,e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==a?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":l,title:l,className:c,children:a}),e[5]=l,e[6]=n,e[7]=r,e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Ks(s){const e=$.c(32),{agent:t,home:r,curated:n}=s,{org:l}=V();let o;e[0]!==t.id||e[1]!==l.id||e[2]!==l.slug?(o={connectionId:t.id,orgId:l.id,orgSlug:l.slug},e[0]=t.id,e[1]=l.id,e[2]=l.slug,e[3]=o):o=e[3];const c=ee(o);let a;e[4]!==t.id||e[5]!==l.id?(a=oe.agentPrompts(l.id,t.id),e[4]=t.id,e[5]=l.id,e[6]=a):a=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Zs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==a||e[10]!==d?(m={queryKey:a,queryFn:d,staleTime:3e4,retry:!1},e[9]=a,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:p,error:g}=le(m),b=ye(l.slug);let x,f;if(e[12]!==t.id||e[13]!==u||e[14]!==b.prompts){let j;e[17]!==t.id?(j=_=>_.agentId===t.id&&_.promptName,e[17]=t.id,e[18]=j):j=e[18],x=b.prompts.filter(j).map(Vs);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],f=[...N];for(const _ of x)f.some(T=>T.name===_.name)||f.push(_);e[12]=t.id,e[13]=u,e[14]=b.prompts,e[15]=x,e[16]=f}else x=e[15],f=e[16];if(p&&x.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(g&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",t.id,g),null;if(f.length===0)return null;let h;e[22]!==n||e[23]!==f?(h=n??f.map(Gs),e[22]=n,e[23]=f,e[24]=h):h=e[24];let y;e[25]!==h?(y=new Set(h),e[25]=h,e[26]=y):y=e[26];const w=y;let v;return e[27]!==t||e[28]!==r||e[29]!==f||e[30]!==w?(v=i.jsx("div",{className:"flex flex-col gap-0.5",children:f.map(j=>i.jsx(Js,{agent:t,home:r,prompt:j,allPromptNames:f.map(Xs),isPinned:w.has(j.name)},j.name))}),e[27]=t,e[28]=r,e[29]=f,e[30]=w,e[31]=v):v=e[31],v}function Xs(s){return s.name}function Gs(s){return s.name}function Vs(s){return{name:s.promptName,title:s.title,description:s.description}}function Zs(s){return{name:s.name,title:s.title,description:s.description}}function Js({agent:s,home:e,prompt:t,allPromptNames:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=s.metadata?.ui?.homePrompts;let d;Array.isArray(a)?d=n?a.filter(u=>u!==t.name):[...a,t.name]:d=n?r.filter(u=>u!==t.name):r;const m={...s.metadata??{},ui:{...s.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:t.title??Qe(t.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Ys(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},ei)}),s[0]=e):e=s[0],e}function ei(s,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const J=1,Ge=`home-board.layout.v${J}`;function Ve(s){return`home-board.layout.v${J}.${s}`}const Ze={version:J,tiles:{},hidden:[]};function ue(s){return!s||s.version!==J?Ze:{version:J,tiles:s.tiles??{},hidden:Array.isArray(s.hidden)?s.hidden:[]}}function ti(s){return Object.keys(s.tiles).length>0||s.hidden.length>0}function si(s){try{const e=localStorage.getItem(Ve(s));return e?ue(JSON.parse(e)):void 0}catch{return}}function _e(s,e){try{localStorage.setItem(Ve(s),JSON.stringify(e))}catch{}}async function Ce(s,e){if(!(await fetch(`/api/${s}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ii(s){const e=$.c(24),t=pe();let r;e[0]!==s?(r=oe.boardLayout(s),e[0]=s,e[1]=r):r=e[1];const n=r;let l;e[2]!==s?(l=si(s),e[2]=s,e[3]=l):l=e[3];const o=l;let c;e[4]!==o||e[5]!==s?(c=async()=>{const h=await fetch(`/api/${s}/kv/${Ge}`);if(h.status===404)return o&&ti(o)?(await Ce(s,o),o):Ze;if(!h.ok)throw new Error("Failed to load board layout");const y=await h.json(),w=ue(y.value);return _e(s,w),w},e[4]=o,e[5]=s,e[6]=c):c=e[6];let a;e[7]!==o||e[8]!==n||e[9]!==c?(a={queryKey:n,queryFn:c,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=c,e[10]=a):a=e[10];const{data:d,isLoading:m}=le(a);let u;e[11]!==s?(u={mutationFn:h=>Ce(s,h)},e[11]=s,e[12]=u):u=e[12];const p=ht(u);let g;e[13]!==p||e[14]!==s||e[15]!==t||e[16]!==n?(g=h=>{_e(s,h),t.setQueryData(n,h),p.mutate(h)},e[13]=p,e[14]=s,e[15]=t,e[16]=n,e[17]=g):g=e[17];const b=g;let x;e[18]!==d?(x=ue(d),e[18]=d,e[19]=x):x=e[19];let f;return e[20]!==m||e[21]!==b||e[22]!==x?(f={layout:x,isLoading:m,save:b},e[20]=m,e[21]=b,e[22]=x,e[23]=f):f=e[23],f}const Je=L.createContext(null);function ni(s){const e=$.c(24),{children:t}=s,{org:r}=V(),n=ii(r.slug),[l,o]=L.useState(!1),[c,a]=L.useState(null);let d;e[0]!==n.layout?(d=()=>{a(n.layout),o(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),o(!1)},e[2]=u):u=e[2];const p=u;let g;e[3]!==c||e[4]!==n?(g=()=>{c&&n.save(c),a(null),o(!1)},e[3]=c,e[4]=n,e[5]=g):g=e[5];const b=g,x=l&&c!==null,f=x?c:n.layout;let h;e[6]!==c||e[7]!==x||e[8]!==n.layout?(h=x?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=x,e[8]=n.layout,e[9]=h):h=e[9];const y=h;let w;e[10]!==l||e[11]!==n?(w=_=>{l?a(_):n.save(_)},e[10]=l,e[11]=n,e[12]=w):w=e[12];const v=w;let j;e[13]!==v||e[14]!==m||e[15]!==y||e[16]!==l||e[17]!==f||e[18]!==b||e[19]!==n.isLoading?(j={isEditMode:l,enter:m,cancel:p,save:b,hasChanges:y,layout:f,isLayoutLoading:n.isLoading,commitLayout:v},e[13]=v,e[14]=m,e[15]=y,e[16]=l,e[17]=f,e[18]=b,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==t||e[22]!==j?(N=i.jsx(Je.Provider,{value:j,children:t}),e[21]=t,e[22]=j,e[23]=N):N=e[23],N}function Ye(){const s=L.useContext(Je);if(!s)throw new Error("useHomeEdit must be used within a HomeEditProvider");return s}function ri({agentId:s}){const{org:e,locator:t}=V(),r=ee({connectionId:s,orgId:e.id,orgSlug:e.slug}),{create:n}=ds(),{setTaskId:l}=Wt(),[o,c]=L.useState(null),[a,d]=L.useState(!1),m=L.useRef(!1),u=async(f,h)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const y=await cs(r,f.name,h),w={type:"doc",content:[{type:"paragraph",content:[rs({id:f.name,name:os(f.name,ls(f._meta)),metadata:y.messages,char:"/",kind:"prompt",args:h}),{type:"text",text:" "}]}]},v=crypto.randomUUID();ms(sessionStorage,t,v,{tiptapDoc:w}),await n({id:v,virtual_mcp_id:s}),l(v,s,{autosend:!0})}catch(y){console.error("[start-thread-from-prompt] failed",y),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},p=async f=>{if(!m.current){if(f.arguments&&f.arguments.length>0){c(f);return}await u(f)}},g=async f=>{if(!o)return;const h=o;c(null),await u(h,f)};return{start:p,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const f=crypto.randomUUID();await n({id:f,virtual_mcp_id:s}),l(f,s)}catch(f){console.error("[start-thread-from-prompt] startBlank failed",f),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ns,{prompt:o,setPrompt:f=>c(f),onSubmit:g}),dialogPrompt:o,starting:a}}const G=4,X=100,Te=12,ie={S:{w:1,h:1},M:{w:1,h:2},T:{w:1,h:3},L:{w:2,h:1},XL:{w:2,h:2},LT:{w:2,h:3},XLT:{w:2,h:4},XXLT:{w:2,h:5},W:{w:4,h:1},WT:{w:4,h:3}},oi={S:"Small",M:"Tall",T:"Column",L:"Wide",XL:"Large",LT:"Showcase",XLT:"Display",XXLT:"Tower",W:"Full width",WT:"Hero"},Ee=["S","M","T","L","XL","LT","XLT","XXLT","W","WT"],li=ie.XL;class fe extends L.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,t){console.error("[home-tiles] tile crashed:",e,t.componentStack)}render(){return this.state.hasError?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(pt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function ai(s){const e=$.c(72),{tiles:t,isEditMode:r,renderTile:n,onMove:l,onResize:o,onRemove:c}=s,a=ge(),d=L.useRef(null),[m,u]=L.useState(null),[p,g]=L.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={activationConstraint:{distance:4}},e[0]=b):b=e[0];const x=Oe(re(De,b),re(Re)),f=t.reduce(ci,0),h=r?Math.max(f+2,4):Math.max(f,1);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/G,cellHeight:X}:null},e[1]=y):y=e[1];const w=y;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=M=>{u(String(M.active.id)),g(w())},e[2]=v):v=e[2];const j=v;let N;e[3]!==p||e[4]!==l||e[5]!==t?(N=M=>{const F=String(M.active.id),P=p??w();if(u(null),g(null),!P||P.cellWidth<=0)return;const R=t.find(q=>q.id===F);if(!R)return;const U=Math.round(M.delta.x/P.cellWidth),B=Math.round(M.delta.y/P.cellHeight);U===0&&B===0||l(F,{x:R.x+U,y:R.y+B})},e[3]=p,e[4]=l,e[5]=t,e[6]=N):N=e[6];const _=N;if(a){let M;if(e[7]!==n||e[8]!==t){let P;e[10]!==n?(P=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:X},children:i.jsx(fe,{children:n(R)})},R.id),e[10]=n,e[11]=P):P=e[11],M=t.map(P),e[7]=n,e[8]=t,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let T,S,E,k,C,I,A,D,z;if(e[14]!==m||e[15]!==p||e[16]!==r||e[17]!==_||e[18]!==c||e[19]!==o||e[20]!==n||e[21]!==x||e[22]!==t||e[23]!==h){const M=m?t.find(Z=>Z.id===m):null;S=Pe,D=x,z=j,E=_;const F=h*X,P=r?X*4:X;let R;e[33]!==F||e[34]!==P?(R={height:F,minHeight:P},e[33]=F,e[34]=P,e[35]=R):R=e[35];let U;e[36]!==r||e[37]!==t||e[38]!==h?(U=r&&i.jsx(di,{rows:h,tiles:t}),e[36]=r,e[37]=t,e[38]=h,e[39]=U):U=e[39];let B;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==o||e[44]!==n||e[45]!==t){let Z;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==o||e[51]!==n?(Z=se=>i.jsx(ui,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:c,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=c,e[50]=o,e[51]=n,e[52]=Z):Z=e[52],B=t.map(Z),e[40]=m,e[41]=r,e[42]=c,e[43]=o,e[44]=n,e[45]=t,e[46]=B}else B=e[46];e[53]!==R||e[54]!==U||e[55]!==B?(k=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[U,B]}),e[53]=R,e[54]=U,e[55]=B,e[56]=k):k=e[56],T=Bt,C=null;const q=M&&p?M.w*p.cellWidth-Te:void 0,ae=M&&p?M.h*p.cellHeight-Te:void 0;e[57]!==q||e[58]!==ae?(I={width:q,height:ae},e[57]=q,e[58]=ae,e[59]=I):I=e[59],A=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(fe,{children:n(M)})}),e[14]=m,e[15]=p,e[16]=r,e[17]=_,e[18]=c,e[19]=o,e[20]=n,e[21]=x,e[22]=t,e[23]=h,e[24]=T,e[25]=S,e[26]=E,e[27]=k,e[28]=C,e[29]=I,e[30]=A,e[31]=D,e[32]=z}else T=e[24],S=e[25],E=e[26],k=e[27],C=e[28],I=e[29],A=e[30],D=e[31],z=e[32];let O;e[60]!==T||e[61]!==C||e[62]!==I||e[63]!==A?(O=i.jsx(T,{dropAnimation:C,style:I,children:A}),e[60]=T,e[61]=C,e[62]=I,e[63]=A,e[64]=O):O=e[64];let Q;return e[65]!==S||e[66]!==E||e[67]!==k||e[68]!==O||e[69]!==D||e[70]!==z?(Q=i.jsxs(S,{sensors:D,onDragStart:z,onDragEnd:E,children:[k,O]}),e[65]=S,e[66]=E,e[67]=k,e[68]=O,e[69]=D,e[70]=z,e[71]=Q):Q=e[71],Q}function ci(s,e){return Math.max(s,e.y+e.h)}function di(s){const e=$.c(7),{rows:t,tiles:r}=s;let n;e[0]!==r?(n=(a,d)=>r.some(m=>a>=m.x&&a<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const l=n;let o;if(e[2]!==l||e[3]!==t){o=[];for(let a=0;a<t;a++)for(let d=0;d<G;d++)l(d,a)||o.push({x:d,y:a});e[2]=l,e[3]=t,e[4]=o}else o=e[4];let c;return e[5]!==o?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(mi)}),e[5]=o,e[6]=c):c=e[6],c}function mi(s){return i.jsx("div",{className:"absolute p-1",style:{left:`${s.x/G*100}%`,top:s.y*X,width:`${1/G*100}%`,height:X},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${s.x}-${s.y}`)}function ui(s){const e=$.c(31),{tile:t,isEditMode:r,isDragging:n,onResize:l,onRemove:o,children:c}=s,a=!r;let d;e[0]!==a||e[1]!==t.id?(d={id:t.id,disabled:a},e[0]=a,e[1]=t.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:p,isDragging:g}=Ft(d),b=`${t.x/G*100}%`,x=`${t.w/G*100}%`,f=t.y*X,h=t.h*X,y=g||n,w=!y&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=y&&"opacity-30";let j;e[3]!==w||e[4]!==v?(j=K("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=j):j=e[5];let N;e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x?(N={left:b,top:f,width:x,height:h},e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=N):N=e[10];const _=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==_?(T=K("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",_),e[11]=_,e[12]=T):T=e[12];let S;e[13]!==u||e[14]!==r||e[15]!==p||e[16]!==o||e[17]!==l||e[18]!==t?(S=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...p,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:i.jsx(Fe,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(fi,{tile:t,onResize:l,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=p,e[16]=o,e[17]=l,e[18]=t,e[19]=S):S=e[19];let E;e[20]!==c?(E=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(fe,{children:c})}),e[20]=c,e[21]=E):E=e[21];let k;e[22]!==E||e[23]!==T||e[24]!==S?(k=i.jsxs("div",{className:T,children:[S,E]}),e[22]=E,e[23]=T,e[24]=S,e[25]=k):k=e[25];let C;return e[26]!==m||e[27]!==k||e[28]!==j||e[29]!==N?(C=i.jsx("div",{ref:m,className:j,style:N,children:k}),e[26]=m,e[27]=k,e[28]=j,e[29]=N,e[30]=C):C=e[30],C}function fi(s){const e=$.c(43),{tile:t,onResize:r,onRemove:n}=s,l=t.minW??1,o=t.minH??1;let c,a,d,m,u,p,g;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==t.h||e[4]!==t.id||e[5]!==t.w){let v;e[13]!==o||e[14]!==l?(v=S=>{const E=ie[S];return E.w>=l&&E.h>=o},e[13]=o,e[14]=l,e[15]=v):v=e[15];const j=Ee.filter(v);let N;e[16]!==t.h||e[17]!==t.w?(N=(()=>{for(const E of Ee){const k=ie[E];if(k.w===t.w&&k.h===t.h)return E}return null})(),e[16]=t.h,e[17]=t.w,e[18]=N):N=e[18];const _=N;a=us,e[19]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(fs,{asChild:!0,children:i.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:i.jsx(Tt,{size:16})})}),e[19]=g):g=e[19],c=hs,d="end",m="w-44",e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ps,{children:"Size"}),e[20]=u):u=e[20];let T;e[21]!==_||e[22]!==r||e[23]!==t.id?(T=S=>{const E=ie[S];return i.jsxs(Ne,{onSelect:()=>r(t.id,E),className:"flex items-center justify-between",children:[i.jsx("span",{children:oi[S]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:_===S?"✓":`${E.w}×${E.h}`})]},S)},e[21]=_,e[22]=r,e[23]=t.id,e[24]=T):T=e[24],p=j.map(T),e[0]=o,e[1]=l,e[2]=r,e[3]=t.h,e[4]=t.id,e[5]=t.w,e[6]=c,e[7]=a,e[8]=d,e[9]=m,e[10]=u,e[11]=p,e[12]=g}else c=e[6],a=e[7],d=e[8],m=e[9],u=e[10],p=e[11],g=e[12];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(xs,{}),e[25]=b):b=e[25];let x;e[26]!==n||e[27]!==t.id?(x=()=>n(t.id),e[26]=n,e[27]=t.id,e[28]=x):x=e[28];let f;e[29]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(gs,{size:14,className:"mr-2"}),e[29]=f):f=e[29];let h;e[30]!==x?(h=i.jsxs(Ne,{onSelect:x,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[30]=x,e[31]=h):h=e[31];let y;e[32]!==c||e[33]!==d||e[34]!==m||e[35]!==u||e[36]!==p||e[37]!==h?(y=i.jsxs(c,{align:d,className:m,children:[u,p,b,h]}),e[32]=c,e[33]=d,e[34]=m,e[35]=u,e[36]=p,e[37]=h,e[38]=y):y=e[38];let w;return e[39]!==a||e[40]!==y||e[41]!==g?(w=i.jsxs(a,{children:[g,y]}),e[39]=a,e[40]=y,e[41]=g,e[42]=w):w=e[42],w}function hi(s,e,t){return s.some(r=>e>=r.x&&e<r.x+r.w&&t>=r.y&&t<r.y+r.h)}function he(s,e,t){for(let r=0;r<100;r++)for(let n=0;n<=G-e;n++){let l=!0;for(let o=0;o<t&&l;o++)for(let c=0;c<e&&l;c++)hi(s,n+c,r+o)&&(l=!1);if(l)return{x:n,y:r}}return{x:0,y:0}}function ce(s,e,t={w:1,h:1}){const r=Math.max(t.w,Math.min(G,s)),n=Math.max(t.h,Math.min(6,e));return{w:r,h:n}}function de(s,e,t){const r=Math.max(0,Math.min(G-t,s)),n=Math.max(0,e);return{x:r,y:n}}function pi(s,e,t){const r=s.find(a=>a.id===e);if(!r)return s;const n=s.filter(a=>a.id!==e),l=n.find(a=>t.x>=a.x&&t.x<a.x+a.w&&t.y>=a.y&&t.y<a.y+a.h);if(l&&l.w===r.w&&l.h===r.h)return s.map(a=>a.id===e?{...a,x:l.x,y:l.y}:a.id===l.id?{...a,x:r.x,y:r.y}:a);const c=[{...r,x:t.x,y:t.y}];for(const a of n){const d=he(c,a.w,a.h);c.push({...a,x:d.x,y:d.y})}return c}function xi(s){const e=$.c(35),{layout:t,isLayoutLoading:r,commitLayout:n}=Ye();let l;e[0]!==t.hidden?(l=new Set(t.hidden),e[0]=t.hidden,e[1]=l):l=e[1];const o=l;let c,a;if(e[2]!==s||e[3]!==o||e[4]!==t.tiles){a=[];let y;e[7]!==o?(y=v=>v.pinned||!o.has(v.id),e[7]=o,e[8]=y):y=e[8];const w=s.filter(y);c=new Map;for(const v of s)v.minSize&&c.set(v.id,v.minSize);for(const v of w){const j=t.tiles[v.id];if(!j)continue;const N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),{x:S,y:E}=de(j.x,j.y,_);a.push({id:v.id,x:S,y:E,w:_,h:T,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(E=>E.id===v.id))continue;const j=v.defaultSize??li,N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),S=he(a,_,T);a.push({id:v.id,x:S.x,y:S.y,w:_,h:T,minW:N?.w,minH:N?.h})}e[2]=s,e[3]=o,e[4]=t.tiles,e[5]=c,e[6]=a}else c=e[5],a=e[6];let d;e[9]!==s?(d=new Set(s.map(gi)),e[9]=s,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(y,w)=>{const v={};for(const j of y)v[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:J,tiles:v,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const p=u;let g;e[14]!==a?(g={visible:a},e[14]=a,e[15]=g):g=e[15];let b;e[16]!==p||e[17]!==t||e[18]!==a?(b=(y,w)=>{const v=a.find(_=>_.id===y);if(!v)return;const j=de(w.x,w.y,v.w);if(j.x===v.x&&j.y===v.y)return;const N=pi(a,y,j);p(N,t.hidden)},e[16]=p,e[17]=t,e[18]=a,e[19]=b):b=e[19];let x;e[20]!==p||e[21]!==t||e[22]!==c||e[23]!==a?(x=(y,w)=>{const v=a.find(k=>k.id===y);if(!v)return;const j=c.get(y),{w:N,h:_}=ce(w.w,w.h,j);if(N===v.w&&_===v.h)return;const T={...v,w:N,h:_,x:de(v.x,v.y,N).x},S=a.filter(k=>k.id!==y),E=[T];for(const k of S){const C=he(E,k.w,k.h);E.push({...k,x:C.x,y:C.y})}p(E,t.hidden)},e[20]=p,e[21]=t,e[22]=c,e[23]=a,e[24]=x):x=e[24];let f;e[25]!==p||e[26]!==t||e[27]!==a?(f=y=>{const w=a.filter(v=>v.id!==y);p(w,Array.from(new Set([...t.hidden,y])))},e[25]=p,e[26]=t,e[27]=a,e[28]=f):f=e[28];let h;return e[29]!==r||e[30]!==g||e[31]!==b||e[32]!==x||e[33]!==f?(h={snapshot:g,isLoading:r,moveTile:b,resizeTile:x,hideTile:f},e[29]=r,e[30]=g,e[31]=b,e[32]=x,e[33]=f,e[34]=h):h=e[34],h}function gi(s){return s.id}const bi={w:2,h:4},yi={w:1,h:2},vi={w:1,h:1};function ji(s){return`prompt:${s.agentId}:${s.promptName||"blank"}`}function wi(s){return`tile:${s.agentId}:${s.resourceUri}`}function Ni(s){return s.promptName?s.agentName:s.description}function Si(s){return{name:s.promptName,title:s.title,description:s.description,arguments:s.arguments,_meta:s._meta}}function ve(s){const e=$.c(10);let t;e[0]!==s?(t={agentId:s},e[0]=s,e[1]=t):t=e[1];const{start:r,startBlank:n,dialog:l,starting:o}=ri(t);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(Si(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const a=c;let d;return e[5]!==l||e[6]!==a||e[7]!==n||e[8]!==o?(d={open:a,startBlank:n,dialog:l,starting:o},e[5]=l,e[6]=a,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function _i(s){const e=$.c(32),{entry:t,isEditMode:r}=s,{open:n,dialog:l,starting:o}=ve(t.agentId);let c;e[0]!==t||e[1]!==n?(c=()=>n(t),e[0]=t,e[1]=n,e[2]=c):c=e[2];const a=o||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let p;e[3]!==d||e[4]!==m||e[5]!==u?(p=K("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=p):p=e[6];let g;e[7]!==t.agentIcon||e[8]!==t.agentName?(g=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[7]=t.agentIcon,e[8]=t.agentName,e[9]=g):g=e[9];let b;e[10]!==t.title?(b=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:t.title}),e[10]=t.title,e[11]=b):b=e[11];let x;e[12]!==t?(x=Ni(t),e[12]=t,e[13]=x):x=e[13];let f;e[14]!==x?(f=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=f):f=e[15];let h;e[16]!==f||e[17]!==b?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[b,f]}),e[16]=f,e[17]=b,e[18]=h):h=e[18];let y;e[19]!==r?(y=!r&&i.jsx(as,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=y):y=e[20];let w;e[21]!==o||e[22]!==c||e[23]!==h||e[24]!==y||e[25]!==a||e[26]!==p||e[27]!==g?(w=i.jsxs("button",{type:"button",onClick:c,disabled:a,"aria-busy":o,className:p,children:[g,h,y]}),e[21]=o,e[22]=c,e[23]=h,e[24]=y,e[25]=a,e[26]=p,e[27]=g,e[28]=w):w=e[28];let v;return e[29]!==l||e[30]!==w?(v=i.jsxs(i.Fragment,{children:[w,l]}),e[29]=l,e[30]=w,e[31]=v):v=e[31],v}function Ci(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Ti)}),s[0]=e):e=s[0],e}function Ti(s,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ei(s){const e=$.c(59),{tile:t,prompts:r,isEditMode:n,tileWidth:l}=s,{org:o}=V();let c;e[0]!==o.id||e[1]!==o.slug||e[2]!==t.connectionId?(c={connectionId:t.connectionId,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=t.connectionId,e[3]=c):c=e[3];const a=ee(c),{open:d,startBlank:m,dialog:u,starting:p}=ve(t.agentId);let g,b,x,f,h;if(e[4]!==a||e[5]!==n||e[6]!==d||e[7]!==o.id||e[8]!==r||e[9]!==m||e[10]!==p||e[11]!==t.agentIcon||e[12]!==t.agentName||e[13]!==t.maxHeight||e[14]!==t.minHeight||e[15]!==t.resourceUri||e[16]!==l){const v=r.filter(ki);f="flex h-full w-full flex-col gap-3 p-3";let j;e[22]!==m?(j=()=>{m()},e[22]=m,e[23]=j):j=e[23];const N=p||n,_=n&&"pl-10 pr-10";let T;e[24]!==_?(T=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",_),e[24]=_,e[25]=T):T=e[25];let S;e[26]!==t.agentIcon||e[27]!==t.agentName?(S=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[26]=t.agentIcon,e[27]=t.agentName,e[28]=S):S=e[28];let E;e[29]!==t.agentName?(E=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[29]=t.agentName,e[30]=E):E=e[30];const k=n?"Drag to rearrange":"Open chat";let C;e[31]!==k?(C=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=C):C=e[32];let I;e[33]!==E||e[34]!==C?(I=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[E,C]}),e[33]=E,e[34]=C,e[35]=I):I=e[35],e[36]!==p||e[37]!==T||e[38]!==S||e[39]!==I||e[40]!==j||e[41]!==N?(h=i.jsxs("button",{type:"button",onClick:j,disabled:N,"aria-busy":p,className:T,children:[S,I]}),e[36]=p,e[37]=T,e[38]=S,e[39]=I,e[40]=j,e[41]=N,e[42]=h):h=e[42],g="flex min-h-0 flex-1 gap-3 overflow-hidden";let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(Ii,{}),e[43]=A):A=e[43];const D=t.minHeight??200,z=t.maxHeight??4e3;e[44]!==a||e[45]!==o.id||e[46]!==D||e[47]!==z||e[48]!==t.resourceUri?(b=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(L.Suspense,{fallback:A,children:i.jsx(ts,{resourceURI:t.resourceUri,orgId:o.id,client:a,displayMode:"fullscreen",minHeight:D,maxHeight:z,className:"h-full"})})}),e[44]=a,e[45]=o.id,e[46]=D,e[47]=z,e[48]=t.resourceUri,e[49]=b):b=e[49],x=v.length>0&&!n&&l>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(O=>i.jsx("button",{type:"button",onClick:()=>d(O),disabled:p,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:O.title})},O.promptName))}),e[4]=a,e[5]=n,e[6]=d,e[7]=o.id,e[8]=r,e[9]=m,e[10]=p,e[11]=t.agentIcon,e[12]=t.agentName,e[13]=t.maxHeight,e[14]=t.minHeight,e[15]=t.resourceUri,e[16]=l,e[17]=g,e[18]=b,e[19]=x,e[20]=f,e[21]=h}else g=e[17],b=e[18],x=e[19],f=e[20],h=e[21];let y;e[50]!==g||e[51]!==b||e[52]!==x?(y=i.jsxs("div",{className:g,children:[b,x]}),e[50]=g,e[51]=b,e[52]=x,e[53]=y):y=e[53];let w;return e[54]!==u||e[55]!==f||e[56]!==h||e[57]!==y?(w=i.jsxs("div",{className:f,children:[h,y,u]}),e[54]=u,e[55]=f,e[56]=h,e[57]=y,e[58]=w):w=e[58],w}function ki(s){return!!s.promptName}function Ii(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),s[0]=e):e=s[0],e}function $i(s){const e=$.c(14),{icon:t,name:r}=s;let n;e[0]!==t||e[1]!==r?(n=i.jsx(Y,{icon:t,name:r,size:"sm+"}),e[0]=t,e[1]=r,e[2]=n):n=e[2];let l;e[3]!==r?(l=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let c;e[6]!==l?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[l,o]}),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==n||e[9]!==c?(a=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=a):a=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==a?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,d]}),e[12]=a,e[13]=m):m=e[13],m}function Ai(s){const e=$.c(33),{tile:t,prompts:r,isEditMode:n}=s,{open:l,startBlank:o,dialog:c,starting:a}=ve(t.agentId);let d,m,u;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==o||e[4]!==a||e[5]!==t.agentIcon||e[6]!==t.agentName){const g=r.filter(Mi);d="flex h-full w-full flex-col gap-3 p-4";let b;e[10]!==o?(b=()=>{o()},e[10]=o,e[11]=b):b=e[11];const x=a||n,f=n&&"pl-10 pr-10";let h;e[12]!==f?(h=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",f),e[12]=f,e[13]=h):h=e[13];let y;e[14]!==t.agentIcon||e[15]!==t.agentName?(y=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[14]=t.agentIcon,e[15]=t.agentName,e[16]=y):y=e[16];let w;e[17]!==t.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[17]=t.agentName,e[18]=w):w=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=v):v=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,v]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==b||e[24]!==x||e[25]!==h||e[26]!==y?(m=i.jsxs("button",{type:"button",onClick:b,disabled:x,className:h,children:[y,j]}),e[22]=j,e[23]=b,e[24]=x,e[25]=h,e[26]=y,e[27]=m):m=e[27],u=g.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:g.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&l(N),disabled:a,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=l,e[2]=r,e[3]=o,e[4]=a,e[5]=t.agentIcon,e[6]=t.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let p;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(p=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=p):p=e[32],p}function Mi(s){return!!s.promptName}function et(s){const e=$.c(36),{isEditMode:t}=s,{org:r}=V(),{isLoading:n,prompts:l,tiles:o}=ye(r.slug),c=He()?.ids??[];let a;e[0]!==c?(a=new Set(c),e[0]=c,e[1]=a):a=e[1];const d=a,m=Ue();let u;e[2]!==o?(u=new Set(o.map(Di)),e[2]=o,e[3]=u):u=e[3];const p=u;let g;if(e[4]!==l){g=new Map;for(const C of l){const I=g.get(C.agentId);I?I.push(C):g.set(C.agentId,[C])}e[4]=l,e[5]=g}else g=e[5];let b;if(e[6]!==l||e[7]!==p||e[8]!==o){let C;e[10]!==p?(C=A=>!p.has(A.agentId),e[10]=p,e[11]=C):C=e[11];const I=l.filter(C);b=[...o.map(Ri),...I.map(Oi)],e[6]=l,e[7]=p,e[8]=o,e[9]=b}else b=e[9];const x=b;let f;e[12]!==x?(f=new Map(x.map(zi)),e[12]=x,e[13]=f):f=e[13];const h=f;let y;e[14]!==x||e[15]!==d?(y=x.map(C=>({id:C.id,defaultSize:C.kind==="tile"?bi:vi,minSize:C.kind==="tile"?yi:void 0,pinned:d.has(C.data.agentId)})),e[14]=x,e[15]=d,e[16]=y):y=e[16];const w=xi(y);let v;e[17]!==m?(v=C=>{m.apply(I=>I.filter(A=>A!==C)).catch(Li)},e[17]=m,e[18]=v):v=e[18];const j=v;let N;e[19]!==h||e[20]!==w||e[21]!==d||e[22]!==j?(N=C=>{const I=h.get(C);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(C)},e[19]=h,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const _=N;let T;e[24]!==h||e[25]!==t||e[26]!==g?(T=C=>{const I=h.get(C.id);if(!I)return null;if(I.kind==="tile"){const A=g.get(I.data.agentId)??[];return i.jsx(xt,{fallback:i.jsx(Ai,{tile:I.data,prompts:A,isEditMode:t}),children:i.jsx(L.Suspense,{fallback:i.jsx($i,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ei,{tile:I.data,prompts:A,isEditMode:t,tileWidth:C.w})})})}return i.jsx(_i,{entry:I.data,isEditMode:t})},e[24]=h,e[25]=t,e[26]=g,e[27]=T):T=e[27];const S=T;if(n||w.isLoading){let C;return e[28]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ci,{}),e[28]=C):C=e[28],C}if(w.snapshot.visible.length===0&&!t)return null;let k;return e[29]!==t||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==_||e[34]!==S?(k=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ai,{tiles:w.snapshot.visible,isEditMode:t,renderTile:S,onMove:w.moveTile,onResize:w.resizeTile,onRemove:_})}),e[29]=t,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=_,e[34]=S,e[35]=k):k=e[35],k}function Li(){return W.error("Couldn't remove from home — please try again.")}function zi(s){return[s.id,s]}function Oi(s){return{kind:"prompt",id:ji(s),data:s}}function Ri(s){return{kind:"tile",id:wi(s),data:s}}function Di(s){return s.agentId}function Pi(s){const e=$.c(2),{prompts:t,tiles:r}=ye(s),n=r.length>0||t.length>0;let l;return e[0]!==n?(l={hasVisibleTiles:n},e[0]=n,e[1]=l):l=e[1],l}const ke=420,Ie=305;function tt(){const s=$.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),s[0]=e):e=s[0];let t;s[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}}),s[1]=t):t=s[1];let r;s[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),s[2]=r):r=s[2];let n;return s[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,t,r,i.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}})]}),s[3]=n):n=s[3],n}function $e(){const s=$.c(33),{data:e}=gt.useSession(),{org:t}=V(),r=ge(),n=At(),{selectedVirtualMcp:l}=Mt();let o;s[0]!==t.id?(o=yt(t.id),s[0]=t.id,s[1]=o):o=s[1];const a=l??o;let d;s[2]!==t.slug?(d=qt(t.slug),s[2]=t.slug,s[3]=d):d=s[3],le(d);let m;s[4]!==t.id||s[5]!==t.slug?(m={connectionId:Le,orgId:t.id,orgSlug:t.slug},s[4]=t.id,s[5]=t.slug,s[6]=m):m=s[6];const u=ee(m);let p;s[7]!==t.id||s[8]!==u?(p=bs(u,t.id),s[7]=t.id,s[8]=u,s[9]=p):p=s[9];let g;s[10]!==t.id||s[11]!==u?(g=Qt(u,t.id),s[10]=t.id,s[11]=u,s[12]=g):g=s[12];let b;s[13]!==a.id||s[14]!==t.id||s[15]!==u?(b=wt(t.id,a.id,u),s[13]=a.id,s[14]=t.id,s[15]=u,s[16]=b):b=s[16];let x;s[17]!==p||s[18]!==g||s[19]!==b?(x={queries:[p,g,b]},s[17]=p,s[18]=g,s[19]=b,s[20]=x):x=s[20],Ss(x);const f=ys(),h=Nt(a.id),{hasDecoKey:y,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:j,hasOnlyDecoProvider:N}=kt(),{hasVisibleTiles:_}=Pi(t.slug),T=It(h?.metadata);if(f.length===0&&!(T&&$t(n))){let O;return s[21]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Lt,{})})}),s[21]=O):O=s[21],O}let E;s[22]!==e?.user?.name?(E=e?.user?.name?.split(" ")[0]||"there",s[22]=e?.user?.name,s[23]=E):E=s[23];const k=E,C=y&&v&&j!=null,I=y&&w&&N;let A;s[24]!==j||s[25]!==C||s[26]!==I?(A=C?i.jsx(ne.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(ne.NoCreditsEyebrow,{}):null,s[24]=j,s[25]=C,s[26]=I,s[27]=A):A=s[27];const D=A;let z;return s[28]!==D||s[29]!==_||s[30]!==r||s[31]!==k?(z=i.jsx(ni,{children:r?i.jsx(Hi,{eyebrow:D,userName:k}):i.jsx(Ui,{eyebrow:D,userName:k,hasVisibleTiles:_})}),s[28]=D,s[29]=_,s[30]=r,s[31]=k,s[32]=z):z=s[32],z}function Hi(s){const e=$.c(12),{eyebrow:t,userName:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(tt,{}),e[0]=n):n=e[0];let l;e[1]!==t?(l=t&&i.jsx("div",{className:"mb-4",children:t}),e[1]=t,e[2]=l):l=e[2];let o;e[3]!==r?(o=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=o):o=e[4];let c;e[5]!==l||e[6]!==o?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[l,o]}),e[5]=l,e[6]=o,e[7]=c):c=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ne.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(et,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,a,d]}),e[10]=c,e[11]=m):m=e[11],m}function Ui(s){const e=$.c(32),{eyebrow:t,userName:r,hasVisibleTiles:n}=s,{isEditMode:l,enter:o,save:c,cancel:a,hasChanges:d}=Ye(),[m,u]=L.useState(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!0),e[0]=p):p=e[0];let g;e[1]!==a||e[2]!==o||e[3]!==d||e[4]!==l||e[5]!==c?(g=i.jsx(vs.Right,{children:i.jsx(Bi,{isEditMode:l,hasChanges:d,onEnter:o,onSave:c,onCancel:a,onAddTile:p})}),e[1]=a,e[2]=o,e[3]=d,e[4]=l,e[5]=c,e[6]=g):g=e[6];let b;e[7]!==m?(b=i.jsx(_s,{open:m,onOpenChange:u}),e[7]=m,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(tt,{}),e[9]=x):x=e[9];const f=n||l?"pt-32":"flex-1 justify-center";let h;e[10]!==f?(h=K("relative flex flex-col items-center px-10 pb-4",f),e[10]=f,e[11]=h):h=e[11];let y;e[12]!==t?(y=t&&i.jsx("div",{className:"mb-4",children:t}),e[12]=t,e[13]=y):y=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==y||e[17]!==w?(v=i.jsxs("div",{className:"text-center mb-10",children:[y,w]}),e[16]=y,e[17]=w,e[18]=v):v=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Fi,{}),i.jsx(ne.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==v?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,j]}),e[20]=v,e[21]=N):N=e[21];let _;e[22]!==l?(_=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(et,{isEditMode:l})}),e[22]=l,e[23]=_):_=e[23];let T;e[24]!==N||e[25]!==_||e[26]!==h?(T=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:h,children:[N,_]})})]}),e[24]=N,e[25]=_,e[26]=h,e[27]=T):T=e[27];let S;return e[28]!==T||e[29]!==g||e[30]!==b?(S=i.jsxs(i.Fragment,{children:[g,b,T]}),e[28]=T,e[29]=g,e[30]=b,e[31]=S):S=e[31],S}function Bi(s){const e=$.c(17),{isEditMode:t,hasChanges:r,onEnter:n,onSave:l,onCancel:o,onAddTile:c}=s;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(be,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(ze,{size:14}),e[3]=p):p=e[3];let g;e[4]!==o?(g=i.jsxs(we,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[p,"Cancel"]}),e[4]=o,e[5]=g):g=e[5];const b=!r;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(St,{size:14}),e[6]=x):x=e[6];let f;e[7]!==l||e[8]!==b?(f=i.jsxs(we,{size:"sm",onClick:l,disabled:b,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=l,e[8]=b,e[9]=f):f=e[9];let h;return e[10]!==u||e[11]!==g||e[12]!==f?(h=i.jsxs(i.Fragment,{children:[u,g,f]}),e[10]=u,e[11]=g,e[12]=f,e[13]=h):h=e[13],h}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Et,{size:14}),e[14]=a):a=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[a,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Fi(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),s[0]=e):e=s[0],e}function Vr(){const s=$.c(2);if(ge()){let r;return s[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx($e,{})}),s[0]=r):r=s[0],r}let t;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx($e,{})})})}),s[1]=t):t=s[1],t}export{Vr as default};
1
+ import{aq as st,ar as me,as as it,at as nt,au as Ae,F as pe,av as rt,aw as ot,r as L,ax as lt,ay as at,az as ct,aA as dt,aB as je,aC as mt,aD as ut,aE as ft,e as $,j as i,q as V,c as K,l as Me,aF as xe,o as W,K as oe,n as le,a as ht,v as pt,E as xt,b as gt,B as we}from"./index-D9kgGhq4.js";import{u as ge}from"./tooltip-M08maXcg.js";import{i as bt,u as ee,S as Le,g as yt}from"./constants-D6Bbr6AT.js";import{a as vt,b as jt,v as wt,u as Nt}from"./use-virtual-mcp-C7J9vBIx.js";import{i as St}from"./Check-o-zUju1W.js";import{X as _t,A as Y,Z as Ct,r as Tt,c as Et}from"./agent-icon-zrokvqQM.js";import{s as be}from"./Plus-BFGy0Ag-.js";import{i as ze}from"./X-BQQplvP0.js";import{u as kt,b as It,h as $t,C as ne}from"./agent-capabilities-9LqLzAxM.js";import{u as At,c as Mt}from"./chat-context-DV1OjViY.js";import{N as Lt}from"./agent-icons-Dv-0lh0p.js";import{u as Oe,a as re,K as Re,P as De,D as Pe,c as zt,S as Ot,v as Rt,b as Dt,C as Pt,s as Ht,d as Ut,e as Bt,f as Ft}from"./sortable.esm-C8q-C7LS.js";import{u as He,a as Ue,o as Qt}from"./use-organization-settings-DcOZmJjR.js";import{c as ye,u as Wt,h as qt}from"./shell-layout-pG6XpLJU.js";import{I as Kt}from"./input-D8kdtiC4.js";import{S as Xt}from"./scroll-area-B0QeeQ1W.js";import{S as Gt,c as Vt,d as Zt,a as Jt,b as Yt}from"./sheet-BcNA728n.js";import{S as H}from"./skeleton-FanER5WJ.js";import{t as Be}from"./ChevronDown-CNy49i0W.js";import{d as Fe}from"./ZoomOut-CpLnwBO_.js";import{g as es,M as ts}from"./types-C_6yTm2K.js";import{I as ss}from"./integration-icon-DOYIIElF.js";import{u as is}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Qe,P as ns,e as rs,s as os,g as ls}from"./pair-DyoQ9qQT.js";import{a as as}from"./XCircle-h_tDVdAY.js";import{g as cs}from"./use-mcp-prompts-DwWf_cps.js";import{u as ds,w as ms}from"./tab-id-DoHEKhGX.js";import{D as us,a as fs,b as hs,h as ps,c as Ne,d as xs}from"./dropdown-menu-Ci6fdZ_l.js";import{s as gs}from"./Trash01-Cx3OtqBr.js";import{a as bs,u as ys}from"./use-ai-providers-DgHf7F2h.js";import{a as vs}from"./toolbar-FU-ITy2s.js";import"./use-collections-Dx8F5dop.js";import"./AlertCircle-Dm12nF6o.js";import"./Tool01-D2UZ1Vs-.js";import"./SwitchHorizontal01-K-7T5m4d.js";import"./RefreshCcw01-86h90ufT.js";import"./ArrowUpRight-GdT2goj_.js";import"./ZapSquare-BZ8deXpK.js";import"./Users03-DcPZW8td.js";import"./CheckCircle-BkEI7gFR.js";import"./ChevronLeft-BswR_fSO.js";import"./ChevronRight-BgIn57eH.js";import"./ChevronUp-CItZiPxX.js";import"./DotsVertical-DpyQCfpE.js";import"./Container-BI041HGs.js";import"./Eye-CwmAmEba.js";import"./Globe01-BQiH4pzR.js";import"./FilterLines-_2tlTach.js";import"./Star01-DH1c5eP5.js";import"./Palette-vdpnI3pe.js";import"./HardDrive-BExU4NVN.js";import"./Stars02-CON7obeQ.js";import"./Key01-BVH8DPhU.js";import"./LayoutLeft-DNYnEEyq.js";import"./LinkExternal01-XNIU6-cE.js";import"./Monitor01-20Eh6WBW.js";import"./Sun-BLdidlza.js";import"./Play-DitjUfoa.js";import"./SearchMd-DcUQwid2.js";import"./Settings02-CK5ZrDud.js";import"./Shield01-DymXSrLL.js";import"./Stars01-9ek2YoUP.js";import"./Upload01-5227NVpL.js";import"./User01-Dm1O7yuK.js";import"./Users01-D9KQz9Jg.js";import"./XClose-DRKdv4XS.js";import"./Zap-B0rZ1Af9.js";import"./spinner-Bniq-hdg.js";import"./dialog-CB0bO41l.js";import"./drawer-DFvei-xn.js";import"./collection-search-lmVdsLrv.js";import"./form-Ct0PcXXO.js";import"./label-BpJD7y8S.js";import"./select-BMTzbu3R.js";import"./tabs-DjiD-oR_.js";import"./toggle-group-BGMT9i62.js";import"./connect-desktop-dialog-RVZBNR1K.js";import"./popover-Ar-4ozUT.js";import"./command-BFycs2Kb.js";import"./index-BvzS7IRp.js";import"./useInfiniteQuery-moOazGP7.js";import"./infiniteQueryObserver-BaYvuSQm.js";import"./index-BACP8eL8.js";import"./question-004-sINsf4GQ.js";import"./checkbox-B-gaLjHk.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CFgeYzCR.js";import"./settings-section-DkCaCHjL.js";import"./card-BXlKgMlf.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CAaHV4Vz.js";import"./use-registry-connections-Bued1bGX.js";import"./use-connection-fZwsgZBE.js";import"./extract-connection-data-cVoEqyD8.js";import"./generate-id-DYV1EuhB.js";import"./collections-BKr8aq5N.js";import"./collection-tabs-C3D4x7Aa.js";import"./badge-BoRJ8tO_.js";import"./textarea-B24VAXi2.js";import"./connection-form-helpers-D45HQd6Q.js";import"./use-infinite-scroll-DxKK_1jX.js";import"./useSuspenseInfiniteQuery-CoKhcfdG.js";import"./required-auth-layout-DFiOpH8z.js";import"./useRouterState-iQdkmhiX.js";import"./use-org-sso-BtiGW1BY.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ND5nyTQq.js";import"./file-type-icon-DFx7UFpB.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-ImCQRVux.js";import"./decopilot-sse-pool-Ce0jkp4a.js";import"./create-sse-subscription-BS5983N4.js";function Se(s,e){const t=new Set(e);return s.filter(r=>!t.has(r))}function js(s,e,t){const r=s.slice(0);return r[e]=t,r}var ws=class extends st{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(s,e,t){super(),this.#n=s,this.#i=t,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(s=>{s.subscribe(e=>{this.#f(s,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(s=>{s.destroy()})}setQueries(s,e){this.#r=s,this.#i=e,me.batch(()=>{const t=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),l=n.map(m=>m.getCurrentResult()),o=t.length!==n.length,c=n.some((m,u)=>m!==t[u]),a=o||c,d=a?!0:l.some((m,u)=>{const p=this.#e[u];return!p||!it(m,p)});!a&&!d||(a&&(this.#c=r,this.#t=n),this.#e=l,this.hasListeners()&&(a&&(Se(t,n).forEach(m=>{m.destroy()}),Se(n,t).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(s=>s.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(s,e){const t=this.#u(s),r=t.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),n=t.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>this.#m(l??r,e,n),()=>this.#d(r,t)]}#d(s,e){return e.map((t,r)=>{const n=s[r];return t.defaultedQueryOptions.notifyOnChangeProps?n:t.observer.trackResult(n,l=>{e.forEach(o=>{o.observer.trackProp(l)})})})}#m(s,e,t){if(e){const r=this.#a,n=t!==void 0&&r!==void 0&&(r.length!==t.length||t.some((l,o)=>l!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,t!==void 0&&(this.#a=t),this.#s=nt(this.#s,e(s))),this.#s}return s}#p(){return this.#i?.combine!==void 0&&this.#t.some((s,e)=>s.options.suspense&&this.#e[e]?.data===void 0)}#u(s){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const l=e.get(n);l?l.push(r):e.set(n,[r])});const t=[];return s.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ae(this.#n,n);t.push({defaultedQueryOptions:n,observer:o})}),t}#f(s,e){const t=this.#t.indexOf(s);t!==-1&&(this.#e=js(this.#e,t,e),this.#h())}#h(){if(this.hasListeners()){const s=this.#d(this.#e,this.#c),e=this.#p(),t=this.#s,r=e?t:this.#m(s,this.#i?.combine);(e||t!==r)&&me.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function Ns({queries:s,...e},t){const r=pe(t),n=rt(),l=ot(),o=L.useMemo(()=>s.map(x=>{const f=r.defaultQueryOptions(x);return f._optimisticResults=n?"isRestoring":"optimistic",f}),[s,r,n]);o.forEach(x=>{lt(x);const f=r.getQueryCache().get(x.queryHash);at(x,l,f)}),ct(l);const[c]=L.useState(()=>new ws(r,o,e)),[a,d,m]=c.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;L.useSyncExternalStore(L.useCallback(x=>u?c.subscribe(me.batchCalls(x)):dt,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),L.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const g=a.some((x,f)=>je(o[f],x))?a.flatMap((x,f)=>{const h=o[f];if(h&&je(h,x)){const y=new Ae(r,h);return mt(h,y,l)}return[]}):[];if(g.length>0)throw Promise.all(g);const b=a.find((x,f)=>{const h=o[f];return h&&ut({result:x,errorResetBoundary:l,throwOnError:h.throwOnError,query:r.getQueryCache().get(h.queryHash),suspense:h.suspense})});if(b?.error)throw b.error;return d(m())}function Ss(s,e){return Ns({...s,queries:s.queries.map(t=>({...t,suspense:!0,throwOnError:ft,enabled:!0,placeholderData:void 0}))},e)}const te=8;function _s(s){const e=$.c(16),{open:t,onOpenChange:r}=s,[n,l]=L.useState("");let o,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Gt,{children:"Manage home"}),c=i.jsx(Vt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=c):(o=e[0],c=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(_t,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=x=>l(x.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Zt,{className:"px-5 py-4 border-b border-border",children:[o,c,i.jsxs("div",{className:"relative mt-3",children:[a,i.jsx(Kt,{value:n,onChange:d,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Ys,{}),e[6]=u):u=e[6];let p;e[7]!==n?(p=i.jsx(Xt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(L.Suspense,{fallback:u,children:i.jsx(Ts,{search:n})})})}),e[7]=n,e[8]=p):p=e[8];let g;e[9]!==m||e[10]!==p?(g=i.jsxs(Jt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,p]}),e[9]=m,e[10]=p,e[11]=g):g=e[11];let b;return e[12]!==r||e[13]!==t||e[14]!==g?(b=i.jsx(Yt,{open:t,onOpenChange:r,children:g}),e[12]=r,e[13]=t,e[14]=g,e[15]=b):b=e[15],b}function Cs(s){const e=$.c(32),{org:t}=V(),r=He();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const l=n,o=Ue(),c=jt(),a=pe();let d;e[2]!==t||e[3]!==a?(d=()=>a.refetchQueries({queryKey:oe.homeNextActions(t.slug),type:"active"}),e[2]=t,e[3]=a,e[4]=d):d=e[4];const m=d;let u;e[5]!==l?(u=S=>l.includes(S),e[5]=l,e[6]=u):u=e[6];const p=u;let g;e[7]!==l||e[8]!==s?(g=s?l.filter(S=>s.has(S)).length:l.length,e[7]=l,e[8]=s,e[9]=g):g=e[9];const x=g>=te;let f;e[10]!==x||e[11]!==p||e[12]!==o?(f=S=>p(S)||x?Promise.resolve():o.apply(E=>E.includes(S)?null:[...E,S]),e[10]=x,e[11]=p,e[12]=o,e[13]=f):f=e[13];const h=f;let y;e[14]!==o?(y=S=>o.apply(E=>E.filter(k=>k!==S)),e[14]=o,e[15]=y):y=e[15];const w=y;let v;e[16]!==o?(v=S=>o.apply(()=>S),e[16]=o,e[17]=v):v=e[17];const j=v;let N;e[18]!==c||e[19]!==x||e[20]!==p||e[21]!==m||e[22]!==o?(N=async(S,E)=>{await c.update.mutateAsync({id:S.id,data:{metadata:E}}),!p(S.id)&&!x&&await o.apply(k=>k.includes(S.id)?null:[...k,S.id]),await m()},e[18]=c,e[19]=x,e[20]=p,e[21]=m,e[22]=o,e[23]=N):N=e[23];const _=N;let T;return e[24]!==h||e[25]!==x||e[26]!==l||e[27]!==p||e[28]!==w||e[29]!==j||e[30]!==_?(T={homeIds:l,isOnHome:p,atLimit:x,addAgent:h,removeAgent:w,reorder:j,saveAgentMetadata:_},e[24]=h,e[25]=x,e[26]=l,e[27]=p,e[28]=w,e[29]=j,e[30]=_,e[31]=T):T=e[31],T}function Ts(s){const e=$.c(21),{search:t}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=vt(r);let l;e[1]!==n?(l=new Set(n.map(As)),e[1]=n,e[2]=l):l=e[2];const o=Cs(l);let c,a,d;if(e[3]!==n||e[4]!==o||e[5]!==t){const x=new Map(n.map($s));c=t.trim().toLowerCase();const f=y=>!c||y.title?.toLowerCase().includes(c);a=o.homeIds.map(y=>x.get(y)).filter(Is).filter(f);let h;e[9]!==o?(h=y=>!o.isOnHome(y.id),e[9]=o,e[10]=h):h=e[10],d=n.filter(ks).filter(h).filter(f).sort(Es),e[3]=n,e[4]=o,e[5]=t,e[6]=c,e[7]=a,e[8]=d}else c=e[6],a=e[7],d=e[8];const m=d;let u;e[11]!==o||e[12]!==a?(u=i.jsx(Ms,{home:o,agents:a}),e[11]=o,e[12]=a,e[13]=u):u=e[13];const p=!!c;let g;e[14]!==m||e[15]!==o||e[16]!==p?(g=i.jsx(Os,{home:o,agents:m,hasSearch:p}),e[14]=m,e[15]=o,e[16]=p,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=i.jsxs(i.Fragment,{children:[u,g]}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}function Es(s,e){return(s.title??"").localeCompare(e.title??"")}function ks(s){return s.id&&!bt(s.id)}function Is(s){return!!s}function $s(s){return[s.id,s]}function As(s){return s.id}function We(s){const e=$.c(7),{title:t,hint:r}=s;let n;e[0]!==t?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t}),e[0]=t,e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let o;return e[4]!==n||e[5]!==l?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,l]}),e[4]=n,e[5]=l,e[6]=o):o=e[6],o}function Ms(s){const e=$.c(14),{home:t,agents:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={coordinateGetter:Ht},e[1]=l):l=e[1];const o=Oe(re(De,n),re(Re,l));let c;e[2]!==t?(c=g=>{const{active:b,over:x}=g;if(!x||b.id===x.id)return;const f=t.homeIds,h=f.indexOf(b.id),y=f.indexOf(x.id);h===-1||y===-1||t.reorder(Ut([...f],h,y)).catch(zs)},e[2]=t,e[3]=c):c=e[3];const a=c,d=`${t.homeIds.length}/${te}`;let m;e[4]!==d?(m=i.jsx(We,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==t||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(Pe,{sensors:o,collisionDetection:zt,onDragEnd:a,children:i.jsx(Ot,{items:r.map(Ls),strategy:Rt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(g=>i.jsx(Ds,{agent:g,home:t},g.id))})})}),e[6]=r,e[7]=a,e[8]=t,e[9]=o,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function Ls(s){return s.id}function zs(){return W.error("Couldn't reorder home — please try again.")}function Os(s){const e=$.c(6),{home:t,agents:r,hasSearch:n}=s,[l,o]=L.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==t||e[3]!==l){const a=r.slice(0,l);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(We,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:a.map(m=>i.jsx(Us,{agent:m,home:t},m.id))}),r.length>l&&i.jsxs("button",{type:"button",onClick:()=>o(Rs),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",r.length-l,")"]})]})]}),e[0]=r,e[1]=n,e[2]=t,e[3]=l,e[4]=c}else c=e[4];return c}function Rs(s){return s+20}function qe(s){const e=xe(s.metadata?.ui).filter(l=>!!l.resourceUri).length,t=s.metadata?.ui?.homePrompts,r=Array.isArray(t)?t.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Ds(s){const e=$.c(57),{agent:t,home:r}=s,[n,l]=L.useState(!1);let o;e[0]!==t.id?(o={id:t.id},e[0]=t.id,e[1]=o):o=e[1];const{attributes:c,listeners:a,setNodeRef:d,transform:m,transition:u,isDragging:p}=Dt(o),g=qe(t)||"Quick access";let b;e[2]!==m?(b=Pt.Transform.toString(m),e[2]=m,e[3]=b):b=e[3];const x=p?.5:void 0,f=p?100:void 0;let h;e[4]!==b||e[5]!==x||e[6]!==f||e[7]!==u?(h={transform:b,transition:u,opacity:x,zIndex:f},e[4]=b,e[5]=x,e[6]=f,e[7]=u,e[8]=h):h=e[8];const y=h,w=p&&"shadow-lg";let v;e[9]!==w?(v=K("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const j=`Drag to reorder ${t.title??t.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Fe,{size:14}),e[11]=N):N=e[11];let _;e[12]!==c||e[13]!==a||e[14]!==j?(_=i.jsx("button",{type:"button",...c,...a,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":j,children:N}),e[12]=c,e[13]=a,e[14]=j,e[15]=_):_=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>l(Hs),e[16]=T):T=e[16];const S=t.title??t.id;let E;e[17]!==t.icon||e[18]!==S?(E=i.jsx(Y,{icon:t.icon,name:S,size:"sm"}),e[17]=t.icon,e[18]=S,e[19]=E):E=e[19];const k=t.title??t.id;let C;e[20]!==k?(C=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:k}),e[20]=k,e[21]=C):C=e[21];let I;e[22]!==g?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:g}),e[22]=g,e[23]=I):I=e[23];let A;e[24]!==C||e[25]!==I?(A=i.jsxs("div",{className:"min-w-0 flex-1",children:[C,I]}),e[24]=C,e[25]=I,e[26]=A):A=e[26];const D=n&&"rotate-180";let z;e[27]!==D?(z=K("shrink-0 text-muted-foreground transition-transform",D),e[27]=D,e[28]=z):z=e[28];let O;e[29]!==z?(O=i.jsx(Be,{size:16,className:z}),e[29]=z,e[30]=O):O=e[30];let Q;e[31]!==n||e[32]!==E||e[33]!==A||e[34]!==O?(Q=i.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[E,A,O]}),e[31]=n,e[32]=E,e[33]=A,e[34]=O,e[35]=Q):Q=e[35];let M;e[36]!==t.id||e[37]!==r?(M=()=>r.removeAgent(t.id).catch(Ps),e[36]=t.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${t.title??t.id} from home`;let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(ze,{size:14}),e[39]=P):P=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:P}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let U;e[43]!==_||e[44]!==Q||e[45]!==R?(U=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[_,Q,R]}),e[43]=_,e[44]=Q,e[45]=R,e[46]=U):U=e[46];let B;e[47]!==t||e[48]!==n||e[49]!==r?(B=n&&i.jsx(Ke,{agent:t,home:r}),e[47]=t,e[48]=n,e[49]=r,e[50]=B):B=e[50];let q;return e[51]!==d||e[52]!==y||e[53]!==U||e[54]!==B||e[55]!==v?(q=i.jsxs("div",{ref:d,style:y,className:v,children:[U,B]}),e[51]=d,e[52]=y,e[53]=U,e[54]=B,e[55]=v,e[56]=q):q=e[56],q}function Ps(){return W.error("Couldn't remove from home — please try again.")}function Hs(s){return!s}function Us({agent:s,home:e}){const[t,r]=L.useState(!1),[n,l]=L.useState(!1),o=qe(s),c=async()=>{if(!e.atLimit){l(!0);try{await e.addAgent(s.id)}catch{W.error("Couldn't add to home — please try again.")}finally{l(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":t,children:[i.jsx(Y,{icon:s.icon,name:s.title??s.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.title??s.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(Be,{size:16,className:K("shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:n?i.jsx(Me,{size:12,className:"animate-spin"}):i.jsx(be,{size:14})})]}),t&&i.jsx(Ke,{agent:s,home:e})]})}function Ke(s){const e=$.c(26),{agent:t,home:r}=s;let n,l,o,c,a,d,m;if(e[0]!==t||e[1]!==r){const f=xe(t.metadata?.ui);let h;e[9]!==t.connections?(h=(t.connections??[]).map(Fs).sort(),e[9]=t.connections,e[10]=h):h=e[10];const y=h;l=t.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Ws,o=t,c=r,a=y,d=new Set(f.map(Bs)),e[0]=t,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c,e[6]=a,e[7]=d,e[8]=m}else n=e[2],l=e[3],o=e[4],c=e[5],a=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==d?(u=i.jsx(n,{agent:o,home:c,connectionIds:a,pinnedResourceUris:d}),e[11]=n,e[12]=o,e[13]=c,e[14]=a,e[15]=d,e[16]=u):u=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Qs,{}),e[17]=p):p=e[17];const g=l??null;let b;e[18]!==t||e[19]!==r||e[20]!==g?(b=i.jsx(L.Suspense,{fallback:p,children:i.jsx(Ks,{agent:t,home:r,curated:g})}),e[18]=t,e[19]=r,e[20]=g,e[21]=b):b=e[21];let x;return e[22]!==m||e[23]!==u||e[24]!==b?(x=i.jsxs("div",{className:m,children:[u,b]}),e[22]=m,e[23]=u,e[24]=b,e[25]=x):x=e[25],x}function Bs(s){return s.resourceUri}function Fs(s){return s.connection_id}function Qs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),s[0]=e):e=s[0],e}function Ws({agent:s,home:e,connectionIds:t,pinnedResourceUris:r}){const{org:n}=V(),l=ee({connectionId:Le,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:c}=le({queryKey:oe.projectConnectionDetails(s.id,t),enabled:t.length>0,queryFn:async()=>(await Promise.all(t.map(async d=>{try{const m=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),{item:u}=is(m),p=(u?.tools??[]).flatMap(g=>{const b=es(g._meta);return b?[{name:g.name,description:g.description,resourceUri:b}]:[]});return{id:d,title:u?.title??d,icon:u?.icon??null,uiTools:p}}catch{return{id:d,title:d,icon:null,uiTools:[]}}}))).filter(d=>d.uiTools.length>0)});return t.length===0?null:c?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(a=>a.uiTools.map(d=>i.jsx(qs,{agent:s,home:e,connection:a,tool:d,isPinned:r.has(d.resourceUri)},`${a.id}:${d.name}`)))})}function qs({agent:s,home:e,connection:t,tool:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=xe(s.metadata?.ui),d=n?a.filter(u=>u.resourceUri!==r.resourceUri):[...a,{connectionId:t.id,resourceUri:r.resourceUri}],m={...s.metadata??{},ui:{...s.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle tile",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(ss,{icon:t.icon,name:t.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Qe(r.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Xe(s){const e=$.c(11),{isPinned:t,submitting:r,onClick:n,label:l}=s,o=t?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==o?(c=K("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=c):c=e[1];let a;e[2]!==t||e[3]!==r?(a=r?i.jsx(Me,{size:12,className:"animate-spin"}):t?i.jsx(Ct,{size:14}):i.jsx(be,{size:14}),e[2]=t,e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==a?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":l,title:l,className:c,children:a}),e[5]=l,e[6]=n,e[7]=r,e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Ks(s){const e=$.c(32),{agent:t,home:r,curated:n}=s,{org:l}=V();let o;e[0]!==t.id||e[1]!==l.id||e[2]!==l.slug?(o={connectionId:t.id,orgId:l.id,orgSlug:l.slug},e[0]=t.id,e[1]=l.id,e[2]=l.slug,e[3]=o):o=e[3];const c=ee(o);let a;e[4]!==t.id||e[5]!==l.id?(a=oe.agentPrompts(l.id,t.id),e[4]=t.id,e[5]=l.id,e[6]=a):a=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Zs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==a||e[10]!==d?(m={queryKey:a,queryFn:d,staleTime:3e4,retry:!1},e[9]=a,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:p,error:g}=le(m),b=ye(l.slug);let x,f;if(e[12]!==t.id||e[13]!==u||e[14]!==b.prompts){let j;e[17]!==t.id?(j=_=>_.agentId===t.id&&_.promptName,e[17]=t.id,e[18]=j):j=e[18],x=b.prompts.filter(j).map(Vs);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],f=[...N];for(const _ of x)f.some(T=>T.name===_.name)||f.push(_);e[12]=t.id,e[13]=u,e[14]=b.prompts,e[15]=x,e[16]=f}else x=e[15],f=e[16];if(p&&x.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(g&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",t.id,g),null;if(f.length===0)return null;let h;e[22]!==n||e[23]!==f?(h=n??f.map(Gs),e[22]=n,e[23]=f,e[24]=h):h=e[24];let y;e[25]!==h?(y=new Set(h),e[25]=h,e[26]=y):y=e[26];const w=y;let v;return e[27]!==t||e[28]!==r||e[29]!==f||e[30]!==w?(v=i.jsx("div",{className:"flex flex-col gap-0.5",children:f.map(j=>i.jsx(Js,{agent:t,home:r,prompt:j,allPromptNames:f.map(Xs),isPinned:w.has(j.name)},j.name))}),e[27]=t,e[28]=r,e[29]=f,e[30]=w,e[31]=v):v=e[31],v}function Xs(s){return s.name}function Gs(s){return s.name}function Vs(s){return{name:s.promptName,title:s.title,description:s.description}}function Zs(s){return{name:s.name,title:s.title,description:s.description}}function Js({agent:s,home:e,prompt:t,allPromptNames:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=s.metadata?.ui?.homePrompts;let d;Array.isArray(a)?d=n?a.filter(u=>u!==t.name):[...a,t.name]:d=n?r.filter(u=>u!==t.name):r;const m={...s.metadata??{},ui:{...s.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:t.title??Qe(t.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Ys(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},ei)}),s[0]=e):e=s[0],e}function ei(s,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const J=1,Ge=`home-board.layout.v${J}`;function Ve(s){return`home-board.layout.v${J}.${s}`}const Ze={version:J,tiles:{},hidden:[]};function ue(s){return!s||s.version!==J?Ze:{version:J,tiles:s.tiles??{},hidden:Array.isArray(s.hidden)?s.hidden:[]}}function ti(s){return Object.keys(s.tiles).length>0||s.hidden.length>0}function si(s){try{const e=localStorage.getItem(Ve(s));return e?ue(JSON.parse(e)):void 0}catch{return}}function _e(s,e){try{localStorage.setItem(Ve(s),JSON.stringify(e))}catch{}}async function Ce(s,e){if(!(await fetch(`/api/${s}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ii(s){const e=$.c(24),t=pe();let r;e[0]!==s?(r=oe.boardLayout(s),e[0]=s,e[1]=r):r=e[1];const n=r;let l;e[2]!==s?(l=si(s),e[2]=s,e[3]=l):l=e[3];const o=l;let c;e[4]!==o||e[5]!==s?(c=async()=>{const h=await fetch(`/api/${s}/kv/${Ge}`);if(h.status===404)return o&&ti(o)?(await Ce(s,o),o):Ze;if(!h.ok)throw new Error("Failed to load board layout");const y=await h.json(),w=ue(y.value);return _e(s,w),w},e[4]=o,e[5]=s,e[6]=c):c=e[6];let a;e[7]!==o||e[8]!==n||e[9]!==c?(a={queryKey:n,queryFn:c,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=c,e[10]=a):a=e[10];const{data:d,isLoading:m}=le(a);let u;e[11]!==s?(u={mutationFn:h=>Ce(s,h)},e[11]=s,e[12]=u):u=e[12];const p=ht(u);let g;e[13]!==p||e[14]!==s||e[15]!==t||e[16]!==n?(g=h=>{_e(s,h),t.setQueryData(n,h),p.mutate(h)},e[13]=p,e[14]=s,e[15]=t,e[16]=n,e[17]=g):g=e[17];const b=g;let x;e[18]!==d?(x=ue(d),e[18]=d,e[19]=x):x=e[19];let f;return e[20]!==m||e[21]!==b||e[22]!==x?(f={layout:x,isLoading:m,save:b},e[20]=m,e[21]=b,e[22]=x,e[23]=f):f=e[23],f}const Je=L.createContext(null);function ni(s){const e=$.c(24),{children:t}=s,{org:r}=V(),n=ii(r.slug),[l,o]=L.useState(!1),[c,a]=L.useState(null);let d;e[0]!==n.layout?(d=()=>{a(n.layout),o(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),o(!1)},e[2]=u):u=e[2];const p=u;let g;e[3]!==c||e[4]!==n?(g=()=>{c&&n.save(c),a(null),o(!1)},e[3]=c,e[4]=n,e[5]=g):g=e[5];const b=g,x=l&&c!==null,f=x?c:n.layout;let h;e[6]!==c||e[7]!==x||e[8]!==n.layout?(h=x?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=x,e[8]=n.layout,e[9]=h):h=e[9];const y=h;let w;e[10]!==l||e[11]!==n?(w=_=>{l?a(_):n.save(_)},e[10]=l,e[11]=n,e[12]=w):w=e[12];const v=w;let j;e[13]!==v||e[14]!==m||e[15]!==y||e[16]!==l||e[17]!==f||e[18]!==b||e[19]!==n.isLoading?(j={isEditMode:l,enter:m,cancel:p,save:b,hasChanges:y,layout:f,isLayoutLoading:n.isLoading,commitLayout:v},e[13]=v,e[14]=m,e[15]=y,e[16]=l,e[17]=f,e[18]=b,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==t||e[22]!==j?(N=i.jsx(Je.Provider,{value:j,children:t}),e[21]=t,e[22]=j,e[23]=N):N=e[23],N}function Ye(){const s=L.useContext(Je);if(!s)throw new Error("useHomeEdit must be used within a HomeEditProvider");return s}function ri({agentId:s}){const{org:e,locator:t}=V(),r=ee({connectionId:s,orgId:e.id,orgSlug:e.slug}),{create:n}=ds(),{setTaskId:l}=Wt(),[o,c]=L.useState(null),[a,d]=L.useState(!1),m=L.useRef(!1),u=async(f,h)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const y=await cs(r,f.name,h),w={type:"doc",content:[{type:"paragraph",content:[rs({id:f.name,name:os(f.name,ls(f._meta)),metadata:y.messages,char:"/",kind:"prompt",args:h}),{type:"text",text:" "}]}]},v=crypto.randomUUID();ms(sessionStorage,t,v,{tiptapDoc:w}),await n({id:v,virtual_mcp_id:s}),l(v,s,{autosend:!0})}catch(y){console.error("[start-thread-from-prompt] failed",y),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},p=async f=>{if(!m.current){if(f.arguments&&f.arguments.length>0){c(f);return}await u(f)}},g=async f=>{if(!o)return;const h=o;c(null),await u(h,f)};return{start:p,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const f=crypto.randomUUID();await n({id:f,virtual_mcp_id:s}),l(f,s)}catch(f){console.error("[start-thread-from-prompt] startBlank failed",f),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ns,{prompt:o,setPrompt:f=>c(f),onSubmit:g}),dialogPrompt:o,starting:a}}const G=4,X=100,Te=12,ie={S:{w:1,h:1},M:{w:1,h:2},T:{w:1,h:3},L:{w:2,h:1},XL:{w:2,h:2},LT:{w:2,h:3},XLT:{w:2,h:4},XXLT:{w:2,h:5},W:{w:4,h:1},WT:{w:4,h:3}},oi={S:"Small",M:"Tall",T:"Column",L:"Wide",XL:"Large",LT:"Showcase",XLT:"Display",XXLT:"Tower",W:"Full width",WT:"Hero"},Ee=["S","M","T","L","XL","LT","XLT","XXLT","W","WT"],li=ie.XL;class fe extends L.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,t){console.error("[home-tiles] tile crashed:",e,t.componentStack)}render(){return this.state.hasError?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(pt,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function ai(s){const e=$.c(72),{tiles:t,isEditMode:r,renderTile:n,onMove:l,onResize:o,onRemove:c}=s,a=ge(),d=L.useRef(null),[m,u]=L.useState(null),[p,g]=L.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={activationConstraint:{distance:4}},e[0]=b):b=e[0];const x=Oe(re(De,b),re(Re)),f=t.reduce(ci,0),h=r?Math.max(f+2,4):Math.max(f,1);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/G,cellHeight:X}:null},e[1]=y):y=e[1];const w=y;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=M=>{u(String(M.active.id)),g(w())},e[2]=v):v=e[2];const j=v;let N;e[3]!==p||e[4]!==l||e[5]!==t?(N=M=>{const F=String(M.active.id),P=p??w();if(u(null),g(null),!P||P.cellWidth<=0)return;const R=t.find(q=>q.id===F);if(!R)return;const U=Math.round(M.delta.x/P.cellWidth),B=Math.round(M.delta.y/P.cellHeight);U===0&&B===0||l(F,{x:R.x+U,y:R.y+B})},e[3]=p,e[4]=l,e[5]=t,e[6]=N):N=e[6];const _=N;if(a){let M;if(e[7]!==n||e[8]!==t){let P;e[10]!==n?(P=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:X},children:i.jsx(fe,{children:n(R)})},R.id),e[10]=n,e[11]=P):P=e[11],M=t.map(P),e[7]=n,e[8]=t,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let T,S,E,k,C,I,A,D,z;if(e[14]!==m||e[15]!==p||e[16]!==r||e[17]!==_||e[18]!==c||e[19]!==o||e[20]!==n||e[21]!==x||e[22]!==t||e[23]!==h){const M=m?t.find(Z=>Z.id===m):null;S=Pe,D=x,z=j,E=_;const F=h*X,P=r?X*4:X;let R;e[33]!==F||e[34]!==P?(R={height:F,minHeight:P},e[33]=F,e[34]=P,e[35]=R):R=e[35];let U;e[36]!==r||e[37]!==t||e[38]!==h?(U=r&&i.jsx(di,{rows:h,tiles:t}),e[36]=r,e[37]=t,e[38]=h,e[39]=U):U=e[39];let B;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==o||e[44]!==n||e[45]!==t){let Z;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==o||e[51]!==n?(Z=se=>i.jsx(ui,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:c,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=c,e[50]=o,e[51]=n,e[52]=Z):Z=e[52],B=t.map(Z),e[40]=m,e[41]=r,e[42]=c,e[43]=o,e[44]=n,e[45]=t,e[46]=B}else B=e[46];e[53]!==R||e[54]!==U||e[55]!==B?(k=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[U,B]}),e[53]=R,e[54]=U,e[55]=B,e[56]=k):k=e[56],T=Bt,C=null;const q=M&&p?M.w*p.cellWidth-Te:void 0,ae=M&&p?M.h*p.cellHeight-Te:void 0;e[57]!==q||e[58]!==ae?(I={width:q,height:ae},e[57]=q,e[58]=ae,e[59]=I):I=e[59],A=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(fe,{children:n(M)})}),e[14]=m,e[15]=p,e[16]=r,e[17]=_,e[18]=c,e[19]=o,e[20]=n,e[21]=x,e[22]=t,e[23]=h,e[24]=T,e[25]=S,e[26]=E,e[27]=k,e[28]=C,e[29]=I,e[30]=A,e[31]=D,e[32]=z}else T=e[24],S=e[25],E=e[26],k=e[27],C=e[28],I=e[29],A=e[30],D=e[31],z=e[32];let O;e[60]!==T||e[61]!==C||e[62]!==I||e[63]!==A?(O=i.jsx(T,{dropAnimation:C,style:I,children:A}),e[60]=T,e[61]=C,e[62]=I,e[63]=A,e[64]=O):O=e[64];let Q;return e[65]!==S||e[66]!==E||e[67]!==k||e[68]!==O||e[69]!==D||e[70]!==z?(Q=i.jsxs(S,{sensors:D,onDragStart:z,onDragEnd:E,children:[k,O]}),e[65]=S,e[66]=E,e[67]=k,e[68]=O,e[69]=D,e[70]=z,e[71]=Q):Q=e[71],Q}function ci(s,e){return Math.max(s,e.y+e.h)}function di(s){const e=$.c(7),{rows:t,tiles:r}=s;let n;e[0]!==r?(n=(a,d)=>r.some(m=>a>=m.x&&a<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const l=n;let o;if(e[2]!==l||e[3]!==t){o=[];for(let a=0;a<t;a++)for(let d=0;d<G;d++)l(d,a)||o.push({x:d,y:a});e[2]=l,e[3]=t,e[4]=o}else o=e[4];let c;return e[5]!==o?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(mi)}),e[5]=o,e[6]=c):c=e[6],c}function mi(s){return i.jsx("div",{className:"absolute p-1",style:{left:`${s.x/G*100}%`,top:s.y*X,width:`${1/G*100}%`,height:X},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${s.x}-${s.y}`)}function ui(s){const e=$.c(31),{tile:t,isEditMode:r,isDragging:n,onResize:l,onRemove:o,children:c}=s,a=!r;let d;e[0]!==a||e[1]!==t.id?(d={id:t.id,disabled:a},e[0]=a,e[1]=t.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:p,isDragging:g}=Ft(d),b=`${t.x/G*100}%`,x=`${t.w/G*100}%`,f=t.y*X,h=t.h*X,y=g||n,w=!y&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=y&&"opacity-30";let j;e[3]!==w||e[4]!==v?(j=K("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=j):j=e[5];let N;e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x?(N={left:b,top:f,width:x,height:h},e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=N):N=e[10];const _=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==_?(T=K("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",_),e[11]=_,e[12]=T):T=e[12];let S;e[13]!==u||e[14]!==r||e[15]!==p||e[16]!==o||e[17]!==l||e[18]!==t?(S=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...p,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:i.jsx(Fe,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(fi,{tile:t,onResize:l,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=p,e[16]=o,e[17]=l,e[18]=t,e[19]=S):S=e[19];let E;e[20]!==c?(E=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(fe,{children:c})}),e[20]=c,e[21]=E):E=e[21];let k;e[22]!==E||e[23]!==T||e[24]!==S?(k=i.jsxs("div",{className:T,children:[S,E]}),e[22]=E,e[23]=T,e[24]=S,e[25]=k):k=e[25];let C;return e[26]!==m||e[27]!==k||e[28]!==j||e[29]!==N?(C=i.jsx("div",{ref:m,className:j,style:N,children:k}),e[26]=m,e[27]=k,e[28]=j,e[29]=N,e[30]=C):C=e[30],C}function fi(s){const e=$.c(43),{tile:t,onResize:r,onRemove:n}=s,l=t.minW??1,o=t.minH??1;let c,a,d,m,u,p,g;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==t.h||e[4]!==t.id||e[5]!==t.w){let v;e[13]!==o||e[14]!==l?(v=S=>{const E=ie[S];return E.w>=l&&E.h>=o},e[13]=o,e[14]=l,e[15]=v):v=e[15];const j=Ee.filter(v);let N;e[16]!==t.h||e[17]!==t.w?(N=(()=>{for(const E of Ee){const k=ie[E];if(k.w===t.w&&k.h===t.h)return E}return null})(),e[16]=t.h,e[17]=t.w,e[18]=N):N=e[18];const _=N;a=us,e[19]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(fs,{asChild:!0,children:i.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:i.jsx(Tt,{size:16})})}),e[19]=g):g=e[19],c=hs,d="end",m="w-44",e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ps,{children:"Size"}),e[20]=u):u=e[20];let T;e[21]!==_||e[22]!==r||e[23]!==t.id?(T=S=>{const E=ie[S];return i.jsxs(Ne,{onSelect:()=>r(t.id,E),className:"flex items-center justify-between",children:[i.jsx("span",{children:oi[S]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:_===S?"✓":`${E.w}×${E.h}`})]},S)},e[21]=_,e[22]=r,e[23]=t.id,e[24]=T):T=e[24],p=j.map(T),e[0]=o,e[1]=l,e[2]=r,e[3]=t.h,e[4]=t.id,e[5]=t.w,e[6]=c,e[7]=a,e[8]=d,e[9]=m,e[10]=u,e[11]=p,e[12]=g}else c=e[6],a=e[7],d=e[8],m=e[9],u=e[10],p=e[11],g=e[12];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(xs,{}),e[25]=b):b=e[25];let x;e[26]!==n||e[27]!==t.id?(x=()=>n(t.id),e[26]=n,e[27]=t.id,e[28]=x):x=e[28];let f;e[29]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(gs,{size:14,className:"mr-2"}),e[29]=f):f=e[29];let h;e[30]!==x?(h=i.jsxs(Ne,{onSelect:x,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[30]=x,e[31]=h):h=e[31];let y;e[32]!==c||e[33]!==d||e[34]!==m||e[35]!==u||e[36]!==p||e[37]!==h?(y=i.jsxs(c,{align:d,className:m,children:[u,p,b,h]}),e[32]=c,e[33]=d,e[34]=m,e[35]=u,e[36]=p,e[37]=h,e[38]=y):y=e[38];let w;return e[39]!==a||e[40]!==y||e[41]!==g?(w=i.jsxs(a,{children:[g,y]}),e[39]=a,e[40]=y,e[41]=g,e[42]=w):w=e[42],w}function hi(s,e,t){return s.some(r=>e>=r.x&&e<r.x+r.w&&t>=r.y&&t<r.y+r.h)}function he(s,e,t){for(let r=0;r<100;r++)for(let n=0;n<=G-e;n++){let l=!0;for(let o=0;o<t&&l;o++)for(let c=0;c<e&&l;c++)hi(s,n+c,r+o)&&(l=!1);if(l)return{x:n,y:r}}return{x:0,y:0}}function ce(s,e,t={w:1,h:1}){const r=Math.max(t.w,Math.min(G,s)),n=Math.max(t.h,Math.min(6,e));return{w:r,h:n}}function de(s,e,t){const r=Math.max(0,Math.min(G-t,s)),n=Math.max(0,e);return{x:r,y:n}}function pi(s,e,t){const r=s.find(a=>a.id===e);if(!r)return s;const n=s.filter(a=>a.id!==e),l=n.find(a=>t.x>=a.x&&t.x<a.x+a.w&&t.y>=a.y&&t.y<a.y+a.h);if(l&&l.w===r.w&&l.h===r.h)return s.map(a=>a.id===e?{...a,x:l.x,y:l.y}:a.id===l.id?{...a,x:r.x,y:r.y}:a);const c=[{...r,x:t.x,y:t.y}];for(const a of n){const d=he(c,a.w,a.h);c.push({...a,x:d.x,y:d.y})}return c}function xi(s){const e=$.c(35),{layout:t,isLayoutLoading:r,commitLayout:n}=Ye();let l;e[0]!==t.hidden?(l=new Set(t.hidden),e[0]=t.hidden,e[1]=l):l=e[1];const o=l;let c,a;if(e[2]!==s||e[3]!==o||e[4]!==t.tiles){a=[];let y;e[7]!==o?(y=v=>v.pinned||!o.has(v.id),e[7]=o,e[8]=y):y=e[8];const w=s.filter(y);c=new Map;for(const v of s)v.minSize&&c.set(v.id,v.minSize);for(const v of w){const j=t.tiles[v.id];if(!j)continue;const N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),{x:S,y:E}=de(j.x,j.y,_);a.push({id:v.id,x:S,y:E,w:_,h:T,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(E=>E.id===v.id))continue;const j=v.defaultSize??li,N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),S=he(a,_,T);a.push({id:v.id,x:S.x,y:S.y,w:_,h:T,minW:N?.w,minH:N?.h})}e[2]=s,e[3]=o,e[4]=t.tiles,e[5]=c,e[6]=a}else c=e[5],a=e[6];let d;e[9]!==s?(d=new Set(s.map(gi)),e[9]=s,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(y,w)=>{const v={};for(const j of y)v[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:J,tiles:v,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const p=u;let g;e[14]!==a?(g={visible:a},e[14]=a,e[15]=g):g=e[15];let b;e[16]!==p||e[17]!==t||e[18]!==a?(b=(y,w)=>{const v=a.find(_=>_.id===y);if(!v)return;const j=de(w.x,w.y,v.w);if(j.x===v.x&&j.y===v.y)return;const N=pi(a,y,j);p(N,t.hidden)},e[16]=p,e[17]=t,e[18]=a,e[19]=b):b=e[19];let x;e[20]!==p||e[21]!==t||e[22]!==c||e[23]!==a?(x=(y,w)=>{const v=a.find(k=>k.id===y);if(!v)return;const j=c.get(y),{w:N,h:_}=ce(w.w,w.h,j);if(N===v.w&&_===v.h)return;const T={...v,w:N,h:_,x:de(v.x,v.y,N).x},S=a.filter(k=>k.id!==y),E=[T];for(const k of S){const C=he(E,k.w,k.h);E.push({...k,x:C.x,y:C.y})}p(E,t.hidden)},e[20]=p,e[21]=t,e[22]=c,e[23]=a,e[24]=x):x=e[24];let f;e[25]!==p||e[26]!==t||e[27]!==a?(f=y=>{const w=a.filter(v=>v.id!==y);p(w,Array.from(new Set([...t.hidden,y])))},e[25]=p,e[26]=t,e[27]=a,e[28]=f):f=e[28];let h;return e[29]!==r||e[30]!==g||e[31]!==b||e[32]!==x||e[33]!==f?(h={snapshot:g,isLoading:r,moveTile:b,resizeTile:x,hideTile:f},e[29]=r,e[30]=g,e[31]=b,e[32]=x,e[33]=f,e[34]=h):h=e[34],h}function gi(s){return s.id}const bi={w:2,h:4},yi={w:1,h:2},vi={w:1,h:1};function ji(s){return`prompt:${s.agentId}:${s.promptName||"blank"}`}function wi(s){return`tile:${s.agentId}:${s.resourceUri}`}function Ni(s){return s.promptName?s.agentName:s.description}function Si(s){return{name:s.promptName,title:s.title,description:s.description,arguments:s.arguments,_meta:s._meta}}function ve(s){const e=$.c(10);let t;e[0]!==s?(t={agentId:s},e[0]=s,e[1]=t):t=e[1];const{start:r,startBlank:n,dialog:l,starting:o}=ri(t);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(Si(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const a=c;let d;return e[5]!==l||e[6]!==a||e[7]!==n||e[8]!==o?(d={open:a,startBlank:n,dialog:l,starting:o},e[5]=l,e[6]=a,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function _i(s){const e=$.c(32),{entry:t,isEditMode:r}=s,{open:n,dialog:l,starting:o}=ve(t.agentId);let c;e[0]!==t||e[1]!==n?(c=()=>n(t),e[0]=t,e[1]=n,e[2]=c):c=e[2];const a=o||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let p;e[3]!==d||e[4]!==m||e[5]!==u?(p=K("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=p):p=e[6];let g;e[7]!==t.agentIcon||e[8]!==t.agentName?(g=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[7]=t.agentIcon,e[8]=t.agentName,e[9]=g):g=e[9];let b;e[10]!==t.title?(b=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:t.title}),e[10]=t.title,e[11]=b):b=e[11];let x;e[12]!==t?(x=Ni(t),e[12]=t,e[13]=x):x=e[13];let f;e[14]!==x?(f=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=f):f=e[15];let h;e[16]!==f||e[17]!==b?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[b,f]}),e[16]=f,e[17]=b,e[18]=h):h=e[18];let y;e[19]!==r?(y=!r&&i.jsx(as,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=r,e[20]=y):y=e[20];let w;e[21]!==o||e[22]!==c||e[23]!==h||e[24]!==y||e[25]!==a||e[26]!==p||e[27]!==g?(w=i.jsxs("button",{type:"button",onClick:c,disabled:a,"aria-busy":o,className:p,children:[g,h,y]}),e[21]=o,e[22]=c,e[23]=h,e[24]=y,e[25]=a,e[26]=p,e[27]=g,e[28]=w):w=e[28];let v;return e[29]!==l||e[30]!==w?(v=i.jsxs(i.Fragment,{children:[w,l]}),e[29]=l,e[30]=w,e[31]=v):v=e[31],v}function Ci(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Ti)}),s[0]=e):e=s[0],e}function Ti(s,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ei(s){const e=$.c(59),{tile:t,prompts:r,isEditMode:n,tileWidth:l}=s,{org:o}=V();let c;e[0]!==o.id||e[1]!==o.slug||e[2]!==t.connectionId?(c={connectionId:t.connectionId,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=t.connectionId,e[3]=c):c=e[3];const a=ee(c),{open:d,startBlank:m,dialog:u,starting:p}=ve(t.agentId);let g,b,x,f,h;if(e[4]!==a||e[5]!==n||e[6]!==d||e[7]!==o.id||e[8]!==r||e[9]!==m||e[10]!==p||e[11]!==t.agentIcon||e[12]!==t.agentName||e[13]!==t.maxHeight||e[14]!==t.minHeight||e[15]!==t.resourceUri||e[16]!==l){const v=r.filter(ki);f="flex h-full w-full flex-col gap-3 p-3";let j;e[22]!==m?(j=()=>{m()},e[22]=m,e[23]=j):j=e[23];const N=p||n,_=n&&"pl-10 pr-10";let T;e[24]!==_?(T=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",_),e[24]=_,e[25]=T):T=e[25];let S;e[26]!==t.agentIcon||e[27]!==t.agentName?(S=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[26]=t.agentIcon,e[27]=t.agentName,e[28]=S):S=e[28];let E;e[29]!==t.agentName?(E=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[29]=t.agentName,e[30]=E):E=e[30];const k=n?"Drag to rearrange":"Open chat";let C;e[31]!==k?(C=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=C):C=e[32];let I;e[33]!==E||e[34]!==C?(I=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[E,C]}),e[33]=E,e[34]=C,e[35]=I):I=e[35],e[36]!==p||e[37]!==T||e[38]!==S||e[39]!==I||e[40]!==j||e[41]!==N?(h=i.jsxs("button",{type:"button",onClick:j,disabled:N,"aria-busy":p,className:T,children:[S,I]}),e[36]=p,e[37]=T,e[38]=S,e[39]=I,e[40]=j,e[41]=N,e[42]=h):h=e[42],g="flex min-h-0 flex-1 gap-3 overflow-hidden";let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(Ii,{}),e[43]=A):A=e[43];const D=t.minHeight??200,z=t.maxHeight??4e3;e[44]!==a||e[45]!==o.id||e[46]!==D||e[47]!==z||e[48]!==t.resourceUri?(b=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(L.Suspense,{fallback:A,children:i.jsx(ts,{resourceURI:t.resourceUri,orgId:o.id,client:a,displayMode:"fullscreen",minHeight:D,maxHeight:z,className:"h-full"})})}),e[44]=a,e[45]=o.id,e[46]=D,e[47]=z,e[48]=t.resourceUri,e[49]=b):b=e[49],x=v.length>0&&!n&&l>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(O=>i.jsx("button",{type:"button",onClick:()=>d(O),disabled:p,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:O.title})},O.promptName))}),e[4]=a,e[5]=n,e[6]=d,e[7]=o.id,e[8]=r,e[9]=m,e[10]=p,e[11]=t.agentIcon,e[12]=t.agentName,e[13]=t.maxHeight,e[14]=t.minHeight,e[15]=t.resourceUri,e[16]=l,e[17]=g,e[18]=b,e[19]=x,e[20]=f,e[21]=h}else g=e[17],b=e[18],x=e[19],f=e[20],h=e[21];let y;e[50]!==g||e[51]!==b||e[52]!==x?(y=i.jsxs("div",{className:g,children:[b,x]}),e[50]=g,e[51]=b,e[52]=x,e[53]=y):y=e[53];let w;return e[54]!==u||e[55]!==f||e[56]!==h||e[57]!==y?(w=i.jsxs("div",{className:f,children:[h,y,u]}),e[54]=u,e[55]=f,e[56]=h,e[57]=y,e[58]=w):w=e[58],w}function ki(s){return!!s.promptName}function Ii(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),s[0]=e):e=s[0],e}function $i(s){const e=$.c(14),{icon:t,name:r}=s;let n;e[0]!==t||e[1]!==r?(n=i.jsx(Y,{icon:t,name:r,size:"sm+"}),e[0]=t,e[1]=r,e[2]=n):n=e[2];let l;e[3]!==r?(l=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let c;e[6]!==l?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[l,o]}),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==n||e[9]!==c?(a=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=a):a=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=d):d=e[11];let m;return e[12]!==a?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,d]}),e[12]=a,e[13]=m):m=e[13],m}function Ai(s){const e=$.c(33),{tile:t,prompts:r,isEditMode:n}=s,{open:l,startBlank:o,dialog:c,starting:a}=ve(t.agentId);let d,m,u;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==o||e[4]!==a||e[5]!==t.agentIcon||e[6]!==t.agentName){const g=r.filter(Mi);d="flex h-full w-full flex-col gap-3 p-4";let b;e[10]!==o?(b=()=>{o()},e[10]=o,e[11]=b):b=e[11];const x=a||n,f=n&&"pl-10 pr-10";let h;e[12]!==f?(h=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",f),e[12]=f,e[13]=h):h=e[13];let y;e[14]!==t.agentIcon||e[15]!==t.agentName?(y=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[14]=t.agentIcon,e[15]=t.agentName,e[16]=y):y=e[16];let w;e[17]!==t.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[17]=t.agentName,e[18]=w):w=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=v):v=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,v]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==b||e[24]!==x||e[25]!==h||e[26]!==y?(m=i.jsxs("button",{type:"button",onClick:b,disabled:x,className:h,children:[y,j]}),e[22]=j,e[23]=b,e[24]=x,e[25]=h,e[26]=y,e[27]=m):m=e[27],u=g.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:g.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&l(N),disabled:a,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=l,e[2]=r,e[3]=o,e[4]=a,e[5]=t.agentIcon,e[6]=t.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let p;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(p=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=p):p=e[32],p}function Mi(s){return!!s.promptName}function et(s){const e=$.c(36),{isEditMode:t}=s,{org:r}=V(),{isLoading:n,prompts:l,tiles:o}=ye(r.slug),c=He()?.ids??[];let a;e[0]!==c?(a=new Set(c),e[0]=c,e[1]=a):a=e[1];const d=a,m=Ue();let u;e[2]!==o?(u=new Set(o.map(Di)),e[2]=o,e[3]=u):u=e[3];const p=u;let g;if(e[4]!==l){g=new Map;for(const C of l){const I=g.get(C.agentId);I?I.push(C):g.set(C.agentId,[C])}e[4]=l,e[5]=g}else g=e[5];let b;if(e[6]!==l||e[7]!==p||e[8]!==o){let C;e[10]!==p?(C=A=>!p.has(A.agentId),e[10]=p,e[11]=C):C=e[11];const I=l.filter(C);b=[...o.map(Ri),...I.map(Oi)],e[6]=l,e[7]=p,e[8]=o,e[9]=b}else b=e[9];const x=b;let f;e[12]!==x?(f=new Map(x.map(zi)),e[12]=x,e[13]=f):f=e[13];const h=f;let y;e[14]!==x||e[15]!==d?(y=x.map(C=>({id:C.id,defaultSize:C.kind==="tile"?bi:vi,minSize:C.kind==="tile"?yi:void 0,pinned:d.has(C.data.agentId)})),e[14]=x,e[15]=d,e[16]=y):y=e[16];const w=xi(y);let v;e[17]!==m?(v=C=>{m.apply(I=>I.filter(A=>A!==C)).catch(Li)},e[17]=m,e[18]=v):v=e[18];const j=v;let N;e[19]!==h||e[20]!==w||e[21]!==d||e[22]!==j?(N=C=>{const I=h.get(C);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(C)},e[19]=h,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const _=N;let T;e[24]!==h||e[25]!==t||e[26]!==g?(T=C=>{const I=h.get(C.id);if(!I)return null;if(I.kind==="tile"){const A=g.get(I.data.agentId)??[];return i.jsx(xt,{fallback:i.jsx(Ai,{tile:I.data,prompts:A,isEditMode:t}),children:i.jsx(L.Suspense,{fallback:i.jsx($i,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ei,{tile:I.data,prompts:A,isEditMode:t,tileWidth:C.w})})})}return i.jsx(_i,{entry:I.data,isEditMode:t})},e[24]=h,e[25]=t,e[26]=g,e[27]=T):T=e[27];const S=T;if(n||w.isLoading){let C;return e[28]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ci,{}),e[28]=C):C=e[28],C}if(w.snapshot.visible.length===0&&!t)return null;let k;return e[29]!==t||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==_||e[34]!==S?(k=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ai,{tiles:w.snapshot.visible,isEditMode:t,renderTile:S,onMove:w.moveTile,onResize:w.resizeTile,onRemove:_})}),e[29]=t,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=_,e[34]=S,e[35]=k):k=e[35],k}function Li(){return W.error("Couldn't remove from home — please try again.")}function zi(s){return[s.id,s]}function Oi(s){return{kind:"prompt",id:ji(s),data:s}}function Ri(s){return{kind:"tile",id:wi(s),data:s}}function Di(s){return s.agentId}function Pi(s){const e=$.c(2),{prompts:t,tiles:r}=ye(s),n=r.length>0||t.length>0;let l;return e[0]!==n?(l={hasVisibleTiles:n},e[0]=n,e[1]=l):l=e[1],l}const ke=420,Ie=305;function tt(){const s=$.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:ke}}),s[0]=e):e=s[0];let t;s[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:ke}}),s[1]=t):t=s[1];let r;s[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),s[2]=r):r=s[2];let n;return s[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,t,r,i.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}})]}),s[3]=n):n=s[3],n}function $e(){const s=$.c(33),{data:e}=gt.useSession(),{org:t}=V(),r=ge(),n=At(),{selectedVirtualMcp:l}=Mt();let o;s[0]!==t.id?(o=yt(t.id),s[0]=t.id,s[1]=o):o=s[1];const a=l??o;let d;s[2]!==t.slug?(d=qt(t.slug),s[2]=t.slug,s[3]=d):d=s[3],le(d);let m;s[4]!==t.id||s[5]!==t.slug?(m={connectionId:Le,orgId:t.id,orgSlug:t.slug},s[4]=t.id,s[5]=t.slug,s[6]=m):m=s[6];const u=ee(m);let p;s[7]!==t.id||s[8]!==u?(p=bs(u,t.id),s[7]=t.id,s[8]=u,s[9]=p):p=s[9];let g;s[10]!==t.id||s[11]!==u?(g=Qt(u,t.id),s[10]=t.id,s[11]=u,s[12]=g):g=s[12];let b;s[13]!==a.id||s[14]!==t.id||s[15]!==u?(b=wt(t.id,a.id,u),s[13]=a.id,s[14]=t.id,s[15]=u,s[16]=b):b=s[16];let x;s[17]!==p||s[18]!==g||s[19]!==b?(x={queries:[p,g,b]},s[17]=p,s[18]=g,s[19]=b,s[20]=x):x=s[20],Ss(x);const f=ys(),h=Nt(a.id),{hasDecoKey:y,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:j,hasOnlyDecoProvider:N}=kt(),{hasVisibleTiles:_}=Pi(t.slug),T=It(h?.metadata);if(f.length===0&&!(T&&$t(n))){let O;return s[21]===Symbol.for("react.memo_cache_sentinel")?(O=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Lt,{})})}),s[21]=O):O=s[21],O}let E;s[22]!==e?.user?.name?(E=e?.user?.name?.split(" ")[0]||"there",s[22]=e?.user?.name,s[23]=E):E=s[23];const k=E,C=y&&v&&j!=null,I=y&&w&&N;let A;s[24]!==j||s[25]!==C||s[26]!==I?(A=C?i.jsx(ne.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(ne.NoCreditsEyebrow,{}):null,s[24]=j,s[25]=C,s[26]=I,s[27]=A):A=s[27];const D=A;let z;return s[28]!==D||s[29]!==_||s[30]!==r||s[31]!==k?(z=i.jsx(ni,{children:r?i.jsx(Hi,{eyebrow:D,userName:k}):i.jsx(Ui,{eyebrow:D,userName:k,hasVisibleTiles:_})}),s[28]=D,s[29]=_,s[30]=r,s[31]=k,s[32]=z):z=s[32],z}function Hi(s){const e=$.c(12),{eyebrow:t,userName:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(tt,{}),e[0]=n):n=e[0];let l;e[1]!==t?(l=t&&i.jsx("div",{className:"mb-4",children:t}),e[1]=t,e[2]=l):l=e[2];let o;e[3]!==r?(o=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=o):o=e[4];let c;e[5]!==l||e[6]!==o?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[l,o]}),e[5]=l,e[6]=o,e[7]=c):c=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ne.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(et,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,a,d]}),e[10]=c,e[11]=m):m=e[11],m}function Ui(s){const e=$.c(32),{eyebrow:t,userName:r,hasVisibleTiles:n}=s,{isEditMode:l,enter:o,save:c,cancel:a,hasChanges:d}=Ye(),[m,u]=L.useState(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!0),e[0]=p):p=e[0];let g;e[1]!==a||e[2]!==o||e[3]!==d||e[4]!==l||e[5]!==c?(g=i.jsx(vs.Right,{children:i.jsx(Bi,{isEditMode:l,hasChanges:d,onEnter:o,onSave:c,onCancel:a,onAddTile:p})}),e[1]=a,e[2]=o,e[3]=d,e[4]=l,e[5]=c,e[6]=g):g=e[6];let b;e[7]!==m?(b=i.jsx(_s,{open:m,onOpenChange:u}),e[7]=m,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(tt,{}),e[9]=x):x=e[9];const f=n||l?"pt-32":"flex-1 justify-center";let h;e[10]!==f?(h=K("relative flex flex-col items-center px-10 pb-4",f),e[10]=f,e[11]=h):h=e[11];let y;e[12]!==t?(y=t&&i.jsx("div",{className:"mb-4",children:t}),e[12]=t,e[13]=y):y=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let v;e[16]!==y||e[17]!==w?(v=i.jsxs("div",{className:"text-center mb-10",children:[y,w]}),e[16]=y,e[17]=w,e[18]=v):v=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Fi,{}),i.jsx(ne.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==v?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,j]}),e[20]=v,e[21]=N):N=e[21];let _;e[22]!==l?(_=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(et,{isEditMode:l})}),e[22]=l,e[23]=_):_=e[23];let T;e[24]!==N||e[25]!==_||e[26]!==h?(T=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:h,children:[N,_]})})]}),e[24]=N,e[25]=_,e[26]=h,e[27]=T):T=e[27];let S;return e[28]!==T||e[29]!==g||e[30]!==b?(S=i.jsxs(i.Fragment,{children:[g,b,T]}),e[28]=T,e[29]=g,e[30]=b,e[31]=S):S=e[31],S}function Bi(s){const e=$.c(17),{isEditMode:t,hasChanges:r,onEnter:n,onSave:l,onCancel:o,onAddTile:c}=s;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(be,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[m,"Add tile"]}),e[1]=c,e[2]=u):u=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(ze,{size:14}),e[3]=p):p=e[3];let g;e[4]!==o?(g=i.jsxs(we,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[p,"Cancel"]}),e[4]=o,e[5]=g):g=e[5];const b=!r;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(St,{size:14}),e[6]=x):x=e[6];let f;e[7]!==l||e[8]!==b?(f=i.jsxs(we,{size:"sm",onClick:l,disabled:b,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=l,e[8]=b,e[9]=f):f=e[9];let h;return e[10]!==u||e[11]!==g||e[12]!==f?(h=i.jsxs(i.Fragment,{children:[u,g,f]}),e[10]=u,e[11]=g,e[12]=f,e[13]=h):h=e[13],h}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Et,{size:14}),e[14]=a):a=e[14];let d;return e[15]!==n?(d=i.jsxs("button",{type:"button",onClick:n,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[a,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Fi(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),s[0]=e):e=s[0],e}function Vr(){const s=$.c(2);if(ge()){let r;return s[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx($e,{})}),s[0]=r):r=s[0],r}let t;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx($e,{})})})}),s[1]=t):t=s[1],t}export{Vr as default};
@@ -1,4 +1,4 @@
1
- import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as rs,d as ls,t as xt,E as os}from"./index-CM4eUM9Q.js";import{S as as}from"./search-input-Br9hH5ca.js";import{P as Me}from"./index-B55sS7_E.js";import{E as wt}from"./empty-state-C-Vzaz3T.js";import{R as ns}from"./require-capability-D0GS6z32.js";import{B as rt}from"./badge-BvUmM76z.js";import{P as ct,a as dt,b as mt}from"./popover-pbPJblFP.js";import{b as Ze,T as et,a as tt}from"./tooltip-c0JCK6eh.js";import{i as ft}from"./Check-BTi6aK2O.js";import{a as Xe}from"./Eye-D-e14RXi.js";import{n as Mt}from"./Globe01-D0-2dr7e.js";import{i as Vt}from"./FilterLines-Ceib5U8s.js";import{i as is}from"./Key01-DJjMsflU.js";import{i as cs}from"./Play-BHXb_TUr.js";import{a6 as ds,a7 as ms,O as us,D as xs}from"./agent-icon-B_Sssulg.js";import{M as _t}from"./monaco-editor-CB_L5Q_g.js";import{u as fs}from"./use-members-BpSAkPCJ.js";import{u as Dt}from"./use-connection-Bna7-Lpr.js";import{S as St,u as It,W as ps}from"./constants-DVPpd9QA.js";import{a as hs}from"./use-virtual-mcp-BA-W1Vhc.js";import{n as Qe}from"./Container-DqZ7iXxp.js";import{c as gs}from"./SwitchHorizontal01-Dc6vSFgX.js";import{s as js}from"./Plus-DTBFvoZ4.js";import{s as vs}from"./Trash01-4Ps74tkv.js";import{I as Ge}from"./input-DwZNdPHy.js";import{g as Ns,b as Lt,f as st,a as Ut,c as pt,d as bs,e as Ft,h as Kt,A as ys,T as ws,i as Ss,M as ht}from"./automation-runs-BB3z--MX.js";import{S as lt,a as ot,b as at,c as Fe,d as nt}from"./select-DUB_e2wA.js";import{S as Is}from"./scroll-area-DMpuHtIE.js";import{t as qt}from"./ChevronDown-BZRrL23D.js";import{C as Cs}from"./calendar-DPPkP_2t.js";import{T as ks}from"./textarea-DHyB0Smt.js";import{C as Bt}from"./collection-tabs-BWubNGTM.js";import{S as Ts}from"./switch-CEixFBdL.js";import{L as Ms}from"./label-4oCFH30G.js";import{I as qe}from"./integration-icon-CBe2H1CK.js";import{A as Ht}from"./avatar-O1JcTGgG.js";import{A as _s,a as Ds,b as Ls}from"./alert-D5REShaT.js";import{C as Jt}from"./card-fKzJiL4z.js";import{K as ke}from"./monitoring-stats-row-CmyF_9mp.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-ojQaNUtI.js";import{d as Rs,S as Os,a as zs,b as Es}from"./sheet-CQuYX4pr.js";import{T as De,a as ut,b as Gt,c as Qt,d as Wt,e as oe}from"./table-BwGGIiJ5.js";import{n as As}from"./ChevronUp-DhRFiyWk.js";import{u as Ps}from"./use-infinite-scroll-BmCBqG2s.js";import{c as Vs,b as Us}from"./use-automations-D_GOMI0Y.js";import"./SearchMd-CbQiai92.js";import"./sidebar-CUicHm9C.js";import"./LayoutLeft-DC99mmKb.js";import"./use-capability-D2Lekzsm.js";import"./access-gate-jSqFnrGs.js";import"./capability-load-error-H04-IMSf.js";import"./AlertCircle-dzvWxujb.js";import"./Tool01-B6ELFGh-.js";import"./RefreshCcw01-BDUToMVd.js";import"./XCircle-BKXSa_VQ.js";import"./ArrowUpRight-CBMu0EOf.js";import"./ZapSquare-rvBlc1j-.js";import"./Users03-BkEliyJ2.js";import"./CheckCircle-C24wnP2Z.js";import"./ChevronLeft-DEtz4dkO.js";import"./ChevronRight-Ddjtetki.js";import"./DotsVertical-DmUaYhK2.js";import"./ZoomOut-Dk_N18Ki.js";import"./Star01-CVzgxp1x.js";import"./Palette-C1AASxx2.js";import"./HardDrive-iB6HZdkm.js";import"./Stars02-XWO6H1Re.js";import"./LinkExternal01-BpZEkrD7.js";import"./Monitor01-C8q7RxXu.js";import"./Sun-CbEJ7xkn.js";import"./Settings02-Bu96rwA_.js";import"./Shield01-knE-M4LE.js";import"./Stars01-CDWeKJ6M.js";import"./Upload01-CnrDySm1.js";import"./User01-BA7YwKC-.js";import"./Users01-DvcVTQ1g.js";import"./XClose-D_AWgVIk.js";import"./X-Ch1EyNal.js";import"./Zap-C_lJ1cEb.js";import"./index-C34u6PSm.js";import"./spinner-d6yvFwOg.js";import"./use-org-auth-client-NzYQ0X0A.js";import"./use-collections-BdrLE9lf.js";import"./useInfiniteQuery-CNKhmBjK.js";import"./infiniteQueryObserver-UgK429qS.js";import"./task-status-Cu-l7Iv4.js";import"./checkbox-BBA-baQg.js";import"./command-eY3hMYWt.js";import"./index-C6H2oubI.js";import"./dialog-zrSzj7TD.js";import"./pair-BUKInYHO.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-9jbZNRel.js";import"./file-type-icon-BPZ9mx_j.js";import"./content-blocks-o63cs2vh.js";import"./types-BqTbtprH.js";import"./chat-context-BmIMIbdZ.js";import"./tab-id-DvasrPZC.js";import"./decopilot-sse-pool-BSh6nGrY.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-ClrNZ9KV.js";import"./use-organization-settings-oXVZ3xqu.js";import"./shell-layout-iqX4bmcb.js";import"./required-auth-layout-DHWUJ_wT.js";import"./useRouterState-wqO08_go.js";import"./use-org-sso-CM2A8YLV.js";import"./use-navigate-to-agent-CLGcl9A6.js";import"./use-mcp-prompts-zOwt9lRN.js";import"./form-DwvvaWfd.js";import"./index-tJpcknvZ.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function Ks(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{e as le,r as K,f as bt,q as Be,j as t,B as Z,o as Ce,c as ce,K as it,n as yt,v as rs,d as ls,t as xt,E as os}from"./index-D9kgGhq4.js";import{S as as}from"./search-input-zYIhXOXh.js";import{P as Me}from"./index-DxocBsWJ.js";import{E as wt}from"./empty-state-DgETnZaU.js";import{R as ns}from"./require-capability-C9yFB8dG.js";import{B as rt}from"./badge-BoRJ8tO_.js";import{P as ct,a as dt,b as mt}from"./popover-Ar-4ozUT.js";import{b as Ze,T as et,a as tt}from"./tooltip-M08maXcg.js";import{i as ft}from"./Check-o-zUju1W.js";import{a as Xe}from"./Eye-CwmAmEba.js";import{n as Mt}from"./Globe01-BQiH4pzR.js";import{i as Vt}from"./FilterLines-_2tlTach.js";import{i as is}from"./Key01-BVH8DPhU.js";import{i as cs}from"./Play-DitjUfoa.js";import{a6 as ds,a7 as ms,O as us,D as xs}from"./agent-icon-zrokvqQM.js";import{M as _t}from"./monaco-editor-Da7GwOd2.js";import{u as fs}from"./use-members-BGhv-lqQ.js";import{u as Dt}from"./use-connection-fZwsgZBE.js";import{S as St,u as It,W as ps}from"./constants-D6Bbr6AT.js";import{a as hs}from"./use-virtual-mcp-C7J9vBIx.js";import{n as Qe}from"./Container-BI041HGs.js";import{c as gs}from"./SwitchHorizontal01-K-7T5m4d.js";import{s as js}from"./Plus-BFGy0Ag-.js";import{s as vs}from"./Trash01-Cx3OtqBr.js";import{I as Ge}from"./input-D8kdtiC4.js";import{g as Ns,b as Lt,f as st,a as Ut,c as pt,d as bs,e as Ft,h as Kt,A as ys,T as ws,i as Ss,M as ht}from"./automation-runs-C41UnlIL.js";import{S as lt,a as ot,b as at,c as Fe,d as nt}from"./select-BMTzbu3R.js";import{S as Is}from"./scroll-area-B0QeeQ1W.js";import{t as qt}from"./ChevronDown-CNy49i0W.js";import{C as Cs}from"./calendar-CNghNFxX.js";import{T as ks}from"./textarea-B24VAXi2.js";import{C as Bt}from"./collection-tabs-C3D4x7Aa.js";import{S as Ts}from"./switch-Mi9vrG7L.js";import{L as Ms}from"./label-BpJD7y8S.js";import{I as qe}from"./integration-icon-DOYIIElF.js";import{A as Ht}from"./avatar-CFgeYzCR.js";import{A as _s,a as Ds,b as Ls}from"./alert-aloz1Luc.js";import{C as Jt}from"./card-BXlKgMlf.js";import{K as ke}from"./monitoring-stats-row-DMC3Qfgg.js";import{g as Fs}from"./connection-slug-eyAPH6o3.js";import{u as $s}from"./useSuspenseInfiniteQuery-CoKhcfdG.js";import{d as Rs,S as Os,a as zs,b as Es}from"./sheet-BcNA728n.js";import{T as De,a as ut,b as Gt,c as Qt,d as Wt,e as oe}from"./table-DSgZcufa.js";import{n as As}from"./ChevronUp-CItZiPxX.js";import{u as Ps}from"./use-infinite-scroll-DxKK_1jX.js";import{c as Vs,b as Us}from"./use-automations-DkHpblle.js";import"./SearchMd-DcUQwid2.js";import"./sidebar-Bk2jzyI-.js";import"./LayoutLeft-DNYnEEyq.js";import"./use-capability-COb_RW9L.js";import"./access-gate-GaKCibnP.js";import"./capability-load-error-CZ-9nVZ5.js";import"./AlertCircle-Dm12nF6o.js";import"./Tool01-D2UZ1Vs-.js";import"./RefreshCcw01-86h90ufT.js";import"./XCircle-h_tDVdAY.js";import"./ArrowUpRight-GdT2goj_.js";import"./ZapSquare-BZ8deXpK.js";import"./Users03-DcPZW8td.js";import"./CheckCircle-BkEI7gFR.js";import"./ChevronLeft-BswR_fSO.js";import"./ChevronRight-BgIn57eH.js";import"./DotsVertical-DpyQCfpE.js";import"./ZoomOut-CpLnwBO_.js";import"./Star01-DH1c5eP5.js";import"./Palette-vdpnI3pe.js";import"./HardDrive-BExU4NVN.js";import"./Stars02-CON7obeQ.js";import"./LinkExternal01-XNIU6-cE.js";import"./Monitor01-20Eh6WBW.js";import"./Sun-BLdidlza.js";import"./Settings02-CK5ZrDud.js";import"./Shield01-DymXSrLL.js";import"./Stars01-9ek2YoUP.js";import"./Upload01-5227NVpL.js";import"./User01-Dm1O7yuK.js";import"./Users01-D9KQz9Jg.js";import"./XClose-DRKdv4XS.js";import"./X-BQQplvP0.js";import"./Zap-B0rZ1Af9.js";import"./index-BvwjdL6f.js";import"./spinner-Bniq-hdg.js";import"./use-org-auth-client-BnMgTkv9.js";import"./use-collections-Dx8F5dop.js";import"./useInfiniteQuery-moOazGP7.js";import"./infiniteQueryObserver-BaYvuSQm.js";import"./task-status-jQFHPQ2F.js";import"./checkbox-B-gaLjHk.js";import"./command-BFycs2Kb.js";import"./index-BvzS7IRp.js";import"./dialog-CB0bO41l.js";import"./pair-DyoQ9qQT.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ND5nyTQq.js";import"./file-type-icon-DFx7UFpB.js";import"./content-blocks-o63cs2vh.js";import"./types-C_6yTm2K.js";import"./chat-context-DV1OjViY.js";import"./tab-id-DoHEKhGX.js";import"./decopilot-sse-pool-Ce0jkp4a.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-DgHf7F2h.js";import"./use-organization-settings-DcOZmJjR.js";import"./shell-layout-pG6XpLJU.js";import"./required-auth-layout-DFiOpH8z.js";import"./useRouterState-iQdkmhiX.js";import"./use-org-sso-BtiGW1BY.js";import"./use-navigate-to-agent-ImCQRVux.js";import"./use-mcp-prompts-DwWf_cps.js";import"./form-Ct0PcXXO.js";import"./index-cadeU-4K.js";const vt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Le(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function Ks(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function $t(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function qs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=vt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,vt.maxJsonRenderSize)+`
4
4
 
@@ -1,3 +1,3 @@
1
- import{e as S,r as E,j as t,n as J,B as T,K as M,c as Y,f as Ce,d as Se,E as re,q as $e,F as Ge,z as Xe,o as I}from"./index-CM4eUM9Q.js";import{i as Qe}from"./ChevronRight-Ddjtetki.js";import{s as De}from"./Eye-D-e14RXi.js";import{n as ae,i as We}from"./Globe01-D0-2dr7e.js";import{a as Ye,c as Ze}from"./ZoomOut-Dk_N18Ki.js";import{s as Je}from"./Plus-DTBFvoZ4.js";import{t as et}from"./Stars01-CDWeKJ6M.js";import{i as ze}from"./Upload01-CnrDySm1.js";import{b as K,T as V,a as q,u as Fe}from"./tooltip-c0JCK6eh.js";import{A as tt,a as lt,b as st,c as nt,d as it,e as rt,f as ot,g as at}from"./alert-dialog-6ai-9HnX.js";import{c as Z,D as ce,a as de,f as ct,b as dt,e as ft,d as mt}from"./dialog-zrSzj7TD.js";import{I as ut}from"./input-DwZNdPHy.js";import{S as H}from"./skeleton-CaDhIMN5.js";import{F as A,d as _e,M as ht}from"./file-type-icon-BPZ9mx_j.js";import{a as xt}from"./toolbar-NS6fUdLE.js";import{u as Oe,b as Pe,H as Te,e as Ue,f as Ae,a as fe,F as Ee,d as me,h as Me,c as pt,i as ye,j as jt,k as Le,l as gt}from"./header-tab-button-ziMK8DeX.js";import{i as ue}from"./DotsVertical-DmUaYhK2.js";import{s as he}from"./Trash01-4Ps74tkv.js";import{i as Re}from"./Zap-C_lJ1cEb.js";import{a as xe,c as X,b as pe,D as je}from"./dropdown-menu-Dp0AYb5Q.js";import{R as ve,a as bt,b as yt}from"./resizable-DhLCux-y.js";import{n as Be}from"./LinkExternal01-BpZEkrD7.js";import{s as Ie}from"./XClose-D_AWgVIk.js";import{i as vt}from"./X-Ch1EyNal.js";import"./Check-BTi6aK2O.js";import"./ChevronLeft-DEtz4dkO.js";import"./LayoutLeft-DC99mmKb.js";import"./index-C34u6PSm.js";const wt=new Set(["output","upload","public","home"]),Nt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function kt(l){return wt.has(l)||!Nt.test(l)?"home":l}function Ct(l){const e=S.c(33);let s,i,o;e[0]!==l?({glyph:s,readOnly:o,...i}=l,e[0]=l,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);const c=E.useId(),r=`${c}-back`,a=`${c}-front`,n=`url(#${r})`;let d;e[4]!==n?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:n}),e[4]=n,e[5]=d):d=e[5];const m=`url(#${a})`;let f;e[6]!==m?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:m}),e[6]=m,e[7]=f):f=e[7];let u,g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),g=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),b=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=u,e[9]=g,e[10]=b):(u=e[8],g=e[9],b=e[10]);let p;e[11]!==s?(p=s&&t.jsx(s,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==o?(x=o&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(De,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=o,e[14]=x):x=e[14];let h,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),N=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=h,e[16]=N):(h=e[15],N=e[16]);let v;e[17]!==r?(v=t.jsxs("linearGradient",{id:r,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[h,N]}),e[17]=r,e[18]=v):v=e[18];let w,j;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("stop",{stopColor:"#72B6FA"}),j=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=w,e[20]=j):(w=e[19],j=e[20]);let C;e[21]!==a?(C=t.jsxs("radialGradient",{id:a,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[w,j]}),e[21]=a,e[22]=C):C=e[22];let k;e[23]!==v||e[24]!==C?(k=t.jsxs("defs",{children:[v,C]}),e[23]=v,e[24]=C,e[25]=k):k=e[25];let $;return e[26]!==i||e[27]!==k||e[28]!==d||e[29]!==f||e[30]!==p||e[31]!==x?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,u,g,b,p,x,k]}),e[26]=i,e[27]=k,e[28]=d,e[29]=f,e[30]=p,e[31]=x,e[32]=$):$=e[32],$}function St(l){const e={};for(const s of l.split(`
1
+ import{e as S,r as E,j as t,n as J,B as T,K as M,c as Y,f as Ce,d as Se,E as re,q as $e,F as Ge,z as Xe,o as I}from"./index-D9kgGhq4.js";import{i as Qe}from"./ChevronRight-BgIn57eH.js";import{s as De}from"./Eye-CwmAmEba.js";import{n as ae,i as We}from"./Globe01-BQiH4pzR.js";import{a as Ye,c as Ze}from"./ZoomOut-CpLnwBO_.js";import{s as Je}from"./Plus-BFGy0Ag-.js";import{t as et}from"./Stars01-9ek2YoUP.js";import{i as ze}from"./Upload01-5227NVpL.js";import{b as K,T as V,a as q,u as Fe}from"./tooltip-M08maXcg.js";import{A as tt,a as lt,b as st,c as nt,d as it,e as rt,f as ot,g as at}from"./alert-dialog-BoYEsobC.js";import{c as Z,D as ce,a as de,f as ct,b as dt,e as ft,d as mt}from"./dialog-CB0bO41l.js";import{I as ut}from"./input-D8kdtiC4.js";import{S as H}from"./skeleton-FanER5WJ.js";import{F as A,d as _e,M as ht}from"./file-type-icon-DFx7UFpB.js";import{a as xt}from"./toolbar-FU-ITy2s.js";import{u as Oe,b as Pe,H as Te,e as Ue,f as Ae,a as fe,F as Ee,d as me,h as Me,c as pt,i as ye,j as jt,k as Le,l as gt}from"./header-tab-button-B8QItw7F.js";import{i as ue}from"./DotsVertical-DpyQCfpE.js";import{s as he}from"./Trash01-Cx3OtqBr.js";import{i as Re}from"./Zap-B0rZ1Af9.js";import{a as xe,c as X,b as pe,D as je}from"./dropdown-menu-Ci6fdZ_l.js";import{R as ve,a as bt,b as yt}from"./resizable-CqxuHIEF.js";import{n as Be}from"./LinkExternal01-XNIU6-cE.js";import{s as Ie}from"./XClose-DRKdv4XS.js";import{i as vt}from"./X-BQQplvP0.js";import"./Check-o-zUju1W.js";import"./ChevronLeft-BswR_fSO.js";import"./LayoutLeft-DNYnEEyq.js";import"./index-BvwjdL6f.js";const wt=new Set(["output","upload","public","home"]),Nt=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function kt(l){return wt.has(l)||!Nt.test(l)?"home":l}function Ct(l){const e=S.c(33);let s,i,o;e[0]!==l?({glyph:s,readOnly:o,...i}=l,e[0]=l,e[1]=s,e[2]=i,e[3]=o):(s=e[1],i=e[2],o=e[3]);const c=E.useId(),r=`${c}-back`,a=`${c}-front`,n=`url(#${r})`;let d;e[4]!==n?(d=t.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:n}),e[4]=n,e[5]=d):d=e[5];const m=`url(#${a})`;let f;e[6]!==m?(f=t.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:m}),e[6]=m,e[7]=f):f=e[7];let u,g,b;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),g=t.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:"#84CDFB"}),b=t.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:"#84CDFB"}),e[8]=u,e[9]=g,e[10]=b):(u=e[8],g=e[9],b=e[10]);let p;e[11]!==s?(p=s&&t.jsx(s,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:"#014AC9",opacity:.55}}),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==o?(x=o&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),t.jsx(De,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),e[13]=o,e[14]=x):x=e[14];let h,N;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("stop",{offset:"0.3",stopColor:"#4D87DF"}),N=t.jsx("stop",{offset:"1",stopColor:"#296FE8"}),e[15]=h,e[16]=N):(h=e[15],N=e[16]);let v;e[17]!==r?(v=t.jsxs("linearGradient",{id:r,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[h,N]}),e[17]=r,e[18]=v):v=e[18];let w,j;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("stop",{stopColor:"#72B6FA"}),j=t.jsx("stop",{offset:"1",stopColor:"#5BB1EF"}),e[19]=w,e[20]=j):(w=e[19],j=e[20]);let C;e[21]!==a?(C=t.jsxs("radialGradient",{id:a,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[w,j]}),e[21]=a,e[22]=C):C=e[22];let k;e[23]!==v||e[24]!==C?(k=t.jsxs("defs",{children:[v,C]}),e[23]=v,e[24]=C,e[25]=k):k=e[25];let $;return e[26]!==i||e[27]!==k||e[28]!==d||e[29]!==f||e[30]!==p||e[31]!==x?($=t.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...i,children:[d,f,u,g,b,p,x,k]}),e[26]=i,e[27]=k,e[28]=d,e[29]=f,e[30]=p,e[31]=x,e[32]=$):$=e[32],$}function St(l){const e={};for(const s of l.split(`
2
2
  `)){const i=s.match(/^([A-Za-z][\w-]*):\s*(.*)$/);i?.[1]&&i[2]!==void 0&&(e[i[1].toLowerCase()]=i[2].trim())}return e}function we(l){for(const e of l.split(/\n\s*\n/)){const s=e.trim();if(!(!s||s.startsWith("#")))return s.replace(/\n/g," ")}return null}function He(l){const e=l.match(/^---\n([\s\S]*?)\n---\n?/);if(!e||e[1]===void 0)return{name:null,description:we(l),body:l};const s=St(e[1]),i=l.slice(e[0].length);return{name:s.name||null,description:s.description||we(i),body:i}}const $t=new Set(["png","jpg","jpeg","gif","webp","svg","avif"]),Dt=new Set(["csv","tsv"]),zt=new Set(["mp4","webm","mov","m4v"]),Ft=new Set(["txt","md","markdown","json","log","yaml","yml","xml","html","htm"]),_t=256*1024;function ee(l){const e=new Date(l);if(Number.isNaN(e.getTime()))return"";const s=Date.now()-e.getTime(),i=Math.floor(s/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const c=Math.floor(o/24);return c<30?`${c}d ago`:e.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ot(l){return l.split(".").pop()?.toLowerCase()??""}function Ke(l){const e=S.c(15),{downloadUrl:s,filename:i,onDelete:o}=l,c=`Actions for ${i}`;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ue,{size:14}),e[0]=r):r=e[0];let a;e[1]!==c?(a=t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Tt,"aria-label":c,children:r})}),e[1]=c,e[2]=a):a=e[2];let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ae,{size:14}),e[3]=n):n=e[3];let d;e[4]!==s||e[5]!==i?(d=t.jsx(X,{asChild:!0,children:t.jsxs("a",{href:s,download:i,children:[n,"Download"]})}),e[4]=s,e[5]=i,e[6]=d):d=e[6];let m;e[7]!==o?(m=o&&t.jsxs(X,{variant:"destructive",onClick:o,children:[t.jsx(he,{size:14}),"Delete"]}),e[7]=o,e[8]=m):m=e[8];let f;e[9]!==d||e[10]!==m?(f=t.jsxs(pe,{align:"end",onClick:Pt,children:[d,m]}),e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==a||e[13]!==f?(u=t.jsxs(je,{children:[a,f]}),e[12]=a,e[13]=f,e[14]=u):u=e[14],u}function Pt(l){return l.stopPropagation()}function Tt(l){return l.stopPropagation()}function te(l){const e=S.c(9),{onOpen:s,children:i,className:o}=l;let c;e[0]!==s?(c=n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),s())},e[0]=s,e[1]=c):c=e[1];let r;e[2]!==o?(r=Y("group/card flex cursor-pointer flex-col gap-3 rounded-2xl border border-border bg-background p-4 text-left transition-colors hover:border-border hover:bg-muted/40",o),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==s||e[6]!==c||e[7]!==r?(a=t.jsx("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:c,className:r,children:i}),e[4]=i,e[5]=s,e[6]=c,e[7]=r,e[8]=a):a=e[8],a}function le(l){const e=S.c(16),{icon:s,name:i,meta:o,subtitle:c,actions:r}=l;let a;e[0]!==i?(a=t.jsx("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",title:i,children:i}),e[0]=i,e[1]=a):a=e[1];let n;e[2]!==o?(n=o&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=n):n=e[3];let d;e[4]!==a||e[5]!==n?(d=t.jsxs("div",{className:"flex items-start gap-3",children:[a,n]}),e[4]=a,e[5]=n,e[6]=d):d=e[6];let m;e[7]!==c?(m=c&&t.jsx("span",{className:"text-xs text-muted-foreground",children:c}),e[7]=c,e[8]=m):m=e[8];let f;e[9]!==d||e[10]!==m?(f=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[d,m]}),e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==r||e[13]!==s||e[14]!==f?(u=t.jsxs("div",{className:"flex w-full items-center gap-2.5",children:[s,f,r]}),e[12]=r,e[13]=s,e[14]=f,e[15]=u):u=e[15],u}function se(l){const e=S.c(15),{name:s,meta:i,subtitle:o,glyph:c,readOnly:r,onOpen:a,onDelete:n}=l;let d;e[0]!==c||e[1]!==r?(d=t.jsx(Ct,{glyph:c,readOnly:r,className:"size-8 shrink-0"}),e[0]=c,e[1]=r,e[2]=d):d=e[2];let m;e[3]!==s||e[4]!==n?(m=n?t.jsxs(je,{children:[t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:At,"aria-label":`Actions for ${s}`,children:t.jsx(ue,{size:14})})}),t.jsx(pe,{align:"end",onClick:Ut,children:t.jsxs(X,{variant:"destructive",onClick:n,children:[t.jsx(he,{size:14}),"Delete"]})})]}):void 0,e[3]=s,e[4]=n,e[5]=m):m=e[5];let f;e[6]!==i||e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==m?(f=t.jsx(le,{icon:d,name:s,meta:i,subtitle:o,actions:m}),e[6]=i,e[7]=s,e[8]=o,e[9]=d,e[10]=m,e[11]=f):f=e[11];let u;return e[12]!==a||e[13]!==f?(u=t.jsx(te,{onOpen:a,children:f}),e[12]=a,e[13]=f,e[14]=u):u=e[14],u}function Ut(l){return l.stopPropagation()}function At(l){return l.stopPropagation()}function Ve(l){const e=S.c(19),{filename:s,updatedAt:i,downloadUrl:o,onOpen:c,onDelete:r}=l;let a;e[0]!==s?(a=t.jsx(A,{filename:s,className:"h-8 w-6.5 shrink-0"}),e[0]=s,e[1]=a):a=e[1];let n;e[2]!==i?(n=ee(i),e[2]=i,e[3]=n):n=e[3];let d;e[4]!==s?(d=_e(s),e[4]=s,e[5]=d):d=e[5];let m;e[6]!==o||e[7]!==s||e[8]!==r?(m=t.jsx(Ke,{downloadUrl:o,filename:s,onDelete:r}),e[6]=o,e[7]=s,e[8]=r,e[9]=m):m=e[9];let f;e[10]!==s||e[11]!==a||e[12]!==n||e[13]!==d||e[14]!==m?(f=t.jsx(le,{icon:a,name:s,meta:n,subtitle:d,actions:m}),e[10]=s,e[11]=a,e[12]=n,e[13]=d,e[14]=m,e[15]=f):f=e[15];let u;return e[16]!==c||e[17]!==f?(u=t.jsx(te,{onOpen:c,children:f}),e[16]=c,e[17]=f,e[18]=u):u=e[18],u}function Et(l){const e=S.c(36),{dirName:s,updatedAt:i,skillMdUrl:o,onOpen:c,onBrowse:r,onDelete:a}=l;let n;e[0]!==o?(n=M.fileText(o),e[0]=o,e[1]=n):n=e[1];let d;e[2]!==o?(d=async()=>{const F=await fetch(o,{credentials:"include"});if(!F.ok)throw new Error(`fetch failed: ${F.status}`);return F.text()},e[2]=o,e[3]=d):d=e[3];let m;e[4]!==n||e[5]!==d?(m={queryKey:n,queryFn:d,staleTime:6e4,retry:!1},e[4]=n,e[5]=d,e[6]=m):m=e[6];const{data:f}=J(m);let u;e[7]!==f?(u=f?He(f):null,e[7]=f,e[8]=u):u=e[8];const g=u;let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:t.jsx(Re,{size:16})}),e[9]=b):b=e[9];const p=g?.name??s;let x;e[10]!==i?(x=ee(i),e[10]=i,e[11]=x):x=e[11];const h=`Actions for ${s}`;let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ue,{size:14}),e[12]=N):N=e[12];let v;e[13]!==h?(v=t.jsx(xe,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-6 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100 data-[state=open]:opacity-100",onClick:Lt,"aria-label":h,children:N})}),e[13]=h,e[14]=v):v=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Ye,{size:14}),e[15]=w):w=e[15];let j;e[16]!==r?(j=t.jsxs(X,{onClick:r,children:[w,"Browse files"]}),e[16]=r,e[17]=j):j=e[17];let C;e[18]!==a?(C=a&&t.jsxs(X,{variant:"destructive",onClick:a,children:[t.jsx(he,{size:14}),"Delete"]}),e[18]=a,e[19]=C):C=e[19];let k;e[20]!==j||e[21]!==C?(k=t.jsxs(pe,{align:"end",onClick:Mt,children:[j,C]}),e[20]=j,e[21]=C,e[22]=k):k=e[22];let $;e[23]!==v||e[24]!==k?($=t.jsxs(je,{children:[v,k]}),e[23]=v,e[24]=k,e[25]=$):$=e[25];let z;e[26]!==$||e[27]!==p||e[28]!==x?(z=t.jsx(le,{icon:b,name:p,meta:x,subtitle:"Skill",actions:$}),e[26]=$,e[27]=p,e[28]=x,e[29]=z):z=e[29];const P=g?.description??"";let D;e[30]!==P?(D=t.jsx("p",{className:"line-clamp-2 min-h-8 text-xs leading-4 text-muted-foreground",children:P}),e[30]=P,e[31]=D):D=e[31];let y;return e[32]!==c||e[33]!==z||e[34]!==D?(y=t.jsxs(te,{onOpen:c,children:[z,D]}),e[32]=c,e[33]=z,e[34]=D,e[35]=y):y=e[35],y}function Mt(l){return l.stopPropagation()}function Lt(l){return l.stopPropagation()}function oe(l){const e=S.c(4),{children:s}=l,[i,o]=E.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n=>{if(!n)return;const d=new IntersectionObserver(m=>{const[f]=m;f?.isIntersecting&&(o(!0),d.disconnect())},{rootMargin:"200px"});d.observe(n)},e[0]=c):c=e[0];const[r]=E.useState(c);if(i){let n;return e[1]!==s?(n=t.jsx(t.Fragment,{children:s}),e[1]=s,e[2]=n):n=e[2],n}let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{ref:r,className:"h-full w-full"}),e[3]=a):a=e[3],a}function Rt(l){const e=S.c(11),{url:s}=l;let i;e[0]!==s?(i=M.fileText(s),e[0]=s,e[1]=i):i=e[1];let o;e[2]!==s?(o=async()=>{const d=await fetch(s,{credentials:"include"});if(!d.ok)throw new Error(`fetch failed: ${d.status}`);return d.text()},e[2]=s,e[3]=o):o=e[3];let c;e[4]!==i||e[5]!==o?(c={queryKey:i,queryFn:o,staleTime:6e4,retry:!1},e[4]=i,e[5]=o,e[6]=c):c=e[6];const{data:r}=J(c);if(!r)return null;let a;e[7]!==r?(a=r.slice(0,2e3),e[7]=r,e[8]=a):a=e[8];let n;return e[9]!==a?(n=t.jsx("pre",{className:"pointer-events-none h-full w-full overflow-hidden bg-background p-3 font-mono text-[9px] leading-[1.5] text-muted-foreground select-none",children:a}),e[9]=a,e[10]=n):n=e[10],n}function Bt(l){const e=S.c(23),{url:s,ext:i}=l;let o;e[0]!==s?(o=M.csvThumb(s),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==s?(c=async()=>{const x=await fetch(s,{credentials:"include",headers:{Range:"bytes=0-8191"}});if(!x.ok)throw new Error(`fetch failed: ${x.status}`);return x.text()},e[2]=s,e[3]=c):c=e[3];let r;e[4]!==o||e[5]!==c?(r={queryKey:o,queryFn:c,staleTime:6e4,retry:!1},e[4]=o,e[5]=c,e[6]=r):r=e[6];const{data:a}=J(r);if(!a)return null;const n=i==="tsv"?" ":",";let d,m,f,u;if(e[7]!==a||e[8]!==n){u=Symbol.for("react.early_return_sentinel");e:{let x;e[13]!==n?(x=N=>N.split(n).slice(0,6).map(Kt),e[13]=n,e[14]=x):x=e[14];const h=a.split(`
3
3
  `).filter(Boolean).slice(0,7).map(x);if(h.length===0){u=null;break e}f="pointer-events-none h-full w-full overflow-hidden bg-background p-2 select-none",m="w-full border-collapse",d=h.map(It)}e[7]=a,e[8]=n,e[9]=d,e[10]=m,e[11]=f,e[12]=u}else d=e[9],m=e[10],f=e[11],u=e[12];if(u!==Symbol.for("react.early_return_sentinel"))return u;let g;e[15]!==d?(g=t.jsx("tbody",{children:d}),e[15]=d,e[16]=g):g=e[16];let b;e[17]!==m||e[18]!==g?(b=t.jsx("table",{className:m,children:g}),e[17]=m,e[18]=g,e[19]=b):b=e[19];let p;return e[20]!==f||e[21]!==b?(p=t.jsx("div",{className:f,children:b}),e[20]=f,e[21]=b,e[22]=p):p=e[22],p}function It(l,e){return t.jsx("tr",{className:Y(e===0&&"bg-muted/50 font-medium"),children:l.map(Ht)},e)}function Ht(l,e){return t.jsx("td",{className:"max-w-[56px] overflow-hidden border border-border/30 px-1 py-px text-[7px] leading-[1.4] text-muted-foreground",style:{maxWidth:56},children:t.jsx("span",{className:"block truncate",children:l})},e)}function Kt(l){return l.trim().replace(/^"|"$/g,"")}function Vt(l){const e=S.c(14),{filename:s,size:i,downloadUrl:o}=l;let c;if(e[0]!==o||e[1]!==s||e[2]!==i){const r=Ot(s);let a;if($t.has(r)){let n;e[4]!==o?(n=t.jsx("img",{src:o,alt:"",loading:"lazy",className:"h-full w-full object-cover"}),e[4]=o,e[5]=n):n=e[5],a=n}else if(zt.has(r)){const n=`${o}#t=0.1`;let d;e[6]!==n?(d=t.jsx(oe,{children:t.jsx("video",{src:n,preload:"metadata",muted:!0,playsInline:!0,className:"pointer-events-none h-full w-full object-cover"})}),e[6]=n,e[7]=d):d=e[7],a=d}else if(r==="pdf"){let n;e[8]!==s?(n=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(A,{filename:s,className:"h-14 w-11 opacity-60"})}),e[8]=s,e[9]=n):n=e[9],a=n}else if(Dt.has(r))a=t.jsx(oe,{children:t.jsx(Bt,{url:o,ext:r})});else if(Ft.has(r)&&i<=_t){let n;e[10]!==o?(n=t.jsx(oe,{children:t.jsx(Rt,{url:o})}),e[10]=o,e[11]=n):n=e[11],a=n}else{let n;e[12]!==s?(n=t.jsx("div",{className:"flex h-full w-full items-center justify-center",children:t.jsx(A,{filename:s,className:"h-14 w-11 opacity-60"})}),e[12]=s,e[13]=n):n=e[13],a=n}c=t.jsx("div",{className:"aspect-[400/265] w-full overflow-hidden rounded-lg border border-border/60 bg-muted/30",children:a}),e[0]=o,e[1]=s,e[2]=i,e[3]=c}else c=e[3];return c}function qt(l){const e=S.c(24),s=l.onOpen;let i;e[0]!==l.filename?(i=t.jsx(A,{filename:l.filename,className:"h-8 w-6.5 shrink-0"}),e[0]=l.filename,e[1]=i):i=e[1];const o=l.filename;let c;e[2]!==l.updatedAt?(c=ee(l.updatedAt),e[2]=l.updatedAt,e[3]=c):c=e[3];let r;e[4]!==l.filename?(r=_e(l.filename),e[4]=l.filename,e[5]=r):r=e[5];let a;e[6]!==l.downloadUrl||e[7]!==l.filename||e[8]!==l.onDelete?(a=t.jsx(Ke,{downloadUrl:l.downloadUrl,filename:l.filename,onDelete:l.onDelete}),e[6]=l.downloadUrl,e[7]=l.filename,e[8]=l.onDelete,e[9]=a):a=e[9];let n;e[10]!==l.filename||e[11]!==i||e[12]!==c||e[13]!==r||e[14]!==a?(n=t.jsx(le,{icon:i,name:o,meta:c,subtitle:r,actions:a}),e[10]=l.filename,e[11]=i,e[12]=c,e[13]=r,e[14]=a,e[15]=n):n=e[15];let d;e[16]!==l.downloadUrl||e[17]!==l.filename||e[18]!==l.size?(d=t.jsx(Vt,{filename:l.filename,size:l.size,downloadUrl:l.downloadUrl}),e[16]=l.downloadUrl,e[17]=l.filename,e[18]=l.size,e[19]=d):d=e[19];let m;return e[20]!==l.onOpen||e[21]!==n||e[22]!==d?(m=t.jsxs(te,{onOpen:s,children:[n,d]}),e[20]=l.onOpen,e[21]=n,e[22]=d,e[23]=m):m=e[23],m}function ne(l){const e=l?l.split("/").filter(Boolean):[],s=e[0]==="public",i=s?e[1]??null:null,o=s?i?`public-${i}`:null:e[0]??null,c=(s?e.slice(2):e.slice(1)).join("/");return{segments:e,volume:o,dirPath:c,isPublic:s,publicSet:i,readOnly:s}}function W(l,e){return l.isPublic&&l.publicSet?`public/${l.publicSet}/${e}`:l.volume?`${l.volume}/${e}`:e}function O(l){const e=l.lastIndexOf("/");return e===-1?l:l.slice(e+1)}const Gt=l=>/\.html?$/i.test(l);function Xt(l){const e=S.c(26),{previewPath:s,onClose:i}=l;let o;e[0]!==s?(o=ne(s),e[0]=s,e[1]=o):o=e[1];const c=o,{volume:r,dirPath:a}=c,{data:n,isPending:d}=Oe(r,a),m=Pe(r??"");let f,u,g,b,p,x;if(e[2]!==m||e[3]!==n||e[4]!==a||e[5]!==d||e[6]!==i||e[7]!==s||e[8]!==r){const v=O(a),w=n&&n.kind==="file"?{key:s,filename:v,size:n.size,downloadUrl:m(n.path)}:null;u=ce,p=!0,e[15]!==i?(x=j=>{j||i()},e[15]=i,e[16]=x):x=e[16],f=de,g="flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",b=w&&n&&Gt(v)?t.jsxs(t.Fragment,{children:[t.jsx(Z,{className:"sr-only",children:v}),t.jsx(Te,{readUrl:w.downloadUrl,marker:Ue(n),title:v,savePath:r==="home"?a:void 0,trailing:t.jsx("div",{className:"w-8 shrink-0"})},s)]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-1 border-b border-border/60 py-1 pr-12 pl-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2",children:[t.jsx(A,{filename:v,className:"h-4.5 w-3.5 shrink-0"}),t.jsx(Z,{className:"truncate text-xs font-medium text-foreground",children:v}),w&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ae(w.size)})]}),w&&t.jsxs(t.Fragment,{children:[t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:w.downloadUrl,download:w.filename,children:t.jsx(ae,{size:14})})})}),t.jsx(q,{side:"bottom",children:"Download"})]}),t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>window.open(w.downloadUrl,"_blank","noopener"),children:t.jsx(Be,{size:14})})}),t.jsx(q,{side:"bottom",children:"Open in new tab"})]})]})]}),t.jsx("div",{className:"relative min-h-0 flex-1 bg-background",children:w?t.jsx(fe,{file:w}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(A,{filename:v,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})})]}),e[2]=m,e[3]=n,e[4]=a,e[5]=d,e[6]=i,e[7]=s,e[8]=r,e[9]=f,e[10]=u,e[11]=g,e[12]=b,e[13]=p,e[14]=x}else f=e[9],u=e[10],g=e[11],b=e[12],p=e[13],x=e[14];let h;e[17]!==f||e[18]!==g||e[19]!==b?(h=t.jsx(f,{className:g,children:b}),e[17]=f,e[18]=g,e[19]=b,e[20]=h):h=e[20];let N;return e[21]!==u||e[22]!==p||e[23]!==x||e[24]!==h?(N=t.jsx(u,{open:p,onOpenChange:x,children:h}),e[21]=u,e[22]=p,e[23]=x,e[24]=h,e[25]=N):N=e[25],N}const Qt=l=>/\.html?$/i.test(l);function Wt(l){const e=S.c(6),{onClose:s}=l;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ie,{size:14}),e[0]=i):i=e[0];let o;e[1]!==s?(o=t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:s,children:i})}),e[1]=s,e[2]=o):o=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(q,{side:"bottom",children:"Close"}),e[3]=c):c=e[3];let r;return e[4]!==o?(r=t.jsxs(K,{children:[o,c]}),e[4]=o,e[5]=r):r=e[5],r}function Yt(l){const e=S.c(49),{previewPath:s,onClose:i}=l;let o;e[0]!==s?(o=ne(s),e[0]=s,e[1]=o):o=e[1];const c=o,{volume:r,dirPath:a}=c,{data:n,isPending:d}=Oe(r,a),m=Pe(r??"");let f,u,g,b,p,x,h,N,v;if(e[2]!==m||e[3]!==n||e[4]!==a||e[5]!==i||e[6]!==s||e[7]!==r){v=Symbol.for("react.early_return_sentinel");e:{if(u=O(a),f=n&&n.kind==="file"?{key:s,filename:u,size:n.size,downloadUrl:m(n.path)}:null,f&&n&&Qt(u)){const F=f.downloadUrl;let U;e[17]!==n?(U=Ue(n),e[17]=n,e[18]=U):U=e[18];let B;e[19]!==i?(B=t.jsx(Wt,{onClose:i}),e[19]=i,e[20]=B):B=e[20],v=t.jsx(Te,{readUrl:F,marker:U,title:u,savePath:r==="home"?a:void 0,trailing:B},s);break e}N="flex h-full w-full flex-col bg-background",h="flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",g="flex min-w-0 flex-1 items-center gap-2 px-2",b=t.jsx(A,{filename:u,className:"h-4.5 w-3.5 shrink-0"}),e[21]!==u?(p=t.jsx("span",{className:"truncate text-xs font-medium text-foreground",children:u}),e[21]=u,e[22]=p):p=e[22],x=f&&t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Ae(f.size)})}e[2]=m,e[3]=n,e[4]=a,e[5]=i,e[6]=s,e[7]=r,e[8]=f,e[9]=u,e[10]=g,e[11]=b,e[12]=p,e[13]=x,e[14]=h,e[15]=N,e[16]=v}else f=e[8],u=e[9],g=e[10],b=e[11],p=e[12],x=e[13],h=e[14],N=e[15],v=e[16];if(v!==Symbol.for("react.early_return_sentinel"))return v;let w;e[23]!==g||e[24]!==b||e[25]!==p||e[26]!==x?(w=t.jsxs("div",{className:g,children:[b,p,x]}),e[23]=g,e[24]=b,e[25]=p,e[26]=x,e[27]=w):w=e[27];let j;e[28]!==f?(j=f&&t.jsxs(t.Fragment,{children:[t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",asChild:!0,children:t.jsx("a",{href:f.downloadUrl,download:f.filename,children:t.jsx(ae,{size:14})})})}),t.jsx(q,{side:"bottom",children:"Download"})]}),t.jsxs(K,{children:[t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:()=>window.open(f.downloadUrl,"_blank","noopener"),children:t.jsx(Be,{size:14})})}),t.jsx(q,{side:"bottom",children:"Open in new tab"})]})]}),e[28]=f,e[29]=j):j=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ie,{size:14}),e[30]=C):C=e[30];let k;e[31]!==i?(k=t.jsx(V,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",onClick:i,children:C})}),e[31]=i,e[32]=k):k=e[32];let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(q,{side:"bottom",children:"Close"}),e[33]=$):$=e[33];let z;e[34]!==k?(z=t.jsxs(K,{children:[k,$]}),e[34]=k,e[35]=z):z=e[35];let P;e[36]!==j||e[37]!==z||e[38]!==h||e[39]!==w?(P=t.jsxs("div",{className:h,children:[w,j,z]}),e[36]=j,e[37]=z,e[38]=h,e[39]=w,e[40]=P):P=e[40];let D;e[41]!==f||e[42]!==u||e[43]!==d?(D=t.jsx("div",{className:"relative min-h-0 flex-1",children:f?t.jsx(fe,{file:f}):d?t.jsx(Ee,{}):t.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[t.jsx(A,{filename:u,className:"h-7.5 w-6"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:"This file is no longer available."})]})}),e[41]=f,e[42]=u,e[43]=d,e[44]=D):D=e[44];let y;return e[45]!==P||e[46]!==D||e[47]!==N?(y=t.jsxs("div",{className:N,children:[P,D]}),e[45]=P,e[46]=D,e[47]=N,e[48]=y):y=e[48],y}function Zt(l){const e=S.c(21),{skillPath:s,onClose:i}=l,o=ne(s),{volume:c,dirPath:r}=o,a=me(),n=a(c??"",`${r}/SKILL.md`),d=M.fileText(n);let m;e[0]!==n?(m=async()=>{const _=await fetch(n,{credentials:"include"});if(!_.ok)throw new Error(`fetch failed: ${_.status}`);return _.text()},e[0]=n,e[1]=m):m=e[1];let f;e[2]!==d||e[3]!==m?(f={queryKey:d,queryFn:m,staleTime:6e4,retry:!1},e[2]=d,e[3]=m,e[4]=f):f=e[4];const u=J(f),g=Me(c??"",r);let b;e[5]!==r?(b=O(r),e[5]=r,e[6]=b):b=e[6];const p=b;let x;e[7]!==u.data?(x=u.data?He(u.data):null,e[7]=u.data,e[8]=x):x=e[8];const h=x,N=el;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=(_,G)=>N(_.path)?-1:N(G.path)?1:O(_.path).localeCompare(O(G.path)),e[9]=v):v=e[9];const w=(g.data??[]).filter(Jt).sort(v),[j,C]=E.useState(null),k=j===null?null:w.find(_=>_.path===j)??null;let $;e[10]!==i?($=_=>{_||i()},e[10]=i,e[11]=$):$=e[11];let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:t.jsx(Re,{size:18})}),e[12]=z):z=e[12];const P=h?.name??p;let D;e[13]!==P?(D=t.jsx(Z,{className:"flex-1 truncate text-base font-medium text-foreground",children:P}),e[13]=P,e[14]=D):D=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ct,{asChild:!0,children:t.jsx(T,{variant:"ghost",size:"icon",className:"size-8 shrink-0",children:t.jsx(vt,{size:16})})}),e[15]=y):y=e[15];let F;e[16]!==D?(F=t.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[z,D,y]}),e[16]=D,e[17]=F):F=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("p",{className:"px-2 py-1.5 text-sm font-medium text-foreground",children:"Files"}),e[18]=U):U=e[18];const B="relative flex min-w-0 flex-1 flex-col overflow-y-auto",ie=k?t.jsx(fe,{file:{key:k.path,filename:O(k.path),size:k.size,downloadUrl:a(c??"",k.path)}}):u.isPending?t.jsxs("div",{className:"flex flex-col gap-2 p-6",children:[t.jsx(H,{className:"h-4 w-1/3"}),t.jsx(H,{className:"h-3 w-full"}),t.jsx(H,{className:"h-3 w-5/6"}),t.jsx(H,{className:"h-3 w-2/3"})]}):u.isError||!h?t.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"This skill is no longer available."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex flex-col gap-4 border-b border-border p-6",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:"Description"}),t.jsx("p",{className:"text-base text-muted-foreground",children:h.description??"Claude Code skill"})]}),t.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none p-6",children:t.jsx(ht,{id:`skill-preview-${s}`,text:h.body})})]});let Q;return e[19]!==ie?(Q=t.jsx("div",{className:B,children:ie}),e[19]=ie,e[20]=Q):Q=e[20],t.jsx(ce,{open:!0,onOpenChange:$,children:t.jsxs(de,{className:"flex h-[88vh] w-[94vw] max-w-none! flex-col gap-0 overflow-hidden p-0 sm:max-w-5xl!",closeButtonClassName:"hidden",children:[F,t.jsxs("div",{className:"flex min-h-0 flex-1",children:[t.jsxs("div",{className:"flex w-[220px] shrink-0 flex-col gap-1 overflow-y-auto border-r border-border bg-muted p-3",children:[U,g.isPending?t.jsx(H,{className:"mx-2 h-4 w-24"}):w.map(_=>{const G=N(_.path)?k===null:j===_.path;return t.jsxs("button",{type:"button",onClick:()=>C(N(_.path)?null:_.path),className:Y("flex items-center gap-2.5 rounded-lg px-2 py-1.5 text-left",G?"bg-background shadow-sm":"hover:bg-muted/60"),children:[t.jsx(A,{filename:O(_.path),className:"h-6 w-5 shrink-0"}),t.jsx("span",{className:Y("truncate text-sm",G?"text-foreground":"text-muted-foreground"),children:O(_.path)})]},_.path)})]}),Q]})]})})}function Jt(l){return l.kind==="file"}function el(l){return O(l)==="SKILL.md"}const qe=[{id:"home",description:"Your organization's home folder",glyph:Ze},{id:"uploads",description:"Files your team uploads",glyph:ze},{id:"outputs",description:"Agent run outputs",glyph:et}],Ne=3;function R(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("p",{className:"text-[13px] text-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function L(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:s}),e[0]=s,e[1]=i):i=e[1],i}function ge(l){const e=S.c(2),{rows:s}=l,i=s===void 0?1:s;let o;return e[0]!==i?(o=t.jsx(L,{children:Array.from({length:i*3},tl)}),e[0]=i,e[1]=o):o=e[1],o}function tl(l,e){return t.jsx(H,{className:"h-16 rounded-2xl"},e)}function be(l){const e=S.c(2),{children:s}=l;let i;return e[0]!==s?(i=t.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1],i}function ll(l){const e=S.c(6),{volume:s,displayName:i,description:o,glyph:c,onOpen:r}=l,a=gt(s),n=i??s,d=a.data?`${a.data.files} files`:void 0;let m;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==n||e[4]!==d?(m=t.jsx(se,{name:n,meta:d,subtitle:o,glyph:c,onOpen:r}),e[0]=o,e[1]=c,e[2]=r,e[3]=n,e[4]=d,e[5]=m):m=e[5],m}function sl(l){const e=S.c(8),{segments:s,onNavigate:i}=l;let o;e[0]!==i?(o=t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(""),children:"Library"}),e[0]=i,e[1]=o):o=e[1];let c;e[2]!==i||e[3]!==s?(c=s.map((a,n)=>{const d=s.slice(0,n+1).join("/"),m=n===s.length-1;return t.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[t.jsx(Qe,{size:12,className:"shrink-0 text-muted-foreground"}),m?t.jsx("span",{className:"truncate font-medium text-foreground",children:a}):t.jsx("button",{type:"button",className:"truncate text-muted-foreground hover:text-foreground hover:underline",onClick:()=>i(d),children:a})]},d)}),e[2]=i,e[3]=s,e[4]=c):c=e[4];let r;return e[5]!==o||e[6]!==c?(r=t.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1 text-sm",children:[o,c]}),e[5]=o,e[6]=c,e[7]=r):r=e[7],r}function nl(l){const e=S.c(19),{onOpenDir:s,onOpenFile:i,onDelete:o}=l,{org:c}=$e(),r=jt(),a=Le(),n=me();let d;if(e[0]!==n||e[1]!==o||e[2]!==s||e[3]!==i||e[4]!==c||e[5]!==a.data?.length||e[6]!==r.data||e[7]!==r.isPending){const m=r.data??[],f=m.slice(0,Ne),u=m.slice(Ne);let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(R,{children:"Folders"}),e[9]=g):g=e[9];let b;e[10]!==s||e[11]!==c?(b=qe.map(h=>t.jsx(ll,{volume:h.id,displayName:h.id==="home"?kt(c.slug):void 0,description:h.description,glyph:h.glyph,onOpen:()=>s(h.id)},h.id)),e[10]=s,e[11]=c,e[12]=b):b=e[12];let p;e[13]!==s||e[14]!==a.data?.length?(p=(a.data?.length??0)>0&&t.jsx(se,{name:"public",meta:`${a.data?.length} sets`,subtitle:"Curated skill sets — read-only",glyph:We,readOnly:!0,onOpen:()=>s("public")}),e[13]=s,e[14]=a.data?.length,e[15]=p):p=e[15];let x;e[16]!==b||e[17]!==p?(x=t.jsxs("div",{className:"flex flex-col gap-3",children:[g,t.jsxs(L,{children:[b,p]})]}),e[16]=b,e[17]=p,e[18]=x):x=e[18],d=t.jsxs(t.Fragment,{children:[r.isPending?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Recently added"}),t.jsx(ge,{})]}):f.length>0?t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Recently added"}),t.jsx(L,{children:f.map(h=>t.jsx(qt,{filename:O(h.path),updatedAt:h.updatedAt,size:h.size,downloadUrl:n(h.volume,h.path),onOpen:()=>i(`${h.volume}/${h.path}`),onDelete:()=>o({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]}):t.jsx(be,{children:"No files yet — upload one, or ask an agent to produce something."}),x,u.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"All files"}),t.jsx(L,{children:u.map(h=>t.jsx(Ve,{filename:O(h.path),updatedAt:h.updatedAt,downloadUrl:n(h.volume,h.path),onOpen:()=>i(`${h.volume}/${h.path}`),onDelete:()=>o({volume:h.volume,path:h.path,kind:"file"})},`${h.volume}/${h.path}`))})]})]}),e[0]=n,e[1]=o,e[2]=s,e[3]=i,e[4]=c,e[5]=a.data?.length,e[6]=r.data,e[7]=r.isPending,e[8]=d}else d=e[8];return d}function il(l){const e=S.c(11),{onOpenDir:s}=l,i=Le();if(i.isPending){let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ge,{}),e[0]=n):n=e[0],n}let o;e[1]!==i.data?(o=i.data??[],e[1]=i.data,e[2]=o):o=e[2];const c=o;if(c.length===0){let n;return e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(be,{children:"No public skill sets are configured."}),e[3]=n):n=e[3],n}let r;if(e[4]!==s||e[5]!==c){let n;e[7]!==s?(n=d=>t.jsx(se,{name:d,subtitle:"Read-only",readOnly:!0,onOpen:()=>s(`public/${d}`)},d),e[7]=s,e[8]=n):n=e[8],r=c.map(n),e[4]=s,e[5]=c,e[6]=r}else r=e[6];let a;return e[9]!==r?(a=t.jsx(L,{children:r}),e[9]=r,e[10]=a):a=e[10],a}function rl(l){const e=S.c(25),{location:s,onOpenDir:i,onOpenFile:o,onOpenSkill:c,onDelete:r}=l,a=s.volume??"",n=Me(a,s.dirPath),d=me();if(n.isPending){let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ge,{rows:2}),e[0]=p):p=e[0],p}if(n.isError){const p=n.error instanceof Error?n.error.message:"Failed to load";let x;return e[1]!==p?(x=t.jsx("p",{className:"text-sm text-destructive",children:p}),e[1]=p,e[2]=x):x=e[2],x}let m,f,u,g;if(e[3]!==d||e[4]!==n.data||e[5]!==s||e[6]!==r||e[7]!==i||e[8]!==o||e[9]!==c||e[10]!==a){g=Symbol.for("react.early_return_sentinel");e:{const p=n.data??[],x=p.filter(cl),h=p.filter(al),N=p.filter(ol);if(p.length===0){const j=s.readOnly?"Empty — this read-only set syncs from its GitHub source.":"Empty folder — upload a file or create a folder to get started.";let C;e[15]!==j?(C=t.jsx(be,{children:j}),e[15]=j,e[16]=C):C=e[16],g=C;break e}let v;e[17]!==s.readOnly||e[18]!==r||e[19]!==a?(v=j=>s.readOnly?void 0:()=>r({volume:a,path:j.path,kind:j.kind}),e[17]=s.readOnly,e[18]=r,e[19]=a,e[20]=v):v=e[20];const w=v;m=x.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Skills"}),t.jsx(L,{children:x.map(j=>t.jsx(Et,{dirName:O(j.path),updatedAt:j.updatedAt,skillMdUrl:d(a,`${j.path}/SKILL.md`),onOpen:()=>c(W(s,j.path)),onBrowse:()=>i(W(s,j.path)),onDelete:w(j)},j.path))})]}),f=h.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Folders"}),t.jsx(L,{children:h.map(j=>t.jsx(se,{name:O(j.path),meta:ee(j.updatedAt),readOnly:s.readOnly,onOpen:()=>i(W(s,j.path)),onDelete:w(j)},j.path))})]}),u=N.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(R,{children:"Files"}),t.jsx(L,{children:N.map(j=>t.jsx(Ve,{filename:O(j.path),updatedAt:j.updatedAt,downloadUrl:d(a,j.path),onOpen:()=>o(W(s,j.path)),onDelete:w(j)},j.path))})]})}e[3]=d,e[4]=n.data,e[5]=s,e[6]=r,e[7]=i,e[8]=o,e[9]=c,e[10]=a,e[11]=m,e[12]=f,e[13]=u,e[14]=g}else m=e[11],f=e[12],u=e[13],g=e[14];if(g!==Symbol.for("react.early_return_sentinel"))return g;let b;return e[21]!==m||e[22]!==f||e[23]!==u?(b=t.jsxs(t.Fragment,{children:[m,f,u]}),e[21]=m,e[22]=f,e[23]=u,e[24]=b):b=e[24],b}function ol(l){return l.kind==="file"}function al(l){return l.kind==="dir"&&!l.hasSkill}function cl(l){return l.kind==="dir"&&l.hasSkill}function ke(){const{org:l}=$e(),e=Ge(),s=Ce(),i=Fe(),o=Se({strict:!1}),c=o.path??"",r=ne(c),a=r.segments.length===0,n=(y,F)=>s({to:".",search:U=>({...U,[y]:F||void 0})}),d=y=>n("path",y),m=y=>n("preview",y),f=y=>n("skill",y),[u,g]=E.useState(null),[b,p]=E.useState(!1),[x,h]=E.useState(""),N=E.useRef(null),v=r.readOnly?null:r.volume??"uploads",w=r.volume?r.dirPath:"",{upload:j,mkdir:C}=ye(v??"uploads"),{remove:k}=ye(u?.volume??"uploads");async function $(y){if(!(!v||!y||y.length===0))try{await j.mutateAsync({dir:w,files:[...y]}),I.success(y.length===1?`Uploaded ${y[0]?.name}`:`Uploaded ${y.length} files`)}catch(F){I.error(F instanceof Error?F.message:"Upload failed")}finally{N.current&&(N.current.value="")}}async function z(){const y=x.trim();if(!(!v||!y))try{await C.mutateAsync(w?`${w}/${y}`:y),I.success(`Folder "${y}" created`),p(!1),h("")}catch(F){I.error(F instanceof Error?F.message:"Failed to create folder")}}async function P(){if(!u)return;const y=u;try{await k.mutateAsync(y.path),I.success(`Deleted ${O(y.path)}`)}catch(F){I.error(F instanceof Error?F.message:"Delete failed")}finally{g(null)}}function D(){for(const y of qe)e.invalidateQueries({queryKey:M.orgFsVolume(l.id,y.id)});r.volume&&e.invalidateQueries({queryKey:M.orgFsVolume(l.id,r.volume)}),e.invalidateQueries({queryKey:M.orgFsRecent(l.id)}),e.invalidateQueries({queryKey:M.orgFsPublicSets(l.id)})}return t.jsxs("div",{className:"h-full overflow-y-auto",children:[t.jsxs("div",{className:"mx-auto flex w-full max-w-[900px] flex-col gap-10 px-6 py-10 lg:px-10",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[!a&&t.jsx(sl,{segments:r.segments,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate text-xl font-medium text-foreground",children:a?"Library":r.segments.at(-1)??"Library"}),t.jsx(T,{variant:"ghost",size:"icon",onClick:D,"aria-label":"Refresh",children:t.jsx(Xe,{size:14})}),!a&&v&&t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[t.jsx(Je,{size:14}),"New folder"]}),r.readOnly?t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[t.jsx(De,{size:12}),"Read-only"]}):t.jsxs(T,{size:"sm",disabled:j.isPending,onClick:()=>N.current?.click(),children:[t.jsx(ze,{size:14}),j.isPending?"Uploading…":"Upload file"]}),t.jsx("input",{ref:N,type:"file",multiple:!0,className:"hidden",onChange:y=>{$(y.target.files)}})]})]}),a?t.jsx(nl,{onOpenDir:d,onOpenFile:m,onDelete:g}):r.volume===null?t.jsx(il,{onOpenDir:d}):t.jsx(rl,{location:r,onOpenDir:d,onOpenFile:m,onOpenSkill:f,onDelete:g},r.volume)]}),o.preview?i&&t.jsx(Xt,{previewPath:o.preview,onClose:()=>n("preview",null)}):o.skill?t.jsx(Zt,{skillPath:o.skill,onClose:()=>n("skill",null)},o.skill):null,t.jsx(ce,{open:b,onOpenChange:p,children:t.jsxs(de,{children:[t.jsxs(dt,{children:[t.jsx(Z,{children:"New folder"}),t.jsxs(ft,{children:["Create a folder in ",c||"the library","."]})]}),t.jsx(ut,{autoFocus:!0,placeholder:"folder-name",value:x,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&z()}}),t.jsxs(mt,{children:[t.jsx(T,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),t.jsx(T,{disabled:!x.trim()||C.isPending,onClick:()=>{z()},children:"Create"})]})]})}),t.jsx(tt,{open:u!==null,onOpenChange:y=>{y||g(null)},children:t.jsxs(lt,{children:[t.jsxs(st,{children:[t.jsxs(nt,{children:["Delete ",u?O(u.path):"","?"]}),t.jsx(it,{children:u?.kind==="dir"?"The folder and everything inside it will be deleted for the whole organization. Sandboxes see this change within seconds.":"The file will be deleted for the whole organization. Sandboxes see this change within seconds."})]}),t.jsxs(rt,{children:[t.jsx(ot,{children:"Cancel"}),t.jsx(at,{onClick:()=>{P()},children:"Delete"})]})]})})]})}function Ll(){const l=S.c(13),e=Fe(),s=Ce();let i;l[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},l[0]=i):i=l[0];const c=Se(i).preview;let r;l[1]!==c?(r=c?O(c):"",l[1]=c,l[2]=r):r=l[2];const a=r;let n;l[3]!==s?(n=()=>s({to:".",search:dl}),l[3]=s,l[4]=n):n=l[4];const d=n;if(e){let g;return l[5]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-background",children:t.jsx(re,{children:t.jsx(ke,{})})}),l[5]=g):g=l[5],g}let m;l[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(ve,{order:1,minSize:30,defaultSize:55,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(re,{children:t.jsx(ke,{})})})})}),l[6]=m):m=l[6];let f;l[7]!==d||l[8]!==a||l[9]!==c?(f=c&&t.jsxs(t.Fragment,{children:[t.jsx(xt.Tabs,{children:t.jsx(pt,{title:a,icon:{kind:"component",Component:g=>t.jsx(A,{filename:a,...g})},active:!0,onClick:d})}),t.jsx(bt,{className:"bg-sidebar"}),t.jsx(ve,{order:2,minSize:25,defaultSize:45,children:t.jsx("div",{className:"h-full p-0.5 pt-0.25",children:t.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:t.jsx(re,{children:t.jsx(Yt,{previewPath:c,onClose:d})})})})})]}),l[7]=d,l[8]=a,l[9]=c,l[10]=f):f=l[10];let u;return l[11]!==f?(u=t.jsxs(yt,{direction:"horizontal",className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:[m,f]}),l[11]=f,l[12]=u):u=l[12],u}function dl(l){return{...l,preview:void 0}}export{Ll as default};
@@ -1 +1 @@
1
- import{e as f,c as d,r as p,j as r}from"./index-CM4eUM9Q.js";import{m as w}from"./sidebar-CUicHm9C.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
1
+ import{e as f,c as d,r as p,j as r}from"./index-D9kgGhq4.js";import{m as w}from"./sidebar-Bk2jzyI-.js";const v=p.createContext(void 0),H=v.Provider;function N(c,e){const l=p.Children.toArray(c);for(const i of l)if(p.isValidElement(i)&&i.type===e)return i;return null}function P(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex flex-col h-full w-full bg-background overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function C(c){const e=f.c(17),{children:l,className:i,hideSidebarTrigger:s}=c;let t;e[0]!==l?(t=N(l,j),e[0]=l,e[1]=t):t=e[1];const n=t;let a;e[2]!==l?(a=N(l,b),e[2]=l,e[3]=a):a=e[3];const o=a;let m;e[4]!==i?(m=d("shrink-0 w-full border-b border-border/50 h-11","flex items-center justify-between gap-3 pr-2 pl-2 md:pl-4",i),e[4]=i,e[5]=m):m=e[5];let x;e[6]!==s?(x=!s&&r.jsx(w,{className:"md:hidden shrink-0"}),e[6]=s,e[7]=x):x=e[7];let u;e[8]!==n||e[9]!==x?(u=r.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[x,n]}),e[8]=n,e[9]=x,e[10]=u):u=e[10];let h;e[11]!==o?(h=r.jsx("div",{className:"flex items-center",children:o}),e[11]=o,e[12]=h):h=e[12];let g;return e[13]!==m||e[14]!==u||e[15]!==h?(g=r.jsxs("div",{className:m,children:[u,h]}),e[13]=m,e[14]=u,e[15]=h,e[16]=g):g=e[16],g}function j(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 min-w-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function b(c){const e=f.c(5),{children:l,className:i}=c;let s;e[0]!==i?(s=d("flex items-center gap-2 shrink-0 overflow-hidden",i),e[0]=i,e[1]=s):s=e[1];let t;return e[2]!==l||e[3]!==s?(t=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=t):t=e[4],t}function $(c){const e=f.c(6),{children:l,className:i}=c,s=p.useContext(v);let t;e[0]!==i||e[1]!==s?(t=d("flex-1 overflow-auto",s,i),e[0]=i,e[1]=s,e[2]=t):t=e[2];let n;return e[3]!==l||e[4]!==t?(n=r.jsx("div",{className:t,children:l}),e[3]=l,e[4]=t,e[5]=n):n=e[5],n}function y(c){const e=f.c(10),{children:l,actions:i,className:s}=c;let t;e[0]!==s?(t=d("flex flex-wrap items-center justify-between gap-3",s),e[0]=s,e[1]=t):t=e[1];let n;e[2]!==l?(n=r.jsx("div",{className:"text-xl font-medium min-w-0",children:l}),e[2]=l,e[3]=n):n=e[3];let a;e[4]!==i?(a=i&&r.jsx("div",{className:"flex items-center gap-2",children:i}),e[4]=i,e[5]=a):a=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==a?(o=r.jsxs("div",{className:t,children:[n,a]}),e[6]=t,e[7]=n,e[8]=a,e[9]=o):o=e[9],o}function R(c){const e=f.c(6),{children:l,className:i,maxWidth:s}=c,t=s===void 0?"max-w-[1200px]":s;let n;e[0]!==i||e[1]!==t?(n=d("mx-auto w-full px-4 pt-8 pb-6 md:px-10 md:pt-12 md:pb-10",t,i),e[0]=i,e[1]=t,e[2]=n):n=e[2];let a;return e[3]!==l||e[4]!==n?(a=r.jsx("div",{className:n,children:l}),e[3]=l,e[4]=n,e[5]=a):a=e[5],a}const T=Object.assign(P,{Header:Object.assign(C,{Left:j,Right:b}),Content:$,Title:y,Body:R});export{T as P,H as a};
@@ -1,4 +1,4 @@
1
- import{dW as se,e as I,j as o,B as te,l as Yt,b1 as We,dX as Gs,r as X,q as oe,c as $,g as Qs,F as Zt,dY as Nt,dZ as es,o as Ys,v as Zs,d_ as en,d$ as tn}from"./index-CM4eUM9Q.js";import{D as sn,F as nn,B as on}from"./index-Bdaabwwx.js";import{h as De,i as rn,u as ae}from"./constants-DVPpd9QA.js";import{a as ts}from"./use-virtual-mcp-BA-W1Vhc.js";import{M as Oe}from"./monaco-editor-CB_L5Q_g.js";import{b as ln,R as zt,a as cn}from"./resizable-DhLCux-y.js";import{B as le}from"./badge-BvUmM76z.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-DUB_e2wA.js";import{S as et}from"./spinner-d6yvFwOg.js";import{V as an}from"./view-mode-toggle-DvvzCaLm.js";import{ag as un,o as dn,i as fn,x as ss,ah as mn,a1 as pn,r as xn,ai as ns,a7 as hn,L as os,aj as gn,ak as bn,a3 as ft,al as jn}from"./agent-icon-B_Sssulg.js";import{i as rs}from"./Play-BHXb_TUr.js";import{b as Sn,a as yn,V as Ge}from"./layout-DVfJUzzq.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-c0JCK6eh.js";import{u as wn,a as vn}from"./use-connection-Bna7-Lpr.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-CVwEyvG9.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-zrSzj7TD.js";import"./index-tJpcknvZ.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as Wn,e as Wt,d as An,q as Pn,S as Dn}from"./scroll-area-DMpuHtIE.js";import{S as Fn}from"./index-DZT3k4JB.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-B1oYmeeS.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-Dp0AYb5Q.js";import{s as Un}from"./Plus-DTBFvoZ4.js";import{b as ps}from"./Tool01-B6ELFGh-.js";import{i as Fe}from"./Check-BTi6aK2O.js";import{s as _t}from"./XClose-D_AWgVIk.js";import{I as Ct}from"./integration-icon-CBe2H1CK.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-C4Pme2EY.js";import"./index-BgCi7oO5.js";import{i as xs}from"./X-Ch1EyNal.js";import{u as hs,a as Gn}from"./use-collections-BdrLE9lf.js";import{E as gs}from"./empty-state-CMCikW75.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as At}from"./input-DwZNdPHy.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=We.useSyncExternalStore(t.subscribe,We.useCallback(()=>e(t.getState()),[t,e]),We.useCallback(()=>e(t.getInitialState()),[t,e]));return We.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return We.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
1
+ import{dW as se,e as I,j as o,B as te,l as Yt,b1 as We,dX as Gs,r as X,q as oe,c as $,g as Qs,F as Zt,dY as Nt,dZ as es,o as Ys,v as Zs,d_ as en,d$ as tn}from"./index-D9kgGhq4.js";import{D as sn,F as nn,B as on}from"./index-BsO26Vey.js";import{h as De,i as rn,u as ae}from"./constants-D6Bbr6AT.js";import{a as ts}from"./use-virtual-mcp-C7J9vBIx.js";import{M as Oe}from"./monaco-editor-Da7GwOd2.js";import{b as ln,R as zt,a as cn}from"./resizable-CqxuHIEF.js";import{B as le}from"./badge-BoRJ8tO_.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-BMTzbu3R.js";import{S as et}from"./spinner-Bniq-hdg.js";import{V as an}from"./view-mode-toggle-m2Gtbg0D.js";import{ag as un,o as dn,i as fn,x as ss,ah as mn,a1 as pn,r as xn,ai as ns,a7 as hn,L as os,aj as gn,ak as bn,a3 as ft,al as jn}from"./agent-icon-zrokvqQM.js";import{i as rs}from"./Play-DitjUfoa.js";import{b as Sn,a as yn,V as Ge}from"./layout-DtZU5vn4.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-M08maXcg.js";import{u as wn,a as vn}from"./use-connection-fZwsgZBE.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-DPaUEjUC.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-CB0bO41l.js";import"./index-cadeU-4K.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as Wn,e as Wt,d as An,q as Pn,S as Dn}from"./scroll-area-B0QeeQ1W.js";import{S as Fn}from"./index-BACP8eL8.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-8wJLJ7yd.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-Ci6fdZ_l.js";import{s as Un}from"./Plus-BFGy0Ag-.js";import{b as ps}from"./Tool01-D2UZ1Vs-.js";import{i as Fe}from"./Check-o-zUju1W.js";import{s as _t}from"./XClose-DRKdv4XS.js";import{I as Ct}from"./integration-icon-DOYIIElF.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-CuBTPd53.js";import"./index-BcVgCuba.js";import{i as xs}from"./X-BQQplvP0.js";import{u as hs,a as Gn}from"./use-collections-Dx8F5dop.js";import{E as gs}from"./empty-state-CmBBVqmb.js";import{c as Qn}from"./create-sse-subscription-BS5983N4.js";import{I as At}from"./input-D8kdtiC4.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=We.useSyncExternalStore(t.subscribe,We.useCallback(()=>e(t.getState()),[t,e]),We.useCallback(()=>e(t.getInitialState()),[t,e]));return We.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return We.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
2
  ${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
3
3
  `:""} ${u}${f}: ${n(d)};`}).join(`
4
4
  `)}