decocms 3.19.1 → 3.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/client/assets/{AlertCircle-CfP2ydlK.js → AlertCircle-B-p2hhbf.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BG7K2o4g.js → ArrowUpRight-Bq-dJGgn.js} +1 -1
  3. package/dist/client/assets/{Check-Rzhysg8v.js → Check-CSixRgqh.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-ByVfCd_z.js → CheckCircle-CqLcOI7o.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-DgAQraB9.js → ChevronDown-BptXi8Ef.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-hIkmA-06.js → ChevronLeft-Bq6F--2K.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-C-1GbVi6.js → ChevronRight-CtziSifX.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D95kdAWS.js → ChevronUp-DChs66VU.js} +1 -1
  9. package/dist/client/assets/{Container-EsK9R8Cs.js → Container-DIwdobum.js} +1 -1
  10. package/dist/client/assets/{DotsVertical--nxfulT_.js → DotsVertical-DQ3UGDDE.js} +1 -1
  11. package/dist/client/assets/{Eye-0u1NnyPn.js → Eye-DepFjUJE.js} +1 -1
  12. package/dist/client/assets/{FilterLines-lN6ZYEU6.js → FilterLines-CIJgiiLT.js} +1 -1
  13. package/dist/client/assets/{Globe01-CYJ5akFo.js → Globe01-BayTDYGC.js} +1 -1
  14. package/dist/client/assets/{HardDrive-Bi11tZlO.js → HardDrive-OwnJRrIS.js} +1 -1
  15. package/dist/client/assets/{Key01-ETI9VuA0.js → Key01-CR8zfCdU.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-D5P3SyL5.js → LayoutLeft-6fPyjOVd.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-CMTN51kD.js → LinkExternal01-B2YZgRTN.js} +1 -1
  18. package/dist/client/assets/{Monitor01-B9COEs1V.js → Monitor01-BNXW6pu5.js} +1 -1
  19. package/dist/client/assets/{Palette-CvBtCHX7.js → Palette-siqkt4cQ.js} +1 -1
  20. package/dist/client/assets/{Play-zcNTCzY3.js → Play-CBt0NeLA.js} +1 -1
  21. package/dist/client/assets/{Plus-BVt3gf6N.js → Plus-gXoAw_mX.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-Do9uT8r5.js → RefreshCcw01-DlKjMM-5.js} +1 -1
  23. package/dist/client/assets/{SearchMd-Ckbe6j0d.js → SearchMd-z6b-QOmX.js} +1 -1
  24. package/dist/client/assets/{Settings02-BFHOCA5h.js → Settings02-C7YqxsZL.js} +1 -1
  25. package/dist/client/assets/{Shield01-ebA_Mmqa.js → Shield01-BT66FEMI.js} +1 -1
  26. package/dist/client/assets/{Star01-DinMZEQp.js → Star01-q6EhXttt.js} +1 -1
  27. package/dist/client/assets/{Stars01-cUHrtzm6.js → Stars01-DcMeK1n0.js} +1 -1
  28. package/dist/client/assets/{Stars02-CovFPupV.js → Stars02-DJ4Y5TfK.js} +1 -1
  29. package/dist/client/assets/{Sun-D5MzBxyK.js → Sun-CeFpMHQU.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CLmvgZdy.js → SwitchHorizontal01-__hAuhZa.js} +1 -1
  31. package/dist/client/assets/{Tool01-D6Ixmgxm.js → Tool01-DXWYgeBe.js} +1 -1
  32. package/dist/client/assets/{Trash01-C6sXu2xm.js → Trash01-B91-1KNk.js} +1 -1
  33. package/dist/client/assets/{Upload01-DslYY_N3.js → Upload01-CcwGyBRP.js} +1 -1
  34. package/dist/client/assets/{User01-9CJ-p7XF.js → User01-JR_76gHl.js} +1 -1
  35. package/dist/client/assets/{Users01-Ds5_zubO.js → Users01-BM2QLqUJ.js} +1 -1
  36. package/dist/client/assets/{Users03-C3j_vENk.js → Users03-D5pU3_ql.js} +1 -1
  37. package/dist/client/assets/{X-Dzpu-bw3.js → X-DCWlm9Ta.js} +1 -1
  38. package/dist/client/assets/{XCircle-gezQrKJB.js → XCircle-CEKwTNMD.js} +1 -1
  39. package/dist/client/assets/{XClose-dfaecXcF.js → XClose-DhQ5V0ST.js} +1 -1
  40. package/dist/client/assets/{Zap-ZCJiHFB8.js → Zap-BLBAeivN.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-Doe97qp7.js → ZapSquare-DSdwG_FE.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-u9z9zRXH.js → ZoomOut-CCPaeWry.js} +1 -1
  43. package/dist/client/assets/{access-gate-CLs4hv6_.js → access-gate-DXlQ8iVy.js} +1 -1
  44. package/dist/client/assets/{accordion-y8ERtqeD.js → accordion-CsQ2TTIf.js} +1 -1
  45. package/dist/client/assets/add-section-modal-ilTOPIUe.js +1 -0
  46. package/dist/client/assets/{agent-capabilities-C4HO1AsU.js → agent-capabilities-CuNGQogd.js} +1 -1
  47. package/dist/client/assets/{agent-icon-atw8dEpB.js → agent-icon-Lc1AgwlE.js} +1 -1
  48. package/dist/client/assets/{agent-icons-BO9U458u.js → agent-icons-Cprwkzhw.js} +1 -1
  49. package/dist/client/assets/agents-list--b7dVWdV.js +1 -0
  50. package/dist/client/assets/ai-providers-Dw2EV4N6.js +1 -0
  51. package/dist/client/assets/{alert-f3LQH8ql.js → alert-HSAarVhN.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-BDuu9Vea.js → alert-dialog-DJLxSS_E.js} +1 -1
  53. package/dist/client/assets/app-editor-ZPlbW7dI.js +1 -0
  54. package/dist/client/assets/{auth-catchall-kvc8ufSV.js → auth-catchall-DeBOSldf.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-CJrIhcxn.js → auth-split-layout-DKKncNKx.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-DCGCyvJL.js → automation-list-row-C8yWYA2H.js} +1 -1
  57. package/dist/client/assets/automation-runs-D-WPNg7m.js +1 -0
  58. package/dist/client/assets/automations-C0KOU0yb.js +1 -0
  59. package/dist/client/assets/{avatar-DiepLBEZ.js → avatar-3vQWE5Hu.js} +1 -1
  60. package/dist/client/assets/{badge-Cosh8Jv6.js → badge-DF6gVmsi.js} +1 -1
  61. package/dist/client/assets/brand-context-EmCiQUXD.js +1 -0
  62. package/dist/client/assets/buckets-SH6KUYAQ.js +1 -0
  63. package/dist/client/assets/{calendar-D85iiJjZ.js → calendar-CCqv5TgR.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-h6odhJ2k.js → capability-load-error-Dn3qy9VI.js} +1 -1
  65. package/dist/client/assets/{card-B2dT-2ts.js → card-CeH_PUFE.js} +1 -1
  66. package/dist/client/assets/{chat-context-7nRfVaxU.js → chat-context-BIie9ysT.js} +1 -1
  67. package/dist/client/assets/{checkbox-B2YbUc0m.js → checkbox-DFFY_m2B.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BLeVCI6_.js → cli-auth-success-CKQ9nJ3v.js} +1 -1
  69. package/dist/client/assets/collection-detail-BVeEbzxz.js +1 -0
  70. package/dist/client/assets/{collection-display-button-COhijorf.js → collection-display-button-_le1JW4q.js} +1 -1
  71. package/dist/client/assets/{collection-search-C0bvNtM9.js → collection-search-Bryj5VYk.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-C_B1r31J.js → collection-table-wrapper-DoTnvoII.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BN4In63u.js → collection-tabs-Y3w8w2D4.js} +1 -1
  74. package/dist/client/assets/{collections-BUCuRVxl.js → collections-B-UBhIxv.js} +1 -1
  75. package/dist/client/assets/{command-BjqkQYxa.js → command-KyGHPzm4.js} +1 -1
  76. package/dist/client/assets/connect-desktop-dialog-BeLm4wl6.js +1 -0
  77. package/dist/client/assets/connection-card-Dug8PvM2.js +1 -0
  78. package/dist/client/assets/connection-detail-BXK_93LF.js +1 -0
  79. package/dist/client/assets/{connection-form-helpers-B093QOVj.js → connection-form-helpers-Ce4ZXQGG.js} +1 -1
  80. package/dist/client/assets/connections-CVEBwrj4.js +1 -0
  81. package/dist/client/assets/{decopilot-sse-pool-DYhlxmFV.js → decopilot-sse-pool-vfZK3kan.js} +1 -1
  82. package/dist/client/assets/{dialog-CvJmXij7.js → dialog-nXKceTRB.js} +1 -1
  83. package/dist/client/assets/domain-settings-OHWjjHlQ.js +1 -0
  84. package/dist/client/assets/{drawer-Cm2a8ouX.js → drawer-lSnonzW3.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-jK5-EocK.js → dropdown-menu-DpfpR4kx.js} +1 -1
  86. package/dist/client/assets/dynamic-plugin-layout-BYQB-ubA.js +1 -0
  87. package/dist/client/assets/{empty-state-BvMn8pb-.js → empty-state-BJuYi96S.js} +1 -1
  88. package/dist/client/assets/{empty-state-CZ6jnWLa.js → empty-state-CY7XUbo0.js} +1 -1
  89. package/dist/client/assets/extract-connection-data-DxtHEsy3.js +1 -0
  90. package/dist/client/assets/features-DeiC9LXr.js +1 -0
  91. package/dist/client/assets/file-explorer-Ch6ZQfZO.js +2 -0
  92. package/dist/client/assets/{file-type-icon-B565DmsG.js → file-type-icon-B2skJERp.js} +1 -1
  93. package/dist/client/assets/{files-DDtaNJV8.js → files-CZNNukx-.js} +1 -1
  94. package/dist/client/assets/{form-DAahwl9B.js → form-BM4RuTjX.js} +1 -1
  95. package/dist/client/assets/general-sYzqMtl5.js +1 -0
  96. package/dist/client/assets/{generate-id-CnLzNGg6.js → generate-id-DvX29Me7.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-qDFzaGLa.js → github-repo-picker-Dlio4Q6_.js} +1 -1
  98. package/dist/client/assets/{header-tab-button-sg2Bkh9m.js → header-tab-button-BY6bk4Fs.js} +1 -1
  99. package/dist/client/assets/{hover-card-DyNloM84.js → hover-card-DASEEDYA.js} +1 -1
  100. package/dist/client/assets/image-field-BTCmGBNs.js +1 -0
  101. package/dist/client/assets/{index-DaTDomcZ.js → index-1xoY7YJX.js} +1 -1
  102. package/dist/client/assets/{index-DU03U45c.js → index-BXzjL9VS.js} +4 -4
  103. package/dist/client/assets/{index-RoHcRkq0.js → index-BfzqpoYd.js} +3 -3
  104. package/dist/client/assets/{index-Dhy2A-ml.js → index-CVPVNlMM.js} +1 -1
  105. package/dist/client/assets/{index-BlWGRwfE.js → index-CaqKcth7.js} +1 -1
  106. package/dist/client/assets/{index-B2iHTL-o.js → index-CnLAq3ph.js} +1 -1
  107. package/dist/client/assets/{index-BloRy46B.js → index-D3hStv8f.js} +1 -1
  108. package/dist/client/assets/{index-BFIoANt_.js → index-D4BxVbG6.js} +1 -1
  109. package/dist/client/assets/index-DFmAjKzK.js +1 -0
  110. package/dist/client/assets/{index-nS3rTKOQ.js → index-DOW4VN4f.js} +1 -1
  111. package/dist/client/assets/{index-Dw66yPMC.js → index-DcxEaxY4.js} +1 -1
  112. package/dist/client/assets/index-Dey5W81J.js +1 -0
  113. package/dist/client/assets/index-e3NOZKNP.js +1 -0
  114. package/dist/client/assets/{index-BDzZll30.js → index-nkMA7ZNv.js} +1 -1
  115. package/dist/client/assets/{index-redirect-DNU9Ckad.js → index-redirect-Dz1DdiHC.js} +1 -1
  116. package/dist/client/assets/{index-3Euwx3bh.js → index-uO0JijnU.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-GkUb2zKT.js → infiniteQueryObserver-CvEVG_TM.js} +1 -1
  118. package/dist/client/assets/{input-DsRHjNfg.js → input-BGQcwAaL.js} +1 -1
  119. package/dist/client/assets/{integration-icon-BOg4uSLi.js → integration-icon-B-zr5uGs.js} +1 -1
  120. package/dist/client/assets/{label-WCbT5R_C.js → label-zIig0cjv.js} +1 -1
  121. package/dist/client/assets/{layout-B9kVRgC4.js → layout-VuI1aPBj.js} +1 -1
  122. package/dist/client/assets/{login-B2dT1ex9.js → login-DgI1VcxE.js} +1 -1
  123. package/dist/client/assets/members-BdlFzlWX.js +3 -0
  124. package/dist/client/assets/{monaco-editor-BleU3J2F.js → monaco-editor-DQviDtyP.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-CwPKi62k.js → monitoring-stats-row-Bsjs_3xk.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-D_06ga7T.js → oauth-callback-CuHVTba4.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-kq_yOJkf.js → oauth-callback-ai-provider-B-N2lOyI.js} +1 -1
  128. package/dist/client/assets/{onboarding-CFkZhYek.js → onboarding-CqGFHsnX.js} +1 -1
  129. package/dist/client/assets/{org-install-BNh6vn9t.js → org-install-B0qdlOKM.js} +1 -1
  130. package/dist/client/assets/{org-layout-3aD45RuC.js → org-layout-CMGneEfe.js} +1 -1
  131. package/dist/client/assets/org-plugin-layout-DGdROiZB.js +1 -0
  132. package/dist/client/assets/{page-seo-form-CtJ-H1-o.js → page-seo-form-C3bI8Neh.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-Cs2jXSnd.js +1 -0
  134. package/dist/client/assets/{pair-DPmFvoFZ.js → pair-NC4sCATE.js} +1 -1
  135. package/dist/client/assets/{plugin-empty-state-m3Z19NWv.js → plugin-empty-state-FQw8SLzO.js} +1 -1
  136. package/dist/client/assets/{plugin-header-CeEbbzl3.js → plugin-header-D-cxTW9a.js} +1 -1
  137. package/dist/client/assets/plugin-layout-DECTyQVg.js +1 -0
  138. package/dist/client/assets/{popover-00xsE00R.js → popover-B1xAxEac.js} +1 -1
  139. package/dist/client/assets/{post-editor-DHpEWcQc.js → post-editor-BXy1yxCV.js} +1 -1
  140. package/dist/client/assets/{primitives-DpFr-gq2.js → primitives-CANqy_LE.js} +1 -1
  141. package/dist/client/assets/{profile-BJCcQ1KU.js → profile-UNuXVjVg.js} +1 -1
  142. package/dist/client/assets/project-app-view-7DW_WhHA.js +1 -0
  143. package/dist/client/assets/record-editor-D9aMJ7nl.js +1 -0
  144. package/dist/client/assets/registry-Ddq3KnAW.js +2 -0
  145. package/dist/client/assets/{registry-layout-DfY363OJ.js → registry-layout-DH7-iD95.js} +1 -1
  146. package/dist/client/assets/{require-capability-USY4c6Pw.js → require-capability-Bi88Fg3q.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-BTqABC6o.js → required-auth-layout-3IQyeREK.js} +1 -1
  148. package/dist/client/assets/{reset-password-DAzKe1m4.js → reset-password-Dstl0VXR.js} +1 -1
  149. package/dist/client/assets/{resizable-tvU32_PL.js → resizable-Cx-Y9zvP.js} +1 -1
  150. package/dist/client/assets/roles-BrYnRIt_.js +1 -0
  151. package/dist/client/assets/{save-status-c_gSkXRz.js → save-status-DSB279Mq.js} +1 -1
  152. package/dist/client/assets/{schema-form-DC8-fGrX.js → schema-form-f_EsRXt1.js} +1 -1
  153. package/dist/client/assets/{scroll-area-DjlF9Nhh.js → scroll-area-BYy84ztj.js} +1 -1
  154. package/dist/client/assets/{search-input-BIE6clnk.js → search-input-C3i2qrnL.js} +1 -1
  155. package/dist/client/assets/secrets-CAO0zPct.js +1 -0
  156. package/dist/client/assets/{sections-editor-S-fGjWCd.js → sections-editor-Dq0mEIsn.js} +1 -1
  157. package/dist/client/assets/{select-DzGY5lz9.js → select-DpYu937I.js} +1 -1
  158. package/dist/client/assets/{select-model-dzURvkLU.js → select-model-B8gz_8C_.js} +1 -1
  159. package/dist/client/assets/seo-editor-DCppyDVT.js +1 -0
  160. package/dist/client/assets/{settings-layout-B12mDVFK.js → settings-layout-BYi6Agz-.js} +1 -1
  161. package/dist/client/assets/{settings-section-DWjadbjH.js → settings-section-pgSq0Nbi.js} +1 -1
  162. package/dist/client/assets/{sheet-D-hNRlw_.js → sheet-y2Nja_Ue.js} +1 -1
  163. package/dist/client/assets/{shell-controls-BGifAFuQ.js → shell-controls-DyDfxDen.js} +1 -1
  164. package/dist/client/assets/shell-layout-D8qm1N5L.js +1 -0
  165. package/dist/client/assets/shell-route-loading-DQ0B9hX1.js +1 -0
  166. package/dist/client/assets/{sidebar-3Sp07kli.js → sidebar-B3S1MC-b.js} +1 -1
  167. package/dist/client/assets/{skeleton-CQGVA-Lx.js → skeleton-thGJKlMg.js} +1 -1
  168. package/dist/client/assets/{sortable.esm-DR5iV7W2.js → sortable.esm-DYE94iJD.js} +1 -1
  169. package/dist/client/assets/{spinner-CCf2Lbex.js → spinner-j70e5pPL.js} +1 -1
  170. package/dist/client/assets/sso-DUhv1jLf.js +1 -0
  171. package/dist/client/assets/store-DxrJkSaq.js +1 -0
  172. package/dist/client/assets/store-registry-B_QywLhG.js +2 -0
  173. package/dist/client/assets/{switch-DhDeb5VA.js → switch-BZi96ipJ.js} +1 -1
  174. package/dist/client/assets/{tab-id-BNsa7AXA.js → tab-id-CjkvF5Bz.js} +1 -1
  175. package/dist/client/assets/{table-BMoC5dcf.js → table-C3TjNbDC.js} +1 -1
  176. package/dist/client/assets/{tabs-DiVDzsDA.js → tabs-sqzEAKlk.js} +1 -1
  177. package/dist/client/assets/{task-status-DJjK_vX7.js → task-status-CgfEdw1R.js} +1 -1
  178. package/dist/client/assets/{textarea-Cq68Cg3C.js → textarea-Bo_ElpPh.js} +1 -1
  179. package/dist/client/assets/{toggle-group-CVuIqYb9.js → toggle-group-jYWXBndg.js} +1 -1
  180. package/dist/client/assets/{toolbar-CKVgGEMh.js → toolbar-BIjePcgn.js} +1 -1
  181. package/dist/client/assets/{tools-list-6s8Pp55V.js → tools-list-9Kj7tcM0.js} +1 -1
  182. package/dist/client/assets/{tooltip-CLHWv9z-.js → tooltip-CC_mfaKY.js} +1 -1
  183. package/dist/client/assets/{types-Cxg1qjf9.js → types-btWFnXlQ.js} +1 -1
  184. package/dist/client/assets/use-ai-providers-D2jZ5H5p.js +1 -0
  185. package/dist/client/assets/use-automations-B6ZTT5n1.js +1 -0
  186. package/dist/client/assets/{use-capability-DGItFWVB.js → use-capability-aJI8msnV.js} +1 -1
  187. package/dist/client/assets/{use-collections-DxWiIX9G.js → use-collections-vRlJo8MD.js} +1 -1
  188. package/dist/client/assets/use-connection-MP_sOdrQ.js +1 -0
  189. package/dist/client/assets/{use-copy-N9gIT0E2.js → use-copy-BkzArvj8.js} +1 -1
  190. package/dist/client/assets/{use-create-virtual-mcp-DilrGBsI.js → use-create-virtual-mcp-C88u5wPn.js} +1 -1
  191. package/dist/client/assets/{use-debounced-autosave-B43AQzLm.js → use-debounced-autosave-C2TtzjZB.js} +1 -1
  192. package/dist/client/assets/use-delete-connection-D8ryW-Gn.js +1 -0
  193. package/dist/client/assets/use-file-configs-DGSgkVs8.js +1 -0
  194. package/dist/client/assets/{use-infinite-scroll-DVN8HYM6.js → use-infinite-scroll-BYw2UY-G.js} +1 -1
  195. package/dist/client/assets/{use-list-state-VA1tpljN.js → use-list-state-CyVLGIWk.js} +1 -1
  196. package/dist/client/assets/use-mcp-client-Brxiewn2.js +10 -0
  197. package/dist/client/assets/{use-mcp-prompts-CY9OUQZa.js → use-mcp-prompts-CKvrvNSD.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-DXY52I1e.js → use-mcp-tools-DFeiBffX.js} +1 -1
  199. package/dist/client/assets/{use-members-9msf87Qx.js → use-members-D6H6sd8q.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-B_6LJV9r.js → use-navigate-to-agent-BRFls8tQ.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-5h3UhfD-.js → use-org-auth-client-IT7XMFB9.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-BTJacuR9.js → use-org-sso-BWWAvGBF.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-D4RU1UCZ.js → use-organization-roles-S9xtJ6m2.js} +1 -1
  204. package/dist/client/assets/use-organization-settings-DjvlRnDe.js +1 -0
  205. package/dist/client/assets/use-registry-connections-BQfixYFV.js +1 -0
  206. package/dist/client/assets/use-secrets-DEcBibJG.js +1 -0
  207. package/dist/client/assets/{use-status-sounds-CFOYqswl.js → use-status-sounds-BJZxFfhN.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-lzqGiNUo.js → use-view-mode-DXlui5dm.js} +1 -1
  209. package/dist/client/assets/use-virtual-mcp-DDTG_-f6.js +1 -0
  210. package/dist/client/assets/useInfiniteQuery-BEouccKd.js +1 -0
  211. package/dist/client/assets/{useRouterState-mAFXQkAT.js → useRouterState-xsU2zFoM.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-wDDb-pw7.js +1 -0
  213. package/dist/client/assets/user-BZco0YX9.js +1 -0
  214. package/dist/client/assets/{view-mode-toggle-PpUBwSzB.js → view-mode-toggle-BN8FgH0K.js} +1 -1
  215. package/dist/client/assets/workflow-BxGrEeHN.js +1 -0
  216. package/dist/client/assets/workflow-detail-QkGhQ2hI.js +1 -0
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +489 -488
  219. package/dist/server/migrate.js +59 -59
  220. package/dist/server/server.js +311 -310
  221. package/package.json +1 -1
  222. package/dist/client/assets/add-section-modal-MSG0lE-F.js +0 -1
  223. package/dist/client/assets/agents-list-BjNtpZI5.js +0 -1
  224. package/dist/client/assets/ai-providers-DzY2b1ST.js +0 -1
  225. package/dist/client/assets/app-editor-BOf1C0bR.js +0 -1
  226. package/dist/client/assets/automation-runs-BPWO4Oxo.js +0 -1
  227. package/dist/client/assets/automations-BzMfwiu_.js +0 -1
  228. package/dist/client/assets/brand-context-fK95FTJj.js +0 -1
  229. package/dist/client/assets/buckets-C3L_6HTA.js +0 -1
  230. package/dist/client/assets/collection-detail-CindHN_k.js +0 -1
  231. package/dist/client/assets/connect-desktop-dialog-Cd86_kfs.js +0 -1
  232. package/dist/client/assets/connection-card-DEJjtCgn.js +0 -1
  233. package/dist/client/assets/connection-detail-ChUQp5-t.js +0 -1
  234. package/dist/client/assets/connections-DN6XHtGB.js +0 -1
  235. package/dist/client/assets/constants-DDZG6Edw.js +0 -10
  236. package/dist/client/assets/domain-settings-BfbT9yk-.js +0 -1
  237. package/dist/client/assets/dynamic-plugin-layout-DLdasNw1.js +0 -1
  238. package/dist/client/assets/extract-connection-data-uGXsWpo7.js +0 -1
  239. package/dist/client/assets/features-Dr9Pp0WS.js +0 -1
  240. package/dist/client/assets/file-explorer-VM_XUNbz.js +0 -2
  241. package/dist/client/assets/general-DwCAWtBz.js +0 -1
  242. package/dist/client/assets/image-field-BaHZoCuZ.js +0 -1
  243. package/dist/client/assets/index-CEv88FJY.js +0 -1
  244. package/dist/client/assets/index-CPhDomOg.js +0 -1
  245. package/dist/client/assets/index-CW47dQON.js +0 -1
  246. package/dist/client/assets/members-CNZCKoI1.js +0 -3
  247. package/dist/client/assets/org-plugin-layout-BZ9dFRVl.js +0 -1
  248. package/dist/client/assets/page-seo-sheet-EUvWIgmh.js +0 -1
  249. package/dist/client/assets/plugin-layout-Bi-w5408.js +0 -1
  250. package/dist/client/assets/project-app-view-I1ua83t6.js +0 -1
  251. package/dist/client/assets/record-editor-B1-ONBrf.js +0 -1
  252. package/dist/client/assets/registry-CbWwvuqp.js +0 -2
  253. package/dist/client/assets/roles-B2-ESfgD.js +0 -1
  254. package/dist/client/assets/secrets-Dx_3aWOf.js +0 -1
  255. package/dist/client/assets/seo-editor-II_27c8U.js +0 -1
  256. package/dist/client/assets/shell-layout-DSHLjHdv.js +0 -1
  257. package/dist/client/assets/shell-route-loading-BMFmixVz.js +0 -1
  258. package/dist/client/assets/sso-qnvxODbb.js +0 -1
  259. package/dist/client/assets/store-DDT_HXod.js +0 -1
  260. package/dist/client/assets/store-registry-IbxDOVas.js +0 -2
  261. package/dist/client/assets/use-ai-providers-BUmRVTXM.js +0 -1
  262. package/dist/client/assets/use-automations-BQsS5jcL.js +0 -1
  263. package/dist/client/assets/use-connection-BKakpvkk.js +0 -1
  264. package/dist/client/assets/use-delete-connection-Sa9GqDFj.js +0 -1
  265. package/dist/client/assets/use-file-configs-BSxIo3R0.js +0 -1
  266. package/dist/client/assets/use-organization-settings-DeuE04BS.js +0 -1
  267. package/dist/client/assets/use-registry-connections-BFubWEDK.js +0 -1
  268. package/dist/client/assets/use-secrets-CEE2TPN5.js +0 -1
  269. package/dist/client/assets/use-virtual-mcp-wf8itLFJ.js +0 -1
  270. package/dist/client/assets/useInfiniteQuery-FaewV0Uc.js +0 -1
  271. package/dist/client/assets/useSuspenseInfiniteQuery-DzO-0tti.js +0 -1
  272. package/dist/client/assets/user-ujRRaChx.js +0 -1
  273. package/dist/client/assets/workflow-BQljQVTn.js +0 -1
  274. package/dist/client/assets/workflow-detail-BK_EcA2N.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "3.19.1",
3
+ "version": "3.20.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{e as $,r as g,j as r,c as H}from"./index-RoHcRkq0.js";import{D as _}from"./agent-icon-atw8dEpB.js";import{i as V}from"./SearchMd-Ckbe6j0d.js";import{D as X,a as J,c as K,b as Q}from"./dialog-CvJmXij7.js";import{I as Y}from"./input-DsRHjNfg.js";import{_ as Z,X as ee,$ as te,a0 as G,G as re}from"./index-DU03U45c.js";import"./AlertCircle-CfP2ydlK.js";import"./Tool01-D6Ixmgxm.js";import"./SwitchHorizontal01-CLmvgZdy.js";import"./RefreshCcw01-Do9uT8r5.js";import"./XCircle-gezQrKJB.js";import"./ArrowUpRight-BG7K2o4g.js";import"./ZapSquare-Doe97qp7.js";import"./Users03-C3j_vENk.js";import"./CheckCircle-ByVfCd_z.js";import"./Check-Rzhysg8v.js";import"./ChevronDown-DgAQraB9.js";import"./ChevronLeft-hIkmA-06.js";import"./ChevronRight-C-1GbVi6.js";import"./ChevronUp-D95kdAWS.js";import"./DotsVertical--nxfulT_.js";import"./Container-EsK9R8Cs.js";import"./Eye-0u1NnyPn.js";import"./ZoomOut-u9z9zRXH.js";import"./Globe01-CYJ5akFo.js";import"./FilterLines-lN6ZYEU6.js";import"./Star01-DinMZEQp.js";import"./Palette-CvBtCHX7.js";import"./HardDrive-Bi11tZlO.js";import"./Stars02-CovFPupV.js";import"./Key01-ETI9VuA0.js";import"./LayoutLeft-D5P3SyL5.js";import"./LinkExternal01-CMTN51kD.js";import"./Monitor01-B9COEs1V.js";import"./Sun-D5MzBxyK.js";import"./Play-zcNTCzY3.js";import"./Plus-BVt3gf6N.js";import"./Settings02-BFHOCA5h.js";import"./Shield01-ebA_Mmqa.js";import"./Stars01-cUHrtzm6.js";import"./Trash01-C6sXu2xm.js";import"./Upload01-DslYY_N3.js";import"./User01-9CJ-p7XF.js";import"./Users01-Ds5_zubO.js";import"./XClose-dfaecXcF.js";import"./X-Dzpu-bw3.js";import"./Zap-ZCJiHFB8.js";import"./agent-capabilities-C4HO1AsU.js";import"./chat-context-7nRfVaxU.js";import"./tab-id-BNsa7AXA.js";import"./constants-DDZG6Edw.js";import"./decopilot-sse-pool-DYhlxmFV.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-wf8itLFJ.js";import"./use-collections-DxWiIX9G.js";import"./use-ai-providers-BUmRVTXM.js";import"./use-organization-settings-DeuE04BS.js";import"./pair-DPmFvoFZ.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-DjlF9Nhh.js";import"./select-DzGY5lz9.js";import"./tooltip-CLHWv9z-.js";import"./use-copy-N9gIT0E2.js";import"./file-type-icon-B565DmsG.js";import"./content-blocks-o63cs2vh.js";import"./types-Cxg1qjf9.js";import"./shell-layout-DSHLjHdv.js";import"./avatar-DiepLBEZ.js";import"./required-auth-layout-BTqABC6o.js";import"./useRouterState-mAFXQkAT.js";import"./use-org-sso-BTJacuR9.js";import"./integration-icon-BOg4uSLi.js";import"./use-navigate-to-agent-B_6LJV9r.js";import"./use-connection-BKakpvkk.js";import"./use-mcp-prompts-CY9OUQZa.js";import"./form-DAahwl9B.js";import"./label-WCbT5R_C.js";import"./spinner-CCf2Lbex.js";import"./drawer-Cm2a8ouX.js";import"./collection-search-C0bvNtM9.js";import"./tabs-DiVDzsDA.js";import"./toggle-group-CVuIqYb9.js";import"./connect-desktop-dialog-Cd86_kfs.js";import"./agent-icons-BO9U458u.js";import"./checkbox-B2YbUc0m.js";import"./skeleton-CQGVA-Lx.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DWjadbjH.js";import"./card-B2dT-2ts.js";import"./popover-00xsE00R.js";import"./command-BjqkQYxa.js";import"./index-B2iHTL-o.js";import"./useInfiniteQuery-FaewV0Uc.js";import"./infiniteQueryObserver-GkUb2zKT.js";import"./sortable.esm-DR5iV7W2.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DEJjtCgn.js";import"./use-registry-connections-BFubWEDK.js";import"./extract-connection-data-uGXsWpo7.js";import"./generate-id-CnLzNGg6.js";import"./collections-BUCuRVxl.js";import"./collection-tabs-BN4In63u.js";import"./badge-Cosh8Jv6.js";import"./textarea-Cq68Cg3C.js";import"./connection-form-helpers-B093QOVj.js";import"./use-infinite-scroll-DVN8HYM6.js";import"./useSuspenseInfiniteQuery-DzO-0tti.js";import"./index-DaTDomcZ.js";import"./dropdown-menu-jK5-EocK.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-BMFmixVz.js";import"./sidebar-3Sp07kli.js";import"./sheet-D-hNRlw_.js";import"./toolbar-CKVgGEMh.js";import"./use-create-virtual-mcp-DilrGBsI.js";import"./github-repo-picker-qDFzaGLa.js";import"./use-mcp-tools-DXY52I1e.js";import"./alert-dialog-BDuu9Vea.js";import"./index-nS3rTKOQ.js";import"./use-org-auth-client-5h3UhfD-.js";import"./hover-card-DyNloM84.js";import"./task-status-DJjK_vX7.js";import"./use-status-sounds-CFOYqswl.js";import"./empty-state-BvMn8pb-.js";import"./resizable-tvU32_PL.js";import"./use-capability-DGItFWVB.js";import"./header-tab-button-sg2Bkh9m.js";import"./index-Dw66yPMC.js";import"./user-ujRRaChx.js";import"./tools-list-6s8Pp55V.js";import"./switch-DhDeb5VA.js";import"./use-debounced-autosave-B43AQzLm.js";import"./index-Dhy2A-ml.js";import"./search-input-BIE6clnk.js";import"./use-secrets-CEE2TPN5.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-y8ERtqeD.js";import"./view-mode-toggle-PpUBwSzB.js";import"./select-model-dzURvkLU.js";import"./use-automations-BQsS5jcL.js";import"./monaco-editor-BleU3J2F.js";import"./automation-runs-BPWO4Oxo.js";import"./table-BMoC5dcf.js";import"./use-members-9msf87Qx.js";import"./automation-list-row-DCGCyvJL.js";const oe=12,E=new Set,D=new Set;function ie(){for(const l of D)l()}function se(l){return E.has(l)?!0:E.size>=oe?!1:(E.add(l),!0)}function F(l){E.delete(l)&&ie()}function le(l){return D.add(l),()=>{D.delete(l)}}function me(l,e){const t=g.useRef(!1),[v,n]=g.useState(!1),m=g.useRef(null),p=g.useRef(null),i=g.useRef(null),o=g.useRef(l);o.current=l;const[x]=g.useState(()=>{const s=()=>{i.current?.(),i.current=null},c=()=>t.current?!0:se(e)?(t.current=!0,n(!0),s(),!0):!1;return f=>{if(p.current=f,m.current&&(m.current.disconnect(),m.current=null),s(),!f){t.current&&(F(e),t.current=!1,n(!1));return}queueMicrotask(()=>{if(p.current!==f)return;const a=new IntersectionObserver(u=>{if(u[0]?.isIntersecting??!1){!c()&&!i.current&&(i.current=le(()=>{p.current===f&&c()}));return}s(),t.current&&(F(e),t.current=!1,n(!1))},{root:o.current.current,rootMargin:"160px 0px"});a.observe(f),m.current=a})}});return{ref:x,iframeActive:v}}function ne(l){const e=$.c(8),{previewUrl:t,title:v,scrollRootRef:n,slotId:m}=l,{ref:p,iframeActive:i}=me(n,m),[o,x]=g.useState(!1);let s;e[0]!==i||e[1]!==o||e[2]!==t||e[3]!==v?(s=i?r.jsxs(r.Fragment,{children:[!o&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${v}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>x(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=i,e[1]=o,e[2]=t,e[3]=v,e[4]=s):s=e[4];let c;return e[5]!==p||e[6]!==s?(c=r.jsx("div",{ref:p,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:s}),e[5]=p,e[6]=s,e[7]=c):c=e[7],c}function pe(l){const e=$.c(26),{entry:t,previewUrl:v,scrollRootRef:n,onSelect:m}=l,p=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let i;e[0]!==p?(i=H("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",p),e[0]=p,e[1]=i):i=e[1];let o;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==v||e[5]!==n?(o=r.jsx(ne,{previewUrl:v,title:t.title,scrollRootRef:n,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=v,e[5]=n,e[6]=o):o=e[6];let x;e[7]!==t.isSavedBlock?(x=t.isSavedBlock?{color:re}:void 0,e[7]=t.isSavedBlock,e[8]=x):x=e[8];let s;e[9]!==x?(s=r.jsx(_,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=s):s=e[10];let c;e[11]!==t.title?(c=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=c):c=e[12];let f;e[13]!==t.description?(f=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=f):f=e[14];let a;e[15]!==c||e[16]!==f?(a=r.jsxs("div",{className:"min-w-0 flex-1",children:[c,f]}),e[15]=c,e[16]=f,e[17]=a):a=e[17];let u;e[18]!==s||e[19]!==a?(u=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[s,a]}),e[18]=s,e[19]=a,e[20]=u):u=e[20];let h;return e[21]!==m||e[22]!==i||e[23]!==o||e[24]!==u?(h=r.jsxs("button",{type:"button",onClick:m,className:i,children:[o,u]}),e[21]=m,e[22]=i,e[23]=o,e[24]=u,e[25]=h):h=e[25],h}function Jr(l){const e=$.c(41),{open:t,onOpenChange:v,meta:n,decofile:m,previewBaseUrl:p,onSelect:i}=l,[o,x]=g.useState(""),[s,c]=g.useState(t),f=g.useRef(null);t!==s&&(c(t),t&&x(""));let a,u,h,b,S,j,N,y,w,R,C;if(e[0]!==m||e[1]!==n||e[2]!==v||e[3]!==i||e[4]!==t||e[5]!==p||e[6]!==o){const U=t&&n&&m?Z(n,m):[],M=n?ee(n):"",z=m?te(m):void 0,W=new Map;if(t&&M)for(const d of U)W.set(d.resolveType,G(p,M,d.previewBlock,z));const A=o.trim().toLowerCase(),q=A?U.filter(d=>d.title.toLowerCase().includes(A)||d.resolveType.toLowerCase().includes(A)||d.description?.toLowerCase().includes(A)):U;u=X,R=t,C=v,a=J,N="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let O;e[18]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(K,{children:"Add section"}),e[18]=O):O=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(V,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[19]=k):k=e[19];let B;e[20]===Symbol.for("react.memo_cache_sentinel")?(B=d=>x(d.target.value),e[20]=B):B=e[20],e[21]!==o?(w=r.jsxs(Q,{className:"shrink-0 border-b px-4 py-3 text-left",children:[O,r.jsxs("div",{className:"relative pt-2",children:[k,r.jsx(Y,{value:o,onChange:B,placeholder:"Search sections...",className:"h-9 pl-8"})]})]}),e[21]=o,e[22]=w):w=e[22],S=f,j="min-h-0 flex-1 overflow-y-auto",h="p-4",b=q.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No sections found."}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:q.map(d=>r.jsx(pe,{entry:d,scrollRootRef:f,previewUrl:W.get(d.resolveType)??G(p,M,d.previewBlock,z),onSelect:()=>i(d)},d.resolveType))}),e[0]=m,e[1]=n,e[2]=v,e[3]=i,e[4]=t,e[5]=p,e[6]=o,e[7]=a,e[8]=u,e[9]=h,e[10]=b,e[11]=S,e[12]=j,e[13]=N,e[14]=y,e[15]=w,e[16]=R,e[17]=C}else a=e[7],u=e[8],h=e[9],b=e[10],S=e[11],j=e[12],N=e[13],y=e[14],w=e[15],R=e[16],C=e[17];let T;e[23]!==h||e[24]!==b?(T=r.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=T):T=e[25];let I;e[26]!==T||e[27]!==S||e[28]!==j?(I=r.jsx("div",{ref:S,className:j,children:T}),e[26]=T,e[27]=S,e[28]=j,e[29]=I):I=e[29];let L;e[30]!==a||e[31]!==I||e[32]!==N||e[33]!==y||e[34]!==w?(L=r.jsxs(a,{closeButtonClassName:N,className:y,children:[w,I]}),e[30]=a,e[31]=I,e[32]=N,e[33]=y,e[34]=w,e[35]=L):L=e[35];let P;return e[36]!==u||e[37]!==L||e[38]!==R||e[39]!==C?(P=r.jsx(u,{open:R,onOpenChange:C,children:L}),e[36]=u,e[37]=L,e[38]=R,e[39]=C,e[40]=P):P=e[40],P}export{Jr as AddSectionModal};
@@ -1 +0,0 @@
1
- import{e as se,j as s,B as Z,q as me,r as Y,t as v,o as de}from"./index-RoHcRkq0.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-jK5-EocK.js";import{s as pe}from"./Star01-DinMZEQp.js";import{a as fe}from"./Users03-C3j_vENk.js";import{S as ge,G as ue,u as he,H as ie,W as oe,a as xe,I as je}from"./github-repo-picker-qDFzaGLa.js";import{a as _e,b as Ce,c as be}from"./use-virtual-mcp-wf8itLFJ.js";import{P as q}from"./index-Dhy2A-ml.js";import{i as ye}from"./DotsVertical--nxfulT_.js";import{a as Ne}from"./Settings02-BFHOCA5h.js";import{s as Se}from"./Trash01-C6sXu2xm.js";import{A as De,ao as ve}from"./agent-icon-atw8dEpB.js";import{k as Ae}from"./use-navigate-to-agent-B_6LJV9r.js";import{C as ke}from"./card-B2dT-2ts.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-DGItFWVB.js";import{E as Te}from"./empty-state-BvMn8pb-.js";import{u as ze}from"./use-create-virtual-mcp-DilrGBsI.js";import{c as Ie,b as Pe,d as He,f as Ee,e as Me,g as Oe,a as Be,A as Ge}from"./alert-dialog-BDuu9Vea.js";import{S as $e}from"./search-input-BIE6clnk.js";import{s as le}from"./Plus-BVt3gf6N.js";import"./Check-Rzhysg8v.js";import"./ChevronRight-C-1GbVi6.js";import"./use-connection-BKakpvkk.js";import"./use-collections-DxWiIX9G.js";import"./constants-DDZG6Edw.js";import"./dialog-CvJmXij7.js";import"./X-Dzpu-bw3.js";import"./RefreshCcw01-Do9uT8r5.js";import"./collection-search-C0bvNtM9.js";import"./SearchMd-Ckbe6j0d.js";import"./checkbox-B2YbUc0m.js";import"./use-mcp-tools-DXY52I1e.js";import"./extract-connection-data-uGXsWpo7.js";import"./generate-id-CnLzNGg6.js";import"./collections-BUCuRVxl.js";import"./sidebar-3Sp07kli.js";import"./LayoutLeft-D5P3SyL5.js";import"./tooltip-CLHWv9z-.js";import"./sheet-D-hNRlw_.js";import"./AlertCircle-CfP2ydlK.js";import"./Tool01-D6Ixmgxm.js";import"./SwitchHorizontal01-CLmvgZdy.js";import"./XCircle-gezQrKJB.js";import"./ArrowUpRight-BG7K2o4g.js";import"./ZapSquare-Doe97qp7.js";import"./CheckCircle-ByVfCd_z.js";import"./ChevronDown-DgAQraB9.js";import"./ChevronLeft-hIkmA-06.js";import"./ChevronUp-D95kdAWS.js";import"./Container-EsK9R8Cs.js";import"./Eye-0u1NnyPn.js";import"./ZoomOut-u9z9zRXH.js";import"./Globe01-CYJ5akFo.js";import"./FilterLines-lN6ZYEU6.js";import"./Palette-CvBtCHX7.js";import"./HardDrive-Bi11tZlO.js";import"./Stars02-CovFPupV.js";import"./Key01-ETI9VuA0.js";import"./LinkExternal01-CMTN51kD.js";import"./Monitor01-B9COEs1V.js";import"./Sun-D5MzBxyK.js";import"./Play-zcNTCzY3.js";import"./Shield01-ebA_Mmqa.js";import"./Stars01-cUHrtzm6.js";import"./Upload01-DslYY_N3.js";import"./User01-9CJ-p7XF.js";import"./Users01-Ds5_zubO.js";import"./XClose-dfaecXcF.js";import"./Zap-ZCJiHFB8.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(k,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(k,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:ge,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(k,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ue,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(k,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(k,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(k,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(k,{variant:"destructive",onClick:w=>{w.stopPropagation(),l(w)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function rs(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=he(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=we("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=q,A=q,w=q;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(q.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const K=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==w.Body||t[19]!==I||t[20]!==K?(P=s.jsxs(w.Body,{children:[I,K,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=K,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(xe,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{rs as default};
@@ -1 +0,0 @@
1
- import{T as B,W as C,aH as ce,aJ as ae,aK as be,aI as ye,ba as pe,e as M,I as ve,H as je,r as T,j as s,D as $e,o as Q,C as _e,q as H,G as ne,a as ee,K as G,n as Ie,c as ge,B as V,t as Se,E as Te}from"./index-RoHcRkq0.js";import{i as Oe}from"./AlertCircle-CfP2ydlK.js";import{P as oe}from"./index-Dhy2A-ml.js";import{S as de}from"./skeleton-CQGVA-Lx.js";import{b as ke,a as me,S as ue,c as Me}from"./settings-section-DWjadbjH.js";import{u as te,b as re,c as Ce}from"./use-ai-providers-BUmRVTXM.js";import{i as Ue}from"./CheckCircle-ByVfCd_z.js";import{p as ze}from"./chat-context-7nRfVaxU.js";import{e as Le,f as qe}from"./use-organization-settings-DeuE04BS.js";import{M as Ve}from"./select-model-dzURvkLU.js";import{u as Be}from"./use-debounced-autosave-B43AQzLm.js";import{I as le}from"./input-DsRHjNfg.js";import{a as he,T as Ge}from"./toggle-group-CVuIqYb9.js";import{b as Ne,c as we,d as Pe,f as Ae,a as De,e as Ke,g as Ee,A as Fe}from"./alert-dialog-BDuu9Vea.js";import{S as J,u as X}from"./constants-DDZG6Edw.js";import{s as Qe}from"./Plus-BVt3gf6N.js";import{i as We}from"./Tool01-D6Ixmgxm.js";import{s as Ye}from"./Trash01-C6sXu2xm.js";import{A as He}from"./avatar-DiepLBEZ.js";import{O as Re,P as Je,c as xe}from"./agent-icons-BO9U458u.js";import{a as Xe}from"./RefreshCcw01-Do9uT8r5.js";import{s as Ze}from"./Eye-0u1NnyPn.js";import{d as et,b as tt,c as st,a as it,D as ot}from"./dialog-CvJmXij7.js";import{S as rt}from"./spinner-CCf2Lbex.js";import{f as lt}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as nt}from"./require-capability-USY4c6Pw.js";import"./sidebar-3Sp07kli.js";import"./LayoutLeft-D5P3SyL5.js";import"./tooltip-CLHWv9z-.js";import"./sheet-D-hNRlw_.js";import"./X-Dzpu-bw3.js";import"./card-B2dT-2ts.js";import"./ArrowUpRight-BG7K2o4g.js";import"./tab-id-BNsa7AXA.js";import"./decopilot-sse-pool-DYhlxmFV.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-wf8itLFJ.js";import"./use-collections-DxWiIX9G.js";import"./drawer-Cm2a8ouX.js";import"./User01-9CJ-p7XF.js";import"./checkbox-B2YbUc0m.js";import"./Check-Rzhysg8v.js";import"./select-DzGY5lz9.js";import"./ChevronDown-DgAQraB9.js";import"./ChevronUp-D95kdAWS.js";import"./Key01-ETI9VuA0.js";import"./SearchMd-Ckbe6j0d.js";import"./Settings02-BFHOCA5h.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-B9COEs1V.js";import"./ChevronRight-C-1GbVi6.js";import"./connect-desktop-dialog-Cd86_kfs.js";import"./Stars01-cUHrtzm6.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-DGItFWVB.js";import"./access-gate-CLs4hv6_.js";import"./capability-load-error-h6odhJ2k.js";B({title:C(),url:C(),icon:C()});B({registries:ae(C(),B({enabled:be()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ce(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const Z=B({keyId:C(),modelId:C(),title:C().optional()}).nullable();ye(["fast","smart","thinking","image","web_research"]);ye(["fast","smart","thinking"]);const at=B({tiers:B({fast:Z,smart:Z,thinking:Z,image:Z,web_research:Z})});B({ids:ce(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:B({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ce(ae(C(),pe())).nullable().optional().describe("Brand images"),metadata:ae(C(),pe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:be().optional().describe("Whether this is the default brand for the organization")});const ct=e=>e.capabilities?.includes("image")===!0,dt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:ct},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:dt}];function ut(e){const t=M.c(20),{slot:i,onSlotChange:l,filterModels:o,defaultKeyId:a}=e,r=te(),[n,p]=T.useState(i?.keyId??a);let y;t[0]!==i?(y=()=>{i?.keyId&&p(i.keyId)},t[0]=i,t[1]=y):y=t[1];const I=i?.keyId;let h;t[2]!==I?(h=[I],t[2]=I,t[3]=h):h=t[3],T.useEffect(y,h);const c=n??a;let u;t[4]!==c||t[5]!==r?(u=c?r.find(d=>d.id===c):null,t[4]=c,t[5]=r,t[6]=u):u=t[6];const k=u,{models:m,isLoading:S}=re(o?c??void 0:void 0),v=o?S||m.some(o):!0;let g;t[7]!==i||t[8]!==k?.providerId?(g=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:k?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=k?.providerId,t[9]=g):g=t[9];const x=g;if(o&&!v){let d;return t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=d):d=t[10],d}let b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=d=>p(d),t[11]=b):b=t[11];let j;t[12]!==c||t[13]!==l?(j=d=>{const w=d.keyId??c??"";p(w),l({keyId:w,modelId:d.modelId,title:d.title})},t[12]=c,t[13]=l,t[14]=j):j=t[14];let f;return t[15]!==c||t[16]!==o||t[17]!==x||t[18]!==j?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:x,credentialId:c,filterModels:o,onCredentialChange:b,onModelChange:j}),t[15]=c,t[16]=o,t[17]=x,t[18]=j,t[19]=f):f=t[19],f}function ft(e){const t=M.c(2),{isPending:i,showSaved:l}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(_e,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(l){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ue,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function pt(){const e=M.c(42),t=te(),i=Le(),l=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ve(at),e[0]=o):o=e[0];let a;e[1]!==i?(a={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=a):a=e[2];const r=je(a),{mutate:n,isPending:p,isSuccess:y}=qe(),I=r.formState.isDirty;let h;e[3]!==r||e[4]!==i||e[5]!==n?(h={delayMs:250,save:async()=>{const _=r.getValues();n(_,{onSuccess:()=>r.reset(_,{keepValues:!0}),onError:F=>{r.reset(i),Q.error(`Failed to save: ${F.message}`)}})}},e[3]=r,e[4]=i,e[5]=n,e[6]=h):h=e[6];const{schedule:c}=Be(h),u=t[0],k=t[1],m=t[2],{models:S}=re(u?.id),{models:v}=re(k?.id),{models:g}=re(m?.id);let x,b;e[7]!==r||e[8]!==l?(x=()=>{l||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},b=[l,r],e[7]=r,e[8]=l,e[9]=x,e[10]=b):(x=e[9],b=e[10]),T.useEffect(x,b);let j;e[11]!==t||e[12]!==r||e[13]!==u||e[14]!==k||e[15]!==m||e[16]!==S||e[17]!==v||e[18]!==g?(j=()=>{const _=r.getValues(),F=new Set(t.map(gt)),P={};u?.id&&(P[u.id]=S),k?.id&&(P[k.id]=v),m?.id&&(P[m.id]=g);const E=W=>W!=null&&!F.has(W.keyId),N={fast:E(_.tiers.fast)?null:_.tiers.fast,smart:E(_.tiers.smart)?null:_.tiers.smart,thinking:E(_.tiers.thinking)?null:_.tiers.thinking,image:E(_.tiers.image)?null:_.tiers.image,web_research:E(_.tiers.web_research)?null:_.tiers.web_research},L=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,q=N.fast===_.tiers.fast&&N.smart===_.tiers.smart&&N.thinking===_.tiers.thinking&&N.image===_.tiers.image&&N.web_research===_.tiers.web_research;if(!L&&q)return;const R=ze(t,P);r.reset({tiers:{fast:N.fast??R.chat.fast,smart:N.smart??R.chat.smart,thinking:N.thinking??R.chat.thinking,image:N.image??R.image,web_research:N.web_research??R.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=u,e[14]=k,e[15]=m,e[16]=S,e[17]=v,e[18]=g,e[19]=j):j=e[19];const f=u?.id,d=k?.id,w=m?.id;let U;e[20]!==t||e[21]!==r||e[22]!==S||e[23]!==v||e[24]!==g||e[25]!==f||e[26]!==d||e[27]!==w?(U=[r,t,S,v,g,f,d,w],e[20]=t,e[21]=r,e[22]=S,e[23]=v,e[24]=g,e[25]=f,e[26]=d,e[27]=w,e[28]=U):U=e[28],T.useEffect(j,U);let O;e[29]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=O):O=e[29];const z=y&&!I;let A;e[30]!==p||e[31]!==z?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[O,s.jsx(ft,{isPending:p,showSaved:z})]}),e[30]=p,e[31]=z,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==c?(D=mt.map(_=>s.jsx($e,{control:r.control,name:`tiers.${_.key}`,render:F=>{const{field:P}=F;return s.jsx(ke,{title:_.label,description:_.description,action:s.jsx(ut,{slot:P.value,defaultKeyId:t[0]?.id??null,filterModels:_.filter,onSlotChange:E=>{P.onChange(E),c()}})})}},_.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=c,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(me,{children:D}),e[37]=D,e[38]=K):K=e[38];let $;return e[39]!==A||e[40]!==K?($=s.jsxs(ue,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=$):$=e[41],$}function gt(e){return e.id}const ht={usd:[10,20,100],brl:[50,100,500]};function xt(){const e=M.c(29),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),[o,a]=T.useState(!1),{mutate:r,isPending:n}=ee({mutationFn:async d=>{const w=await l.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:d,currency:c}});if(w?.isError)throw new Error(w.content?.[0]?.text??"Failed to get top-up URL");return w.structuredContent?.url},onSuccess:yt,onError:bt}),[p,y]=T.useState(""),[I,h]=T.useState("usd"),c=I,u=parseFloat(p),k=!isNaN(u)&&u>=1,m=c==="brl"?"R$":"$";let S;e[3]!==h?(S=d=>{d&&h(d)},e[3]=h,e[4]=S):S=e[4];let v,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(he,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),g=s.jsx(he,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[5]=v,e[6]=g):(v=e[5],g=e[6]);let x;e[7]!==c||e[8]!==S?(x=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:c,onValueChange:S,children:[v,g]}),e[7]=c,e[8]=S,e[9]=x):x=e[9];let b;e[10]!==c||e[11]!==m||e[12]!==o||e[13]!==n||e[14]!==r?(b=!o&&s.jsxs(s.Fragment,{children:[ht[c].map(d=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:n,onClick:()=>r(d*100),children:[m,d]},d)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:n,children:"Custom"})]}),e[10]=c,e[11]=m,e[12]=o,e[13]=n,e[14]=r,e[15]=b):b=e[15];let j;e[16]!==m||e[17]!==p||e[18]!==u||e[19]!==o||e[20]!==k||e[21]!==n||e[22]!==y||e[23]!==r?(j=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:m}),s.jsx(le,{type:"number",min:"1",step:"1",placeholder:"50",value:p,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!k||n,onClick:()=>r(Math.round(u*100)),children:n?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:"Cancel"})]}),e[16]=m,e[17]=p,e[18]=u,e[19]=o,e[20]=k,e[21]=n,e[22]=y,e[23]=r,e[24]=j):j=e[24];let f;return e[25]!==x||e[26]!==b||e[27]!==j?(f=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x,b,j]})}),e[25]=x,e[26]=b,e[27]=j,e[28]=f):f=e[28],f}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=M.c(61),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne(),a=te();let r;e[3]!==a?(r=a.find(It),e[3]=a,e[4]=r):r=e[4];const n=r,[p,y]=T.useState(!1);let I;e[5]!==l||e[6]!==n?(I=async()=>{n&&await l.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:n.id}})},e[5]=l,e[6]=n,e[7]=I):I=e[7];let h;e[8]!==t.id||e[9]!==o?(h=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),y(!1)},e[8]=t.id,e[9]=o,e[10]=h):h=e[10];let c;e[11]!==I||e[12]!==h?(c={mutationFn:I,onSuccess:h,onError:_t},e[11]=I,e[12]=h,e[13]=c):c=e[13];const{mutate:u,isPending:k}=ee(c);let m;e[14]!==t.id?(m=G.aiProviderCredits(t.id,"deco"),e[14]=t.id,e[15]=m):m=e[15];const S=!!n;let v;e[16]!==l?(v=async()=>{const fe=await l.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return fe?.isError?null:fe.structuredContent??null},e[16]=l,e[17]=v):v=e[17];let g;e[18]!==m||e[19]!==S||e[20]!==v?(g={queryKey:m,enabled:S,staleTime:6e4,queryFn:v},e[18]=m,e[19]=S,e[20]=v,e[21]=g):g=e[21];const{data:x,isLoading:b,refetch:j,isFetching:f}=Ie(g);if(!n)return null;const d=x?.balanceCents!=null?x.balanceCents/100:null;let w;e[22]!==d?(w=d!=null?`$${d.toFixed(2)}`:"—",e[22]=d,e[23]=w):w=e[23];const U=w;let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[24]=O):O=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),e[25]=z):z=e[25];let A;e[26]!==k?(A=s.jsxs("div",{className:"flex items-center justify-between",children:[O,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:k,children:"Disconnect"})]}),e[26]=k,e[27]=A):A=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ne,{children:[s.jsx(we,{children:"Disconnect Deco AI Gateway"}),s.jsx(Pe,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[28]=D):D=e[28];let K;e[29]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ae,{children:"Cancel"}),e[29]=K):K=e[29];let $;e[30]!==u?($=s.jsxs(De,{children:[D,s.jsxs(Ke,{children:[K,s.jsx(Ee,{onClick:()=>u(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[30]=u,e[31]=$):$=e[31];let _;e[32]!==p||e[33]!==$?(_=s.jsx(Fe,{open:p,onOpenChange:y,children:$}),e[32]=p,e[33]=$,e[34]=_):_=e[34];let F;e[35]!==d||e[36]!==U||e[37]!==f||e[38]!==b?(F=b||f?s.jsx(de,{className:"h-9 w-24"}):s.jsx("span",{className:ge("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&vt(d)),children:U}),e[35]=d,e[36]=U,e[37]=f,e[38]=b,e[39]=F):F=e[39];let P;e[40]!==j?(P=()=>j(),e[40]=j,e[41]=P):P=e[41];const E=f&&"animate-spin";let N;e[42]!==E?(N=ge(E),e[42]=E,e[43]=N):N=e[43];let L;e[44]!==N?(L=s.jsx(_e,{size:14,className:N}),e[44]=N,e[45]=L):L=e[45];let q;e[46]!==f||e[47]!==P||e[48]!==L?(q=s.jsx("button",{type:"button",onClick:P,disabled:f,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:L}),e[46]=f,e[47]=P,e[48]=L,e[49]=q):q=e[49];let R;e[50]!==F||e[51]!==q?(R=s.jsxs("div",{className:"flex items-baseline gap-2",children:[F,q]}),e[50]=F,e[51]=q,e[52]=R):R=e[52];let W;e[53]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[53]=W):W=e[53];let Y;e[54]!==R?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[R,W]}),e[54]=R,e[55]=Y):Y=e[55];let se;e[56]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(xt,{})]}),e[56]=se):se=e[56];let ie;return e[57]!==A||e[58]!==_||e[59]!==Y?(ie=s.jsx(ue,{title:"Deco AI Gateway",children:s.jsx(me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[A,_,Y,se]})})}),e[57]=A,e[58]=_,e[59]=Y,e[60]=ie):ie=e[60],ie}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function It(e){return e.providerId==="deco"}function St(){const e=M.c(11),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne();let a;e[3]!==l?(a=async()=>{const p=await l.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:"deco"}});if(p?.isError)throw new Error(p.content?.[0]?.text??"Key provisioning failed")},e[3]=l,e[4]=a):a=e[4];let r;e[5]!==t.id||e[6]!==o?(r=()=>{Se("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[5]=t.id,e[6]=o,e[7]=r):r=e[7];let n;return e[8]!==a||e[9]!==r?(n={mutationFn:a,onSuccess:r,onError:kt},e[8]=a,e[9]=r,e[10]=n):n=e[10],ee(n)}function kt(e){Se("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=M.c(10),{mutate:t,isPending:i}=St();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:l.join(", ")}}),e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=a):a=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let n;e[4]!==t?(n=()=>t(),e[4]=t,e[5]=n):n=e[5];const p=i?"Connecting…":"Connect Deco";let y;return e[6]!==i||e[7]!==n||e[8]!==p?(y=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[a,r,s.jsx(V,{variant:"outline",disabled:i,onClick:n,children:p})]})]}),e[6]=i,e[7]=n,e[8]=p,e[9]=y):y=e[9],y}const Nt=B({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function wt({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:o,currentBaseUrl:a,onCancel:r,onSuccess:n}){const{org:p}=H(),y=X({connectionId:J,orgId:p.id,orgSlug:p.slug}),I=ne(),[h,c]=T.useState(!1),u=t.id==="openai-compatible",k=t.supportedMethods.includes("api-key"),{register:m,handleSubmit:S,watch:v,formState:{errors:g}}=je({resolver:ve(Nt),defaultValues:{label:o,apiKey:"",baseUrl:a??""}}),x=v("apiKey")??"",{mutate:b,isPending:j}=ee({mutationFn:async f=>{let d;f.apiKey?u?d=JSON.stringify({baseUrl:f.baseUrl||a||"",apiKey:f.apiKey}):d=f.apiKey:u&&f.baseUrl&&f.baseUrl!==a&&(d=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await y.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:e.id,label:f.label,...d!==void 0?{apiKey:d}:{}}})},onSuccess:()=>{I.invalidateQueries({queryKey:G.aiProviderKeys(p.id)}),I.invalidateQueries({queryKey:G.aiProviders(p.id)}),Q.success("Provider updated"),n()},onError:f=>Q.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:S(f=>b(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(le,{placeholder:"e.g. Personal key",...m("label"),className:"h-8 text-sm"}),g.label&&s.jsx("p",{className:"text-xs text-destructive",children:g.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...m("baseUrl"),className:"h-8 text-sm"})]}),k&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(le,{type:h&&x?"text":"password",placeholder:l,...m("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),x&&s.jsx("button",{type:"button",onClick:()=>c(!h),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:h?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:j,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:j,children:j?"Saving...":"Save"})]})]})}function Pt(e){const t=M.c(31),{providerKey:i,provider:l,open:o,onOpenChange:a}=e,{org:r}=H();let n;t[0]!==r.id||t[1]!==r.slug?(n={connectionId:J,orgId:r.id,orgSlug:r.slug},t[0]=r.id,t[1]=r.slug,t[2]=n):n=t[2];const p=X(n);let y;t[3]!==l.id||t[4]!==i.presetId?(y=l.id==="openai-compatible"&&i.presetId?Re.find(j=>j.id===i.presetId):void 0,t[3]=l.id,t[4]=i.presetId,t[5]=y):y=t[5];const I=y,h=I?.name??l.name;let c;t[6]!==i.id?(c=G.aiProviderKeyPreview(i.id),t[6]=i.id,t[7]=c):c=t[7];let u;t[8]!==p||t[9]!==i.id?(u=async()=>(await p.callTool({name:"AI_PROVIDER_KEY_PREVIEW",arguments:{keyId:i.id}})).structuredContent,t[8]=p,t[9]=i.id,t[10]=u):u=t[10];let k;t[11]!==o||t[12]!==c||t[13]!==u?(k={queryKey:c,queryFn:u,enabled:o,staleTime:0},t[11]=o,t[12]=c,t[13]=u,t[14]=k):k=t[14];const{data:m,isLoading:S}=Ie(k);let v;t[15]!==h?(v=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",h]})}),t[15]=h,t[16]=v):v=t[16];let g;t[17]!==S||t[18]!==a||t[19]!==I||t[20]!==m||t[21]!==l||t[22]!==i?(g=S||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(rt,{})}):s.jsx(wt,{providerKey:i,provider:l,preset:I,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[17]=S,t[18]=a,t[19]=I,t[20]=m,t[21]=l,t[22]=i,t[23]=g):g=t[23];let x;t[24]!==v||t[25]!==g?(x=s.jsxs(it,{className:"sm:max-w-md",children:[v,g]}),t[24]=v,t[25]=g,t[26]=x):x=t[26];let b;return t[27]!==a||t[28]!==o||t[29]!==x?(b=s.jsx(ot,{open:o,onOpenChange:a,children:x}),t[27]=a,t[28]=o,t[29]=x,t[30]=b):b=t[30],b}function At(e){const t=M.c(51),{providerKey:i,provider:l}=e,{org:o}=H();let a;t[0]!==o.id||t[1]!==o.slug?(a={connectionId:J,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=a):a=t[2];const r=X(a),n=ne(),[p,y]=T.useState(!1),[I,h]=T.useState(!1),c=l.id==="openai-compatible";let u;t[3]!==c||t[4]!==i.presetId?(u=c&&i.presetId?Re.find(q=>q.id===i.presetId):void 0,t[3]=c,t[4]=i.presetId,t[5]=u):u=t[5];const k=u,m=k?k.name:c?"Custom OpenAI-compatible":l.name,S=k?.logo??l.logo;let v;e:{if(c){v=i.label;break e}const q=i.label;let R;t[6]!==i.createdAt?(R=lt(new Date(i.createdAt)),t[6]=i.createdAt,t[7]=R):R=t[7],v=`${q} · added ${R} ago`}const g=v;let x;t[8]!==r||t[9]!==i.id?(x=async()=>{await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i.id}})},t[8]=r,t[9]=i.id,t[10]=x):x=t[10];let b;t[11]!==o.id||t[12]!==i.id||t[13]!==n?(b=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),n.invalidateQueries({queryKey:G.aiProviders(o.id)}),n.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),y(!1)},t[11]=o.id,t[12]=i.id,t[13]=n,t[14]=b):b=t[14];let j;t[15]!==x||t[16]!==b?(j={mutationFn:x,onSuccess:b,onError:Dt},t[15]=x,t[16]=b,t[17]=j):j=t[17];const{mutate:f,isPending:d}=ee(j);let w;t[18]!==m||t[19]!==S?(w=S?s.jsx("img",{src:S,alt:m,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:m.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[18]=m,t[19]=S,t[20]=w):w=t[20];let U;t[21]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>h(!0),children:s.jsx(We,{size:14})}),t[21]=U):U=t[21];let O,z;t[22]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),O=s.jsx(Ye,{size:14}),t[22]=O,t[23]=z):(O=t[22],z=t[23]);let A;t[24]!==d?(A=s.jsxs("div",{className:"flex items-center gap-0.5",children:[U,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:d,onClick:z,children:O})]}),t[24]=d,t[25]=A):A=t[25];let D;t[26]!==g||t[27]!==m||t[28]!==A||t[29]!==w?(D=s.jsx(ke,{icon:w,title:m,description:g,action:A}),t[26]=g,t[27]=m,t[28]=A,t[29]=w,t[30]=D):D=t[30];let K;t[31]!==I||t[32]!==l||t[33]!==i?(K=s.jsx(Pt,{providerKey:i,provider:l,open:I,onOpenChange:h}),t[31]=I,t[32]=l,t[33]=i,t[34]=K):K=t[34];let $;t[35]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(we,{children:"Delete API key"}),t[35]=$):$=t[35];let _;t[36]!==i.label?(_=s.jsxs(Ne,{children:[$,s.jsxs(Pe,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[36]=i.label,t[37]=_):_=t[37];let F;t[38]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Ae,{children:"Cancel"}),t[38]=F):F=t[38];let P;t[39]!==f?(P=s.jsxs(Ke,{children:[F,s.jsx(Ee,{onClick:()=>f(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[39]=f,t[40]=P):P=t[40];let E;t[41]!==_||t[42]!==P?(E=s.jsxs(De,{children:[_,P]}),t[41]=_,t[42]=P,t[43]=E):E=t[43];let N;t[44]!==p||t[45]!==E?(N=s.jsx(Fe,{open:p,onOpenChange:y,children:E}),t[44]=p,t[45]=E,t[46]=N):N=t[46];let L;return t[47]!==D||t[48]!==K||t[49]!==N?(L=s.jsxs(s.Fragment,{children:[D,K,N]}),t[47]=D,t[48]=K,t[49]=N,t[50]=L):L=t[50],L}function Dt(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=M.c(11),{onConnectClick:i}=e,l=te(),o=Ce();let a;t[0]!==o?.providers?(a=o?.providers??[],t[0]=o?.providers,t[1]=a):a=t[1];const r=a;let n;if(t[2]!==l||t[3]!==i||t[4]!==r){let p;t[6]!==r?(p=c=>({key:c,provider:r.find(u=>u.id===c.providerId)}),t[6]=r,t[7]=p):p=t[7];const y=l.filter(Rt).map(p).filter(Ft);let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Qe,{size:14}),t[8]=I):I=t[8];let h;t[9]!==i?(h=s.jsxs(V,{size:"sm",onClick:i,children:[I,"Connect provider"]}),t[9]=i,t[10]=h):h=t[10],n=s.jsx(ue,{title:"Connected providers",headerClassName:"px-0",actions:h,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(me,{children:y.map(Et)})}),t[2]=l,t[3]=i,t[4]=r,t[5]=n}else n=t[5];return n}function Et(e){const{key:t,provider:i}=e;return s.jsx(At,{providerKey:t,provider:i},t.id)}function Ft(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function $t(e){const t=M.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Oe,{size:16}),t[0]=l):l=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Tt(){const e=M.c(23),t=te();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const l=i,o=t.length>0,[a,r]=T.useState(!1),[n,p]=T.useState(null),y=Ce();let I;e[2]!==y?.providers?(I=y?.providers??[],e[2]=y?.providers,e[3]=I):I=e[3];const h=I;if(!o){let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=()=>r(!0),e[4]=v):v=e[4];let g;e[5]!==h?(g=s.jsx(Je,{providers:h,onSelect:p,onShowAll:v}),e[5]=h,e[6]=g):g=e[6];const x=n!==null||a;let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=w=>{w||(p(null),r(!1))},e[7]=b):b=e[7];const j=n??void 0;let f;e[8]!==x||e[9]!==j?(f=s.jsx(xe,{open:x,onOpenChange:b,initialProvider:j}),e[8]=x,e[9]=j,e[10]=f):f=e[10];let d;return e[11]!==g||e[12]!==f?(d=s.jsxs(s.Fragment,{children:[g,f]}),e[11]=g,e[12]=f,e[13]=d):d=e[13],d}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=c):c=e[14];let u;e[15]!==l?(u=l?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=l,e[16]=u):u=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Kt,{onConnectClick:()=>r(!0)}),e[17]=k):k=e[17];let m;e[18]!==a?(m=s.jsx(xe,{open:a,onOpenChange:r}),e[18]=a,e[19]=m):m=e[19];let S;return e[20]!==u||e[21]!==m?(S=s.jsxs(s.Fragment,{children:[c,u,k,m]}),e[20]=u,e[21]=m,e[22]=S):S=e[22],S}function Ot(e){return e.providerId==="deco"}function Mt(){const e=M.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(oe.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(oe,{children:s.jsx(oe.Content,{children:s.jsx(oe.Body,{children:s.jsxs(Me,{children:[t,s.jsx(Te,{fallback:Ut,children:s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-64 w-full"}),children:s.jsx(Tt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx($t,{error:t??new Error("Failed to load AI providers")})}function Bs(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(nt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Mt,{})}),e[0]=t):t=e[0],t}export{Bs as default};
@@ -1 +0,0 @@
1
- import{e as M,r as S,j as o,l as q}from"./index-RoHcRkq0.js";import{S as G}from"./scroll-area-DjlF9Nhh.js";import{j as H,a4 as J,d as Q}from"./index-DU03U45c.js";import{S as U}from"./schema-form-DC8-fGrX.js";import{S as W}from"./save-status-c_gSkXRz.js";import"./select-DzGY5lz9.js";import"./tooltip-CLHWv9z-.js";import"./Check-Rzhysg8v.js";import"./ChevronDown-DgAQraB9.js";import"./ChevronUp-D95kdAWS.js";import"./agent-capabilities-C4HO1AsU.js";import"./chat-context-7nRfVaxU.js";import"./tab-id-BNsa7AXA.js";import"./constants-DDZG6Edw.js";import"./decopilot-sse-pool-DYhlxmFV.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-wf8itLFJ.js";import"./use-collections-DxWiIX9G.js";import"./use-ai-providers-BUmRVTXM.js";import"./use-organization-settings-DeuE04BS.js";import"./pair-DPmFvoFZ.js";import"./agent-icon-atw8dEpB.js";import"./AlertCircle-CfP2ydlK.js";import"./Tool01-D6Ixmgxm.js";import"./SwitchHorizontal01-CLmvgZdy.js";import"./RefreshCcw01-Do9uT8r5.js";import"./XCircle-gezQrKJB.js";import"./ArrowUpRight-BG7K2o4g.js";import"./ZapSquare-Doe97qp7.js";import"./Users03-C3j_vENk.js";import"./CheckCircle-ByVfCd_z.js";import"./ChevronLeft-hIkmA-06.js";import"./ChevronRight-C-1GbVi6.js";import"./DotsVertical--nxfulT_.js";import"./Container-EsK9R8Cs.js";import"./Eye-0u1NnyPn.js";import"./ZoomOut-u9z9zRXH.js";import"./Globe01-CYJ5akFo.js";import"./FilterLines-lN6ZYEU6.js";import"./Star01-DinMZEQp.js";import"./Palette-CvBtCHX7.js";import"./HardDrive-Bi11tZlO.js";import"./Stars02-CovFPupV.js";import"./Key01-ETI9VuA0.js";import"./LayoutLeft-D5P3SyL5.js";import"./LinkExternal01-CMTN51kD.js";import"./Monitor01-B9COEs1V.js";import"./Sun-D5MzBxyK.js";import"./Play-zcNTCzY3.js";import"./Plus-BVt3gf6N.js";import"./SearchMd-Ckbe6j0d.js";import"./Settings02-BFHOCA5h.js";import"./Shield01-ebA_Mmqa.js";import"./Stars01-cUHrtzm6.js";import"./Trash01-C6sXu2xm.js";import"./Upload01-DslYY_N3.js";import"./User01-9CJ-p7XF.js";import"./Users01-Ds5_zubO.js";import"./XClose-dfaecXcF.js";import"./X-Dzpu-bw3.js";import"./Zap-ZCJiHFB8.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-N9gIT0E2.js";import"./file-type-icon-B565DmsG.js";import"./dialog-CvJmXij7.js";import"./content-blocks-o63cs2vh.js";import"./types-Cxg1qjf9.js";import"./shell-layout-DSHLjHdv.js";import"./avatar-DiepLBEZ.js";import"./required-auth-layout-BTqABC6o.js";import"./useRouterState-mAFXQkAT.js";import"./use-org-sso-BTJacuR9.js";import"./integration-icon-BOg4uSLi.js";import"./use-navigate-to-agent-B_6LJV9r.js";import"./use-connection-BKakpvkk.js";import"./use-mcp-prompts-CY9OUQZa.js";import"./form-DAahwl9B.js";import"./label-WCbT5R_C.js";import"./input-DsRHjNfg.js";import"./spinner-CCf2Lbex.js";import"./drawer-Cm2a8ouX.js";import"./collection-search-C0bvNtM9.js";import"./tabs-DiVDzsDA.js";import"./toggle-group-CVuIqYb9.js";import"./connect-desktop-dialog-Cd86_kfs.js";import"./agent-icons-BO9U458u.js";import"./checkbox-B2YbUc0m.js";import"./skeleton-CQGVA-Lx.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DWjadbjH.js";import"./card-B2dT-2ts.js";import"./popover-00xsE00R.js";import"./command-BjqkQYxa.js";import"./index-B2iHTL-o.js";import"./useInfiniteQuery-FaewV0Uc.js";import"./infiniteQueryObserver-GkUb2zKT.js";import"./sortable.esm-DR5iV7W2.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DEJjtCgn.js";import"./use-registry-connections-BFubWEDK.js";import"./extract-connection-data-uGXsWpo7.js";import"./generate-id-CnLzNGg6.js";import"./collections-BUCuRVxl.js";import"./collection-tabs-BN4In63u.js";import"./badge-Cosh8Jv6.js";import"./textarea-Cq68Cg3C.js";import"./connection-form-helpers-B093QOVj.js";import"./use-infinite-scroll-DVN8HYM6.js";import"./useSuspenseInfiniteQuery-DzO-0tti.js";import"./index-DaTDomcZ.js";import"./dropdown-menu-jK5-EocK.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-BMFmixVz.js";import"./sidebar-3Sp07kli.js";import"./sheet-D-hNRlw_.js";import"./toolbar-CKVgGEMh.js";import"./use-create-virtual-mcp-DilrGBsI.js";import"./github-repo-picker-qDFzaGLa.js";import"./use-mcp-tools-DXY52I1e.js";import"./alert-dialog-BDuu9Vea.js";import"./index-nS3rTKOQ.js";import"./use-org-auth-client-5h3UhfD-.js";import"./hover-card-DyNloM84.js";import"./task-status-DJjK_vX7.js";import"./use-status-sounds-CFOYqswl.js";import"./empty-state-BvMn8pb-.js";import"./resizable-tvU32_PL.js";import"./use-capability-DGItFWVB.js";import"./header-tab-button-sg2Bkh9m.js";import"./index-Dw66yPMC.js";import"./user-ujRRaChx.js";import"./tools-list-6s8Pp55V.js";import"./switch-DhDeb5VA.js";import"./use-debounced-autosave-B43AQzLm.js";import"./index-Dhy2A-ml.js";import"./search-input-BIE6clnk.js";import"./use-secrets-CEE2TPN5.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-y8ERtqeD.js";import"./view-mode-toggle-PpUBwSzB.js";import"./select-model-dzURvkLU.js";import"./use-automations-BQsS5jcL.js";import"./monaco-editor-BleU3J2F.js";import"./automation-runs-BPWO4Oxo.js";import"./table-BMoC5dcf.js";import"./use-members-9msf87Qx.js";import"./automation-list-row-DCGCyvJL.js";import"./calendar-D85iiJjZ.js";import"./image-field-BaHZoCuZ.js";import"./use-file-configs-BSxIo3R0.js";function qo(g){const t=M.c(38),{orgSlug:N,virtualMcpId:_,branch:k,blockKey:r,block:i,meta:m,title:E,excludeFields:n,schemaPending:C}=g,P=C===void 0?!1:C,e=typeof i?.__resolveType=="string"?i.__resolveType:"";let d;if(t[0]!==n||t[1]!==m||t[2]!==e){const c=e?H(e,m):null;d=c&&n?.length?{...c,properties:Object.fromEntries(Object.entries(c.properties??{}).filter(y=>{const[I]=y;return!n.includes(I)}))}:c,t[0]=n,t[1]=m,t[2]=e,t[3]=d}else d=t[3];const f=d;let u;t[4]!==i||t[5]!==r||t[6]!==m||t[7]!==E?(u=E??(i?J(r,i,m):r),t[4]=i,t[5]=r,t[6]=m,t[7]=E,t[8]=u):u=t[8];const B=u;let x;t[9]!==k||t[10]!==N||t[11]!==_?(x={orgSlug:N,virtualMcpId:_,branch:k},t[9]=k,t[10]=N,t[11]=_,t[12]=x):x=t[12];const{save:K,isPending:R}=Q(x),[A,L]=S.useState(r),[z,O]=S.useState(null),[V,D]=S.useState(0);let h;t[13]===Symbol.for("react.memo_cache_sentinel")?(h=[],t[13]=h):h=t[13];const[w,$]=S.useState(h);A!==r&&(L(r),O(null),D(X),$([]));let v;t[14]!==i?(v=i??{},t[14]=i,t[15]=v):v=t[15];const F=z??v;let b;t[16]!==r||t[17]!==e||t[18]!==K?(b=c=>{const y=c;O(y),K(r,{...y,__resolveType:e})},t[16]=r,t[17]=e,t[18]=K,t[19]=b):b=t[19];const T=b;let p;t[20]!==B?(p=o.jsx("span",{className:"text-sm font-medium",children:B}),t[20]=B,t[21]=p):p=t[21];let s;t[22]!==R?(s=o.jsx(W,{isPending:R,isError:!1}),t[22]=R,t[23]=s):s=t[23];let l;t[24]!==p||t[25]!==s?(l=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[p,s]}),t[24]=p,t[25]=s,t[26]=l):l=t[26];let a;t[27]!==r||t[28]!==w||t[29]!==F||t[30]!==V||t[31]!==T||t[32]!==f||t[33]!==P?(a=o.jsx(G,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:f?o.jsx(U,{schema:f,value:F,onChange:T,basePath:"",breadcrumbPath:w,onBreadcrumbChange:$},`${r}:${V}`):P?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(q,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[27]=r,t[28]=w,t[29]=F,t[30]=V,t[31]=T,t[32]=f,t[33]=P,t[34]=a):a=t[34];let j;return t[35]!==l||t[36]!==a?(j=o.jsxs("div",{className:"flex h-full flex-col",children:[l,a]}),t[35]=l,t[36]=a,t[37]=j):j=t[37],j}function X(g){return g+1}export{qo as AppEditor};
@@ -1 +0,0 @@
1
- import{e as le,r as oe,c as be,j as t,B as fe,K as xe,n as Ve,E as tt,q as st}from"./index-RoHcRkq0.js";import{u as ze}from"./useInfiniteQuery-FaewV0Uc.js";import{u as lt}from"./use-connection-BKakpvkk.js";import{i as nt,g as at,S as rt,u as it}from"./constants-DDZG6Edw.js";import{a as ot}from"./use-virtual-mcp-wf8itLFJ.js";import{C as ct}from"./card-B2dT-2ts.js";import{a as Ke,b as qe,S as dt,d as mt}from"./sheet-D-hNRlw_.js";import{c as Ge,d as He,a as Ne,e as te,b as Be,T as se}from"./table-BMoC5dcf.js";import{E as Se}from"./empty-state-BvMn8pb-.js";import{u as ke}from"./use-infinite-scroll-DVN8HYM6.js";import{u as ut}from"./use-members-9msf87Qx.js";import{S as ue}from"./task-status-DJjK_vX7.js";import{e as ft}from"./use-automations-BQsS5jcL.js";import{u as xt}from"./useSuspenseInfiniteQuery-DzO-0tti.js";import{B as je}from"./badge-Cosh8Jv6.js";import{S as ht,a as gt,b as pt,c as ge,d as jt}from"./select-DzGY5lz9.js";import{C as Le}from"./checkbox-B2YbUc0m.js";import{t as he}from"./ChevronDown-DgAQraB9.js";import{c as bt,C as Nt,e as Fe,d as vt,a as St,b as yt}from"./command-BjqkQYxa.js";import{a as Je,b as Qe,P as Ze}from"./popover-00xsE00R.js";import{A as We}from"./avatar-DiepLBEZ.js";import{n as ye}from"./ChevronUp-D95kdAWS.js";import{n as Ie}from"./Container-EsK9R8Cs.js";import{i as wt}from"./FilterLines-lN6ZYEU6.js";import{m as Ct,n as _t}from"./pair-DPmFvoFZ.js";import{I as Pe}from"./integration-icon-BOg4uSLi.js";function Ue(l){const e=le.c(74),{options:s,onValueChange:n,defaultValue:r,placeholder:i,variant:a,animation:m,maxCount:c,modalPopover:o,asChild:b,className:v,disabled:x,onSearchChange:h}=l;let N;e[0]!==r?(N=r===void 0?[]:r,e[0]=r,e[1]=N):N=e[1];const u=N,p=i===void 0?"Select items":i,j=a===void 0?"default":a,g=m===void 0?0:m,S=c===void 0?3:c,f=o===void 0?!1:o,y=b===void 0?!1:b,_=x===void 0?!1:x,[d,C]=oe.useState(u),[T,w]=oe.useState(!1);let I,k;e[2]!==u||e[3]!==d?(I=()=>{JSON.stringify(d)!==JSON.stringify(u)&&C(u)},k=[u,d],e[2]=u,e[3]=d,e[4]=I,e[5]=k):(I=e[4],k=e[5]),oe.useEffect(I,k);let P;e[6]!==n||e[7]!==d?(P=E=>{if(E.key==="Enter")w(!0);else if(E.key==="Backspace"&&!E.currentTarget.value){const H=[...d];H.pop(),C(H),n(H)}},e[6]=n,e[7]=d,e[8]=P):P=e[8];const D=P;let M;e[9]!==n||e[10]!==d?(M=E=>{const H=d.includes(E.value)?d.filter(me=>me!==E.value):[...d,E.value];C(H),n(H)},e[9]=n,e[10]=d,e[11]=M):M=e[11];const A=M;let $;e[12]!==n?($=()=>{C([]),n([])},e[12]=n,e[13]=$):$=e[13];const B=$;let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{w(Pt)},e[14]=F):F=e[14];const Z=F;let q;e[15]!==B||e[16]!==n||e[17]!==s||e[18]!==d.length?(q=()=>{if(d.length===s.length)B();else{const E=s.map(It);C(E),n(E)}},e[15]=B,e[16]=n,e[17]=s,e[18]=d.length,e[19]=q):q=e[19];const U=q;let O;e[20]!==y?(O=y?{}:{variant:"outline"},e[20]=y,e[21]=O):O=e[21];let L;e[22]!==v?(L=be("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",v),e[22]=v,e[23]=L):L=e[23];let K;e[24]!==g||e[25]!==S||e[26]!==s||e[27]!==p||e[28]!==d||e[29]!==j?(K=d.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[d.slice(0,S).map(E=>{const H=s.find(ve=>ve.value===E),me=H?.icon;return t.jsxs(je,{variant:j==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${g}s`},children:[me&&t.jsx(me,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:H?.label})]},E)}),d.length>S&&t.jsxs(je,{variant:j==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${g}s`},children:["+",d.length-S]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(he,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:p}),t.jsx(he,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=g,e[25]=S,e[26]=s,e[27]=p,e[28]=d,e[29]=j,e[30]=K):K=e[30];let V;e[31]!==_||e[32]!==O||e[33]!==L||e[34]!==K?(V=t.jsx(Je,{asChild:!0,children:t.jsx(fe,{ref:null,...O,onClick:Z,className:L,disabled:_,children:K})}),e[31]=_,e[32]=O,e[33]=L,e[34]=K,e[35]=V):V=e[35];let J;e[36]===Symbol.for("react.memo_cache_sentinel")?(J=()=>w(!1),e[36]=J):J=e[36];const z=!h;let Q;e[37]!==D||e[38]!==h?(Q=t.jsx(bt,{placeholder:"Search...",onKeyDown:D,onValueChange:h,className:"rounded-t-xl"}),e[37]=D,e[38]=h,e[39]=Q):Q=e[39];let ce;e[40]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx(Nt,{children:"No results found."}),e[40]=ce):ce=e[40];let W;e[41]!==U?(W=()=>{U()},e[41]=U,e[42]=W):W=e[42];let Y;e[43]!==U?(Y=E=>{E.stopPropagation(),U()},e[43]=U,e[44]=Y):Y=e[44];const de=d.length===s.length&&s.length>0;let ne;e[45]!==de||e[46]!==U?(ne=t.jsx(Le,{checked:de,onCheckedChange:U,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:kt}),e[45]=de,e[46]=U,e[47]=ne):ne=e[47];let ae;e[48]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx("span",{children:"(Select All)"}),e[48]=ae):ae=e[48];let X;e[49]!==Y||e[50]!==ne?(X=t.jsxs("div",{className:"flex items-center w-full",onClick:Y,children:[ne,ae]}),e[49]=Y,e[50]=ne,e[51]=X):X=e[51];let ee;e[52]!==W||e[53]!==X?(ee=t.jsx(Fe,{onSelect:W,className:"cursor-pointer",children:X},"all"),e[52]=W,e[53]=X,e[54]=ee):ee=e[54];let re;if(e[55]!==s||e[56]!==d||e[57]!==A){let E;e[59]!==d||e[60]!==A?(E=H=>{const me=d.includes(H.value);return t.jsx(Fe,{onSelect:()=>{A(H)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:ve=>{ve.stopPropagation(),A(H)},children:[t.jsx(Le,{checked:me,onCheckedChange:()=>{A(H)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Tt}),H.icon&&t.jsx(H.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:H.label})]})},H.value)},e[59]=d,e[60]=A,e[61]=E):E=e[61],re=s.map(E),e[55]=s,e[56]=d,e[57]=A,e[58]=re}else re=e[58];let R;e[62]!==ee||e[63]!==re?(R=t.jsxs(vt,{className:"rounded-b-xl",children:[ce,t.jsxs(St,{children:[ee,re]})]}),e[62]=ee,e[63]=re,e[64]=R):R=e[64];let G;e[65]!==z||e[66]!==Q||e[67]!==R?(G=t.jsx(Qe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:J,children:t.jsxs(yt,{shouldFilter:z,className:"rounded-xl",children:[Q,R]})}),e[65]=z,e[66]=Q,e[67]=R,e[68]=G):G=e[68];let ie;return e[69]!==T||e[70]!==f||e[71]!==V||e[72]!==G?(ie=t.jsxs(Ze,{open:T,onOpenChange:w,modal:f,children:[V,G]}),e[69]=T,e[70]=f,e[71]=V,e[72]=G,e[73]=ie):ie=e[73],ie}function Tt(l){return l.stopPropagation()}function kt(l){return l.stopPropagation()}function It(l){return l.value}function Pt(l){return!l}const Ye=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],Mt=40;function Cs(l){const s=(l.endDate.getTime()-l.startDate.getTime())/Mt;return Ye.find(r=>r.ms>=s)?.label??"1d"}function Me(l){const e=Ye.find(i=>i.label===l);if(e)return e.ms;const s=/^(\d+)([mhd])$/.exec(l);if(!s)return 6e4;const n=parseInt(s[1],10),r=s[2];return r==="h"?n*36e5:r==="d"?n*864e5:n*6e4}function Dt(l,e){const s=new Date(l);return Me(e)>=864e5?s.toLocaleDateString([],{month:"short",day:"numeric"}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Oe(l,e){const s=Me(e);return new Date(Math.floor(l.getTime()/s)*s)}function Rt(l){return l>=1e4?`${(l/1e3).toFixed(1)}s`:`${Math.round(l)}ms`}function De(l){return Number.isFinite(l)?l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:Math.round(l).toLocaleString():"0"}function Re(l){return Number.isFinite(l)?`$${l.toFixed(l<1?4:2)}`:"$0.00"}function _s(l,e,s){const n=Me(s),r=Oe(e.startDate,s).getTime(),i=e.endDate.getTime(),a=new Map(l.map(c=>[Oe(new Date(c.timestamp),s).getTime(),c])),m=[];for(let c=r;c<=i;c+=n){const o=a.get(c),b=new Date(c).toISOString();m.push({t:b,ts:c,label:Dt(b,s),calls:o?.calls??0,errors:o?.errors??0,errorRate:o?.errorRate??0,avg:o?.avg??0,p50:o?.p50??0,p95:o?.p95??0,inputTokens:o?.inputTokens??0,outputTokens:o?.outputTokens??0,totalTokens:o?.totalTokens??0,costUsd:o?.costUsd??0})}return m}function Ts(l,e){return e==="requests"?l.calls:e==="errors"?l.errorRate:l.avgDurationMs}function ks(l,e){return e==="requests"?l.calls.toLocaleString():e==="errors"?`${l.errorRate.toFixed(1)}%`:Rt(l.avgDurationMs)}function Ae(l){return(l.run_config??{}).agent?.id??(l.virtual_mcp_id||null)}function Ee(l,e,s,n){if(!l)return n;const r=e.find(a=>a.id===l)??s?.find(a=>a.id===l);if(r?.title)return r.title;const i=nt(l);return i?at(i).title??n:l}function $e(l,e,s){return l?(e.find(r=>r.id===l)??s?.find(r=>r.id===l))?.icon??null:null}function Xe(l){return l?.data?.members??[]}function we(l){const e=le.c(33),{thread:s,connections:n,virtualMcps:r,selectedIndex:i,total:a,onPrev:m,onNext:c}=l;let o,b;if(e[0]!==n||e[1]!==s||e[2]!==r){const I=Ae(s);o=Ee(I,r,n,""),b=$e(I,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=b}else o=e[3],b=e[4];const v=b,x=o||s.title;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Ie,{}),e[5]=h):h=e[5];let N;e[6]!==v||e[7]!==x?(N=t.jsx(Pe,{icon:v,name:x,size:"sm",fallbackIcon:h,className:"shadow-sm shrink-0 rounded-md"}),e[6]=v,e[7]=x,e[8]=N):N=e[8];let u;e[9]!==s.title?(u=t.jsx(dt,{className:"text-sm leading-snug truncate",children:s.title}),e[9]=s.title,e[10]=u):u=e[10];let p;e[11]!==o?(p=o&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:o}),e[11]=o,e[12]=p):p=e[12];let j;e[13]!==u||e[14]!==p?(j=t.jsxs("div",{className:"min-w-0",children:[u,p]}),e[13]=u,e[14]=p,e[15]=j):j=e[15];let g;e[16]!==N||e[17]!==j?(g=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[N,j]}),e[16]=N,e[17]=j,e[18]=g):g=e[18];const S=i===0;let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ye,{size:14}),e[19]=f):f=e[19];let y;e[20]!==m||e[21]!==S?(y=t.jsx(fe,{size:"icon",variant:"ghost",onClick:m,disabled:S,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous thread",children:f}),e[20]=m,e[21]=S,e[22]=y):y=e[22];const _=i===a-1;let d;e[23]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(he,{size:14}),e[23]=d):d=e[23];let C;e[24]!==c||e[25]!==_?(C=t.jsx(fe,{size:"icon",variant:"ghost",onClick:c,disabled:_,className:"h-7 w-7 text-muted-foreground","aria-label":"Next thread",children:d}),e[24]=c,e[25]=_,e[26]=C):C=e[26];let T;e[27]!==y||e[28]!==C?(T=t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[y,C]}),e[27]=y,e[28]=C,e[29]=T):T=e[29];let w;return e[30]!==T||e[31]!==g?(w=t.jsx(mt,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[g,T]})}),e[30]=T,e[31]=g,e[32]=w):w=e[32],w}function At(l){const e=le.c(48),{thread:s,connections:n,virtualMcps:r,members:i}=l;let a,m;if(e[0]!==n||e[1]!==s||e[2]!==r){const M=Ae(s);a=Ee(M,r,n,""),m=$e(M,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=m}else a=e[3],m=e[4];const c=m;let o;if(e[5]!==i||e[6]!==s.created_by){const M=Xe(i);let A;e[8]!==s.created_by?(A=$=>$.userId===s.created_by,e[8]=s.created_by,e[9]=A):A=e[9],o=M.find(A),e[5]=i,e[6]=s.created_by,e[7]=o}else o=e[7];const b=o;let v;e[10]!==b?.user.email||e[11]!==b?.user.name||e[12]!==s.created_by?(v=b?.user.name??b?.user.email??s.created_by?.substring(0,8)??"—",e[10]=b?.user.email,e[11]=b?.user.name,e[12]=s.created_by,e[13]=v):v=e[13];const x=v,h=b?.user.image??void 0;let N;e[14]!==s.created_at?(N=new Date(s.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=s.created_at,e[15]=N):N=e[15];const u=N,p=ue[s.status]??ue.completed,j=p.icon;let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Status"}),e[16]=g):g=e[16];let S;e[17]!==j||e[18]!==p.iconClassName?(S=t.jsx(j,{size:13,className:p.iconClassName}),e[17]=j,e[18]=p.iconClassName,e[19]=S):S=e[19];let f;e[20]!==p.labelColor?(f=be("text-sm",p.labelColor),e[20]=p.labelColor,e[21]=f):f=e[21];let y;e[22]!==p.label||e[23]!==f?(y=t.jsx("span",{className:f,children:p.label}),e[22]=p.label,e[23]=f,e[24]=y):y=e[24];let _;e[25]!==S||e[26]!==y?(_=t.jsxs("div",{children:[g,t.jsxs("div",{className:"flex items-center gap-1.5",children:[S,y]})]}),e[25]=S,e[26]=y,e[27]=_):_=e[27];let d;e[28]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Date"}),e[28]=d):d=e[28];let C;e[29]!==u?(C=t.jsxs("div",{children:[d,t.jsx("div",{className:"text-sm text-foreground",children:u})]}),e[29]=u,e[30]=C):C=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[31]=T):T=e[31];let w;e[32]!==h||e[33]!==x?(w=t.jsx(We,{url:h,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),e[32]=h,e[33]=x,e[34]=w):w=e[34];let I;e[35]!==x?(I=t.jsx("span",{className:"text-sm text-foreground",children:x}),e[35]=x,e[36]=I):I=e[36];let k;e[37]!==w||e[38]!==I?(k=t.jsxs("div",{children:[T,t.jsxs("div",{className:"flex items-center gap-2",children:[w,I]})]}),e[37]=w,e[38]=I,e[39]=k):k=e[39];let P;e[40]!==c||e[41]!==a?(P=a&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Pe,{icon:c,name:a,size:"xs",fallbackIcon:t.jsx(Ie,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"text-sm text-foreground",children:a})]})]}),e[40]=c,e[41]=a,e[42]=P):P=e[42];let D;return e[43]!==C||e[44]!==k||e[45]!==P||e[46]!==_?(D=t.jsxs("div",{className:"px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm",children:[_,C,k,P]}),e[43]=C,e[44]=k,e[45]=P,e[46]=_,e[47]=D):D=e[47],D}function Et(l){const e=le.c(72),{thread:s,usage:n,members:r,connections:i,virtualMcps:a,onClick:m,lastRowRef:c}=l;let o,b;if(e[0]!==i||e[1]!==s||e[2]!==a){const V=Ae(s);o=Ee(V,a,i,"—"),b=$e(V,a,i),e[0]=i,e[1]=s,e[2]=a,e[3]=o,e[4]=b}else o=e[3],b=e[4];const v=b;let x;if(e[5]!==r||e[6]!==s.created_by){const V=Xe(r);let J;e[8]!==s.created_by?(J=z=>z.userId===s.created_by,e[8]=s.created_by,e[9]=J):J=e[9],x=V.find(J),e[5]=r,e[6]=s.created_by,e[7]=x}else x=e[7];const h=x;let N;e[10]!==h?.user.email||e[11]!==h?.user.name||e[12]!==s.created_by?(N=h?.user.name??h?.user.email??s.created_by?.substring(0,8)??"—",e[10]=h?.user.email,e[11]=h?.user.name,e[12]=s.created_by,e[13]=N):N=e[13];const u=N,p=h?.user.image??void 0;let j,g;if(e[14]!==s.created_at){const V=new Date(s.created_at);j=V.toLocaleDateString("en-US",{month:"short",day:"numeric"}),g=V.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[14]=s.created_at,e[15]=j,e[16]=g}else j=e[15],g=e[16];const S=g,f=ue[s.status]??ue.completed,y=f.icon;let _;e[17]!==s.title?(_=t.jsx(se,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[17]=s.title,e[18]=_):_=e[18];let d;e[19]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ie,{}),e[19]=d):d=e[19];let C;e[20]!==v||e[21]!==o?(C=t.jsx(Pe,{icon:v,name:o,size:"xs",fallbackIcon:d,className:"shrink-0 size-5! min-w-5! rounded-md"}),e[20]=v,e[21]=o,e[22]=C):C=e[22];let T;e[23]!==o?(T=t.jsx("span",{className:"truncate",children:o}),e[23]=o,e[24]=T):T=e[24];let w;e[25]!==C||e[26]!==T?(w=t.jsx(se,{className:"w-36 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,T]})}),e[25]=C,e[26]=T,e[27]=w):w=e[27];let I;e[28]!==p||e[29]!==u?(I=t.jsx(We,{url:p,fallback:u,shape:"circle",size:"2xs",className:"shrink-0"}),e[28]=p,e[29]=u,e[30]=I):I=e[30];let k;e[31]!==u?(k=t.jsx("span",{className:"truncate",children:u}),e[31]=u,e[32]=k):k=e[32];let P;e[33]!==I||e[34]!==k?(P=t.jsx(se,{className:"w-28 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[33]=I,e[34]=k,e[35]=P):P=e[35];let D;e[36]!==y||e[37]!==f.iconClassName?(D=t.jsx(y,{size:14,className:f.iconClassName}),e[36]=y,e[37]=f.iconClassName,e[38]=D):D=e[38];let M;e[39]!==f.labelColor?(M=be("text-sm",f.labelColor),e[39]=f.labelColor,e[40]=M):M=e[40];let A;e[41]!==f.label||e[42]!==M?(A=t.jsx("span",{className:M,children:f.label}),e[41]=f.label,e[42]=M,e[43]=A):A=e[43];let $;e[44]!==D||e[45]!==A?($=t.jsx(se,{className:"w-24 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[D,A]})}),e[44]=D,e[45]=A,e[46]=$):$=e[46];let B;e[47]!==n?(B=n?De(n.totalTokens):"—",e[47]=n,e[48]=B):B=e[48];let F;e[49]!==B?(F=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:B}),e[49]=B,e[50]=F):F=e[50];let Z;e[51]!==n?(Z=n&&n.costUsd>0?Re(n.costUsd):"—",e[51]=n,e[52]=Z):Z=e[52];let q;e[53]!==Z?(q=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:Z}),e[53]=Z,e[54]=q):q=e[54];let U;e[55]!==j?(U=t.jsx("div",{children:j}),e[55]=j,e[56]=U):U=e[56];let O;e[57]!==S?(O=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:S}),e[57]=S,e[58]=O):O=e[58];let L;e[59]!==U||e[60]!==O?(L=t.jsxs(se,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[U,O]}),e[59]=U,e[60]=O,e[61]=L):L=e[61];let K;return e[62]!==c||e[63]!==m||e[64]!==P||e[65]!==$||e[66]!==F||e[67]!==q||e[68]!==L||e[69]!==_||e[70]!==w?(K=t.jsxs(Ne,{ref:c,className:"h-14 md:h-16 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:m,children:[_,w,P,$,F,q,L]}),e[62]=c,e[63]=m,e[64]=P,e[65]=$,e[66]=F,e[67]=q,e[68]=L,e[69]=_,e[70]=w,e[71]=K):K=e[71],K}const Ce=100;function $t(l){const e=le.c(37),{client:s,locator:n,thread:r,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}=l;let x;e[0]!==n||e[1]!==r.id?(x=xe.threadMessages(n,r.id),e[0]=n,e[1]=r.id,e[2]=x):x=e[2];let h;e[3]!==s||e[4]!==r.id?(h=async k=>{const{pageParam:P}=k,D=P===void 0?0:P;if(!s)throw new Error("MCP client is not available");const M=await s.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:r.id,limit:Ce,offset:D}});return M.structuredContent??M},e[3]=s,e[4]=r.id,e[5]=h):h=e[5];let N;e[6]!==x||e[7]!==h?(N={queryKey:x,queryFn:h,initialPageParam:0,getNextPageParam:Ut,staleTime:6e4},e[6]=x,e[7]=h,e[8]=N):N=e[8];const{data:u,fetchNextPage:p,hasNextPage:j,isFetchingNextPage:g}=xt(N);let S;e[9]!==u.pages?(S=u.pages.flatMap(Ft).filter(Lt),e[9]=u.pages,e[10]=S):S=e[10];const f=S,y=Ct(f);let _;e[11]!==p||e[12]!==j||e[13]!==g?(_=()=>{j&&!g&&p()},e[11]=p,e[12]=j,e[13]=g,e[14]=_):_=e[14];const d=ke(_,j??!1,g);let C;e[15]!==i||e[16]!==v||e[17]!==b||e[18]!==c||e[19]!==r||e[20]!==o||e[21]!==a?(C=t.jsx(we,{thread:r,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[15]=i,e[16]=v,e[17]=b,e[18]=c,e[19]=r,e[20]=o,e[21]=a,e[22]=C):C=e[22];let T;e[23]!==i||e[24]!==m||e[25]!==r||e[26]!==a?(T=t.jsx(At,{thread:r,connections:i,virtualMcps:a,members:m}),e[23]=i,e[24]=m,e[25]=r,e[26]=a,e[27]=T):T=e[27];let w;e[28]!==g||e[29]!==d||e[30]!==y||e[31]!==f.length?(w=f.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No messages in this thread"}):t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:t.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[y.map((k,P)=>t.jsx("div",{ref:P===y.length-1?d:void 0,children:t.jsx(_t,{pair:k,isLastPair:P===y.length-1,status:"ready"})},`pair-${k.user?.id??k.assistant?.id}`)),g&&t.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"Loading more\\u2026"})]})}),e[28]=g,e[29]=d,e[30]=y,e[31]=f.length,e[32]=w):w=e[32];let I;return e[33]!==C||e[34]!==T||e[35]!==w?(I=t.jsxs(t.Fragment,{children:[C,T,w]}),e[33]=C,e[34]=T,e[35]=w,e[36]=I):I=e[36],I}function Lt(l){return l.role==="user"||l.role==="assistant"}function Ft(l){return l.items??[]}function Ut(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Ce))return n.length*Ce}function et(l){const e=le.c(39),{thread:s,client:n,locator:r,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}=l;let x;e[0]!==i||e[1]!==v||e[2]!==b||e[3]!==c||e[4]!==s||e[5]!==o||e[6]!==a?(x=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[0]=i,e[1]=v,e[2]=b,e[3]=c,e[4]=s,e[5]=o,e[6]=a,e[7]=x):x=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Failed to load messages"}),e[8]=h):h=e[8];let N;e[9]!==x?(N=t.jsxs(t.Fragment,{children:[x,h]}),e[9]=x,e[10]=N):N=e[10];let u;e[11]!==i||e[12]!==v||e[13]!==b||e[14]!==c||e[15]!==s||e[16]!==o||e[17]!==a?(u=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[11]=i,e[12]=v,e[13]=b,e[14]=c,e[15]=s,e[16]=o,e[17]=a,e[18]=u):u=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Loading conversation\\u2026"}),e[19]=p):p=e[19];let j;e[20]!==u?(j=t.jsxs(t.Fragment,{children:[u,p]}),e[20]=u,e[21]=j):j=e[21];let g;e[22]!==n||e[23]!==i||e[24]!==r||e[25]!==m||e[26]!==v||e[27]!==b||e[28]!==c||e[29]!==s||e[30]!==o||e[31]!==a?(g=t.jsx($t,{client:n,locator:r,thread:s,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[22]=n,e[23]=i,e[24]=r,e[25]=m,e[26]=v,e[27]=b,e[28]=c,e[29]=s,e[30]=o,e[31]=a,e[32]=g):g=e[32];let S;e[33]!==j||e[34]!==g?(S=t.jsx(oe.Suspense,{fallback:j,children:g}),e[33]=j,e[34]=g,e[35]=S):S=e[35];let f;return e[36]!==N||e[37]!==S?(f=t.jsx(tt,{fallback:N,children:S}),e[36]=N,e[37]=S,e[38]=f):f=e[38],f}function Is(l){const e=le.c(43),{filterAgentIds:s,filterUserIds:n,filterStatus:r,virtualMcpOptions:i,memberOptions:a,activeFiltersCount:m,onUpdateFilters:c}=l,[o,b]=oe.useState(!1);let v,x;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(wt,{size:16}),x=t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),e[0]=v,e[1]=x):(v=e[0],x=e[1]);let h;e[2]!==m?(h=m>0&&t.jsxs(t.Fragment,{children:[t.jsx(je,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:m}),t.jsx(je,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:m})]}),e[2]=m,e[3]=h):h=e[3];let N;e[4]!==h?(N=t.jsx(Je,{asChild:!0,children:t.jsxs(fe,{variant:"outline",className:"relative",children:[v,x,h]})}),e[4]=h,e[5]=N):N=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"font-medium text-sm",children:"Filter Threads"}),e[6]=u):u=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agent"}),e[7]=p):p=e[7];let j;e[8]!==c?(j=M=>c({filterAgentIds:M.slice(0,1)}),e[8]=c,e[9]=j):j=e[9];let g;e[10]!==s||e[11]!==j||e[12]!==i?(g=t.jsxs("div",{children:[p,t.jsx(Ue,{options:i,defaultValue:s,onValueChange:j,placeholder:"All agents",variant:"secondary",className:"w-full",maxCount:1})]}),e[10]=s,e[11]=j,e[12]=i,e[13]=g):g=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"User"}),e[14]=S):S=e[14];let f;e[15]!==c?(f=M=>c({filterUserIds:M.slice(0,1)}),e[15]=c,e[16]=f):f=e[16];let y;e[17]!==n||e[18]!==a||e[19]!==f?(y=t.jsxs("div",{children:[S,t.jsx(Ue,{options:a,defaultValue:n,onValueChange:f,placeholder:"All users",variant:"secondary",className:"w-full",maxCount:1})]}),e[17]=n,e[18]=a,e[19]=f,e[20]=y):y=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),e[21]=_):_=e[21];let d;e[22]!==c?(d=M=>c({filterStatus:M}),e[22]=c,e[23]=d):d=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ht,{className:"w-full",children:t.jsx(gt,{})}),e[24]=C):C=e[24];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(pt,{children:[t.jsx(ge,{value:"all",children:"All statuses"}),t.jsx(ge,{value:"completed",children:"Completed"}),t.jsx(ge,{value:"active",children:"Active"}),t.jsx(ge,{value:"failed",children:"Failed"})]}),e[25]=T):T=e[25];let w;e[26]!==r||e[27]!==d?(w=t.jsxs("div",{children:[_,t.jsxs(jt,{value:r,onValueChange:d,children:[C,T]})]}),e[26]=r,e[27]=d,e[28]=w):w=e[28];let I;e[29]!==y||e[30]!==w||e[31]!==g?(I=t.jsxs("div",{className:"space-y-3",children:[g,y,w]}),e[29]=y,e[30]=w,e[31]=g,e[32]=I):I=e[32];let k;e[33]!==m||e[34]!==c?(k=m>0&&t.jsx(fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{c({filterAgentIds:[],filterUserIds:[],filterStatus:"all"}),b(!1)},children:"Clear all filters"}),e[33]=m,e[34]=c,e[35]=k):k=e[35];let P;e[36]!==I||e[37]!==k?(P=t.jsx(Qe,{align:"end",className:"w-[280px]",children:t.jsxs("div",{className:"space-y-4",children:[u,I,k]})}),e[36]=I,e[37]=k,e[38]=P):P=e[38];let D;return e[39]!==o||e[40]!==P||e[41]!==N?(D=t.jsxs(Ze,{open:o,onOpenChange:b,children:[N,P]}),e[39]=o,e[40]=P,e[41]=N,e[42]=D):D=e[42],D}const _e=50;function Ps(l){const e=le.c(29),{client:s,locator:n,membersData:r,allConnections:i,allVirtualMcps:a,dateRange:m,searchQuery:c,filterAgentIds:o,filterUserIds:b,filterStatus:v}=l,[x,h]=oe.useState(null),N=m.startDate.toISOString(),u=m.endDate.toISOString(),p=JSON.stringify({startDate:N,endDate:u,search:c,agentIds:o,userIds:b,status:v}),{data:j,fetchNextPage:g,hasNextPage:S,isFetchingNextPage:f,isLoading:y}=ze({queryKey:xe.threadsInfinite(n,p),queryFn:async R=>{const{pageParam:G}=R,ie=G===void 0?0:G;if(!s)throw new Error("MCP client is not available");const E=await s.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:_e,offset:ie,startDate:N,endDate:u,...c?{search:c}:{},...o&&o.length>0?{agentId:o[0]}:{},...b&&b.length>0?{userId:b[0]}:{},...v&&v!=="all"?{status:v}:{}}});return E.structuredContent??E},initialPageParam:0,getNextPageParam:Gt,staleTime:3e4}),_=(j?.pages??[]).flatMap(qt),d=_.map(Kt),{data:C}=Ve({queryKey:xe.monitoringThreadUsage(n,JSON.stringify({ids:d,startDate:N,endDate:u})),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const R=await s.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:d,startDate:N,endDate:u}});return R.structuredContent??R},enabled:!!s&&d.length>0,staleTime:3e4}),T=new Map((C?.items??[]).map(zt)),[w,I]=oe.useState(null),[k,P]=oe.useState("desc");let D;e[0]!==w?(D=R=>{w===R?P(Vt):(I(R),P("desc"))},e[0]=w,e[1]=D):D=e[1];const M=D,A=R=>{const G=T.get(R);return G?w==="cost"?G.costUsd:G.totalTokens:0},$=w?[..._].sort((R,G)=>{const ie=A(R.id),E=A(G.id);return k==="desc"?E-ie:ie-E}):_,B=x!==null?$[x]??null:null;let F;e[2]!==g||e[3]!==S||e[4]!==f?(F=()=>{S&&!f&&g()},e[2]=g,e[3]=S,e[4]=f,e[5]=F):F=e[5];const q=ke(F,S??!1,f),U=!!c||(o?.length??0)>0||(b?.length??0)>0||v&&v!=="all";let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=()=>h(Ot),e[6]=O):O=e[6];const L=O,K=()=>h(R=>R!==null&&R<$.length-1?R+1:R),V="flex-1 flex flex-col overflow-auto min-w-0",J="mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",z="flex-1 flex flex-col min-w-0",Q="flex-1 min-w-0 pt-1",ce="min-w-0",W=y?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})}):_.length===0?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx(Se,{title:U?"No matching threads":"No threads in this time range",description:U?"Try adjusting your filters or search query.":"Try expanding the time range to see older threads."})}):t.jsxs(t.Fragment,{children:[t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0 z-20",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(te,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Title"}),t.jsx(te,{className:"w-36 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(te,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("tokens"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Tokens",w==="tokens"&&(k==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("cost"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Cost",w==="cost"&&(k==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(te,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"})]})}),t.jsx(Be,{children:$.map((R,G)=>t.jsx(Et,{thread:R,usage:T.get(R.id),members:r,connections:i,virtualMcps:a,onClick:()=>h(G),lastRowRef:G===$.length-1?q:void 0},R.id))})]}),f&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more..."})]});let Y;e[7]!==W?(Y=t.jsx("div",{className:J,children:t.jsx("div",{className:z,children:t.jsx("div",{className:Q,children:t.jsx("div",{className:ce,children:W})})})}),e[7]=W,e[8]=Y):Y=e[8];const de=x!==null;let ne;e[9]===Symbol.for("react.memo_cache_sentinel")?(ne=R=>{R||h(null)},e[9]=ne):ne=e[9];let ae;e[10]!==i||e[11]!==a||e[12]!==s||e[13]!==$||e[14]!==K||e[15]!==L||e[16]!==n||e[17]!==r||e[18]!==B||e[19]!==x?(ae=B&&x!==null&&t.jsx(et,{thread:B,client:s,locator:n,connections:i,virtualMcps:a,members:r,selectedIndex:x,total:$.length,onPrev:L,onNext:K}),e[10]=i,e[11]=a,e[12]=s,e[13]=$,e[14]=K,e[15]=L,e[16]=n,e[17]=r,e[18]=B,e[19]=x,e[20]=ae):ae=e[20];let X;e[21]!==ae?(X=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:ae}),e[21]=ae,e[22]=X):X=e[22];let ee;e[23]!==de||e[24]!==X?(ee=t.jsx(qe,{open:de,onOpenChange:ne,children:X}),e[23]=de,e[24]=X,e[25]=ee):ee=e[25];let re;return e[26]!==Y||e[27]!==ee?(re=t.jsxs("div",{className:V,children:[Y,ee]}),e[26]=Y,e[27]=ee,e[28]=re):re=e[28],re}function Ot(l){return l!==null&&l>0?l-1:l}function Vt(l){return l==="desc"?"asc":"desc"}function zt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Kt(l){return l.id}function qt(l){return l.items??[]}function Gt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<_e))return n.length*_e}const Te=50;function pe(l){const e=le.c(10),{title:s,value:n,subtitle:r}=l;let i;e[0]!==s?(i=t.jsx("span",{className:"text-sm text-foreground/70",children:s}),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=t.jsx("span",{className:"text-3xl font-normal tabular-nums",children:n}),e[2]=n,e[3]=a):a=e[3];let m;e[4]!==r?(m=r&&t.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=m):m=e[5];let c;return e[6]!==i||e[7]!==a||e[8]!==m?(c=t.jsxs(ct,{className:"pt-4 px-4 pb-5 gap-1",children:[i,a,m]}),e[6]=i,e[7]=a,e[8]=m,e[9]=c):c=e[9],c}function Ht(l){const e=le.c(27),{automationId:s,range:n}=l,{data:r,isLoading:i}=ft(s,n),a=r?.runs,m=r?.usage;let c;e[0]!==a?(c=a&&a.total>0?`${Math.round(a.completed/a.total*100)}%`:"—",e[0]=a,e[1]=c):c=e[1];const o=c,b=m&&m.truncated?`last ${m.sampledRuns} runs`:void 0;let v;e[2]!==i||e[3]!==a?.total?(v=i?"…":a?.total.toLocaleString()??"0",e[2]=i,e[3]=a?.total,e[4]=v):v=e[4];const x=a?`${a.completed} ok · ${a.failed} failed${a.inProgress>0?` · ${a.inProgress} running`:""}`:void 0;let h;e[5]!==v||e[6]!==x?(h=t.jsx(pe,{title:"Runs",value:v,subtitle:x}),e[5]=v,e[6]=x,e[7]=h):h=e[7];const N=i?"…":o;let u;e[8]!==N?(u=t.jsx(pe,{title:"Success rate",value:N}),e[8]=N,e[9]=u):u=e[9];let p;e[10]!==i||e[11]!==m?.totalTokens?(p=i?"…":De(m?.totalTokens??0),e[10]=i,e[11]=m?.totalTokens,e[12]=p):p=e[12];let j;e[13]!==p||e[14]!==b?(j=t.jsx(pe,{title:"Tokens",value:p,subtitle:b}),e[13]=p,e[14]=b,e[15]=j):j=e[15];let g;e[16]!==i||e[17]!==m?(g=i?"…":m&&m.costUsd>0?Re(m.costUsd):"—",e[16]=i,e[17]=m,e[18]=g):g=e[18];let S;e[19]!==g||e[20]!==b?(S=t.jsx(pe,{title:"Cost",value:g,subtitle:b}),e[19]=g,e[20]=b,e[21]=S):S=e[21];let f;return e[22]!==S||e[23]!==h||e[24]!==u||e[25]!==j?(f=t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[h,u,j,S]}),e[22]=S,e[23]=h,e[24]=u,e[25]=j,e[26]=f):f=e[26],f}function Bt(l){const e=le.c(39),{run:s,usage:n,onClick:r,lastRowRef:i}=l;let a,m;if(e[0]!==s.created_at){const C=new Date(s.created_at);a=C.toLocaleDateString("en-US",{month:"short",day:"numeric"}),m=C.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[0]=s.created_at,e[1]=a,e[2]=m}else a=e[1],m=e[2];const c=m,o=ue[s.status]??ue.completed,b=o.icon;let v;e[3]!==s.title?(v=t.jsx(se,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[3]=s.title,e[4]=v):v=e[4];let x;e[5]!==b||e[6]!==o.iconClassName?(x=t.jsx(b,{size:14,className:o.iconClassName}),e[5]=b,e[6]=o.iconClassName,e[7]=x):x=e[7];let h;e[8]!==o.labelColor?(h=be("text-sm",o.labelColor),e[8]=o.labelColor,e[9]=h):h=e[9];let N;e[10]!==o.label||e[11]!==h?(N=t.jsx("span",{className:h,children:o.label}),e[10]=o.label,e[11]=h,e[12]=N):N=e[12];let u;e[13]!==x||e[14]!==N?(u=t.jsx(se,{className:"w-28 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[x,N]})}),e[13]=x,e[14]=N,e[15]=u):u=e[15];let p;e[16]!==n?(p=n?De(n.totalTokens):"—",e[16]=n,e[17]=p):p=e[17];let j;e[18]!==p?(j=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:p}),e[18]=p,e[19]=j):j=e[19];let g;e[20]!==n?(g=n&&n.costUsd>0?Re(n.costUsd):"—",e[20]=n,e[21]=g):g=e[21];let S;e[22]!==g?(S=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:g}),e[22]=g,e[23]=S):S=e[23];let f;e[24]!==a?(f=t.jsx("div",{children:a}),e[24]=a,e[25]=f):f=e[25];let y;e[26]!==c?(y=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:c}),e[26]=c,e[27]=y):y=e[27];let _;e[28]!==f||e[29]!==y?(_=t.jsxs(se,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[f,y]}),e[28]=f,e[29]=y,e[30]=_):_=e[30];let d;return e[31]!==i||e[32]!==r||e[33]!==S||e[34]!==_||e[35]!==v||e[36]!==u||e[37]!==j?(d=t.jsxs(Ne,{ref:i,className:"h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:r,children:[v,u,j,S,_]}),e[31]=i,e[32]=r,e[33]=S,e[34]=_,e[35]=v,e[36]=u,e[37]=j,e[38]=d):d=e[38],d}function Ms(l){const e=le.c(48),{automationId:s,triggerIds:n,range:r}=l,{org:i,locator:a}=st();let m;e[0]!==i.id||e[1]!==i.slug?(m={connectionId:rt,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=m):m=e[2];const c=it(m),o=lt(),b=ot(),{data:v}=ut(),[x,h]=oe.useState(null),N=n.length>0;let u;e[3]!==s||e[4]!==i.id||e[5]!==n?(u=xe.automationRuns(i.id,s,n),e[3]=s,e[4]=i.id,e[5]=n,e[6]=u):u=e[6];let p;e[7]!==c||e[8]!==n?(p=async z=>{const{pageParam:Q}=z,ce=Q===void 0?0:Q,W=await c.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:Te,offset:ce,where:{trigger_ids:n}}});return W.structuredContent??W},e[7]=c,e[8]=n,e[9]=p):p=e[9];let j;e[10]!==N||e[11]!==u||e[12]!==p?(j={queryKey:u,queryFn:p,initialPageParam:0,getNextPageParam:Yt,enabled:N,staleTime:3e4},e[10]=N,e[11]=u,e[12]=p,e[13]=j):j=e[13];const{data:g,fetchNextPage:S,hasNextPage:f,isFetchingNextPage:y,isLoading:_}=ze(j),d=(g?.pages??[]).flatMap(Wt),C=d.map(Zt),{data:T}=Ve({queryKey:xe.monitoringThreadUsage(a,JSON.stringify({ids:C,...r})),queryFn:async()=>{const z=await c.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:C,...r.startDate?{startDate:r.startDate}:{},...r.endDate?{endDate:r.endDate}:{}}});return z.structuredContent??z},enabled:C.length>0,staleTime:3e4});let w;e[14]!==T?.items?(w=new Map((T?.items??[]).map(Qt)),e[14]=T?.items,e[15]=w):w=e[15];const I=w;let k;e[16]!==S||e[17]!==f||e[18]!==y?(k=()=>{f&&!y&&S()},e[16]=S,e[17]=f,e[18]=y,e[19]=k):k=e[19];const P=ke(k,f??!1,y),D=x!==null?d[x]??null:null;let M;e[20]===Symbol.for("react.memo_cache_sentinel")?(M=()=>h(Jt),e[20]=M):M=e[20];const A=M,$=()=>h(z=>z!==null&&z<d.length-1?z+1:z),B="flex flex-col gap-5";let F;e[21]!==s||e[22]!==r?(F=t.jsx(Ht,{automationId:s,range:r}),e[21]=s,e[22]=r,e[23]=F):F=e[23];const Z=N?_?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading runs…"}):d.length===0?t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No runs yet",description:"This automation hasn't run yet. Trigger it or wait for a starter to fire."})}):t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(te,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Run"}),t.jsx(te,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Tokens"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Cost"}),t.jsx(te,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Started"})]})}),t.jsx(Be,{children:d.map((z,Q)=>t.jsx(Bt,{run:z,usage:I.get(z.id),onClick:()=>h(Q),lastRowRef:Q===d.length-1?P:void 0},z.id))})]}):t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No starters yet",description:"Add a starter (cron, event, or webhook) to start collecting runs."})});let q;e[24]!==y?(q=y&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more…"}),e[24]=y,e[25]=q):q=e[25];const U=x!==null;let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=z=>{z||h(null)},e[26]=O):O=e[26];let L;e[27]!==o||e[28]!==b||e[29]!==c||e[30]!==$||e[31]!==A||e[32]!==a||e[33]!==v||e[34]!==d||e[35]!==D||e[36]!==x?(L=D&&x!==null&&t.jsx(et,{thread:D,client:c,locator:a,connections:o,virtualMcps:b,members:v,selectedIndex:x,total:d.length,onPrev:A,onNext:$}),e[27]=o,e[28]=b,e[29]=c,e[30]=$,e[31]=A,e[32]=a,e[33]=v,e[34]=d,e[35]=D,e[36]=x,e[37]=L):L=e[37];let K;e[38]!==L?(K=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:L}),e[38]=L,e[39]=K):K=e[39];let V;e[40]!==U||e[41]!==K?(V=t.jsx(qe,{open:U,onOpenChange:O,children:K}),e[40]=U,e[41]=K,e[42]=V):V=e[42];let J;return e[43]!==Z||e[44]!==q||e[45]!==V||e[46]!==F?(J=t.jsxs("div",{className:B,children:[F,Z,q,V]}),e[43]=Z,e[44]=q,e[45]=V,e[46]=F,e[47]=J):J=e[47],J}function Jt(l){return l!==null&&l>0?l-1:l}function Qt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Zt(l){return l.id}function Wt(l){return l.items??[]}function Yt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Te))return n.length*Te}export{Ms as A,Ue as M,Is as T,Re as a,_s as b,Rt as c,ks as d,Ts as e,De as f,Cs as g,Xe as h,Ps as i};
@@ -1 +0,0 @@
1
- import{e as k,j as o,q as L,f as T,r as $,B as M,t as N}from"./index-RoHcRkq0.js";import{s as q}from"./Plus-BVt3gf6N.js";import{i as S}from"./Zap-ZCJiHFB8.js";import{S as D}from"./search-input-BIE6clnk.js";import{P as l}from"./index-Dhy2A-ml.js";import{E as b}from"./empty-state-BvMn8pb-.js";import{c as O}from"./use-automations-BQsS5jcL.js";import{k as V}from"./use-navigate-to-agent-B_6LJV9r.js";import{A as F}from"./automation-list-row-DCGCyvJL.js";import{h as G}from"./constants-DDZG6Edw.js";import{a as H}from"./use-virtual-mcp-wf8itLFJ.js";import{R as J}from"./require-capability-USY4c6Pw.js";import"./SearchMd-Ckbe6j0d.js";import"./sidebar-3Sp07kli.js";import"./LayoutLeft-D5P3SyL5.js";import"./tooltip-CLHWv9z-.js";import"./sheet-D-hNRlw_.js";import"./X-Dzpu-bw3.js";import"./alert-dialog-BDuu9Vea.js";import"./dropdown-menu-jK5-EocK.js";import"./Check-Rzhysg8v.js";import"./ChevronRight-C-1GbVi6.js";import"./DotsVertical--nxfulT_.js";import"./agent-icon-atw8dEpB.js";import"./AlertCircle-CfP2ydlK.js";import"./Tool01-D6Ixmgxm.js";import"./SwitchHorizontal01-CLmvgZdy.js";import"./RefreshCcw01-Do9uT8r5.js";import"./XCircle-gezQrKJB.js";import"./ArrowUpRight-BG7K2o4g.js";import"./ZapSquare-Doe97qp7.js";import"./Users03-C3j_vENk.js";import"./CheckCircle-ByVfCd_z.js";import"./ChevronDown-DgAQraB9.js";import"./ChevronLeft-hIkmA-06.js";import"./ChevronUp-D95kdAWS.js";import"./Container-EsK9R8Cs.js";import"./Eye-0u1NnyPn.js";import"./ZoomOut-u9z9zRXH.js";import"./Globe01-CYJ5akFo.js";import"./FilterLines-lN6ZYEU6.js";import"./Star01-DinMZEQp.js";import"./Palette-CvBtCHX7.js";import"./HardDrive-Bi11tZlO.js";import"./Stars02-CovFPupV.js";import"./Key01-ETI9VuA0.js";import"./LinkExternal01-CMTN51kD.js";import"./Monitor01-B9COEs1V.js";import"./Sun-D5MzBxyK.js";import"./Play-zcNTCzY3.js";import"./Settings02-BFHOCA5h.js";import"./Shield01-ebA_Mmqa.js";import"./Stars01-cUHrtzm6.js";import"./Trash01-C6sXu2xm.js";import"./Upload01-DslYY_N3.js";import"./User01-9CJ-p7XF.js";import"./Users01-Ds5_zubO.js";import"./XClose-dfaecXcF.js";import"./use-collections-DxWiIX9G.js";import"./use-capability-DGItFWVB.js";import"./access-gate-CLs4hv6_.js";import"./capability-load-error-h6odhJ2k.js";function K(){const t=k.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,B=H(),R=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(B.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const m=y.get(e.virtual_mcp_id);if(m&&m.title.toLowerCase().includes(g))return!0}return!1}),P=(e,m)=>{const A=m&&y.has(m)?m:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),R(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let a;t[10]!==h.Content||t[11]!==s?(a=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=a):a=t[12];let c;return t[13]!==x||t[14]!==a?(c=o.jsx(x,{children:a}),t[13]=x,t[14]=a,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function eo(){const t=k.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{eo as default};
@@ -1 +0,0 @@
1
- import{e as H,X as Ie,q as ze,G as Le,K as Re,n as Ke,a as ge,j as n,B as Te,t as V,o as X,r as Oe,H as Xe,c as _e,D as fe}from"./index-RoHcRkq0.js";import{S as He,u as Ue}from"./constants-DDZG6Edw.js";import{t as qe}from"./ChevronDown-DgAQraB9.js";import{i as Me}from"./ChevronRight-C-1GbVi6.js";import{s as Ve,t as Ge}from"./Star01-DinMZEQp.js";import{n as Qe}from"./LinkExternal01-CMTN51kD.js";import{s as Pe}from"./Plus-BVt3gf6N.js";import{s as Ye}from"./Trash01-C6sXu2xm.js";import{i as Je}from"./Zap-ZCJiHFB8.js";import{c as We,b as Ze,d as et,f as tt,g as st,e as nt,a as lt,A as ot}from"./alert-dialog-BDuu9Vea.js";import{I as ue}from"./input-DsRHjNfg.js";import{T as rt}from"./textarea-Cq68Cg3C.js";import{P as Ne}from"./index-Dhy2A-ml.js";import{u as $e}from"./unwrap-tool-result-BYXdCQMg.js";import{u as at}from"./use-debounced-autosave-B43AQzLm.js";import{R as it}from"./require-capability-USY4c6Pw.js";import"./sidebar-3Sp07kli.js";import"./LayoutLeft-D5P3SyL5.js";import"./tooltip-CLHWv9z-.js";import"./sheet-D-hNRlw_.js";import"./X-Dzpu-bw3.js";import"./use-capability-DGItFWVB.js";import"./access-gate-CLs4hv6_.js";import"./capability-load-error-h6odhJ2k.js";function we(t){const e=H.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let i;e[2]!==s?(i=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=i):i=e[3];let d;return e[4]!==o||e[5]!==r||e[6]!==i?(d=n.jsxs("div",{className:r,children:[i,o]}),e[4]=o,e[5]=r,e[6]=i,e[7]=d):d=e[7],d}function ct(t){const e=H.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Oe.useState("");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Je,{size:18,className:"text-primary"})}),e[0]=i):i=e[0];let d,u;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),u=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=d,e[2]=u):(d=e[1],u=e[2]);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=f=>r(f.target.value),e[3]=p):p=e[3];let b;e[4]!==l||e[5]!==o||e[6]!==s?(b=f=>{f.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=b):b=e[7];let m;e[8]!==l||e[9]!==b?(m=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:p,className:"max-w-xs",onKeyDown:b}),e[8]=l,e[9]=b,e[10]=m):m=e[10];let c;e[11]!==l||e[12]!==o?(c=!l.trim()||o,e[11]=l,e[12]=o,e[13]=c):c=e[13];let a;e[14]!==l||e[15]!==s?(a=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=a):a=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ve,{size:14}),e[17]=x):x=e[17];const g=o?"Extracting...":"Extract";let h;e[18]!==g||e[19]!==c||e[20]!==a?(h=n.jsxs(Te,{variant:"outline",disabled:c,onClick:a,children:[x,g]}),e[18]=g,e[19]=c,e[20]=a,e[21]=h):h=e[21];let v;return e[22]!==h||e[23]!==m?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[i,n.jsxs("div",{className:"flex-1",children:[d,u,n.jsxs("div",{className:"mt-3 flex gap-2",children:[m,h]})]})]})}),e[22]=h,e[23]=m,e[24]=v):v=e[24],v}function dt(t){const e=H.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const i=r;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=d):d=e[2];let u;e[3]!==o||e[4]!==l?(u=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=u):u=e[5];let p;e[6]!==s.control||e[7]!==u?(p=n.jsxs("div",{children:[d,n.jsx(fe,{control:s.control,name:"name",render:u})]}),e[6]=s.control,e[7]=u,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{children:"Domain"}),e[9]=b):b=e[9];let m;e[10]!==i?(m=i&&n.jsxs("a",{href:`https://${i}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Qe,{size:10}),"open"]}),e[10]=i,e[11]=m):m=e[11];let c;e[12]!==m?(c=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[b,m]}),e[12]=m,e[13]=c):c=e[13];let a;e[14]!==o||e[15]!==l?(a=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=a):a=e[16];let x;e[17]!==s.control||e[18]!==a?(x=n.jsx(fe,{control:s.control,name:"domain",render:a}),e[17]=s.control,e[18]=a,e[19]=x):x=e[19];let g;e[20]!==c||e[21]!==x?(g=n.jsxs("div",{children:[c,x]}),e[20]=c,e[21]=x,e[22]=g):g=e[22];let h;e[23]!==g||e[24]!==p?(h=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[p,g]}),e[23]=g,e[24]=p,e[25]=h):h=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let f;e[27]!==o||e[28]!==l?(f=D=>{const{field:y}=D;return n.jsx(rt,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=f):f=e[29];let C;e[30]!==s.control||e[31]!==f?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:f})]}),e[30]=s.control,e[31]=f,e[32]=C):C=e[32];let w;return e[33]!==h||e[34]!==C?(w=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[h,C]})}),e[33]=h,e[34]=C,e[35]=w):w=e[35],w}const mt={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Ae(t){const e=H.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:i,onFieldCommit:d}=t,u=r===void 0?"h-full w-full object-contain p-3":r;let p;e[0]!==s||e[1]!==o?(p=s.watch(o),e[0]=s,e[1]=o,e[2]=p):p=e[2];const b=p;let m;e[3]!==u||e[4]!==l||e[5]!==b?(m=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:mt,children:b?n.jsx("img",{src:b,alt:l,className:u,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=u,e[4]=l,e[5]=b,e[6]=m):m=e[6];let c;e[7]!==l?(c=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=c):c=e[8];let a;e[9]!==i||e[10]!==d?(a=v=>{const{field:f}=v;return n.jsx(ue,{...f,onChange:C=>{f.onChange(C),i()},onBlur:()=>{f.onBlur(),d()},placeholder:"https://..."})},e[9]=i,e[10]=d,e[11]=a):a=e[11];let x;e[12]!==s.control||e[13]!==o||e[14]!==a?(x=n.jsx(fe,{control:s.control,name:o,render:a}),e[12]=s.control,e[13]=o,e[14]=a,e[15]=x):x=e[15];let g;e[16]!==c||e[17]!==x?(g=n.jsxs("div",{className:"flex-1",children:[c,x]}),e[16]=c,e[17]=x,e[18]=g):g=e[18];let h;return e[19]!==m||e[20]!==g?(h=n.jsxs("div",{className:"flex items-start gap-3",children:[m,g]}),e[19]=m,e[20]=g,e[21]=h):h=e[21],h}function ft(t){const e=H.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Ae,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Ae,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Ae,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const ut=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function xt(t){const e=H.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(d=>{const{key:u,label:p}=d,b=`fonts.${u}`,m=s.watch(b);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:p}),m&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:m},children:m})]}),n.jsx(fe,{control:s.control,name:b,render:c=>{const{field:a}=c;return n.jsx(ue,{...a,value:a.value??"",onChange:x=>{a.onChange(x),o()},onBlur:()=>{a.onBlur(),l()},placeholder:`Font family for ${p.toLowerCase()}`})}})]},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}const gt=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function ht(t){const e=H.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=gt.map(d=>{const{key:u,label:p}=d,b=`colors.${u}`;return n.jsx(fe,{control:s.control,name:b,render:m=>{const{field:c}=m;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:c.value??"#000000",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:c.value??"",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:p})]})}},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}function pt(t){const e=H.c(128),{brand:s,client:o,onChanged:l}=t,[r,i]=Oe.useState(s.isDefault??!1),[d,u]=Oe.useState(!1),p=s.name??"",b=s.domain??"",m=s.overview??"",c=s.logo??"",a=s.favicon??"",x=s.ogImage??"";let g;e[0]!==s.fonts?(g=s.fonts??{},e[0]=s.fonts,e[1]=g):g=e[1];let h;e[2]!==s.colors?(h=s.colors??{},e[2]=s.colors,e[3]=h):h=e[3];let v;e[4]!==p||e[5]!==b||e[6]!==m||e[7]!==c||e[8]!==a||e[9]!==x||e[10]!==g||e[11]!==h?(v={values:{name:p,domain:b,overview:m,logo:c,favicon:a,ogImage:x,fonts:g,colors:h}},e[4]=p,e[5]=b,e[6]=m,e[7]=c,e[8]=a,e[9]=x,e[10]=g,e[11]=h,e[12]=v):v=e[12];const f=Xe(v);let C;e[13]!==s.id||e[14]!==s.images||e[15]!==o?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(kt),Ce=Object.values(j.colors).some(Dt),Se={id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null,images:s.images};await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:Se})},onError:wt},e[13]=s.id,e[14]=s.images,e[15]=o,e[16]=C):C=e[16];const w=ge(C);let D;e[17]!==s.id||e[18]!==f||e[19]!==l||e[20]!==w?(D={delayMs:500,save:async()=>{const j=f.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=f.getValues(),Se=f.control._defaultValues;f.reset(Ce,{keepValues:!0});try{await w.mutateAsync(Ce),V("brand_updated",{brand_id:s.id,fields:ve}),X.success("Brand context updated successfully"),l()}catch{f.reset(Se,{keepValues:!0})}}},e[17]=s.id,e[18]=f,e[19]=l,e[20]=w,e[21]=D):D=e[21];const{schedule:y,flush:N}=at(D);let I;e[22]!==s.id||e[23]!==o?(I=async()=>{await o.callTool({name:"BRAND_CONTEXT_DELETE",arguments:{id:s.id}})},e[22]=s.id,e[23]=o,e[24]=I):I=e[24];let z;e[25]!==s.id||e[26]!==l?(z=()=>{V("brand_deleted",{brand_id:s.id}),u(!1),l(),X.success("Brand deleted")},e[25]=s.id,e[26]=l,e[27]=z):z=e[27];let U;e[28]!==I||e[29]!==z?(U={mutationFn:I,onSuccess:z,onError:_t},e[28]=I,e[29]=z,e[30]=U):U=e[30];const{mutate:xe,isPending:k}=ge(U);let B;e[31]!==s.id||e[32]!==s.isDefault||e[33]!==o?(B=async()=>{await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:{id:s.id,isDefault:!s.isDefault}})},e[31]=s.id,e[32]=s.isDefault,e[33]=o,e[34]=B):B=e[34];let A;e[35]!==s.id||e[36]!==s.isDefault||e[37]!==l?(A=()=>{V(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),l(),X.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[35]=s.id,e[36]=s.isDefault,e[37]=l,e[38]=A):A=e[38];let T;e[39]!==B||e[40]!==A?(T={mutationFn:B,onSuccess:A,onError:Nt},e[39]=B,e[40]=A,e[41]=T):T=e[41];const{mutate:O}=ge(T),M=s.isDefault?"border-primary/30":"border-border/60";let q;e[42]!==M?(q=_e("rounded-2xl border bg-background",M),e[42]=M,e[43]=q):q=e[43];let R;e[44]!==r?(R=()=>i(!r),e[44]=r,e[45]=R):R=e[45];let L;e[46]!==r?(L=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(qe,{size:14}):n.jsx(Me,{size:14})}),e[46]=r,e[47]=L):L=e[47];let E;e[48]!==s.logo||e[49]!==s.name?(E=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:Ct})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[48]=s.logo,e[49]=s.name,e[50]=E):E=e[50];const K=s.name||"Untitled Brand";let F;e[51]!==K?(F=n.jsx("span",{className:"text-sm font-medium text-foreground",children:K}),e[51]=K,e[52]=F):F=e[52];let S;e[53]!==s.domain?(S=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[53]=s.domain,e[54]=S):S=e[54];let P;e[55]!==F||e[56]!==S?(P=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[F,S]}),e[55]=F,e[56]=S,e[57]=P):P=e[57];let _;e[58]!==s.colors||e[59]!==r?(_=!r&&s.colors&&Object.values(s.colors).some(vt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(yt).map(jt)}),e[58]=s.colors,e[59]=r,e[60]=_):_=e[60];let $;e[61]!==s.fonts||e[62]!==r?($=!r&&s.fonts&&Object.values(s.fonts).some(bt)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[61]=s.fonts,e[62]=r,e[63]=$):$=e[63];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let G;e[64]!==De?(G=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[64]=De,e[65]=G):G=e[65];let Q,Y;e[66]!==O?(Q=j=>{j.stopPropagation(),O()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),O())},e[66]=O,e[67]=Q,e[68]=Y):(Q=e[67],Y=e[68]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[69]!==Be?(J=_e(Be),e[69]=Be,e[70]=J):J=e[70];let W;e[71]!==J?(W=n.jsx(Ge,{size:13,className:J}),e[71]=J,e[72]=W):W=e[72];let Z;e[73]!==G||e[74]!==Q||e[75]!==Y||e[76]!==ke||e[77]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:G,onClick:Q,onKeyDown:Y,title:ke,children:W}),e[73]=G,e[74]=Q,e[75]=Y,e[76]=ke,e[77]=W,e[78]=Z):Z=e[78];let he,pe;e[79]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),u(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),u(!0))},e[79]=he,e[80]=pe):(he=e[79],pe=e[80]);let be;e[81]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ye,{size:13,className:"text-muted-foreground"})}),e[81]=be):be=e[81];let ee;e[82]!==R||e[83]!==L||e[84]!==E||e[85]!==P||e[86]!==_||e[87]!==$||e[88]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:R,children:[L,E,P,_,$,Z,be]}),e[82]=R,e[83]=L,e[84]=E,e[85]=P,e[86]=_,e[87]=$,e[88]=Z,e[89]=ee):ee=e[89];let te;e[90]!==r||e[91]!==N||e[92]!==f||e[93]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(dt,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(ft,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ht,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(xt,{form:f,onFieldChange:y,onFieldCommit:N})]})]}),e[90]=r,e[91]=N,e[92]=f,e[93]=y,e[94]=te):te=e[94];let se;e[95]!==k?(se=j=>{!j&&!k&&u(!1)},e[95]=k,e[96]=se):se=e[96];let je;e[97]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(We,{children:"Delete brand?"}),e[97]=je):je=e[97];const Ee=s.name||"this brand";let ne;e[98]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[98]=Ee,e[99]=ne):ne=e[99];let le;e[100]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[100]=s.isDefault,e[101]=le):le=e[101];let oe;e[102]!==ne||e[103]!==le?(oe=n.jsxs(Ze,{children:[je,n.jsx(et,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[102]=ne,e[103]=le,e[104]=oe):oe=e[104];let re;e[105]!==k?(re=n.jsx(tt,{disabled:k,children:"Cancel"}),e[105]=k,e[106]=re):re=e[106];let ae;e[107]!==xe?(ae=j=>{j.preventDefault(),xe()},e[107]=xe,e[108]=ae):ae=e[108];const Fe=k?"Deleting...":"Delete";let ie;e[109]!==k||e[110]!==ae||e[111]!==Fe?(ie=n.jsx(st,{onClick:ae,disabled:k,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[109]=k,e[110]=ae,e[111]=Fe,e[112]=ie):ie=e[112];let ce;e[113]!==re||e[114]!==ie?(ce=n.jsxs(nt,{children:[re,ie]}),e[113]=re,e[114]=ie,e[115]=ce):ce=e[115];let de;e[116]!==oe||e[117]!==ce?(de=n.jsxs(lt,{children:[oe,ce]}),e[116]=oe,e[117]=ce,e[118]=de):de=e[118];let me;e[119]!==d||e[120]!==se||e[121]!==de?(me=n.jsx(ot,{open:d,onOpenChange:se,children:de}),e[119]=d,e[120]=se,e[121]=de,e[122]=me):me=e[122];let ye;return e[123]!==q||e[124]!==ee||e[125]!==te||e[126]!==me?(ye=n.jsxs("div",{className:q,children:[ee,te,me]}),e[123]=q,e[124]=ee,e[125]=te,e[126]=me,e[127]=ye):ye=e[127],ye}function bt(t){return t}function jt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function yt(t){const[,e]=t;return e}function vt(t){return t}function Ct(t){t.target.style.display="none"}function Nt(){return X.error("Failed to update default brand")}function _t(){return X.error("Failed to delete brand")}function wt(){return X.error("Failed to save brand context")}function Dt(t){return t?.trim()}function kt(t){return t?.trim()}function Bt(){const t=H.c(57),{brandExtractEnabled:e}=Ie(),{org:s}=ze();let o;t[0]!==s.id||t[1]!==s.slug?(o={connectionId:He,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=o):o=t[2];const l=Ue(o),r=Le();let i;t[3]!==s.id?(i=Re.brandContext(s.id),t[3]=s.id,t[4]=i):i=t[4];let d;t[5]!==l?(d=async()=>{const _=await l.callTool({name:"BRAND_CONTEXT_LIST",arguments:{includeArchived:!1}}),$=$e(_);return Array.isArray($?.items)?$.items:[]},t[5]=l,t[6]=d):d=t[6];let u;t[7]!==i||t[8]!==d?(u={queryKey:i,queryFn:d},t[7]=i,t[8]=d,t[9]=u):u=t[9];const{data:p}=Ke(u),m=(p===void 0?[]:p).filter(St);let c;t[10]!==s.id||t[11]!==r?(c=()=>r.invalidateQueries({queryKey:Re.brandContext(s.id),refetchType:"all"}),t[10]=s.id,t[11]=r,t[12]=c):c=t[12];const a=c;let x;t[13]!==l?(x=async()=>{await l.callTool({name:"BRAND_CONTEXT_CREATE",arguments:{name:"New Brand",domain:"example.com",overview:""}})},t[13]=l,t[14]=x):x=t[14];let g;t[15]!==a?(g=()=>{V("brand_created"),a(),X.success("Brand created")},t[15]=a,t[16]=g):g=t[16];let h;t[17]!==x||t[18]!==g?(h={mutationFn:x,onSuccess:g,onError:Ft},t[17]=x,t[18]=g,t[19]=h):h=t[19];const{mutate:v,isPending:f}=ge(h);let C;t[20]!==l?(C=async _=>{V("brand_extract_started",{domain:_});const $=await l.callTool({name:"BRAND_CONTEXT_EXTRACT",arguments:{domain:_}});$e($)},t[20]=l,t[21]=C):C=t[21];let w;t[22]!==a?(w=()=>{V("brand_extract_succeeded"),a(),X.success("Brand extracted successfully")},t[22]=a,t[23]=w):w=t[23];let D;t[24]!==w||t[25]!==C?(D={mutationFn:C,onSuccess:w,onError:Et},t[24]=w,t[25]=C,t[26]=D):D=t[26];const{mutate:y,isPending:N}=ge(D),I=Ne,z=Ne,U=Ne,xe="flex flex-col gap-6";let k;t[27]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[27]=k):k=t[27];let B;t[28]!==v?(B=()=>v(),t[28]=v,t[29]=B):B=t[29];let A;t[30]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Pe,{size:14}),t[30]=A):A=t[30];let T;t[31]!==f||t[32]!==B?(T=n.jsxs("div",{className:"flex items-center justify-between",children:[k,n.jsxs(Te,{variant:"outline",onClick:B,disabled:f,children:[A,"Add Brand"]})]}),t[31]=f,t[32]=B,t[33]=T):T=t[33];let O;t[34]!==e||t[35]!==y||t[36]!==N?(O=e&&n.jsx(ct,{onExtract:_=>y(_),isExtracting:N}),t[34]=e,t[35]=y,t[36]=N,t[37]=O):O=t[37];const M=m.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Te,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>v(),disabled:f,children:[n.jsx(Pe,{size:14}),"Add your first brand"]})]}),q="group space-y-3";let R;t[38]!==l||t[39]!==a?(R=_=>n.jsx(pt,{brand:_,client:l,onChanged:a},_.id),t[38]=l,t[39]=a,t[40]=R):R=t[40];const L=m.map(R);let E;t[41]!==L?(E=n.jsx("div",{className:q,children:L}),t[41]=L,t[42]=E):E=t[42];let K;t[43]!==T||t[44]!==O||t[45]!==M||t[46]!==E?(K=n.jsxs("div",{className:xe,children:[T,O,M,E]}),t[43]=T,t[44]=O,t[45]=M,t[46]=E,t[47]=K):K=t[47];let F;t[48]!==U.Body||t[49]!==K?(F=n.jsx(U.Body,{children:K}),t[48]=U.Body,t[49]=K,t[50]=F):F=t[50];let S;t[51]!==z.Content||t[52]!==F?(S=n.jsx(z.Content,{children:F}),t[51]=z.Content,t[52]=F,t[53]=S):S=t[53];let P;return t[54]!==I||t[55]!==S?(P=n.jsx(I,{children:S}),t[54]=I,t[55]=S,t[56]=P):P=t[56],P}function Et(t){V("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),X.error(t instanceof Error?t.message:"Failed to extract brand")}function Ft(){return X.error("Failed to create brand")}function St(t){return!t.archivedAt}function ss(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(it,{capability:"org:manage",area:"brand context",children:n.jsx(Bt,{})}),t[0]=e):e=t[0],e}export{ss as default};
@@ -1 +0,0 @@
1
- import{e as D,j as t,E as q,r as v,B as A,o as P}from"./index-RoHcRkq0.js";import{i as O}from"./AlertCircle-CfP2ydlK.js";import{i as $}from"./HardDrive-Bi11tZlO.js";import{s as E}from"./Plus-BVt3gf6N.js";import{s as T}from"./Trash01-C6sXu2xm.js";import{f as L,g as K,c as G,b as M,d as W,e as H,a as J,A as Q}from"./alert-dialog-BDuu9Vea.js";import{D as V,a as X,b as Y,c as Z,e as ee,d as te}from"./dialog-CvJmXij7.js";import{I as N}from"./input-DsRHjNfg.js";import{L as k}from"./label-WCbT5R_C.js";import{S as se}from"./switch-DhDeb5VA.js";import{S as ie}from"./skeleton-CQGVA-Lx.js";import{T as re}from"./textarea-Cq68Cg3C.js";import{P as _}from"./index-Dhy2A-ml.js";import{c as ne}from"./settings-section-DWjadbjH.js";import{u as le,a as oe,b as ae}from"./use-file-configs-BSxIo3R0.js";import{R as ce}from"./require-capability-USY4c6Pw.js";import"./X-Dzpu-bw3.js";import"./sidebar-3Sp07kli.js";import"./LayoutLeft-D5P3SyL5.js";import"./tooltip-CLHWv9z-.js";import"./sheet-D-hNRlw_.js";import"./card-B2dT-2ts.js";import"./ArrowUpRight-BG7K2o4g.js";import"./constants-DDZG6Edw.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-capability-DGItFWVB.js";import"./access-gate-CLs4hv6_.js";import"./capability-load-error-h6odhJ2k.js";function de(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function me(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(O,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function fe(s){const e=D.c(41),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx($,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.bucket||e[4]!==i.region?(o=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[3]=i.bucket,e[4]=i.region,e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==o?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o]}),e[6]=l,e[7]=o,e[8]=p):p=e[8];let a;e[9]!==i.description?(a=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[9]=i.description,e[10]=a):a=e[10];let j;e[11]!==i.endpoint||e[12]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[11]=i.endpoint,e[12]=i.forcePathStyle,e[13]=j):j=e[13];let h;e[14]!==i.prefix?(h=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[14]=i.prefix,e[15]=h):h=e[15];let c;e[16]!==i.publicUrlBase?(c=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[16]=i.publicUrlBase,e[17]=c):c=e[17];let d;e[18]!==p||e[19]!==a||e[20]!==j||e[21]!==h||e[22]!==c?(d=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[p,a,j,h,c]})]}),e[18]=p,e[19]=a,e[20]=j,e[21]=h,e[22]=c,e[23]=d):d=e[23];let g;e[24]!==i.createdAt?(g=new Date(i.createdAt).toLocaleDateString(),e[24]=i.createdAt,e[25]=g):g=e[25];let x;e[26]!==g?(x=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let m;e[28]!==i||e[29]!==n?(m=()=>n(i),e[28]=i,e[29]=n,e[30]=m):m=e[30];const y=`Delete ${i.name}`;let f;e[31]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(T,{size:14}),e[31]=f):f=e[31];let u;e[32]!==m||e[33]!==y?(u=t.jsx(A,{variant:"ghost",size:"sm",onClick:m,"aria-label":y,children:f}),e[32]=m,e[33]=y,e[34]=u):u=e[34];let S;e[35]!==x||e[36]!==u?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[x,u]}),e[35]=x,e[36]=u,e[37]=S):S=e[37];let C;return e[38]!==S||e[39]!==d?(C=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[d,S]}),e[38]=S,e[39]=d,e[40]=C):C=e[40],C}function ue(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx($,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(E,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,r,t.jsxs(A,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function B({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,p]=v.useState(""),[a,j]=v.useState(""),[h,c]=v.useState(""),[d,g]=v.useState(!1),[x,m]=v.useState(""),[y,f]=v.useState(""),[u,S]=v.useState(""),[C,w]=v.useState(""),F=oe();function R(){n(""),l(""),p(""),j(""),c(""),g(!1),m(""),f(""),S(""),w("")}async function z(b){if(b.preventDefault(),!(!i.trim()||!o.trim()||!a.trim())&&!(!u||!C))try{await F.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:a.trim(),endpoint:h.trim()||void 0,forcePathStyle:d,prefix:x.trim()||void 0,publicUrlBase:y.trim()||void 0,accessKeyId:u,secretAccessKey:C}),P.success(`Bucket "${i.trim()}" added`),R(),e(!1)}catch(I){P.error(de(I,"Failed to add bucket"))}}const U=F.isPending||!i.trim()||!o.trim()||!a.trim()||!u||!C;return t.jsx(V,{open:s,onOpenChange:e,children:t.jsxs(X,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(Y,{children:[t.jsx(Z,{children:"Add S3 bucket"}),t.jsx(ee,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:z,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:b=>n(b.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:b=>p(b.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:a,onChange:b=>j(b.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:h,onChange:b=>c(b.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(k,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(se,{id:"file-config-path-style",checked:d,onCheckedChange:g})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:x,onChange:b=>m(b.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:y,onChange:b=>f(b.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:u,onChange:b=>S(b.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:C,onChange:b=>w(b.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(re,{id:"file-config-description",value:r,onChange:b=>l(b.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(te,{children:[t.jsx(A,{type:"button",variant:"outline",onClick:()=>{R(),e(!1)},disabled:F.isPending,children:"Cancel"}),t.jsx(A,{type:"submit",disabled:U,children:F.isPending?"Adding…":"Add bucket"})]})]})]})})}function xe(s){const e=D.c(25),{config:i,onClose:n}=s,r=ae();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),P.success(`Bucket "${i.name}" removed`),n()}catch(S){const C=S;P.error(C instanceof Error?C.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,p=i!==null;let a;e[4]!==n?(a=u=>!u&&n(),e[4]=n,e[5]=a):a=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(G,{children:"Remove bucket configuration?"}),e[6]=j):j=e[6];const h=i?.name;let c;e[7]!==h?(c=t.jsxs(M,{children:[j,t.jsxs(W,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:h}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=h,e[8]=c):c=e[8];let d;e[9]!==r.isPending?(d=t.jsx(L,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=d):d=e[10];const g=r.isPending?"Removing…":"Remove";let x;e[11]!==r.isPending||e[12]!==o||e[13]!==g?(x=t.jsx(K,{onClick:o,disabled:r.isPending,children:g}),e[11]=r.isPending,e[12]=o,e[13]=g,e[14]=x):x=e[14];let m;e[15]!==d||e[16]!==x?(m=t.jsxs(H,{children:[d,x]}),e[15]=d,e[16]=x,e[17]=m):m=e[17];let y;e[18]!==m||e[19]!==c?(y=t.jsxs(J,{children:[c,m]}),e[18]=m,e[19]=c,e[20]=y):y=e[20];let f;return e[21]!==y||e[22]!==p||e[23]!==a?(f=t.jsx(Q,{open:p,onOpenChange:a,children:y}),e[21]=y,e[22]=p,e[23]=a,e[24]=f):f=e[24],f}function pe(){const s=D.c(25),e=le(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let f;s[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ue,{onCreate:()=>n(!0)}),s[0]=f):f=s[0];let u;return s[1]!==i?(u=t.jsxs(t.Fragment,{children:[f,t.jsx(B,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=u):u=s[2],u}const o=e.length===1?"":"s";let p;s[3]!==e.length||s[4]!==o?(p=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=p):p=s[5];let a;s[6]===Symbol.for("react.memo_cache_sentinel")?(a=()=>n(!0),s[6]=a):a=s[6];let j;s[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs(A,{onClick:a,size:"sm",children:[t.jsx(E,{size:14}),"Add bucket"]}),s[7]=j):j=s[7];let h;s[8]!==p?(h=t.jsxs("div",{className:"flex items-center justify-between",children:[p,j]}),s[8]=p,s[9]=h):h=s[9];let c;if(s[10]!==e){let f;s[12]===Symbol.for("react.memo_cache_sentinel")?(f=u=>t.jsx(fe,{config:u,onDelete:l},u.id),s[12]=f):f=s[12],c=e.map(f),s[10]=e,s[11]=c}else c=s[11];let d;s[13]!==c?(d=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:c})}),s[13]=c,s[14]=d):d=s[14];let g;s[15]!==i?(g=t.jsx(B,{open:i,onOpenChange:n}),s[15]=i,s[16]=g):g=s[16];let x;s[17]===Symbol.for("react.memo_cache_sentinel")?(x=()=>l(null),s[17]=x):x=s[17];let m;s[18]!==r?(m=t.jsx(xe,{config:r,onClose:x}),s[18]=r,s[19]=m):m=s[19];let y;return s[20]!==h||s[21]!==d||s[22]!==g||s[23]!==m?(y=t.jsxs(t.Fragment,{children:[h,d,g,m]}),s[20]=h,s[21]=d,s[22]=g,s[23]=m,s[24]=y):y=s[24],y}function he(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_,{children:t.jsx(_.Content,{children:t.jsx(_.Body,{children:t.jsxs(ne,{children:[e,t.jsx(q,{fallback:ge,children:t.jsx(v.Suspense,{fallback:t.jsx(ie,{className:"h-32 w-full"}),children:t.jsx(pe,{})})})]})})})}),s[1]=i):i=s[1],i}function ge(s){const{error:e}=s;return t.jsx(me,{error:e??new Error("Failed to load file configs")})}function We(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ce,{capability:"file-configs:manage",area:"files",children:t.jsx(he,{})}),s[0]=e):e=s[0],e}export{We as default};
@@ -1 +0,0 @@
1
- import{T as Ke,W as te,e as C,j as t,E as Te,r as w,q as ie,H as Qe,c as J,bn as Ge,l as le,d as Ye,P as Q,B as W,o as Xe,g as ae,bo as ke}from"./index-RoHcRkq0.js";import{E as Pe}from"./empty-state-BvMn8pb-.js";import{u as Ze,a as Ee}from"./use-collections-DxWiIX9G.js";import{u as ce}from"./constants-DDZG6Edw.js";import{F as se,a as et,b as de,d as me}from"./form-DAahwl9B.js";import{I as ue}from"./input-DsRHjNfg.js";import{T as re}from"./textarea-Cq68Cg3C.js";import{a as tt,b as st,V as pe}from"./layout-B9kVRgC4.js";import{S as ot,W as nt,a as rt}from"./index-BDzZll30.js";import{g as it,M as lt,a as je}from"./types-Cxg1qjf9.js";import{A as at,a as ct,b as dt}from"./alert-f3LQH8ql.js";import{d as be,S as Ne,a as ve,b as Se,c as oe}from"./select-DzGY5lz9.js";import{c as mt,b as ye,T as we,a as Ce}from"./tooltip-CLHWv9z-.js";import{i as ut}from"./AlertCircle-CfP2ydlK.js";import{S as pt,Q as xt,a6 as ft,N as ht,a7 as gt,F as Ie}from"./agent-icon-atw8dEpB.js";import{a as jt}from"./Eye-0u1NnyPn.js";import{i as bt}from"./Play-zcNTCzY3.js";import{i as Nt}from"./ChevronRight-C-1GbVi6.js";import{O as vt,M as St}from"./index-CEv88FJY.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./tools-list-6s8Pp55V.js";import{a as _e,u as Ae}from"./use-connection-BKakpvkk.js";import{b as It}from"./use-mcp-tools-DXY52I1e.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as $e}from"./integration-icon-BOg4uSLi.js";import{f as Tt,i as kt}from"./chat-context-7nRfVaxU.js";import{u as Pt}from"./shell-layout-DSHLjHdv.js";import{M as Et}from"./monaco-editor-BleU3J2F.js";import{E as _t}from"./empty-state-CZ6jnWLa.js";import{n as At}from"./Container-EsK9R8Cs.js";import"./label-WCbT5R_C.js";import"./index-Dhy2A-ml.js";import"./sidebar-3Sp07kli.js";import"./LayoutLeft-D5P3SyL5.js";import"./sheet-D-hNRlw_.js";import"./X-Dzpu-bw3.js";import"./index-BFIoANt_.js";import"./collections-BUCuRVxl.js";import"./index-3Euwx3bh.js";import"./use-virtual-mcp-wf8itLFJ.js";import"./resizable-tvU32_PL.js";import"./ZoomOut-u9z9zRXH.js";import"./badge-Cosh8Jv6.js";import"./spinner-CCf2Lbex.js";import"./view-mode-toggle-PpUBwSzB.js";import"./dialog-CvJmXij7.js";import"./scroll-area-DjlF9Nhh.js";import"./index-DaTDomcZ.js";import"./hover-card-DyNloM84.js";import"./dropdown-menu-jK5-EocK.js";import"./Check-Rzhysg8v.js";import"./DotsVertical--nxfulT_.js";import"./Plus-BVt3gf6N.js";import"./Tool01-D6Ixmgxm.js";import"./XClose-dfaecXcF.js";import"./accordion-y8ERtqeD.js";import"./index-nS3rTKOQ.js";import"./create-sse-subscription-BS5983N4.js";import"./ChevronDown-DgAQraB9.js";import"./ChevronUp-D95kdAWS.js";import"./SwitchHorizontal01-CLmvgZdy.js";import"./RefreshCcw01-Do9uT8r5.js";import"./XCircle-gezQrKJB.js";import"./ArrowUpRight-BG7K2o4g.js";import"./ZapSquare-Doe97qp7.js";import"./Users03-C3j_vENk.js";import"./CheckCircle-ByVfCd_z.js";import"./ChevronLeft-hIkmA-06.js";import"./Globe01-CYJ5akFo.js";import"./FilterLines-lN6ZYEU6.js";import"./Star01-DinMZEQp.js";import"./Palette-CvBtCHX7.js";import"./HardDrive-Bi11tZlO.js";import"./Stars02-CovFPupV.js";import"./Key01-ETI9VuA0.js";import"./LinkExternal01-CMTN51kD.js";import"./Monitor01-B9COEs1V.js";import"./Sun-D5MzBxyK.js";import"./SearchMd-Ckbe6j0d.js";import"./Settings02-BFHOCA5h.js";import"./Shield01-ebA_Mmqa.js";import"./Stars01-cUHrtzm6.js";import"./Trash01-C6sXu2xm.js";import"./Upload01-DslYY_N3.js";import"./User01-9CJ-p7XF.js";import"./Users01-Ds5_zubO.js";import"./Zap-ZCJiHFB8.js";import"./extract-connection-data-uGXsWpo7.js";import"./generate-id-CnLzNGg6.js";import"./use-registry-connections-BFubWEDK.js";import"./use-organization-settings-DeuE04BS.js";import"./index-B2iHTL-o.js";import"./popover-00xsE00R.js";import"./use-create-virtual-mcp-DilrGBsI.js";import"./use-navigate-to-agent-B_6LJV9r.js";import"./tab-id-BNsa7AXA.js";import"./decopilot-sse-pool-DYhlxmFV.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-ai-providers-BUmRVTXM.js";import"./avatar-DiepLBEZ.js";import"./required-auth-layout-BTqABC6o.js";import"./useRouterState-mAFXQkAT.js";import"./use-org-sso-BTJacuR9.js";import"./index-Dw66yPMC.js";Ke({title:te().min(1),description:te().nullable(),body:te()});function ne(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Ot(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Rt(s){const e=C.c(13),{form:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let r;e[1]!==n.control?(r=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:n.control,name:"title",render:Ut}),t.jsx(se,{control:n.control,name:"description",render:Mt})]})]}),e[1]=n.control,e[2]=r):r=e[2];let i,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=a):(i=e[3],a=e[4]);let c;e[5]!==n.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,a,t.jsx(se,{control:n.control,name:"body",render:Dt})]}),e[5]=n.control,e[6]=c):c=e[6];let l;e[7]!==r||e[8]!==c?(l=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[r,c]}),e[7]=r,e[8]=c,e[9]=l):l=e[9];let p;return e[10]!==n||e[11]!==l?(p=t.jsx(et,{...n,children:l}),e[10]=n,e[11]=l,e[12]=p):p=e[12],p}function Dt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Mt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Ut(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function zt(s){const e=C.c(36),{providerId:n,promptId:o}=s,{org:r}=ie(),i=n||null;let a;e[0]!==r.id||e[1]!==r.slug||e[2]!==i?(a={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=i,e[3]=a):a=e[3];const c=ce(a),l=Ze(n,"PROMPT",o,c),p=Ee(n,"PROMPT",c),f=p.update.isPending;let u;e[4]!==l?(u=l?{title:l.title,description:l.description??null,body:ne(l)}:void 0,e[4]=l,e[5]=u):u=e[5];let h;e[6]!==u?(h={values:u},e[6]=u,e[7]=h):h=e[7];const N=Qe(h);let T;e[8]!==N||e[9]!==l?(T=()=>{l&&N.reset({title:l.title,description:l.description??null,body:ne(l)})},e[8]=N,e[9]=l,e[10]=T):T=e[10];const _=T;let A;e[11]!==p.update||e[12]!==N||e[13]!==o?(A=N.handleSubmit(async j=>{const P=await p.update.mutateAsync({id:o,data:{title:j.title,description:j.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:j.body}}]}});N.reset({title:P.title,description:P.description??null,body:ne(P)})}),e[11]=p.update,e[12]=N,e[13]=o,e[14]=A):A=e[14];const O=A;if(!l){let j;return e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=j):j=e[15],j}let y;e[16]!==l.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:l.title}),e[16]=l.title,e[17]=y):y=e[17];let k;e[18]!==l.description?(k=l.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:l.description})]}):null,e[18]=l.description,e[19]=k):k=e[19];let I;e[20]!==y||e[21]!==k?(I=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,k]})}),e[20]=y,e[21]=k,e[22]=I):I=e[22];let g;e[23]!==O?(g=()=>{O()},e[23]=O,e[24]=g):g=e[24];let v;e[25]!==N.formState.isDirty||e[26]!==f||e[27]!==_||e[28]!==g?(v=t.jsx(tt,{children:t.jsx(ot,{onSave:g,onUndo:_,isDirty:N.formState.isDirty,isSaving:f})}),e[25]=N.formState.isDirty,e[26]=f,e[27]=_,e[28]=g,e[29]=v):v=e[29];let S;e[30]!==N?(S=t.jsx("div",{className:"h-full",children:t.jsx(Rt,{form:N})}),e[30]=N,e[31]=S):S=e[31];let $;return e[32]!==v||e[33]!==S||e[34]!==I?($=t.jsxs(pe,{children:[I,v,S]}),e[32]=v,e[33]=S,e[34]=I,e[35]=$):$=e[35],$}function Bt(s){const e=C.c(4),{itemId:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Ot(),e[0]=o):o=e[0];const r=o;if(!r){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let i;return e[2]!==n?(i=t.jsx(Te,{children:t.jsx(w.Suspense,{fallback:null,children:t.jsx(zt,{providerId:r,promptId:n})})}),e[2]=n,e[3]=i):i=e[3],i}function Oe(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("min-w-0 overflow-hidden",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Re(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("ol",{"data-slot":"breadcrumb-list",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function V(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("inline-flex items-center gap-1.5 min-w-0",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("li",{"data-slot":"breadcrumb-item",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function G(s){const e=C.c(10);let n,o,r;e[0]!==s?({asChild:n,className:o,...r}=s,e[0]=s,e[1]=n,e[2]=o,e[3]=r):(n=e[1],o=e[2],r=e[3]);const i=n?Ge:"a";let a;e[4]!==o?(a=J("hover:text-foreground transition-colors truncate",o),e[4]=o,e[5]=a):a=e[5];let c;return e[6]!==i||e[7]!==r||e[8]!==a?(c=t.jsx(i,{"data-slot":"breadcrumb-link",className:a,...r}),e[6]=i,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("text-foreground font-medium truncate",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Y(s){const e=C.c(12);let n,o,r;e[0]!==s?({children:n,className:o,...r}=s,e[0]=s,e[1]=n,e[2]=o,e[3]=r):(n=e[1],o=e[2],r=e[3]);let i;e[4]!==o?(i=J("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",o),e[4]=o,e[5]=i):i=e[5];let a;e[6]!==n?(a=n??t.jsx(Nt,{}),e[6]=n,e[7]=a):a=e[7];let c;return e[8]!==r||e[9]!==i||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:i,...r,children:a}),e[8]=r,e[9]=i,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Lt(s){const e=C.c(11),{toolName:n,connectionId:o,siblings:r,onSelectInstance:i,onBack:a}=s;let c;e[0]!==o?(c={connectionId:o},e[0]=o,e[1]=c):c=e[1];const l=wt(c);if(!l.isAuthenticated){let u;return e[2]!==l.supportsOAuth||e[3]!==a?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?t.jsx(vt,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(St,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=a,e[4]=u):u=e[4],u}const p=`${o}:${n}`;let f;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==p||e[9]!==n?(f=t.jsx(Vt,{toolName:n,connectionId:o,siblings:r,onSelectInstance:i},p),e[5]=o,e[6]=i,e[7]=r,e[8]=p,e[9]=n,e[10]=f):f=e[10],f}function Vt({toolName:s,connectionId:e,siblings:n,onSelectInstance:o}){const{replayId:r}=Ye({strict:!1}),i=(()=>{if(!r)return null;const d=`replay-${r}`,m=sessionStorage.getItem(d);if(!m)return null;sessionStorage.removeItem(d);try{return JSON.parse(m)}catch{return null}})(),a=(()=>{if(!i)return null;const d={};for(const[m,b]of Object.entries(i))b!==null&&typeof b=="object"?d[m]=JSON.stringify(b,null,2):d[m]=b;return d})(),[c,l]=w.useState(a??{}),[p,f]=w.useState(i?JSON.stringify(i,null,2):"{}"),[u,h]=w.useState(null),[N,T]=w.useState(null),[_,A]=w.useState(null),[O,y]=w.useState(null),[k,I]=w.useState(!1),[g,v]=w.useState(null),{org:S}=ie(),$=_e(e),j=Tt(),P=kt(),{setChatOpen:z}=Pt(),M=`${e}:${s}`,R=ce({connectionId:e,orgId:S.id,orgSlug:S.slug}),U=It({client:R}),x=U.data?.tools?.find(d=>d.name===s),E=it(x?._meta),B=d=>{if(!j)return;const m=$t(d.content);m.content.length>0&&(z(!0),j.sendMessage({tiptapDoc:m}))},[D,X]=w.useState("json"),[Me,Ue]=w.useState(!1);E&&!Me&&(X("ui"),Ue(!0));const xe=x?.inputSchema?.properties,fe=xe?Object.keys(xe):[],q=fe.length>0,H={};if(q&&x?.inputSchema?.properties)for(const d of fe)H[d]=x.inputSchema.required?.includes(d)?"":void 0;const Z=d=>Object.prototype.hasOwnProperty.call(c,d),ze=async()=>{I(!0),y(null),h(null),T(null),A(null),v(null);const d=performance.now();try{if(!R)throw new Error("MCP client is not available");const m=q?{...H,...c}:(()=>{const F=p.trim();if(!F)return{};const L=JSON.parse(F);if(L&&typeof L=="object")return L;throw new Error("Raw JSON input must be an object.")})();q&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([F,L])=>{if((L.type==="object"||L.type==="array")&&typeof m[F]=="string")try{m[F]=JSON.parse(m[F])}catch{}});const b=await R.callTool({name:s,arguments:m}),K=b.structuredContent??b,qe=performance.now(),We=Math.round(qe-d);h(K),T(b),A(m);const He=JSON.stringify(K),ge=new TextEncoder().encode(He).length;v({duration:`${We}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const b=m instanceof Error?m.message:String(m);y(b||"Unknown error occurred");const K=performance.now();v({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{l(b=>({...b,[d]:m}))},Be=()=>{h(null),T(null),A(null),y(null),v(null)},Fe=x?.name??Ft(s),Le=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections",params:{org:S.slug},children:"Connections"})})}),t.jsx(Y,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections/$appSlug",params:{org:S.slug,appSlug:yt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(Y,{})]}),t.jsx(V,{children:t.jsx(De,{children:Fe})})]})}),he=n.length>1&&t.jsxs(be,{value:e,onValueChange:o,children:[t.jsx(Ne,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ve,{})}),t.jsx(Se,{children:n.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Ve=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),x?.inputSchema?.required&&x.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&x?.inputSchema?.properties?Object.entries(x.inputSchema.properties).map(([d,m])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,x.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:m.type})]}),m.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.description}),m.type==="object"||m.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):m.type==="boolean"?t.jsxs(be,{value:Z(d)?String(c[d]??""):"",onValueChange:b=>ee(d,b==="true"),children:[t.jsx(Ne,{children:t.jsx(ve,{placeholder:"Select true or false..."})}),t.jsxs(Se,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d}...`})]},d)):x?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:p,onChange:d=>f(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(W,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(pt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(W,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:ze,children:[t.jsx(bt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Je=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[g&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(xt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.duration})]}),g.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ft,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.tokens})]}),g.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ht,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.bytes})]}),g.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:g.cost})})]}),E&&t.jsx(mt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(W,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(gt,{size:14})})}),t.jsx(Ce,{children:"Interactive view"})]}),t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(W,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:"JSON view"})]})]})})]})]}),O&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(at,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{className:"h-4 w-4"}),t.jsx(ct,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(dt,{className:"text-xs text-destructive",children:O})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&R?t.jsx(w.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(lt,{resourceURI:E,toolInfo:x?{tool:x}:void 0,toolInput:_??void 0,toolResult:N??void 0,displayMode:"fullscreen",minHeight:je.view.minHeight,maxHeight:je.view.maxHeight,client:R,onMessage:B,onUpdateModelContext:d=>P?.setAppContext(M,d),onTeardown:()=>P?.clearAppContext(M),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(u,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(W,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(u,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(jt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(Ie,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(pe,{breadcrumb:Le,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx($e,{icon:$?.icon||null,name:$?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[U.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):U.isLoading?t.jsx(le,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:U.isSuccess?"ready":U.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:x?.annotations,_meta:x?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:x?.description||"No description available"})]}),n.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Ve}),Je]})})]})})}function Jt(s){const e=C.c(10),{itemId:n,siblings:o,onBack:r}=s,[i,a]=w.useState(o[0]?.id??"");let c;e[0]!==i||e[1]!==o?(c=o.find(h=>h.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=c):c=e[2];const l=c;if(!_e(l||void 0)||!l){let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=h):h=e[3],h}let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=f):f=e[4];let u;return e[5]!==l||e[6]!==r||e[7]!==o||e[8]!==n?(u=t.jsx(w.Suspense,{fallback:f,children:t.jsx(Lt,{toolName:n,connectionId:l,siblings:o,onSelectInstance:a,onBack:r})}),e[5]=l,e[6]=r,e[7]=o,e[8]=n,e[9]=u):u=e[9],u}const qt={workflow:rt,workflow_execution:nt,prompt:Bt};function Wt(){const s=C.c(9),e=ke();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const o=ae(n),r=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const a=Ae(i);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const l=c,p=Ht;let f;return s[5]!==l||s[6]!==r||s[7]!==a?(f=t.jsx(Jt,{itemId:r,siblings:a,onBack:l,onUpdate:p}),s[5]=l,s[6]=r,s[7]=a,s[8]=f):f=s[8],f}async function Ht(s){return Promise.resolve()}function Kt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=C.c(41),e=ke();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const o=ae(n),r=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:l}=ie();let p;s[3]!==o.appSlug?(p={slug:o.appSlug},s[3]=o.appSlug,s[4]=p):p=s[4];const u=Ae(p)[0]??null,h=u?.id??"",N=h||"no-connection",T=h??null;let _;s[5]!==l.id||s[6]!==l.slug||s[7]!==T?(_={connectionId:T,orgId:l.id,orgSlug:l.slug},s[5]=l.id,s[6]=l.slug,s[7]=T,s[8]=_):_=s[8];const A=ce(_),O=Ee(N,r,A);let y;s[9]!==O||s[10]!==i?(y=async D=>{i&&await O.update.mutateAsync({id:i,data:D})},s[9]=O,s[10]=i,s[11]=y):y=s[11];const k=y;let I;s[12]!==r?(I=r?.toLowerCase(),s[12]=r,s[13]=I):I=s[13];const g=I,v=g&&qt[g];let S;s[14]!==r?(S=Kt(r),s[14]=r,s[15]=S):S=s[15];const $=S;let j;s[16]!==l.slug?(j=t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections",params:{org:l.slug},children:"Connections"})})}),s[16]=l.slug,s[17]=j):j=s[17];let P;s[18]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Y,{}),s[18]=P):P=s[18];let z;s[19]!==r||s[20]!==u||s[21]!==l.slug||s[22]!==o.appSlug?(z=u&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(G,{asChild:!0,children:t.jsx(Q,{to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.appSlug},search:{tab:r},children:u.title})})}),t.jsx(Y,{})]}),s[19]=r,s[20]=u,s[21]=l.slug,s[22]=o.appSlug,s[23]=z):z=s[23];let M;s[24]!==$?(M=t.jsx(V,{children:t.jsx(De,{children:$})}),s[24]=$,s[25]=M):M=s[25];let R;s[26]!==z||s[27]!==M||s[28]!==j?(R=t.jsx(Oe,{children:t.jsxs(Re,{children:[j,P,z,M]})}),s[26]=z,s[27]=M,s[28]=j,s[29]=R):R=s[29];const U=R;if(v){let D;return s[30]!==v||s[31]!==c||s[32]!==k||s[33]!==i?(D=t.jsx(v,{itemId:i,onBack:c,onUpdate:k}),s[30]=v,s[31]=c,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let x;s[35]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=x):x=s[35];let E;s[36]!==c?(E=t.jsx(_t,{icon:x,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=E):E=s[37];let B;return s[38]!==U||s[39]!==E?(B=t.jsx(pe,{breadcrumb:U,children:E}),s[38]=U,s[39]=E,s[40]=B):B=s[40],B}function Gt(){const s=C.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const n=ae(e);if(decodeURIComponent(n.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Wt,{}),s[1]=a):a=s[1],a}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{}),s[2]=i):i=s[2],i}function Ko(){const s=C.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Te,{children:t.jsx(w.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Ko as default};
@@ -1 +0,0 @@
1
- import{e as P,r as T,q as A,G as _,a as B,j as s,B as L,K as z,o as K}from"./index-RoHcRkq0.js";import{c as Y,e as q,b as F,a as M,D as O}from"./dialog-CvJmXij7.js";import{S as R}from"./spinner-CCf2Lbex.js";import{i as Q}from"./Check-Rzhysg8v.js";import{a as $}from"./Eye-0u1NnyPn.js";import{S as G,u as H}from"./constants-DDZG6Edw.js";import{u as W}from"./chat-context-7nRfVaxU.js";const E="bunx decocms link",v={"claude-code":"Claude Code",codex:"Codex"};function w(n){return n.map(e=>v[e]).filter(e=>!!e)}function N(n){return Object.keys(v).filter(e=>!n.includes(e)).map(e=>v[e]).filter(e=>!!e)}function ie(n){const e=P.c(35),{open:h,onOpenChange:j}=n,t=W(),[C,y]=T.useState(!1),{org:i}=A(),k=_();let x;e[0]!==i.id||e[1]!==i.slug?(x={connectionId:G,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=x):x=e[2];const b=H(x);let o;e[3]!==b?(o=async()=>{const S=await b.callTool({name:"LINK_DISCONNECT",arguments:{}});if(S?.isError)throw new Error(S.content?.[0]?.text??"Failed to disconnect desktop")},e[3]=b,e[4]=o):o=e[4];let a;e[5]!==i.id||e[6]!==k?(a=()=>{k.invalidateQueries({queryKey:z.currentLink(i.id)})},e[5]=i.id,e[6]=k,e[7]=a):a=e[7];let f;e[8]!==o||e[9]!==a?(f={mutationFn:o,onSuccess:a,onError:J},e[8]=o,e[9]=a,e[10]=f):f=e[10];const p=B(f),D=t.online?"Desktop connected":"Connect your desktop";let l;e[11]!==D?(l=s.jsx(Y,{children:D}),e[11]=D,e[12]=l):l=e[12];const I=t.online?"Your desktop is online. Pick a desktop agent in the chat to use it.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[13]!==I?(r=s.jsx(q,{children:I}),e[13]=I,e[14]=r):r=e[14];let c;e[15]!==l||e[16]!==r?(c=s.jsxs(F,{children:[l,r]}),e[15]=l,e[16]=r,e[17]=c):c=e[17];let d;e[18]!==C||e[19]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:E}),s.jsx(L,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(E),y(!0),setTimeout(()=>y(!1),1500)},children:C?s.jsx(Q,{size:14}):s.jsx($,{size:14})})]}),e[18]=C,e[19]=t.online,e[20]=d):d=e[20];let m;e[21]!==p||e[22]!==t.capabilities||e[23]!==t.hostname||e[24]!==t.machineId||e[25]!==t.online?(m=t.online?s.jsxs("div",{className:"flex flex-col gap-1 text-sm",children:[s.jsxs("p",{className:"text-foreground",children:[t.hostname??t.machineId??"Your desktop"," is linked."]}),w(t.capabilities).length>0&&s.jsxs("p",{className:"text-muted-foreground",children:["Available: ",w(t.capabilities).join(", ")]}),N(t.capabilities).length>0&&s.jsxs("p",{className:"text-muted-foreground",children:[N(t.capabilities).join(" and ")," ",N(t.capabilities).length>1?"were":"was"," ","not detected on this desktop. Install the CLI and sign in there — it appears here automatically within a minute."]}),s.jsx("div",{className:"flex justify-end pt-2",children:s.jsx(L,{type:"button",variant:"outline",size:"sm",disabled:p.isPending,onClick:()=>p.mutate(),className:"text-destructive hover:text-destructive",children:p.isPending?"Disconnecting…":"Disconnect desktop"})})]}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(R,{size:"sm"}),"Waiting for desktop…"]}),e[21]=p,e[22]=t.capabilities,e[23]=t.hostname,e[24]=t.machineId,e[25]=t.online,e[26]=m):m=e[26];let u;e[27]!==d||e[28]!==m||e[29]!==c?(u=s.jsxs(M,{className:"sm:max-w-md",children:[c,d,m]}),e[27]=d,e[28]=m,e[29]=c,e[30]=u):u=e[30];let g;return e[31]!==j||e[32]!==h||e[33]!==u?(g=s.jsx(O,{open:h,onOpenChange:j,children:u}),e[31]=j,e[32]=h,e[33]=u,e[34]=g):g=e[34],g}function J(n){K.error(`Disconnect failed: ${n.message}`)}export{ie as C,w as v};
@@ -1 +0,0 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,q as $,b6 as k,K as D,c as E,j as x}from"./index-RoHcRkq0.js";import{u as K}from"./use-registry-connections-BFubWEDK.js";import{b as Q}from"./use-organization-settings-DeuE04BS.js";import{S as w,c as q}from"./constants-DDZG6Edw.js";import{u as F}from"./useInfiniteQuery-FaewV0Uc.js";import{i as H,f as G}from"./extract-connection-data-uGXsWpo7.js";import{C as U}from"./card-B2dT-2ts.js";import{I as V}from"./integration-icon-BOg4uSLi.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=F({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await q({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};