@decocms/mesh 2.121.0 → 2.122.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 (187) hide show
  1. package/dist/client/assets/{AlertCircle-BvhzS1YT.js → AlertCircle-xlmc_ewP.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-BUf3xaDz.js → AlertOctagon-D421ZtkR.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-BUE7sdod.js → AlertTriangle-Ddzav--o.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BU2sm27g.js → ArrowLeft-Cm3_NyIq.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CkjIXBAe.js → ArrowUp-D7gFQV8U.js} +1 -1
  6. package/dist/client/assets/{Check-DYZ8kvzv.js → Check-CwhCIsIx.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DTVGXl8H.js → CheckCircle-gVXszZ9H.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-CWio5h0R.js → CheckDone01-CZrV6JdL.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-lDwU0JKj.js → CheckVerified02-BG2LRHT3.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-DugvEHIv.js → ChevronDown-DHYql12c.js} +1 -1
  11. package/dist/client/assets/{ChevronRight-B5elpXGa.js → ChevronRight-qRilEtY5.js} +1 -1
  12. package/dist/client/assets/{Clock-BWKgsoiG.js → Clock-Ck0JfdvV.js} +1 -1
  13. package/dist/client/assets/{Code01-Dv0mdRP8.js → Code01-CJtE_l6W.js} +1 -1
  14. package/dist/client/assets/Coins01-BilMBcS0.js +1 -0
  15. package/dist/client/assets/{Container-83NFZamb.js → Container-DmRzes59.js} +1 -1
  16. package/dist/client/assets/{Copy01-CqukwIfv.js → Copy01-_H9GhcIe.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-C__zTPE5.js → Dataflow03-DVn12h_U.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-Bh5e-6rc.js → DotsHorizontal-wYWp0xyO.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-jfuFTzKE.js → DotsVertical-DXaOiE8_.js} +1 -1
  20. package/dist/client/assets/{Download01-DFCfNrum.js → Download01-CYVDY-WP.js} +1 -1
  21. package/dist/client/assets/{Edit01-CO8VRSTn.js → Edit01-BNuFD-E4.js} +1 -1
  22. package/dist/client/assets/{Eye-B5D7LmIz.js → Eye-DRUYj907.js} +1 -1
  23. package/dist/client/assets/{File02-DbRoaSSj.js → File02-BTJzpWWh.js} +1 -1
  24. package/dist/client/assets/{File06-BCPbJ79i.js → File06-D7PEf5a6.js} +1 -1
  25. package/dist/client/assets/{FilterLines-C7xWgmCm.js → FilterLines-DEUbdgpO.js} +1 -1
  26. package/dist/client/assets/{Globe01-C--nEoR6.js → Globe01-D38ZY7LP.js} +1 -1
  27. package/dist/client/assets/{Globe02-CaREPjt_.js → Globe02-C1VZ1Sth.js} +1 -1
  28. package/dist/client/assets/{Grid01-BWlobPSC.js → Grid01-CSoBYZVu.js} +1 -1
  29. package/dist/client/assets/{Hash02-C8PvyKUH.js → Hash02-70NdGfYY.js} +1 -1
  30. package/dist/client/assets/{Home02-DUurisPV.js → Home02-TEl7q7Ca.js} +1 -1
  31. package/dist/client/assets/{Image01-CiXOk6aA.js → Image01-B7uGBtXf.js} +1 -1
  32. package/dist/client/assets/{Inbox01-BjRCuorQ.js → Inbox01-D4AhYFiy.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-DXIZ30Xe.js → InfoCircle-1K9NYGAl.js} +1 -1
  34. package/dist/client/assets/{Key01-DGayuWvT.js → Key01-BabDlHce.js} +1 -1
  35. package/dist/client/assets/{LinkExternal01-B0wN3aw-.js → LinkExternal01-CpfoXnvY.js} +1 -1
  36. package/dist/client/assets/{List-Bm2F0wOt.js → List-FibtrqYM.js} +1 -1
  37. package/dist/client/assets/{Loading01-DVlzuDXC.js → Loading01-Bl1Pk_oo.js} +1 -1
  38. package/dist/client/assets/{Lock01-Dlsr6mr6.js → Lock01-BltwB-9b.js} +1 -1
  39. package/dist/client/assets/{Pin01-CTbGsypg.js → Pin01-BmPA32VH.js} +1 -1
  40. package/dist/client/assets/{Play--vga6A7y.js → Play-CbvJYqM5.js} +1 -1
  41. package/dist/client/assets/{Plus-BgTScIjT.js → Plus-CPirwa1w.js} +1 -1
  42. package/dist/client/assets/{RefreshCcw01-C9q1gCtA.js → RefreshCcw01-DpTBiD-b.js} +1 -1
  43. package/dist/client/assets/{RefreshCw01-DlEvV3CS.js → RefreshCw01-B1WiG0_Y.js} +1 -1
  44. package/dist/client/assets/{Rows03-BvTFjz3x.js → Rows03-CSDgVDop.js} +1 -1
  45. package/dist/client/assets/{Save01-s6loxod6.js → Save01-LUKipDfp.js} +1 -1
  46. package/dist/client/assets/{SearchMd-qPELZ8ba.js → SearchMd-CmV0Tepn.js} +1 -1
  47. package/dist/client/assets/{Settings01-B3ha2umj.js → Settings01-C0WLxd49.js} +1 -1
  48. package/dist/client/assets/{Shield01-CmaBuhqg.js → Shield01-BbVNhLRQ.js} +1 -1
  49. package/dist/client/assets/{Terminal-CLx6qyUj.js → Terminal-BNbAKfj5.js} +1 -1
  50. package/dist/client/assets/{Tool01-BBuFYp2z.js → Tool01-XlUnVTZF.js} +1 -1
  51. package/dist/client/assets/{Trash01-BwVrCeYG.js → Trash01-CsD9CMZr.js} +1 -1
  52. package/dist/client/assets/{Upload01-O1LTk7kl.js → Upload01-Tev8kZ4-.js} +1 -1
  53. package/dist/client/assets/{Users03-mLhLYYpx.js → Users03-B5yv7ula.js} +1 -1
  54. package/dist/client/assets/{XCircle-DYabZgm3.js → XCircle-BGdKXUli.js} +1 -1
  55. package/dist/client/assets/{XClose-CUkPQHX7.js → XClose-CBFYdEvF.js} +1 -1
  56. package/dist/client/assets/{agent-connections-preview-C0ZC1Uys.js → agent-connections-preview-CDXgp0lX.js} +1 -1
  57. package/dist/client/assets/{agent-detail-PNk7yJqH.js → agent-detail-H6KClcRl.js} +1 -1
  58. package/dist/client/assets/{agents-BgVLYh1H.js → agents-DMasQsS6.js} +1 -1
  59. package/dist/client/assets/{alert-dialog-IbckaySD.js → alert-dialog-DB07UdJN.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-DnzAukzZ.js → auth-catchall-vsfBBopf.js} +1 -1
  61. package/dist/client/assets/{avatar-De3rgEZe.js → avatar-DlH0tlJW.js} +1 -1
  62. package/dist/client/assets/{badge-Dic8iag_.js → badge-DApFAaFp.js} +1 -1
  63. package/dist/client/assets/{binder-kzm2-hR4.js → binder-DA98_oix.js} +1 -1
  64. package/dist/client/assets/{breadcrumb-DA-aLp2Z.js → breadcrumb-rKBAWCrS.js} +1 -1
  65. package/dist/client/assets/{button-COjpHvkK.js → button-CZPRmDPf.js} +1 -1
  66. package/dist/client/assets/{card-BiC_BjTe.js → card-RVty8OZv.js} +1 -1
  67. package/dist/client/assets/chart-IzVtzoKL.js +15 -0
  68. package/dist/client/assets/{checkbox-pPAN-LtC.js → checkbox-BcFea8vV.js} +1 -1
  69. package/dist/client/assets/{circle-alert-D41wsw8X.js → circle-alert-D5ZoEK1D.js} +1 -1
  70. package/dist/client/assets/{collection-detail-CTsvweAq.js → collection-detail-D6YGM3Fm.js} +2 -2
  71. package/dist/client/assets/{collection-tab-C561L5WF.js → collection-tab-B5SlZhK5.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-qfYRj5nQ.js → collection-table-wrapper-Dg5F9IdT.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CZ7jNcIU.js → collection-tabs-DBVkuHlL.js} +1 -1
  74. package/dist/client/assets/{command-CpW6wMAK.js → command-BsoFq-dz.js} +1 -1
  75. package/dist/client/assets/{connect-BOSD5VhT.js → connect-Bu-5xEzi.js} +1 -1
  76. package/dist/client/assets/{connection-card-ClRCfHxD.js → connection-card-DzedQCif.js} +1 -1
  77. package/dist/client/assets/connection-detail-CbVv5VEj.js +1 -0
  78. package/dist/client/assets/{connections-BJH0-etY.js → connections-C2FCZthc.js} +1 -1
  79. package/dist/client/assets/constants-BHCPzANQ.js +1 -0
  80. package/dist/client/assets/{constants-D-wlluJ1.js → constants-C2M7RsNt.js} +1 -1
  81. package/dist/client/assets/{context-JZ9bzUIC.js → context-BgVlhaqT.js} +1 -1
  82. package/dist/client/assets/{create-organization-dialog-CtvnKlw-.js → create-organization-dialog-Cwe3EZ2W.js} +1 -1
  83. package/dist/client/assets/{create-project-dialog-pcTtT4gK.js → create-project-dialog-CICUNrHC.js} +1 -1
  84. package/dist/client/assets/{dialog-DbMPbzlh.js → dialog-DGoua-F-.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-DFSc-v7C.js → dropdown-menu-CEy971MU.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-DW7MYlbX.js → dynamic-plugin-layout-C0ICbkQo.js} +1 -1
  87. package/dist/client/assets/{empty-state-CWevsb-G.js → empty-state-C_g2tsPC.js} +1 -1
  88. package/dist/client/assets/{empty-state-DnI_qH-Y.js → empty-state-C_zMtSoY.js} +1 -1
  89. package/dist/client/assets/{env-vars-editor-BU2Y2-Ll.js → env-vars-editor-C8MNbLkk.js} +1 -1
  90. package/dist/client/assets/{error-boundary-CCf2jUlG.js → error-boundary-DqZtjxEB.js} +1 -1
  91. package/dist/client/assets/{extract-connection-data-DZvBZ10P.js → extract-connection-data-BdeTK8Ro.js} +1 -1
  92. package/dist/client/assets/{file-browser-BIlLUTHf.js → file-browser-q6rlKrnm.js} +2 -2
  93. package/dist/client/assets/{form-ek51qwAH.js → form-CFbWoYe6.js} +1 -1
  94. package/dist/client/assets/{grid-view-CENvKEY6.js → grid-view-DPEEIdxr.js} +1 -1
  95. package/dist/client/assets/{home-XXv2oXrf.js → home-CS0lvzq9.js} +1 -1
  96. package/dist/client/assets/{index-CjOTWUhd.js → index-0fcwYTfR.js} +36 -36
  97. package/dist/client/assets/{index-BbQ4Bnn7.js → index-0yaYrNTf.js} +1 -1
  98. package/dist/client/assets/index-BHAz67cr.css +1 -0
  99. package/dist/client/assets/{index-XxwFMzDI.js → index-Bl5KG9xm.js} +1 -1
  100. package/dist/client/assets/{index-Ba79Kla7.js → index-BpjZjisS.js} +1 -1
  101. package/dist/client/assets/{index-DqBwvK0E.js → index-BzbwskdO.js} +1 -1
  102. package/dist/client/assets/{index-Cl2GHryt.js → index-DOQ9GLeH.js} +1 -1
  103. package/dist/client/assets/{index-UItETm2j.js → index-Dq6km8uv.js} +1 -1
  104. package/dist/client/assets/{index-CEFIvFnf.js → index-DrrqKIxq.js} +3 -3
  105. package/dist/client/assets/{infiniteQueryObserver-B9nwx2aL.js → infiniteQueryObserver-BUe0-uqo.js} +1 -1
  106. package/dist/client/assets/{input-UPbtT6D5.js → input-C2aMc-tK.js} +1 -1
  107. package/dist/client/assets/{integration-icon-D3KY1sTg.js → integration-icon-BVqKl9De.js} +1 -1
  108. package/dist/client/assets/{label-OGiRqcEX.js → label-CoS6RHW3.js} +1 -1
  109. package/dist/client/assets/{layout-CvVtUUQW.js → layout-D1KoVO75.js} +1 -1
  110. package/dist/client/assets/{localstorage-keys-CRTQAB4C.js → localstorage-keys-Dn-W0lb3.js} +1 -1
  111. package/dist/client/assets/{login-CdLmE4NZ.js → login-VK-mokwH.js} +1 -1
  112. package/dist/client/assets/{markdown-Ca1p_aAP.js → markdown-BM0BQJdP.js} +1 -1
  113. package/dist/client/assets/{mcp-oauth-BbnOwrZd.js → mcp-oauth-DeNBGJ6_.js} +1 -1
  114. package/dist/client/assets/{mcp-server-card-CWlDBaaF.js → mcp-server-card-DacuauM5.js} +1 -1
  115. package/dist/client/assets/{mcp-server-detail-B-5zNwGt.js → mcp-server-detail-BLz5yvcq.js} +2 -2
  116. package/dist/client/assets/{members-UNx8dAjn.js → members-DenaIJqs.js} +1 -1
  117. package/dist/client/assets/monitoring-CJ1M1mUC.js +31 -0
  118. package/dist/client/assets/{monitoring-dashboard-edit-D1I_fFwn.js → monitoring-dashboard-edit-R1y62lIg.js} +1 -1
  119. package/dist/client/assets/{monitoring-dashboard-view-BBoKWBp9.js → monitoring-dashboard-view-BKjuLdW2.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-tVkX9nfx.js → oauth-callback-DX8HUvyR.js} +1 -1
  121. package/dist/client/assets/page-B9pAkFvr.js +1 -0
  122. package/dist/client/assets/{page-B9N0sRu5.js → page-sxnt39Ii.js} +1 -1
  123. package/dist/client/assets/{plugin-empty-state-DtpXQISJ.js → plugin-empty-state-ChCFqmd0.js} +1 -1
  124. package/dist/client/assets/{plugin-empty-state-Dap_lue3.js → plugin-empty-state-D5H9c9JD.js} +1 -1
  125. package/dist/client/assets/{plugin-header-BMtZYqR-.js → plugin-header-BWrOoTRo.js} +1 -1
  126. package/dist/client/assets/{plugin-header-mbAE6Sve.js → plugin-header-CVre9sGT.js} +1 -1
  127. package/dist/client/assets/{popover-CJJX7cOM.js → popover-D64RiLTH.js} +1 -1
  128. package/dist/client/assets/project-layout-BaHenL2i.js +1 -0
  129. package/dist/client/assets/{projects-list-BmWZdC4b.js → projects-list-DnkqBPpp.js} +1 -1
  130. package/dist/client/assets/{ranking-layout-BqQuRiQh.js → ranking-layout-Wlr8fTR0.js} +1 -1
  131. package/dist/client/assets/{readme-viewer-CgSAdR9I.js → readme-viewer-DHp79NQe.js} +1 -1
  132. package/dist/client/assets/{registry-layout-DgsXq9Iy.js → registry-layout-DYNrneTu.js} +1 -1
  133. package/dist/client/assets/{registry-utils-DNrODt4G.js → registry-utils-B3BaD7r8.js} +1 -1
  134. package/dist/client/assets/{reports-layout-rm_1mJnU.js → reports-layout-BbfZIE8e.js} +1 -1
  135. package/dist/client/assets/{reset-password-CARUWrH0.js → reset-password-BQ__IAnv.js} +1 -1
  136. package/dist/client/assets/{resizable-BeAVlcw0.js → resizable-DAFw0KAb.js} +1 -1
  137. package/dist/client/assets/{save-actions-CcxXXbVc.js → save-actions-DGAmsooG.js} +1 -1
  138. package/dist/client/assets/{scroll-area-CItFqOci.js → scroll-area-DH4YtMqo.js} +1 -1
  139. package/dist/client/assets/{select-CwgyA5Wi.js → select-L9VC3PJn.js} +1 -1
  140. package/dist/client/assets/shell-layout-BEcaEstI.js +3 -0
  141. package/dist/client/assets/{skeleton-B5wseAX1.js → skeleton-C7PEWbcl.js} +1 -1
  142. package/dist/client/assets/{spinner-JsI3DFrV.js → spinner-BCc4DqcN.js} +1 -1
  143. package/dist/client/assets/{store-invite-D3LF9Yde.js → store-invite-CVYdc9iu.js} +1 -1
  144. package/dist/client/assets/{switch-BYuPAsrN.js → switch-EPGLJyI3.js} +1 -1
  145. package/dist/client/assets/{table-C25e3lsO.js → table-BKrr_ZVb.js} +1 -1
  146. package/dist/client/assets/{tasks-CzwD0Q_Q.js → tasks-Bn5ZyhP_.js} +1 -1
  147. package/dist/client/assets/{textarea-BzrbRDMZ.js → textarea-bPVDAJiU.js} +1 -1
  148. package/dist/client/assets/{time-range-picker-U_fyer52.js → time-range-picker-VyfEBU8i.js} +1 -1
  149. package/dist/client/assets/{toggle-group-DwUL9sIJ.js → toggle-group-Dp_hXbL3.js} +1 -1
  150. package/dist/client/assets/{tools-list-Beeckj80.js → tools-list-BdI3Q54q.js} +1 -1
  151. package/dist/client/assets/{tooltip-WTQ1Sf9I.js → tooltip-Di7lOmib.js} +1 -1
  152. package/dist/client/assets/{topbar-portal-CzctQPFH.js → topbar-portal-DKAZNOCc.js} +1 -1
  153. package/dist/client/assets/{typewriter-title-yszFjZyk.js → typewriter-title-CJBquTSX.js} +1 -1
  154. package/dist/client/assets/{use-binding-Xiu53R3H.js → use-binding-lQ5At5HW.js} +1 -1
  155. package/dist/client/assets/{use-connection-Cn_KCAac.js → use-connection-DjTWTI9s.js} +1 -1
  156. package/dist/client/assets/{use-copy-DxEdnDUl.js → use-copy-Cy4z0myA.js} +1 -1
  157. package/dist/client/assets/{use-create-virtual-mcp-D2iqPR2G.js → use-create-virtual-mcp-DyqNrljf.js} +1 -1
  158. package/dist/client/assets/{use-deco-chat-open-gpgx82-l.js → use-deco-chat-open-BuSNLd83.js} +1 -1
  159. package/dist/client/assets/{use-install-from-registry-xTriX8BS.js → use-install-from-registry-Dww4DIOX.js} +1 -1
  160. package/dist/client/assets/{use-list-state-DbHjmI2c.js → use-list-state-1nCBLa98.js} +1 -1
  161. package/dist/client/assets/{use-llm-1lq-QT_E.js → use-llm-Ce8POLUd.js} +1 -1
  162. package/dist/client/assets/{use-mcp-prompts-VDHthI2F.js → use-mcp-prompts-9RF1o3Vk.js} +1 -1
  163. package/dist/client/assets/{use-mcp-tools-D-6_rATb.js → use-mcp-tools-mAwwC0gK.js} +1 -1
  164. package/dist/client/assets/{use-mobile-DZvuCyAg.js → use-mobile-Cyo_7CU1.js} +1 -1
  165. package/dist/client/assets/{use-organization-settings-BzT6x8GT.js → use-organization-settings-dfLWy4_Y.js} +1 -1
  166. package/dist/client/assets/{use-project-Cpu_jAWh.js → use-project-BLgGy5mK.js} +1 -1
  167. package/dist/client/assets/use-settings-modal-BAyKuvP-.js +1 -0
  168. package/dist/client/assets/{use-view-mode-1Gj9Ftyw.js → use-view-mode-Dz6ZqxC7.js} +1 -1
  169. package/dist/client/assets/{use-virtual-mcp-CzLaRfMK.js → use-virtual-mcp-BA3G4Be3.js} +1 -1
  170. package/dist/client/assets/useInfiniteQuery-CIiL-5Y3.js +1 -0
  171. package/dist/client/assets/{useMutation-CRJhwh4V.js → useMutation-byIh8vPM.js} +1 -1
  172. package/dist/client/assets/useQuery-DcU1ldNG.js +1 -0
  173. package/dist/client/assets/useSuspenseInfiniteQuery-Dc-GS2UT.js +1 -0
  174. package/dist/client/assets/{workflow-I781PsAJ.js → workflow-j7kNV5HR.js} +1 -1
  175. package/dist/client/index.html +2 -2
  176. package/package.json +1 -1
  177. package/dist/client/assets/connection-detail-CrRrhObV.js +0 -1
  178. package/dist/client/assets/constants-DNU7gsUd.js +0 -1
  179. package/dist/client/assets/index-CRF3yQiM.css +0 -1
  180. package/dist/client/assets/monitoring-CNQyYNJh.js +0 -45
  181. package/dist/client/assets/page-CiWneucU.js +0 -1
  182. package/dist/client/assets/project-layout-06BwdR0x.js +0 -1
  183. package/dist/client/assets/shell-layout-BeAkZvQA.js +0 -3
  184. package/dist/client/assets/use-settings-modal-DWpwYi2w.js +0 -1
  185. package/dist/client/assets/useInfiniteQuery-BkWiNIx3.js +0 -1
  186. package/dist/client/assets/useQuery-DMUhrQv9.js +0 -1
  187. package/dist/client/assets/useSuspenseInfiniteQuery-CvuCfv37.js +0 -1
@@ -1 +1 @@
1
- import{c as Q,r as U,u as re,K as oe,bx as we,j as t,b as me,O as de,d as Ie,by as Te,bz as ne,aD as Re}from"./index-CEFIvFnf.js";import{P as X}from"./index-DqBwvK0E.js";import{B as Pe,a as ze,b as $e,c as ke}from"./breadcrumb-DA-aLp2Z.js";import{i as ue}from"./AlertTriangle-BUE7sdod.js";import{i as fe}from"./FilterLines-C7xWgmCm.js";import{n as xe}from"./Inbox01-BjRCuorQ.js";import{i as se}from"./Loading01-DVlzuDXC.js";import{s as ge}from"./RefreshCw01-DlEvV3CS.js";import{i as pe}from"./SearchMd-qPELZ8ba.js";import{u as he}from"./useQuery-DMUhrQv9.js";import{u as Le}from"./useInfiniteQuery-BkWiNIx3.js";import{a as Fe,f as Ee,b as Oe}from"./registry-utils-DNrODt4G.js";import{u as je,W as Ke,a as _e,h as Ae,b as Me}from"./constants-D-wlluJ1.js";import{f as Be,g as ye,h as De}from"./use-connection-Cn_KCAac.js";import{s as Ge}from"./slugify-CEUa2lfQ.js";import{C as We,E as Ve}from"./empty-state-CWevsb-G.js";import{M as ae}from"./mcp-server-card-CWlDBaaF.js";import{c as ie,B as Y}from"./button-COjpHvkK.js";import{I as qe}from"./input-UPbtT6D5.js";import{b as ve,P as be,a as Ne}from"./popover-CJJX7cOM.js";import{i as Ce}from"./Check-DYZ8kvzv.js";import{t as Se}from"./ChevronDown-DugvEHIv.js";import{s as te}from"./XClose-CUkPQHX7.js";import{s as Ue}from"./Plus-BgTScIjT.js";import{u as He}from"./use-binding-Xiu53R3H.js";import{L as Je,u as Qe}from"./localstorage-keys-CRTQAB4C.js";import{E as Ye}from"./error-boundary-CCf2jUlG.js";import"./use-mobile-DZvuCyAg.js";import"./tooltip-WTQ1Sf9I.js";import"./ChevronRight-B5elpXGa.js";import"./infiniteQueryObserver-B9nwx2aL.js";import"./useMutation-CRJhwh4V.js";import"./CheckVerified02-lDwU0JKj.js";import"./Globe02-CaREPjt_.js";import"./Lock01-Dlsr6mr6.js";import"./Terminal-CLx6qyUj.js";import"./card-BiC_BjTe.js";import"./integration-icon-D3KY1sTg.js";import"./Container-83NFZamb.js";import"./github-icon-Dp3wHhYE.js";import"./binder-kzm2-hR4.js";function Ze(s,e){const r=Q.c(4),[l,m]=U.useState(s),n=U.useRef(null),o=U.useRef(!0);let c,a;return r[0]!==e||r[1]!==s?(c=()=>{if(o.current){o.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{m(s)},e),()=>{n.current&&clearTimeout(n.current)}},a=[s,e],r[0]=e,r[1]=s,r[2]=c,r[3]=a):(c=r[2],a=r[3]),U.useEffect(c,a),l}function Xe(s){const e=Q.c(14),r=U.useRef(null),l=`scroll-position:${s}`,m=U.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const o=n;let c;e[2]!==l?(c=()=>{if(m.current===l)return;const j=sessionStorage.getItem(l);if(j&&r.current){const S=Number.parseInt(j,10);r.current.scrollTop=S}m.current=l},e[2]=l,e[3]=c):c=e[3];const a=c;let g;e[4]!==a||e[5]!==l?(g=()=>{m.current!==l&&a()},e[4]=a,e[5]=l,e[6]=g):g=e[6];const I=g;let i;e[7]!==a||e[8]!==l?(i=j=>{r.current=j,j&&m.current!==l&&requestAnimationFrame(()=>{a()})},e[7]=a,e[8]=l,e[9]=i):i=e[9];const p=i;let d;return e[10]!==I||e[11]!==o||e[12]!==p?(d={scrollRef:p,saveScrollPosition:o,handleScroll:I},e[10]=I,e[11]=o,e[12]=p,e[13]=d):d=e[13],d}const et=24;function tt(s){const e=Q.c(54),{registryId:r,listToolName:l,filtersToolName:m,search:n}=s,{org:o}=re();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,g]=U.useState(c);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[1]=I):I=e[1];const[i,p]=U.useState(I),d=r||null;let j;e[2]!==o.id||e[3]!==d?(j={connectionId:d,orgId:o.id},e[2]=o.id,e[3]=d,e[4]=j):j=e[4];const S=je(j),R=!!m;let b;e[5]!==m||e[6]!==r?(b=oe.toolCall(r,m||"no-filters","{}"),e[5]=m,e[6]=r,e[7]=b):b=e[7];let N;e[8]!==S||e[9]!==m?(N=async()=>{if(!m)return{tags:[],categories:[]};const f=await S.callTool({name:m,arguments:{}});return f.structuredContent??f},e[8]=S,e[9]=m,e[10]=N):N=e[10];let P;e[11]!==b||e[12]!==N?(P={queryKey:b,queryFn:N,staleTime:36e5,retry:2},e[11]=b,e[12]=N,e[13]=P):P=e[13];const{data:z}=he(P);let h,C,$;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==i||e[18]!==a){const f=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:et,...a.length>0&&{tags:a},...i.length>0&&{categories:i},...f&&{where:f}},$=Le,C=oe.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=i,e[18]=a,e[19]=h,e[20]=C,e[21]=$}else h=e[19],C=e[20],$=e[21];let v;e[22]!==S||e[23]!==h||e[24]!==l?(v=async f=>{const{pageParam:Z}=f,le=Z?{...h,cursor:Z}:h,ee=await S.callTool({name:l,arguments:le});return ee.structuredContent??ee},e[22]=S,e[23]=h,e[24]=l,e[25]=v):v=e[25];let k;e[26]!==v||e[27]!==C?(k={queryKey:C,queryFn:v,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=v,e[27]=C,e[28]=k):k=e[28];const{data:w,fetchNextPage:x,hasNextPage:y,isFetchingNextPage:u,isFetching:T,isLoading:L,error:F}=$(k);let K;e:{if(!w?.pages||w.pages.length===0){K=null;break e}const f=w.pages[0];if(typeof f=="object"&&f!==null&&"totalCount"in f&&typeof f.totalCount=="number"){K=f.totalCount;break e}K=null}const _=K,E=w?.pages;let G;e[29]!==E?(G=Fe(E),e[29]=E,e[30]=G):G=e[30];const H=G;let W;e[31]!==n||e[32]!==i.length||e[33]!==a.length?(W=a.length>0||i.length>0||!!n?.trim(),e[31]=n,e[32]=i.length,e[33]=a.length,e[34]=W):W=e[34];const D=W,B=T&&!u&&!L&&D;let A;e[35]!==x||e[36]!==y||e[37]!==u?(A=()=>{y&&!u&&x()},e[35]=x,e[36]=y,e[37]=u,e[38]=A):A=e[38];const V=A,O=y??!1,M=R?z?.tags:void 0,q=R?z?.categories:void 0;let J;return e[39]!==D||e[40]!==T||e[41]!==u||e[42]!==B||e[43]!==L||e[44]!==H||e[45]!==F||e[46]!==V||e[47]!==i||e[48]!==a||e[49]!==O||e[50]!==M||e[51]!==q||e[52]!==_?(J={items:H,totalCount:_,hasMore:O,isLoadingMore:u,isFiltering:B,isInitialLoading:L,isFetching:T,error:F,loadMore:V,availableTags:M,availableCategories:q,selectedTags:a,selectedCategories:i,setSelectedTags:g,setSelectedCategories:p,hasActiveFilters:D},e[39]=D,e[40]=T,e[41]=u,e[42]=B,e[43]=L,e[44]=H,e[45]=F,e[46]=V,e[47]=i,e[48]=a,e[49]=O,e[50]=M,e[51]=q,e[52]=_,e[53]=J):J=e[53],J}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,l)=>l.count-r.count).slice(0,e)}function ce(s){const e=Q.c(52),{label:r,items:l,selectedItems:m,onToggle:n,onClear:o}=s,[c,a]=U.useState(""),[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N,P,z,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==g||e[4]!==c||e[5]!==m){const x=[...c?l.filter(E=>E.value.toLowerCase().includes(c.toLowerCase())):l].sort(lt);d=m.length,p=ve,P=g,z=I;let y;e[17]!==r?(y=t.jsx("span",{children:r}),e[17]=r,e[18]=y):y=e[18];let u;e[19]!==d?(u=d>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=u):u=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=T):T=e[21],e[22]!==u||e[23]!==y?(h=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[y,u,T]})}),e[22]=u,e[23]=y,e[24]=h):h=e[24],i=Ne,R="w-64 p-0",b="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let F;e[26]!==r?(F=r.toLowerCase(),e[26]=r,e[27]=F):F=e[27];const K=`Search ${F}...`;let _;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=E=>a(E.target.value),e[28]=_):_=e[28],e[29]!==c||e[30]!==K?(N=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,t.jsx(qe,{type:"text",placeholder:K,value:c,onChange:_,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=K,e[31]=N):N=e[31],j="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",S=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const G=m.includes(E.value);return t.jsxs("button",{onClick:()=>n(E.value),className:ie("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=g,e[4]=c,e[5]=m,e[6]=i,e[7]=p,e[8]=d,e[9]=j,e[10]=S,e[11]=R,e[12]=b,e[13]=N,e[14]=P,e[15]=z,e[16]=h}else i=e[6],p=e[7],d=e[8],j=e[9],S=e[10],R=e[11],b=e[12],N=e[13],P=e[14],z=e[15],h=e[16];let C;e[32]!==j||e[33]!==S?(C=t.jsx("div",{className:j,children:S}),e[32]=j,e[33]=S,e[34]=C):C=e[34];let $;e[35]!==r||e[36]!==o||e[37]!==d?($=d>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:o,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=o,e[37]=d,e[38]=$):$=e[38];let v;e[39]!==i||e[40]!==$||e[41]!==R||e[42]!==b||e[43]!==N||e[44]!==C?(v=t.jsxs(i,{className:R,align:b,children:[N,C,$]}),e[39]=i,e[40]=$,e[41]=R,e[42]=b,e[43]=N,e[44]=C,e[45]=v):v=e[45];let k;return e[46]!==p||e[47]!==v||e[48]!==P||e[49]!==z||e[50]!==h?(k=t.jsxs(p,{open:P,onOpenChange:z,children:[h,v]}),e[46]=p,e[47]=v,e[48]=P,e[49]=z,e[50]=h,e[51]=k):k=e[51],k}function lt(s,e){return e.count-s.count}function nt(s){const e=Q.c(67),{availableTags:r,availableCategories:l,selectedTags:m,selectedCategories:n,onTagChange:o,onCategoryChange:c}=s,a=r&&r.length>0||l&&l.length>0,g=m.length>0||n.length>0;if(!a)return null;let I;e[0]!==o||e[1]!==m?(I=y=>{m.includes(y)?o(m.filter(u=>u!==y)):o([...m,y])},e[0]=o,e[1]=m,e[2]=I):I=e[2];const i=I;let p;e[3]!==c||e[4]!==n?(p=y=>{n.includes(y)?c(n.filter(u=>u!==y)):c([...n,y])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const d=p;let j;e[6]!==c||e[7]!==o?(j=()=>{o([]),c([])},e[6]=c,e[7]=o,e[8]=j):j=e[8];const S=j;let R,b,N,P,z,h,C;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==o||e[13]!==n||e[14]!==m||e[15]!==d||e[16]!==i){const y=l?rt(l,6):[];R=n,b=m,C=new Set(y.map(ot)),z="flex items-center border-b border-border";let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(fe,{size:16})}),e[24]=u):u=e[24];let T;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==d?(T=l&&l.length>0&&t.jsx(ce,{label:"Categories",items:l,selectedItems:n,onToggle:d,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=d,e[29]=T):T=e[29];let L;e[30]!==r||e[31]!==o||e[32]!==m||e[33]!==i?(L=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:m,onToggle:i,onClear:()=>o([])}),e[30]=r,e[31]=o,e[32]=m,e[33]=i,e[34]=L):L=e[34],e[35]!==L||e[36]!==T?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[u,T,L]}),e[35]=L,e[36]=T,e[37]=h):h=e[37],N="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==n||e[39]!==d?(F=K=>{const _=n.includes(K.value);return t.jsxs("div",{onClick:()=>d(K.value),className:ie("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",_?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:K.value}),_&&t.jsx("span",{onClick:E=>{E.stopPropagation(),d(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},K.value)},e[38]=n,e[39]=d,e[40]=F):F=e[40],P=y.map(F),e[9]=l,e[10]=r,e[11]=c,e[12]=o,e[13]=n,e[14]=m,e[15]=d,e[16]=i,e[17]=R,e[18]=b,e[19]=N,e[20]=P,e[21]=z,e[22]=h,e[23]=C}else R=e[17],b=e[18],N=e[19],P=e[20],z=e[21],h=e[22],C=e[23];let $;if(e[41]!==R||e[42]!==d||e[43]!==C){let y;e[45]!==C?(y=T=>!C.has(T),e[45]=C,e[46]=y):y=e[46];let u;e[47]!==d?(u=T=>t.jsxs("div",{onClick:()=>d(T),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:T}),t.jsx("span",{onClick:L=>{L.stopPropagation(),d(T)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`cat-${T}`),e[47]=d,e[48]=u):u=e[48],$=R.filter(y).map(u),e[41]=R,e[42]=d,e[43]=C,e[44]=$}else $=e[44];let v;if(e[49]!==b||e[50]!==i){let y;e[52]!==i?(y=u=>t.jsxs("div",{onClick:()=>i(u),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:u}),t.jsx("span",{onClick:T=>{T.stopPropagation(),i(u)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`tag-${u}`),e[52]=i,e[53]=y):y=e[53],v=b.map(y),e[49]=b,e[50]=i,e[51]=v}else v=e[51];let k;e[54]!==S||e[55]!==g?(k=g&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:S,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(te,{size:14}),"Clear all"]}),e[54]=S,e[55]=g,e[56]=k):k=e[56];let w;e[57]!==k||e[58]!==N||e[59]!==P||e[60]!==$||e[61]!==v?(w=t.jsxs("div",{className:N,children:[P,$,v,k]}),e[57]=k,e[58]=N,e[59]=P,e[60]=$,e[61]=v,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==z||e[65]!==h?(x=t.jsxs("div",{className:z,children:[h,w]}),e[63]=w,e[64]=z,e[65]=h,e[66]=x):x=e[66],x}function ot(s){return s.value}function it(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=Q.c(55),{registryId:r,listToolName:l,filtersToolName:m,storePrivateOnly:n}=s,[o,c]=U.useState(""),a=Ze(o,300),g=me(),{org:I}=re(),{scrollRef:i,saveScrollPosition:p,handleScroll:d}=Xe(`store-discovery:${r}`);let j;e[0]!==a||e[1]!==m||e[2]!==l||e[3]!==r?(j={registryId:r,listToolName:l,filtersToolName:m,search:a},e[0]=a,e[1]=m,e[2]=l,e[3]=r,e[4]=j):j=e[4];const{items:S,hasMore:R,isLoadingMore:b,isInitialLoading:N,isFetching:P,error:z,loadMore:h,availableTags:C,availableCategories:$,selectedTags:v,selectedCategories:k,setSelectedTags:w,setSelectedCategories:x,hasActiveFilters:y}=tt(j);let u,T,L,F;if(e[5]!==a||e[6]!==P||e[7]!==N||e[8]!==S||e[9]!==o||e[10]!==n){const O=o?it(S,o):S;F=n?O.filter(dt):O,u=(o!==a||P)&&!N&&!!o,L=F.filter(at),T=F.filter(M=>!L.find(q=>q.id===M.id)),e[5]=a,e[6]=P,e[7]=N,e[8]=S,e[9]=o,e[10]=n,e[11]=u,e[12]=T,e[13]=L,e[14]=F}else u=e[11],T=e[12],L=e[13],F=e[14];const K=T;let _;e[15]!==g||e[16]!==I.slug||e[17]!==r||e[18]!==p?(_=O=>{p();const M=Ge(O.name||O.title||O.server?.title||""),q=typeof O.id=="string"&&O.id.includes("/"),J=typeof O.server?.name=="string"&&O.server.name.includes("/"),f=q&&!J?O.id:O.server?.name||O.id||"";g({to:"/$org/$project/store/$appName",params:{org:I.slug,project:de,appName:M},search:{registryId:r,serverName:f}})},e[15]=g,e[16]=I.slug,e[17]=r,e[18]=p,e[19]=_):_=e[19];const E=_;let G;e[20]!==d||e[21]!==R||e[22]!==b||e[23]!==h?(G=O=>{if(d(),!R||b)return;const M=O.currentTarget;M.scrollHeight-M.scrollTop-M.clientHeight<200&&h()},e[20]=d,e[21]=R,e[22]=b,e[23]=h,e[24]=G):G=e[24];const H=G;let W;e[25]!==u||e[26]!==o?(W=t.jsx(We,{value:o,onChange:c,placeholder:"Search for an MCP Server...",isSearching:u}),e[25]=u,e[26]=o,e[27]=W):W=e[27];let D;e[28]!==$||e[29]!==C||e[30]!==k||e[31]!==v||e[32]!==x||e[33]!==w?(D=t.jsx(nt,{availableTags:C,availableCategories:$,selectedTags:v,selectedCategories:k,onTagChange:w,onCategoryChange:x}),e[28]=$,e[29]=C,e[30]=k,e[31]=v,e[32]=x,e[33]=w,e[34]=D):D=e[34];let B;e[35]!==K||e[36]!==z||e[37]!==E||e[38]!==y||e[39]!==R||e[40]!==N||e[41]!==b||e[42]!==u||e[43]!==o||e[44]!==L||e[45]!==F?(B=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:z&&!N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),z.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:z.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:mt,children:[t.jsx(ge,{className:"size-4"}),"Try again"]})]}):N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):F.length===0&&!y?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):F.length===0&&y&&!o?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(fe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):o&&F.length===0&&!u?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[u&&F.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),L.length>0&&t.jsx(ae,{items:L,title:"Verified",onItemClick:E}),K.length>0&&t.jsx(ae,{items:K,title:L.length>0?"All":"",onItemClick:E}),R&&b&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(se,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[35]=K,e[36]=z,e[37]=E,e[38]=y,e[39]=R,e[40]=N,e[41]=b,e[42]=u,e[43]=o,e[44]=L,e[45]=F,e[46]=B):B=e[46];let A;e[47]!==H||e[48]!==i||e[49]!==B?(A=t.jsx("div",{ref:i,className:"flex-1 overflow-y-auto",onScroll:H,children:B}),e[47]=H,e[48]=i,e[49]=B,e[50]=A):A=e[50];let V;return e[51]!==W||e[52]!==D||e[53]!==A?(V=t.jsxs("div",{className:"flex flex-col h-full",children:[W,D,A]}),e[51]=W,e[52]=D,e[53]=A,e[54]=V):V=e[54],V}function mt(){return window.location.reload()}function dt(s){return s.is_public!==!0}function ut(s){const e=Q.c(11),{registryId:r,storePrivateOnly:l}=s,m=Be(r),n=m?.tools;let o;e[0]!==n?(o=Ee(n),e[0]=n,e[1]=o):o=e[1];const c=o;if(!c){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(xe,{className:"size-8 text-muted-foreground"})}),e[2]=d):d=e[2];let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[d,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=j):j=e[3],j}const a=m?.tools;let g;e[4]!==a?(g=Oe(a),e[4]=a,e[5]=g):g=e[5];const i=g||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==i?(p=t.jsx(ct,{registryId:r,listToolName:c,filtersToolName:i,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=i,e[10]=p):p=e[10],p}function ft(s){const e=Q.c(43),{registries:r,value:l,onValueChange:m,onAddWellKnown:n,wellKnownRegistries:o,placeholder:c}=s,a=c===void 0?"Select a registry...":c,[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N;if(e[0]!==g||e[1]!==a||e[2]!==r||e[3]!==l){let w;e[12]!==l?(w=y=>y.id===l,e[12]=l,e[13]=w):w=e[13];const x=r.find(w);p=ve,b=g,N=I,i=be,R=!0,d="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(j=ie("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=j):j=e[14],S=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:a}),e[0]=g,e[1]=a,e[2]=r,e[3]=l,e[4]=i,e[5]=p,e[6]=d,e[7]=j,e[8]=S,e[9]=R,e[10]=b,e[11]=N}else i=e[4],p=e[5],d=e[6],j=e[7],S=e[8],R=e[9],b=e[10],N=e[11];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=P):P=e[15];let z;e[16]!==d||e[17]!==j||e[18]!==S?(z=t.jsxs("button",{type:d,className:j,children:[S,P]}),e[16]=d,e[17]=j,e[18]=S,e[19]=z):z=e[19];let h;e[20]!==i||e[21]!==R||e[22]!==z?(h=t.jsx(i,{asChild:R,children:z}),e[20]=i,e[21]=R,e[22]=z,e[23]=h):h=e[23];let C;if(e[24]!==m||e[25]!==r||e[26]!==l){let w;e[28]!==m||e[29]!==l?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{m(x.id??x.name),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),l===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=m,e[29]=l,e[30]=w):w=e[30],C=r.map(w),e[24]=m,e[25]=r,e[26]=l,e[27]=C}else C=e[27];let $;e[31]!==n||e[32]!==o?($=o.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(w=>t.jsxs("button",{type:"button",onClick:()=>{n(w),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(Ue,{size:16})})]},w.id??w.title))]}),e[31]=n,e[32]=o,e[33]=$):$=e[33];let v;e[34]!==C||e[35]!==$?(v=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[C,$]}),e[34]=C,e[35]=$,e[36]=v):v=e[36];let k;return e[37]!==p||e[38]!==h||e[39]!==v||e[40]!==b||e[41]!==N?(k=t.jsxs(p,{open:b,onOpenChange:N,children:[h,v]}),e[37]=p,e[38]=h,e[39]=v,e[40]=b,e[41]=N,e[42]=k):k=e[42],k}function xt({registries:s,onConnected:e}){const r=ye(),{org:{slug:l}}=re(),{data:m}=Ie.useSession(),n=me(),[o,c]=U.useState(!1),a=s[0],g=async()=>{if(!(!a||!m?.user?.id)){c(!0);try{const i=await r.create.mutateAsync(a);e?.(i.id)}finally{c(!1)}}},I=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:de},search:{action:"create"}})};return t.jsx(Ve,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:g,disabled:o||!a,children:[a?.icon&&t.jsx("img",{src:a.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:I,children:"Custom Connection"})]})})}function gt(s){const e=Q.c(15),{error:r,onRetry:l,registryName:m}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=o):o=e[1];let c;e[2]!==m?(c=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:m})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=m,e[3]=c):c=e[3];let a;e[4]!==r?(a=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=a):a=e[5];let g;e[6]!==c||e[7]!==a?(g=t.jsxs("div",{className:"space-y-2",children:[o,c,a]}),e[6]=c,e[7]=a,e[8]=g):g=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ge,{className:"size-4"}),e[9]=I):I=e[9];let i;e[10]!==l?(i=t.jsxs(Y,{variant:"outline",size:"sm",onClick:l,children:[I,"Try again"]}),e[10]=l,e[11]=i):i=e[11];let p;return e[12]!==g||e[13]!==i?(p=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,g,i]}),e[12]=g,e[13]=i,e[14]=p):p=e[14],p}function ns(){const s=Q.c(49),{org:e,project:r}=re(),l=De(),m=ye(),n=Te(),o=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=He(l);let a;s[0]!==e.id?(a=Ke.SELF(e.id),s[0]=e.id,s[1]=a):a=s[1];const g=a,I=r.enabledPlugins,i=I==null||I.includes(ne),p=c.filter(f=>f.id!==g?!0:i);let d;s[2]!==g?(d=f=>f.id===g,s[2]=g,s[3]=d):d=s[3];const j=p.some(d);let S;s[4]!==e.id?(S={connectionId:_e,orgId:e.id},s[4]=e.id,s[5]=S):S=s[5];const R=je(S);let b;s[6]!==r.id||s[7]!==R?(b=async()=>{const f=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ne}});return f.structuredContent??f},s[6]=r.id,s[7]=R,s[8]=b):b=s[8];const{data:N}=he({queryKey:oe.projectPluginConfig(r.id??"",ne),queryFn:b,enabled:j&&!!r.id,staleTime:6e4}),P=N?.config?.settings;let z;s[9]!==P||s[10]!==g?(z=f=>f.id===g&&P?{id:f.id,name:P.registryName||f.title,icon:P.registryIcon||f.icon||void 0}:{id:f.id,name:f.title,icon:f.icon||void 0},s[9]=P,s[10]=g,s[11]=z):z=s[11];const h=p.map(z);let C;s[12]!==e.slug?(C=Je.selectedRegistry(e.slug),s[12]=e.slug,s[13]=C):C=s[13];const[$,v]=Qe(C,ht);let k;s[14]!==$?(k=f=>f.id===$,s[14]=$,s[15]=k):k=s[15];const x=p.find(k)?.id||p[0]?.id||"",y=x===g&&P?.storePrivateOnly===!0;let u;s[16]!==e.id?(u=Ae(e.id),s[16]=e.id,s[17]=u):u=s[17];let T;s[18]!==u?(T=[u],s[18]=u,s[19]=T):T=s[19];const L=T;let F;s[20]===Symbol.for("react.memo_cache_sentinel")?(F=[Me()],s[20]=F):F=s[20];const K=F;let _;s[21]!==m.create||s[22]!==v?(_=async f=>{const Z=await m.create.mutateAsync(f);v(Z.id)},s[21]=m.create,s[22]=v,s[23]=_):_=s[23];const E=_,G=new Set(p.map(pt)),H=L.filter(f=>f.id&&!G.has(f.id)),W=K.filter(f=>f.id&&!G.has(f.id));if(o){let f;return s[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Re,{}),s[24]=f):f=s[24],f}let D;s[25]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X.Header.Left,{children:t.jsx(Pe,{children:t.jsx(ze,{children:t.jsx($e,{children:t.jsx(ke,{children:"Store"})})})})}),s[25]=D):D=s[25];let B;s[26]!==E?(B=async f=>E(f),s[26]=E,s[27]=B):B=s[27];let A;s[28]!==H||s[29]!==x||s[30]!==h||s[31]!==v||s[32]!==B?(A=t.jsxs(X.Header,{children:[D,t.jsx(X.Header.Right,{children:t.jsx(ft,{wellKnownRegistries:H,registries:h,value:x,onValueChange:v,onAddWellKnown:B,placeholder:"Select store..."})})]}),s[28]=H,s[29]=x,s[30]=h,s[31]=v,s[32]=B,s[33]=A):A=s[33];let V;s[34]!==x||s[35]!==h?(V=f=>{const{error:Z,resetError:le}=f;return t.jsx(gt,{error:Z,onRetry:le,registryName:h.find(ee=>ee.id===x)?.name??"registry"})},s[34]=x,s[35]=h,s[36]=V):V=s[36];let O;s[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=O):O=s[37];let M;s[38]!==W||s[39]!==x||s[40]!==v||s[41]!==y?(M=t.jsx(U.Suspense,{fallback:O,children:x?t.jsx(ut,{registryId:x,storePrivateOnly:y}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(xt,{registries:W,onConnected:f=>{v(f)}})})}),s[38]=W,s[39]=x,s[40]=v,s[41]=y,s[42]=M):M=s[42];let q;s[43]!==V||s[44]!==M?(q=t.jsx(X.Content,{children:t.jsx(Ye,{fallback:V,children:M})}),s[43]=V,s[44]=M,s[45]=q):q=s[45];let J;return s[46]!==A||s[47]!==q?(J=t.jsxs(X,{children:[A,q]}),s[46]=A,s[47]=q,s[48]=J):J=s[48],J}function pt(s){return s.id}function ht(s){return s??""}export{ns as default};
1
+ import{c as Q,r as U,u as re,K as oe,bx as we,j as t,b as me,O as de,d as Ie,by as Te,bz as ne,aD as Re}from"./index-DrrqKIxq.js";import{P as X}from"./index-BzbwskdO.js";import{B as Pe,a as ze,b as $e,c as ke}from"./breadcrumb-rKBAWCrS.js";import{i as ue}from"./AlertTriangle-Ddzav--o.js";import{i as fe}from"./FilterLines-DEUbdgpO.js";import{n as xe}from"./Inbox01-D4AhYFiy.js";import{i as se}from"./Loading01-Bl1Pk_oo.js";import{s as ge}from"./RefreshCw01-B1WiG0_Y.js";import{i as pe}from"./SearchMd-CmV0Tepn.js";import{u as he}from"./useQuery-DcU1ldNG.js";import{u as Le}from"./useInfiniteQuery-CIiL-5Y3.js";import{a as Fe,f as Ee,b as Oe}from"./registry-utils-B3BaD7r8.js";import{u as je,W as Ke,a as _e,h as Ae,b as Me}from"./constants-C2M7RsNt.js";import{f as Be,g as ye,h as De}from"./use-connection-DjTWTI9s.js";import{s as Ge}from"./slugify-CEUa2lfQ.js";import{C as We,E as Ve}from"./empty-state-C_g2tsPC.js";import{M as ae}from"./mcp-server-card-DacuauM5.js";import{c as ie,B as Y}from"./button-CZPRmDPf.js";import{I as qe}from"./input-C2aMc-tK.js";import{b as ve,P as be,a as Ne}from"./popover-D64RiLTH.js";import{i as Ce}from"./Check-CwhCIsIx.js";import{t as Se}from"./ChevronDown-DHYql12c.js";import{s as te}from"./XClose-CBFYdEvF.js";import{s as Ue}from"./Plus-CPirwa1w.js";import{u as He}from"./use-binding-lQ5At5HW.js";import{L as Je,u as Qe}from"./localstorage-keys-Dn-W0lb3.js";import{E as Ye}from"./error-boundary-DqZtjxEB.js";import"./use-mobile-Cyo_7CU1.js";import"./tooltip-Di7lOmib.js";import"./ChevronRight-qRilEtY5.js";import"./infiniteQueryObserver-BUe0-uqo.js";import"./useMutation-byIh8vPM.js";import"./CheckVerified02-BG2LRHT3.js";import"./Globe02-C1VZ1Sth.js";import"./Lock01-BltwB-9b.js";import"./Terminal-BNbAKfj5.js";import"./card-RVty8OZv.js";import"./integration-icon-BVqKl9De.js";import"./Container-DmRzes59.js";import"./github-icon-Dp3wHhYE.js";import"./binder-DA98_oix.js";function Ze(s,e){const r=Q.c(4),[l,m]=U.useState(s),n=U.useRef(null),o=U.useRef(!0);let c,a;return r[0]!==e||r[1]!==s?(c=()=>{if(o.current){o.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{m(s)},e),()=>{n.current&&clearTimeout(n.current)}},a=[s,e],r[0]=e,r[1]=s,r[2]=c,r[3]=a):(c=r[2],a=r[3]),U.useEffect(c,a),l}function Xe(s){const e=Q.c(14),r=U.useRef(null),l=`scroll-position:${s}`,m=U.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const o=n;let c;e[2]!==l?(c=()=>{if(m.current===l)return;const j=sessionStorage.getItem(l);if(j&&r.current){const S=Number.parseInt(j,10);r.current.scrollTop=S}m.current=l},e[2]=l,e[3]=c):c=e[3];const a=c;let g;e[4]!==a||e[5]!==l?(g=()=>{m.current!==l&&a()},e[4]=a,e[5]=l,e[6]=g):g=e[6];const I=g;let i;e[7]!==a||e[8]!==l?(i=j=>{r.current=j,j&&m.current!==l&&requestAnimationFrame(()=>{a()})},e[7]=a,e[8]=l,e[9]=i):i=e[9];const p=i;let d;return e[10]!==I||e[11]!==o||e[12]!==p?(d={scrollRef:p,saveScrollPosition:o,handleScroll:I},e[10]=I,e[11]=o,e[12]=p,e[13]=d):d=e[13],d}const et=24;function tt(s){const e=Q.c(54),{registryId:r,listToolName:l,filtersToolName:m,search:n}=s,{org:o}=re();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,g]=U.useState(c);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[1]=I):I=e[1];const[i,p]=U.useState(I),d=r||null;let j;e[2]!==o.id||e[3]!==d?(j={connectionId:d,orgId:o.id},e[2]=o.id,e[3]=d,e[4]=j):j=e[4];const S=je(j),R=!!m;let b;e[5]!==m||e[6]!==r?(b=oe.toolCall(r,m||"no-filters","{}"),e[5]=m,e[6]=r,e[7]=b):b=e[7];let N;e[8]!==S||e[9]!==m?(N=async()=>{if(!m)return{tags:[],categories:[]};const f=await S.callTool({name:m,arguments:{}});return f.structuredContent??f},e[8]=S,e[9]=m,e[10]=N):N=e[10];let P;e[11]!==b||e[12]!==N?(P={queryKey:b,queryFn:N,staleTime:36e5,retry:2},e[11]=b,e[12]=N,e[13]=P):P=e[13];const{data:z}=he(P);let h,C,$;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==i||e[18]!==a){const f=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:et,...a.length>0&&{tags:a},...i.length>0&&{categories:i},...f&&{where:f}},$=Le,C=oe.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=i,e[18]=a,e[19]=h,e[20]=C,e[21]=$}else h=e[19],C=e[20],$=e[21];let v;e[22]!==S||e[23]!==h||e[24]!==l?(v=async f=>{const{pageParam:Z}=f,le=Z?{...h,cursor:Z}:h,ee=await S.callTool({name:l,arguments:le});return ee.structuredContent??ee},e[22]=S,e[23]=h,e[24]=l,e[25]=v):v=e[25];let k;e[26]!==v||e[27]!==C?(k={queryKey:C,queryFn:v,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=v,e[27]=C,e[28]=k):k=e[28];const{data:w,fetchNextPage:x,hasNextPage:y,isFetchingNextPage:u,isFetching:T,isLoading:L,error:F}=$(k);let K;e:{if(!w?.pages||w.pages.length===0){K=null;break e}const f=w.pages[0];if(typeof f=="object"&&f!==null&&"totalCount"in f&&typeof f.totalCount=="number"){K=f.totalCount;break e}K=null}const _=K,E=w?.pages;let G;e[29]!==E?(G=Fe(E),e[29]=E,e[30]=G):G=e[30];const H=G;let W;e[31]!==n||e[32]!==i.length||e[33]!==a.length?(W=a.length>0||i.length>0||!!n?.trim(),e[31]=n,e[32]=i.length,e[33]=a.length,e[34]=W):W=e[34];const D=W,B=T&&!u&&!L&&D;let A;e[35]!==x||e[36]!==y||e[37]!==u?(A=()=>{y&&!u&&x()},e[35]=x,e[36]=y,e[37]=u,e[38]=A):A=e[38];const V=A,O=y??!1,M=R?z?.tags:void 0,q=R?z?.categories:void 0;let J;return e[39]!==D||e[40]!==T||e[41]!==u||e[42]!==B||e[43]!==L||e[44]!==H||e[45]!==F||e[46]!==V||e[47]!==i||e[48]!==a||e[49]!==O||e[50]!==M||e[51]!==q||e[52]!==_?(J={items:H,totalCount:_,hasMore:O,isLoadingMore:u,isFiltering:B,isInitialLoading:L,isFetching:T,error:F,loadMore:V,availableTags:M,availableCategories:q,selectedTags:a,selectedCategories:i,setSelectedTags:g,setSelectedCategories:p,hasActiveFilters:D},e[39]=D,e[40]=T,e[41]=u,e[42]=B,e[43]=L,e[44]=H,e[45]=F,e[46]=V,e[47]=i,e[48]=a,e[49]=O,e[50]=M,e[51]=q,e[52]=_,e[53]=J):J=e[53],J}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,l)=>l.count-r.count).slice(0,e)}function ce(s){const e=Q.c(52),{label:r,items:l,selectedItems:m,onToggle:n,onClear:o}=s,[c,a]=U.useState(""),[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N,P,z,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==g||e[4]!==c||e[5]!==m){const x=[...c?l.filter(E=>E.value.toLowerCase().includes(c.toLowerCase())):l].sort(lt);d=m.length,p=ve,P=g,z=I;let y;e[17]!==r?(y=t.jsx("span",{children:r}),e[17]=r,e[18]=y):y=e[18];let u;e[19]!==d?(u=d>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=u):u=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=T):T=e[21],e[22]!==u||e[23]!==y?(h=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[y,u,T]})}),e[22]=u,e[23]=y,e[24]=h):h=e[24],i=Ne,R="w-64 p-0",b="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let F;e[26]!==r?(F=r.toLowerCase(),e[26]=r,e[27]=F):F=e[27];const K=`Search ${F}...`;let _;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=E=>a(E.target.value),e[28]=_):_=e[28],e[29]!==c||e[30]!==K?(N=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,t.jsx(qe,{type:"text",placeholder:K,value:c,onChange:_,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=K,e[31]=N):N=e[31],j="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",S=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const G=m.includes(E.value);return t.jsxs("button",{onClick:()=>n(E.value),className:ie("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=g,e[4]=c,e[5]=m,e[6]=i,e[7]=p,e[8]=d,e[9]=j,e[10]=S,e[11]=R,e[12]=b,e[13]=N,e[14]=P,e[15]=z,e[16]=h}else i=e[6],p=e[7],d=e[8],j=e[9],S=e[10],R=e[11],b=e[12],N=e[13],P=e[14],z=e[15],h=e[16];let C;e[32]!==j||e[33]!==S?(C=t.jsx("div",{className:j,children:S}),e[32]=j,e[33]=S,e[34]=C):C=e[34];let $;e[35]!==r||e[36]!==o||e[37]!==d?($=d>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:o,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=o,e[37]=d,e[38]=$):$=e[38];let v;e[39]!==i||e[40]!==$||e[41]!==R||e[42]!==b||e[43]!==N||e[44]!==C?(v=t.jsxs(i,{className:R,align:b,children:[N,C,$]}),e[39]=i,e[40]=$,e[41]=R,e[42]=b,e[43]=N,e[44]=C,e[45]=v):v=e[45];let k;return e[46]!==p||e[47]!==v||e[48]!==P||e[49]!==z||e[50]!==h?(k=t.jsxs(p,{open:P,onOpenChange:z,children:[h,v]}),e[46]=p,e[47]=v,e[48]=P,e[49]=z,e[50]=h,e[51]=k):k=e[51],k}function lt(s,e){return e.count-s.count}function nt(s){const e=Q.c(67),{availableTags:r,availableCategories:l,selectedTags:m,selectedCategories:n,onTagChange:o,onCategoryChange:c}=s,a=r&&r.length>0||l&&l.length>0,g=m.length>0||n.length>0;if(!a)return null;let I;e[0]!==o||e[1]!==m?(I=y=>{m.includes(y)?o(m.filter(u=>u!==y)):o([...m,y])},e[0]=o,e[1]=m,e[2]=I):I=e[2];const i=I;let p;e[3]!==c||e[4]!==n?(p=y=>{n.includes(y)?c(n.filter(u=>u!==y)):c([...n,y])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const d=p;let j;e[6]!==c||e[7]!==o?(j=()=>{o([]),c([])},e[6]=c,e[7]=o,e[8]=j):j=e[8];const S=j;let R,b,N,P,z,h,C;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==o||e[13]!==n||e[14]!==m||e[15]!==d||e[16]!==i){const y=l?rt(l,6):[];R=n,b=m,C=new Set(y.map(ot)),z="flex items-center border-b border-border";let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(fe,{size:16})}),e[24]=u):u=e[24];let T;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==d?(T=l&&l.length>0&&t.jsx(ce,{label:"Categories",items:l,selectedItems:n,onToggle:d,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=d,e[29]=T):T=e[29];let L;e[30]!==r||e[31]!==o||e[32]!==m||e[33]!==i?(L=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:m,onToggle:i,onClear:()=>o([])}),e[30]=r,e[31]=o,e[32]=m,e[33]=i,e[34]=L):L=e[34],e[35]!==L||e[36]!==T?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[u,T,L]}),e[35]=L,e[36]=T,e[37]=h):h=e[37],N="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==n||e[39]!==d?(F=K=>{const _=n.includes(K.value);return t.jsxs("div",{onClick:()=>d(K.value),className:ie("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",_?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:K.value}),_&&t.jsx("span",{onClick:E=>{E.stopPropagation(),d(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},K.value)},e[38]=n,e[39]=d,e[40]=F):F=e[40],P=y.map(F),e[9]=l,e[10]=r,e[11]=c,e[12]=o,e[13]=n,e[14]=m,e[15]=d,e[16]=i,e[17]=R,e[18]=b,e[19]=N,e[20]=P,e[21]=z,e[22]=h,e[23]=C}else R=e[17],b=e[18],N=e[19],P=e[20],z=e[21],h=e[22],C=e[23];let $;if(e[41]!==R||e[42]!==d||e[43]!==C){let y;e[45]!==C?(y=T=>!C.has(T),e[45]=C,e[46]=y):y=e[46];let u;e[47]!==d?(u=T=>t.jsxs("div",{onClick:()=>d(T),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:T}),t.jsx("span",{onClick:L=>{L.stopPropagation(),d(T)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`cat-${T}`),e[47]=d,e[48]=u):u=e[48],$=R.filter(y).map(u),e[41]=R,e[42]=d,e[43]=C,e[44]=$}else $=e[44];let v;if(e[49]!==b||e[50]!==i){let y;e[52]!==i?(y=u=>t.jsxs("div",{onClick:()=>i(u),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:u}),t.jsx("span",{onClick:T=>{T.stopPropagation(),i(u)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`tag-${u}`),e[52]=i,e[53]=y):y=e[53],v=b.map(y),e[49]=b,e[50]=i,e[51]=v}else v=e[51];let k;e[54]!==S||e[55]!==g?(k=g&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:S,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(te,{size:14}),"Clear all"]}),e[54]=S,e[55]=g,e[56]=k):k=e[56];let w;e[57]!==k||e[58]!==N||e[59]!==P||e[60]!==$||e[61]!==v?(w=t.jsxs("div",{className:N,children:[P,$,v,k]}),e[57]=k,e[58]=N,e[59]=P,e[60]=$,e[61]=v,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==z||e[65]!==h?(x=t.jsxs("div",{className:z,children:[h,w]}),e[63]=w,e[64]=z,e[65]=h,e[66]=x):x=e[66],x}function ot(s){return s.value}function it(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=Q.c(55),{registryId:r,listToolName:l,filtersToolName:m,storePrivateOnly:n}=s,[o,c]=U.useState(""),a=Ze(o,300),g=me(),{org:I}=re(),{scrollRef:i,saveScrollPosition:p,handleScroll:d}=Xe(`store-discovery:${r}`);let j;e[0]!==a||e[1]!==m||e[2]!==l||e[3]!==r?(j={registryId:r,listToolName:l,filtersToolName:m,search:a},e[0]=a,e[1]=m,e[2]=l,e[3]=r,e[4]=j):j=e[4];const{items:S,hasMore:R,isLoadingMore:b,isInitialLoading:N,isFetching:P,error:z,loadMore:h,availableTags:C,availableCategories:$,selectedTags:v,selectedCategories:k,setSelectedTags:w,setSelectedCategories:x,hasActiveFilters:y}=tt(j);let u,T,L,F;if(e[5]!==a||e[6]!==P||e[7]!==N||e[8]!==S||e[9]!==o||e[10]!==n){const O=o?it(S,o):S;F=n?O.filter(dt):O,u=(o!==a||P)&&!N&&!!o,L=F.filter(at),T=F.filter(M=>!L.find(q=>q.id===M.id)),e[5]=a,e[6]=P,e[7]=N,e[8]=S,e[9]=o,e[10]=n,e[11]=u,e[12]=T,e[13]=L,e[14]=F}else u=e[11],T=e[12],L=e[13],F=e[14];const K=T;let _;e[15]!==g||e[16]!==I.slug||e[17]!==r||e[18]!==p?(_=O=>{p();const M=Ge(O.name||O.title||O.server?.title||""),q=typeof O.id=="string"&&O.id.includes("/"),J=typeof O.server?.name=="string"&&O.server.name.includes("/"),f=q&&!J?O.id:O.server?.name||O.id||"";g({to:"/$org/$project/store/$appName",params:{org:I.slug,project:de,appName:M},search:{registryId:r,serverName:f}})},e[15]=g,e[16]=I.slug,e[17]=r,e[18]=p,e[19]=_):_=e[19];const E=_;let G;e[20]!==d||e[21]!==R||e[22]!==b||e[23]!==h?(G=O=>{if(d(),!R||b)return;const M=O.currentTarget;M.scrollHeight-M.scrollTop-M.clientHeight<200&&h()},e[20]=d,e[21]=R,e[22]=b,e[23]=h,e[24]=G):G=e[24];const H=G;let W;e[25]!==u||e[26]!==o?(W=t.jsx(We,{value:o,onChange:c,placeholder:"Search for an MCP Server...",isSearching:u}),e[25]=u,e[26]=o,e[27]=W):W=e[27];let D;e[28]!==$||e[29]!==C||e[30]!==k||e[31]!==v||e[32]!==x||e[33]!==w?(D=t.jsx(nt,{availableTags:C,availableCategories:$,selectedTags:v,selectedCategories:k,onTagChange:w,onCategoryChange:x}),e[28]=$,e[29]=C,e[30]=k,e[31]=v,e[32]=x,e[33]=w,e[34]=D):D=e[34];let B;e[35]!==K||e[36]!==z||e[37]!==E||e[38]!==y||e[39]!==R||e[40]!==N||e[41]!==b||e[42]!==u||e[43]!==o||e[44]!==L||e[45]!==F?(B=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:z&&!N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),z.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:z.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:mt,children:[t.jsx(ge,{className:"size-4"}),"Try again"]})]}):N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):F.length===0&&!y?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):F.length===0&&y&&!o?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(fe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):o&&F.length===0&&!u?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[u&&F.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),L.length>0&&t.jsx(ae,{items:L,title:"Verified",onItemClick:E}),K.length>0&&t.jsx(ae,{items:K,title:L.length>0?"All":"",onItemClick:E}),R&&b&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(se,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[35]=K,e[36]=z,e[37]=E,e[38]=y,e[39]=R,e[40]=N,e[41]=b,e[42]=u,e[43]=o,e[44]=L,e[45]=F,e[46]=B):B=e[46];let A;e[47]!==H||e[48]!==i||e[49]!==B?(A=t.jsx("div",{ref:i,className:"flex-1 overflow-y-auto",onScroll:H,children:B}),e[47]=H,e[48]=i,e[49]=B,e[50]=A):A=e[50];let V;return e[51]!==W||e[52]!==D||e[53]!==A?(V=t.jsxs("div",{className:"flex flex-col h-full",children:[W,D,A]}),e[51]=W,e[52]=D,e[53]=A,e[54]=V):V=e[54],V}function mt(){return window.location.reload()}function dt(s){return s.is_public!==!0}function ut(s){const e=Q.c(11),{registryId:r,storePrivateOnly:l}=s,m=Be(r),n=m?.tools;let o;e[0]!==n?(o=Ee(n),e[0]=n,e[1]=o):o=e[1];const c=o;if(!c){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(xe,{className:"size-8 text-muted-foreground"})}),e[2]=d):d=e[2];let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[d,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=j):j=e[3],j}const a=m?.tools;let g;e[4]!==a?(g=Oe(a),e[4]=a,e[5]=g):g=e[5];const i=g||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==i?(p=t.jsx(ct,{registryId:r,listToolName:c,filtersToolName:i,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=i,e[10]=p):p=e[10],p}function ft(s){const e=Q.c(43),{registries:r,value:l,onValueChange:m,onAddWellKnown:n,wellKnownRegistries:o,placeholder:c}=s,a=c===void 0?"Select a registry...":c,[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N;if(e[0]!==g||e[1]!==a||e[2]!==r||e[3]!==l){let w;e[12]!==l?(w=y=>y.id===l,e[12]=l,e[13]=w):w=e[13];const x=r.find(w);p=ve,b=g,N=I,i=be,R=!0,d="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(j=ie("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=j):j=e[14],S=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:a}),e[0]=g,e[1]=a,e[2]=r,e[3]=l,e[4]=i,e[5]=p,e[6]=d,e[7]=j,e[8]=S,e[9]=R,e[10]=b,e[11]=N}else i=e[4],p=e[5],d=e[6],j=e[7],S=e[8],R=e[9],b=e[10],N=e[11];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=P):P=e[15];let z;e[16]!==d||e[17]!==j||e[18]!==S?(z=t.jsxs("button",{type:d,className:j,children:[S,P]}),e[16]=d,e[17]=j,e[18]=S,e[19]=z):z=e[19];let h;e[20]!==i||e[21]!==R||e[22]!==z?(h=t.jsx(i,{asChild:R,children:z}),e[20]=i,e[21]=R,e[22]=z,e[23]=h):h=e[23];let C;if(e[24]!==m||e[25]!==r||e[26]!==l){let w;e[28]!==m||e[29]!==l?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{m(x.id??x.name),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),l===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=m,e[29]=l,e[30]=w):w=e[30],C=r.map(w),e[24]=m,e[25]=r,e[26]=l,e[27]=C}else C=e[27];let $;e[31]!==n||e[32]!==o?($=o.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(w=>t.jsxs("button",{type:"button",onClick:()=>{n(w),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(Ue,{size:16})})]},w.id??w.title))]}),e[31]=n,e[32]=o,e[33]=$):$=e[33];let v;e[34]!==C||e[35]!==$?(v=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[C,$]}),e[34]=C,e[35]=$,e[36]=v):v=e[36];let k;return e[37]!==p||e[38]!==h||e[39]!==v||e[40]!==b||e[41]!==N?(k=t.jsxs(p,{open:b,onOpenChange:N,children:[h,v]}),e[37]=p,e[38]=h,e[39]=v,e[40]=b,e[41]=N,e[42]=k):k=e[42],k}function xt({registries:s,onConnected:e}){const r=ye(),{org:{slug:l}}=re(),{data:m}=Ie.useSession(),n=me(),[o,c]=U.useState(!1),a=s[0],g=async()=>{if(!(!a||!m?.user?.id)){c(!0);try{const i=await r.create.mutateAsync(a);e?.(i.id)}finally{c(!1)}}},I=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:de},search:{action:"create"}})};return t.jsx(Ve,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:g,disabled:o||!a,children:[a?.icon&&t.jsx("img",{src:a.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:I,children:"Custom Connection"})]})})}function gt(s){const e=Q.c(15),{error:r,onRetry:l,registryName:m}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=o):o=e[1];let c;e[2]!==m?(c=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:m})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=m,e[3]=c):c=e[3];let a;e[4]!==r?(a=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=a):a=e[5];let g;e[6]!==c||e[7]!==a?(g=t.jsxs("div",{className:"space-y-2",children:[o,c,a]}),e[6]=c,e[7]=a,e[8]=g):g=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ge,{className:"size-4"}),e[9]=I):I=e[9];let i;e[10]!==l?(i=t.jsxs(Y,{variant:"outline",size:"sm",onClick:l,children:[I,"Try again"]}),e[10]=l,e[11]=i):i=e[11];let p;return e[12]!==g||e[13]!==i?(p=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,g,i]}),e[12]=g,e[13]=i,e[14]=p):p=e[14],p}function ns(){const s=Q.c(49),{org:e,project:r}=re(),l=De(),m=ye(),n=Te(),o=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=He(l);let a;s[0]!==e.id?(a=Ke.SELF(e.id),s[0]=e.id,s[1]=a):a=s[1];const g=a,I=r.enabledPlugins,i=I==null||I.includes(ne),p=c.filter(f=>f.id!==g?!0:i);let d;s[2]!==g?(d=f=>f.id===g,s[2]=g,s[3]=d):d=s[3];const j=p.some(d);let S;s[4]!==e.id?(S={connectionId:_e,orgId:e.id},s[4]=e.id,s[5]=S):S=s[5];const R=je(S);let b;s[6]!==r.id||s[7]!==R?(b=async()=>{const f=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ne}});return f.structuredContent??f},s[6]=r.id,s[7]=R,s[8]=b):b=s[8];const{data:N}=he({queryKey:oe.projectPluginConfig(r.id??"",ne),queryFn:b,enabled:j&&!!r.id,staleTime:6e4}),P=N?.config?.settings;let z;s[9]!==P||s[10]!==g?(z=f=>f.id===g&&P?{id:f.id,name:P.registryName||f.title,icon:P.registryIcon||f.icon||void 0}:{id:f.id,name:f.title,icon:f.icon||void 0},s[9]=P,s[10]=g,s[11]=z):z=s[11];const h=p.map(z);let C;s[12]!==e.slug?(C=Je.selectedRegistry(e.slug),s[12]=e.slug,s[13]=C):C=s[13];const[$,v]=Qe(C,ht);let k;s[14]!==$?(k=f=>f.id===$,s[14]=$,s[15]=k):k=s[15];const x=p.find(k)?.id||p[0]?.id||"",y=x===g&&P?.storePrivateOnly===!0;let u;s[16]!==e.id?(u=Ae(e.id),s[16]=e.id,s[17]=u):u=s[17];let T;s[18]!==u?(T=[u],s[18]=u,s[19]=T):T=s[19];const L=T;let F;s[20]===Symbol.for("react.memo_cache_sentinel")?(F=[Me()],s[20]=F):F=s[20];const K=F;let _;s[21]!==m.create||s[22]!==v?(_=async f=>{const Z=await m.create.mutateAsync(f);v(Z.id)},s[21]=m.create,s[22]=v,s[23]=_):_=s[23];const E=_,G=new Set(p.map(pt)),H=L.filter(f=>f.id&&!G.has(f.id)),W=K.filter(f=>f.id&&!G.has(f.id));if(o){let f;return s[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Re,{}),s[24]=f):f=s[24],f}let D;s[25]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X.Header.Left,{children:t.jsx(Pe,{children:t.jsx(ze,{children:t.jsx($e,{children:t.jsx(ke,{children:"Store"})})})})}),s[25]=D):D=s[25];let B;s[26]!==E?(B=async f=>E(f),s[26]=E,s[27]=B):B=s[27];let A;s[28]!==H||s[29]!==x||s[30]!==h||s[31]!==v||s[32]!==B?(A=t.jsxs(X.Header,{children:[D,t.jsx(X.Header.Right,{children:t.jsx(ft,{wellKnownRegistries:H,registries:h,value:x,onValueChange:v,onAddWellKnown:B,placeholder:"Select store..."})})]}),s[28]=H,s[29]=x,s[30]=h,s[31]=v,s[32]=B,s[33]=A):A=s[33];let V;s[34]!==x||s[35]!==h?(V=f=>{const{error:Z,resetError:le}=f;return t.jsx(gt,{error:Z,onRetry:le,registryName:h.find(ee=>ee.id===x)?.name??"registry"})},s[34]=x,s[35]=h,s[36]=V):V=s[36];let O;s[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=O):O=s[37];let M;s[38]!==W||s[39]!==x||s[40]!==v||s[41]!==y?(M=t.jsx(U.Suspense,{fallback:O,children:x?t.jsx(ut,{registryId:x,storePrivateOnly:y}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(xt,{registries:W,onConnected:f=>{v(f)}})})}),s[38]=W,s[39]=x,s[40]=v,s[41]=y,s[42]=M):M=s[42];let q;s[43]!==V||s[44]!==M?(q=t.jsx(X.Content,{children:t.jsx(Ye,{fallback:V,children:M})}),s[43]=V,s[44]=M,s[45]=q):q=s[45];let J;return s[46]!==A||s[47]!==q?(J=t.jsxs(X,{children:[A,q]}),s[46]=A,s[47]=q,s[48]=J):J=s[48],J}function pt(s){return s.id}function ht(s){return s??""}export{ns as default};
@@ -1 +1 @@
1
- import{c as n,j as t,H as o}from"./index-CEFIvFnf.js";function c(){const s=n.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(o,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
1
+ import{c as n,j as t,H as o}from"./index-DrrqKIxq.js";function c(){const s=n.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(o,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
@@ -1 +1 @@
1
- import{c as s,j as t}from"./index-CEFIvFnf.js";import{e as r}from"./Dataflow03-C__zTPE5.js";function a(){const o=s.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(r,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),o[0]=e):e=o[0],e}export{a as default};
1
+ import{c as s,j as t}from"./index-DrrqKIxq.js";import{e as r}from"./Dataflow03-DVn12h_U.js";function a(){const o=s.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(r,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),o[0]=e):e=o[0],e}export{a as default};
@@ -1 +1 @@
1
- import{c as S,j as s,r as w}from"./index-CEFIvFnf.js";import{i as R}from"./Check-DYZ8kvzv.js";import{t as _}from"./ChevronDown-DugvEHIv.js";import{e as y}from"./Dataflow03-C__zTPE5.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:r,onConnectionChange:N}=x,[n,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==r){let t;e[3]!==r?(t=u=>u.id===r,e[3]=r,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=r,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==n?(o=()=>z(!n),e[13]=n,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==n||e[26]!==N||e[27]!==r?(m=n&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===r&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=n,e[26]=N,e[27]=r,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function H(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{H as default};
1
+ import{c as S,j as s,r as w}from"./index-DrrqKIxq.js";import{i as R}from"./Check-CwhCIsIx.js";import{t as _}from"./ChevronDown-DHYql12c.js";import{e as y}from"./Dataflow03-DVn12h_U.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:r,onConnectionChange:N}=x,[n,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==r){let t;e[3]!==r?(t=u=>u.id===r,e[3]=r,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=r,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==n?(o=()=>z(!n),e[13]=n,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==n||e[26]!==N||e[27]!==r?(m=n&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===r&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=n,e[26]=N,e[27]=r,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function H(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{H as default};
@@ -1 +1 @@
1
- import{c as w,j as s,r as S,H as y}from"./index-CEFIvFnf.js";import{i as _}from"./Check-DYZ8kvzv.js";import{t as k}from"./ChevronDown-DugvEHIv.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function I(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{I as default};
1
+ import{c as w,j as s,r as S,H as y}from"./index-DrrqKIxq.js";import{i as _}from"./Check-CwhCIsIx.js";import{t as k}from"./ChevronDown-DHYql12c.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function I(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{I as default};
@@ -1 +1 @@
1
- import{r as i,ap as $,j as c,aG as L,al as G,as as A,ar as _,au as P,aH as w,aw as j,aI as H,aJ as E,aK as z,aL as K,ax as J,aM as Q,aN as U,aO as V,aP as W,aQ as Z,aR as q,c as R}from"./index-CEFIvFnf.js";import{c as B}from"./button-COjpHvkK.js";var m="Popover",[b]=J(m,[E]),g=E(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=g(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=g(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=g(o),s=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:s,onClick:P(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),M=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};M.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(j,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=Q("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return z(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(I,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(I,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),I=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=g(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":k(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:P(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=g(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=se;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=M,ue=D;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{Pe as P,ge as a,ve as b};
1
+ import{r as i,ap as $,j as c,aG as L,al as G,as as A,ar as _,au as P,aH as w,aw as j,aI as H,aJ as E,aK as z,aL as K,ax as J,aM as Q,aN as U,aO as V,aP as W,aQ as Z,aR as q,c as R}from"./index-DrrqKIxq.js";import{c as B}from"./button-CZPRmDPf.js";var m="Popover",[b]=J(m,[E]),g=E(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=g(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=g(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=g(o),s=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:s,onClick:P(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),M=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};M.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(j,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=Q("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return z(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(I,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(I,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),I=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=g(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":k(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:P(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=g(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=se;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=M,ue=D;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{Pe as P,ge as a,ve as b};
@@ -0,0 +1 @@
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};
@@ -1 +1 @@
1
- import{b4 as U,c as O,u as H,j as s,aE as G,r as I,b as M,O as V}from"./index-CEFIvFnf.js";import{u as q}from"./use-project-Cpu_jAWh.js";import{P as E}from"./index-DqBwvK0E.js";import{E as R,C as F}from"./empty-state-CWevsb-G.js";import{A as J}from"./avatar-De3rgEZe.js";import{c as K,B as T}from"./button-COjpHvkK.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as W}from"./create-project-dialog-pcTtT4gK.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-DA-aLp2Z.js";import"./useQuery-DMUhrQv9.js";import"./constants-D-wlluJ1.js";import"./use-mobile-DZvuCyAg.js";import"./tooltip-WTQ1Sf9I.js";import"./Loading01-DVlzuDXC.js";import"./SearchMd-qPELZ8ba.js";import"./input-UPbtT6D5.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-CRJhwh4V.js";import"./dialog-DbMPbzlh.js";import"./form-ek51qwAH.js";import"./label-OGiRqcEX.js";import"./textarea-BzrbRDMZ.js";import"./Check-DYZ8kvzv.js";import"./ChevronRight-B5elpXGa.js";const te=U("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let D;return e[55]!==A||e[56]!==u?(D=s.jsx(G,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=D):D=e[57],D}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function $e(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=M();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=E;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(E.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(E.Header,{children:[w,s.jsx(E.Header.Right,{children:s.jsx(T,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=E.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(T,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==V}export{$e as default};
1
+ import{b4 as U,c as O,u as H,j as s,aE as G,r as I,b as M,O as V}from"./index-DrrqKIxq.js";import{u as q}from"./use-project-BLgGy5mK.js";import{P as E}from"./index-BzbwskdO.js";import{E as R,C as F}from"./empty-state-C_g2tsPC.js";import{A as J}from"./avatar-DlH0tlJW.js";import{c as K,B as T}from"./button-CZPRmDPf.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as W}from"./create-project-dialog-CICUNrHC.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-rKBAWCrS.js";import"./useQuery-DcU1ldNG.js";import"./constants-C2M7RsNt.js";import"./use-mobile-Cyo_7CU1.js";import"./tooltip-Di7lOmib.js";import"./Loading01-Bl1Pk_oo.js";import"./SearchMd-CmV0Tepn.js";import"./input-C2aMc-tK.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-byIh8vPM.js";import"./dialog-DGoua-F-.js";import"./form-CFbWoYe6.js";import"./label-CoS6RHW3.js";import"./textarea-bPVDAJiU.js";import"./Check-CwhCIsIx.js";import"./ChevronRight-qRilEtY5.js";const te=U("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let D;return e[55]!==A||e[56]!==u?(D=s.jsx(G,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=D):D=e[57],D}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function $e(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=M();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=E;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(E.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(E.Header,{children:[w,s.jsx(E.Header.Right,{children:s.jsx(T,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=E.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(T,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==V}export{$e as default};