decocms 3.73.1 → 3.74.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/dist/client/assets/{AlertCircle-DMqR3m0L.js → AlertCircle-CqOVaXci.js} +1 -1
  2. package/dist/client/assets/ArrowRight-CTyWXakV.js +1 -0
  3. package/dist/client/assets/{ArrowUpRight-DeYzuaJ8.js → ArrowUpRight-xZqz95CV.js} +1 -1
  4. package/dist/client/assets/Check-CBlc59JS.js +1 -0
  5. package/dist/client/assets/{CheckCircle-D6b8lFUP.js → CheckCircle-CY28HM-W.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-CYFvWHpZ.js → ChevronDown-2DYEh3oE.js} +1 -1
  7. package/dist/client/assets/{ChevronLeft-DXSAgzPw.js → ChevronLeft-B75Dfp8F.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-Dj41DV2U.js → ChevronRight-ax97YKuz.js} +1 -1
  9. package/dist/client/assets/ChevronUp-g-p4yrQF.js +1 -0
  10. package/dist/client/assets/{DotsVertical-y5lMfVOQ.js → DotsVertical-DRQxhuxE.js} +1 -1
  11. package/dist/client/assets/{Eye-D3THRXh6.js → Eye-Bxan3Sqa.js} +1 -1
  12. package/dist/client/assets/{FilterLines-BPeCeYIz.js → FilterLines-DglSMqXL.js} +1 -1
  13. package/dist/client/assets/{Globe01-BquIL2vg.js → Globe01-C4v1tUFc.js} +1 -1
  14. package/dist/client/assets/{Globe04-BBRZWdJY.js → Globe04-uuqaZSXc.js} +1 -1
  15. package/dist/client/assets/{HardDrive-DmtpWveq.js → HardDrive-BNcT29uK.js} +1 -1
  16. package/dist/client/assets/{Key01-Lcx9qTy7.js → Key01-dy7oLiQz.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-CkiSxkS_.js → LayoutLeft-C7Cwg5dB.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-jwO28Eeb.js → LinkExternal01-Bxjblrw6.js} +1 -1
  19. package/dist/client/assets/{Monitor01-L6hrk62b.js → Monitor01-gDDtOZYE.js} +1 -1
  20. package/dist/client/assets/{Palette-ClNyQOQA.js → Palette-CmP2nXkm.js} +1 -1
  21. package/dist/client/assets/{Play-C6QgiUls.js → Play-DR1SFBmJ.js} +1 -1
  22. package/dist/client/assets/{Plus-_82_8sq8.js → Plus-41YUU3X4.js} +1 -1
  23. package/dist/client/assets/{SearchMd-C3Pmxf99.js → SearchMd-kFyk-Zpn.js} +1 -1
  24. package/dist/client/assets/{Settings02-B7hO-Tma.js → Settings02-BQvb6NDs.js} +1 -1
  25. package/dist/client/assets/{Shield01-RDE62wRx.js → Shield01-CwXJTWO7.js} +1 -1
  26. package/dist/client/assets/{Star01-BfSEPDRT.js → Star01-DmOmdDYT.js} +1 -1
  27. package/dist/client/assets/{Stars01-W6Wl0Pse.js → Stars01-DY8Z1eLP.js} +1 -1
  28. package/dist/client/assets/{Stars02-9vF61uFx.js → Stars02-RZSAG7rn.js} +1 -1
  29. package/dist/client/assets/{Sun-BxuJFhF6.js → Sun-DqCoPTzZ.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-yw5VS97V.js → SwitchHorizontal01-B6awNCuJ.js} +1 -1
  31. package/dist/client/assets/{Tool01-B4SsemMS.js → Tool01-YzuqPBZS.js} +1 -1
  32. package/dist/client/assets/{Trash01-CG0gTYx7.js → Trash01-xhyzjxAl.js} +1 -1
  33. package/dist/client/assets/{Upload01-BlvGy5d-.js → Upload01-Dz2Fe5CV.js} +1 -1
  34. package/dist/client/assets/{User01-CTuKNCEa.js → User01-pnGUlp6P.js} +1 -1
  35. package/dist/client/assets/{Users01-KXiCgru2.js → Users01-D6UupxJE.js} +1 -1
  36. package/dist/client/assets/{Users03-BOvyNEV4.js → Users03-DJchxrNl.js} +1 -1
  37. package/dist/client/assets/{X-CKIhVHQk.js → X-RMAI-CnD.js} +1 -1
  38. package/dist/client/assets/XCircle-C_zOOXjw.js +1 -0
  39. package/dist/client/assets/{XClose-Ig7y9gcI.js → XClose-CL72OyYw.js} +1 -1
  40. package/dist/client/assets/{Zap-w60sxAoc.js → Zap-T1H5BLPl.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-C7yt7KfQ.js → ZapSquare-DI8RUlXz.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-DVSwpwUz.js → ZoomOut-BSvbLjMK.js} +1 -1
  43. package/dist/client/assets/{access-gate-CEtgmlCt.js → access-gate-DstBDFIb.js} +1 -1
  44. package/dist/client/assets/add-section-modal-DBrqHaz_.js +1 -0
  45. package/dist/client/assets/agent-icon-DTdfxhoG.js +1 -0
  46. package/dist/client/assets/agents-list-D0eHoQaW.js +1 -0
  47. package/dist/client/assets/ai-providers-c7kYb7as.js +1 -0
  48. package/dist/client/assets/{alert-dialog-BuJSufuR.js → alert-dialog-DN5_Bt7m.js} +3 -3
  49. package/dist/client/assets/{alert-DIqgQstn.js → alert-waKnXqGk.js} +1 -1
  50. package/dist/client/assets/app-editor-CjIo2G2v.js +1 -0
  51. package/dist/client/assets/{auth-tkqpBHf1.js → auth-D-vZuhvw.js} +1 -1
  52. package/dist/client/assets/{auth-catchall-CHUZWWSw.js → auth-catchall-CSqcjejU.js} +1 -1
  53. package/dist/client/assets/auth-entry-DQ7yt2AO.js +1 -0
  54. package/dist/client/assets/{auth-split-layout-DRR0KEkj.js → auth-split-layout-B5a3UwoJ.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-40GibzkL.js → automation-list-row-D-BX02uH.js} +1 -1
  56. package/dist/client/assets/{automation-runs-BEntIYkJ.js → automation-runs-B1BUJ0hr.js} +1 -1
  57. package/dist/client/assets/automations-BNbMRDB2.js +1 -0
  58. package/dist/client/assets/{avatar-DfTXVgX9.js → avatar-BSTZ3pLJ.js} +1 -1
  59. package/dist/client/assets/backoff-CrEUbyZT.js +1 -0
  60. package/dist/client/assets/{badge-an9iff2c.js → badge-C-FrgWTB.js} +1 -1
  61. package/dist/client/assets/{block-document-DZEmtfok.js → block-document-tkHTmk1o.js} +1 -1
  62. package/dist/client/assets/{brand-context-BhD6vM0G.js → brand-context-DTdKKUc_.js} +1 -1
  63. package/dist/client/assets/buckets-Buf4MXLa.js +1 -0
  64. package/dist/client/assets/{calendar-tEWC6_XV.js → calendar-0PXqzC_Y.js} +1 -1
  65. package/dist/client/assets/{capability-load-error-BXEh1mp-.js → capability-load-error-aingpVqh.js} +1 -1
  66. package/dist/client/assets/{card-Ckx3Kwvj.js → card-DWaNR_SK.js} +1 -1
  67. package/dist/client/assets/category-editor-Dp8tqW7w.js +1 -0
  68. package/dist/client/assets/chat-context-Bdh5JOoc.js +21 -0
  69. package/dist/client/assets/checkbox-DATFo6mV.js +1 -0
  70. package/dist/client/assets/{cli-auth-success-DWLJa27h.js → cli-auth-success-Q9j8LqnR.js} +1 -1
  71. package/dist/client/assets/collection-detail--PV4VgNS.js +1 -0
  72. package/dist/client/assets/collection-display-button-D2Dz4UQ9.js +1 -0
  73. package/dist/client/assets/{collection-search-CCzYANV5.js → collection-search-B3PCp0sJ.js} +1 -1
  74. package/dist/client/assets/{collection-tabs-CBstOc4r.js → collection-tabs-B5bp1dvV.js} +1 -1
  75. package/dist/client/assets/{command-pIEd50-L.js → command-BKUAhUTA.js} +1 -1
  76. package/dist/client/assets/commerce-onboarding-DQThXa88.js +1 -0
  77. package/dist/client/assets/connect-desktop-dialog-ueZU4yr9.js +1 -0
  78. package/dist/client/assets/{connection-card-CqvtHNnU.js → connection-card-D6eF5jM2.js} +1 -1
  79. package/dist/client/assets/connection-detail-YrkoweOb.js +1 -0
  80. package/dist/client/assets/{connection-form-helpers-ByFrPc9N.js → connection-form-helpers-yM5F39cE.js} +1 -1
  81. package/dist/client/assets/connections-Co0mzlVI.js +1 -0
  82. package/dist/client/assets/context-menu-rnym8CLu.js +1 -0
  83. package/dist/client/assets/{decopilot-D6xQ1qh2.js → decopilot-CR1kdCz1.js} +1 -1
  84. package/dist/client/assets/decopilot-sse-pool-CznG8mAO.js +1 -0
  85. package/dist/client/assets/delay-CnY5UFtP.js +1 -0
  86. package/dist/client/assets/dialog-D5b28yFH.js +1 -0
  87. package/dist/client/assets/{domain-settings-DIU6G_-3.js → domain-settings-0tGbevEe.js} +1 -1
  88. package/dist/client/assets/drawer-ColE1TJK.js +1 -0
  89. package/dist/client/assets/dropdown-menu-DYoIlQSg.js +1 -0
  90. package/dist/client/assets/{empty-state-BrSxZrfZ.js → empty-state-DHarvDyS.js} +1 -1
  91. package/dist/client/assets/{extract-connection-data-CBzjCfJ2.js → extract-connection-data-uuFWP3hz.js} +1 -1
  92. package/dist/client/assets/file-explorer-B808VENL.js +2 -0
  93. package/dist/client/assets/{file-type-icon-BOPDPlds.js → file-type-icon-DEvi9B1o.js} +1 -1
  94. package/dist/client/assets/{files-cbAPSaRo.js → files-CWeUPbcm.js} +1 -1
  95. package/dist/client/assets/{form-BZY9ZRz4.js → form-BKLsYVOj.js} +1 -1
  96. package/dist/client/assets/general-Drmz-YIR.js +1 -0
  97. package/dist/client/assets/{github-repo-picker-CrW8szfE.js → github-repo-picker-D5sPE9uB.js} +1 -1
  98. package/dist/client/assets/{hooks-DLdyjUhZ.js → hooks-Bb_hjVv2.js} +6 -6
  99. package/dist/client/assets/image-field-1axHkRyS.js +1 -0
  100. package/dist/client/assets/{import-from-deco-dialog-BVpWCCC9.js → import-from-deco-dialog-C8-Pf8Mw.js} +2 -2
  101. package/dist/client/assets/{index-CqHy6432.js → index-BJGyjJJt.js} +10 -10
  102. package/dist/client/assets/index-BolisCRq.js +1 -0
  103. package/dist/client/assets/{index-BQXvSs-s.js → index-CUKe_k5H.js} +3 -3
  104. package/dist/client/assets/{index-WHuW26DU.js → index-CXYNhsAc.js} +12 -12
  105. package/dist/client/assets/{index-BBz_54sx.js → index-CjzKLlWA.js} +1 -1
  106. package/dist/client/assets/{index-DexxTctJ.js → index-D972QGLJ.js} +1 -1
  107. package/dist/client/assets/{index-C3Ab2DJ2.js → index-D9IK491L.js} +29 -29
  108. package/dist/client/assets/{index-CszBxeF9.js → index-DCgPZCHy.js} +1 -1
  109. package/dist/client/assets/index-DTxciPdS.js +1 -0
  110. package/dist/client/assets/{index-xsAZnQ1t.js → index-DjKTb3Jx.js} +1 -1
  111. package/dist/client/assets/{index-BwhwNs2D.js → index-Dmymcqqe.js} +4 -4
  112. package/dist/client/assets/{index-CE8AoMpS.js → index-DuzF9uKh.js} +1 -1
  113. package/dist/client/assets/{index-BY2TC4bG.js → index-dhnE5w8d.js} +2 -2
  114. package/dist/client/assets/{index-C4w1u5Cz.js → index-nU2ktNYZ.js} +1 -1
  115. package/dist/client/assets/{index-redirect-DHc9uFFV.js → index-redirect-CbKHrvpG.js} +1 -1
  116. package/dist/client/assets/{input-BmmiCY6T.js → input-B9q8KV4F.js} +1 -1
  117. package/dist/client/assets/{integration-icon-CFvT6ZpF.js → integration-icon-BVY3nW43.js} +1 -1
  118. package/dist/client/assets/label-x3YhPSqt.js +1 -0
  119. package/dist/client/assets/login-DJq6zJkS.js +1 -0
  120. package/dist/client/assets/{mcp-oauth-BGmk7Mi5.js → mcp-oauth-HIYUmIS7.js} +1 -1
  121. package/dist/client/assets/{members-DO2LVAyy.js → members-CEIQEz29.js} +2 -2
  122. package/dist/client/assets/{monaco-editor-yw8USVwR.js → monaco-editor-DQsadrcR.js} +1 -1
  123. package/dist/client/assets/{monitoring-stats-row-BuR-EBQ0.js → monitoring-stats-row-XQSX37Es.js} +1 -1
  124. package/dist/client/assets/{oauth-callback-wtZvQiOu.js → oauth-callback-BHYoQdej.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-ai-provider-17H-B-SW.js → oauth-callback-ai-provider-BQxMDjkd.js} +1 -1
  126. package/dist/client/assets/onboarding-YBSFHrWd.js +1 -0
  127. package/dist/client/assets/{org-install-e7rNwps-.js → org-install-BYuosPdC.js} +1 -1
  128. package/dist/client/assets/org-layout-MRzgibsh.js +1 -0
  129. package/dist/client/assets/organization-choice-CapZcYtV.js +1 -0
  130. package/dist/client/assets/{page-seo-form-BgMsVAcV.js → page-seo-form-CqZfv8X_.js} +1 -1
  131. package/dist/client/assets/page-seo-sheet-DtnjMpuE.js +1 -0
  132. package/dist/client/assets/popover-BzQ5wL7A.js +1 -0
  133. package/dist/client/assets/post-editor-CTE-wZis.js +1 -0
  134. package/dist/client/assets/preview-dialog-BueN40wX.js +5 -0
  135. package/dist/client/assets/{primitives-BcfJna5s.js → primitives-CKy26jWq.js} +1 -1
  136. package/dist/client/assets/profile-DChufnnG.js +1 -0
  137. package/dist/client/assets/project-app-view-CkSSi0TS.js +1 -0
  138. package/dist/client/assets/record-editor-CbsS0IVi.js +1 -0
  139. package/dist/client/assets/registry-DK3Q5gX_.js +2 -0
  140. package/dist/client/assets/{registry-layout-t_GwGR-W.js → registry-layout-CodfYx2r.js} +4 -4
  141. package/dist/client/assets/require-capability-DwLm9QUw.js +1 -0
  142. package/dist/client/assets/required-auth-layout-CyLg9iYq.js +1 -0
  143. package/dist/client/assets/{reset-password-CPoVJQh2.js → reset-password-DMNx-Vj9.js} +1 -1
  144. package/dist/client/assets/roles-CJZwr85B.js +1 -0
  145. package/dist/client/assets/save-referenced-block-BuKB-TPt.js +1 -0
  146. package/dist/client/assets/save-status-Odb6tzfv.js +1 -0
  147. package/dist/client/assets/{schema-form-D8_e7uDj.js → schema-form-CJ9tFDNN.js} +1 -1
  148. package/dist/client/assets/{scroll-area-DwqNfKe5.js → scroll-area-CijwgfU1.js} +7 -7
  149. package/dist/client/assets/{search-input-DjHO_xeh.js → search-input-BSp_OQdj.js} +1 -1
  150. package/dist/client/assets/secrets-BbqOZ3Gn.js +1 -0
  151. package/dist/client/assets/sections-editor-CyLQRlzi.js +2 -0
  152. package/dist/client/assets/select-BTavF8g-.js +1 -0
  153. package/dist/client/assets/{select-model-4ZBcZdkE.js → select-model-CYUBV6FP.js} +1 -1
  154. package/dist/client/assets/seo-editor-DsbALoze.js +1 -0
  155. package/dist/client/assets/settings-layout-kO_j7afz.js +1 -0
  156. package/dist/client/assets/{settings-section-Dxa_AxFP.js → settings-section-nTIyismy.js} +1 -1
  157. package/dist/client/assets/{sheet-COdJ-0Qy.js → sheet-Be7nx13S.js} +1 -1
  158. package/dist/client/assets/shell-controls-BdoUGZ5s.js +1 -0
  159. package/dist/client/assets/shell-layout-Ceh14jWF.js +1 -0
  160. package/dist/client/assets/shell-route-loading-COgnRrgS.js +1 -0
  161. package/dist/client/assets/{sidebar-DCgpgzJu.js → sidebar-aqkJk02H.js} +1 -1
  162. package/dist/client/assets/skeleton-BZA1ydJ5.js +1 -0
  163. package/dist/client/assets/{sortable.esm-LmSoSdxy.js → sortable.esm-3Eb-EVuH.js} +1 -1
  164. package/dist/client/assets/sso-T9-I0dOY.js +1 -0
  165. package/dist/client/assets/{store-Dj11zgxF.js → store-hSXqoJiA.js} +1 -1
  166. package/dist/client/assets/store-registry-CO5po8Ys.js +2 -0
  167. package/dist/client/assets/studio-tools-BThbo34U.js +1 -0
  168. package/dist/client/assets/switch-ChNCbD78.js +1 -0
  169. package/dist/client/assets/table-DyhJ_N7y.js +1 -0
  170. package/dist/client/assets/{tabs-BcUIMPwc.js → tabs-CEcgElcv.js} +1 -1
  171. package/dist/client/assets/{task-status-BfQltC__.js → task-status-BrIZavAZ.js} +1 -1
  172. package/dist/client/assets/textarea-CnG5GolZ.js +1 -0
  173. package/dist/client/assets/{toggle-group-Cp4C3_lM.js → toggle-group-88j9eFgy.js} +1 -1
  174. package/dist/client/assets/{toolbar-DyjTkAru.js → toolbar-tWfkybln.js} +1 -1
  175. package/dist/client/assets/tooltip-DVqOmAgj.js +1 -0
  176. package/dist/client/assets/{types-7ak1Ve40.js → types-Azj4SL2T.js} +1 -1
  177. package/dist/client/assets/{use-ai-providers-CC3uGtbf.js → use-ai-providers-D3K1IBXP.js} +1 -1
  178. package/dist/client/assets/{use-automations-D2hKtMe8.js → use-automations-CJcYBYig.js} +1 -1
  179. package/dist/client/assets/use-capability-t8jcbJQc.js +1 -0
  180. package/dist/client/assets/{use-clock-tick-SbPzFjh0.js → use-clock-tick-GkLlDe0y.js} +1 -1
  181. package/dist/client/assets/{use-collections-DrlB7sAG.js → use-collections-Bau2O-hk.js} +1 -1
  182. package/dist/client/assets/use-connection-nkWhshyI.js +1 -0
  183. package/dist/client/assets/use-copy-BQ6cLTdv.js +1 -0
  184. package/dist/client/assets/use-create-virtual-mcp-YKgnWL2r.js +1 -0
  185. package/dist/client/assets/{use-debounced-autosave-C4B5942u.js → use-debounced-autosave-BwtEh4oP.js} +1 -1
  186. package/dist/client/assets/use-deco-credits-DlEQB-Si.js +1 -0
  187. package/dist/client/assets/{use-delete-connection-C_lUSAxo.js → use-delete-connection-BJMhiTgm.js} +1 -1
  188. package/dist/client/assets/use-file-configs-JZp3bWtX.js +1 -0
  189. package/dist/client/assets/{use-infinite-scroll-CaTJY2LS.js → use-infinite-scroll-DwZozWFz.js} +1 -1
  190. package/dist/client/assets/{use-join-requests-Bf6--Yng.js → use-join-requests-8ZuovDfH.js} +1 -1
  191. package/dist/client/assets/use-mcp-client-RiDQVGqe.js +10 -0
  192. package/dist/client/assets/{use-mcp-prompts-5xEBY9_7.js → use-mcp-prompts-_xCjRWbU.js} +1 -1
  193. package/dist/client/assets/{use-mcp-tools-CYtQa-6Z.js → use-mcp-tools-DdnF4WnM.js} +1 -1
  194. package/dist/client/assets/{use-members-BWyLHt4a.js → use-members-CL8wIDhY.js} +1 -1
  195. package/dist/client/assets/use-navigate-to-agent-Dxf_z3z_.js +1 -0
  196. package/dist/client/assets/{use-org-auth-client-Blpkj8FB.js → use-org-auth-client-BB07oHZb.js} +1 -1
  197. package/dist/client/assets/{use-org-sso-CEQ82hSZ.js → use-org-sso-BlwxfZ0b.js} +1 -1
  198. package/dist/client/assets/{use-organization-roles-lBgqu0F4.js → use-organization-roles-DiyfHPtd.js} +1 -1
  199. package/dist/client/assets/use-organization-settings-DKT8xIyC.js +1 -0
  200. package/dist/client/assets/{use-registry-connections-CK9xDmAR.js → use-registry-connections-DCqUfQJj.js} +1 -1
  201. package/dist/client/assets/use-secrets-CPbnjha6.js +1 -0
  202. package/dist/client/assets/{use-status-sounds-C5Tq4YPI.js → use-status-sounds-BUy3GUGM.js} +1 -1
  203. package/dist/client/assets/{use-view-mode-Dz9A7efZ.js → use-view-mode-WOpiEgc-.js} +1 -1
  204. package/dist/client/assets/{use-virtual-mcp-Bc7GdFZa.js → use-virtual-mcp-DY0FqgMd.js} +1 -1
  205. package/dist/client/assets/useInfiniteQuery-GAIa3lI8.js +1 -0
  206. package/dist/client/assets/useSuspenseInfiniteQuery-CB85USQy.js +1 -0
  207. package/dist/client/assets/variant-calendar-f-5HkKFU.js +1 -0
  208. package/dist/client/assets/view-mode-toggle-DIP0BMUY.js +1 -0
  209. package/dist/client/index.html +1 -1
  210. package/dist/server/cli.js +509 -506
  211. package/dist/server/server.js +318 -318
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronUp-CiXMtnii.js +0 -1
  214. package/dist/client/assets/XCircle-DRGwo6Em.js +0 -1
  215. package/dist/client/assets/add-section-modal-CwlL6ayr.js +0 -1
  216. package/dist/client/assets/agent-icon-D5EbntAT.js +0 -1
  217. package/dist/client/assets/agents-list-DOj0Fh6v.js +0 -1
  218. package/dist/client/assets/ai-providers-D2FalLjO.js +0 -1
  219. package/dist/client/assets/app-editor-DH47BAx3.js +0 -1
  220. package/dist/client/assets/automations-C8R4Fvhm.js +0 -1
  221. package/dist/client/assets/buckets-BNXQ-vfY.js +0 -1
  222. package/dist/client/assets/category-editor-511TL03p.js +0 -1
  223. package/dist/client/assets/chat-context-BNtznWGC.js +0 -21
  224. package/dist/client/assets/checkbox-I3IyJWnj.js +0 -1
  225. package/dist/client/assets/collection-detail-CqdkHGGR.js +0 -1
  226. package/dist/client/assets/collection-display-button-C3NMWQ0u.js +0 -1
  227. package/dist/client/assets/connect-desktop-dialog-BgIjMJ8k.js +0 -1
  228. package/dist/client/assets/connection-detail-BljhUTi8.js +0 -1
  229. package/dist/client/assets/connections-BxfE7CNZ.js +0 -1
  230. package/dist/client/assets/context-menu-CUB1yHM7.js +0 -1
  231. package/dist/client/assets/decopilot-sse-pool-BkzSWgw-.js +0 -1
  232. package/dist/client/assets/dialog-CyIn0DRx.js +0 -1
  233. package/dist/client/assets/drawer-DFg9xgM4.js +0 -1
  234. package/dist/client/assets/dropdown-menu-kPcoeCiJ.js +0 -1
  235. package/dist/client/assets/file-explorer-DqjZVlFC.js +0 -2
  236. package/dist/client/assets/general-DiEcrxnP.js +0 -1
  237. package/dist/client/assets/image-field-CodUWKZv.js +0 -1
  238. package/dist/client/assets/index-CE5zniob.js +0 -1
  239. package/dist/client/assets/index-DCOB_mfs.js +0 -1
  240. package/dist/client/assets/label-DitP_QKf.js +0 -1
  241. package/dist/client/assets/login-B5Epw0z9.js +0 -1
  242. package/dist/client/assets/onboarding-BoQhKI2i.js +0 -1
  243. package/dist/client/assets/org-layout-BMfkaVCj.js +0 -1
  244. package/dist/client/assets/page-seo-sheet-DeiY4L_a.js +0 -1
  245. package/dist/client/assets/popover-BcAFMnrn.js +0 -1
  246. package/dist/client/assets/post-editor-B7uc8ZWG.js +0 -1
  247. package/dist/client/assets/preview-dialog-CWq_MXwm.js +0 -5
  248. package/dist/client/assets/profile-D0fa1gEu.js +0 -1
  249. package/dist/client/assets/project-app-view-CXpwRwLv.js +0 -1
  250. package/dist/client/assets/record-editor-Ct33qGpE.js +0 -1
  251. package/dist/client/assets/registry-BIqKm9sP.js +0 -2
  252. package/dist/client/assets/require-capability-CoJVffIR.js +0 -1
  253. package/dist/client/assets/required-auth-layout-B3CS-pLH.js +0 -1
  254. package/dist/client/assets/roles-Kqs8iopc.js +0 -1
  255. package/dist/client/assets/save-referenced-block-rb2uyE9z.js +0 -1
  256. package/dist/client/assets/save-status-C9PbQUEN.js +0 -1
  257. package/dist/client/assets/secrets-Dlj_raMe.js +0 -1
  258. package/dist/client/assets/sections-editor-D8YHUjur.js +0 -2
  259. package/dist/client/assets/select-Di6xzzYo.js +0 -1
  260. package/dist/client/assets/seo-editor-C9cdDir2.js +0 -1
  261. package/dist/client/assets/settings-layout-DR15Rbl6.js +0 -1
  262. package/dist/client/assets/shell-controls-Cw8j2a_F.js +0 -1
  263. package/dist/client/assets/shell-layout-DmxTk-Cg.js +0 -1
  264. package/dist/client/assets/shell-route-loading-DW_liPbt.js +0 -1
  265. package/dist/client/assets/skeleton-CZ9pOveV.js +0 -1
  266. package/dist/client/assets/sso-BJQWPrvg.js +0 -1
  267. package/dist/client/assets/store-registry-BXdj_bIJ.js +0 -2
  268. package/dist/client/assets/studio-tools-DRut7Wwk.js +0 -1
  269. package/dist/client/assets/switch-sHkW6RUp.js +0 -1
  270. package/dist/client/assets/table-BUxYcsuG.js +0 -1
  271. package/dist/client/assets/textarea-D8B22gmM.js +0 -1
  272. package/dist/client/assets/tooltip-2IhfImXT.js +0 -1
  273. package/dist/client/assets/use-capability-CU6DCnG3.js +0 -1
  274. package/dist/client/assets/use-connection-Dffadu_t.js +0 -1
  275. package/dist/client/assets/use-copy-Btaqep1K.js +0 -1
  276. package/dist/client/assets/use-create-virtual-mcp-D6wTKoFC.js +0 -1
  277. package/dist/client/assets/use-deco-credits-16Jb7c03.js +0 -1
  278. package/dist/client/assets/use-file-configs-qOKR17qO.js +0 -1
  279. package/dist/client/assets/use-mcp-client-BdKIOTso.js +0 -10
  280. package/dist/client/assets/use-navigate-to-agent-BTMo9com.js +0 -1
  281. package/dist/client/assets/use-organization-settings--a-kmsBC.js +0 -1
  282. package/dist/client/assets/use-secrets-B008jqWi.js +0 -1
  283. package/dist/client/assets/useInfiniteQuery-Ca6dlOLl.js +0 -1
  284. package/dist/client/assets/useRouterState-DgLuS94C.js +0 -1
  285. package/dist/client/assets/useSuspenseInfiniteQuery-CZbIaY66.js +0 -1
  286. package/dist/client/assets/variant-calendar-DgzKgoL6.js +0 -1
  287. package/dist/client/assets/view-mode-toggle-Cc6sYskX.js +0 -1
@@ -1 +0,0 @@
1
- import{r as E,e as ie,j as t,a1 as tt,l as le,p as ke,f as De,d as nt,b as we,u as st,o as ot,a2 as it,x as rt,w as at,B as U,t as ne,F as ct,c as de,n as X,K as lt}from"./index-C3Ab2DJ2.js";import{g as dt,a as Ae,b as ut,e as mt}from"./extract-connection-data-CBzjCfJ2.js";import{C as pt}from"./collection-display-button-C3NMWQ0u.js";import{S as ht}from"./search-input-DjHO_xeh.js";import{C as gt}from"./collection-tabs-CBstOc4r.js";import{u as xt,a as Te,g as ft,C as ve}from"./connection-card-CqvtHNnU.js";import{E as jt}from"./empty-state-BrSxZrfZ.js";import{I as yt}from"./integration-icon-CFvT6ZpF.js";import{P as pe}from"./index-CszBxeF9.js";import{u as Ct,D as vt}from"./use-delete-connection-C_lUSAxo.js";import{u as Ce}from"./use-capability-CU6DCnG3.js";import{u as St}from"./use-infinite-scroll-CaTJY2LS.js";import{u as bt}from"./use-view-mode-Dz9A7efZ.js";import{g as ge}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as $e,A as Oe,e as Le,g as Fe,a as Me,f as ze}from"./alert-dialog-BuJSufuR.js";import{C as Ve}from"./checkbox-I3IyJWnj.js";import{d as Ee,c as Be,D as Ke,a as Ue,b as Re,e as He}from"./dialog-CyIn0DRx.js";import{D as _t,a as Nt,c as kt,b as Dt,d as wt,e as At,f as Tt}from"./drawer-DFg9xgM4.js";import{u as It}from"./tooltip-2IhfImXT.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-kPcoeCiJ.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as _e}from"./form-BZY9ZRz4.js";import{I as re}from"./input-BmmiCY6T.js";import{d as Pt,b as $t,c as Ot,S as Lt,a as ce}from"./select-Di6xzzYo.js";import{T as Ft}from"./textarea-D8B22gmM.js";import{b as Ge,u as Mt}from"./use-connection-Dffadu_t.js";import{u as zt}from"./use-virtual-mcp-Bc7GdFZa.js";import{i as Vt,a as Et}from"./mcp-oauth-BGmk7Mi5.js";import{u as Bt}from"./studio-tools-DRut7Wwk.js";import{Z as Kt,a7 as Ut,C as Rt,z as Ht}from"./agent-icon-D5EbntAT.js";import{n as xe}from"./XCircle-DRGwo6Em.js";import{a as Qe}from"./DotsVertical-y5lMfVOQ.js";import{s as Je}from"./Eye-D3THRXh6.js";import{s as ye}from"./Star01-BfSEPDRT.js";import{s as Ye}from"./Plus-_82_8sq8.js";import{s as Ze}from"./Trash01-CG0gTYx7.js";import{s as et}from"./XClose-Ig7y9gcI.js";import{i as he,a as Ne,E as Wt,c as Xt,p as qt,b as Gt,d as Qt}from"./connection-form-helpers-ByFrPc9N.js";import"./use-mcp-client-BdKIOTso.js";import"./auth-tkqpBHf1.js";import"./SwitchHorizontal01-yw5VS97V.js";import"./ChevronUp-CiXMtnii.js";import"./view-mode-toggle-Cc6sYskX.js";import"./badge-an9iff2c.js";import"./SearchMd-C3Pmxf99.js";import"./use-registry-connections-CK9xDmAR.js";import"./use-organization-settings--a-kmsBC.js";import"./useInfiniteQuery-Ca6dlOLl.js";import"./card-Ckx3Kwvj.js";import"./sidebar-DCgpgzJu.js";import"./LayoutLeft-CkiSxkS_.js";import"./sheet-COdJ-0Qy.js";import"./X-CKIhVHQk.js";import"./ChevronRight-Dj41DV2U.js";import"./label-DitP_QKf.js";import"./ChevronDown-CYFvWHpZ.js";import"./use-collections-DrlB7sAG.js";import"./AlertCircle-DMqR3m0L.js";import"./Tool01-B4SsemMS.js";import"./Settings02-B7hO-Tma.js";import"./ArrowUpRight-DeYzuaJ8.js";import"./ZapSquare-C7yt7KfQ.js";import"./Users03-BOvyNEV4.js";import"./CheckCircle-D6b8lFUP.js";import"./ChevronLeft-DXSAgzPw.js";import"./Stars02-9vF61uFx.js";import"./ZoomOut-DVSwpwUz.js";import"./Globe01-BquIL2vg.js";import"./FilterLines-BPeCeYIz.js";import"./Globe04-BBRZWdJY.js";import"./HardDrive-DmtpWveq.js";import"./Key01-Lcx9qTy7.js";import"./LinkExternal01-jwO28Eeb.js";import"./Monitor01-L6hrk62b.js";import"./Sun-BxuJFhF6.js";import"./Palette-ClNyQOQA.js";import"./Play-C6QgiUls.js";import"./Shield01-RDE62wRx.js";import"./Stars01-W6Wl0Pse.js";import"./Upload01-BlvGy5d-.js";import"./User01-CTuKNCEa.js";import"./Users01-KXiCgru2.js";import"./Zap-w60sxAoc.js";function Jt(j){const e=`deco-filters-${j}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function Yt(j){const e=ie.c(7),[n,p]=E.useState(j),[a,o]=E.useState(j?"desc":null);let i;e[0]!==a||e[1]!==n?(i=y=>{n!==y?(p(y),o("asc")):a==="asc"?o("desc"):a==="desc"&&(p(void 0),o(null))},e[0]=a,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==a||e[5]!==n?(h={sortKey:n,sortDirection:a,handleSort:g},e[3]=g,e[4]=a,e[5]=n,e[6]=h):h=e[6],h}function Zt(j){const e=ie.c(20),{namespace:n,resource:p,defaultSortKey:a,defaultViewMode:o}=j,i=a===void 0?"title":a,g=o===void 0?"table":o,[h,y]=E.useState(""),x=E.useDeferredValue(h),N=`${n}-${p}`,[b,c]=Jt(N),f=`mesh-${p}-filter-visible-${n}`;let u;e[0]!==f?(u=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=u):u=e[1];const[v,_]=E.useState(u);let k;e[2]!==f?(k=T=>{_(T),globalThis.localStorage?.setItem(f,String(T))},e[2]=f,e[3]=k):k=e[3];const $=k;let L;e[4]!==v||e[5]!==$?(L=()=>{$(!v)},e[4]=v,e[5]=$,e[6]=L):L=e[6];const s=L,[w,F]=bt(`mesh-${p}-${n}`,g),{sortKey:M,sortDirection:A,handleSort:P}=Yt(i),z=M;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==x||e[12]!==$||e[13]!==c||e[14]!==F||e[15]!==A||e[16]!==z||e[17]!==s||e[18]!==w?(C={search:h,searchTerm:x,setSearch:y,filters:b,setFilters:c,filterBarVisible:v,setFilterBarVisible:$,toggleFilterBar:s,viewMode:w,setViewMode:F,sortKey:z,sortDirection:A,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=x,e[12]=$,e[13]=c,e[14]=F,e[15]=A,e[16]=z,e[17]=s,e[18]=w,e[19]=C):C=e[19],C}function en(j){const e=ie.c(51),{group:n,onOpen:p,selectionMode:a,selectedIds:o,onToggleSelect:i}=j;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let y;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=y}else y=e[7];const x=y,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let c;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==a?(c=()=>a?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=a,e[20]=c):c=e[20];const f=a&&h&&"ring-2 ring-primary",u=a&&x&&!h&&"ring-1 ring-primary/50";let v;e[21]!==f||e[22]!==u?(v=de(f,u),e[21]=f,e[22]=u,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(xe,{}),e[24]=_):_=e[24];let k;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==a||e[30]!==x?(k=a?t.jsx(Ve,{checked:h?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=a,e[30]=x,e[31]=k):k=e[31];const $=a?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let L;e[32]!==$?(L=de("overflow-hidden transition-all duration-150 ease-out",$),e[32]=$,e[33]=L):L=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:nn,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let w;e[35]!==p?(w=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=w):w=e[36];let F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(Je,{size:16}),e[37]=F):F=e[37];let M;e[38]!==w?(M=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:tn,children:t.jsxs(ae,{onClick:w,children:[F,"Open"]})})]}),e[38]=w,e[39]=M):M=e[39];let A;e[40]!==L||e[41]!==M?(A=t.jsx("div",{className:L,children:M}),e[40]=L,e[41]=M,e[42]=A):A=e[42];let P;e[43]!==k||e[44]!==A?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[k,A]}),e[43]=k,e[44]=A,e[45]=P):P=e[45];let z;return e[46]!==P||e[47]!==b||e[48]!==c||e[49]!==v?(z=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:b,onClick:c,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=c,e[49]=v,e[50]=z):z=e[50],z}function tn(j){return j.stopPropagation()}function nn(j){return j.stopPropagation()}function sn(j){const e=ie.c(23),{count:n,total:p,canManage:a,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:y,onToggleStatus:x,onCancel:N}=j;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let c;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(c=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=c):c=e[6];let f;e[7]!==o||e[8]!==y?(f=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Ye,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=y,e[9]=f):f=e[9];let u;e[10]!==a||e[11]!==h||e[12]!==x?(u=a&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=a,e[11]=h,e[12]=x,e[13]=u):u=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(et,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let k;return e[17]!==b||e[18]!==c||e[19]!==f||e[20]!==u||e[21]!==_?(k=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[b,c,f,u,_]})}),e[17]=b,e[18]=c,e[19]=f,e[20]=u,e[21]=_,e[22]=k):k=e[22],k}function on(j){const e=ie.c(25),{open:n,onOpenChange:p,agents:a,onConfirm:o}=j,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ke,{children:[t.jsx(Ue,{children:"Add to Agent"}),t.jsx(Re,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let y;e[1]!==a||e[2]!==i?(y=a.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):a.map(k=>t.jsxs("button",{type:"button",onClick:()=>g(k.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(yt,{icon:k.icon,name:k.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[1]=a,e[2]=i,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let c;e[8]!==o||e[9]!==p||e[10]!==i?(c=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=c):c=e[11];let f;e[12]!==b||e[13]!==c?(f=t.jsx(U,{disabled:b,onClick:c,children:"Add"}),e[12]=b,e[13]=c,e[14]=f):f=e[14];let u;e[15]!==N||e[16]!==f?(u=t.jsxs(He,{children:[N,f]}),e[15]=N,e[16]=f,e[17]=u):u=e[17];let v;e[18]!==x||e[19]!==u?(v=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[h,x,u]}),e[18]=x,e[19]=u,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(Ee,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function rn(j){const e=ie.c(20),{open:n,onOpenChange:p,count:a,onConfirm:o}=j,i=a!==1?"s":"";let g;e[0]!==a||e[1]!==i?(g=t.jsxs(Ie,{children:["Delete ",a," connection",i,"?"]}),e[0]=a,e[1]=i,e[2]=g):g=e[2];const h=a!==1?"s":"";let y;e[3]!==h?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=y):y=e[4];let x;e[5]!==g||e[6]!==y?(x=t.jsxs($e,{children:[g,y]}),e[5]=g,e[6]=y,e[7]=x):x=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Oe,{children:"Cancel"}),e[8]=N):N=e[8];const b=a!==1?"s":"";let c;e[9]!==a||e[10]!==o||e[11]!==b?(c=t.jsxs(Le,{children:[N,t.jsxs(Fe,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",a," connection",b]})]}),e[9]=a,e[10]=o,e[11]=b,e[12]=c):c=e[12];let f;e[13]!==x||e[14]!==c?(f=t.jsxs(Me,{children:[x,c]}),e[13]=x,e[14]=c,e[15]=f):f=e[15];let u;return e[16]!==p||e[17]!==n||e[18]!==f?(u=t.jsx(ze,{open:n,onOpenChange:p,children:f}),e[16]=p,e[17]=n,e[18]=f,e[19]=u):u=e[19],u}function an(j){return j._registryId?.includes("community-registry")===!0}function cn(j){const e=ie.c(58),{item:n,canManage:p,allConnections:a,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=j,[y,x]=E.useState(!1),[N,b]=E.useState(null);let c,f;e[0]!==o||e[1]!==n?(c=Ae(n)??"",f=o.has(c),e[0]=o,e[1]=n,e[2]=c,e[3]=f):(c=e[2],f=e[3]);const u=f,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",k=n.server?.description||n.description||null;let $;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?($=n.server?.icons?.[0]?.src||ut(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=$):$=e[6];const L=$;let s;if(e[7]!==a||e[8]!==c){let D;e[10]!==c?(D=se=>se.connection_type!=="VIRTUAL"&&se.app_name===c,e[10]=c,e[11]=D):D=e[11],s=a.filter(D),e[7]=a,e[8]=c,e[9]=s}else s=e[9];const w=s;let F;e[12]!==n?(F=an(n),e[12]=n,e[13]=F):F=e[13];const M=F;let A,P;e[14]!==w||e[15]!==p||e[16]!==M||e[17]!==u||e[18]!==n||e[19]!==h||e[20]!==g?(A=()=>{if(u){const D=w[0];D&&g(D);return}p&&P()},P=()=>{M?(b("connect"),x(!0)):h(n)},e[14]=w,e[15]=p,e[16]=M,e[17]=u,e[18]=n,e[19]=h,e[20]=g,e[21]=A,e[22]=P):(A=e[21],P=e[22]);let z;e[23]!==n||e[24]!==h||e[25]!==N?(z=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=z):z=e[26];const C=z;let T;e[27]!==k||e[28]!==L||e[29]!==_?(T={title:_,description:k,icon:L},e[27]=k,e[28]=L,e[29]=_,e[30]=T):T=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(xe,{}),e[31]=Q):Q=e[31];let H;e[32]!==M||e[33]!==n._sourceIcon?(H=M&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=M,e[33]=n._sourceIcon,e[34]=H):H=e[34];let q;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==u||e[39]!==n.id?(q=u?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:D=>{D.stopPropagation(),P()},children:i===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=u,e[39]=n.id,e[40]=q):q=e[40];let l;e[41]!==H||e[42]!==q?(l=t.jsxs("div",{className:"flex items-center gap-2",children:[H,q]}),e[41]=H,e[42]=q,e[43]=l):l=e[43];let S;e[44]!==A||e[45]!==l||e[46]!==T?(S=t.jsx(ve,{connection:T,fallbackIcon:Q,onClick:A,headerActionsAlwaysVisible:!0,headerActions:l}),e[44]=A,e[45]=l,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs($e,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Oe,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Me,{children:[V,t.jsxs(Le,{children:[R,t.jsx(Fe,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let m;e[52]!==y||e[53]!==B?(m=t.jsx(ze,{open:y,onOpenChange:x,children:B}),e[52]=y,e[53]=B,e[54]=m):m=e[54];let O;return e[55]!==S||e[56]!==m?(O=t.jsxs(t.Fragment,{children:[S,m]}),e[55]=S,e[56]=m,e[57]=O):O=e[57],O}function ln({listState:j,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:a,enabledRegistries:o}){const{org:i}=ke(),g=ct(),h=De(),{data:y}=we.useSession(),x=Ge(),N=Mt(j),b=Ct(),{granted:c}=Ce("connections:manage"),{granted:f}=Ce("agents:manage"),[u,v]=E.useState(new Set),_=u.size>0,[k,$]=E.useState(!1),[L,s]=E.useState(!1),[w,F]=E.useState(null),M=zt(),A=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ft(A),z=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=Te(o,j.searchTerm),Q=T.items,H=St(T.loadMore,T.hasMore,T.isLoadingMore),q=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),l=a==="ALL"||o.some(r=>r.id===a)?a:"ALL",S=j.search.length>0,V=e==="all"||S?Q.filter(r=>{if(l!=="ALL"&&r._registryId!==l)return!1;if(S){const d=Ae(r);if(d&&q.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=mt(r,i.id,y.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,G=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!G){X.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:W}=await x.create.mutateAsync(d),Se=new URL(`/api/${i.slug}/mcp/${W}`,window.location.origin),be=await Vt({url:Se.href,token:null,orgId:i.id});if(be.supportsOAuth&&!be.isAuthenticated){const{token:me,tokenInfo:oe,error:je}=await Et({connectionId:W,orgSlug:i.slug,scope:"offline_access"});if(je||!me){ne("connection_oauth_failed",{connection_id:W,flow:"connections_page_connect",error:je??"no_token"}),X.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:W,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${i.slug}/connections/${W}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:W,data:{}}):await x.update.mutateAsync({id:W,data:{connection_token:me}})}catch{await x.update.mutateAsync({id:W,data:{connection_token:me}})}else await x.update.mutateAsync({id:W,data:{connection_token:me}});await g.invalidateQueries({queryKey:lt.isMCPAuthenticated(Se.href,null)}),X.success("Authentication successful")}}X.success("Connected successfully")}catch(d){X.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},m=Bt(),O=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},D=async()=>{$(!1);const r=[...u];ne("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await m.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}O(),X.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await x.update.mutateAsync({id:r,data:{status:d}}),O(),X.success(d==="active"?"Connection enabled":"Connection disabled")}catch{X.error("Failed to update connection")}},fe=async r=>{const d=[...u];ne("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await x.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}O(),X.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},ue=async r=>{const d=M.find(G=>G.id===r);if(!d)return;ne("connections_bulk_add_to_agent",{agent_id:r,count:u.size});const K=new Set(d.connections.map(G=>G.connection_id)),I=[...u].filter(G=>!K.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){X.info("All selected connections are already in that agent");return}try{await m.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:G=>{const W=G.queryKey;return W[1]===i.id&&W[3]==="collection"&&W[4]==="VIRTUAL_MCP"}}),X.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{X.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...b}),t.jsx(rn,{open:k,onOpenChange:$,count:u.size,onConfirm:D}),t.jsx(on,{open:L,onOpenChange:s,agents:M,onConfirm:ue}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&A.length===0:e==="all"?V.length===0:A.length===0)?t.jsx(jt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:j.search?`No Connections match "${j.search}"`:c?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(r=>{if(r.type==="group")return t.jsx(en,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:u,onToggleSelect:z},r.key);const d=r.connection,K=u.has(d.id);return t.jsx(ve,{connection:d,fallbackIcon:t.jsx(xe,{}),onClick:()=>_?z(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ge(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Ve,{checked:K,onCheckedChange:()=>z(d.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(ae,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ge(d)}})},children:[t.jsx(Je,{size:16}),"Open"]}),(c||f)&&t.jsxs(ae,{onClick:I=>{I.stopPropagation(),z(d.id)},children:[t.jsx(Ut,{size:16}),"Select"]}),c&&(d.status==="active"?t.jsxs(ae,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Rt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Ht,{size:16}),"Enable"]})),c&&t.jsxs(ae,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(cn,{item:r,canManage:c,allConnections:N,connectedAppNames:q,connectingItemId:w,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ge(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(sn,{count:u.size,total:A.length,canManage:c,canManageAgents:f,onSelectAll:()=>{v(new Set(A.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>$(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function dn(){const{org:j}=ke(),e=De(),n=nt({strict:!1}),{data:p}=we.useSession(),{stdioEnabled:a}=st(),o=It(),{granted:i}=Ce("connections:manage"),g=Zt({namespace:j.slug,resource:"connections"}),h=Ge(),[y,x]=ot(it.connectionsTab(j.slug),l=>n.tab==="all"||n.tab==="connected"?n.tab:l??"all"),[N,b]=E.useState("ALL"),[c,f]=E.useState("ALL"),[u,v]=E.useState("ALL"),_=xt(),$=Te(_,g.searchTerm).items,L=g.search!==g.searchTerm,s=rt({resolver:at(Xt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),w=s.watch("ui_type"),F=s.watch("connection_url"),M=s.watch("npx_package"),A=he({uiType:w,connectionUrl:F??"",npxPackage:M??""})??Ne({uiType:w,connectionUrl:F??"",registryItems:$}),P=i&&n.action==="create",z=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:j.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:j.slug},search:{}})},T=async l=>{let S,V=null,R=null,B=null;l.ui_type==="NPX"?(S="STDIO",V="",B=Gt(l.npx_package||"",l.env_vars||[])):l.ui_type==="STDIO"?(S="STDIO",V="",B=Qt(l.stdio_command||"",l.stdio_args||"",l.stdio_cwd,l.env_vars||[])):(S=l.ui_type,V=l.connection_url||"",R=l.connection_token||null);const m=dt("conn");ne("connection_custom_created",{connection_type:S,ui_type:l.ui_type}),await h.create.mutateAsync({id:m,title:l.title,description:l.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:j.id,icon:l.icon??null,app_name:null,app_id:null,connection_headers:B,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:ge({app_name:null,connection_url:V,title:l.title,id:m})}})},Q=l=>{l||(P&&C(),s.reset())},H=l=>{const S=l.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,m=D=>{if(D&&(!V&&!s.getValues("title").trim()&&D.title&&s.setValue("title",D.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&D.description&&s.setValue("description",D.description,{shouldDirty:!1}),!B&&D.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(r=>r.key)),ue=D.envVarKeys.filter(r=>!fe.has(r));ue.length>0&&s.setValue("env_vars",[...se,...ue.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},O=qt(S);if(O&&a){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),m(he({uiType:"NPX",npxPackage:O.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const D=w==="HTTP"||w==="SSE"||w==="Websocket"?w:"HTTP";s.setValue("ui_type",D,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),m(he({uiType:D,connectionUrl:S})??Ne({uiType:D,connectionUrl:S,registryItems:$}));return}w==="NPX"&&m(he({uiType:"NPX",npxPackage:S}))},q=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:z,children:[t.jsx(Ye,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const l="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Pt,{value:m.value,onValueChange:m.onChange,children:[t.jsx(ee,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Lt,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Kt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),w==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(re,{placeholder:"@perplexity-ai/mcp-server",...m,value:m.value??"",onPaste:O=>{const D=O.clipboardData.getData("text");D&&(O.preventDefault(),s.setValue("npx_package",D.trim(),{shouldDirty:!0}),H(D))},onBlur:O=>{H(O.target.value),m.onBlur()}})}),t.jsx(te,{})]})}),w==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(re,{placeholder:"node, bun, python...",...m,value:m.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(re,{placeholder:"arg1 arg2 --flag value",...m,value:m.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(re,{placeholder:"/path/to/project (optional)",...m,value:m.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(w==="NPX"||w==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Wt,{value:m.value??[],onChange:m.onChange})}),t.jsx(te,{})]})}),w!=="NPX"&&w!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(re,{placeholder:"https://example.com/mcp",...m,value:m.value??"",onPaste:O=>{const D=O.clipboardData.getData("text");D&&(O.preventDefault(),s.setValue("connection_url",D.trim(),{shouldDirty:!0}),H(D))},onBlur:O=>{H(O.target.value),m.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:A?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(re,{type:"password",placeholder:A?.token?.placeholder??"Bearer token or API key",...m,value:m.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(re,{placeholder:"My Connection",...m})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:m})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(Ft,{placeholder:"A brief description of this connection",rows:3,...m,value:m.value??""})}),t.jsx(te,{})]})})]}),B=P;return o?t.jsx(_t,{open:B,onOpenChange:Q,children:t.jsxs(Nt,{className:"max-h-[90vh]",children:[t.jsx(kt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Dt,{children:l}),t.jsx(wt,{className:"mt-1",children:S})]}),t.jsx(At,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(_e,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(Tt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:B,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Ke,{children:[t.jsx(Ue,{children:l}),t.jsx(Re,{children:S})]}),t.jsx(_e,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(He,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ht,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:l=>{l.key==="Escape"&&(g.setSearch(""),l.target.blur())}}),t.jsx(pt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:N,onChange:l=>b(l||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:c,onChange:l=>f(l||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:u,onChange:l=>v(l||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(l=>({id:l.id,label:l.id.includes("community-registry")?"Community MCP Registry":l.title}))]}]:[]]})]}),q]}),t.jsx(gt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:l=>{const S=l;S!==y&&ne("connections_page_tab_changed",{to_tab:S}),x(S)}}),t.jsx(E.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("div",{style:{opacity:L?.5:1,transition:L?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:L?"none":"auto"},children:t.jsx(ln,{listState:g,activeTab:y,typeFilter:N,statusFilter:c,registryFilter:u,enabledRegistries:_})})})]})})})]})})}function Es(){const j=ie.c(1);let e;return j[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(E.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(dn,{})})}),j[0]=e):e=j[0],e}export{Es as default};
@@ -1 +0,0 @@
1
- import{r as i,j as a,dE as T,P as y,M as v,dF as O,dG as j,dH as G,dI as $,bN as k,dJ as D,dK as _,T as L,dL as U,dM as z,dN as B,dO as F,dP as H,dQ as X,dR as K,dS as W,dT as J,e as C,c as g}from"./index-C3Ab2DJ2.js";var h="ContextMenu",[Q]=L(h,[_]),u=_(),[Y,R]=Q(h),N=n=>{const{__scopeContextMenu:e,children:o,onOpenChange:t,dir:r,modal:s=!0}=n,[d,c]=i.useState(!1),x=u(e),m=k(t),l=i.useCallback(f=>{c(f),m(f)},[m]);return a.jsx(Y,{scope:e,open:d,onOpenChange:l,modal:s,children:a.jsx(D,{...x,dir:r,open:d,onOpenChange:l,modal:s,children:o})})};N.displayName=h;var P="ContextMenuTrigger",b=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,disabled:t=!1,...r}=n,s=R(P,o),d=u(o),c=i.useRef({x:0,y:0}),x=i.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),m=i.useRef(0),l=i.useCallback(()=>window.clearTimeout(m.current),[]),f=p=>{c.current={x:p.clientX,y:p.clientY},s.onOpenChange(!0)};return i.useEffect(()=>l,[l]),i.useEffect(()=>{t&&l()},[t,l]),a.jsxs(a.Fragment,{children:[a.jsx(T,{...d,virtualRef:x}),a.jsx(y.span,{"data-state":s.open?"open":"closed","data-disabled":t?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...n.style},onContextMenu:t?n.onContextMenu:v(n.onContextMenu,p=>{l(),f(p),p.preventDefault()}),onPointerDown:t?n.onPointerDown:v(n.onPointerDown,M(p=>{l(),m.current=window.setTimeout(()=>f(p),700)})),onPointerMove:t?n.onPointerMove:v(n.onPointerMove,M(l)),onPointerCancel:t?n.onPointerCancel:v(n.onPointerCancel,M(l)),onPointerUp:t?n.onPointerUp:v(n.onPointerUp,M(l))})]})});b.displayName=P;var q="ContextMenuPortal",w=n=>{const{__scopeContextMenu:e,...o}=n,t=u(e);return a.jsx(G,{...t,...o})};w.displayName=q;var E="ContextMenuContent",I=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=R(E,o),s=u(o),d=i.useRef(!1);return a.jsx($,{...s,...t,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{n.onCloseAutoFocus?.(c),!c.defaultPrevented&&d.current&&c.preventDefault(),d.current=!1},onInteractOutside:c=>{n.onInteractOutside?.(c),!c.defaultPrevented&&!r.modal&&(d.current=!0)},style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});I.displayName=E;var V="ContextMenuGroup",Z=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(U,{...r,...t,ref:e})});Z.displayName=V;var ee="ContextMenuLabel",te=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(z,{...r,...t,ref:e})});te.displayName=ee;var ne="ContextMenuItem",S=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(O,{...r,...t,ref:e})});S.displayName=ne;var oe="ContextMenuCheckboxItem",re=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(B,{...r,...t,ref:e})});re.displayName=oe;var ae="ContextMenuRadioGroup",se=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(F,{...r,...t,ref:e})});se.displayName=ae;var ie="ContextMenuRadioItem",ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(H,{...r,...t,ref:e})});ce.displayName=ie;var ue="ContextMenuItemIndicator",de=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(X,{...r,...t,ref:e})});de.displayName=ue;var le="ContextMenuSeparator",A=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(j,{...r,...t,ref:e})});A.displayName=le;var xe="ContextMenuArrow",pe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(K,{...r,...t,ref:e})});pe.displayName=xe;var me="ContextMenuSubTrigger",fe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(W,{...r,...t,ref:e})});fe.displayName=me;var ve="ContextMenuSubContent",Ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(J,{...r,...t,ref:e,style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ce.displayName=ve;function M(n){return e=>e.pointerType!=="mouse"?n(e):void 0}var Me=N,ge=b,he=w,_e=I,Re=S,Ne=A;function be(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(Me,{"data-slot":"context-menu",...o}),e[2]=o,e[3]=t):t=e[3],t}function we(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(ge,{"data-slot":"context-menu-trigger",...o}),e[2]=o,e[3]=t):t=e[3],t}function Ee(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(he,{children:a.jsx(_e,{"data-slot":"context-menu-content",className:r,...t})}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}function Ie(n){const e=C.c(12);let o,t,r,s;e[0]!==n?({className:o,inset:t,variant:s,...r}=n,e[0]=n,e[1]=o,e[2]=t,e[3]=r,e[4]=s):(o=e[1],t=e[2],r=e[3],s=e[4]);const d=s===void 0?"default":s;let c;e[5]!==o?(c=g("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=c):c=e[6];let x;return e[7]!==t||e[8]!==r||e[9]!==c||e[10]!==d?(x=a.jsx(Re,{"data-slot":"context-menu-item","data-inset":t,"data-variant":d,className:c,...r}),e[7]=t,e[8]=r,e[9]=c,e[10]=d,e[11]=x):x=e[11],x}function Se(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("bg-border -mx-1 my-1 h-px",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(Ne,{"data-slot":"context-menu-separator",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{Ie as C,Se as a,we as b,Ee as c,be as d};
@@ -1 +0,0 @@
1
- import"./index-C3Ab2DJ2.js";const w={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(w);function A(s,i,l,a,c){const o=Math.min(s,i*a**l);return(1-c*Math.random())*o}const y=3e4,v=1e3;function _(s){const{buildUrl:i,eventTypes:l,name:a,crossTab:c=!1}=s,o=new Map,u=c&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(u&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function d(e,t){e.bootDone=!0;for(const n of e.handlers)try{n(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(i(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const n=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),d(e,r)};for(const r of l)t.addEventListener(r,n)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=A(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!u){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?d(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const n={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,n),u){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=f=>C(n,f.data),n.channel=r}return S(n),n}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,n){const r=m(e);r.refCount++,r.handlers.add(t),n&&r.reconnectHandlers.add(n);let f=!1;return()=>{f||(f=!0,r.handlers.delete(t),n&&r.reconnectHandlers.delete(n),r.refCount--,r.refCount<=0&&L(r))}}}}function k(s,i){const l=new Set(i);return{subscribe(a,c,o){const u=d=>{l.has(d.type)&&c(d)};return s.subscribe(a,u,o)}}}const D=[...p],g=[...p],M=_({name:"watch",buildUrl:s=>`/api/${encodeURIComponent(s)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),O=k(M,[...p]),N=O;export{w as D,N as d,A as e};
@@ -1 +0,0 @@
1
- import{e as n,j as i,cA as u,c,bP as m,dx as x,dy as j,cB as N,cC as b,dz as g,dA as D}from"./index-C3Ab2DJ2.js";import{i as h}from"./X-CKIhVHQk.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function A(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{B as D,R as a,A as b,T as c,_ as d,P as e,w as f,v as g,y as h,k as i};
@@ -1 +0,0 @@
1
- import{e as d,j as s,cs as i,c}from"./index-C3Ab2DJ2.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +0,0 @@
1
- import{e as c,j as d,dX as f,dY as m,c as u,dZ as g,d_ as x,d$ as v,e0 as b,e1 as h,e2 as w,e3 as j,e4 as N,e5 as z,e6 as _,e7 as y,e8 as p}from"./index-C3Ab2DJ2.js";import{i as $}from"./ChevronUp-CiXMtnii.js";import{i as D}from"./ChevronRight-Dj41DV2U.js";import{i as M}from"./DotsVertical-y5lMfVOQ.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function X(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function Y(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function Z(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function A(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,Z as d,q as e,A as f,Y as g,P as h,X as i,O as j,L as k};
@@ -1,2 +0,0 @@
1
- import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,F as ut,n as $,K as Te}from"./index-C3Ab2DJ2.js";import{F as mt,l as pt}from"./index-xsAZnQ1t.js";import{e as ht,at as xt,au as gt,av as ae,aw as yt,N as $e}from"./agent-icon-D5EbntAT.js";import{a as wt}from"./Tool01-B4SsemMS.js";import{s as jt}from"./XClose-Ig7y9gcI.js";import{S as bt}from"./scroll-area-DwqNfKe5.js";import{b as Oe,T as Re,a as ze}from"./tooltip-2IhfImXT.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-BuJSufuR.js";import{u as Et}from"./chat-context-BNtznWGC.js";import{b as Pt}from"./shell-layout-DmxTk-Cg.js";import{ae as le,af as Ae,ag as Tt}from"./index-WHuW26DU.js";import{a as $t,b as Ot,D as Rt,e as zt,c as At,d as Wt}from"./dialog-CyIn0DRx.js";import{I as We}from"./input-BmmiCY6T.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-CUB1yHM7.js";import{t as Vt}from"./ChevronDown-CYFvWHpZ.js";import{i as Bt}from"./ChevronRight-Dj41DV2U.js";import{a as Gt}from"./ZoomOut-DVSwpwUz.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-CWq_MXwm.js";import"./AlertCircle-DMqR3m0L.js";import"./SwitchHorizontal01-yw5VS97V.js";import"./Settings02-B7hO-Tma.js";import"./XCircle-DRGwo6Em.js";import"./ArrowUpRight-DeYzuaJ8.js";import"./ZapSquare-C7yt7KfQ.js";import"./Users03-BOvyNEV4.js";import"./CheckCircle-D6b8lFUP.js";import"./ChevronUp-CiXMtnii.js";import"./ChevronLeft-DXSAgzPw.js";import"./DotsVertical-y5lMfVOQ.js";import"./Stars02-9vF61uFx.js";import"./Eye-D3THRXh6.js";import"./Globe01-BquIL2vg.js";import"./FilterLines-BPeCeYIz.js";import"./Star01-BfSEPDRT.js";import"./Globe04-BBRZWdJY.js";import"./HardDrive-DmtpWveq.js";import"./Key01-Lcx9qTy7.js";import"./LayoutLeft-CkiSxkS_.js";import"./LinkExternal01-jwO28Eeb.js";import"./Monitor01-L6hrk62b.js";import"./Sun-BxuJFhF6.js";import"./Palette-ClNyQOQA.js";import"./Play-C6QgiUls.js";import"./Plus-_82_8sq8.js";import"./SearchMd-C3Pmxf99.js";import"./Shield01-RDE62wRx.js";import"./Stars01-W6Wl0Pse.js";import"./Trash01-CG0gTYx7.js";import"./Upload01-BlvGy5d-.js";import"./User01-CTuKNCEa.js";import"./Users01-KXiCgru2.js";import"./X-CKIhVHQk.js";import"./Zap-w60sxAoc.js";import"./use-clock-tick-SbPzFjh0.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Btaqep1K.js";import"./file-type-icon-BOPDPlds.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-7ak1Ve40.js";import"./use-mcp-client-BdKIOTso.js";import"./auth-tkqpBHf1.js";import"./hooks-DLdyjUhZ.js";import"./decopilot-sse-pool-BkzSWgw-.js";import"./studio-tools-DRut7Wwk.js";import"./sheet-COdJ-0Qy.js";import"./integration-icon-CFvT6ZpF.js";import"./use-virtual-mcp-Bc7GdFZa.js";import"./use-collections-DrlB7sAG.js";import"./use-navigate-to-agent-BTMo9com.js";import"./use-connection-Dffadu_t.js";import"./use-mcp-prompts-5xEBY9_7.js";import"./form-BZY9ZRz4.js";import"./label-DitP_QKf.js";import"./select-Di6xzzYo.js";import"./use-ai-providers-CC3uGtbf.js";import"./use-organization-settings--a-kmsBC.js";import"./avatar-DfTXVgX9.js";import"./required-auth-layout-B3CS-pLH.js";import"./useRouterState-DgLuS94C.js";import"./use-org-sso-CEQ82hSZ.js";import"./index-BY2TC4bG.js";import"./drawer-DFg9xgM4.js";import"./collection-search-CCzYANV5.js";import"./tabs-BcUIMPwc.js";import"./toggle-group-Cp4C3_lM.js";import"./use-deco-credits-16Jb7c03.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CqvtHNnU.js";import"./use-registry-connections-CK9xDmAR.js";import"./useInfiniteQuery-Ca6dlOLl.js";import"./use-infinite-scroll-CaTJY2LS.js";import"./extract-connection-data-CBzjCfJ2.js";import"./card-Ckx3Kwvj.js";import"./collection-tabs-CBstOc4r.js";import"./badge-an9iff2c.js";import"./textarea-D8B22gmM.js";import"./connection-form-helpers-ByFrPc9N.js";import"./useSuspenseInfiniteQuery-CZbIaY66.js";import"./mcp-oauth-BGmk7Mi5.js";import"./connect-desktop-dialog-BgIjMJ8k.js";import"./decopilot-D6xQ1qh2.js";import"./checkbox-I3IyJWnj.js";import"./skeleton-CZ9pOveV.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-Dxa_AxFP.js";import"./popover-BcAFMnrn.js";import"./command-pIEd50-L.js";import"./index-DexxTctJ.js";import"./dropdown-menu-kPcoeCiJ.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C5Tq4YPI.js";import"./empty-state-BrSxZrfZ.js";import"./toolbar-DyjTkAru.js";import"./use-mcp-tools-CYtQa-6Z.js";import"./use-capability-CU6DCnG3.js";import"./shell-route-loading-DW_liPbt.js";import"./index-C4w1u5Cz.js";import"./switch-sHkW6RUp.js";import"./use-debounced-autosave-C4B5942u.js";import"./index-CszBxeF9.js";import"./sidebar-DCgpgzJu.js";import"./search-input-DjHO_xeh.js";import"./github-repo-picker-CrW8szfE.js";import"./use-secrets-B008jqWi.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-Cc6sYskX.js";import"./select-model-4ZBcZdkE.js";import"./use-automations-D2hKtMe8.js";import"./monaco-editor-yw8USVwR.js";import"./automation-runs-BEntIYkJ.js";import"./table-BUxYcsuG.js";import"./use-members-BWyLHt4a.js";import"./use-org-auth-client-Blpkj8FB.js";import"./task-status-BfQltC__.js";import"./automation-list-row-40GibzkL.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Ri({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
- `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=O?.path===n.path,Y=Jt(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&J(null)}}),i.jsx(vt,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Ri as FileExplorer};
@@ -1 +0,0 @@
1
- import{f as M,p as $,F as U,x as Q,w as H,a as q,t as P,n as w,K as I,j as n,ad as L,s as Y,v as k,e as F,r as T,B as Z,a2 as B,H as J}from"./index-C3Ab2DJ2.js";import{P as N}from"./index-CszBxeF9.js";import{u as W}from"./use-org-auth-client-Blpkj8FB.js";import{u as X}from"./use-debounced-autosave-C4B5942u.js";import{A as ee}from"./avatar-DfTXVgX9.js";import{I as V}from"./input-BmmiCY6T.js";import{S as K,a as G,b as A,c as te}from"./settings-section-Dxa_AxFP.js";import{D as ne}from"./domain-settings-DIU6G_-3.js";import{u as ae}from"./studio-tools-DRut7Wwk.js";import{c as se,b as oe,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-BuJSufuR.js";import{R as me}from"./require-capability-CoJVffIR.js";import"./sidebar-DCgpgzJu.js";import"./LayoutLeft-CkiSxkS_.js";import"./tooltip-2IhfImXT.js";import"./sheet-COdJ-0Qy.js";import"./X-CKIhVHQk.js";import"./User01-CTuKNCEa.js";import"./card-Ckx3Kwvj.js";import"./ArrowUpRight-DeYzuaJ8.js";import"./badge-an9iff2c.js";import"./select-Di6xzzYo.js";import"./ChevronUp-CiXMtnii.js";import"./ChevronDown-CYFvWHpZ.js";import"./use-capability-CU6DCnG3.js";import"./access-gate-CEtgmlCt.js";import"./capability-load-error-BXEh1mp-.js";const ge=Y({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function fe(e){const t=F.c(13),{value:v,onChange:h,name:o,disabled:d}=e,m=T.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=pe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let s;t[3]!==d||t[4]!==a?(s=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=s):s=t[5];const i=v||void 0,p=o??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==s||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,g]}),t[9]=d,t[10]=s,t[11]=g,t[12]=f):f=t[12],f}function pe(){return w.error("Failed to read image")}function he(){const e=M(),{org:t}=$(),v=W(),h=U(),o=Q({resolver:H(ge),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=q({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const i=await v.organization.update({data:s});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,s)=>{P("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:I.organizations()}),h.invalidateQueries({queryKey:I.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,s)=>{P("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const i=o.getValues(),p=o.control._defaultValues;o.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{o.reset(p,{keepValues:!0})}}}),r=o.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(K,{children:n.jsxs(G,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(fe,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(L,{control:o.control,name:"name",render:({field:a})=>n.jsx(V,{id:"org-name",...a,onChange:s=>{a.onChange(s),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(L,{control:o.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:s=>{const i=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function xe(){const e=F.c(42),{org:t}=$(),[v,h]=T.useState(!1),[o,d]=T.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{P("organization_deleted",{organization_id:t.id}),localStorage.getItem(B.lastOrgSlug())===t.slug&&localStorage.removeItem(B.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:je},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=q(c);let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=()=>h(!0),e[9]=s):s=e[9];let i;e[10]!==a.isPending?(i=n.jsx(K,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(G,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Z,{variant:"destructive",size:"sm",onClick:s,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(se,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==o||e[20]!==t.name?(u=n.jsx(V,{value:o,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=o,e[20]=t.name,e[21]=u):u=e[21];let y;e[22]!==u||e[23]!==f||e[24]!==x?(y=n.jsxs(oe,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=y):y=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(re,{children:"Cancel"}),e[26]=D):D=e[26];let b;e[27]!==a?(b=()=>a.mutate(),e[27]=a,e[28]=b):b=e[28];const E=o!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==b||e[30]!==E||e[31]!==R?(S=n.jsxs(le,{children:[D,n.jsx(ce,{onClick:b,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=b,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ue,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let _;return e[39]!==C||e[40]!==i?(_=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=_):_=e[41],_}function je(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ve(){const e=F.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(he,{}),n.jsx(ne,{}),n.jsx(xe,{})]})})})}),e[0]=t):t=e[0],t}function Ue(){const e=F.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ve,{})}),e[0]=t):t=e[0],t}export{Ue as default};
@@ -1 +0,0 @@
1
- import{e as C,p as be,a as _e,K as Pe,j as t,a1 as Ue,r as $,B as Y,L as $e,c as he,l as De,n as q}from"./index-C3Ab2DJ2.js";import{a as W}from"./Tool01-B4SsemMS.js";import{s as ze}from"./Trash01-CG0gTYx7.js";import{i as je}from"./Upload01-BlvGy5d-.js";import{I as Fe}from"./input-BmmiCY6T.js";import{L as Te}from"./label-DitP_QKf.js";import{i as Le}from"./AlertCircle-DMqR3m0L.js";import{i as Ne}from"./ChevronUp-CiXMtnii.js";import{a as Ee}from"./Eye-D3THRXh6.js";import{a as Oe}from"./DotsVertical-y5lMfVOQ.js";import{N as Ae}from"./agent-icon-D5EbntAT.js";import{n as Re}from"./LinkExternal01-jwO28Eeb.js";import{d as Be,a as Ge,b as Me,D as Ve,c as Ke}from"./dialog-CyIn0DRx.js";import{c as pe,a as Je,D as Qe,b as qe}from"./dropdown-menu-kPcoeCiJ.js";import{S as Ye}from"./skeleton-CZ9pOveV.js";import{T as We,a as He,b as Xe,c as Ze}from"./tabs-BcUIMPwc.js";import{u as et,c as tt}from"./use-file-configs-qOKR17qO.js";import{u as st}from"./useInfiniteQuery-Ca6dlOLl.js";import{u as nt}from"./studio-tools-DRut7Wwk.js";function it(s){if(typeof s=="string")return s;if(!s||typeof s!="object")return"";const e=s;if(Array.isArray(e.variants)){const n=e.variants,l=n.find(r=>r.rule?.__resolveType?.includes("always"));if(typeof l?.value=="string")return l.value;const i=n.find(r=>typeof r.value=="string");if(i)return i.value}return typeof e.src=="string"?e.src:typeof e.url=="string"?e.url:typeof e.value=="string"?e.value:""}function lt(s){const e=C.c(10),{org:n}=be(),l=nt();let i;e[0]!==n.id||e[1]!==s.configId?(i=Pe.filePickerObjects(n.id,s.configId),e[0]=n.id,e[1]=s.configId,e[2]=i):i=e[2];const r=s.enabled!==!1&&!!s.configId;let o;e[3]!==s.configId||e[4]!==l?(o=async a=>{const{pageParam:g}=a;return await l.call("FILE_OBJECTS_LIST",{configId:s.configId,cursor:g??void 0})},e[3]=s.configId,e[4]=l,e[5]=o):o=e[5];let f;return e[6]!==i||e[7]!==r||e[8]!==o?(f={queryKey:i,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:o,getNextPageParam:rt},e[6]=i,e[7]=r,e[8]=o,e[9]=f):f=e[9],st(f)}function rt(s){return s.nextCursor??void 0}function Ce(){const s=C.c(2),{org:e}=be();let n;return s[0]!==e?(n={mutationFn:async l=>{const i=l.file.type||"application/octet-stream",r=await fetch(`/api/${encodeURIComponent(e.slug)}/file-configs/${encodeURIComponent(l.configId)}/upload?filename=${encodeURIComponent(l.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:l.file});if(!r.ok){const o=await r.text().catch(ot);let f=`${r.status} ${r.statusText}`;try{const a=JSON.parse(o);a.message&&(f=a.message)}catch{o&&(f=o.slice(0,200))}throw new Error(`Upload failed: ${f}`)}return await r.json()}},s[0]=e,s[1]=n):n=s[1],_e(n)}function ot(){return""}const ye="file-picker:last-config-id";function at(s){const e=C.c(19),n=s.mode==="image"?"Pick an image":"Pick a file";let l;e[0]!==n?(l=t.jsx(Ge,{children:n}),e[0]=n,e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Me,{children:"Upload a new file or pick one previously uploaded to a configured bucket."}),e[2]=i):i=e[2];let r;e[3]!==l?(r=t.jsxs(Ve,{children:[l,i]}),e[3]=l,e[4]=r):r=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Ye,{className:"h-64 w-full"}),e[5]=o):o=e[5];let f;e[6]!==s?(f=x=>{s.onSelect(x),s.onOpenChange(!1)},e[6]=s,e[7]=f):f=e[7];let a;e[8]!==s.lockedConfigId||e[9]!==s.mode||e[10]!==f?(a=t.jsx(Ue,{fallback:ct,children:t.jsx($.Suspense,{fallback:o,children:t.jsx(ft,{mode:s.mode,lockedConfigId:s.lockedConfigId,onSelect:f})})}),e[8]=s.lockedConfigId,e[9]=s.mode,e[10]=f,e[11]=a):a=e[11];let g;e[12]!==r||e[13]!==a?(g=t.jsxs(Ke,{className:"sm:max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",children:[r,a]}),e[12]=r,e[13]=a,e[14]=g):g=e[14];let u;return e[15]!==s.onOpenChange||e[16]!==s.open||e[17]!==g?(u=t.jsx(Be,{open:s.open,onOpenChange:s.onOpenChange,children:g}),e[15]=s.onOpenChange,e[16]=s.open,e[17]=g,e[18]=u):u=e[18],u}function ct(s){const{error:e}=s;return t.jsx(dt,{error:e??new Error("Failed to load buckets")})}function dt(s){const e=C.c(3),{error:n}=s;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Le,{size:16}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,t.jsx("span",{className:"text-sm font-medium",children:n.message})]}),e[1]=n.message,e[2]=i):i=e[2],i}function ft(s){const e=C.c(32),{mode:n,lockedConfigId:l,onSelect:i}=s,r=et();if(r.length===0){let d;return e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(gt,{}),e[0]=d):d=e[0],d}if(l){let d;if(e[1]!==r||e[2]!==l){let c;e[4]!==l?(c=h=>h.id===l,e[4]=l,e[5]=c):c=e[5],d=r.find(c),e[1]=r,e[2]=l,e[3]=d}else d=e[3];const m=d;if(m){let c;return e[6]!==m||e[7]!==n||e[8]!==i?(c=t.jsx(xe,{config:m,mode:n,onSelect:i}),e[6]=m,e[7]=n,e[8]=i,e[9]=c):c=e[9],c}}if(r.length===1){const d=r[0];let m;return e[10]!==d||e[11]!==n||e[12]!==i?(m=t.jsx(xe,{config:d,mode:n,onSelect:i}),e[10]=d,e[11]=n,e[12]=i,e[13]=m):m=e[13],m}let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=typeof window<"u"?window.localStorage.getItem(ye):null,e[14]=o):o=e[14];const f=o;let a;e[15]!==r?(a=r.find(d=>d.id===f)?.id??r[0].id,e[15]=r,e[16]=a):a=e[16];const g=a;let u;e[17]!==r?(u=r.map(ut),e[17]=r,e[18]=u):u=e[18];let x;e[19]!==u?(x=t.jsx(He,{className:"self-start",children:u}),e[19]=u,e[20]=x):x=e[20];let p;if(e[21]!==r||e[22]!==n||e[23]!==i){let d;e[25]!==n||e[26]!==i?(d=m=>t.jsx(Xe,{value:m.id,className:"min-h-0 flex-1 overflow-hidden",children:t.jsx(xe,{config:m,mode:n,onSelect:i})},m.id),e[25]=n,e[26]=i,e[27]=d):d=e[27],p=r.map(d),e[21]=r,e[22]=n,e[23]=i,e[24]=p}else p=e[24];let j;return e[28]!==g||e[29]!==x||e[30]!==p?(j=t.jsxs(Ze,{defaultValue:g,onValueChange:mt,className:"min-h-0 flex-1 flex flex-col",children:[x,p]}),e[28]=g,e[29]=x,e[30]=p,e[31]=j):j=e[31],j}function ut(s){return t.jsx(We,{value:s.id,children:s.name},s.id)}function mt(s){typeof window<"u"&&window.localStorage.setItem(ye,s)}function gt(){const s=C.c(4),{org:e}=be();let n,l;s[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(je,{size:20,className:"text-muted-foreground"})}),l=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No bucket configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket in Settings before you can upload files."})]}),s[0]=n,s[1]=l):(n=s[0],l=s[1]);let i;return s[2]!==e.slug?(i=t.jsxs("div",{className:"rounded-xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,l,t.jsx(Y,{asChild:!0,size:"sm",className:"mt-2",children:t.jsx($e,{to:"/$org/settings/files",params:{org:e.slug},children:"Configure a bucket"})})]}),s[2]=e.slug,s[3]=i):i=s[3],i}function xe({config:s,mode:e,onSelect:n}){const l=lt({configId:s.id}),i=Ce(),[r,o]=$.useState(!1),f=$.useRef(null),a=e==="image"?"image/*":void 0;async function g(c){if(!c)return;const h=Array.from(c);if(h.length===0)return;let w=null;const b=[];for(const N of h)try{const y=await i.mutateAsync({configId:s.id,file:N});w??=y.publicUrl}catch(y){b.push(`${N.name} (${y instanceof Error?y.message:"upload failed"})`)}await l.refetch(),b.length>0&&q.error(b.length===h.length?`Upload failed: ${b.join("; ")}`:`Some files failed: ${b.join("; ")}`),w&&n(w)}function u(c){c.preventDefault(),o(!0)}function x(){o(!1)}function p(c){c.preventDefault(),o(!1),g(c.dataTransfer.files)}const d=(l.data?.pages??[]).flatMap(c=>c.items),m=d.filter(c=>e==="image"?Ie(c.key):!0);return t.jsxs("div",{className:"flex flex-col gap-3 min-h-0 h-full",children:[t.jsxs("button",{type:"button",onClick:()=>f.current?.click(),onDragOver:u,onDragLeave:x,onDrop:p,className:he("rounded-xl border border-dashed border-border/60 p-6 flex flex-col items-center justify-center gap-2 text-center transition-colors",r&&"border-primary bg-primary/5",i.isPending&&"opacity-60 pointer-events-none"),children:[t.jsx(je,{size:18,className:"text-muted-foreground"}),t.jsx("p",{className:"text-sm font-medium",children:i.isPending?"Uploading…":"Drop files here or click to upload"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Up to 100 MB."," ",e==="image"?"Images only (PNG, JPEG, WebP, GIF, SVG, AVIF).":"Common image, video, audio, and document types."]}),t.jsx("input",{ref:f,type:"file",accept:a,multiple:!0,className:"hidden",onChange:c=>{const h=Array.from(c.target.files??[]);c.target.value="",g(h)}})]}),l.isFetching&&!l.isFetchingNextPage?t.jsx("div",{className:"flex justify-end",children:t.jsx("span",{className:"text-xs text-muted-foreground",children:"Loading…"})}):null,t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[m.length===0?e==="image"&&d.length>0?t.jsx(xt,{}):t.jsx(pt,{}):e==="image"?t.jsx(bt,{items:m,onSelect:n}):t.jsx(jt,{items:m,onSelect:n}),l.hasNextPage&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(Y,{type:"button",variant:"outline",size:"sm",disabled:l.isFetchingNextPage,onClick:()=>l.fetchNextPage(),children:l.isFetchingNextPage?t.jsxs(t.Fragment,{children:[t.jsx(De,{size:14,className:"animate-spin"}),"Loading…"]}):"Load more"})})]})]})}function pt(){const s=C.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(W,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No files in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Drop a file above to get started."})]}),s[0]=e):e=s[0],e}function xt(){const s=C.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex h-full min-h-40 flex-col items-center justify-center gap-2 py-8 text-center",children:[t.jsx("div",{className:"flex size-10 items-center justify-center rounded-full bg-muted",children:t.jsx(W,{size:18,className:"text-muted-foreground"})}),t.jsx("p",{className:"text-sm font-medium",children:"No images in this bucket yet"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"The bucket has other files, but none match common image formats."})]}),s[0]=e):e=s[0],e}function Ie(s){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(s)}function ht(s){const e=s.lastIndexOf(".");return e<0||e===s.length-1?"file":s.slice(e+1).toLowerCase()}function bt(s){const e=C.c(7),{items:n,onSelect:l}=s;let i;if(e[0]!==n||e[1]!==l){let o;e[3]!==l?(o=f=>t.jsx(Se,{item:f,variant:"image",onSelect:l},f.key),e[3]=l,e[4]=o):o=e[4],i=n.map(o),e[0]=n,e[1]=l,e[2]=i}else i=e[2];let r;return e[5]!==i?(r=t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:i}),e[5]=i,e[6]=r):r=e[6],r}function jt(s){const e=C.c(7),{items:n,onSelect:l}=s;let i;if(e[0]!==n||e[1]!==l){let o;e[3]!==l?(o=f=>t.jsx("li",{children:t.jsx(Se,{item:f,variant:"row",onSelect:l})},f.key),e[3]=l,e[4]=o):o=e[4],i=n.map(o),e[0]=n,e[1]=l,e[2]=i}else i=e[2];let r;return e[5]!==i?(r=t.jsx("ul",{className:"divide-y divide-border/60 rounded-lg border border-border/60",children:i}),e[5]=i,e[6]=r):r=e[6],r}function Se(s){const e=C.c(58),{item:n,variant:l,onSelect:i}=s;let r;e[0]!==n.key?(r=ht(n.key),e[0]=n.key,e[1]=r):r=e[1];const o=r;if(l==="image"){let b;e[2]!==n.publicUrl||e[3]!==i?(b=()=>i(n.publicUrl),e[2]=n.publicUrl,e[3]=i,e[4]=b):b=e[4];let N;e[5]!==n.key||e[6]!==n.publicUrl?(N=t.jsx("img",{src:n.publicUrl,alt:n.key,loading:"lazy",className:"h-full w-full object-cover",onError:yt}),e[5]=n.key,e[6]=n.publicUrl,e[7]=N):N=e[7];let y;e[8]!==n.key||e[9]!==b||e[10]!==N?(y=t.jsx("button",{type:"button",onClick:b,className:"block h-full w-full transition hover:ring-2 hover:ring-primary",title:n.key,children:N}),e[8]=n.key,e[9]=b,e[10]=N,e[11]=y):y=e[11];let P;e[12]!==o?(P=t.jsx("span",{className:"pointer-events-none absolute left-1.5 top-1.5 rounded bg-background/80 px-1.5 py-0.5 text-[10px] font-medium uppercase text-foreground opacity-0 backdrop-blur-sm transition-opacity group-hover:opacity-100",children:o}),e[12]=o,e[13]=P):P=e[13];let S;e[14]!==n||e[15]!==i?(S=t.jsx("div",{className:"absolute right-1.5 top-1.5 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx(ke,{item:n,onSelect:i})}),e[14]=n,e[15]=i,e[16]=S):S=e[16];let I;e[17]!==n.key?(I=we(n.key),e[17]=n.key,e[18]=I):I=e[18];let _;e[19]!==I?(_=t.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-2 opacity-0 transition-opacity group-hover:opacity-100",children:t.jsx("p",{className:"truncate text-xs text-white",children:I})}),e[19]=I,e[20]=_):_=e[20];let k;return e[21]!==y||e[22]!==P||e[23]!==S||e[24]!==_?(k=t.jsxs("div",{className:"group relative aspect-square overflow-hidden rounded-lg border border-border/60 bg-muted",children:[y,P,S,_]}),e[21]=y,e[22]=P,e[23]=S,e[24]=_,e[25]=k):k=e[25],k}let f;e[26]!==n.publicUrl||e[27]!==i?(f=()=>i(n.publicUrl),e[26]=n.publicUrl,e[27]=i,e[28]=f):f=e[28];let a;e[29]!==n.key?(a=t.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted",children:Ie(n.key)?t.jsx(W,{size:16,className:"text-muted-foreground"}):t.jsx(Ae,{size:16,className:"text-muted-foreground"})}),e[29]=n.key,e[30]=a):a=e[30];let g;e[31]!==n.key?(g=we(n.key),e[31]=n.key,e[32]=g):g=e[32];let u;e[33]!==g?(u=t.jsx("p",{className:"truncate text-sm font-medium",children:g}),e[33]=g,e[34]=u):u=e[34];let x;e[35]!==n.key?(x=t.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:n.key}),e[35]=n.key,e[36]=x):x=e[36];let p;e[37]!==u||e[38]!==x?(p=t.jsxs("div",{className:"min-w-0 flex-1",children:[u,x]}),e[37]=u,e[38]=x,e[39]=p):p=e[39];let j;e[40]!==o?(j=t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:o}),e[40]=o,e[41]=j):j=e[41];let d;e[42]!==n.size?(d=wt(n.size),e[42]=n.size,e[43]=d):d=e[43];let m;e[44]!==d?(m=t.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:d}),e[44]=d,e[45]=m):m=e[45];let c;e[46]!==m||e[47]!==f||e[48]!==a||e[49]!==p||e[50]!==j?(c=t.jsxs("button",{type:"button",onClick:f,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[a,p,j,m]}),e[46]=m,e[47]=f,e[48]=a,e[49]=p,e[50]=j,e[51]=c):c=e[51];let h;e[52]!==n||e[53]!==i?(h=t.jsx(ke,{item:n,onSelect:i}),e[52]=n,e[53]=i,e[54]=h):h=e[54];let w;return e[55]!==c||e[56]!==h?(w=t.jsxs("div",{className:"group flex items-center gap-3 px-3 py-2 transition hover:bg-muted/50",children:[c,h]}),e[55]=c,e[56]=h,e[57]=w):w=e[57],w}function yt(s){s.target.style.display="none"}function ke(s){const e=C.c(22),{item:n,onSelect:l}=s,[i,r]=$.useState(!1);let o;e[0]!==n.publicUrl?(o=async function(b){b.preventDefault(),b.stopPropagation();try{await navigator.clipboard.writeText(n.publicUrl),r(!0),window.setTimeout(()=>r(!1),1500)}catch{q.error("Failed to copy URL")}},e[0]=n.publicUrl,e[1]=o):o=e[1];const f=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Je,{asChild:!0,children:t.jsx(Y,{type:"button",variant:"ghost",size:"icon",className:"size-7 rounded-md bg-background/80 backdrop-blur-sm",onClick:kt,"aria-label":"Asset actions",children:t.jsx(Oe,{size:14})})}),e[2]=a):a=e[2];let g;e[3]!==n.publicUrl||e[4]!==l?(g=()=>l(n.publicUrl),e[3]=n.publicUrl,e[4]=l,e[5]=g):g=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ne,{size:14}),e[6]=u):u=e[6];let x;e[7]!==g?(x=t.jsxs(pe,{onClick:g,children:[u,"Use this"]}),e[7]=g,e[8]=x):x=e[8];let p;e[9]!==i?(p=i?t.jsx(Ne,{size:14}):t.jsx(Ee,{size:14}),e[9]=i,e[10]=p):p=e[10];const j=i?"Copied":"Copy URL";let d;e[11]!==f||e[12]!==p||e[13]!==j?(d=t.jsxs(pe,{onClick:f,children:[p,j]}),e[11]=f,e[12]=p,e[13]=j,e[14]=d):d=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Re,{size:14}),e[15]=m):m=e[15];let c;e[16]!==n.publicUrl?(c=t.jsx(pe,{asChild:!0,children:t.jsxs("a",{href:n.publicUrl,target:"_blank",rel:"noreferrer",onClick:vt,children:[m,"Open in new tab"]})}),e[16]=n.publicUrl,e[17]=c):c=e[17];let h;return e[18]!==c||e[19]!==x||e[20]!==d?(h=t.jsxs(Qe,{children:[a,t.jsxs(qe,{align:"end",onClick:Nt,children:[x,d,c]})]}),e[18]=c,e[19]=x,e[20]=d,e[21]=h):h=e[21],h}function vt(s){return s.stopPropagation()}function Nt(s){return s.stopPropagation()}function kt(s){return s.stopPropagation()}function we(s){const e=s.split("/");return e[e.length-1]??s}function wt(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(1)} MB`}function Ct(s,e){if(!e)return null;const n=e.toLowerCase();return s.find(l=>{const i=l.bucket.toLowerCase();return l.siteSlug?.toLowerCase()===n||i===n||i===`deco-assets-${n}`})??null}function It(s){try{const e=new URL(s).pathname;return decodeURIComponent(e.split("/").pop()??s)}catch{return s.split("/").pop()??s}}function St(s){const e=s.lastIndexOf(".");return e<0||e===s.length-1?"":s.slice(e+1).toLowerCase()}const _t=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml","image/avif"]);function Yt(s){const e=C.c(86),{schema:n,value:l,onChange:i,path:r,label:o,sandbox:f}=s,a=it(l),[g,u]=$.useState(!1),[x,p]=$.useState(!1),[j,d]=$.useState(!1),[m,c]=$.useState(!1),h=a?It(a):"",w=h?St(h):"",b=tt(),N=Ce();let y;e[0]!==b.data?.configs?(y=b.data?.configs??[],e[0]=b.data?.configs,e[1]=y):y=e[1];const P=f?.siteSlug;let S;e[2]!==y||e[3]!==P?(S=Ct(y,P),e[2]=y,e[3]=P,e[4]=S):S=e[4];const I=S;let _;e[5]!==i||e[6]!==c||e[7]!==d?(_=function(v){d(!1),c(!1),i(v)},e[5]=i,e[6]=c,e[7]=d,e[8]=_):_=e[8];const k=_;let H;e[9]!==b.data?.configs||e[10]!==I?(H=function(){if(I)return I.id;const v=b.data?.configs??[];if(v.length===1)return v[0].id;if(v.length===0)return null;const D=typeof window<"u"?window.localStorage.getItem(ye):null;return v.some(ie=>ie.id===D)?D:null},e[9]=b.data?.configs,e[10]=I,e[11]=H):H=e[11];const le=H;let X;e[12]!==le||e[13]!==u||e[14]!==k||e[15]!==N?(X=async function(v){if(!v)return;const D=Array.from(v).filter(Pt);if(D.length===0){q.error("Only image files are accepted here.");return}const ie=le();if(!ie){u(!0);return}try{const ge=await N.mutateAsync({configId:ie,file:D[0]});k(ge.publicUrl),D.length>1&&q.info(`Uploaded ${D[0].name}; extra files were ignored (single-select field).`)}catch(ge){const ve=ge;q.error(ve instanceof Error?ve.message:"Upload failed")}},e[12]=le,e[13]=u,e[14]=k,e[15]=N,e[16]=X):X=e[16];const re=X;let Z;e[17]!==p?(Z=function(v){v.preventDefault(),v.dataTransfer.types.includes("Files")&&p(!0)},e[17]=p,e[18]=Z):Z=e[18];const oe=Z;let ee;e[19]!==p?(ee=function(v){v.currentTarget===v.target&&p(!1)},e[19]=p,e[20]=ee):ee=e[20];const ae=ee;let te;e[21]!==re||e[22]!==p?(te=function(v){v.preventDefault(),p(!1),re(v.dataTransfer.files)},e[21]=re,e[22]=p,e[23]=te):te=e[23];const ce=te;let z;e[24]!==o||e[25]!==r?(z=t.jsx(Te,{htmlFor:r,className:"text-muted-foreground",children:o}),e[24]=o,e[25]=r,e[26]=z):z=e[26];let F;e[27]!==n.description?(F=n.description&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n.description}),e[27]=n.description,e[28]=F):F=e[28];let T;e[29]!==z||e[30]!==F?(T=t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[z,F]}),e[29]=z,e[30]=F,e[31]=T):T=e[31];const de=x&&"border-primary ring-2 ring-primary/30",fe=N.isPending&&"pointer-events-none opacity-60";let L;e[32]!==de||e[33]!==fe?(L=he("group relative w-full overflow-hidden rounded-xl border border-border/60 bg-muted/30 transition",de,fe),e[32]=de,e[33]=fe,e[34]=L):L=e[34];let E;e[35]!==w||e[36]!==h||e[37]!==m||e[38]!==j||e[39]!==o||e[40]!==c||e[41]!==d||e[42]!==u||e[43]!==a||e[44]!==N.isPending?(E=a?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative h-40 w-full bg-[image:linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%),linear-gradient(45deg,rgba(0,0,0,0.04)_25%,transparent_25%,transparent_75%,rgba(0,0,0,0.04)_75%)] bg-[position:0_0,8px_8px] [background-size:16px_16px]",children:[!m&&t.jsx("img",{src:a,alt:o,className:he("h-full w-full object-contain transition-opacity",!j&&"opacity-0"),onLoad:()=>d(!0),onError:()=>c(!0)},a),m&&t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 text-muted-foreground",children:[t.jsx(W,{size:20}),t.jsx("p",{className:"text-xs",children:"Preview unavailable"})]}),!j&&!m&&t.jsx("div",{className:"absolute inset-0 animate-pulse bg-muted/60"})]}),t.jsxs("div",{className:"flex items-center gap-2 border-t border-border/60 bg-background/50 px-3 py-2",children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium",children:h}),w&&t.jsx("span",{className:"shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium uppercase text-muted-foreground",children:w})]})]}):t.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex h-40 w-full flex-col items-center justify-center gap-2 text-sm text-muted-foreground hover:bg-muted/60 hover:text-foreground",children:[t.jsx(W,{size:20}),t.jsx("span",{className:"text-sm font-medium",children:N.isPending?"Uploading…":"Drop an image or click to browse"}),t.jsx("span",{className:"text-xs text-muted-foreground",children:"PNG, JPEG, WebP, GIF, SVG, AVIF — up to 100 MB"})]}),e[35]=w,e[36]=h,e[37]=m,e[38]=j,e[39]=o,e[40]=c,e[41]=d,e[42]=u,e[43]=a,e[44]=N.isPending,e[45]=E):E=e[45];let O;e[46]!==x?(O=x&&t.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-primary/10 backdrop-blur-[1px]",children:t.jsx("span",{className:"rounded-md bg-background px-3 py-1.5 text-xs font-medium shadow",children:"Drop to upload"})}),e[46]=x,e[47]=O):O=e[47];let A;e[48]!==ae||e[49]!==oe||e[50]!==ce||e[51]!==L||e[52]!==E||e[53]!==O?(A=t.jsxs("div",{onDragOver:oe,onDragLeave:ae,onDrop:ce,className:L,children:[E,O]}),e[48]=ae,e[49]=oe,e[50]=ce,e[51]=L,e[52]=E,e[53]=O,e[54]=A):A=e[54];let R;e[55]!==k?(R=U=>k(U.target.value),e[55]=k,e[56]=R):R=e[56];let B;e[57]!==r||e[58]!==a||e[59]!==R?(B=t.jsx(Fe,{id:r,type:"url",value:a,onChange:R,placeholder:"https://...",className:"h-9 min-w-0 flex-1"}),e[57]=r,e[58]=a,e[59]=R,e[60]=B):B=e[60];let G;e[61]!==u?(G=()=>u(!0),e[61]=u,e[62]=G):G=e[62];let se;e[63]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx(je,{size:14}),e[63]=se):se=e[63];const ue=a?"Replace":"Browse";let M;e[64]!==G||e[65]!==ue?(M=t.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:G,className:"h-9 shrink-0",children:[se,ue]}),e[64]=G,e[65]=ue,e[66]=M):M=e[66];let V;e[67]!==k||e[68]!==a?(V=a&&t.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:()=>k(""),className:"h-9 shrink-0","aria-label":"Remove image",children:t.jsx(ze,{size:14})}),e[67]=k,e[68]=a,e[69]=V):V=e[69];let K;e[70]!==B||e[71]!==M||e[72]!==V?(K=t.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[B,M,V]}),e[70]=B,e[71]=M,e[72]=V,e[73]=K):K=e[73];let J;e[74]!==k?(J=U=>k(U),e[74]=k,e[75]=J):J=e[75];const me=I?.id??null;let Q;e[76]!==g||e[77]!==u||e[78]!==J||e[79]!==me?(Q=t.jsx(at,{open:g,onOpenChange:u,mode:"image",onSelect:J,lockedConfigId:me}),e[76]=g,e[77]=u,e[78]=J,e[79]=me,e[80]=Q):Q=e[80];let ne;return e[81]!==T||e[82]!==A||e[83]!==K||e[84]!==Q?(ne=t.jsxs("div",{className:"grid w-full min-w-0 grid-cols-[minmax(0,1fr)] gap-2",children:[T,A,K,Q]}),e[81]=T,e[82]=A,e[83]=K,e[84]=Q,e[85]=ne):ne=e[85],ne}function Pt(s){return _t.has(s.type||"")}export{at as F,Yt as I,ye as L,it as e,Ct as m,Ce as u};