@decocms/mesh 2.122.0 → 2.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/dist/client/assets/{AlertCircle-xlmc_ewP.js → AlertCircle-BpvTeRWZ.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-D421ZtkR.js → AlertOctagon-KPbgj_fe.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-Ddzav--o.js → AlertTriangle-BQr7kJDW.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-Cm3_NyIq.js → ArrowLeft-6opPa7zy.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-D7gFQV8U.js → ArrowUp-Bt1al9WB.js} +1 -1
  6. package/dist/client/assets/{Check-CwhCIsIx.js → Check-COoTrHCh.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-gVXszZ9H.js → CheckCircle-Dif3Jy99.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-CZrV6JdL.js → CheckDone01-B8UrJ9b0.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-BG2LRHT3.js → CheckVerified02-BXTAAE0g.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-DHYql12c.js → ChevronDown-5ys0844E.js} +1 -1
  11. package/dist/client/assets/{ChevronRight-qRilEtY5.js → ChevronRight-B8put0eN.js} +1 -1
  12. package/dist/client/assets/{Clock-Ck0JfdvV.js → Clock-lQFxjk3U.js} +1 -1
  13. package/dist/client/assets/{Code01-CJtE_l6W.js → Code01-BZ3OnS6C.js} +1 -1
  14. package/dist/client/assets/{Container-DmRzes59.js → Container-CYXpgUH-.js} +1 -1
  15. package/dist/client/assets/{Copy01-_H9GhcIe.js → Copy01-RhM6GPKh.js} +1 -1
  16. package/dist/client/assets/{Dataflow03-DVn12h_U.js → Dataflow03-DQ3l0uK3.js} +1 -1
  17. package/dist/client/assets/{DotsHorizontal-wYWp0xyO.js → DotsHorizontal-CXUsxuDx.js} +1 -1
  18. package/dist/client/assets/{DotsVertical-DXaOiE8_.js → DotsVertical--UCmDvo-.js} +1 -1
  19. package/dist/client/assets/{Download01-CYVDY-WP.js → Download01-RzJvHlJ-.js} +1 -1
  20. package/dist/client/assets/{Edit01-BNuFD-E4.js → Edit01-pUCJ7HNy.js} +1 -1
  21. package/dist/client/assets/{Eye-DRUYj907.js → Eye-Dk7SbACo.js} +1 -1
  22. package/dist/client/assets/{File02-BTJzpWWh.js → File02-BuUCkwHe.js} +1 -1
  23. package/dist/client/assets/{File06-D7PEf5a6.js → File06-BiAuw-uA.js} +1 -1
  24. package/dist/client/assets/{FilterLines-DEUbdgpO.js → FilterLines-DAGdGqpc.js} +1 -1
  25. package/dist/client/assets/{Globe01-D38ZY7LP.js → Globe01-BW-Ba2wM.js} +1 -1
  26. package/dist/client/assets/{Globe02-C1VZ1Sth.js → Globe02-JrHK1B-m.js} +1 -1
  27. package/dist/client/assets/{Grid01-CSoBYZVu.js → Grid01-B0TbJ6AU.js} +1 -1
  28. package/dist/client/assets/{Hash02-70NdGfYY.js → Hash02-CjnFXmXE.js} +1 -1
  29. package/dist/client/assets/{Home02-TEl7q7Ca.js → Home02-DygdOIOt.js} +1 -1
  30. package/dist/client/assets/{Image01-B7uGBtXf.js → Image01-CjAt3NIh.js} +1 -1
  31. package/dist/client/assets/{Inbox01-D4AhYFiy.js → Inbox01-iihr_vaX.js} +1 -1
  32. package/dist/client/assets/{InfoCircle-1K9NYGAl.js → InfoCircle-DgqWMR4R.js} +1 -1
  33. package/dist/client/assets/{Key01-BabDlHce.js → Key01-CMhaJPaL.js} +1 -1
  34. package/dist/client/assets/{LinkExternal01-CpfoXnvY.js → LinkExternal01-zi5yhvLt.js} +1 -1
  35. package/dist/client/assets/{List-FibtrqYM.js → List-BIF-EvrZ.js} +1 -1
  36. package/dist/client/assets/{Loading01-Bl1Pk_oo.js → Loading01-BdPk5R9C.js} +1 -1
  37. package/dist/client/assets/{Lock01-BltwB-9b.js → Lock01-CPquSRx9.js} +1 -1
  38. package/dist/client/assets/{Pin01-BmPA32VH.js → Pin01-CR3q25pP.js} +1 -1
  39. package/dist/client/assets/{Play-CbvJYqM5.js → Play-C4BzmLav.js} +1 -1
  40. package/dist/client/assets/{Plus-CPirwa1w.js → Plus-BJkQ4qvs.js} +1 -1
  41. package/dist/client/assets/{RefreshCcw01-DpTBiD-b.js → RefreshCcw01-CMJUa0vf.js} +1 -1
  42. package/dist/client/assets/{RefreshCw01-B1WiG0_Y.js → RefreshCw01-CwUk_ICv.js} +1 -1
  43. package/dist/client/assets/{Rows03-CSDgVDop.js → Rows03-CaPKdXTG.js} +1 -1
  44. package/dist/client/assets/{Save01-LUKipDfp.js → Save01-pTgRxfLl.js} +1 -1
  45. package/dist/client/assets/{SearchMd-CmV0Tepn.js → SearchMd-BkraDgIf.js} +1 -1
  46. package/dist/client/assets/{Settings01-C0WLxd49.js → Settings01-JN6f9_qk.js} +1 -1
  47. package/dist/client/assets/{Shield01-BbVNhLRQ.js → Shield01-MwzSK_IW.js} +1 -1
  48. package/dist/client/assets/{Terminal-BNbAKfj5.js → Terminal-D0agZcO6.js} +1 -1
  49. package/dist/client/assets/{Tool01-XlUnVTZF.js → Tool01-VRdaPnbs.js} +1 -1
  50. package/dist/client/assets/{Trash01-CsD9CMZr.js → Trash01-BS69Rn26.js} +1 -1
  51. package/dist/client/assets/{Upload01-Tev8kZ4-.js → Upload01-bzy9bCNi.js} +1 -1
  52. package/dist/client/assets/{Users03-B5yv7ula.js → Users03-13i8se4V.js} +1 -1
  53. package/dist/client/assets/{XCircle-BGdKXUli.js → XCircle-Bnl7RwSj.js} +1 -1
  54. package/dist/client/assets/{XClose-CBFYdEvF.js → XClose-CIsPKYhP.js} +1 -1
  55. package/dist/client/assets/{agent-connections-preview-CDXgp0lX.js → agent-connections-preview-eu9uGyuz.js} +1 -1
  56. package/dist/client/assets/{agent-detail-H6KClcRl.js → agent-detail-wValyywk.js} +1 -1
  57. package/dist/client/assets/{agents-DMasQsS6.js → agents-BQf_kwYr.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-DB07UdJN.js → alert-dialog-CTIXpfNf.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-vsfBBopf.js → auth-catchall-Co8IiazS.js} +1 -1
  60. package/dist/client/assets/{avatar-DlH0tlJW.js → avatar-CUhi-qzb.js} +1 -1
  61. package/dist/client/assets/{badge-DApFAaFp.js → badge-BAIkBZff.js} +1 -1
  62. package/dist/client/assets/{binder-DA98_oix.js → binder-DZp12Y3n.js} +1 -1
  63. package/dist/client/assets/{breadcrumb-rKBAWCrS.js → breadcrumb-C2msqz1b.js} +1 -1
  64. package/dist/client/assets/{button-CZPRmDPf.js → button-BpEnz7t9.js} +1 -1
  65. package/dist/client/assets/{card-RVty8OZv.js → card-DILUA5lp.js} +1 -1
  66. package/dist/client/assets/{chart-IzVtzoKL.js → chart-yT8TpKTO.js} +1 -1
  67. package/dist/client/assets/{checkbox-BcFea8vV.js → checkbox-DsMm03Et.js} +1 -1
  68. package/dist/client/assets/{circle-alert-D5ZoEK1D.js → circle-alert-ld-jNaFW.js} +1 -1
  69. package/dist/client/assets/{collection-detail-D6YGM3Fm.js → collection-detail-Bps6AdGb.js} +1 -1
  70. package/dist/client/assets/{collection-tab-B5SlZhK5.js → collection-tab-Cb2OKmOU.js} +1 -1
  71. package/dist/client/assets/{collection-table-wrapper-Dg5F9IdT.js → collection-table-wrapper-BcYBtIFU.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-DBVkuHlL.js → collection-tabs-CJN7uriQ.js} +1 -1
  73. package/dist/client/assets/{command-BsoFq-dz.js → command-DFf8Hw6Q.js} +1 -1
  74. package/dist/client/assets/{connect-Bu-5xEzi.js → connect-CjDjmgo0.js} +1 -1
  75. package/dist/client/assets/{connection-card-DzedQCif.js → connection-card-Cxm32ifq.js} +1 -1
  76. package/dist/client/assets/connection-detail-3ns6XuoV.js +1 -0
  77. package/dist/client/assets/{connections-C2FCZthc.js → connections-DSBc-5jR.js} +1 -1
  78. package/dist/client/assets/constants-BU0VInXj.js +1 -0
  79. package/dist/client/assets/{constants-C2M7RsNt.js → constants-BoBHGSW8.js} +1 -1
  80. package/dist/client/assets/{context-BgVlhaqT.js → context-KYYCma1O.js} +14 -14
  81. package/dist/client/assets/{create-organization-dialog-Cwe3EZ2W.js → create-organization-dialog-pjo7W0nj.js} +1 -1
  82. package/dist/client/assets/{create-project-dialog-CICUNrHC.js → create-project-dialog-B6kkAgjA.js} +1 -1
  83. package/dist/client/assets/deco-constants-DGRap-0f.js +1 -0
  84. package/dist/client/assets/{dialog-DGoua-F-.js → dialog-CKyGpmoE.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-CEy971MU.js → dropdown-menu-Df5G5zUr.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-C0ICbkQo.js → dynamic-plugin-layout-C7RtCIjV.js} +1 -1
  87. package/dist/client/assets/{empty-state-C_zMtSoY.js → empty-state-BO_xpc7n.js} +1 -1
  88. package/dist/client/assets/{empty-state-C_g2tsPC.js → empty-state-CXRsSa_5.js} +1 -1
  89. package/dist/client/assets/{env-vars-editor-C8MNbLkk.js → env-vars-editor-CWL7WVCl.js} +1 -1
  90. package/dist/client/assets/{error-boundary-DqZtjxEB.js → error-boundary-DKBJmhkm.js} +1 -1
  91. package/dist/client/assets/{extract-connection-data-BdeTK8Ro.js → extract-connection-data-CVVFDhKc.js} +1 -1
  92. package/dist/client/assets/{file-browser-q6rlKrnm.js → file-browser-DFvCuor8.js} +2 -2
  93. package/dist/client/assets/{form-CFbWoYe6.js → form-DW9viO4r.js} +1 -1
  94. package/dist/client/assets/{grid-view-DPEEIdxr.js → grid-view-7qEPSoqU.js} +1 -1
  95. package/dist/client/assets/{home-CS0lvzq9.js → home-BNkgmOcB.js} +1 -1
  96. package/dist/client/assets/{index-Bl5KG9xm.js → index-42oFt7Vf.js} +1 -1
  97. package/dist/client/assets/{index-Dq6km8uv.js → index-C2ysDUMA.js} +1 -1
  98. package/dist/client/assets/{index-0fcwYTfR.js → index-CLnaj1R8.js} +40 -40
  99. package/dist/client/assets/{index-BpjZjisS.js → index-DYSwonwp.js} +1 -1
  100. package/dist/client/assets/{index-DrrqKIxq.js → index-Dj3-TAFC.js} +3 -3
  101. package/dist/client/assets/{index-DOQ9GLeH.js → index-LqsHIY-h.js} +1 -1
  102. package/dist/client/assets/{index-BzbwskdO.js → index-ZJgHVjA9.js} +1 -1
  103. package/dist/client/assets/{index-0yaYrNTf.js → index-pyLbkMHd.js} +1 -1
  104. package/dist/client/assets/{infiniteQueryObserver-BUe0-uqo.js → infiniteQueryObserver-CXT3S8iT.js} +1 -1
  105. package/dist/client/assets/{input-C2aMc-tK.js → input-BJdUVCMG.js} +1 -1
  106. package/dist/client/assets/{integration-icon-BVqKl9De.js → integration-icon-CitBcWGE.js} +1 -1
  107. package/dist/client/assets/{label-CoS6RHW3.js → label-CLOKtxmE.js} +1 -1
  108. package/dist/client/assets/{layout-D1KoVO75.js → layout-Bm2oJesN.js} +1 -1
  109. package/dist/client/assets/{localstorage-keys-Dn-W0lb3.js → localstorage-keys-Bxhx_7VG.js} +1 -1
  110. package/dist/client/assets/{login-VK-mokwH.js → login-C1DGsJab.js} +1 -1
  111. package/dist/client/assets/{markdown-BM0BQJdP.js → markdown-C6oZzbdV.js} +1 -1
  112. package/dist/client/assets/{mcp-oauth-DeNBGJ6_.js → mcp-oauth-BgGOZ6Yl.js} +1 -1
  113. package/dist/client/assets/{mcp-server-card-DacuauM5.js → mcp-server-card-Bs5CjNs8.js} +1 -1
  114. package/dist/client/assets/{mcp-server-detail-BLz5yvcq.js → mcp-server-detail-TYK4H4ys.js} +2 -2
  115. package/dist/client/assets/{members-DenaIJqs.js → members-Dtp6tHqv.js} +1 -1
  116. package/dist/client/assets/{monitoring-CJ1M1mUC.js → monitoring-D4yuvuET.js} +1 -1
  117. package/dist/client/assets/{monitoring-dashboard-edit-R1y62lIg.js → monitoring-dashboard-edit-BhZoWvFY.js} +1 -1
  118. package/dist/client/assets/{monitoring-dashboard-view-BKjuLdW2.js → monitoring-dashboard-view-D3TquP25.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-DX8HUvyR.js → oauth-callback-deuUTi00.js} +1 -1
  120. package/dist/client/assets/page-D2E5ZzCU.js +1 -0
  121. package/dist/client/assets/{page-sxnt39Ii.js → page-DOr5GIYN.js} +1 -1
  122. package/dist/client/assets/{plugin-empty-state-ChCFqmd0.js → plugin-empty-state-Bgs1lZLk.js} +1 -1
  123. package/dist/client/assets/{plugin-empty-state-D5H9c9JD.js → plugin-empty-state-TS8DmJJp.js} +1 -1
  124. package/dist/client/assets/{plugin-header-BWrOoTRo.js → plugin-header-BeCh7KII.js} +1 -1
  125. package/dist/client/assets/{plugin-header-CVre9sGT.js → plugin-header-CBzycd5v.js} +1 -1
  126. package/dist/client/assets/{popover-D64RiLTH.js → popover-BvNaYtjG.js} +1 -1
  127. package/dist/client/assets/project-layout-DUPzxc2p.js +1 -0
  128. package/dist/client/assets/{projects-list-DnkqBPpp.js → projects-list-BnTZ2oT-.js} +1 -1
  129. package/dist/client/assets/{ranking-layout-Wlr8fTR0.js → ranking-layout-CRWlaZ6i.js} +1 -1
  130. package/dist/client/assets/{readme-viewer-DHp79NQe.js → readme-viewer-BIh-4-st.js} +1 -1
  131. package/dist/client/assets/{registry-layout-DYNrneTu.js → registry-layout-DCY6UJG0.js} +1 -1
  132. package/dist/client/assets/{registry-utils-B3BaD7r8.js → registry-utils-fUWTJDy1.js} +1 -1
  133. package/dist/client/assets/{reports-layout-BbfZIE8e.js → reports-layout-D8otPyup.js} +1 -1
  134. package/dist/client/assets/{reset-password-BQ__IAnv.js → reset-password-B2xcsGcX.js} +1 -1
  135. package/dist/client/assets/{resizable-DAFw0KAb.js → resizable-B7M-KqaZ.js} +1 -1
  136. package/dist/client/assets/{save-actions-DGAmsooG.js → save-actions-CnZBYHaQ.js} +1 -1
  137. package/dist/client/assets/{scroll-area-DH4YtMqo.js → scroll-area-CK3Yk4ZG.js} +1 -1
  138. package/dist/client/assets/{select-L9VC3PJn.js → select-D3Cqu_xI.js} +1 -1
  139. package/dist/client/assets/shell-layout-gULKyNae.js +3 -0
  140. package/dist/client/assets/{skeleton-C7PEWbcl.js → skeleton-BEJPNsmx.js} +1 -1
  141. package/dist/client/assets/{spinner-BCc4DqcN.js → spinner-DP-rnGOg.js} +1 -1
  142. package/dist/client/assets/{store-invite-CVYdc9iu.js → store-invite-7kH88tcd.js} +1 -1
  143. package/dist/client/assets/{switch-EPGLJyI3.js → switch-Dc13mBjk.js} +1 -1
  144. package/dist/client/assets/{table-BKrr_ZVb.js → table-5zDBkIKt.js} +1 -1
  145. package/dist/client/assets/{tasks-Bn5ZyhP_.js → tasks-VFkq3Gln.js} +1 -1
  146. package/dist/client/assets/{textarea-bPVDAJiU.js → textarea-DQjt4TcB.js} +1 -1
  147. package/dist/client/assets/{time-range-picker-VyfEBU8i.js → time-range-picker-DlLbbTWq.js} +1 -1
  148. package/dist/client/assets/{toggle-group-Dp_hXbL3.js → toggle-group-7v5RUGzy.js} +1 -1
  149. package/dist/client/assets/{tools-list-BdI3Q54q.js → tools-list-CYXwR1B4.js} +1 -1
  150. package/dist/client/assets/{tooltip-Di7lOmib.js → tooltip-jCrVkUGG.js} +1 -1
  151. package/dist/client/assets/{topbar-portal-DKAZNOCc.js → topbar-portal-BgsY0Tym.js} +1 -1
  152. package/dist/client/assets/{typewriter-title-CJBquTSX.js → typewriter-title-CqQ7vz03.js} +1 -1
  153. package/dist/client/assets/{use-binding-lQ5At5HW.js → use-binding-D1PhjEYd.js} +1 -1
  154. package/dist/client/assets/{use-connection-DjTWTI9s.js → use-connection-CU2MpSPl.js} +1 -1
  155. package/dist/client/assets/{use-copy-Cy4z0myA.js → use-copy-52ScM36o.js} +1 -1
  156. package/dist/client/assets/{use-create-virtual-mcp-DyqNrljf.js → use-create-virtual-mcp-Dgc9LRMA.js} +1 -1
  157. package/dist/client/assets/{use-deco-chat-open-BuSNLd83.js → use-deco-chat-open-DEcM1zJp.js} +1 -1
  158. package/dist/client/assets/{use-install-from-registry-Dww4DIOX.js → use-install-from-registry-D0ma5MSu.js} +1 -1
  159. package/dist/client/assets/{use-list-state-1nCBLa98.js → use-list-state-CHfyM4gv.js} +1 -1
  160. package/dist/client/assets/{use-llm-Ce8POLUd.js → use-llm-CeHDiSJa.js} +1 -1
  161. package/dist/client/assets/{use-mcp-prompts-9RF1o3Vk.js → use-mcp-prompts-DKsdNnZ7.js} +1 -1
  162. package/dist/client/assets/{use-mcp-tools-mAwwC0gK.js → use-mcp-tools-D1hnuDSz.js} +1 -1
  163. package/dist/client/assets/{use-mobile-Cyo_7CU1.js → use-mobile-Dn42c33D.js} +1 -1
  164. package/dist/client/assets/{use-organization-settings-dfLWy4_Y.js → use-organization-settings-D7m45jWB.js} +1 -1
  165. package/dist/client/assets/{use-project-BLgGy5mK.js → use-project-BPC08iXP.js} +1 -1
  166. package/dist/client/assets/{use-settings-modal-BAyKuvP-.js → use-settings-modal-Ddi5OSQC.js} +1 -1
  167. package/dist/client/assets/{use-view-mode-Dz6ZqxC7.js → use-view-mode-D6ejd-aW.js} +1 -1
  168. package/dist/client/assets/{use-virtual-mcp-BA3G4Be3.js → use-virtual-mcp-BSB4fi0P.js} +1 -1
  169. package/dist/client/assets/useInfiniteQuery-CrVQg4J6.js +1 -0
  170. package/dist/client/assets/{useMutation-byIh8vPM.js → useMutation-DXvszu1D.js} +1 -1
  171. package/dist/client/assets/useQuery-7VkeRbRj.js +1 -0
  172. package/dist/client/assets/useSuspenseInfiniteQuery-BUl5uhPk.js +1 -0
  173. package/dist/client/assets/{workflow-j7kNV5HR.js → workflow-tlR1uEKO.js} +1 -1
  174. package/dist/client/index.html +1 -1
  175. package/package.json +1 -1
  176. package/dist/client/assets/Coins01-BilMBcS0.js +0 -1
  177. package/dist/client/assets/connection-detail-CbVv5VEj.js +0 -1
  178. package/dist/client/assets/constants-BHCPzANQ.js +0 -1
  179. package/dist/client/assets/page-B9pAkFvr.js +0 -1
  180. package/dist/client/assets/project-layout-BaHenL2i.js +0 -1
  181. package/dist/client/assets/shell-layout-BEcaEstI.js +0 -3
  182. package/dist/client/assets/useInfiniteQuery-CIiL-5Y3.js +0 -1
  183. package/dist/client/assets/useQuery-DcU1ldNG.js +0 -1
  184. package/dist/client/assets/useSuspenseInfiniteQuery-Dc-GS2UT.js +0 -1
@@ -1 +1 @@
1
- import{r as N,u as w,d as q,b as G,j as t,O as B,c as L,aE as Q,m as J,K as W,t as A}from"./index-DrrqKIxq.js";import{a as Z,u as V,e as Y}from"./constants-C2M7RsNt.js";import{C as X}from"./collection-tab-B5SlZhK5.js";import{g as ee,h as te}from"./use-connection-DjTWTI9s.js";import{B as I}from"./button-CZPRmDPf.js";import{E as R}from"./empty-state-C_g2tsPC.js";import{E as ne}from"./error-boundary-DqZtjxEB.js";import{P as x}from"./index-BzbwskdO.js";import{B as F,a as M,b as z,c as T}from"./breadcrumb-rKBAWCrS.js";import{a as se,b as ie}from"./use-binding-lQ5At5HW.js";import{i as oe}from"./AlertTriangle-Ddzav--o.js";import{i as le}from"./Loading01-Bl1Pk_oo.js";import{s as re}from"./RefreshCcw01-DpTBiD-b.js";import{u as ae}from"./useMutation-byIh8vPM.js";import{e as ce}from"./Dataflow03-DVn12h_U.js";import"./generate-id-Dyweu44Y.js";import"./collection-table-wrapper-Dg5F9IdT.js";import"./dropdown-menu-CEy971MU.js";import"./Check-CwhCIsIx.js";import"./ChevronRight-qRilEtY5.js";import"./ArrowUp-D7gFQV8U.js";import"./Grid01-CSoBYZVu.js";import"./List-FibtrqYM.js";import"./tooltip-Di7lOmib.js";import"./table-BKrr_ZVb.js";import"./card-RVty8OZv.js";import"./integration-icon-BVqKl9De.js";import"./Container-DmRzes59.js";import"./Copy01-_H9GhcIe.js";import"./DotsVertical-DXaOiE8_.js";import"./Edit01-BNuFD-E4.js";import"./Eye-DRUYj907.js";import"./Trash01-CsD9CMZr.js";import"./empty-state-C_zMtSoY.js";import"./Inbox01-D4AhYFiy.js";import"./use-list-state-1nCBLa98.js";import"./avatar-DlH0tlJW.js";import"./useQuery-DcU1ldNG.js";import"./use-view-mode-Dz6ZqxC7.js";import"./use-mobile-Cyo_7CU1.js";import"./constants-BHCPzANQ.js";import"./alert-dialog-DB07UdJN.js";import"./Plus-CPirwa1w.js";import"./layout-D1KoVO75.js";import"./SearchMd-CmV0Tepn.js";import"./input-C2aMc-tK.js";import"./binder-DA98_oix.js";const U=({size:n=24,color:e="currentColor",...i})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},N.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));U.displayName="Settings02";function de({title:n,description:e,wellKnownMcp:i,imageSrc:a,onConnected:o}){const c=ee(),{org:{slug:s}}=w(),{data:r}=q.useSession(),d=G(),[m,p]=N.useState(!1),l=async()=>{if(!(!i||!r?.user?.id)){p(!0);try{const f=await c.create.mutateAsync(i);o?.(f.id),d({to:"/$org/$project/mcps/$connectionId",params:{org:s,project:B,connectionId:f.id}})}finally{p(!1)}}},u=()=>{d({to:"/$org/$project/mcps",params:{org:s,project:B},search:{action:"create"}})};return t.jsx(R,{image:a?t.jsx("img",{src:a,alt:n,width:336,height:320,className:"max-w-full h-auto"}):null,title:n,description:e,actions:t.jsxs(t.Fragment,{children:[t.jsxs(I,{variant:"outline",onClick:l,disabled:m||!i,children:[i?.icon&&t.jsx("img",{src:i.icon,alt:"",className:"size-4"}),m?"Installing...":`Install ${i?.title||"MCP"}`]}),t.jsx(I,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function me(n){const e=L.c(35),{bindingName:i,collectionName:a,title:o,emptyState:c,wellKnownMcp:s}=n,{org:r}=w(),d=te();let m;e[0]!==d||e[1]!==i?(m={connections:d,binding:i},e[0]=d,e[1]=i,e[2]=m):m=e[2];const l=se(m)[0],u=ie(l);let f;if(e[3]!==a||e[4]!==u){let g;e[6]!==a?(g=$=>$.name.toLowerCase()===a.toLowerCase(),e[6]=a,e[7]=g):g=e[7],f=u.find(g),e[3]=a,e[4]=u,e[5]=f}else f=e[5];const S=f,[D,H]=N.useState(null),_=l&&S&&(l.id||D);let h;e[8]!==o?(h=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:o})})})})})}),e[8]=o,e[9]=h):h=e[9];let j;e[10]!==l||e[11]!==r||e[12]!==o?(j=g=>{const{error:$,resetError:K}=g;return t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(oe,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("h3",{className:"text-lg font-medium",children:["Failed to load ",o.toLowerCase()]}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:$?.message||"Unable to connect to the server. Please check that it is running and accessible."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(I,{variant:"outline",onClick:K,children:[t.jsx(re,{className:"size-4"}),"Try again"]}),l&&t.jsx(I,{variant:"outline",asChild:!0,children:t.jsxs(Q,{to:"/$org/$project/mcps/$connectionId",params:{org:r.slug,project:B,connectionId:l.id},search:{tab:"settings"},children:[t.jsx(U,{className:"size-4"}),"Connection Settings"]})})]})]})},e[10]=l,e[11]=r,e[12]=o,e[13]=j):j=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),e[14]=k):k=e[14];let b;e[15]!==o?(b=o.toLowerCase(),e[15]=o,e[16]=b):b=e[16];let C;e[17]!==b?(C=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[k,t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",b,"..."]})]}),e[17]=b,e[18]=C):C=e[18];let y;e[19]!==S||e[20]!==l||e[21]!==c||e[22]!==r||e[23]!==_||e[24]!==s?(y=_?t.jsx(X,{connectionId:l.id,org:r.slug,activeCollection:S}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(de,{title:c.title,description:c.description,wellKnownMcp:s,imageSrc:c.imageSrc,onConnected:g=>{H(g)}})}),e[19]=S,e[20]=l,e[21]=c,e[22]=r,e[23]=_,e[24]=s,e[25]=y):y=e[25];let P;e[26]!==C||e[27]!==y?(P=t.jsx(N.Suspense,{fallback:C,children:y}),e[26]=C,e[27]=y,e[28]=P):P=e[28];let E;e[29]!==j||e[30]!==P?(E=t.jsx(x.Content,{children:t.jsx(ne,{fallback:j,children:P})}),e[29]=j,e[30]=P,e[31]=E):E=e[31];let v;return e[32]!==E||e[33]!==h?(v=t.jsxs(x,{children:[h,E]}),e[32]=E,e[33]=h,e[34]=v):v=e[34],v}function ue(){const n=L.c(12),{org:e,project:i}=w(),a=J();let o;n[0]!==e.id?(o={connectionId:Z,orgId:e.id},n[0]=e.id,n[1]=o):o=n[1];const c=V(o);let s;n[2]!==c||n[3]!==i?(s=async p=>{const l=i.enabledPlugins??[];if(l.includes(p))return;const u=[...l,p],f=await c.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,enabledPlugins:u}});return f.structuredContent??f},n[2]=c,n[3]=i,n[4]=s):s=n[4];let r;n[5]!==e.id||n[6]!==i||n[7]!==a?(r=()=>{a.invalidateQueries({queryKey:W.project(e.id,i.slug)}),a.invalidateQueries({queryKey:W.projects(e.id)})},n[5]=e.id,n[6]=i,n[7]=a,n[8]=r):r=n[8];let d;return n[9]!==s||n[10]!==r?(d={mutationFn:s,onSuccess:r,onError:pe},n[9]=s,n[10]=r,n[11]=d):d=n[11],ae(d)}function pe(n){A.error("Failed to enable plugin: "+(n instanceof Error?n.message:"Unknown error"))}function fe(n){const e=L.c(12),{pluginId:i,title:a,description:o,icon:c}=n,s=ue();let r;e[0]!==s||e[1]!==i?(r=async()=>{try{await s.mutateAsync(i),A.success("Plugin enabled!")}catch{}},e[0]=s,e[1]=i,e[2]=r):r=e[2];const d=r,m=c??null,p=s.isPending?"Enabling…":"Enable plugin";let l;e[3]!==s.isPending||e[4]!==d||e[5]!==p?(l=t.jsx(I,{onClick:d,disabled:s.isPending,children:p}),e[3]=s.isPending,e[4]=d,e[5]=p,e[6]=l):l=e[6];let u;return e[7]!==o||e[8]!==m||e[9]!==l||e[10]!==a?(u=t.jsx(R,{image:m,title:a,description:o,actions:l}),e[7]=o,e[8]=m,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}const O="workflows";function at(){const n=L.c(3),{project:e}=w();if(!(e.enabledPlugins??[]).includes(O)){let c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:"Workflows"})})})})})}),n[0]=c):c=n[0];let s;return n[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs(x,{children:[c,t.jsx(x.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(fe,{pluginId:O,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(ce,{className:"size-8 text-muted-foreground"})})})})})]}),n[1]=s):s=n[1],s}let o;return n[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(me,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Run durable MCP tool calls in background."},wellKnownMcp:Y()}),n[2]=o):o=n[2],o}export{at as default};
1
+ import{r as N,u as w,d as q,b as G,j as t,O as B,c as L,aE as Q,m as J,K as W,t as A}from"./index-Dj3-TAFC.js";import{a as Z,u as V,e as Y}from"./constants-BoBHGSW8.js";import{C as X}from"./collection-tab-Cb2OKmOU.js";import{g as ee,h as te}from"./use-connection-CU2MpSPl.js";import{B as I}from"./button-BpEnz7t9.js";import{E as R}from"./empty-state-CXRsSa_5.js";import{E as ne}from"./error-boundary-DKBJmhkm.js";import{P as x}from"./index-ZJgHVjA9.js";import{B as F,a as M,b as z,c as T}from"./breadcrumb-C2msqz1b.js";import{a as se,b as ie}from"./use-binding-D1PhjEYd.js";import{i as oe}from"./AlertTriangle-BQr7kJDW.js";import{i as le}from"./Loading01-BdPk5R9C.js";import{s as re}from"./RefreshCcw01-CMJUa0vf.js";import{u as ae}from"./useMutation-DXvszu1D.js";import{e as ce}from"./Dataflow03-DQ3l0uK3.js";import"./generate-id-Dyweu44Y.js";import"./collection-table-wrapper-BcYBtIFU.js";import"./dropdown-menu-Df5G5zUr.js";import"./Check-COoTrHCh.js";import"./ChevronRight-B8put0eN.js";import"./ArrowUp-Bt1al9WB.js";import"./Grid01-B0TbJ6AU.js";import"./List-BIF-EvrZ.js";import"./tooltip-jCrVkUGG.js";import"./table-5zDBkIKt.js";import"./card-DILUA5lp.js";import"./integration-icon-CitBcWGE.js";import"./Container-CYXpgUH-.js";import"./Copy01-RhM6GPKh.js";import"./DotsVertical--UCmDvo-.js";import"./Edit01-pUCJ7HNy.js";import"./Eye-Dk7SbACo.js";import"./Trash01-BS69Rn26.js";import"./empty-state-BO_xpc7n.js";import"./Inbox01-iihr_vaX.js";import"./use-list-state-CHfyM4gv.js";import"./avatar-CUhi-qzb.js";import"./useQuery-7VkeRbRj.js";import"./use-view-mode-D6ejd-aW.js";import"./use-mobile-Dn42c33D.js";import"./constants-BU0VInXj.js";import"./alert-dialog-CTIXpfNf.js";import"./Plus-BJkQ4qvs.js";import"./layout-Bm2oJesN.js";import"./SearchMd-BkraDgIf.js";import"./input-BJdUVCMG.js";import"./binder-DZp12Y3n.js";const U=({size:n=24,color:e="currentColor",...i})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},N.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));U.displayName="Settings02";function de({title:n,description:e,wellKnownMcp:i,imageSrc:a,onConnected:o}){const c=ee(),{org:{slug:s}}=w(),{data:r}=q.useSession(),d=G(),[m,p]=N.useState(!1),l=async()=>{if(!(!i||!r?.user?.id)){p(!0);try{const f=await c.create.mutateAsync(i);o?.(f.id),d({to:"/$org/$project/mcps/$connectionId",params:{org:s,project:B,connectionId:f.id}})}finally{p(!1)}}},u=()=>{d({to:"/$org/$project/mcps",params:{org:s,project:B},search:{action:"create"}})};return t.jsx(R,{image:a?t.jsx("img",{src:a,alt:n,width:336,height:320,className:"max-w-full h-auto"}):null,title:n,description:e,actions:t.jsxs(t.Fragment,{children:[t.jsxs(I,{variant:"outline",onClick:l,disabled:m||!i,children:[i?.icon&&t.jsx("img",{src:i.icon,alt:"",className:"size-4"}),m?"Installing...":`Install ${i?.title||"MCP"}`]}),t.jsx(I,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function me(n){const e=L.c(35),{bindingName:i,collectionName:a,title:o,emptyState:c,wellKnownMcp:s}=n,{org:r}=w(),d=te();let m;e[0]!==d||e[1]!==i?(m={connections:d,binding:i},e[0]=d,e[1]=i,e[2]=m):m=e[2];const l=se(m)[0],u=ie(l);let f;if(e[3]!==a||e[4]!==u){let g;e[6]!==a?(g=$=>$.name.toLowerCase()===a.toLowerCase(),e[6]=a,e[7]=g):g=e[7],f=u.find(g),e[3]=a,e[4]=u,e[5]=f}else f=e[5];const S=f,[D,H]=N.useState(null),_=l&&S&&(l.id||D);let h;e[8]!==o?(h=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:o})})})})})}),e[8]=o,e[9]=h):h=e[9];let j;e[10]!==l||e[11]!==r||e[12]!==o?(j=g=>{const{error:$,resetError:K}=g;return t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(oe,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("h3",{className:"text-lg font-medium",children:["Failed to load ",o.toLowerCase()]}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:$?.message||"Unable to connect to the server. Please check that it is running and accessible."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(I,{variant:"outline",onClick:K,children:[t.jsx(re,{className:"size-4"}),"Try again"]}),l&&t.jsx(I,{variant:"outline",asChild:!0,children:t.jsxs(Q,{to:"/$org/$project/mcps/$connectionId",params:{org:r.slug,project:B,connectionId:l.id},search:{tab:"settings"},children:[t.jsx(U,{className:"size-4"}),"Connection Settings"]})})]})]})},e[10]=l,e[11]=r,e[12]=o,e[13]=j):j=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),e[14]=k):k=e[14];let b;e[15]!==o?(b=o.toLowerCase(),e[15]=o,e[16]=b):b=e[16];let C;e[17]!==b?(C=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[k,t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",b,"..."]})]}),e[17]=b,e[18]=C):C=e[18];let y;e[19]!==S||e[20]!==l||e[21]!==c||e[22]!==r||e[23]!==_||e[24]!==s?(y=_?t.jsx(X,{connectionId:l.id,org:r.slug,activeCollection:S}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(de,{title:c.title,description:c.description,wellKnownMcp:s,imageSrc:c.imageSrc,onConnected:g=>{H(g)}})}),e[19]=S,e[20]=l,e[21]=c,e[22]=r,e[23]=_,e[24]=s,e[25]=y):y=e[25];let P;e[26]!==C||e[27]!==y?(P=t.jsx(N.Suspense,{fallback:C,children:y}),e[26]=C,e[27]=y,e[28]=P):P=e[28];let E;e[29]!==j||e[30]!==P?(E=t.jsx(x.Content,{children:t.jsx(ne,{fallback:j,children:P})}),e[29]=j,e[30]=P,e[31]=E):E=e[31];let v;return e[32]!==E||e[33]!==h?(v=t.jsxs(x,{children:[h,E]}),e[32]=E,e[33]=h,e[34]=v):v=e[34],v}function ue(){const n=L.c(12),{org:e,project:i}=w(),a=J();let o;n[0]!==e.id?(o={connectionId:Z,orgId:e.id},n[0]=e.id,n[1]=o):o=n[1];const c=V(o);let s;n[2]!==c||n[3]!==i?(s=async p=>{const l=i.enabledPlugins??[];if(l.includes(p))return;const u=[...l,p],f=await c.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,enabledPlugins:u}});return f.structuredContent??f},n[2]=c,n[3]=i,n[4]=s):s=n[4];let r;n[5]!==e.id||n[6]!==i||n[7]!==a?(r=()=>{a.invalidateQueries({queryKey:W.project(e.id,i.slug)}),a.invalidateQueries({queryKey:W.projects(e.id)})},n[5]=e.id,n[6]=i,n[7]=a,n[8]=r):r=n[8];let d;return n[9]!==s||n[10]!==r?(d={mutationFn:s,onSuccess:r,onError:pe},n[9]=s,n[10]=r,n[11]=d):d=n[11],ae(d)}function pe(n){A.error("Failed to enable plugin: "+(n instanceof Error?n.message:"Unknown error"))}function fe(n){const e=L.c(12),{pluginId:i,title:a,description:o,icon:c}=n,s=ue();let r;e[0]!==s||e[1]!==i?(r=async()=>{try{await s.mutateAsync(i),A.success("Plugin enabled!")}catch{}},e[0]=s,e[1]=i,e[2]=r):r=e[2];const d=r,m=c??null,p=s.isPending?"Enabling…":"Enable plugin";let l;e[3]!==s.isPending||e[4]!==d||e[5]!==p?(l=t.jsx(I,{onClick:d,disabled:s.isPending,children:p}),e[3]=s.isPending,e[4]=d,e[5]=p,e[6]=l):l=e[6];let u;return e[7]!==o||e[8]!==m||e[9]!==l||e[10]!==a?(u=t.jsx(R,{image:m,title:a,description:o,actions:l}),e[7]=o,e[8]=m,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}const O="workflows";function at(){const n=L.c(3),{project:e}=w();if(!(e.enabledPlugins??[]).includes(O)){let c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:"Workflows"})})})})})}),n[0]=c):c=n[0];let s;return n[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs(x,{children:[c,t.jsx(x.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(fe,{pluginId:O,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(ce,{className:"size-8 text-muted-foreground"})})})})})]}),n[1]=s):s=n[1],s}let o;return n[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(me,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Run durable MCP tool calls in background."},wellKnownMcp:Y()}),n[2]=o):o=n[2],o}export{at as default};
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <title>MCP Mesh</title>
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
- <script type="module" crossorigin src="/assets/index-DrrqKIxq.js"></script>
6
+ <script type="module" crossorigin src="/assets/index-Dj3-TAFC.js"></script>
7
7
  <link rel="stylesheet" crossorigin href="/assets/index-BHAz67cr.css">
8
8
  </head>
9
9
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.122.0",
3
+ "version": "2.123.0",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{r}from"./index-DrrqKIxq.js";const i=({size:e=24,color:t="currentColor",...o})=>r.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},r.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));i.displayName="Coins01";export{i};
@@ -1 +0,0 @@
1
- import{c as X,j as t,b as Re,O as Se,aE as at,u as ct,bA as Ge,ai as vt,p as yt,by as Xe,r as Y,o as lt,b8 as Nt,bg as _t,s as W,aj as Je,ak as Ct,e as St,a as Tt,m as wt,k as kt,l as Pt,i as It,t as Ce,K as Ye}from"./index-DrrqKIxq.js";import{E as Ne,C as dt}from"./empty-state-C_g2tsPC.js";import{E as mt}from"./error-boundary-DqZtjxEB.js";import{E as $t,r as At,e as ut}from"./env-vars-editor-C8MNbLkk.js";import{P as Ke}from"./index-BpjZjisS.js";import{S as Vt}from"./save-actions-DGAmsooG.js";import{b as Mt,a as Dt}from"./use-binding-lQ5At5HW.js";import{u as Ot,S as Et}from"./index-Dq6km8uv.js";import{f as We,g as pt}from"./use-connection-DjTWTI9s.js";import{u as Rt}from"./constants-C2M7RsNt.js";import{d as Lt}from"./use-mcp-tools-mAwwC0gK.js";import{b as Ut,d as Ft}from"./use-mcp-prompts-9RF1o3Vk.js";import{a as Bt}from"./mcp-oauth-DeNBGJ6_.js";import{b as Ze,c as zt,d as Xt,e as Kt,B as Wt,a as qt}from"./breadcrumb-rKBAWCrS.js";import{B as Be}from"./button-CZPRmDPf.js";import{C as Ht}from"./collection-tabs-DBVkuHlL.js";import{i as Ee}from"./Loading01-Bl1Pk_oo.js";import{V as qe,a as Qt}from"./layout-D1KoVO75.js";import{C as Gt}from"./collection-tab-B5SlZhK5.js";import{I as Le}from"./integration-icon-BVqKl9De.js";import{B as ze}from"./badge-DApFAaFp.js";import{D as Jt,a as Yt,b as Zt,c as et}from"./dropdown-menu-CEy971MU.js";import{F as G,a as es,b as J,d as q,f as Z,c as te,e as ts}from"./form-CFbWoYe6.js";import{I as ee}from"./input-C2aMc-tK.js";import{S as tt,a as st,b as nt,c as ot,d as Q}from"./select-L9VC3PJn.js";import{i as ft}from"./CheckCircle-gVXszZ9H.js";import{t as ss}from"./ChevronDown-DHYql12c.js";import{n as ns}from"./Container-DmRzes59.js";import{s as Oe}from"./Globe02-C1VZ1Sth.js";import{s as os}from"./RefreshCcw01-DpTBiD-b.js";import{i as rs}from"./Terminal-BNbAKfj5.js";import{s as is}from"./Trash01-CsD9CMZr.js";import{t as He}from"./Users03-B5yv7ula.js";import{s as as}from"./XClose-CBFYdEvF.js";import{U as cs}from"./use-list-state-1nCBLa98.js";import{b as ls,a as ds}from"./use-virtual-mcp-BA3G4Be3.js";import{i as ms}from"./ChevronRight-qRilEtY5.js";import{s as us}from"./Plus-CPirwa1w.js";import{f as ps}from"./formatDistanceToNow-Cb2QZZJn.js";import{a as xt,C as ht}from"./collection-table-wrapper-Dg5F9IdT.js";import{C as gt}from"./card-RVty8OZv.js";import{R as fs}from"./readme-viewer-DHp79NQe.js";import{T as xs}from"./tools-list-BdI3Q54q.js";import"./SearchMd-CmV0Tepn.js";import"./AlertTriangle-Ddzav--o.js";import"./tooltip-Di7lOmib.js";import"./Pin01-BmPA32VH.js";import"./use-organization-settings-dfLWy4_Y.js";import"./useMutation-byIh8vPM.js";import"./Save01-LUKipDfp.js";import"./binder-DA98_oix.js";import"./File06-D7PEf5a6.js";import"./Key01-BabDlHce.js";import"./constants-BHCPzANQ.js";import"./registry-utils-B3BaD7r8.js";import"./extract-connection-data-BdeTK8Ro.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-Dww4DIOX.js";import"./index-Bl5KG9xm.js";import"./circle-alert-D5ZoEK1D.js";import"./index-DOQ9GLeH.js";import"./index-0fcwYTfR.js";import"./context-BgVlhaqT.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-Ce8POLUd.js";import"./useQuery-DcU1ldNG.js";import"./localstorage-keys-Dn-W0lb3.js";import"./skeleton-C7PEWbcl.js";import"./popover-D64RiLTH.js";import"./Grid01-CSoBYZVu.js";import"./Image01-B7uGBtXf.js";import"./Settings01-C0WLxd49.js";import"./useSuspenseInfiniteQuery-Dc-GS2UT.js";import"./infiniteQueryObserver-BUe0-uqo.js";import"./spinner-BCc4DqcN.js";import"./dialog-DGoua-F-.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-D7gFQV8U.js";import"./Edit01-BNuFD-E4.js";import"./XCircle-BGdKXUli.js";import"./AlertCircle-xlmc_ewP.js";import"./use-deco-chat-open-BuSNLd83.js";import"./ArrowLeft-Cm3_NyIq.js";import"./use-copy-Cy4z0myA.js";import"./Check-CwhCIsIx.js";import"./Code01-CJtE_l6W.js";import"./use-create-virtual-mcp-DyqNrljf.js";import"./Coins01-BilMBcS0.js";import"./marked.esm-BaswSlok.js";import"./markdown-BM0BQJdP.js";import"./Copy01-_H9GhcIe.js";import"./Clock-Ck0JfdvV.js";import"./index-BzbwskdO.js";import"./use-mobile-Cyo_7CU1.js";import"./DotsVertical-DXaOiE8_.js";import"./Eye-DRUYj907.js";import"./empty-state-C_zMtSoY.js";import"./Inbox01-D4AhYFiy.js";import"./alert-dialog-DB07UdJN.js";import"./label-CoS6RHW3.js";import"./avatar-DlH0tlJW.js";import"./use-view-mode-Dz6ZqxC7.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./List-FibtrqYM.js";import"./table-BKrr_ZVb.js";import"./RefreshCw01-B1WiG0_Y.js";function hs(s){const e=X.c(14),{virtualMcp:n,org:o}=s;let r;e[0]!==o||e[1]!==n.id?(r={org:o,project:Se,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=r):r=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(He,{size:16}),e[3]=a):a=e[3];let c;e[4]!==n.icon||e[5]!==n.title?(c=t.jsx(Le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=c):c=e[6];let u;e[7]!==n.title?(u=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ms,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let l;return e[10]!==r||e[11]!==c||e[12]!==u?(l=t.jsxs(at,{to:"/$org/$project/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,u,f]}),e[10]=r,e[11]=c,e[12]=u,e[13]=l):l=e[13],l}function rt(s){const e=X.c(20),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:u}=s,f=Re(),l=ds();let x;e[0]!==l.create||e[1]!==r||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==c?(x=async()=>{const m=await l.create.mutateAsync({title:`${o} Agent`,description:r??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:c,project:Se,agentId:m.id}})},e[0]=l.create,e[1]=r,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=c,e[7]=x):x=e[7];const p=x;if(u){let m;e[8]!==l.create.isPending?(m=l.create.isPending?t.jsx(Ee,{size:16,className:"animate-spin"}):t.jsx(us,{size:16}),e[8]=l.create.isPending,e[9]=m):m=e[9];let d;return e[10]!==l.create.isPending||e[11]!==p||e[12]!==m?(d=t.jsx(Be,{variant:"ghost",className:"size-6 p-0",onClick:p,disabled:l.create.isPending,children:m}),e[10]=l.create.isPending,e[11]=p,e[12]=m,e[13]=d):d=e[13],d}let i;e[14]!==l.create.isPending?(i=l.create.isPending?t.jsx(Ee,{className:"animate-spin text-muted-foreground"}):t.jsx(He,{className:"size-3 text-muted-foreground"}),e[14]=l.create.isPending,e[15]=i):i=e[15];let b;return e[16]!==l.create.isPending||e[17]!==p||e[18]!==i?(b=t.jsxs(Be,{variant:"outline",size:"sm",onClick:p,disabled:l.create.isPending,children:[i,"Create an agent"]}),e[16]=l.create.isPending,e[17]=p,e[18]=i,e[19]=b):b=e[19],b}function gs(s){const e=X.c(26),{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c}=s;let u;e[0]!==n?(u={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=u):u=e[1];const f=ls(u);if(!(f.length>0)){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=d):d=e[2];let j;return e[3]!==r||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==c?(j=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[d,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=a,e[5]=n,e[6]=o,e[7]=c,e[8]=j):j=e[8],j}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let p;e[10]!==r||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==c?(p=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(rt,{connectionId:n,connectionTitle:o,connectionDescription:r,connectionIcon:a,org:c,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=a,e[12]=n,e[13]=o,e[14]=c,e[15]=p):p=e[15];let i;if(e[16]!==c||e[17]!==f){let d;e[19]!==c?(d=j=>t.jsx(hs,{virtualMcp:j,org:c},j.id),e[19]=c,e[20]=d):d=e[20],i=f.map(d),e[16]=c,e[17]=f,e[18]=i}else i=e[18];let b;e[21]!==i?(b=t.jsx("div",{className:"flex flex-col gap-2",children:i}),e[21]=i,e[22]=b):b=e[22];let m;return e[23]!==p||e[24]!==b?(m=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,b]}),e[23]=p,e[24]=b,e[25]=m):m=e[25],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:r}){const a=Ge({control:s.control,name:"ui_type"}),c=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:u}=vt(),f=(()=>{if(typeof c!="string"||!c)return!1;try{const i=new URL(c);return i.hostname==="api.githubcopilot.com"&&i.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),l=u||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?yt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(He,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsxs(st,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(Oe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(nt,{})]})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:"HTTP"}),t.jsx(Q,{value:"SSE",children:"SSE"}),t.jsx(Q,{value:"Websocket",children:"Websocket"}),l&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:"NPX Package"}),t.jsx(Q,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:b})=>t.jsx(J,{className:"flex-1 min-w-0",children:t.jsx(q,{children:t.jsx(ee,{placeholder:"https://example.com/mcp",...b,value:b.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(tt,{value:i.value,onValueChange:i.onChange,children:[t.jsx(q,{children:t.jsx(st,{className:"h-10",children:t.jsx(nt,{})})}),t.jsxs(ot,{children:[t.jsx(Q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Oe,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ns,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(rs,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(Z,{})]})}),a==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"node, bun, python...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"arg1 arg2 --flag value",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(q,{children:t.jsx(ee,{placeholder:"/path/to/project (optional)",...i,value:i.value||"",className:"h-10 rounded-lg"})}),t.jsx(Z,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(q,{children:t.jsx($t,{value:i.value??[],onChange:i.onChange})}),t.jsx(Z,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:i})=>t.jsxs(J,{className:"flex flex-col gap-3",children:[t.jsx(te,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Jt,{children:[t.jsx(Yt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(ze,{variant:"success",className:"gap-1.5",children:[t.jsx(ft,{size:12}),"Authenticated via OAuth",t.jsx(ss,{size:12})]})})}),t.jsxs(Zt,{align:"start",children:[t.jsxs(et,{onClick:o,children:[t.jsx(os,{size:16}),"Re-authenticate"]}),t.jsxs(et,{variant:"destructive",onClick:r,children:[t.jsx(is,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&i.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>i.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(as,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(ee,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...i,value:i.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(ts,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Z,{})]})})]})}function bs(s){const e=X.c(43),{form:n,connection:o,isMCPAuthenticated:r,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:u}=s,{org:f}=ct();let l;e[0]!==o.icon||e[1]!==o.title?(l=t.jsx(Le,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=l):l=e[2];let x;e[3]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(G,{control:n.control,name:"title",render:ys}),t.jsx(G,{control:n.control,name:"description",render:vs})]}),e[3]=n.control,e[4]=x):x=e[4];let p;e[5]!==l||e[6]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[l,x]}),e[5]=l,e[6]=x,e[7]=p):p=e[7];let i;e[8]!==o||e[9]!==n||e[10]!==a||e[11]!==c||e[12]!==u?(i=t.jsx(js,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:c,onRemoveOAuth:u}),e[8]=o,e[9]=n,e[10]=a,e[11]=c,e[12]=u,e[13]=i):i=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=b):b=e[14];let m;e[15]!==r?(m=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[b,r?t.jsxs(ze,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ft,{size:12}),"Connected"]}):t.jsx(ze,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=m):m=e[16];let d;e[17]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=d):d=e[17];let j;e[18]!==o.created_by?(j=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[d,t.jsx(cs,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=j):j=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=w):w=e[20];let v;e[21]!==o.updated_at?(v=o.updated_at?ps(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=v):v=e[22];let N;e[23]!==v?(N=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[w,t.jsx("span",{className:"text-sm text-foreground",children:v})]}),e[23]=v,e[24]=N):N=e[24];let _;e[25]!==N||e[26]!==m||e[27]!==j?(_=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[m,j,N]}),e[25]=N,e[26]=m,e[27]=j,e[28]=_):_=e[28];let y;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==f.slug?(y=t.jsx(gs,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=f.slug,e[34]=y):y=e[34];let h;e[35]!==_||e[36]!==y||e[37]!==p||e[38]!==i?(h=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[p,i,_,y]}),e[35]=_,e[36]=y,e[37]=p,e[38]=i,e[39]=h):h=e[39];let k;return e[40]!==n||e[41]!==h?(k=t.jsx(es,{...n,children:h}),e[40]=n,e[41]=h,e[42]=k):k=e[42],k}function vs(s){const{field:e}=s;return t.jsxs(J,{className:"w-full space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Z,{})]})}function ys(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 space-y-0",children:[t.jsx(q,{children:t.jsx(ee,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(Z,{})]})}function Ns(s){const e=X.c(42),{prompts:n,connectionId:o,org:r,connectionTitle:a,connectionIcon:c,onPromptClick:u,showToolbar:f,emptyMessage:l}=s,x=f===void 0?!0:f,p=l===void 0?"This connection doesn't have any prompts yet.":l,i=Re(),m=Xe().location.href,[d,j]=Y.useState(""),[w,v]=Y.useState("table"),[N,_]=Y.useState("name"),[y,h]=Y.useState("asc");let k;e[0]!==y||e[1]!==N?(k=S=>{N===S?(h(ws),y==="desc"&&_(void 0)):(_(S),h("asc"))},e[0]=y,e[1]=N,e[2]=k):k=e[2];const B=k;let $;e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==r?($=S=>{u?u(S):o&&r&&i({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:Se,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(S.name)}})},e[3]=o,e[4]=i,e[5]=u,e[6]=r,e[7]=$):$=e[7];const M=$;let A;if(e[8]!==n||e[9]!==d||e[10]!==y||e[11]!==N){const S=!n||n.length===0?[]:d.trim()?(()=>{const H=d.toLowerCase();return n.filter(K=>K.name.toLowerCase().includes(H)||K.description&&K.description.toLowerCase().includes(H))})():n;A=!N||!y?S:[...S].sort((H,K)=>{const se=H[N]||"",ne=K[N]||"",oe=String(se).localeCompare(String(ne));return y==="asc"?oe:-oe}),e[8]=n,e[9]=d,e[10]=y,e[11]=N,e[12]=A}else A=e[12];const I=A;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:Ts,sortable:!0},{id:"description",header:"Description",render:Ss,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const L=R;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=L.filter(Cs).map(_s),e[14]=C):C=e[14];const z=C;let P;e[15]!==c||e[16]!==a||e[17]!==B||e[18]!==x||e[19]!==y||e[20]!==N||e[21]!==m||e[22]!==w?(P=x&&t.jsxs(qe,{children:[t.jsx(ht,{viewMode:w,onViewModeChange:v,sortKey:N,sortDirection:y,onSort:B,sortOptions:z}),t.jsx(Ke,{title:a?`${a}: Prompts`:"Prompts",url:m,icon:c??"description"})]}),e[15]=c,e[16]=a,e[17]=B,e[18]=x,e[19]=y,e[20]=N,e[21]=m,e[22]=w,e[23]=P):P=e[23];let D;e[24]===Symbol.for("react.memo_cache_sentinel")?(D=S=>{S.key==="Escape"&&(j(""),S.target.blur())},e[24]=D):D=e[24];let V;e[25]!==d?(V=t.jsx(dt,{value:d,onChange:j,placeholder:"Search prompts...",onKeyDown:D}),e[25]=d,e[26]=V):V=e[26];let g;e[27]!==p||e[28]!==M||e[29]!==B||e[30]!==d||e[31]!==y||e[32]!==N||e[33]!==I||e[34]!==w?(g=w==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:I.length===0?t.jsx(Ne,{image:null,title:d?"No prompts found":"No prompts available",description:d?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:I.map(S=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>M(S),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Le,{icon:null,name:S.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:S.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:S.description||"No description"})]})]})},S.name))})}):t.jsx(xt,{columns:L,data:I,isLoading:!1,sortKey:N,sortDirection:y,onSort:B,onRowClick:S=>M(S),emptyState:t.jsx(Ne,{image:null,title:d?"No prompts found":"No prompts available",description:d?"Try adjusting your search terms":p})}),e[27]=p,e[28]=M,e[29]=B,e[30]=d,e[31]=y,e[32]=N,e[33]=I,e[34]=w,e[35]=g):g=e[35];let F;e[36]!==V||e[37]!==g?(F=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,g]}),e[36]=V,e[37]=g,e[38]=F):F=e[38];let O;return e[39]!==F||e[40]!==P?(O=t.jsxs(t.Fragment,{children:[P,F]}),e[39]=F,e[40]=P,e[41]=O):O=e[41],O}function _s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Cs(s){return s.sortable}function Ss(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ts(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ws(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function ks(s){const e=X.c(6),{prompts:n,connectionId:o,org:r}=s,a=We(o),c=a?.title,u=a?.icon;let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==u?(f=t.jsx(Ns,{prompts:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:u}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=u,e[5]=f):f=e[5],f}function Ps(s){const e=X.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(fs,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function Is(s){const e=X.c(39),{resources:n,connectionTitle:o,connectionIcon:r,onResourceClick:a,showToolbar:c,emptyMessage:u}=s,f=c===void 0?!0:c,l=u===void 0?"This connection doesn't have any resources yet.":u,p=Xe().location.href,[i,b]=Y.useState(""),[m,d]=Y.useState("table"),[j,w]=Y.useState("name"),[v,N]=Y.useState("asc");let _;e[0]!==v||e[1]!==j?(_=g=>{j===g?(N(Es),v==="desc"&&w(void 0)):(w(g),N("asc"))},e[0]=v,e[1]=j,e[2]=_):_=e[2];const y=_;let h;e[3]!==a?(h=g=>{a&&a(g)},e[3]=a,e[4]=h):h=e[4];const k=h;let B;if(e[5]!==n||e[6]!==i||e[7]!==v||e[8]!==j){const g=!n||n.length===0?[]:i.trim()?(()=>{const F=i.toLowerCase();return n.filter(O=>O.uri.toLowerCase().includes(F)||O.name&&O.name.toLowerCase().includes(F)||O.description&&O.description.toLowerCase().includes(F))})():n;B=!j||!v?g:[...g].sort((F,O)=>{const S=F[j]||"",H=O[j]||"",K=String(S).localeCompare(String(H));return v==="asc"?K:-K}),e[5]=n,e[6]=i,e[7]=v,e[8]=j,e[9]=B}else B=e[9];const $=B;let M;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=[{id:"name",header:"Name",render:Os,sortable:!0},{id:"uri",header:"URI",render:Ds,sortable:!0},{id:"description",header:"Description",render:Ms,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Vs,sortable:!0}],e[10]=M):M=e[10];const A=M;let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=A.filter(As).map($s),e[11]=I):I=e[11];const R=I;let L;e[12]!==r||e[13]!==o||e[14]!==y||e[15]!==f||e[16]!==v||e[17]!==j||e[18]!==p||e[19]!==m?(L=f&&t.jsxs(qe,{children:[t.jsx(ht,{viewMode:m,onViewModeChange:d,sortKey:j,sortDirection:v,onSort:y,sortOptions:R}),t.jsx(Ke,{title:o?`${o}: Resources`:"Resources",url:p,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=y,e[15]=f,e[16]=v,e[17]=j,e[18]=p,e[19]=m,e[20]=L):L=e[20];let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=g=>{g.key==="Escape"&&(b(""),g.target.blur())},e[21]=C):C=e[21];let z;e[22]!==i?(z=t.jsx(dt,{value:i,onChange:b,placeholder:"Search resources...",onKeyDown:C}),e[22]=i,e[23]=z):z=e[23];let P;e[24]!==l||e[25]!==k||e[26]!==y||e[27]!==i||e[28]!==v||e[29]!==j||e[30]!==$||e[31]!==m?(P=m==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:$.length===0?t.jsx(Ne,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:$.map(g=>t.jsx(gt,{className:"cursor-pointer transition-colors",onClick:()=>k(g),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Le,{icon:null,name:g.name||g.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:g.name||g.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:g.uri}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:g.description})]})]})},g.uri))})}):t.jsx(xt,{columns:A,data:$,isLoading:!1,sortKey:j,sortDirection:v,onSort:y,onRowClick:g=>k(g),emptyState:t.jsx(Ne,{image:null,title:i?"No resources found":"No resources available",description:i?"Try adjusting your search terms":l})}),e[24]=l,e[25]=k,e[26]=y,e[27]=i,e[28]=v,e[29]=j,e[30]=$,e[31]=m,e[32]=P):P=e[32];let D;e[33]!==z||e[34]!==P?(D=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[z,P]}),e[33]=z,e[34]=P,e[35]=D):D=e[35];let V;return e[36]!==D||e[37]!==L?(V=t.jsxs(t.Fragment,{children:[L,D]}),e[36]=D,e[37]=L,e[38]=V):V=e[38],V}function $s(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function As(s){return s.sortable}function Vs(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ms(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Os(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Es(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Rs(s){const e=X.c(6),{resources:n,connectionId:o,org:r}=s,a=We(o),c=a?.title,u=a?.icon;let f;return e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==c||e[4]!==u?(f=t.jsx(Is,{resources:n,connectionId:o,org:r,connectionTitle:c,connectionIcon:u}),e[0]=o,e[1]=r,e[2]=n,e[3]=c,e[4]=u,e[5]=f):f=e[5],f}const Ls=lt({key:W().min(1,"Key is required"),value:W()}),Us=lt({title:W().min(1,"Name is required"),description:W().nullable().optional(),ui_type:Ct(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:W().optional(),connection_token:W().nullable().optional(),npx_package:W().optional(),stdio_command:W().optional(),stdio_args:W().optional(),stdio_cwd:W().optional(),env_vars:Je(Ls).optional(),configuration_scopes:Je(W()).nullable().optional(),configuration_state:Nt(W(),_t()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Fs(s){const e=X.c(5),{tools:n,connectionId:o,org:r,isLoading:a}=s;let c;return e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==n?(c=t.jsx(xs,{tools:n,connectionId:o,org:r,isLoading:a}),e[0]=o,e[1]=a,e[2]=r,e[3]=n,e[4]=c):c=e[4],c}function Bs(s){return s.command==="npx"}function zs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Xs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ks(s,e){const n={command:"npx",args:["-y",s]},o=ut(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Ws(s,e,n,o){const r={command:s};e.trim()&&(r.args=e.trim().split(/\s+/)),n?.trim()&&(r.cwd=n.trim());const a=ut(o);return Object.keys(a).length>0&&(r.envVars=a),r}function it(s,e){const n={title:s.title,description:s.description??"",configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&It(s.connection_headers)){const o=s.connection_headers,r=At(o.envVars);if(Bs(o)){const c=zs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const a=Xs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function qs(s){let e,n=null,o=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Ks(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ws(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,connection_type:e,connection_url:n,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Hs(s){const e=X.c(117),{connection:n,connectionId:o,org:r,requestedTabId:a,collections:c,onUpdate:u,isUpdating:f,prompts:l,resources:x,tools:p,isLoadingTools:i}=s;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={from:"/$org/$project/mcps/$connectionId"},e[0]=b):b=e[0];const m=Re(b),d=wt(),w=Xe().location.href,v=pt();let N;e[1]!==o?(N={connectionId:o},e[1]=o,e[2]=N):N=e[2];const _=Ot(N),h=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let k;e[3]!==n?(k={connections:[n],binding:"MCP"},e[3]=n,e[4]=k):k=e[4];const $=Dt(k).length>0,M=n?.metadata?.repository,A=!!M?.url;let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=kt(Us),e[5]=I):I=e[5];let R;e[6]!==n?(R=it(n),e[6]=n,e[7]=R):R=e[7];let L;e[8]!==R?(L={resolver:I,values:R},e[8]=R,e[9]=L):L=e[9];const C=Pt(L),z=C.formState.isDirty;let P;e[10]!==C||e[11]!==u?(P=async()=>{if(!await C.trigger())return;const U=C.getValues(),ye=qs(U);await u(ye),C.reset(U)},e[10]=C,e[11]=u,e[12]=P):P=e[12];const D=P;let V;e[13]!==n||e[14]!==C?(V=()=>{C.reset(it(n))},e[13]=n,e[14]=C,e[15]=V):V=e[15];const g=V;let F;e[16]!==n.id||e[17]!==v||e[18]!==d?(F=async()=>{const{token:T,tokenInfo:U,error:ye}=await Bt({connectionId:n.id});if(ye||!T){Ce.error(`Authentication failed: ${ye}`);return}if(U)try{const De=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:U.accessToken,refreshToken:U.refreshToken,expiresIn:U.expiresIn,scope:U.scope,clientId:U.clientId,clientSecret:U.clientSecret,tokenEndpoint:U.tokenEndpoint})});if(!De.ok)console.error("Failed to save OAuth token:",await De.text()),await v.update.mutateAsync({id:n.id,data:{connection_token:T}});else try{await v.update.mutateAsync({id:n.id,data:{}})}catch(Qe){console.warn("Failed to refresh connection tools after OAuth:",Qe)}}catch(De){console.error("Error saving OAuth token:",De),await v.update.mutateAsync({id:n.id,data:{connection_token:T}})}else await v.update.mutateAsync({id:n.id,data:{connection_token:T}});const bt=new URL(`/mcp/${n.id}`,window.location.origin);await d.invalidateQueries({queryKey:Ye.isMCPAuthenticated(bt.href,null)}),Ce.success("Authentication successful")},e[16]=n.id,e[17]=v,e[18]=d,e[19]=F):F=e[19];const O=F;let S;e[20]!==n.id||e[21]!==d?(S=async()=>{try{const T=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!T.ok){const ye=await T.text();Ce.error(`Failed to remove OAuth: ${ye}`);return}const U=new URL(`/mcp/${n.id}`,window.location.origin);await d.invalidateQueries({queryKey:Ye.isMCPAuthenticated(U.href,null)}),Ce.success("OAuth removed. You can now re-authenticate with a different account.")}catch(T){console.error("Error removing OAuth token:",T),Ce.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=d,e[22]=S):S=e[22];const H=S,K=p.length,se=l.length,ne=x.length,oe=K>0||i;let Te;e[23]===Symbol.for("react.memo_cache_sentinel")?(Te={id:"settings",label:"Settings"},e[23]=Te):Te=e[23];let re;e[24]!==i||e[25]!==h||e[26]!==oe||e[27]!==K?(re=h&&oe?[{id:"tools",label:"Tools",count:i?void 0:K}]:[],e[24]=i,e[25]=h,e[26]=oe,e[27]=K,e[28]=re):re=e[28];let ie;e[29]!==h||e[30]!==se?(ie=h&&se>0?[{id:"prompts",label:"Prompts",count:se}]:[],e[29]=h,e[30]=se,e[31]=ie):ie=e[31];let ae;e[32]!==h||e[33]!==ne?(ae=h&&ne>0?[{id:"resources",label:"Resources",count:ne}]:[],e[32]=h,e[33]=ne,e[34]=ae):ae=e[34];let we;if(e[35]!==c||e[36]!==A||e[37]!==h||e[38]!==re||e[39]!==ie||e[40]!==ae){let T;e[42]!==A?(T=A?[{id:"readme",label:"README"}]:[],e[42]=A,e[43]=T):T=e[43],we=[Te,...re,...ie,...ae,...h?(c||[]).map(Gs):[],...T],e[35]=c,e[36]=A,e[37]=h,e[38]=re,e[39]=ie,e[40]=ae,e[41]=we}else we=e[41];const _e=we,jt=h&&_e.some(Qs)?"tools":"settings",E=_e.some(T=>T.id===a)?a:jt;let ke;e[44]!==m?(ke=T=>{m({search:U=>({...U,tab:T}),replace:!0})},e[44]=m,e[45]=ke):ke=e[45];const ce=ke;let le;e[46]!==c?(le=c||[],e[46]=c,e[47]=le):le=e[47];let Pe;if(e[48]!==E||e[49]!==le){let T;e[51]!==E?(T=U=>U.name===E,e[51]=E,e[52]=T):T=e[52],Pe=le.find(T),e[48]=E,e[49]=le,e[50]=Pe}else Pe=e[50];const Ie=Pe;let de;e[53]!==r?(de=t.jsx(Ze,{children:t.jsx(Xt,{asChild:!0,children:t.jsx(at,{to:"/$org/$project/mcps",params:{org:r,project:Se},children:"Connections"})})}),e[53]=r,e[54]=de):de=e[54];let $e;e[55]===Symbol.for("react.memo_cache_sentinel")?($e=t.jsx(Kt,{}),e[55]=$e):$e=e[55];let me;e[56]!==n.title?(me=t.jsx(Ze,{children:t.jsx(zt,{children:n.title})}),e[56]=n.title,e[57]=me):me=e[57];let Ae;e[58]!==de||e[59]!==me?(Ae=t.jsx(Wt,{children:t.jsxs(qt,{children:[de,$e,me]})}),e[58]=de,e[59]=me,e[60]=Ae):Ae=e[60];const Ue=Ae;let ue;e[61]!==D||e[62]!==g||e[63]!==z||e[64]!==f?(ue=t.jsx(Vt,{onSave:D,onUndo:g,isDirty:z,isSaving:f}),e[61]=D,e[62]=g,e[63]=z,e[64]=f,e[65]=ue):ue=e[65];const Fe=n.icon??"settings";let pe;e[66]!==n.title||e[67]!==Fe||e[68]!==w?(pe=t.jsx(Ke,{title:n.title,url:w,icon:Fe}),e[66]=n.title,e[67]=Fe,e[68]=w,e[69]=pe):pe=e[69];let fe;e[70]!==ue||e[71]!==pe?(fe=t.jsxs(qe,{children:[ue,pe]}),e[70]=ue,e[71]=pe,e[72]=fe):fe=e[72];let xe;e[73]!==_.hasOAuthToken||e[74]!==n||e[75]!==C||e[76]!==O||e[77]!==H||e[78]!==h?(xe=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(bs,{form:C,connection:n,isMCPAuthenticated:h,hasOAuthToken:_.hasOAuthToken,onReauthenticate:O,onRemoveOAuth:H})}),e[73]=_.hasOAuthToken,e[74]=n,e[75]=C,e[76]=O,e[77]=H,e[78]=h,e[79]=xe):xe=e[79];let he;e[80]!==E||e[81]!==ce||e[82]!==_e?(he=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Ht,{tabs:_e,activeTab:E,onTabChange:ce,className:"flex-1"})}),e[80]=E,e[81]=ce,e[82]=_e,e[83]=he):he=e[83];let Ve;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=Ve):Ve=e[84];let ge;e[85]!==Ie||e[86]!==E||e[87]!==_.isServerError||e[88]!==_.supportsOAuth||e[89]!==n||e[90]!==o||e[91]!==C||e[92]!==O||e[93]!==ce||e[94]!==$||e[95]!==A||e[96]!==i||e[97]!==h||e[98]!==r||e[99]!==l||e[100]!==M||e[101]!==x||e[102]!==p?(ge=t.jsx(Y.Suspense,{fallback:Ve,children:E==="tools"?t.jsx(Fs,{tools:p,connectionId:o,org:r,isLoading:i}):E==="prompts"?t.jsx(ks,{prompts:l,connectionId:o,org:r}):E==="resources"?t.jsx(Rs,{resources:x,connectionId:o,org:r}):E==="settings"?t.jsx(Et,{connection:n,form:C,hasMcpBinding:$,isMCPAuthenticated:h,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:O,onViewReadme:A?()=>ce("readme"):void 0}):E==="readme"&&A?t.jsx(Ps,{repository:M}):Ie&&h?t.jsx(Gt,{connectionId:o,org:r,activeCollection:Ie},E):t.jsx(Ne,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=Ie,e[86]=E,e[87]=_.isServerError,e[88]=_.supportsOAuth,e[89]=n,e[90]=o,e[91]=C,e[92]=O,e[93]=ce,e[94]=$,e[95]=A,e[96]=i,e[97]=h,e[98]=r,e[99]=l,e[100]=M,e[101]=x,e[102]=p,e[103]=ge):ge=e[103];let je;e[104]!==E||e[105]!==ge?(je=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(mt,{children:ge},E)}),e[104]=E,e[105]=ge,e[106]=je):je=e[106];let be;e[107]!==he||e[108]!==je?(be=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[he,je]}),e[107]=he,e[108]=je,e[109]=be):be=e[109];let ve;e[110]!==xe||e[111]!==be?(ve=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[xe,be]}),e[110]=xe,e[111]=be,e[112]=ve):ve=e[112];let Me;return e[113]!==Ue||e[114]!==fe||e[115]!==ve?(Me=t.jsxs(Qt,{breadcrumb:Ue,children:[fe,ve]}),e[113]=Ue,e[114]=fe,e[115]=ve,e[116]=Me):Me=e[116],Me}function Qs(s){return s.id==="tools"}function Gs(s){return{id:s.name,label:s.displayName}}function Js(){const s=X.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Re(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:r,org:a}=St(o),{org:c}=ct();let u;s[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=u):u=s[2];const l=Tt(u).tab??"",x=We(r),p=pt(),i=Mt(x??void 0);let b;s[3]!==r||s[4]!==c.id?(b={connectionId:r,orgId:c.id},s[3]=r,s[4]=c.id,s[5]=b):b=s[5];const m=Rt(b);let d;s[6]!==m?(d={client:m},s[6]=m,s[7]=d):d=s[7];const{data:j}=Ut(d);let w;s[8]!==m?(w={client:m},s[8]=m,s[9]=w):w=s[9];const{data:v}=Ft(w),_=!(x?.connection_type==="VIRTUAL")&&x?.tools&&x.tools.length>0,y=!_;let h;s[10]!==m||s[11]!==y?(h={client:m,enabled:y},s[10]=m,s[11]=y,s[12]=h):h=s[12];const{data:k,isLoading:B}=Lt(h);let $;s[13]!==j?.prompts?($=j?.prompts??[],s[13]=j?.prompts,s[14]=$):$=s[14];let M;s[15]!==$?(M=$.map(en),s[15]=$,s[16]=M):M=s[16];const A=M;let I;s[17]!==v?.resources?(I=v?.resources??[],s[17]=v?.resources,s[18]=I):I=s[18];let R;s[19]!==I?(R=I.map(Zs),s[19]=I,s[20]=R):R=s[20];const L=R;let C;s[21]!==x||s[22]!==_||s[23]!==k?.tools?(C=_?x.tools??[]:(k?.tools??[]).map(Ys),s[21]=x,s[22]=_,s[23]=k?.tools,s[24]=C):C=s[24];const z=C;let P;s[25]!==p.update||s[26]!==r?(P=async g=>{await p.update.mutateAsync({id:r,data:g})},s[25]=p.update,s[26]=r,s[27]=P):P=s[27];const D=P;if(!x){let g;return s[28]!==n||s[29]!==a?(g=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ne,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Be,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:Se}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=g):g=s[30],g}let V;return s[31]!==p.update.isPending||s[32]!==i||s[33]!==x||s[34]!==r||s[35]!==D||s[36]!==B||s[37]!==a||s[38]!==A||s[39]!==l||s[40]!==L||s[41]!==z?(V=t.jsx(Hs,{org:a,connection:x,connectionId:r,requestedTabId:l,collections:i,onUpdate:D,isUpdating:p.update.isPending,prompts:A,resources:L,tools:z,isLoadingTools:B}),s[31]=p.update.isPending,s[32]=i,s[33]=x,s[34]=r,s[35]=D,s[36]=B,s[37]=a,s[38]=A,s[39]=l,s[40]=L,s[41]=z,s[42]=V):V=s[42],V}function Ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations}}function Zs(s){return{uri:s.uri,name:s.name,description:s.description}}function en(s){return{name:s.name,description:s.description}}function tn(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(mt,{children:t.jsx(Y.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Js,{})})}),s[0]=e):e=s[0],e}function or(){const s=X.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tn,{}),s[0]=e):e=s[0],e}export{or as default};
@@ -1 +0,0 @@
1
- import{D as t,E as a}from"./index-DrrqKIxq.js";const e=t(a,{target:"draft-7"});export{e as B};
@@ -1 +0,0 @@
1
- import{r as b,c as y,j as s,u as ne,d as ae,t as Y}from"./index-DrrqKIxq.js";import{V as ce,C as j}from"./index-0fcwYTfR.js";import{T as me,i as de,a as fe,t as pe}from"./typewriter-title-CJBquTSX.js";import{E as ue}from"./error-boundary-DqZtjxEB.js";import{u as ee,b as he}from"./context-BgVlhaqT.js";import{I as te}from"./integration-icon-BVqKl9De.js";import{P as xe,a as je,b as ge}from"./popover-D64RiLTH.js";import{S as X}from"./skeleton-C7PEWbcl.js";import{c as se,B as H}from"./button-CZPRmDPf.js";import{i as be,d as ye}from"./constants-C2M7RsNt.js";import{b as Ne}from"./use-virtual-mcp-BA3G4Be3.js";import{i as _e}from"./ChevronRight-qRilEtY5.js";import{t as ie}from"./Users03-B5yv7ula.js";import{P as A}from"./index-BzbwskdO.js";import{a as U,b as J,T as Q}from"./tooltip-Di7lOmib.js";import{c as Se}from"./Pin01-BmPA32VH.js";import{s as ve}from"./Plus-CPirwa1w.js";import"./spinner-BCc4DqcN.js";import"./use-mcp-prompts-9RF1o3Vk.js";import"./useQuery-DcU1ldNG.js";import"./dialog-DGoua-F-.js";import"./form-CFbWoYe6.js";import"./label-CoS6RHW3.js";import"./input-C2aMc-tK.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-D7gFQV8U.js";import"./ChevronDown-DHYql12c.js";import"./Edit01-BNuFD-E4.js";import"./XCircle-BGdKXUli.js";import"./AlertCircle-xlmc_ewP.js";import"./AlertTriangle-Ddzav--o.js";import"./use-deco-chat-open-BuSNLd83.js";import"./localstorage-keys-Dn-W0lb3.js";import"./useMutation-byIh8vPM.js";import"./ArrowLeft-Cm3_NyIq.js";import"./use-copy-Cy4z0myA.js";import"./badge-DApFAaFp.js";import"./Check-CwhCIsIx.js";import"./Code01-CJtE_l6W.js";import"./SearchMd-CmV0Tepn.js";import"./use-create-virtual-mcp-DyqNrljf.js";import"./Coins01-BilMBcS0.js";import"./marked.esm-BaswSlok.js";import"./markdown-BM0BQJdP.js";import"./Copy01-_H9GhcIe.js";import"./tools-list-BdI3Q54q.js";import"./collection-table-wrapper-Dg5F9IdT.js";import"./dropdown-menu-CEy971MU.js";import"./Grid01-CSoBYZVu.js";import"./List-FibtrqYM.js";import"./table-BKrr_ZVb.js";import"./empty-state-C_g2tsPC.js";import"./Loading01-Bl1Pk_oo.js";import"./card-RVty8OZv.js";import"./Eye-DRUYj907.js";import"./Globe02-C1VZ1Sth.js";import"./RefreshCw01-B1WiG0_Y.js";import"./layout-D1KoVO75.js";import"./use-connection-DjTWTI9s.js";import"./generate-id-Dyweu44Y.js";import"./Clock-Ck0JfdvV.js";import"./Trash01-CsD9CMZr.js";import"./decopilot-events-Brt4gAR6.js";import"./use-llm-Ce8POLUd.js";import"./use-binding-lQ5At5HW.js";import"./binder-DA98_oix.js";import"./select-L9VC3PJn.js";import"./File06-D7PEf5a6.js";import"./Image01-B7uGBtXf.js";import"./RefreshCcw01-DpTBiD-b.js";import"./Settings01-C0WLxd49.js";import"./useSuspenseInfiniteQuery-Dc-GS2UT.js";import"./infiniteQueryObserver-BUe0-uqo.js";import"./Container-DmRzes59.js";import"./use-mobile-Cyo_7CU1.js";const re=({size:e=24,color:t="currentColor",...i})=>b.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},b.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));re.displayName="Share07";function Ce(e){const t=y.c(15),{agent:i}=e,{setVirtualMcpId:u}=ee();let l;t[0]!==i.id||t[1]!==u?(l=()=>{u(i.id)},t[0]=i.id,t[1]=u,t[2]=l):l=t[2];const r=l;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const d=`Select agent ${i.title}`;let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ie,{size:20}),t[4]=o):o=t[4];let c;t[5]!==i.icon||t[6]!==i.title?(c=s.jsx(te,{icon:i.icon,name:i.title,fallbackIcon:o}),t[5]=i.icon,t[6]=i.title,t[7]=c):c=t[7];let n;t[8]!==i.title?(n=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=n):n=t[9];let a;return t[10]!==r||t[11]!==d||t[12]!==c||t[13]!==n?(a=s.jsxs("button",{type:"button",onClick:r,className:m,"aria-label":d,children:[c,n]}),t[10]=r,t[11]=d,t[12]=c,t[13]=n,t[14]=a):a=t[14],a}function we(e){const t=y.c(14),{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:l}=e,[r,m]=b.useState(!1),d=b.useRef(null);let o,c;t[0]!==r?(o=()=>{r&&setTimeout(()=>{d.current?.focus()},0)},c=[r],t[0]=r,t[1]=o,t[2]=c):(o=t[1],c=t[2]),b.useEffect(o,c);let n;t[3]!==l?(n=N=>{l(N),m(!1)},t[3]=l,t[4]=n):n=t[4];const a=n;let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=f):f=t[5];let p;t[6]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(xe,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(_e,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=p):p=t[6];let h;t[7]!==a||t[8]!==u||t[9]!==i?(h=s.jsx(je,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ce,{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:a,searchInputRef:d})}),t[7]=a,t[8]=u,t[9]=i,t[10]=h):h=t[10];let g;return t[11]!==r||t[12]!==h?(g=s.jsxs(ge,{open:r,onOpenChange:m,children:[p,h]}),t[11]=r,t[12]=h,t[13]=g):g=t[13],g}function ke(){const e=y.c(20),t=Ne(),{selectedVirtualMcp:i,setVirtualMcpId:u}=ee();let l,r,m,d,o,c;if(e[0]!==t){o=Symbol.for("react.early_return_sentinel");e:{const h=t.filter(Me).slice(0,6);if(h.length===0){o=null;break e}c=t.map(Te),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=d):d=e[7],l="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",r=h.map(ze)}e[0]=t,e[1]=l,e[2]=r,e[3]=m,e[4]=d,e[5]=o,e[6]=c}else l=e[1],r=e[2],m=e[3],d=e[4],o=e[5],c=e[6];if(o!==Symbol.for("react.early_return_sentinel"))return o;const n=i?.id??null;let a;e[8]!==u||e[9]!==n||e[10]!==c?(a=s.jsx(we,{virtualMcps:c,selectedVirtualMcpId:n,onVirtualMcpChange:u}),e[8]=u,e[9]=n,e[10]=c,e[11]=a):a=e[11];let f;e[12]!==l||e[13]!==r||e[14]!==a?(f=s.jsxs("div",{className:l,children:[r,a]}),e[12]=l,e[13]=r,e[14]=a,e[15]=f):f=e[15];let p;return e[16]!==m||e[17]!==d||e[18]!==f?(p=s.jsxs("div",{className:m,children:[d,f]}),e[16]=m,e[17]=d,e[18]=f,e[19]=p):p=e[19],p}function ze(e){return s.jsx(Ce,{agent:e},e.id??"default")}function Te(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function Me(e){return e.id!==null&&!be(e.id)}function Ie(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(X,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(Pe)})]}),e[1]=i):i=e[1],i}function Pe(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(X,{className:"size-6 rounded-md shrink-0"}),s.jsx(X,{className:"h-4 w-full"})]},t)}function $e(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(b.Suspense,{fallback:s.jsx(Ie,{}),children:s.jsx(ke,{})}),e[0]=t):t=e[0],t}function Ee(){const e=new Date().getHours();return e>=5&&e<12?"Morning":e>=12&&e<17?"Afternoon":e>=17&&e<22?"Evening":"Night"}function Ve(){const e=y.c(61),{org:t}=ne(),{data:i}=ae.useSession(),{modelsConnections:u,isChatEmpty:l,activeThreadId:r,createThread:m,switchToThread:d,threads:o,selectedVirtualMcp:c}=he();let n;if(e[0]!==r||e[1]!==o){let x;e[3]!==r?(x=oe=>oe.id===r,e[3]=r,e[4]=x):x=e[4],n=o.find(x),e[0]=r,e[1]=o,e[2]=n}else n=e[2];const a=n,[f,p]=b.useState(!1);let h;e[5]!==i?.user?.name?(h=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=h):h=e[6];const g=h;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=Ee(),e[7]=N):N=e[7];const le=N;let L;e[8]!==t.id?(L=ye(t.id),e[8]=t.id,e[9]=L):L=e[9];const R=c??L;if(u.length===0){let x;return e[10]!==t?(x=s.jsx("div",{className:"flex flex-col size-full bg-background items-center justify-center",children:s.jsx(j.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=x):x=e[11],x}let _;e[12]!==a?(_=a?.title&&s.jsx(me,{text:a.title,className:"text-sm font-medium text-foreground"}),e[12]=a,e[13]=_):_=e[13];let S;e[14]!==_?(S=s.jsx(A.Header.Left,{className:"gap-2",children:_}),e[14]=_,e[15]=S):S=e[15];let v;e[16]!==m?(v=()=>m(),e[16]=m,e[17]=v):v=e[17];let B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(ve,{size:16}),e[18]=B):B=e[18];let C;e[19]!==l||e[20]!==v?(C=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:v,disabled:l,"aria-label":"New chat",children:B})}),e[19]=l,e[20]=v,e[21]=C):C=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(J,{children:"New chat"}),e[22]=O):O=e[22];let w;e[23]!==C?(w=s.jsxs(Q,{children:[C,O]}),e[23]=C,e[24]=w):w=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=()=>p(!0),e[25]=D):D=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs(Q,{children:[s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:D,"aria-label":"Chat history",children:s.jsx(de,{size:16})})}),s.jsx(J,{children:"Chat history"})]}),e[26]=F):F=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Se,{size:16}),e[27]=W):W=e[27];let k;e[28]!==l?(k=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:He,disabled:l,"aria-label":"Pin chat",children:W})}),e[28]=l,e[29]=k):k=e[29];let Z;e[30]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(J,{children:"Pin chat"}),e[30]=Z):Z=e[30];let z;e[31]!==k?(z=s.jsxs(Q,{children:[k,Z]}),e[31]=k,e[32]=z):z=e[32];let q;e[33]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(re,{size:16}),e[33]=q):q=e[33];let T;e[34]!==l?(T=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ae,disabled:l,"aria-label":"Share chat",children:q})}),e[34]=l,e[35]=T):T=e[35];let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(J,{children:"Share chat"}),e[36]=G):G=e[36];let M;e[37]!==T?(M=s.jsxs(Q,{children:[T,G]}),e[37]=T,e[38]=M):M=e[38];let I;e[39]!==w||e[40]!==z||e[41]!==M?(I=s.jsxs(A.Header.Right,{className:"gap-1",children:[w,F,z,M]}),e[39]=w,e[40]=z,e[41]=M,e[42]=I):I=e[42];let P;e[43]!==I||e[44]!==S?(P=s.jsxs(A.Header,{className:"flex-none z-10 bg-background",children:[S,I]}),e[43]=I,e[44]=S,e[45]=P):P=e[45];let $;e[46]!==R||e[47]!==l||e[48]!==g?($=l?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(te,{icon:R.icon,name:R.title,size:"md",fallbackIcon:s.jsx(ie,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-lg font-medium text-foreground",children:[le," ",g,","]}),s.jsx("p",{className:"text-base text-muted-foreground opacity-50 mb-0",children:"What are we building today?"})]}),s.jsx("div",{className:"w-full -mt-1",children:s.jsx(j.Input,{})}),s.jsx(j.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx($e,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(j.Main,{children:s.jsx(j.Messages,{})}),s.jsx(j.Footer,{children:s.jsx(j.Input,{})})]}),e[46]=R,e[47]=l,e[48]=g,e[49]=$):$=e[49];let E;e[50]!==d?(E=async x=>{await d(x),p(!1)},e[50]=d,e[51]=E):E=e[51];let V;e[52]!==r||e[53]!==f||e[54]!==E||e[55]!==o?(V=s.jsx(fe,{open:f,onOpenChange:p,threads:o,activeThreadId:r,onThreadSelect:E}),e[52]=r,e[53]=f,e[54]=E,e[55]=o,e[56]=V):V=e[56];let K;return e[57]!==P||e[58]!==$||e[59]!==V?(K=s.jsxs(j,{children:[P,$,V]}),e[57]=P,e[58]=$,e[59]=V,e[60]=K):K=e[60],K}function Ae(){Y.info("Share feature coming soon")}function He(){Y.info("Pin feature coming soon")}function Le(e){const t=y.c(14),{error:i,onRetry:u}=e,l=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(A.Header,{className:"flex-none",children:[s.jsx(A.Header.Left,{className:"gap-2"}),s.jsx(A.Header.Right,{className:"gap-1"})]}),t[0]=r):r=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(pe,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const d=l?"Unable to load models":"Something went wrong";let o;t[2]!==d?(o=s.jsx("h3",{className:"text-lg font-medium",children:d}),t[2]=d,t[3]=o):o=t[3];const c=l?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let n;t[4]!==c?(n=s.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=n):n=t[5];let a;t[6]!==o||t[7]!==n?(a=s.jsxs("div",{className:"space-y-2",children:[o,n]}),t[6]=o,t[7]=n,t[8]=a):a=t[8];let f;t[9]!==u?(f=s.jsx(H,{variant:"outline",onClick:u,children:"Try again"}),t[9]=u,t[10]=f):f=t[10];let p;return t[11]!==a||t[12]!==f?(p=s.jsxs(j,{children:[r,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,f]})})]}),t[11]=a,t[12]=f,t[13]=p):p=t[13],p}function as(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ue,{fallback:Re,children:s.jsx(b.Suspense,{fallback:s.jsx(j.Skeleton,{}),children:s.jsx(Ve,{})})}),e[0]=t):t=e[0],t}function Re(e){const{error:t,resetError:i}=e;return s.jsx(Le,{error:t,onRetry:i})}export{as as default};
@@ -1 +0,0 @@
1
- import{r as g,c as z,d as Ue,j as i,u as Z,O as J,t as V,H as Nr,o as Ct,s as fe,b as Ce,m as Ae,l as At,k as Ot,K as X,aF as De,bG as Cr,b1 as te,P as _t,S as $e,e as Ar,aD as Or}from"./index-DrrqKIxq.js";import{u as _r,a as Et}from"./use-project-BLgGy5mK.js";import{c as oe,B as H}from"./button-CZPRmDPf.js";import{a as It,b as Er,c as Ir,d as Dr,D as Dt}from"./dialog-DGoua-F-.js";import{a as Tr,b as zr,c as Lr,T as $r,i as Tt}from"./tooltip-Di7lOmib.js";import{u as qe,S as ee}from"./skeleton-C7PEWbcl.js";import{p as zt,a as nt,t as Mr,u as Fr}from"./use-settings-modal-BAyKuvP-.js";import{A as Lt}from"./avatar-DlH0tlJW.js";import{i as Ye}from"./Coins01-BilMBcS0.js";import{t as $t}from"./Settings01-C0WLxd49.js";import{i as Rr}from"./Check-CwhCIsIx.js";import{a as Br}from"./Copy01-_H9GhcIe.js";import{S as we}from"./switch-EPGLJyI3.js";import{S as Mt,a as Ft,d as ye,c as Rt,b as Wr}from"./select-L9VC3PJn.js";import{i as Gr}from"./Code01-CJtE_l6W.js";import{i as Kr}from"./Shield01-BbVNhLRQ.js";import{n as Ur}from"./CheckDone01-CZrV6JdL.js";import{u as Oe}from"./useMutation-byIh8vPM.js";import{a as Bt,F as he,b as re,c as ne,d as ie,f as pe,e as Me}from"./form-CFbWoYe6.js";import{I as xe}from"./input-C2aMc-tK.js";import{i as qr}from"./Upload01-Tev8kZ4-.js";import{a as He,u as je}from"./constants-C2M7RsNt.js";import{T as Yr}from"./textarea-bPVDAJiU.js";import{c as Hr,h as Vr,d as Xr,b as Qr,A as Jr,e as Zr,g as en,a as tn,f as rn}from"./alert-dialog-DB07UdJN.js";import{u as nn}from"./useQuery-DcU1ldNG.js";import{L as Fe}from"./label-CoS6RHW3.js";import{n as an}from"./Container-DmRzes59.js";import{h as Wt}from"./use-connection-DjTWTI9s.js";import{a as sn,c as ln}from"./use-binding-lQ5At5HW.js";import{u as on}from"./use-install-from-registry-Dww4DIOX.js";import{i as cn}from"./Loading01-Bl1Pk_oo.js";import{s as Gt}from"./Plus-CPirwa1w.js";import{i as q,G as Kt,g as Te,m as dn,D as _e,r as ge,Z as Ee,L as ce,s as ve,C as un,a as mn,b as Ut,c as fn,d as hn,T as pn,u as xn,e as gn,f as vn,h as ke,j as Y,k as it,l as at,n as qt,o as Yt,p as Ie,q as Ve,t as yn,v as bn,w as Ht,x as Xe,y as Qe,z as Vt,A as jn,B as Xt,E as st,F as kn,H as wn,I as Qt,R as Pn,S as Sn,J as Nn,K as Cn,M as Jt,N as An,O as On,P as _n,Q as En,U as In,V as Dn,W as Tn,X as zn,Y as Ln,_ as lt,$ as ot,a0 as ct,a1 as $n,a2 as Je,a3 as Mn,a4 as ue,a5 as Fn,a6 as Rn,a7 as Bn,a8 as Wn,a9 as Gn,aa as ze,ab as Kn,ac as Pe,ad as W,ae as Ze,af as Un,ag as qn,ah as Yn,ai as Zt,aj as er,ak as Hn,al as Vn,am as Xn,an as tr,ao as G,ap as Qn,aq as Jn,ar as Zn,as as ei,at as ti,au as ri,av as ni,aw as ii,ax as ai,ay as si,az as li,aA as oi,aB as ci}from"./chart-IzVtzoKL.js";import{b as di,a as ui}from"./use-mcp-tools-mAwwC0gK.js";import"./localstorage-keys-Dn-W0lb3.js";import"./ChevronDown-DHYql12c.js";import"./binder-DA98_oix.js";import"./extract-connection-data-BdeTK8Ro.js";import"./constants-BHCPzANQ.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-B3BaD7r8.js";import"./generate-id-Dyweu44Y.js";import"./index-Bl5KG9xm.js";const rr=({size:t=24,color:e="currentColor",...r})=>g.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},g.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));rr.displayName="Beaker01";const nr=({size:t=24,color:e="currentColor",...r})=>g.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},g.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));nr.displayName="Bell01";const et=({size:t=24,color:e="currentColor",...r})=>g.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},g.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));et.displayName="Zap";const mi=[{key:"general",label:"General",icon:i.jsx($t,{size:14})},{key:"plugins",label:"Plugins",icon:i.jsx(et,{size:14})}];function fi(t){const e=z.c(14),{activeSection:r,onNavigate:n}=t,{org:a}=Z();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={suspense:!0},e[0]=s):s=e[0];const{data:l}=_r(a.id,s);let o;e[1]!==r?(o=zt(r),e[1]=r,e[2]=o):o=e[2];const d=o;let u;if(e[3]!==d?.slug||e[4]!==r||e[5]!==n||e[6]!==l){let f;e[8]!==d?.slug||e[9]!==r||e[10]!==n?(f=m=>{const x=d?.slug===m.slug;return i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsxs("button",{type:"button",onClick:()=>n(nt(m.slug,"general")),className:oe("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",x?"text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("div",{className:"size-4 shrink-0 rounded-[3px] flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:m.ui?.themeColor??"#60a5fa"},children:m.ui?.icon?i.jsx("img",{src:m.ui.icon,alt:"",className:"size-full object-cover"}):i.jsx("span",{className:"text-[8px] font-semibold text-white leading-none",children:(m.name??m.slug).charAt(0).toUpperCase()})}),i.jsx("span",{className:"truncate",children:m.name??m.slug})]}),x&&i.jsx("div",{className:"ml-3 flex flex-col gap-0.5 border-l border-border pl-2.5",children:mi.map(p=>{const v=nt(m.slug,p.key);return i.jsxs("button",{type:"button",onClick:()=>n(v),className:oe("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===v?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:p.icon}),i.jsx("span",{className:"truncate",children:p.label})]},p.key)})})]},m.slug)},e[8]=d?.slug,e[9]=r,e[10]=n,e[11]=f):f=e[11],u=(l??[]).filter(hi).map(f),e[3]=d?.slug,e[4]=r,e[5]=n,e[6]=l,e[7]=u}else u=e[7];let c;return e[12]!==u?(c=i.jsx(i.Fragment,{children:u}),e[12]=u,e[13]=c):c=e[13],c}function hi(t){return t.slug!==J}function pi(t){const e=z.c(30),{activeSection:r,onNavigate:n}=t,{data:a}=Ue.useSession(),[s]=qe(),l=a?.user,o=l?.image,d=l?.name??"Profile",u=l?.name??"U";let c;e[0]!==u||e[1]!==o?(c=i.jsx(Lt,{url:o,fallback:u,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=u,e[1]=o,e[2]=c):c=e[2];let f;e[3]!==d||e[4]!==c?(f={key:"account.profile",label:d,icon:c},e[3]=d,e[4]=c,e[5]=f):f=e[5];let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={key:"account.preferences",label:"Preferences",icon:i.jsx($t,{size:14})},e[6]=m):m=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x={key:"account.experimental",label:"Experimental",icon:i.jsx(rr,{size:14})},e[7]=x):x=e[7];let p;e[8]!==f?(p=[f,m,x],e[8]=f,e[9]=p):p=e[9];const v=p;let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b={key:"org.general",label:"General",icon:i.jsx(Mr,{size:14})},e[10]=b):b=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"org.plugins",label:"Plugins",icon:i.jsx(et,{size:14})},e[11]=w):w=e[11];let P;e[12]===Symbol.for("react.memo_cache_sentinel")?(P=[b,w,{key:"org.billing",label:"Billing",icon:i.jsx(Ye,{size:14})}],e[12]=P):P=e[12];const S=P;let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=j):j=e[13];let h;e[14]!==v||e[15]!==r||e[16]!==n?(h=i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[j,v.map(A=>i.jsxs("button",{type:"button",onClick:()=>n(A.key),className:oe("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===A.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:A.icon}),i.jsx("span",{className:"truncate",children:A.label})]},A.key))]}),e[14]=v,e[15]=r,e[16]=n,e[17]=h):h=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=y):y=e[18];let k;e[19]!==r||e[20]!==n?(k=i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[y,S.map(A=>i.jsxs("button",{type:"button",onClick:()=>n(A.key),className:oe("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===A.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[i.jsx("span",{className:"shrink-0",children:A.icon}),i.jsx("span",{className:"truncate",children:A.label})]},A.key))]}),e[19]=r,e[20]=n,e[21]=k):k=e[21];let N;e[22]!==r||e[23]!==n||e[24]!==s.experimental_projects?(N=s.experimental_projects&&i.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[i.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Projects"}),i.jsx(g.Suspense,{fallback:i.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/50",children:"Loading…"}),children:i.jsx(fi,{activeSection:r,onNavigate:n})})]}),e[22]=r,e[23]=n,e[24]=s.experimental_projects,e[25]=N):N=e[25];let C;return e[26]!==h||e[27]!==k||e[28]!==N?(C=i.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[h,k,N]}),e[26]=h,e[27]=k,e[28]=N,e[29]=C):C=e[29],C}function xi(){const t=z.c(32),{data:e}=Ue.useSession(),[r,n]=g.useState(!1),a=e?.user,s=a?.image;let l;t[0]!==a?(l=()=>{a?.id&&navigator.clipboard.writeText(a.id).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},t[0]=a,t[1]=l):l=t[1];const o=l;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const u=a?.name??"U";let c;t[3]!==u||t[4]!==s?(c=i.jsx(Lt,{url:s,fallback:u,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=u,t[4]=s,t[5]=c):c=t[5];const f=a?.name??"User";let m;t[6]!==f?(m=i.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:f}),t[6]=f,t[7]=m):m=t[7];const x=a?.email;let p;t[8]!==x?(p=i.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=p):p=t[9];let v;t[10]!==m||t[11]!==p?(v=i.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[m,p]}),t[10]=m,t[11]=p,t[12]=v):v=t[12];let b;t[13]!==c||t[14]!==v?(b=i.jsxs("div",{className:"flex items-center gap-4",children:[c,v]}),t[13]=c,t[14]=v,t[15]=b):b=t[15];let w;t[16]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=w):w=t[16];let P;t[17]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=P):P=t[17];const S=a?.id;let j;t[18]!==S?(j=i.jsx("span",{className:"font-mono text-sm",children:S}),t[18]=S,t[19]=j):j=t[19];let h;t[20]!==r?(h=r?i.jsx(Rr,{size:14,className:"text-green-600 shrink-0"}):i.jsx(Br,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=h):h=t[21];let y;t[22]!==o||t[23]!==j||t[24]!==h?(y=i.jsx(Tr,{asChild:!0,children:i.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[j,h]})}),t[22]=o,t[23]=j,t[24]=h,t[25]=y):y=t[25];let k;t[26]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(zr,{side:"left",children:i.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=k):k=t[26];let N;t[27]!==y?(N=i.jsxs("div",{className:"flex flex-col",children:[w,i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[P,i.jsx(Lr,{children:i.jsxs($r,{children:[y,k]})})]})]}),t[27]=y,t[28]=N):N=t[28];let C;return t[29]!==N||t[30]!==b?(C=i.jsxs("div",{className:"flex flex-col gap-8",children:[d,b,N]}),t[29]=N,t[30]=b,t[31]=C):C=t[31],C}function Le(t){const e=z.c(27),{icon:r,label:n,description:a,control:s,onClick:l,disabled:o}=t,d=o?void 0:l,u=l?"button":void 0,c=l&&!o?0:void 0;let f;e[0]!==o||e[1]!==l?(f=l&&!o?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())}:void 0,e[0]=o,e[1]=l,e[2]=f):f=e[2];const m=l&&!o?"pointer":void 0;let x;e[3]!==m?(x={cursor:m},e[3]=m,e[4]=x):x=e[4];let p;e[5]!==r?(p=i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=p):p=e[6];let v;e[7]!==n?(v=i.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[7]=n,e[8]=v):v=e[8];let b;e[9]!==a?(b=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:a}),e[9]=a,e[10]=b):b=e[10];let w;e[11]!==v||e[12]!==b?(w=i.jsxs("div",{className:"min-w-0",children:[v,b]}),e[11]=v,e[12]=b,e[13]=w):w=e[13];let P;e[14]!==w||e[15]!==p?(P=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[p,w]}),e[14]=w,e[15]=p,e[16]=P):P=e[16];let S;e[17]!==s?(S=i.jsx("div",{onClick:gi,className:"shrink-0",children:s}),e[17]=s,e[18]=S):S=e[18];let j;return e[19]!==d||e[20]!==P||e[21]!==S||e[22]!==u||e[23]!==c||e[24]!==f||e[25]!==x?(j=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:u,tabIndex:c,onKeyDown:f,style:x,children:[P,S]}),e[19]=d,e[20]=P,e[21]=S,e[22]=u,e[23]=c,e[24]=f,e[25]=x,e[26]=j):j=e[26],j}function gi(t){return t.stopPropagation()}function dt(){const t=z.c(35),[e,r]=qe();let n;t[0]!==r?(n=async k=>{if(k&&await Notification.requestPermission()!=="granted"){V.error("Notifications denied. Please enable them in your browser settings."),r(yi);return}r(N=>({...N,enableNotifications:k}))},t[0]=r,t[1]=n):n=t[1];const a=n;let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=s):s=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(Gr,{size:16}),t[3]=l):l=t[3];let o;t[4]!==r?(o=()=>r(vi),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=k=>r(N=>({...N,devMode:k})),t[6]=r,t[7]=d):d=t[7];let u;t[8]!==e.devMode||t[9]!==d?(u=i.jsx(we,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=u):u=t[10];let c;t[11]!==o||t[12]!==u?(c=i.jsx(Le,{icon:l,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:u}),t[11]=o,t[12]=u,t[13]=c):c=t[13];let f;t[14]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(nr,{size:16}),t[14]=f):f=t[14];let m;t[15]!==a||t[16]!==e.enableNotifications?(m=i.jsx(Le,{icon:f,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>a(!e.enableNotifications),control:i.jsx(we,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:a})}),t[15]=a,t[16]=e.enableNotifications,t[17]=m):m=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(Kr,{size:16}),t[18]=x):x=t[18];let p;t[19]!==r?(p=k=>r(N=>({...N,toolApprovalLevel:k})),t[19]=r,t[20]=p):p=t[20];let v;t[21]===Symbol.for("react.memo_cache_sentinel")?(v={none:"None",readonly:"Read-only",yolo:"YOLO"},t[21]=v):v=t[21];const b=v[e.toolApprovalLevel];let w;t[22]!==b?(w=i.jsx(Ft,{className:"w-36",children:i.jsx("span",{children:b})}),t[22]=b,t[23]=w):w=t[23];let P;t[24]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(ye,{value:"none",textValue:"None",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"None"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=P):P=t[24];let S;t[25]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx(ye,{value:"readonly",textValue:"Read-only",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"Read-only"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=S):S=t[25];let j;t[26]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs(Rt,{children:[P,S,i.jsx(ye,{value:"yolo",textValue:"YOLO",children:i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("span",{className:"font-medium",children:"YOLO"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=j):j=t[26];let h;t[27]!==e.toolApprovalLevel||t[28]!==p||t[29]!==w?(h=i.jsx(Le,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:i.jsxs(Mt,{value:e.toolApprovalLevel,onValueChange:p,children:[w,j]})}),t[27]=e.toolApprovalLevel,t[28]=p,t[29]=w,t[30]=h):h=t[30];let y;return t[31]!==h||t[32]!==c||t[33]!==m?(y=i.jsxs("div",{className:"flex flex-col gap-6",children:[s,i.jsxs("div",{className:"flex flex-col",children:[c,m,h]})]}),t[31]=h,t[32]=c,t[33]=m,t[34]=y):y=t[34],y}function vi(t){return{...t,devMode:!t.devMode}}function yi(t){return{...t,enableNotifications:!1}}function ut(t){const e=z.c(22),{icon:r,label:n,description:a,checked:s,onCheckedChange:l}=t;let o;e[0]!==s||e[1]!==l?(o=()=>l(!s),e[0]=s,e[1]=l,e[2]=o):o=e[2];let d;e[3]!==r?(d=i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[3]=r,e[4]=d):d=e[4];let u;e[5]!==n?(u=i.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),e[5]=n,e[6]=u):u=e[6];let c;e[7]!==a?(c=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:a}),e[7]=a,e[8]=c):c=e[8];let f;e[9]!==u||e[10]!==c?(f=i.jsxs("div",{className:"min-w-0",children:[u,c]}),e[9]=u,e[10]=c,e[11]=f):f=e[11];let m;e[12]!==d||e[13]!==f?(m=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[d,f]}),e[12]=d,e[13]=f,e[14]=m):m=e[14];let x;e[15]!==s||e[16]!==l?(x=i.jsx("div",{onClick:bi,className:"shrink-0",children:i.jsx(we,{checked:s,onCheckedChange:l})}),e[15]=s,e[16]=l,e[17]=x):x=e[17];let p;return e[18]!==o||e[19]!==m||e[20]!==x?(p=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:o,children:[m,x]}),e[18]=o,e[19]=m,e[20]=x,e[21]=p):p=e[21],p}function bi(t){return t.stopPropagation()}function ji(){const t=z.c(16),[e,r]=qe();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),t[0]=n):n=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Nr,{size:16}),t[1]=a):a=t[1];let s;t[2]!==r?(s=f=>r(m=>({...m,experimental_projects:f})),t[2]=r,t[3]=s):s=t[3];let l;t[4]!==e.experimental_projects||t[5]!==s?(l=i.jsx(ut,{icon:a,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:e.experimental_projects,onCheckedChange:s}),t[4]=e.experimental_projects,t[5]=s,t[6]=l):l=t[6];let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Ur,{size:16}),t[7]=o):o=t[7];let d;t[8]!==r?(d=f=>r(m=>({...m,experimental_tasks:f})),t[8]=r,t[9]=d):d=t[9];let u;t[10]!==e.experimental_tasks||t[11]!==d?(u=i.jsx(ut,{icon:o,label:"Tasks",description:"Enable the tasks feature in the sidebar.",checked:e.experimental_tasks,onCheckedChange:d}),t[10]=e.experimental_tasks,t[11]=d,t[12]=u):u=t[12];let c;return t[13]!==l||t[14]!==u?(c=i.jsxs("div",{className:"flex flex-col gap-6",children:[n,i.jsxs("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:[l,u]})]}),t[13]=l,t[14]=u,t[15]=c):c=t[15],c}const ki=Ct({name:fe().min(1,"Name is required").max(255,"Name is too long"),slug:fe().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:fe().optional()});function wi(t){const e=z.c(24),{value:r,onChange:n,name:a}=t,s=g.useRef(null);let l;e[0]!==n?(l=j=>{const h=j.target.files?.[0];if(h){if(h.size>2097152){V.error("Image must be smaller than 2MB");return}const y=new FileReader;y.onerror=()=>{const k=y.error;console.error("FileReader error:",k),V.error(k?.message||"Failed to read image file. Please try again."),s.current&&(s.current.value="")},y.onloadend=()=>{if(y.readyState===FileReader.DONE&&y.result){const k=y.result;n(k)}},y.readAsDataURL(h)}},e[0]=n,e[1]=l):l=e[1];const o=l;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{s.current?.click()},e[2]=d):d=e[2];const u=d;let c;e[3]!==n?(c=j=>{j.stopPropagation(),n("")},e[3]=n,e[4]=c):c=e[4];const f=c;let m;e[5]!==o?(m=i.jsx("input",{type:"file",ref:s,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=m):m=e[6];let x;e[7]!==f||e[8]!==a||e[9]!==r?(x=r?i.jsxs("div",{className:"relative group",children:[i.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:i.jsx("img",{src:r,alt:a||"Organization logo",className:"w-full h-full object-cover"})}),i.jsx("button",{type:"button",onClick:f,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:i.jsx(Tt,{className:"h-3 w-3"})})]}):i.jsxs("button",{type:"button",onClick:u,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[i.jsx(qr,{className:"h-5 w-5"}),i.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=f,e[8]=a,e[9]=r,e[10]=x):x=e[10];const p=r?"Change Logo":"Upload Logo";let v;e[11]!==p?(v=i.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:u,className:"mb-2",children:p}),e[11]=p,e[12]=v):v=e[12];let b;e[13]!==f||e[14]!==r?(b=r&&i.jsx(H,{type:"button",variant:"ghost",size:"sm",onClick:f,className:"ml-2",children:"Remove"}),e[13]=f,e[14]=r,e[15]=b):b=e[15];let w;e[16]===Symbol.for("react.memo_cache_sentinel")?(w=i.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=w):w=e[16];let P;e[17]!==v||e[18]!==b?(P=i.jsxs("div",{className:"flex-1",children:[v,b,w]}),e[17]=v,e[18]=b,e[19]=P):P=e[19];let S;return e[20]!==P||e[21]!==m||e[22]!==x?(S=i.jsxs("div",{className:"flex items-start gap-4",children:[m,x,P]}),e[20]=P,e[21]=m,e[22]=x,e[23]=S):S=e[23],S}function Pi(){const t=Ce(),{org:e,project:r}=Z(),n=Ae(),[a,s]=g.useState(!1),l=At({resolver:Ot(ki),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Oe({mutationFn:async c=>{const f={name:c.name,slug:c.slug};c.logo&&(f.logo=c.logo);const m=await Ue.organization.update({organizationId:e.id,data:f});if(m?.error)throw new Error(m.error.message||"Failed to update organization");return m},onSuccess:c=>{n.invalidateQueries({queryKey:X.organizations()}),n.invalidateQueries({queryKey:X.activeOrganization(e.slug)}),V.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{V.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{s(!1)}}),d=c=>{s(!0),o.mutate(c)},u=l.formState.isDirty;return i.jsx(Bt,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(d),className:"space-y-6",children:[i.jsx(he,{control:l.control,name:"name",render:({field:c})=>i.jsxs(re,{children:[i.jsx(ne,{children:"Organization Name"}),i.jsx(ie,{children:i.jsx(xe,{placeholder:"My Organization",...c,disabled:a})}),i.jsx(pe,{})]})}),i.jsx(he,{control:l.control,name:"slug",render:({field:c})=>i.jsxs(re,{children:[i.jsx(ne,{children:"Organization Slug"}),i.jsx(ie,{children:i.jsx(xe,{placeholder:"my-organization",...c,disabled:a,onChange:f=>{const m=f.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(m)}})}),i.jsx(Me,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),i.jsx(pe,{})]})}),i.jsx(he,{control:l.control,name:"logo",render:({field:c})=>i.jsxs(re,{children:[i.jsx(ne,{children:"Logo"}),i.jsx(ie,{children:i.jsx(wi,{value:c.value,onChange:c.onChange,name:l.watch("name")})}),i.jsx(pe,{})]})}),i.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[i.jsx(H,{type:"submit",disabled:!u||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),u&&i.jsx(H,{type:"button",variant:"outline",onClick:()=>l.reset(),disabled:a,children:"Cancel"})]})]})})}function Si(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),i.jsx(Pi,{})]}),t[0]=e):e=t[0],e}const Ni=Ct({name:fe().min(1,"Name is required").max(200,"Name is too long"),description:fe().max(1e3,"Description is too long").nullable(),themeColor:fe().nullable()});function Ci(){const t=z.c(63),{org:e,project:r}=Z(),n=Ae(),a=r.slug===J;let s;t[0]!==e.id?(s={connectionId:He,orgId:e.id},t[0]=e.id,t[1]=s):s=t[1];const l=je(s);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=Ot(Ni),t[2]=o):o=t[2];const d=r.name??"",u=r.description??"",c=r.ui?.themeColor??"#60a5fa";let f;t[3]!==d||t[4]!==u||t[5]!==c?(f={resolver:o,values:{name:d,description:u,themeColor:c}},t[3]=d,t[4]=u,t[5]=c,t[6]=f):f=t[6];const m=At(f);let x;t[7]!==l||t[8]!==r.id||t[9]!==r.ui?.banner||t[10]!==r.ui?.bannerColor||t[11]!==r.ui?.icon?(x=async I=>{const D=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:r.id,name:I.name,description:I.description||null,ui:{themeColor:I.themeColor||null,banner:r.ui?.banner??null,bannerColor:r.ui?.bannerColor??null,icon:r.ui?.icon??null}}});return D.structuredContent??D},t[7]=l,t[8]=r.id,t[9]=r.ui?.banner,t[10]=r.ui?.bannerColor,t[11]=r.ui?.icon,t[12]=x):x=t[12];let p;t[13]!==m||t[14]!==e.id||t[15]!==r.slug||t[16]!==n?(p=()=>{n.invalidateQueries({queryKey:X.project(e.id,r.slug)}),n.invalidateQueries({queryKey:X.projects(e.id)}),m.reset(m.getValues())},t[13]=m,t[14]=e.id,t[15]=r.slug,t[16]=n,t[17]=p):p=t[17];let v;t[18]!==x||t[19]!==p?(v={mutationFn:x,onSuccess:p,onError:Ai},t[18]=x,t[19]=p,t[20]=v):v=t[20];const b=Oe(v);let w;t[21]!==b?(w=async I=>{await b.mutateAsync(I)},t[21]=b,t[22]=w):w=t[22];const P=w;let S;t[23]!==m||t[24]!==P?(S=I=>{I(),m.handleSubmit(P)()},t[23]=m,t[24]=P,t[25]=S):S=t[25];const j=S;let h;t[26]!==m||t[27]!==P?(h=m.handleSubmit(P),t[26]=m,t[27]=P,t[28]=h):h=t[28];let y;t[29]!==a||t[30]!==b.isPending||t[31]!==j?(y=I=>{const{field:D}=I;return i.jsxs(re,{children:[i.jsx(ne,{children:"Project Name"}),i.jsx(ie,{children:i.jsx(xe,{placeholder:"My Project",...D,onBlur:()=>j(D.onBlur),disabled:a||b.isPending})}),a&&i.jsx(Me,{children:"The organization admin project name cannot be changed."}),i.jsx(pe,{})]})},t[29]=a,t[30]=b.isPending,t[31]=j,t[32]=y):y=t[32];let k;t[33]!==m.control||t[34]!==y?(k=i.jsx(he,{control:m.control,name:"name",render:y}),t[33]=m.control,t[34]=y,t[35]=k):k=t[35];let N;t[36]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(ne,{children:"Slug"}),t[36]=N):N=t[36];let C;t[37]!==r.slug?(C=i.jsx(ie,{children:i.jsx(xe,{value:r.slug,disabled:!0,className:"bg-muted"})}),t[37]=r.slug,t[38]=C):C=t[38];let A;t[39]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(Me,{children:"The project slug cannot be changed after creation."}),t[39]=A):A=t[39];let O;t[40]!==C?(O=i.jsxs(re,{children:[N,C,A]}),t[40]=C,t[41]=O):O=t[41];let _;t[42]!==b.isPending||t[43]!==j?(_=I=>{const{field:D}=I;return i.jsxs(re,{children:[i.jsx(ne,{children:"Description"}),i.jsx(ie,{children:i.jsx(Yr,{placeholder:"Optional project description...",rows:3,...D,value:D.value??"",onBlur:()=>j(D.onBlur),disabled:b.isPending})}),i.jsx(pe,{})]})},t[42]=b.isPending,t[43]=j,t[44]=_):_=t[44];let E;t[45]!==m.control||t[46]!==_?(E=i.jsx(he,{control:m.control,name:"description",render:_}),t[45]=m.control,t[46]=_,t[47]=E):E=t[47];let T;t[48]!==b.isPending||t[49]!==j?(T=I=>{const{field:D}=I;return i.jsxs(re,{children:[i.jsx(ne,{children:"Color"}),i.jsx(ie,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"size-9 rounded-md border border-input overflow-hidden cursor-pointer shrink-0",style:{backgroundColor:D.value??"#60a5fa"},children:i.jsx("input",{type:"color",value:D.value??"#60a5fa",onChange:B=>D.onChange(B.target.value),onBlur:()=>j(D.onBlur),disabled:b.isPending,className:"opacity-0 w-full h-full cursor-pointer"})}),i.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:D.value??"#60a5fa"})]})}),i.jsx(pe,{})]})},t[48]=b.isPending,t[49]=j,t[50]=T):T=t[50];let L;t[51]!==m.control||t[52]!==T?(L=i.jsx(he,{control:m.control,name:"themeColor",render:T}),t[51]=m.control,t[52]=T,t[53]=L):L=t[53];let F;t[54]!==h||t[55]!==k||t[56]!==O||t[57]!==E||t[58]!==L?(F=i.jsxs("form",{onSubmit:h,className:"space-y-6",children:[k,O,E,L]}),t[54]=h,t[55]=k,t[56]=O,t[57]=E,t[58]=L,t[59]=F):F=t[59];let $;return t[60]!==m||t[61]!==F?($=i.jsx("div",{className:"flex flex-col",children:i.jsx(Bt,{...m,children:F})}),t[60]=m,t[61]=F,t[62]=$):$=t[62],$}function Ai(t){V.error("Failed to update project: "+(t instanceof Error?t.message:"Unknown error"))}function ir(){const t=z.c(45),{org:e,project:r}=Z(),n=Ce(),a=Ae(),[s,l]=g.useState(""),[o,d]=g.useState(!1),u=r.slug===J;let c;t[0]!==e.id?(c={connectionId:He,orgId:e.id},t[0]=e.id,t[1]=c):c=t[1];const f=je(c);let m;t[2]!==f||t[3]!==r.id?(m=async()=>{const R=await f.callTool({name:"PROJECT_DELETE",arguments:{projectId:r.id}});return R.structuredContent??R},t[2]=f,t[3]=r.id,t[4]=m):m=t[4];let x;t[5]!==n||t[6]!==e.id||t[7]!==e.slug||t[8]!==a?(x=R=>{R.success?(a.invalidateQueries({queryKey:X.projects(e.id)}),V.success("Project deleted"),n({to:"/$org/$project",params:{org:e.slug,project:J}})):V.error(R.message??"Failed to delete project")},t[5]=n,t[6]=e.id,t[7]=e.slug,t[8]=a,t[9]=x):x=t[9];let p;t[10]!==m||t[11]!==x?(p={mutationFn:m,onSuccess:x,onError:Oi},t[10]=m,t[11]=x,t[12]=p):p=t[12];const v=Oe(p);if(u)return null;const b=s===r.name;let w;t[13]!==v?(w=()=>{v.mutate()},t[13]=v,t[14]=w):w=t[14];const P=w;let S;t[15]===Symbol.for("react.memo_cache_sentinel")?(S=R=>{d(R),R||l("")},t[15]=S):S=t[15];const j=S;let h;t[16]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"Danger Zone"}),t[16]=h):h=t[16];let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete Project"}),i.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Permanently delete this project and all its data. This action cannot be undone."})]}),t[17]=y):y=t[17];let k;t[18]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsx(Vr,{asChild:!0,children:i.jsx(H,{variant:"outline",className:"shrink-0 bg-destructive/10 text-destructive border-0 hover:bg-destructive/15 hover:text-destructive",children:"Delete Project"})}),t[18]=k):k=t[18];let N;t[19]!==r.name?(N=i.jsxs(Hr,{children:['Delete "',r.name,'"?']}),t[19]=r.name,t[20]=N):N=t[20];let C;t[21]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Xr,{children:"This action cannot be undone. All project data will be permanently deleted."}),t[21]=C):C=t[21];let A;t[22]!==N?(A=i.jsxs(Qr,{children:[N,C]}),t[22]=N,t[23]=A):A=t[23];let O;t[24]!==r.name?(O=i.jsxs("p",{className:"text-sm mb-2",children:["Type ",i.jsx("strong",{children:r.name})," to confirm:"]}),t[24]=r.name,t[25]=O):O=t[25];let _;t[26]===Symbol.for("react.memo_cache_sentinel")?(_=R=>l(R.target.value),t[26]=_):_=t[26];let E;t[27]!==s||t[28]!==r.name?(E=i.jsx(xe,{value:s,onChange:_,placeholder:r.name}),t[27]=s,t[28]=r.name,t[29]=E):E=t[29];let T;t[30]!==O||t[31]!==E?(T=i.jsxs("div",{className:"py-4",children:[O,E]}),t[30]=O,t[31]=E,t[32]=T):T=t[32];let L;t[33]===Symbol.for("react.memo_cache_sentinel")?(L=i.jsx(Jr,{children:"Cancel"}),t[33]=L):L=t[33];const F=!b||v.isPending,$=v.isPending?"Deleting...":"Delete Project";let I;t[34]!==P||t[35]!==F||t[36]!==$?(I=i.jsxs(Zr,{children:[L,i.jsx(en,{onClick:P,disabled:F,className:"bg-destructive/10 text-destructive hover:bg-destructive/15 hover:text-destructive border-0",children:$})]}),t[34]=P,t[35]=F,t[36]=$,t[37]=I):I=t[37];let D;t[38]!==A||t[39]!==T||t[40]!==I?(D=i.jsxs(tn,{children:[A,T,I]}),t[38]=A,t[39]=T,t[40]=I,t[41]=D):D=t[41];let B;return t[42]!==o||t[43]!==D?(B=i.jsxs("div",{className:"flex flex-col",children:[h,i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[y,i.jsxs(rn,{open:o,onOpenChange:j,children:[k,D]})]})]}),t[42]=o,t[43]=D,t[44]=B):B=t[44],B}function Oi(t){V.error("Failed to delete project: "+(t instanceof Error?t.message:"Unknown error"))}function _i(){const t=z.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"General"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsxs("div",{className:"flex flex-col",children:[e,i.jsxs("div",{className:"pt-6 flex flex-col gap-6",children:[i.jsx(Ci,{}),i.jsx(ir,{})]})]}),t[1]=r):r=t[1],r}function Ei({value:t,onValueChange:e,placeholder:r="Select a connection...",binding:n,bindingType:a,onAddNew:s,className:l,disabled:o=!1}){const[d,u]=g.useState(!1),{installByBinding:c,isInstalling:f}=on(),m=d||f,x=Wt(),p=sn({connections:x,binding:typeof n=="string"?n:void 0}),v=!n||!x?x??[]:typeof n=="string"?p:Array.isArray(n)&&n.length>0?x.filter(h=>ln(h,n)):x,b=(()=>{if(!a?.startsWith("@"))return null;const[h,y]=a.replace("@","").split("/");return h&&y?{scope:h,appName:y}:null})(),w=(()=>{let h=v;const y=Array.isArray(n)&&n.length>0;if(b&&!y&&(h=h.filter(k=>{const N=k.app_name,C=k.metadata?.scopeName;return N===b.appName&&C===b.scope})),t&&!h.some(k=>k.id===t)){const k=x?.find(N=>N.id===t);if(k)return[k,...h]}return h})(),P=a?.startsWith("@"),S=async()=>{if(P&&a){u(!0);try{const h=await c(a);h&&e(h.id)}finally{u(!1)}return}s?.()},j=w.find(h=>h.id===t);return i.jsxs(Mt,{value:t??"none",onValueChange:h=>e(h==="none"?null:h),disabled:o,children:[i.jsx(Ft,{size:"sm",className:oe("w-[200px]",l),children:i.jsx(Wr,{placeholder:r,children:j?i.jsxs("div",{className:"flex items-center gap-2",children:[j.icon?i.jsx("img",{src:j.icon,alt:j.title,className:"w-4 h-4 rounded shrink-0"}):i.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:j.title.slice(0,1).toUpperCase()}),i.jsx("span",{className:"truncate",children:j.title})]}):r})}),i.jsxs(Rt,{children:[i.jsx(ye,{value:"none",children:"No connection"}),w.length===0?i.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):w.map(h=>i.jsx(ye,{value:h.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[h.icon?i.jsx("img",{src:h.icon,alt:h.title,className:"w-4 h-4 rounded"}):i.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:h.title.slice(0,1).toUpperCase()}),i.jsx("span",{children:h.title})]})},h.id)),(s||P)&&i.jsx("div",{className:"border-t border-border",children:i.jsx(H,{onPointerDown:h=>h.stopPropagation(),onClick:h=>{h.preventDefault(),h.stopPropagation(),S()},disabled:m||o,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:m?i.jsxs(i.Fragment,{children:[i.jsx(cn,{size:16,className:"animate-spin"}),i.jsx("span",{children:"Connecting..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Gt,{size:16}),i.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ii=t=>{if(!t||typeof t!="object")return!1;const e=t;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},Re=t=>{const e=t.structuredContent??t,r=e&&typeof e=="object"?e:null,n=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(n??"Tool call failed");if(Ii(e))throw new Error(e.text);return e};function Di(t){return t.requiresMcpBinding===!0?!0:t.binding!==void 0}function Ti(t){const e=z.c(57),{plugin:r,isEnabled:n,isSaving:a,pendingBinding:s,description:l,label:o,icon:d,projectId:u,client:c,onBindingChange:f,onToggle:m}=t;let x;e[0]!==r?(x=Di(r),e[0]=r,e[1]=x):x=e[1];const p=x;let v;e[2]!==r.id||e[3]!==u?(v=X.projectPluginConfig(u??"",r.id),e[2]=r.id,e[3]=u,e[4]=v):v=e[4];let b;e[5]!==c||e[6]!==r.id||e[7]!==u?(b=async()=>{if(!u)throw new Error("Project ID is required to load plugin config.");const B=await c.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:u,pluginId:r.id}});return Re(B)},e[5]=c,e[6]=r.id,e[7]=u,e[8]=b):b=e[8];const w=!!u&&p;let P;e[9]!==v||e[10]!==b||e[11]!==w?(P={queryKey:v,queryFn:b,enabled:w},e[9]=v,e[10]=b,e[11]=w,e[12]=P):P=e[12];const{data:S,isLoading:j}=nn(P),h=S?.config?.connectionId??null,y=s!==void 0?s:h;let k;e[13]!==n||e[14]!==a||e[15]!==m||e[16]!==r.id?(k=()=>!a&&m(r.id,!n),e[13]=n,e[14]=a,e[15]=m,e[16]=r.id,e[17]=k):k=e[17];const N=a?void 0:"pointer";let C;e[18]!==N?(C={cursor:N},e[18]=N,e[19]=C):C=e[19];let A;e[20]!==d?(A=d&&i.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:d}),e[20]=d,e[21]=A):A=e[21];let O;e[22]!==o?(O=i.jsx("p",{className:"text-sm font-medium text-foreground",children:o}),e[22]=o,e[23]=O):O=e[23];let _;e[24]!==l?(_=l&&i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:l}),e[24]=l,e[25]=_):_=e[25];let E;e[26]!==O||e[27]!==_?(E=i.jsxs("div",{className:"min-w-0",children:[O,_]}),e[26]=O,e[27]=_,e[28]=E):E=e[28];let T;e[29]!==E||e[30]!==A?(T=i.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[A,E]}),e[29]=E,e[30]=A,e[31]=T):T=e[31];let L;e[32]!==m||e[33]!==r.id?(L=B=>m(r.id,B),e[32]=m,e[33]=r.id,e[34]=L):L=e[34];let F;e[35]!==n||e[36]!==a||e[37]!==L?(F=i.jsx("div",{onClick:Li,className:"shrink-0",children:i.jsx(we,{checked:n,onCheckedChange:L,disabled:a})}),e[35]=n,e[36]=a,e[37]=L,e[38]=F):F=e[38];let $;e[39]!==T||e[40]!==F?($=i.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[T,F]}),e[39]=T,e[40]=F,e[41]=$):$=e[41];let I;e[42]!==j||e[43]!==n||e[44]!==a||e[45]!==p||e[46]!==f||e[47]!==r.binding||e[48]!==r.id||e[49]!==y||e[50]!==h?(I=n&&p&&i.jsxs("div",{onClick:zi,className:"pb-4 pl-7 flex items-center gap-3",children:[i.jsx(Fe,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),i.jsx(Ei,{value:y??null,onValueChange:B=>f(r.id,B,h),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:a||j})]}),e[42]=j,e[43]=n,e[44]=a,e[45]=p,e[46]=f,e[47]=r.binding,e[48]=r.id,e[49]=y,e[50]=h,e[51]=I):I=e[51];let D;return e[52]!==$||e[53]!==I||e[54]!==k||e[55]!==C?(D=i.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:k,style:C,children:[$,I]}),e[52]=$,e[53]=I,e[54]=k,e[55]=C,e[56]=D):D=e[56],D}function zi(t){return t.stopPropagation()}function Li(t){return t.stopPropagation()}function $i(){const{org:t,project:e}=Z(),r=Ae(),n=je({connectionId:He,orgId:t.id}),[a,s]=g.useState({}),[l,o]=g.useState({}),[d,u]=g.useState(!1),c=e.enabledPlugins??[],f=h=>{const y=a[h];return y!==void 0?y:c.includes(h)},m=()=>{const h=new Set(c);for(const[y,k]of Object.entries(a))k?h.add(y):h.delete(y);return Array.from(h)},x=Object.keys(a).length>0||Object.keys(l).length>0,p=(h,y)=>{const k=c.includes(h);s(y===k?N=>{const{[h]:C,...A}=N;return A}:N=>({...N,[h]:y}))},v=(h,y,k)=>{if(y===k){o(N=>{const{[h]:C,...A}=N;return A});return}o(N=>({...N,[h]:y}))},b=Oe({mutationFn:async h=>{const y=[];if(h.updatePlugins){const k=await n.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:h.enabledPlugins}});y.push(Re(k))}if(h.bindingUpdates.length>0){const k=await Promise.all(h.bindingUpdates.map(async({pluginId:N,connectionId:C})=>{const A=await n.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:N,connectionId:C}});return Re(A)}));y.push(...k)}return y},onSuccess:(h,y)=>{y.updatePlugins&&(r.invalidateQueries({queryKey:X.project(t.id,e.slug)}),r.invalidateQueries({queryKey:X.projects(t.id)})),y.bindingUpdates.forEach(({pluginId:k})=>{r.invalidateQueries({queryKey:X.projectPluginConfig(e.id??"",k)})}),s({}),o({}),V.success("Plugins updated successfully")},onError:h=>{V.error("Failed to update plugins: "+(h instanceof Error?h.message:"Unknown error"))},onSettled:()=>{u(!1)}}),w=()=>{u(!0),b.mutate({enabledPlugins:m(),updatePlugins:Object.keys(a).length>0,bindingUpdates:Object.entries(l).map(([h,y])=>({pluginId:h,connectionId:y}))})},P=()=>{s({}),o({})},S=h=>{const y=Cr.find(k=>k.pluginId===h);return y?{label:y.label,icon:y.items[0]?.icon}:null},j=h=>De.find(k=>k.id===h)?.description??null;return De.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex flex-col",children:De.map(h=>{const y=S(h.id),k=j(h.id),N=f(h.id);return i.jsx(Ti,{plugin:h,isEnabled:N,isSaving:d,pendingBinding:l[h.id],description:k,label:y?.label??h.id,icon:y?.icon??i.jsx(an,{size:14}),projectId:e.id,client:n,onBindingChange:v,onToggle:p},h.id)})}),i.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[i.jsx(H,{variant:"outline",onClick:P,disabled:!x||d,children:"Cancel"}),i.jsx(H,{onClick:w,disabled:!x||d,className:"min-w-24",children:d?"Saving...":"Save Changes"})]})]})}function mt(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsx("div",{children:i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Plugins"})}),i.jsx($i,{})]}),t[0]=e):e=t[0],e}function Mi(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Danger Zone"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),i.jsx(ir,{})]}),t[0]=e):e=t[0],e}var ft=function(e,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),s=2;s<n;s++)a[s-2]=arguments[s];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>a[l++]))}};function Fi(t){return t&&typeof t=="object"&&"className"in t&&typeof t.className=="string"?t.className:""}function Ri(t){return(t%180+180)%180}var Bi=function(e){var{width:r,height:n}=e,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Ri(a),l=s*Math.PI/180,o=Math.atan(n/r),d=l>o&&l<Math.PI-o?n/Math.sin(l):r/Math.cos(l);return Math.abs(d)};function ar(t,e){if(e<1)return[];if(e===1)return t;for(var r=[],n=0;n<t.length;n+=e){var a=t[n];a!==void 0&&r.push(a)}return r}function Wi(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Bi(n,r)}function Gi(t,e,r){var n=r==="width",{x:a,y:s,width:l,height:o}=t;return e===1?{start:n?a:s,end:n?a+l:s+o}:{start:n?a+l:s+o,end:n?a:s}}function be(t,e,r,n,a){if(t*e<t*n||t*e>t*a)return!1;var s=r();return t*(e-t*s/2-n)>=0&&t*(e+t*s/2-a)<=0}function Ki(t,e){return ar(t,e+1)}function Ui(t,e,r,n,a){for(var s=(n||[]).slice(),{start:l,end:o}=e,d=0,u=1,c=l,f=function(){var p=n?.[d];if(p===void 0)return{v:ar(n,u)};var v=d,b,w=()=>(b===void 0&&(b=r(p,v)),b),P=p.coordinate,S=d===0||be(t,P,w,c,o);S||(d=0,c=l,u+=1),S&&(c=P+t*(w()/2+a),d+=u)},m;u<=s.length;)if(m=f(),m)return m.v;return[]}function qi(t,e,r,n,a){var s=(n||[]).slice(),l=s.length;if(l===0)return[];for(var{start:o,end:d}=e,u=1;u<=l;u++){for(var c=(l-1)%u,f=o,m=!0,x=function(){var j=n[v];if(j==null)return 0;var h=v,y,k=()=>(y===void 0&&(y=r(j,h)),y),N=j.coordinate,C=v===c||be(t,N,k,f,d);if(!C)return m=!1,1;C&&(f=N+t*(k()/2+a))},p,v=c;v<l&&(p=x(),!(p!==0&&p===1));v+=u);if(m){for(var b=[],w=c;w<l;w+=u){var P=n[w];P!=null&&b.push(P)}return b}}return[]}function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function K(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ht(Object(r),!0).forEach(function(n){Yi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Yi(t,e,r){return(e=Hi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hi(t){var e=Vi(t,"string");return typeof e=="symbol"?e:e+""}function Vi(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xi(t,e,r,n,a){for(var s=(n||[]).slice(),l=s.length,{start:o}=e,{end:d}=e,u=function(m){var x=s[m];if(x==null)return 1;var p=x,v,b=()=>(v===void 0&&(v=r(x,m)),v);if(m===l-1){var w=t*(p.coordinate+t*b()/2-d);s[m]=p=K(K({},p),{},{tickCoord:w>0?p.coordinate-w*t:p.coordinate})}else s[m]=p=K(K({},p),{},{tickCoord:p.coordinate});if(p.tickCoord!=null){var P=be(t,p.tickCoord,b,o,d);P&&(d=p.tickCoord-t*(b()/2+a),s[m]=K(K({},p),{},{isShow:!0}))}},c=l-1;c>=0;c--)u(c);return s}function Qi(t,e,r,n,a,s){var l=(n||[]).slice(),o=l.length,{start:d,end:u}=e;if(s){var c=n[o-1];if(c!=null){var f=r(c,o-1),m=t*(c.coordinate+t*f/2-u);if(l[o-1]=c=K(K({},c),{},{tickCoord:m>0?c.coordinate-m*t:c.coordinate}),c.tickCoord!=null){var x=be(t,c.tickCoord,()=>f,d,u);x&&(u=c.tickCoord-t*(f/2+a),l[o-1]=K(K({},c),{},{isShow:!0}))}}}for(var p=s?o-1:o,v=function(P){var S=l[P];if(S==null)return 1;var j=S,h,y=()=>(h===void 0&&(h=r(S,P)),h);if(P===0){var k=t*(j.coordinate-t*y()/2-d);l[P]=j=K(K({},j),{},{tickCoord:k<0?j.coordinate-k*t:j.coordinate})}else l[P]=j=K(K({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var N=be(t,j.tickCoord,y,d,u);N&&(d=j.tickCoord+t*(y()/2+a),l[P]=K(K({},j),{},{isShow:!0}))}},b=0;b<p;b++)v(b);return l}function tt(t,e,r){var{tick:n,ticks:a,viewBox:s,minTickGap:l,orientation:o,interval:d,tickFormatter:u,unit:c,angle:f}=t;if(!a||!a.length||!n)return[];if(q(d)||Kt.isSsr){var m;return(m=Ki(a,q(d)?d:0))!==null&&m!==void 0?m:[]}var x=[],p=o==="top"||o==="bottom"?"width":"height",v=c&&p==="width"?Te(c,{fontSize:e,letterSpacing:r}):{width:0,height:0},b=(h,y)=>{var k=typeof u=="function"?u(h.value,y):h.value;return p==="width"?Wi(Te(k,{fontSize:e,letterSpacing:r}),v,f):Te(k,{fontSize:e,letterSpacing:r})[p]},w=a[0],P=a[1],S=a.length>=2&&w!=null&&P!=null?dn(P.coordinate-w.coordinate):1,j=Gi(s,S,p);return d==="equidistantPreserveStart"?Ui(S,j,b,a,l):d==="equidistantPreserveEnd"?qi(S,j,b,a,l):(d==="preserveStart"||d==="preserveStartEnd"?x=Qi(S,j,b,a,l,d==="preserveStartEnd"):x=Xi(S,j,b,a,l),x.filter(h=>h.isShow))}var Ji=t=>{var{ticks:e,label:r,labelGapWithTick:n=5,tickSize:a=0,tickMargin:s=0}=t,l=0;if(e){Array.from(e).forEach(c=>{if(c){var f=c.getBoundingClientRect();f.width>l&&(l=f.width)}});var o=r?r.getBoundingClientRect().width:0,d=a+s,u=l+d+o+(r?n:0);return Math.round(u)}return 0},Zi=["axisLine","width","height","className","hide","ticks","axisType"];function ea(t,e){if(t==null)return{};var r,n,a=ta(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function ta(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},de.apply(null,arguments)}function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pt(Object(r),!0).forEach(function(n){ra(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ra(t,e,r){return(e=na(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function na(t){var e=ia(t,"string");return typeof e=="symbol"?e:e+""}function ia(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Q={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:_e.axis};function aa(t){var{x:e,y:r,width:n,height:a,orientation:s,mirror:l,axisLine:o,otherSvgProps:d}=t;if(!o)return null;var u=M(M(M({},d),ve(o)),{},{fill:"none"});if(s==="top"||s==="bottom"){var c=+(s==="top"&&!l||s==="bottom"&&l);u=M(M({},u),{},{x1:e,y1:r+c*a,x2:e+n,y2:r+c*a})}else{var f=+(s==="left"&&!l||s==="right"&&l);u=M(M({},u),{},{x1:e+f*n,y1:r,x2:e+f*n,y2:r+a})}return g.createElement("line",de({},u,{className:te("recharts-cartesian-axis-line",Ut(o,"className"))}))}function sa(t,e,r,n,a,s,l,o,d){var u,c,f,m,x,p,v=o?-1:1,b=t.tickSize||l,w=q(t.tickCoord)?t.tickCoord:t.coordinate;switch(s){case"top":u=c=t.coordinate,m=r+ +!o*a,f=m-v*b,p=f-v*d,x=w;break;case"left":f=m=t.coordinate,c=e+ +!o*n,u=c-v*b,x=u-v*d,p=w;break;case"right":f=m=t.coordinate,c=e+ +o*n,u=c+v*b,x=u+v*d,p=w;break;default:u=c=t.coordinate,m=r+ +o*a,f=m+v*b,p=f+v*d,x=w;break}return{line:{x1:u,y1:f,x2:c,y2:m},tick:{x,y:p}}}function la(t,e){switch(t){case"left":return e?"start":"end";case"right":return e?"end":"start";default:return"middle"}}function oa(t,e){switch(t){case"left":case"right":return"middle";case"top":return e?"start":"end";default:return e?"end":"start"}}function ca(t){var{option:e,tickProps:r,value:n}=t,a,s=te(r.className,"recharts-cartesian-axis-tick-value");if(g.isValidElement(e))a=g.cloneElement(e,M(M({},r),{},{className:s}));else if(typeof e=="function")a=e(M(M({},r),{},{className:s}));else{var l="recharts-cartesian-axis-tick-value";typeof e!="boolean"&&(l=te(l,Fi(e))),a=g.createElement(pn,de({},r,{className:l}),n)}return a}var da=g.forwardRef((t,e)=>{var{ticks:r=[],tick:n,tickLine:a,stroke:s,tickFormatter:l,unit:o,padding:d,tickTextProps:u,orientation:c,mirror:f,x:m,y:x,width:p,height:v,tickSize:b,tickMargin:w,fontSize:P,letterSpacing:S,getTicksConfig:j,events:h,axisType:y}=t,k=tt(M(M({},j),{},{ticks:r}),P,S),N=la(c,f),C=oa(c,f),A=ve(j),O=fn(n),_={};typeof a=="object"&&(_=a);var E=M(M({},A),{},{fill:"none"},_),T=k.map($=>M({entry:$},sa($,m,x,p,v,c,b,f,w))),L=T.map($=>{var{entry:I,line:D}=$;return g.createElement(ce,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(I.value,"-").concat(I.coordinate,"-").concat(I.tickCoord)},a&&g.createElement("line",de({},E,D,{className:te("recharts-cartesian-axis-tick-line",Ut(a,"className"))})))}),F=T.map(($,I)=>{var D,B,{entry:R,tick:wr}=$,Pr=M(M(M(M({verticalAnchor:C},A),{},{textAnchor:N,stroke:"none",fill:s},wr),{},{index:I,payload:R,visibleTicksCount:k.length,tickFormatter:l,padding:d},u),{},{angle:(D=(B=u?.angle)!==null&&B!==void 0?B:A.angle)!==null&&D!==void 0?D:0}),Sr=M(M({},Pr),O);return g.createElement(ce,de({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(R.value,"-").concat(R.coordinate,"-").concat(R.tickCoord)},hn(h,R,I)),n&&g.createElement(ca,{option:n,tickProps:Sr,value:"".concat(typeof l=="function"?l(R.value,I):R.value).concat(o||"")}))});return g.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(y,"-ticks")},F.length>0&&g.createElement(Ee,{zIndex:_e.label},g.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(y,"-tick-labels"),ref:e},F)),L.length>0&&g.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(y,"-tick-lines")},L))}),ua=g.forwardRef((t,e)=>{var{axisLine:r,width:n,height:a,className:s,hide:l,ticks:o,axisType:d}=t,u=ea(t,Zi),[c,f]=g.useState(""),[m,x]=g.useState(""),p=g.useRef(null);g.useImperativeHandle(e,()=>({getCalculatedWidth:()=>{var b;return Ji({ticks:p.current,label:(b=t.labelRef)===null||b===void 0?void 0:b.current,labelGapWithTick:5,tickSize:t.tickSize,tickMargin:t.tickMargin})}}));var v=g.useCallback(b=>{if(b){var w=b.getElementsByClassName("recharts-cartesian-axis-tick-value");p.current=w;var P=w[0];if(P){var S=window.getComputedStyle(P),j=S.fontSize,h=S.letterSpacing;(j!==c||h!==m)&&(f(j),x(h))}}},[c,m]);return l||n!=null&&n<=0||a!=null&&a<=0?null:g.createElement(Ee,{zIndex:t.zIndex},g.createElement(ce,{className:te("recharts-cartesian-axis",s)},g.createElement(aa,{x:t.x,y:t.y,width:n,height:a,orientation:t.orientation,mirror:t.mirror,axisLine:r,otherSvgProps:ve(t)}),g.createElement(da,{ref:v,axisType:d,events:u,fontSize:c,getTicksConfig:t,height:t.height,letterSpacing:m,mirror:t.mirror,orientation:t.orientation,padding:t.padding,stroke:t.stroke,tick:t.tick,tickFormatter:t.tickFormatter,tickLine:t.tickLine,tickMargin:t.tickMargin,tickSize:t.tickSize,tickTextProps:t.tickTextProps,ticks:o,unit:t.unit,width:t.width,x:t.x,y:t.y}),g.createElement(un,{x:t.x,y:t.y,width:t.width,height:t.height,lowerWidth:t.width,upperWidth:t.width},g.createElement(mn,{label:t.label,labelRef:t.labelRef}),t.children)))}),rt=g.forwardRef((t,e)=>{var r=ge(t,Q);return g.createElement(ua,de({},r,{ref:e}))});rt.displayName="CartesianAxis";var ma=["x1","y1","x2","y2","key"],fa=["offset"],ha=["xAxisId","yAxisId"],pa=["xAxisId","yAxisId"];function xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function U(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xt(Object(r),!0).forEach(function(n){xa(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xa(t,e,r){return(e=ga(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ga(t){var e=va(t,"string");return typeof e=="symbol"?e:e+""}function va(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ae(){return ae=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ae.apply(null,arguments)}function Se(t,e){if(t==null)return{};var r,n,a=ya(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function ya(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}var ba=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:n,y:a,width:s,height:l,ry:o}=t;return g.createElement("rect",{x:n,y:a,ry:o,width:s,height:l,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function sr(t){var{option:e,lineItemProps:r}=t,n;if(g.isValidElement(e))n=g.cloneElement(e,r);else if(typeof e=="function")n=e(r);else{var a,{x1:s,y1:l,x2:o,y2:d,key:u}=r,c=Se(r,ma),f=(a=ve(c))!==null&&a!==void 0?a:{},{offset:m}=f,x=Se(f,fa);n=g.createElement("line",ae({},x,{x1:s,y1:l,x2:o,y2:d,fill:"none",key:u}))}return n}function ja(t){var{x:e,width:r,horizontal:n=!0,horizontalPoints:a}=t;if(!n||!a||!a.length)return null;var{xAxisId:s,yAxisId:l}=t,o=Se(t,ha),d=a.map((u,c)=>{var f=U(U({},o),{},{x1:e,y1:u,x2:e+r,y2:u,key:"line-".concat(c),index:c});return g.createElement(sr,{key:"line-".concat(c),option:n,lineItemProps:f})});return g.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function ka(t){var{y:e,height:r,vertical:n=!0,verticalPoints:a}=t;if(!n||!a||!a.length)return null;var{xAxisId:s,yAxisId:l}=t,o=Se(t,pa),d=a.map((u,c)=>{var f=U(U({},o),{},{x1:u,y1:e,x2:u,y2:e+r,key:"line-".concat(c),index:c});return g.createElement(sr,{option:n,lineItemProps:f,key:"line-".concat(c)})});return g.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function wa(t){var{horizontalFill:e,fillOpacity:r,x:n,y:a,width:s,height:l,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var u=o.map(f=>Math.round(f+a-a)).sort((f,m)=>f-m);a!==u[0]&&u.unshift(0);var c=u.map((f,m)=>{var x=u[m+1],p=x==null,v=p?a+l-f:x-f;if(v<=0)return null;var b=m%e.length;return g.createElement("rect",{key:"react-".concat(m),y:f,x:n,height:v,width:s,stroke:"none",fill:e[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return g.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function Pa(t){var{vertical:e=!0,verticalFill:r,fillOpacity:n,x:a,y:s,width:l,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var u=d.map(f=>Math.round(f+a-a)).sort((f,m)=>f-m);a!==u[0]&&u.unshift(0);var c=u.map((f,m)=>{var x=u[m+1],p=x==null,v=p?a+l-f:x-f;if(v<=0)return null;var b=m%r.length;return g.createElement("rect",{key:"react-".concat(m),x:f,y:s,width:v,height:o,stroke:"none",fill:r[b],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return g.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var Sa=(t,e)=>{var{xAxis:r,width:n,height:a,offset:s}=t;return qt(tt(U(U(U({},Q),r),{},{ticks:Yt(r),viewBox:{x:0,y:0,width:n,height:a}})),s.left,s.left+s.width,e)},Na=(t,e)=>{var{yAxis:r,width:n,height:a,offset:s}=t;return qt(tt(U(U(U({},Q),r),{},{ticks:Yt(r),viewBox:{x:0,y:0,width:n,height:a}})),s.top,s.top+s.height,e)},Ca={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:_e.grid};function lr(t){var e=xn(),r=gn(),n=vn(),a=U(U({},ge(t,Ca)),{},{x:q(t.x)?t.x:n.left,y:q(t.y)?t.y:n.top,width:q(t.width)?t.width:n.width,height:q(t.height)?t.height:n.height}),{xAxisId:s,yAxisId:l,x:o,y:d,width:u,height:c,syncWithTicks:f,horizontalValues:m,verticalValues:x}=a,p=ke(),v=Y(C=>it(C,"xAxis",s,p)),b=Y(C=>it(C,"yAxis",l,p));if(!at(u)||!at(c)||!q(o)||!q(d))return null;var w=a.verticalCoordinatesGenerator||Sa,P=a.horizontalCoordinatesGenerator||Na,{horizontalPoints:S,verticalPoints:j}=a;if((!S||!S.length)&&typeof P=="function"){var h=m&&m.length,y=P({yAxis:b?U(U({},b),{},{ticks:h?m:b.ticks}):void 0,width:e??u,height:r??c,offset:n},h?!0:f);ft(Array.isArray(y),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof y,"]")),Array.isArray(y)&&(S=y)}if((!j||!j.length)&&typeof w=="function"){var k=x&&x.length,N=w({xAxis:v?U(U({},v),{},{ticks:k?x:v.ticks}):void 0,width:e??u,height:r??c,offset:n},k?!0:f);ft(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(j=N)}return g.createElement(Ee,{zIndex:a.zIndex},g.createElement("g",{className:"recharts-cartesian-grid"},g.createElement(ba,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),g.createElement(wa,ae({},a,{horizontalPoints:S})),g.createElement(Pa,ae({},a,{verticalPoints:j})),g.createElement(ja,ae({},a,{offset:n,horizontalPoints:S,xAxis:v,yAxis:b})),g.createElement(ka,ae({},a,{offset:n,verticalPoints:j,xAxis:v,yAxis:b}))))}lr.displayName="CartesianGrid";var or=(t,e,r)=>Ht(t,"xAxis",Xe(t,e),r),cr=(t,e,r)=>Vt(t,"xAxis",Xe(t,e),r),dr=(t,e,r)=>Ht(t,"yAxis",Qe(t,e),r),ur=(t,e,r)=>Vt(t,"yAxis",Qe(t,e),r),Aa=Ie([Ve,or,dr,cr,ur],(t,e,r,n,a)=>Xt(t,"xAxis")?st(e,n,!1):st(r,a,!1)),Oa=(t,e)=>e,mr=Ie([kn,Oa],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),fr=t=>{var e=Ve(t),r=Xt(e,"xAxis");return r?"yAxis":"xAxis"},_a=(t,e)=>{var r=fr(t);return r==="yAxis"?Qe(t,e):Xe(t,e)},Ea=(t,e,r)=>wn(t,fr(t),_a(t,e),r),Ia=Ie([mr,Ea],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:n}=t,a=jn(t);if(!(n==null||a==null)){var s=(r=e[n])===null||r===void 0?void 0:r.stackedData,l=s?.find(o=>o.key===a);if(l!=null)return l.map(o=>[o[0],o[1]])}}}),Da=Ie([Ve,or,dr,cr,ur,Ia,yn,Aa,mr,bn],(t,e,r,n,a,s,l,o,d,u)=>{var{chartData:c,dataStartIndex:f,dataEndIndex:m}=l;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||n==null||a==null||n.length===0||a.length===0||o==null)){var{data:x}=d,p;if(x&&x.length>0?p=x:p=c?.slice(f,m+1),p!=null)return Ja({layout:t,xAxis:e,yAxis:r,xAxisTicks:n,yAxisTicks:a,dataStartIndex:f,areaSettings:d,stackedData:s,displayedData:p,chartBaseValue:u,bandSize:o})}}),Ta=["id"],za=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function se(){return se=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},se.apply(null,arguments)}function hr(t,e){if(t==null)return{};var r,n,a=La(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function La(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gt(Object(r),!0).forEach(function(n){$a(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $a(t,e,r){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ma(t){var e=Fa(t,"string");return typeof e=="symbol"?e:e+""}function Fa(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ne(t,e){return t&&t!=="none"?t:e}var Ra=t=>{var{dataKey:e,name:r,stroke:n,fill:a,legendType:s,hide:l}=t;return[{inactive:l,dataKey:e,type:s,color:Ne(n,a),value:Jt(r,e),payload:t}]},Ba=g.memo(t=>{var{dataKey:e,data:r,stroke:n,strokeWidth:a,fill:s,name:l,hide:o,unit:d,tooltipType:u,id:c}=t,f={dataDefinedOnItem:r,getPosition:On,settings:{stroke:n,strokeWidth:a,fill:s,dataKey:e,nameKey:void 0,name:Jt(l,e),hide:o,type:u,color:Ne(n,s),unit:d,graphicalItemId:c}};return g.createElement(An,{tooltipEntrySettings:f})});function Wa(t){var{clipPathId:e,points:r,props:n}=t,{needClip:a,dot:s,dataKey:l}=n,o=ve(n);return g.createElement(Kn,{points:r,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:o,needClip:a,clipPathId:e})}function Ga(t){var{showLabels:e,children:r,points:n}=t,a=n.map(s=>{var l,o,d={x:(l=s.x)!==null&&l!==void 0?l:0,y:(o=s.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return me(me({},d),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return g.createElement(Wn,{value:e?a:void 0},r)}function vt(t){var{points:e,baseLine:r,needClip:n,clipPathId:a,props:s}=t,{layout:l,type:o,stroke:d,connectNulls:u,isRange:c}=s,{id:f}=s,m=hr(s,Ta),x=ve(m),p=Gn(m);return g.createElement(g.Fragment,null,e?.length>1&&g.createElement(ce,{clipPath:n?"url(#clipPath-".concat(a,")"):void 0},g.createElement(ze,se({},p,{id:f,points:e,connectNulls:u,type:o,baseLine:r,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&g.createElement(ze,se({},x,{className:"recharts-area-curve",layout:l,type:o,connectNulls:u,fill:"none",points:e})),d!=="none"&&c&&g.createElement(ze,se({},x,{className:"recharts-area-curve",layout:l,type:o,connectNulls:u,fill:"none",points:r}))),g.createElement(Wa,{points:e,props:m,clipPathId:a}))}function Ka(t){var e,r,{alpha:n,baseLine:a,points:s,strokeWidth:l}=t,o=(e=s[0])===null||e===void 0?void 0:e.y,d=(r=s[s.length-1])===null||r===void 0?void 0:r.y;if(!Pe(o)||!Pe(d))return null;var u=n*Math.abs(o-d),c=Math.max(...s.map(f=>f.x||0));return q(a)?c=Math.max(a,c):a&&Array.isArray(a)&&a.length&&(c=Math.max(...a.map(f=>f.x||0),c)),q(c)?g.createElement("rect",{x:0,y:o<d?o:o-u,width:c+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}function Ua(t){var e,r,{alpha:n,baseLine:a,points:s,strokeWidth:l}=t,o=(e=s[0])===null||e===void 0?void 0:e.x,d=(r=s[s.length-1])===null||r===void 0?void 0:r.x;if(!Pe(o)||!Pe(d))return null;var u=n*Math.abs(o-d),c=Math.max(...s.map(f=>f.y||0));return q(a)?c=Math.max(a,c):a&&Array.isArray(a)&&a.length&&(c=Math.max(...a.map(f=>f.y||0),c)),q(c)?g.createElement("rect",{x:o<d?o:o-u,y:0,width:u,height:Math.floor(c+(l?parseInt("".concat(l),10):1))}):null}function qa(t){var{alpha:e,layout:r,points:n,baseLine:a,strokeWidth:s}=t;return r==="vertical"?g.createElement(Ka,{alpha:e,points:n,baseLine:a,strokeWidth:s}):g.createElement(Ua,{alpha:e,points:n,baseLine:a,strokeWidth:s})}function Ya(t){var{needClip:e,clipPathId:r,props:n,previousPointsRef:a,previousBaselineRef:s}=t,{points:l,baseLine:o,isAnimationActive:d,animationBegin:u,animationDuration:c,animationEasing:f,onAnimationStart:m,onAnimationEnd:x}=n,p=g.useMemo(()=>({points:l,baseLine:o}),[l,o]),v=$n(p,"recharts-area-"),b=Je(),[w,P]=g.useState(!1),S=!w,j=g.useCallback(()=>{typeof x=="function"&&x(),P(!1)},[x]),h=g.useCallback(()=>{typeof m=="function"&&m(),P(!0)},[m]);if(b==null)return null;var y=a.current,k=s.current;return g.createElement(Ga,{showLabels:S,points:l},n.children,g.createElement(Mn,{animationId:v,begin:u,duration:c,isActive:d,easing:f,onAnimationEnd:j,onAnimationStart:h,key:v},N=>{if(y){var C=y.length/l.length,A=N===1?l:l.map((_,E)=>{var T=Math.floor(E*C);if(y[T]){var L=y[T];return me(me({},_),{},{x:ue(L.x,_.x,N),y:ue(L.y,_.y,N)})}return _}),O;return q(o)?O=ue(k,o,N):Fn(o)||Rn(o)?O=ue(k,0,N):O=o.map((_,E)=>{var T=Math.floor(E*C);if(Array.isArray(k)&&k[T]){var L=k[T];return me(me({},_),{},{x:ue(L.x,_.x,N),y:ue(L.y,_.y,N)})}return _}),N>0&&(a.current=A,s.current=O),g.createElement(vt,{points:A,baseLine:O,needClip:e,clipPathId:r,props:n})}return N>0&&(a.current=l,s.current=o),g.createElement(ce,null,d&&g.createElement("defs",null,g.createElement("clipPath",{id:"animationClipPath-".concat(r)},g.createElement(qa,{alpha:N,points:l,baseLine:o,layout:b,strokeWidth:n.strokeWidth}))),g.createElement(ce,{clipPath:"url(#animationClipPath-".concat(r,")")},g.createElement(vt,{points:l,baseLine:o,needClip:e,clipPathId:r,props:n})))}),g.createElement(Bn,{label:n.label}))}function Ha(t){var{needClip:e,clipPathId:r,props:n}=t,a=g.useRef(null),s=g.useRef();return g.createElement(Ya,{needClip:e,clipPathId:r,props:n,previousPointsRef:a,previousBaselineRef:s})}class Va extends g.PureComponent{render(){var{hide:e,dot:r,points:n,className:a,top:s,left:l,needClip:o,xAxisId:d,yAxisId:u,width:c,height:f,id:m,baseLine:x,zIndex:p}=this.props;if(e)return null;var v=te("recharts-area",a),b=m,{r:w,strokeWidth:P}=Tn(r),S=zn(r),j=w*2+P,h=o?"url(#clipPath-".concat(S?"":"dots-").concat(b,")"):void 0;return g.createElement(Ee,{zIndex:p},g.createElement(ce,{className:v},o&&g.createElement("defs",null,g.createElement(Ln,{clipPathId:b,xAxisId:d,yAxisId:u}),!S&&g.createElement("clipPath",{id:"clipPath-dots-".concat(b)},g.createElement("rect",{x:l-j/2,y:s-j/2,width:c+j,height:f+j}))),g.createElement(Ha,{needClip:o,clipPathId:b,props:this.props})),g.createElement(lt,{points:n,mainColor:Ne(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:h}),this.props.isRange&&Array.isArray(x)&&g.createElement(lt,{points:x,mainColor:Ne(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:h}))}}var pr={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:_e.area};function Xa(t){var e,r=ge(t,pr),{activeDot:n,animationBegin:a,animationDuration:s,animationEasing:l,connectNulls:o,dot:d,fill:u,fillOpacity:c,hide:f,isAnimationActive:m,legendType:x,stroke:p,xAxisId:v,yAxisId:b}=r,w=hr(r,za),P=_n(),S=En(),{needClip:j}=In(v,b),h=ke(),{points:y,isRange:k,baseLine:N}=(e=Y(T=>Da(T,t.id,h)))!==null&&e!==void 0?e:{},C=Dn();if(P!=="horizontal"&&P!=="vertical"||C==null||S!=="AreaChart"&&S!=="ComposedChart")return null;var{height:A,width:O,x:_,y:E}=C;return!y||!y.length?null:g.createElement(Va,se({},w,{activeDot:n,animationBegin:a,animationDuration:s,animationEasing:l,baseLine:N,connectNulls:o,dot:d,fill:u,fillOpacity:c,height:A,hide:f,layout:P,isAnimationActive:m==="auto"?!Kt.isSsr:m,isRange:k,legendType:x,needClip:j,points:y,stroke:p,width:O,left:_,top:E,xAxisId:v,yAxisId:b}))}var Qa=(t,e,r,n,a)=>{var s=r??e;if(q(s))return s;var l=t==="horizontal"?a:n,o=l.scale.domain();if(l.type==="number"){var d=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return s==="dataMin"?u:s==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return s==="dataMin"?o[0]:s==="dataMax"?o[1]:o[0]};function Ja(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:n},stackedData:a,layout:s,chartBaseValue:l,xAxis:o,yAxis:d,displayedData:u,dataStartIndex:c,xAxisTicks:f,yAxisTicks:m,bandSize:x}=t,p=a&&a.length,v=Qa(s,l,r,o,d),b=s==="horizontal",w=!1,P=u.map((j,h)=>{var y,k,N,C;if(p)C=a[c+h];else{var A=ot(j,n);Array.isArray(A)?(C=A,w=!0):C=[v,A]}var O=(y=(k=C)===null||k===void 0?void 0:k[1])!==null&&y!==void 0?y:null,_=O==null||p&&!e&&ot(j,n)==null;if(b){var E;return{x:ct({axis:o,ticks:f,bandSize:x,entry:j,index:h}),y:_?null:(E=d.scale.map(O))!==null&&E!==void 0?E:null,value:C,payload:j}}return{x:_?null:(N=o.scale.map(O))!==null&&N!==void 0?N:null,y:ct({axis:d,ticks:m,bandSize:x,entry:j,index:h}),value:C,payload:j}}),S;return p||w?S=P.map(j=>{var h,y=Array.isArray(j.value)?j.value[0]:null;if(b){var k;return{x:j.x,y:y!=null&&j.y!=null&&(k=d.scale.map(y))!==null&&k!==void 0?k:null,payload:j.payload}}return{x:y!=null&&(h=o.scale.map(y))!==null&&h!==void 0?h:null,y:j.y,payload:j.payload}}):S=b?d.scale.map(v):o.scale.map(v),{points:P,baseLine:S??0,isRange:w}}function Za(t){var e=ge(t,pr),r=ke();return g.createElement(Pn,{id:e.id,type:"area"},n=>g.createElement(g.Fragment,null,g.createElement(Sn,{legendPayload:Ra(e)}),g.createElement(Ba,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:n}),g.createElement(Nn,{type:"area",id:n,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:Cn(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),g.createElement(Xa,se({},e,{id:n}))))}var xr=g.memo(Za,Qt);xr.displayName="Area";var es=["domain","range"],ts=["domain","range"];function yt(t,e){if(t==null)return{};var r,n,a=rs(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function rs(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function bt(t,e){return t===e?!0:Array.isArray(t)&&t.length===2&&Array.isArray(e)&&e.length===2?t[0]===e[0]&&t[1]===e[1]:!1}function gr(t,e){if(t===e)return!0;var{domain:r,range:n}=t,a=yt(t,es),{domain:s,range:l}=e,o=yt(e,ts);return!bt(r,s)||!bt(n,l)?!1:Qt(a,o)}var ns=["type"],is=["dangerouslySetInnerHTML","ticks","scale"],as=["id","scale"];function Be(){return Be=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Be.apply(null,arguments)}function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function kt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(n){ss(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ss(t,e,r){return(e=ls(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ls(t){var e=os(t,"string");return typeof e=="symbol"?e:e+""}function os(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function We(t,e){if(t==null)return{};var r,n,a=cs(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function cs(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function ds(t){var e=Ze(),r=g.useRef(null),n=Je(),{type:a}=t,s=We(t,ns),l=tr(n,"xAxis",a),o=g.useMemo(()=>{if(l!=null)return kt(kt({},s),{},{type:l})},[s,l]);return g.useLayoutEffect(()=>{o!=null&&(r.current===null?e(Un(o)):r.current!==o&&e(qn({prev:r.current,next:o})),r.current=o)},[o,e]),g.useLayoutEffect(()=>()=>{r.current&&(e(Yn(r.current)),r.current=null)},[e]),null}var us=t=>{var{xAxisId:e,className:r}=t,n=Y(Zt),a=ke(),s="xAxis",l=Y(w=>er(w,s,e,a)),o=Y(w=>Hn(w,e)),d=Y(w=>Vn(w,e)),u=Y(w=>Xn(w,e));if(o==null||d==null||u==null)return null;var{dangerouslySetInnerHTML:c,ticks:f,scale:m}=t,x=We(t,is),{id:p,scale:v}=u,b=We(u,as);return g.createElement(rt,Be({},x,b,{x:d.x,y:d.y,width:o.width,height:o.height,className:te("recharts-".concat(s," ").concat(s),r),viewBox:n,ticks:l,axisType:s}))},ms={allowDataOverflow:W.allowDataOverflow,allowDecimals:W.allowDecimals,allowDuplicatedCategory:W.allowDuplicatedCategory,angle:W.angle,axisLine:Q.axisLine,height:W.height,hide:!1,includeHidden:W.includeHidden,interval:W.interval,label:!1,minTickGap:W.minTickGap,mirror:W.mirror,orientation:W.orientation,padding:W.padding,reversed:W.reversed,scale:W.scale,tick:W.tick,tickCount:W.tickCount,tickLine:Q.tickLine,tickSize:Q.tickSize,type:W.type,xAxisId:0},fs=t=>{var e=ge(t,ms);return g.createElement(g.Fragment,null,g.createElement(ds,{allowDataOverflow:e.allowDataOverflow,allowDecimals:e.allowDecimals,allowDuplicatedCategory:e.allowDuplicatedCategory,angle:e.angle,dataKey:e.dataKey,domain:e.domain,height:e.height,hide:e.hide,id:e.xAxisId,includeHidden:e.includeHidden,interval:e.interval,minTickGap:e.minTickGap,mirror:e.mirror,name:e.name,orientation:e.orientation,padding:e.padding,reversed:e.reversed,scale:e.scale,tick:e.tick,tickCount:e.tickCount,tickFormatter:e.tickFormatter,ticks:e.ticks,type:e.type,unit:e.unit}),g.createElement(us,e))},vr=g.memo(fs,gr);vr.displayName="XAxis";var hs=["type"],ps=["dangerouslySetInnerHTML","ticks","scale"],xs=["id","scale"];function Ge(){return Ge=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ge.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Pt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(n){gs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gs(t,e,r){return(e=vs(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vs(t){var e=ys(t,"string");return typeof e=="symbol"?e:e+""}function ys(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ke(t,e){if(t==null)return{};var r,n,a=bs(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function bs(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function js(t){var e=Ze(),r=g.useRef(null),n=Je(),{type:a}=t,s=Ke(t,hs),l=tr(n,"yAxis",a),o=g.useMemo(()=>{if(l!=null)return Pt(Pt({},s),{},{type:l})},[l,s]);return g.useLayoutEffect(()=>{o!=null&&(r.current===null?e(Qn(o)):r.current!==o&&e(Jn({prev:r.current,next:o})),r.current=o)},[o,e]),g.useLayoutEffect(()=>()=>{r.current&&(e(Zn(r.current)),r.current=null)},[e]),null}function ks(t){var{yAxisId:e,className:r,width:n,label:a}=t,s=g.useRef(null),l=g.useRef(null),o=Y(Zt),d=ke(),u=Ze(),c="yAxis",f=Y(y=>ei(y,e)),m=Y(y=>ti(y,e)),x=Y(y=>er(y,c,e,d)),p=Y(y=>ri(y,e));if(g.useLayoutEffect(()=>{if(!(n!=="auto"||!f||ni(a)||g.isValidElement(a)||p==null)){var y=s.current;if(y){var k=y.getCalculatedWidth();Math.round(f.width)!==Math.round(k)&&u(ii({id:e,width:k}))}}},[x,f,u,a,e,n,p]),f==null||m==null||p==null)return null;var{dangerouslySetInnerHTML:v,ticks:b,scale:w}=t,P=Ke(t,ps),{id:S,scale:j}=p,h=Ke(p,xs);return g.createElement(rt,Ge({},P,h,{ref:s,labelRef:l,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:te("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c}))}var ws={allowDataOverflow:G.allowDataOverflow,allowDecimals:G.allowDecimals,allowDuplicatedCategory:G.allowDuplicatedCategory,angle:G.angle,axisLine:Q.axisLine,hide:!1,includeHidden:G.includeHidden,interval:G.interval,label:!1,minTickGap:G.minTickGap,mirror:G.mirror,orientation:G.orientation,padding:G.padding,reversed:G.reversed,scale:G.scale,tick:G.tick,tickCount:G.tickCount,tickLine:Q.tickLine,tickSize:Q.tickSize,type:G.type,width:G.width,yAxisId:0},Ps=t=>{var e=ge(t,ws);return g.createElement(g.Fragment,null,g.createElement(js,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter}),g.createElement(ks,e))},yr=g.memo(Ps,gr);yr.displayName="YAxis";var Ss=["axis"],Ns=g.forwardRef((t,e)=>g.createElement(ai,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ss,tooltipPayloadSearcher:si,categoricalChartProps:t,ref:e}));const Cs=["sites-deco-ai-gateway.decocache.com"];function le(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function As(t,e){const r=new Date,n=[];if(t==="day"){for(let a=29;a>=0;a--){const s=new Date(r);s.setDate(s.getDate()-a),n.push({date:s.toLocaleDateString("en-US",{month:"short",day:"numeric"}),amount:a===0?e.daily:0})}n[n.length-1]={date:n[n.length-1]?.date??"Today",amount:e.daily}}else if(t==="week"){for(let a=11;a>=0;a--){const s=new Date(r);s.setDate(s.getDate()-a*7),n.push({date:`W${String(52-a)}`,amount:a===0?e.weekly:0})}n[n.length-1]={date:n[n.length-1]?.date??"This week",amount:e.weekly}}else{for(let a=11;a>=0;a--){const s=new Date(r);s.setMonth(s.getMonth()-a),n.push({date:s.toLocaleDateString("en-US",{month:"short",year:"2-digit"}),amount:a===0?e.monthly:0})}n[n.length-1]={date:n[n.length-1]?.date??"This month",amount:e.monthly}}return n}const Os=[5,10,25,50,100];function _s(t){const e=z.c(25),{open:r,onOpenChange:n,connectionId:a,currentLimitUsd:s}=t,{org:l}=Z(),[o,d]=g.useState(null),[u,c]=g.useState(""),[f,m]=g.useState(null),[x,p]=g.useState(null);let v;e[0]!==a||e[1]!==l.id?(v={connectionId:a,orgId:l.id},e[0]=a,e[1]=l.id,e[2]=v):v=e[2];const b=je(v);let w;e[3]!==b?(w={client:b},e[3]=b,e[4]=w):w=e[4];const{mutate:P,isPending:S}=ui(w),j=o??(u?parseFloat(u):null);let h,y;e[5]!==s||e[6]!==j||e[7]!==P||e[8]!==n?(y=()=>{if(!j||j<=0)return;const A=s+j;p(null),P({name:"GATEWAY_SET_LIMIT",arguments:{limit_usd:A,return_url:window.location.href}},{onSuccess:O=>{const _=O.structuredContent;_?.checkout_url?m(_.checkout_url):_?.billing_mode==="postpaid"&&h()},onError:O=>{p(O.message??"Failed to create payment link.")}})},h=()=>{d(null),c(""),m(null),p(null),n(!1)},e[5]=s,e[6]=j,e[7]=P,e[8]=n,e[9]=h,e[10]=y):(h=e[9],y=e[10]);let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=i.jsxs(Er,{children:[i.jsx(Ir,{children:"Add Credit"}),i.jsx(Dr,{children:"Choose how much credit to add to your AI Gateway."})]}),e[11]=k):k=e[11];let N;e[12]!==f||e[13]!==s||e[14]!==u||e[15]!==j||e[16]!==x||e[17]!==y||e[18]!==S||e[19]!==o?(N=i.jsxs(It,{className:"sm:max-w-md",children:[k,f?i.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),i.jsx(H,{asChild:!0,className:"gap-2",children:i.jsxs("a",{href:f,children:[i.jsx(Ye,{size:15}),"Complete Payment"]})})]}):i.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(Fe,{className:"text-xs text-muted-foreground",children:"Select amount"}),i.jsx("div",{className:"grid grid-cols-5 gap-2",children:Os.map(A=>i.jsxs("button",{type:"button",onClick:()=>{d(A),c("")},className:oe("rounded-md border px-3 py-2 text-sm font-medium transition-colors",o===A?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",A]},A))})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(Fe,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:"Or enter a custom amount"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),i.jsx(xe,{id:"custom-amount",type:"number",min:"1",step:"1",placeholder:"0.00",className:"pl-7",value:u,onChange:A=>{c(A.target.value),d(null)}})]})]}),x&&i.jsx("p",{className:"text-xs text-destructive",children:x}),i.jsxs("div",{className:"flex items-center justify-between pt-1",children:[i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Current limit:"," ",i.jsx("span",{className:"font-medium text-foreground",children:le(s)})]}),i.jsx(H,{onClick:y,disabled:S||!j||j<=0,className:"gap-2",children:S?"Generating...":"Continue"})]})]})]}),e[12]=f,e[13]=s,e[14]=u,e[15]=j,e[16]=x,e[17]=y,e[18]=S,e[19]=o,e[20]=N):N=e[20];let C;return e[21]!==h||e[22]!==r||e[23]!==N?(C=i.jsx(Dt,{open:r,onOpenChange:h,children:N}),e[21]=h,e[22]=r,e[23]=N,e[24]=C):C=e[24],C}function Es(t){const e=z.c(23),{available:r,total:n,onAddCredit:a}=t,s=n>0?Math.max(0,Math.min(100,(n-r)/n*100)):0;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),e[0]=l):l=e[0];let o;e[1]!==r?(o=le(r),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==o?(d=i.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:o}),e[3]=o,e[4]=d):d=e[4];let u;e[5]!==n?(u=n>0&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",le(n)," total"]}),e[5]=n,e[6]=u):u=e[6];let c;e[7]!==d||e[8]!==u?(c=i.jsxs("div",{className:"flex flex-col gap-1",children:[l,d,u]}),e[7]=d,e[8]=u,e[9]=c):c=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Gt,{size:16}),e[10]=f):f=e[10];let m;e[11]!==a?(m=i.jsxs(H,{onClick:a,className:"gap-2 px-5",children:[f,"Add Credit"]}),e[11]=a,e[12]=m):m=e[12];let x;e[13]!==c||e[14]!==m?(x=i.jsxs("div",{className:"flex items-center justify-between",children:[c,m]}),e[13]=c,e[14]=m,e[15]=x):x=e[15];let p;e[16]!==r||e[17]!==n||e[18]!==s?(p=n>0&&i.jsxs("div",{className:"mt-4",children:[i.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:i.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${s}%`}})}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[le(n-r)," used"]})]}),e[16]=r,e[17]=n,e[18]=s,e[19]=p):p=e[19];let v;return e[20]!==x||e[21]!==p?(v=i.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[x,p]}),e[20]=x,e[21]=p,e[22]=v):v=e[22],v}const St={day:"Daily",week:"Weekly",month:"Monthly"},Is={day:"daily",week:"weekly",month:"monthly"},Ds={amount:{label:"Spend",color:"var(--chart-1)"}};function Ts(t){const e=z.c(38),{usage:r}=t,[n,a]=g.useState("day");let s;e[0]!==n||e[1]!==r?(s=As(n,r),e[0]=n,e[1]=r,e[2]=s):s=e[2];const l=s,o=r[Is[n]];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),e[3]=d):d=e[3];let u;e[4]!==o?(u=le(o),e[4]=o,e[5]=u):u=e[5];let c;e[6]!==u?(c=i.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:u}),e[6]=u,e[7]=c):c=e[7];const f=n==="day"?"today":n==="week"?"this week":"this month";let m;e[8]!==f?(m=i.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==c||e[11]!==m?(x=i.jsxs("div",{className:"flex items-baseline gap-2",children:[c,m]}),e[10]=c,e[11]=m,e[12]=x):x=e[12];let p;e[13]!==r.total?(p=le(r.total),e[13]=r.total,e[14]=p):p=e[14];let v;e[15]!==p?(v=i.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[p," all-time"]}),e[15]=p,e[16]=v):v=e[16];let b;e[17]!==x||e[18]!==v?(b=i.jsxs("div",{className:"flex flex-col gap-0.5",children:[d,x,v]}),e[17]=x,e[18]=v,e[19]=b):b=e[19];let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w=Object.keys(St),e[20]=w):w=e[20];let P;e[21]!==n?(P=i.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:w.map(E=>i.jsx("button",{type:"button",onClick:()=>a(E),className:oe("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",n===E?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:St[E]},E))}),e[21]=n,e[22]=P):P=e[22];let S;e[23]!==b||e[24]!==P?(S=i.jsxs("div",{className:"flex items-center justify-between",children:[b,P]}),e[23]=b,e[24]=P,e[25]=S):S=e[25];let j;e[26]===Symbol.for("react.memo_cache_sentinel")?(j={top:4,right:4,bottom:0,left:0},e[26]=j):j=e[26];let h,y,k,N;e[27]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx("defs",{children:i.jsxs("linearGradient",{id:"fillAmount",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"5%",stopColor:"var(--color-amount)",stopOpacity:.3}),i.jsx("stop",{offset:"95%",stopColor:"var(--color-amount)",stopOpacity:0})]})}),y=i.jsx(lr,{vertical:!1,strokeDasharray:"3 3"}),k=i.jsx(vr,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11}),N=i.jsx(yr,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:Ls}),e[27]=h,e[28]=y,e[29]=k,e[30]=N):(h=e[27],y=e[28],k=e[29],N=e[30]);let C,A;e[31]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(li,{content:i.jsx(oi,{formatter:zs})}),A=i.jsx(xr,{type:"monotone",dataKey:"amount",stroke:"var(--color-amount)",fill:"url(#fillAmount)",strokeWidth:2}),e[31]=C,e[32]=A):(C=e[31],A=e[32]);let O;e[33]!==l?(O=i.jsx(ci,{config:Ds,className:"h-[280px] w-full",children:i.jsxs(Ns,{data:l,margin:j,children:[h,y,k,N,C,A]})}),e[33]=l,e[34]=O):O=e[34];let _;return e[35]!==S||e[36]!==O?(_=i.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[S,O]}),e[35]=S,e[36]=O,e[37]=_):_=e[37],_}function zs(t){return le(t)}function Ls(t){return`$${t}`}function $s(t){const e=z.c(23),{connectionId:r}=t,{org:n}=Z(),[a,s]=g.useState(!1);let l;e[0]!==r||e[1]!==n.id?(l={connectionId:r,orgId:n.id},e[0]=r,e[1]=n.id,e[2]=l):l=e[2];const o=je(l);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let u;e[4]!==o?(u={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Ms},e[4]=o,e[5]=u):u=e[5];const{data:c,isLoading:f}=di(u);if(f){let y;return e[6]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx(br,{}),e[6]=y):y=e[6],y}const m=c?.limit.remaining??0,x=c?.limit.total??0;let p;e[7]!==c?.usage?(p=c?.usage??{total:0,daily:0,weekly:0,monthly:0},e[7]=c?.usage,e[8]=p):p=e[8];const v=p,b=x;let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=()=>s(!0),e[9]=w):w=e[9];let P;e[10]!==m||e[11]!==x?(P=i.jsx(Es,{available:m,total:x,onAddCredit:w}),e[10]=m,e[11]=x,e[12]=P):P=e[12];let S;e[13]!==v?(S=i.jsx(Ts,{usage:v}),e[13]=v,e[14]=S):S=e[14];let j;e[15]!==a||e[16]!==r||e[17]!==b?(j=i.jsx(_s,{open:a,onOpenChange:s,connectionId:r,currentLimitUsd:b}),e[15]=a,e[16]=r,e[17]=b,e[18]=j):j=e[18];let h;return e[19]!==P||e[20]!==S||e[21]!==j?(h=i.jsxs(i.Fragment,{children:[P,S,j]}),e[19]=P,e[20]=S,e[21]=j,e[22]=h):h=e[22],h}function Ms(t){return t.structuredContent}function br(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{children:[i.jsx(ee,{className:"h-5 w-32"}),i.jsx(ee,{className:"h-4 w-64 mt-1.5"})]}),i.jsx(ee,{className:"h-28 rounded-xl"}),i.jsx(ee,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function jr(){const t=z.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Monitor usage and manage credits for your organization."})]}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:i.jsx(Ye,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"flex flex-col gap-6",children:[e,i.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-sm font-medium text-foreground",children:"No AI Gateway configured"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Install the Deco AI Gateway MCP to start tracking usage and managing credits."})]})]})]}),t[2]=n):n=t[2],n}class Fs extends g.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?i.jsx(jr,{}):this.props.children}}function Rs(){const e=Wt().find(r=>{try{return!!r.connection_url&&Cs.includes(new URL(r.connection_url).host)}catch{return!1}});return e?.id?i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Monitor usage and manage credits for your organization."})]}),i.jsx($s,{connectionId:e.id})]}):i.jsx(jr,{})}function Bs(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-6",children:i.jsx(Fs,{children:i.jsx(g.Suspense,{fallback:i.jsx(br,{}),children:i.jsx(Rs,{})})})}),t[0]=e):e=t[0],e}function kr(){const t=z.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(ee,{className:"h-6 w-48"}),r=i.jsx(ee,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let n;return t[2]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,i.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[i.jsx(ee,{className:"h-12 w-full"}),i.jsx(ee,{className:"h-12 w-full"})]})]}),t[2]=n):n=t[2],n}function Nt(t){const e=z.c(14),{projectSlug:r,children:n}=t,{org:a}=Z(),{data:s,isLoading:l}=Et(a.id,r);if(l||!s){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(kr,{}),e[0]=f):f=e[0],f}const o=r===J;let d;e[1]!==s.description||e[2]!==s.enabledPlugins||e[3]!==s.id||e[4]!==s.name||e[5]!==s.organizationId||e[6]!==s.slug||e[7]!==s.ui||e[8]!==o?(d={id:s.id,organizationId:s.organizationId,slug:s.slug,name:s.name,description:s.description,enabledPlugins:s.enabledPlugins,ui:s.ui,isOrgAdmin:o},e[1]=s.description,e[2]=s.enabledPlugins,e[3]=s.id,e[4]=s.name,e[5]=s.organizationId,e[6]=s.slug,e[7]=s.ui,e[8]=o,e[9]=d):d=e[9];const u=d;let c;return e[10]!==n||e[11]!==u||e[12]!==a?(c=i.jsx(_t,{org:a,project:u,children:n}),e[10]=n,e[11]=u,e[12]=a,e[13]=c):c=e[13],c}function Ws(t){const e=z.c(20),{section:r}=t;let n;e[0]!==r?(n=zt(r),e[0]=r,e[1]=n):n=e[1];const a=n;if(a){let s;e[2]!==a.sub?(s=a.sub==="general"&&i.jsx(_i,{}),e[2]=a.sub,e[3]=s):s=e[3];let l;e[4]!==a.sub?(l=a.sub==="plugins"&&i.jsx(mt,{}),e[4]=a.sub,e[5]=l):l=e[5];let o;e[6]!==a.sub?(o=a.sub==="danger"&&i.jsx(Mi,{}),e[6]=a.sub,e[7]=o):o=e[7];let d;return e[8]!==a.slug||e[9]!==s||e[10]!==l||e[11]!==o?(d=i.jsxs(Nt,{projectSlug:a.slug,children:[s,l,o]}),e[8]=a.slug,e[9]=s,e[10]=l,e[11]=o,e[12]=d):d=e[12],d}switch(r){case"account.profile":{let s;return e[13]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(xi,{}),e[13]=s):s=e[13],s}case"account.preferences":{let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(dt,{}),e[14]=s):s=e[14],s}case"account.experimental":{let s;return e[15]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(ji,{}),e[15]=s):s=e[15],s}case"org.general":{let s;return e[16]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Si,{}),e[16]=s):s=e[16],s}case"org.plugins":{let s;return e[17]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Nt,{projectSlug:J,children:i.jsx(mt,{})}),e[17]=s):s=e[17],s}case"org.billing":{let s;return e[18]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(Bs,{}),e[18]=s):s=e[18],s}default:{let s;return e[19]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx(dt,{}),e[19]=s):s=e[19],s}}}function Gs(){const t=z.c(23),{isOpen:e,activeSection:r,open:n,close:a}=Fr();let s;t[0]!==a?(s=b=>!b&&a(),t[0]=a,t[1]=s):s=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=l):l=t[2];let o;t[3]!==r||t[4]!==n?(o=i.jsx(g.Suspense,{fallback:l,children:i.jsx(pi,{activeSection:r,onNavigate:n})}),t[3]=r,t[4]=n,t[5]=o):o=t[5];let d,u;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(Tt,{size:16}),u=i.jsx("span",{className:"sr-only",children:"Close"}),t[6]=d,t[7]=u):(d=t[6],u=t[7]);let c;t[8]!==a?(c=i.jsxs("button",{type:"button",onClick:a,className:"absolute top-4 right-4 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[d,u]}),t[8]=a,t[9]=c):c=t[9];let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(kr,{}),t[10]=f):f=t[10];let m;t[11]!==r?(m=i.jsx(g.Suspense,{fallback:f,children:i.jsx(Ws,{section:r})}),t[11]=r,t[12]=m):m=t[12];let x;t[13]!==c||t[14]!==m?(x=i.jsxs("div",{className:"flex-1 overflow-y-auto p-8 min-w-0 relative",children:[c,m]}),t[13]=c,t[14]=m,t[15]=x):x=t[15];let p;t[16]!==o||t[17]!==x?(p=i.jsx(It,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:i.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=p):p=t[18];let v;return t[19]!==e||t[20]!==s||t[21]!==p?(v=i.jsx(Dt,{open:e,onOpenChange:s,children:p}),t[19]=e,t[20]=s,t[21]=p,t[22]=v):v=t[22],v}function Ks(t){const e=z.c(12),{projectSlug:r,orgSlug:n,error:a}=t,s=Ce();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=l):l=e[0];let o;e[1]!==r?(o=i.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==a.message?(d=i.jsx("p",{className:"text-sm text-muted-foreground",children:a.message}),e[3]=a.message,e[4]=d):d=e[4];let u;e[5]!==s||e[6]!==n?(u=i.jsx(H,{variant:"link",onClick:()=>s({to:"/$org/$project",params:{org:n,project:J}}),children:"Go to organization home"}),e[5]=s,e[6]=n,e[7]=u):u=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==u?(c=i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,o,d,u]}),e[8]=o,e[9]=d,e[10]=u,e[11]=c):c=e[11],c}function Us(t){const e=z.c(9),{projectSlug:r,orgSlug:n}=t,a=Ce();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=s):s=e[0];let l;e[1]!==r?(l=i.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=l):l=e[2];let o;e[3]!==a||e[4]!==n?(o=i.jsx(H,{variant:"link",onClick:()=>a({to:"/$org/$project",params:{org:n,project:J}}),children:"Go to organization home"}),e[3]=a,e[4]=n,e[5]=o):o=e[5];let d;return e[6]!==l||e[7]!==o?(d=i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[s,l,o]}),e[6]=l,e[7]=o,e[8]=d):d=e[8],d}function qs(){const t=z.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=Ar(e),{org:n}=Z(),a=r.org,s=r.project,{data:l,isLoading:o,error:d}=Et(n.id,s);if(o){let v;return t[1]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx($e,{}),t[1]=v):v=t[1],v}if(d){let v;return t[2]!==d||t[3]!==a||t[4]!==s?(v=i.jsx(Ks,{projectSlug:s,orgSlug:a,error:d}),t[2]=d,t[3]=a,t[4]=s,t[5]=v):v=t[5],v}if(!l){let v;return t[6]!==a||t[7]!==s?(v=i.jsx(Us,{projectSlug:s,orgSlug:a}),t[6]=a,t[7]=s,t[8]=v):v=t[8],v}const u=l.slug===J;let c;t[9]!==l.description||t[10]!==l.enabledPlugins||t[11]!==l.id||t[12]!==l.name||t[13]!==l.organizationId||t[14]!==l.slug||t[15]!==l.ui||t[16]!==u?(c={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:u},t[9]=l.description,t[10]=l.enabledPlugins,t[11]=l.id,t[12]=l.name,t[13]=l.organizationId,t[14]=l.slug,t[15]=l.ui,t[16]=u,t[17]=c):c=t[17];const f=c;let m,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(g.Suspense,{fallback:i.jsx($e,{}),children:i.jsx(Or,{})}),x=i.jsx(Gs,{}),t[18]=m,t[19]=x):(m=t[18],x=t[19]);let p;return t[20]!==f||t[21]!==n?(p=i.jsxs(_t,{org:n,project:f,children:[m,x]}),t[20]=f,t[21]=n,t[22]=p):p=t[22],p}function Ll(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(g.Suspense,{fallback:i.jsx($e,{}),children:i.jsx(qs,{})}),t[0]=e):e=t[0],e}export{Ll as default};