decocms 2.158.0 → 2.158.2

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 (201) hide show
  1. package/dist/client/assets/{AlertCircle-DsQlVvig.js → AlertCircle-BVzUbFpn.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-Cvo6EEA1.js → AlignLeft-C6EBYnL8.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-KTP4HONB.js → ArrowDown-BbVCdIIL.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CR3SWku2.js → ArrowLeft-G2GpUvfS.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BfaawFDM.js → ArrowUp-JndBjwJL.js} +1 -1
  6. package/dist/client/assets/{Check-OSWZCZf9.js → Check-q1dqks2U.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-B2wkNkz_.js → CheckCircle-DAQqu9C_.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-j6DaSyTU.js → CheckDone01-B7ahPP7j.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-D6qy17me.js → CheckVerified02-CZ912ESL.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-BR4cCk-W.js → ChevronDown-cViiGxn9.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-D4Ua6sXw.js → ChevronLeft-Cl-I3Mb5.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-ByOuE_Vi.js → ChevronRight-D7UsQHH3.js} +1 -1
  13. package/dist/client/assets/{Clock-BEpmd0mM.js → Clock-uUYVZnmE.js} +1 -1
  14. package/dist/client/assets/{Code01-BsBlwdG0.js → Code01-EB8m5diA.js} +1 -1
  15. package/dist/client/assets/{Container-BVSlDn4p.js → Container-BnukWtxV.js} +1 -1
  16. package/dist/client/assets/{Copy01-B595Thpy.js → Copy01-DIuxFCYv.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-DW4Gd5sB.js → Dataflow03-CSrRmRdp.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-0eyRqScK.js → DotsHorizontal-C5wq0CTn.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-Cshw63SI.js → DotsVertical-DxhWxx-U.js} +1 -1
  20. package/dist/client/assets/{Download01-DFmX-SGA.js → Download01-RW_lAP8U.js} +1 -1
  21. package/dist/client/assets/{Edit01-BzJXGmI-.js → Edit01-C0vDTgcf.js} +1 -1
  22. package/dist/client/assets/{Edit05-BKDqgNc4.js → Edit05-BbXNdh53.js} +1 -1
  23. package/dist/client/assets/{Eye-CHYeRDXI.js → Eye-BY6V0QO1.js} +1 -1
  24. package/dist/client/assets/{File02-ZK3-99s4.js → File02-mE2VQadh.js} +1 -1
  25. package/dist/client/assets/{File06-B7IZdrgj.js → File06-BAK1qMG7.js} +1 -1
  26. package/dist/client/assets/{FilterLines-pJtef_Pv.js → FilterLines-D7KpfRSU.js} +1 -1
  27. package/dist/client/assets/{Globe01-p5f8j_mm.js → Globe01-yz8Ugxya.js} +1 -1
  28. package/dist/client/assets/{Globe02-D7s1ULQJ.js → Globe02-7C9FcKVE.js} +1 -1
  29. package/dist/client/assets/{Grid01-DIGu5eh8.js → Grid01-BOCowW7O.js} +1 -1
  30. package/dist/client/assets/{Hash02-CkWXLlvG.js → Hash02-B4FAvj_q.js} +1 -1
  31. package/dist/client/assets/{Home02-DiSPSdMx.js → Home02-DVchDjYK.js} +1 -1
  32. package/dist/client/assets/{Image01-4wUrHqw6.js → Image01-CQ8GcYUR.js} +1 -1
  33. package/dist/client/assets/{Inbox01-csEiEq63.js → Inbox01-DI6dcB2-.js} +1 -1
  34. package/dist/client/assets/{InfoCircle-s0XyUQYC.js → InfoCircle-BLcCSQhh.js} +1 -1
  35. package/dist/client/assets/{Key01-BP2mhRrj.js → Key01-DZIfBgYr.js} +1 -1
  36. package/dist/client/assets/{LayersTwo01-C4CgBsBK.js → LayersTwo01-D5xVmKNM.js} +1 -1
  37. package/dist/client/assets/{LayoutLeft-DzzE993C.js → LayoutLeft-BPUqmi0D.js} +1 -1
  38. package/dist/client/assets/{Link01-CHaReCKl.js → Link01-BSeN3LgC.js} +1 -1
  39. package/dist/client/assets/{LinkExternal01-Cj5yLC8K.js → LinkExternal01-Rv_hEkme.js} +1 -1
  40. package/dist/client/assets/{List-BnvhY7Nh.js → List-Bf-7f4Yc.js} +1 -1
  41. package/dist/client/assets/{Loading01-aMp99RZI.js → Loading01-1unV3no7.js} +1 -1
  42. package/dist/client/assets/{Lock01-STjQUMU6.js → Lock01-XSJRlK5x.js} +1 -1
  43. package/dist/client/assets/{Play-Dr8AlTmi.js → Play-Bae0FSDA.js} +1 -1
  44. package/dist/client/assets/{Plus-Dp8Rr75G.js → Plus-DRukDy12.js} +1 -1
  45. package/dist/client/assets/{RefreshCcw01-DDGad8lb.js → RefreshCcw01-D1XgqmbV.js} +1 -1
  46. package/dist/client/assets/{Save01-36pjbcKA.js → Save01-Ba2I-ry6.js} +1 -1
  47. package/dist/client/assets/{SearchMd-r7i5BQk7.js → SearchMd-DQrPJQV9.js} +1 -1
  48. package/dist/client/assets/{Settings01-DKTz1YSf.js → Settings01-C-jo0YyN.js} +1 -1
  49. package/dist/client/assets/{Shield01-J7QygUij.js → Shield01-D-svmdvB.js} +1 -1
  50. package/dist/client/assets/{Terminal-CtjH6zFY.js → Terminal-D0OfGCn6.js} +1 -1
  51. package/dist/client/assets/{Trash01-DJTe1fKw.js → Trash01-DO5SV3mV.js} +1 -1
  52. package/dist/client/assets/{Upload01-BEhQSPeB.js → Upload01-2a8eC1w5.js} +1 -1
  53. package/dist/client/assets/{Users03-CG_islph.js → Users03-D0FREVnP.js} +1 -1
  54. package/dist/client/assets/{X-DjDetE_c.js → X-CK2TCShL.js} +1 -1
  55. package/dist/client/assets/{XCircle-CSLSI6pa.js → XCircle-0CM-aUam.js} +1 -1
  56. package/dist/client/assets/{XClose-dSJ6zVxj.js → XClose-C1VIP6EM.js} +1 -1
  57. package/dist/client/assets/{Zap-BdJ17pmL.js → Zap-DmFOqnT1.js} +1 -1
  58. package/dist/client/assets/{agent-connections-preview-DB81vdUX.js → agent-connections-preview-BAdFzhUY.js} +1 -1
  59. package/dist/client/assets/{agent-detail-BAru2zv4.js → agent-detail-BlWN1elN.js} +1 -1
  60. package/dist/client/assets/{agents-DTLxCfRX.js → agents-DTTSh7i4.js} +1 -1
  61. package/dist/client/assets/{alert-dialog-Bbrwo05x.js → alert-dialog-BpAl1CV2.js} +1 -1
  62. package/dist/client/assets/{auth-catchall-BETKUynS.js → auth-catchall-CdYMLH0m.js} +1 -1
  63. package/dist/client/assets/{avatar-D94UEcg7.js → avatar-R3EZmhcg.js} +1 -1
  64. package/dist/client/assets/{badge-DxYG_XB9.js → badge-Bgf3f5yM.js} +1 -1
  65. package/dist/client/assets/{binder-wDmRPNL2.js → binder-D6CqvsA8.js} +1 -1
  66. package/dist/client/assets/{breadcrumb-BrsAPde7.js → breadcrumb-HFSeCoIU.js} +1 -1
  67. package/dist/client/assets/{card-CkYe6Ikt.js → card-CeKLZLLA.js} +1 -1
  68. package/dist/client/assets/{chart-DnUFHI2d.js → chart-6PxHbkHq.js} +1 -1
  69. package/dist/client/assets/{checkbox-DhgSL5Cz.js → checkbox-DiriJ1bL.js} +1 -1
  70. package/dist/client/assets/{circle-alert-CgP-qNn-.js → circle-alert-CunKhYPu.js} +1 -1
  71. package/dist/client/assets/{collapsible-DYgsVB3N.js → collapsible-viU10JM0.js} +1 -1
  72. package/dist/client/assets/{collection-detail-D5XIUYKg.js → collection-detail-DeNYFvSk.js} +1 -1
  73. package/dist/client/assets/{collection-display-button-DEx37m4V.js → collection-display-button-DEqK6xTT.js} +1 -1
  74. package/dist/client/assets/{collection-search-DXvW2iQG.js → collection-search-Cg477-ZE.js} +1 -1
  75. package/dist/client/assets/{collection-tab-CNXNROrc.js → collection-tab-_QON2VMK.js} +1 -1
  76. package/dist/client/assets/{collection-table-wrapper-xKuLiuQ5.js → collection-table-wrapper-BFNUM8s8.js} +1 -1
  77. package/dist/client/assets/{collection-tabs-BEqvkJum.js → collection-tabs-BQNMu9-v.js} +1 -1
  78. package/dist/client/assets/{command-wAVHsF2T.js → command-Du1jchMC.js} +1 -1
  79. package/dist/client/assets/{connect-yoERnUTv.js → connect-B6BALd_j.js} +1 -1
  80. package/dist/client/assets/{connection-card--y0YdfEA.js → connection-card-AwrPPwJU.js} +1 -1
  81. package/dist/client/assets/{connection-detail-1Ku6b0Wl.js → connection-detail-BgxEpm2N.js} +1 -1
  82. package/dist/client/assets/{connection-status-Cq0AmCwK.js → connection-status-B2kwe82w.js} +1 -1
  83. package/dist/client/assets/{connections-Cih6wM0L.js → connections-sNaEyT2l.js} +1 -1
  84. package/dist/client/assets/constants-BJwM9pw-.js +1 -0
  85. package/dist/client/assets/{constants-_xTq0aTt.js → constants-DMTOffGt.js} +1 -1
  86. package/dist/client/assets/{context-Bk-UzwLO.js → context-Cx8RVNtA.js} +1 -1
  87. package/dist/client/assets/{create-organization-dialog-D50lIYTQ.js → create-organization-dialog-D402PfvW.js} +1 -1
  88. package/dist/client/assets/{create-project-dialog-B3BGNP1R.js → create-project-dialog-Caslq4es.js} +1 -1
  89. package/dist/client/assets/{danger-DuT5kBaU.js → danger-CU9K1Lxe.js} +1 -1
  90. package/dist/client/assets/{danger-zone-Cjq5A9rY.js → danger-zone-M1bpTpYc.js} +1 -1
  91. package/dist/client/assets/{decopilot-events-BrbCILIn.js → decopilot-events-DWI9oooP.js} +1 -1
  92. package/dist/client/assets/{dependencies-BXhkBUyi.js → dependencies-BoutRVFB.js} +1 -1
  93. package/dist/client/assets/{dialog-B-Kp8Cuq.js → dialog-CcebbiBo.js} +1 -1
  94. package/dist/client/assets/{dropdown-menu-DjhC4m2a.js → dropdown-menu-CXrh9ioK.js} +1 -1
  95. package/dist/client/assets/{dynamic-plugin-layout-DRpqAaco.js → dynamic-plugin-layout-D2OWQZ3_.js} +1 -1
  96. package/dist/client/assets/{editable-task-title-CWlhOc5Q.js → editable-task-title-COV97EVU.js} +1 -1
  97. package/dist/client/assets/{empty-state-680W7nUY.js → empty-state-DsHolTNX.js} +1 -1
  98. package/dist/client/assets/{env-vars-editor-BRxwCr-L.js → env-vars-editor-BrHnxudF.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-DUglufvW.js → extract-connection-data-BEvScFbw.js} +1 -1
  100. package/dist/client/assets/{file-browser-BLB4FkOU.js → file-browser-CuyBxdvO.js} +2 -2
  101. package/dist/client/assets/{form-DK8WrQI3.js → form-CHPvar9M.js} +1 -1
  102. package/dist/client/assets/{general-DonW35nE.js → general-Cbq5hDRf.js} +1 -1
  103. package/dist/client/assets/{grid-view-CqJSMZVQ.js → grid-view-CaeVfax4.js} +1 -1
  104. package/dist/client/assets/{home-DIVCSvrl.js → home-onyTH5vb.js} +1 -1
  105. package/dist/client/assets/{icon-picker-DvkCVh_W.js → icon-picker-5u9dfSxr.js} +1 -1
  106. package/dist/client/assets/{index-D9XxJ5Op.js → index-BLT0BC6X.js} +1 -1
  107. package/dist/client/assets/{index-DA_JOtb0.js → index-BgG2zeek.js} +1 -1
  108. package/dist/client/assets/{index-SKwvOtlz.js → index-CcYCRia5.js} +1 -1
  109. package/dist/client/assets/{index-C8u6axf-.js → index-CrHCQ8Nf.js} +1 -1
  110. package/dist/client/assets/{index-BmSASrPR.js → index-CyPfQaAG.js} +1 -1
  111. package/dist/client/assets/{index-B84Dx7nI.js → index-D4JwUMfo.js} +3 -3
  112. package/dist/client/assets/{index-BGwf3l_M.js → index-DMdX3d7M.js} +1 -1
  113. package/dist/client/assets/{index-BPI27S5s.js → index-DSWhMirv.js} +1 -1
  114. package/dist/client/assets/{index-CmH5OQnm.js → index-DbJ64cDo.js} +1 -1
  115. package/dist/client/assets/{infiniteQueryObserver-DenS4T97.js → infiniteQueryObserver-DAdEAsRM.js} +1 -1
  116. package/dist/client/assets/{input-NIbTU7RU.js → input-BRH9Cf1s.js} +1 -1
  117. package/dist/client/assets/{integration-icon-DNJkhUIt.js → integration-icon-D2pk71z8.js} +1 -1
  118. package/dist/client/assets/{label-B6R7vHKQ.js → label-BhB8mtiL.js} +1 -1
  119. package/dist/client/assets/{layout-CECSvrhq.js → layout-CR4iGa7x.js} +1 -1
  120. package/dist/client/assets/{layout-CMdmqG4j.js → layout-DUbXIf2V.js} +1 -1
  121. package/dist/client/assets/{localstorage-keys-BckSA5cs.js → localstorage-keys-xw4Txgji.js} +1 -1
  122. package/dist/client/assets/{login-BfEg3qXN.js → login-DpLcnK8m.js} +1 -1
  123. package/dist/client/assets/{markdown-Cqv1T19z.js → markdown-Bew8FtWp.js} +1 -1
  124. package/dist/client/assets/{mcp-app-renderer-gG-wM7zZ.js → mcp-app-renderer-DXWDRIz1.js} +1 -1
  125. package/dist/client/assets/{mcp-server-card-M7WdUx8I.js → mcp-server-card-CGJI-JTC.js} +1 -1
  126. package/dist/client/assets/{mcp-server-detail-D73ue2Yz.js → mcp-server-detail-Du7Mkxw8.js} +2 -2
  127. package/dist/client/assets/{members-Buq9RcXv.js → members-aFtvvF7x.js} +1 -1
  128. package/dist/client/assets/{monaco-editor-BXv0Xqkq.js → monaco-editor-Bu_nzanD.js} +1 -1
  129. package/dist/client/assets/{monitoring-CEhjsxOM.js → monitoring-DUPAD86y.js} +1 -1
  130. package/dist/client/assets/{monitoring-dashboard-edit-BntH-KiR.js → monitoring-dashboard-edit-jvf2tclW.js} +1 -1
  131. package/dist/client/assets/{monitoring-dashboard-view-Bw3iwoxc.js → monitoring-dashboard-view-Cq38oJdA.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-D455SJn4.js → oauth-callback-D6_W5G9Z.js} +1 -1
  133. package/dist/client/assets/{page-DrITT5mj.js → page-BS9YQYaQ.js} +1 -1
  134. package/dist/client/assets/{page-C-6ciKw-.js → page-MwTkffcW.js} +1 -1
  135. package/dist/client/assets/{plugin-empty-state-BLzOpmuv.js → plugin-empty-state-CX1Iswsk.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-D73E0OXs.js → plugin-empty-state-K_WMVH5N.js} +1 -1
  137. package/dist/client/assets/{plugin-header-_N_-KJkN.js → plugin-header-BnUtjbuj.js} +1 -1
  138. package/dist/client/assets/{plugin-header-DkXBoQof.js → plugin-header-wHkJw6Ps.js} +1 -1
  139. package/dist/client/assets/plugins-B8bz_CxQ.js +1 -0
  140. package/dist/client/assets/{popover-D7xgfP4W.js → popover-BUt6i0bO.js} +1 -1
  141. package/dist/client/assets/{project-app-view-DWi5m8l8.js → project-app-view-Ddnzem3H.js} +1 -1
  142. package/dist/client/assets/{project-layout-CWEThOiP.js → project-layout-DWDar7ZB.js} +1 -1
  143. package/dist/client/assets/{project-plugins-BKPLJXFp.js → project-plugins-WC8H-cAg.js} +1 -1
  144. package/dist/client/assets/{projects-list-Y8k15POh.js → projects-list-C3_Rk2DF.js} +1 -1
  145. package/dist/client/assets/{readme-viewer-WWU4z7Xg.js → readme-viewer-Cl0fEGPs.js} +1 -1
  146. package/dist/client/assets/{registry-layout-D_LH6ewr.js → registry-layout-qsGwGj-s.js} +1 -1
  147. package/dist/client/assets/{registry-utils-CMqg9IHN.js → registry-utils-C_DP4Ynk.js} +1 -1
  148. package/dist/client/assets/{reports-layout-B3u5OkMC.js → reports-layout-G7dKXuEU.js} +1 -1
  149. package/dist/client/assets/{reset-password-Cm7BWULq.js → reset-password-CvmEg3aM.js} +1 -1
  150. package/dist/client/assets/{resizable-pH8vbRAI.js → resizable-D6AZXb64.js} +1 -1
  151. package/dist/client/assets/{save-actions-CTDUNaiW.js → save-actions-BdSxTuVy.js} +1 -1
  152. package/dist/client/assets/{scroll-area-DOWQyO2m.js → scroll-area-njeV-KTe.js} +1 -1
  153. package/dist/client/assets/{select-1y3LRFgk.js → select-DwZBzl3A.js} +1 -1
  154. package/dist/client/assets/{shell-layout-B6SbKq-6.js → shell-layout-DEmQ57ZH.js} +2 -2
  155. package/dist/client/assets/{sidebar-settings-BZx3Z8UA.js → sidebar-settings-CdNudIJY.js} +1 -1
  156. package/dist/client/assets/{skeleton-CMw17Qjd.js → skeleton-CbT1YKhD.js} +1 -1
  157. package/dist/client/assets/{spinner-DiXeE5Xk.js → spinner-DwdOzJhG.js} +1 -1
  158. package/dist/client/assets/{store-invite-BdRmGVAy.js → store-invite-DiA-EMIw.js} +1 -1
  159. package/dist/client/assets/{switch-BA80KxP2.js → switch-DZkrSmgJ.js} +1 -1
  160. package/dist/client/assets/{table-vuF1fVQ6.js → table-gCgflBYD.js} +1 -1
  161. package/dist/client/assets/{tabs-D3RTRDyW.js → tabs-D9mKN69N.js} +1 -1
  162. package/dist/client/assets/tasks-Ehdu-4cK.js +1 -0
  163. package/dist/client/assets/{tasks-panel-D3YXt5j8.js → tasks-panel-F1KlPjDk.js} +1 -1
  164. package/dist/client/assets/{textarea-BW2ziFqJ.js → textarea-Bdphv-Mj.js} +1 -1
  165. package/dist/client/assets/{time-range-picker-CZg_Yx1g.js → time-range-picker-CBcFD3JT.js} +1 -1
  166. package/dist/client/assets/{toggle-group-DO86EMeS.js → toggle-group-DbiUjc4d.js} +1 -1
  167. package/dist/client/assets/{tools-list-BzLGkrz5.js → tools-list-xYMva9v3.js} +1 -1
  168. package/dist/client/assets/{tooltip-CHJhCJL3.js → tooltip-BcimsULQ.js} +1 -1
  169. package/dist/client/assets/{topbar-portal-BomQ7YMR.js → topbar-portal-DecQv7ul.js} +1 -1
  170. package/dist/client/assets/{types-DibruoFW.js → types-DVrpg4Au.js} +1 -1
  171. package/dist/client/assets/{use-binding-Bdb-0lwc.js → use-binding-CZG6TNcT.js} +1 -1
  172. package/dist/client/assets/{use-collections-BoFyuDa6.js → use-collections-Bs1uQVQJ.js} +1 -1
  173. package/dist/client/assets/{use-connection-DSPQNIQD.js → use-connection-96ulKDkp.js} +1 -1
  174. package/dist/client/assets/{use-copy-Ba97e-kV.js → use-copy-CqEqSzSC.js} +1 -1
  175. package/dist/client/assets/{use-create-virtual-mcp-Cf71AE6l.js → use-create-virtual-mcp-LFxhmGpw.js} +1 -1
  176. package/dist/client/assets/{use-install-from-registry-B6NE77_0.js → use-install-from-registry-B8bxY6WO.js} +1 -1
  177. package/dist/client/assets/{use-list-state-kborONTL.js → use-list-state-C-V7Oz_V.js} +1 -1
  178. package/dist/client/assets/{use-llm-CKGJlXuC.js → use-llm-CmHgTlzz.js} +1 -1
  179. package/dist/client/assets/{use-mcp-prompts-C___IsDE.js → use-mcp-prompts-DDRMLpw3.js} +1 -1
  180. package/dist/client/assets/{use-mcp-tools-K2l5CqFr.js → use-mcp-tools-BvNLaNQe.js} +1 -1
  181. package/dist/client/assets/{use-members-DajocvHM.js → use-members-DrMgxhod.js} +1 -1
  182. package/dist/client/assets/{use-mobile-DznYZ63b.js → use-mobile-DoL_dqtN.js} +1 -1
  183. package/dist/client/assets/{use-preferences-BfaOwWT4.js → use-preferences-BrXnvkz-.js} +1 -1
  184. package/dist/client/assets/{use-project-DZlIfmd3.js → use-project-BFzyu71z.js} +1 -1
  185. package/dist/client/assets/{use-settings-modal-C2h2dbTq.js → use-settings-modal-BIGLZUPG.js} +1 -1
  186. package/dist/client/assets/{use-view-mode-3gfyljcZ.js → use-view-mode-BArlOdRG.js} +1 -1
  187. package/dist/client/assets/{use-virtual-mcp-5EdNqvyH.js → use-virtual-mcp-B9smgfPR.js} +1 -1
  188. package/dist/client/assets/useInfiniteQuery-BgV83YrM.js +1 -0
  189. package/dist/client/assets/{useMutation-Be5QSQym.js → useMutation-D-zwC1-P.js} +1 -1
  190. package/dist/client/assets/useQuery-D0xC6l4K.js +1 -0
  191. package/dist/client/assets/useSuspenseInfiniteQuery-8i63vxYn.js +1 -0
  192. package/dist/client/assets/{user-CY9QFLJr.js → user-BoAAEh6g.js} +1 -1
  193. package/dist/client/assets/{workflow-Db4yuI9S.js → workflow-DBN2RqP8.js} +1 -1
  194. package/dist/client/index.html +1 -1
  195. package/package.json +1 -1
  196. package/dist/client/assets/constants-BBAQxhFl.js +0 -1
  197. package/dist/client/assets/plugins-D4w2xHCL.js +0 -1
  198. package/dist/client/assets/tasks-C_CW4iPq.js +0 -1
  199. package/dist/client/assets/useInfiniteQuery-CFRJ66U9.js +0 -1
  200. package/dist/client/assets/useQuery-CIRdCYZz.js +0 -1
  201. package/dist/client/assets/useSuspenseInfiniteQuery-CQgxvKZn.js +0 -1
@@ -1 +1 @@
1
- import{r as _,j as n,z as J,B as G,u as V,w as W,x as K,K as q,bc as D,be as $,c as Q}from"./index-B84Dx7nI.js";import{u as Y}from"./useQuery-CIRdCYZz.js";import{u as H}from"./useMutation-Be5QSQym.js";import{u as X,a as Z}from"./constants-_xTq0aTt.js";import{S as ee}from"./switch-BA80KxP2.js";import{L as te}from"./label-B6R7vHKQ.js";import{n as ne}from"./Container-BVSlDn4p.js";import{b as se}from"./use-connection-DSPQNIQD.js";import{a as ie,c as re}from"./use-binding-Bdb-0lwc.js";import{u as oe}from"./use-install-from-registry-B6NE77_0.js";import{i as le}from"./Loading01-aMp99RZI.js";import{s as ae}from"./Plus-Dp8Rr75G.js";import{S as ce,a as de,b as ue,c as me,d as M}from"./select-1y3LRFgk.js";function ge({value:o,onValueChange:e,placeholder:r="Select a connection...",binding:l,bindingType:a,onAddNew:y,className:x,disabled:h=!1}){const[j,d]=_.useState(!1),{installByBinding:N,isInstalling:S}=oe(),b=j||S,u=se(),w=ie({connections:u,binding:typeof l=="string"?l:void 0}),C=!l||!u?u??[]:typeof l=="string"?w:Array.isArray(l)&&l.length>0?u.filter(t=>re(t,l)):u,m=(()=>{if(!a?.startsWith("@"))return null;const[t,s]=a.replace("@","").split("/");return t&&s?{scope:t,appName:s}:null})(),P=(()=>{let t=C;const s=Array.isArray(l)&&l.length>0;if(m&&!s&&(t=t.filter(i=>{const c=i.app_name,p=i.metadata?.scopeName;return c===m.appName&&p===m.scope})),o&&!t.some(i=>i.id===o)){const i=u?.find(c=>c.id===o);if(i)return[i,...t]}return t})(),v=a?.startsWith("@"),A=async()=>{if(v&&a){d(!0);try{const t=await N(a);t&&e(t.id)}finally{d(!1)}return}y?.()},g=P.find(t=>t.id===o);return n.jsxs(ce,{value:o??"none",onValueChange:t=>e(t==="none"?null:t),disabled:h,children:[n.jsx(de,{size:"sm",className:J("w-[200px]",x),children:n.jsx(ue,{placeholder:r,children:g?n.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?n.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded shrink-0"}):n.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:g.title.slice(0,1).toUpperCase()}),n.jsx("span",{className:"truncate",children:g.title})]}):r})}),n.jsxs(me,{children:[n.jsx(M,{value:"none",children:"No connection"}),P.length===0?n.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(t=>n.jsx(M,{value:t.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?n.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):n.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:t.title.slice(0,1).toUpperCase()}),n.jsx("span",{children:t.title})]})},t.id)),(y||v)&&n.jsx("div",{className:"border-t border-border",children:n.jsx(G,{onPointerDown:t=>t.stopPropagation(),onClick:t=>{t.preventDefault(),t.stopPropagation(),A()},disabled:b||h,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:b?n.jsxs(n.Fragment,{children:[n.jsx(le,{size:16,className:"animate-spin"}),n.jsx("span",{children:"Connecting..."})]}):n.jsxs(n.Fragment,{children:[n.jsx(ae,{size:16}),n.jsx("span",{children:"Add Connection"})]})})})]})]})}const pe=o=>{if(!o||typeof o!="object")return!1;const e=o;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},z=o=>{const e=o.structuredContent??o,r=e&&typeof e=="object"?e:null,l=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(l??"Tool call failed");if(pe(e))throw new Error(e.text);return e};function fe(o){return o.requiresMcpBinding===!0?!0:o.binding!==void 0}function xe(o){const e=Q.c(57),{plugin:r,isEnabled:l,isSaving:a,pendingBinding:y,description:x,label:h,icon:j,projectId:d,client:N,onBindingChange:S,onToggle:b}=o;let u;e[0]!==r?(u=fe(r),e[0]=r,e[1]=u):u=e[1];const w=u;let C;e[2]!==r.id||e[3]!==d?(C=q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=C):C=e[4];let m;e[5]!==N||e[6]!==r.id||e[7]!==d?(m=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const O=await N.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return z(O)},e[5]=N,e[6]=r.id,e[7]=d,e[8]=m):m=e[8];const P=!!d&&w;let v;e[9]!==C||e[10]!==m||e[11]!==P?(v={queryKey:C,queryFn:m,enabled:P},e[9]=C,e[10]=m,e[11]=P,e[12]=v):v=e[12];const{data:A,isLoading:g}=Y(v),t=A?.config?.connectionId??null,s=y!==void 0?y:t;let i;e[13]!==l||e[14]!==a||e[15]!==b||e[16]!==r.id?(i=()=>!a&&b(r.id,!l),e[13]=l,e[14]=a,e[15]=b,e[16]=r.id,e[17]=i):i=e[17];const c=a?void 0:"pointer";let p;e[18]!==c?(p={cursor:c},e[18]=c,e[19]=p):p=e[19];let f;e[20]!==j?(f=j&&n.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:j}),e[20]=j,e[21]=f):f=e[21];let I;e[22]!==h?(I=n.jsx("p",{className:"text-sm font-medium text-foreground",children:h}),e[22]=h,e[23]=I):I=e[23];let E;e[24]!==x?(E=x&&n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:x}),e[24]=x,e[25]=E):E=e[25];let B;e[26]!==I||e[27]!==E?(B=n.jsxs("div",{className:"min-w-0",children:[I,E]}),e[26]=I,e[27]=E,e[28]=B):B=e[28];let k;e[29]!==B||e[30]!==f?(k=n.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[f,B]}),e[29]=B,e[30]=f,e[31]=k):k=e[31];let T;e[32]!==b||e[33]!==r.id?(T=O=>b(r.id,O),e[32]=b,e[33]=r.id,e[34]=T):T=e[34];let F;e[35]!==l||e[36]!==a||e[37]!==T?(F=n.jsx("div",{onClick:je,className:"shrink-0",children:n.jsx(ee,{checked:l,onCheckedChange:T,disabled:a})}),e[35]=l,e[36]=a,e[37]=T,e[38]=F):F=e[38];let L;e[39]!==k||e[40]!==F?(L=n.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[k,F]}),e[39]=k,e[40]=F,e[41]=L):L=e[41];let U;e[42]!==g||e[43]!==l||e[44]!==a||e[45]!==w||e[46]!==S||e[47]!==r.binding||e[48]!==r.id||e[49]!==s||e[50]!==t?(U=l&&w&&n.jsx("div",{className:"pb-4 pl-7 space-y-2",onClick:he,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),n.jsx(ge,{value:s??null,onValueChange:O=>S(r.id,O,t),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:a||g})]})}),e[42]=g,e[43]=l,e[44]=a,e[45]=w,e[46]=S,e[47]=r.binding,e[48]=r.id,e[49]=s,e[50]=t,e[51]=U):U=e[51];let R;return e[52]!==L||e[53]!==U||e[54]!==i||e[55]!==p?(R=n.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:i,style:p,children:[L,U]}),e[52]=L,e[53]=U,e[54]=i,e[55]=p,e[56]=R):R=e[56],R}function he(o){return o.stopPropagation()}function je(o){return o.stopPropagation()}function be(){const{org:o,project:e}=V(),r=W(),l=X({connectionId:Z,orgId:o.id}),[a,y]=_.useState({}),[x,h]=_.useState({}),[j,d]=_.useState(!1),N=e.enabledPlugins??[],S=t=>{const s=a[t];return s!==void 0?s:N.includes(t)},b=()=>{const t=new Set(N);for(const[s,i]of Object.entries(a))i?t.add(s):t.delete(s);return Array.from(t)},u=Object.keys(a).length>0||Object.keys(x).length>0,w=(t,s)=>{const i=N.includes(t);y(s===i?c=>{const{[t]:p,...f}=c;return f}:c=>({...c,[t]:s}))},C=(t,s,i)=>{if(s===i){h(c=>{const{[t]:p,...f}=c;return f});return}h(c=>({...c,[t]:s}))},m=H({mutationFn:async t=>{const s=[];if(t.updatePlugins){const i=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:t.enabledPlugins}});s.push(z(i))}if(t.bindingUpdates.length>0){const i=await Promise.all(t.bindingUpdates.map(async({pluginId:c,connectionId:p,settings:f})=>{const I=await l.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:c,connectionId:p,settings:f}});return z(I)}));s.push(...i)}return s},onSuccess:(t,s)=>{s.updatePlugins&&(r.invalidateQueries({queryKey:q.project(o.id,e.slug)}),r.invalidateQueries({queryKey:q.projects(o.id)})),s.bindingUpdates.forEach(({pluginId:i})=>{r.invalidateQueries({queryKey:q.projectPluginConfig(e.id??"",i)})}),y({}),h({}),K.success("Plugins updated successfully")},onError:t=>{K.error("Failed to update plugins: "+(t instanceof Error?t.message:"Unknown error"))},onSettled:()=>{d(!1)}}),P=()=>{d(!0);const t=Object.keys(x).map(s=>{const i=x[s];return{pluginId:s,connectionId:i!==void 0?i:void 0}});m.mutate({enabledPlugins:b(),updatePlugins:Object.keys(a).length>0,bindingUpdates:t})},v=()=>{y({}),h({})},A=t=>{const s=$.find(i=>i.pluginId===t);return s?{label:s.label,icon:s.items[0]?.icon}:null},g=t=>D.find(i=>i.id===t)?.description??null;return D.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-col",children:D.map(t=>{const s=A(t.id),i=g(t.id),c=S(t.id);return n.jsx(xe,{plugin:t,isEnabled:c,isSaving:j,pendingBinding:x[t.id],description:i,label:s?.label??t.id,icon:s?.icon??n.jsx(ne,{size:14}),projectId:e.id,client:l,onBindingChange:C,onToggle:w},t.id)})}),n.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[n.jsx(G,{variant:"outline",onClick:v,disabled:!u||j,children:"Cancel"}),n.jsx(G,{onClick:P,disabled:!u||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}function Le(){const o=Q.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Features"}),n.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Extend your project with built-in capabilities that activate automatically on any connection that supports them."})]}),n.jsx(be,{})]}),o[0]=e):e=o[0],e}export{Le as P};
1
+ import{r as _,j as n,z as J,B as G,u as V,w as W,x as K,K as q,bc as D,be as $,c as Q}from"./index-D4JwUMfo.js";import{u as Y}from"./useQuery-D0xC6l4K.js";import{u as H}from"./useMutation-D-zwC1-P.js";import{u as X,a as Z}from"./constants-DMTOffGt.js";import{S as ee}from"./switch-DZkrSmgJ.js";import{L as te}from"./label-BhB8mtiL.js";import{n as ne}from"./Container-BnukWtxV.js";import{b as se}from"./use-connection-96ulKDkp.js";import{a as ie,c as re}from"./use-binding-CZG6TNcT.js";import{u as oe}from"./use-install-from-registry-B8bxY6WO.js";import{i as le}from"./Loading01-1unV3no7.js";import{s as ae}from"./Plus-DRukDy12.js";import{S as ce,a as de,b as ue,c as me,d as M}from"./select-DwZBzl3A.js";function ge({value:o,onValueChange:e,placeholder:r="Select a connection...",binding:l,bindingType:a,onAddNew:y,className:x,disabled:h=!1}){const[j,d]=_.useState(!1),{installByBinding:N,isInstalling:S}=oe(),b=j||S,u=se(),w=ie({connections:u,binding:typeof l=="string"?l:void 0}),C=!l||!u?u??[]:typeof l=="string"?w:Array.isArray(l)&&l.length>0?u.filter(t=>re(t,l)):u,m=(()=>{if(!a?.startsWith("@"))return null;const[t,s]=a.replace("@","").split("/");return t&&s?{scope:t,appName:s}:null})(),P=(()=>{let t=C;const s=Array.isArray(l)&&l.length>0;if(m&&!s&&(t=t.filter(i=>{const c=i.app_name,p=i.metadata?.scopeName;return c===m.appName&&p===m.scope})),o&&!t.some(i=>i.id===o)){const i=u?.find(c=>c.id===o);if(i)return[i,...t]}return t})(),v=a?.startsWith("@"),A=async()=>{if(v&&a){d(!0);try{const t=await N(a);t&&e(t.id)}finally{d(!1)}return}y?.()},g=P.find(t=>t.id===o);return n.jsxs(ce,{value:o??"none",onValueChange:t=>e(t==="none"?null:t),disabled:h,children:[n.jsx(de,{size:"sm",className:J("w-[200px]",x),children:n.jsx(ue,{placeholder:r,children:g?n.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?n.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded shrink-0"}):n.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:g.title.slice(0,1).toUpperCase()}),n.jsx("span",{className:"truncate",children:g.title})]}):r})}),n.jsxs(me,{children:[n.jsx(M,{value:"none",children:"No connection"}),P.length===0?n.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(t=>n.jsx(M,{value:t.id,children:n.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?n.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):n.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:t.title.slice(0,1).toUpperCase()}),n.jsx("span",{children:t.title})]})},t.id)),(y||v)&&n.jsx("div",{className:"border-t border-border",children:n.jsx(G,{onPointerDown:t=>t.stopPropagation(),onClick:t=>{t.preventDefault(),t.stopPropagation(),A()},disabled:b||h,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:b?n.jsxs(n.Fragment,{children:[n.jsx(le,{size:16,className:"animate-spin"}),n.jsx("span",{children:"Connecting..."})]}):n.jsxs(n.Fragment,{children:[n.jsx(ae,{size:16}),n.jsx("span",{children:"Add Connection"})]})})})]})]})}const pe=o=>{if(!o||typeof o!="object")return!1;const e=o;return e.type==="text"&&typeof e.text=="string"&&e.text.trim().toLowerCase().startsWith("error")},z=o=>{const e=o.structuredContent??o,r=e&&typeof e=="object"?e:null,l=r?.content?.[0]?.text&&typeof r.content[0].text=="string"?r.content[0].text:null;if(r?.isError)throw new Error(l??"Tool call failed");if(pe(e))throw new Error(e.text);return e};function fe(o){return o.requiresMcpBinding===!0?!0:o.binding!==void 0}function xe(o){const e=Q.c(57),{plugin:r,isEnabled:l,isSaving:a,pendingBinding:y,description:x,label:h,icon:j,projectId:d,client:N,onBindingChange:S,onToggle:b}=o;let u;e[0]!==r?(u=fe(r),e[0]=r,e[1]=u):u=e[1];const w=u;let C;e[2]!==r.id||e[3]!==d?(C=q.projectPluginConfig(d??"",r.id),e[2]=r.id,e[3]=d,e[4]=C):C=e[4];let m;e[5]!==N||e[6]!==r.id||e[7]!==d?(m=async()=>{if(!d)throw new Error("Project ID is required to load plugin config.");const O=await N.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:d,pluginId:r.id}});return z(O)},e[5]=N,e[6]=r.id,e[7]=d,e[8]=m):m=e[8];const P=!!d&&w;let v;e[9]!==C||e[10]!==m||e[11]!==P?(v={queryKey:C,queryFn:m,enabled:P},e[9]=C,e[10]=m,e[11]=P,e[12]=v):v=e[12];const{data:A,isLoading:g}=Y(v),t=A?.config?.connectionId??null,s=y!==void 0?y:t;let i;e[13]!==l||e[14]!==a||e[15]!==b||e[16]!==r.id?(i=()=>!a&&b(r.id,!l),e[13]=l,e[14]=a,e[15]=b,e[16]=r.id,e[17]=i):i=e[17];const c=a?void 0:"pointer";let p;e[18]!==c?(p={cursor:c},e[18]=c,e[19]=p):p=e[19];let f;e[20]!==j?(f=j&&n.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:j}),e[20]=j,e[21]=f):f=e[21];let I;e[22]!==h?(I=n.jsx("p",{className:"text-sm font-medium text-foreground",children:h}),e[22]=h,e[23]=I):I=e[23];let E;e[24]!==x?(E=x&&n.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:x}),e[24]=x,e[25]=E):E=e[25];let B;e[26]!==I||e[27]!==E?(B=n.jsxs("div",{className:"min-w-0",children:[I,E]}),e[26]=I,e[27]=E,e[28]=B):B=e[28];let k;e[29]!==B||e[30]!==f?(k=n.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[f,B]}),e[29]=B,e[30]=f,e[31]=k):k=e[31];let T;e[32]!==b||e[33]!==r.id?(T=O=>b(r.id,O),e[32]=b,e[33]=r.id,e[34]=T):T=e[34];let F;e[35]!==l||e[36]!==a||e[37]!==T?(F=n.jsx("div",{onClick:je,className:"shrink-0",children:n.jsx(ee,{checked:l,onCheckedChange:T,disabled:a})}),e[35]=l,e[36]=a,e[37]=T,e[38]=F):F=e[38];let L;e[39]!==k||e[40]!==F?(L=n.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[k,F]}),e[39]=k,e[40]=F,e[41]=L):L=e[41];let U;e[42]!==g||e[43]!==l||e[44]!==a||e[45]!==w||e[46]!==S||e[47]!==r.binding||e[48]!==r.id||e[49]!==s||e[50]!==t?(U=l&&w&&n.jsx("div",{className:"pb-4 pl-7 space-y-2",onClick:he,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(te,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),n.jsx(ge,{value:s??null,onValueChange:O=>S(r.id,O,t),binding:r.binding,placeholder:"Select connection...",className:"w-56",disabled:a||g})]})}),e[42]=g,e[43]=l,e[44]=a,e[45]=w,e[46]=S,e[47]=r.binding,e[48]=r.id,e[49]=s,e[50]=t,e[51]=U):U=e[51];let R;return e[52]!==L||e[53]!==U||e[54]!==i||e[55]!==p?(R=n.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:i,style:p,children:[L,U]}),e[52]=L,e[53]=U,e[54]=i,e[55]=p,e[56]=R):R=e[56],R}function he(o){return o.stopPropagation()}function je(o){return o.stopPropagation()}function be(){const{org:o,project:e}=V(),r=W(),l=X({connectionId:Z,orgId:o.id}),[a,y]=_.useState({}),[x,h]=_.useState({}),[j,d]=_.useState(!1),N=e.enabledPlugins??[],S=t=>{const s=a[t];return s!==void 0?s:N.includes(t)},b=()=>{const t=new Set(N);for(const[s,i]of Object.entries(a))i?t.add(s):t.delete(s);return Array.from(t)},u=Object.keys(a).length>0||Object.keys(x).length>0,w=(t,s)=>{const i=N.includes(t);y(s===i?c=>{const{[t]:p,...f}=c;return f}:c=>({...c,[t]:s}))},C=(t,s,i)=>{if(s===i){h(c=>{const{[t]:p,...f}=c;return f});return}h(c=>({...c,[t]:s}))},m=H({mutationFn:async t=>{const s=[];if(t.updatePlugins){const i=await l.callTool({name:"PROJECT_UPDATE",arguments:{projectId:e.id,enabledPlugins:t.enabledPlugins}});s.push(z(i))}if(t.bindingUpdates.length>0){const i=await Promise.all(t.bindingUpdates.map(async({pluginId:c,connectionId:p,settings:f})=>{const I=await l.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:e.id,pluginId:c,connectionId:p,settings:f}});return z(I)}));s.push(...i)}return s},onSuccess:(t,s)=>{s.updatePlugins&&(r.invalidateQueries({queryKey:q.project(o.id,e.slug)}),r.invalidateQueries({queryKey:q.projects(o.id)})),s.bindingUpdates.forEach(({pluginId:i})=>{r.invalidateQueries({queryKey:q.projectPluginConfig(e.id??"",i)})}),y({}),h({}),K.success("Plugins updated successfully")},onError:t=>{K.error("Failed to update plugins: "+(t instanceof Error?t.message:"Unknown error"))},onSettled:()=>{d(!1)}}),P=()=>{d(!0);const t=Object.keys(x).map(s=>{const i=x[s];return{pluginId:s,connectionId:i!==void 0?i:void 0}});m.mutate({enabledPlugins:b(),updatePlugins:Object.keys(a).length>0,bindingUpdates:t})},v=()=>{y({}),h({})},A=t=>{const s=$.find(i=>i.pluginId===t);return s?{label:s.label,icon:s.items[0]?.icon}:null},g=t=>D.find(i=>i.id===t)?.description??null;return D.length===0?n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-col",children:D.map(t=>{const s=A(t.id),i=g(t.id),c=S(t.id);return n.jsx(xe,{plugin:t,isEnabled:c,isSaving:j,pendingBinding:x[t.id],description:i,label:s?.label??t.id,icon:s?.icon??n.jsx(ne,{size:14}),projectId:e.id,client:l,onBindingChange:C,onToggle:w},t.id)})}),n.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[n.jsx(G,{variant:"outline",onClick:v,disabled:!u||j,children:"Cancel"}),n.jsx(G,{onClick:P,disabled:!u||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}function Le(){const o=Q.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Features"}),n.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Extend your project with built-in capabilities that activate automatically on any connection that supports them."})]}),n.jsx(be,{})]}),o[0]=e):e=o[0],e}export{Le as P};
@@ -1 +1 @@
1
- import{bd as G,c as O,u as H,z as M,j as s,at as V,r as I,e as q,B as R,O as U}from"./index-B84Dx7nI.js";import{a as F}from"./use-project-DZlIfmd3.js";import{P as D}from"./index-CmH5OQnm.js";import{E as T,C as J}from"./collection-search-DXvW2iQG.js";import{A as K}from"./avatar-D94UEcg7.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as W}from"./create-project-dialog-B3BGNP1R.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-BrsAPde7.js";import"./useQuery-CIRdCYZz.js";import"./constants-_xTq0aTt.js";import"./localstorage-keys-BckSA5cs.js";import"./useMutation-Be5QSQym.js";import"./tooltip-CHJhCJL3.js";import"./index-C8u6axf-.js";import"./Loading01-aMp99RZI.js";import"./SearchMd-r7i5BQk7.js";import"./input-NIbTU7RU.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-B-Kp8Cuq.js";import"./X-DjDetE_c.js";import"./form-DK8WrQI3.js";import"./label-B6R7vHKQ.js";import"./textarea-BW2ziFqJ.js";import"./Check-OSWZCZf9.js";import"./ChevronRight-ByOuE_Vi.js";const te=G("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=M("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors"),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(K,{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 E;return e[55]!==A||e[56]!==u?(E=s.jsx(V,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}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 Ae(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=F(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=q();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/projects/$slug/settings/general",params:{org:e.slug,project:U,slug: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=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.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(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(R,{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(J,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.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(T,{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(T,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(R,{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!==U}export{Ae as default};
1
+ import{bd as G,c as O,u as H,z as M,j as s,at as V,r as I,e as q,B as R,O as U}from"./index-D4JwUMfo.js";import{a as F}from"./use-project-BFzyu71z.js";import{P as D}from"./index-DbJ64cDo.js";import{E as T,C as J}from"./collection-search-Cg477-ZE.js";import{A as K}from"./avatar-R3EZmhcg.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as W}from"./create-project-dialog-Caslq4es.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-HFSeCoIU.js";import"./useQuery-D0xC6l4K.js";import"./constants-DMTOffGt.js";import"./localstorage-keys-xw4Txgji.js";import"./useMutation-D-zwC1-P.js";import"./tooltip-BcimsULQ.js";import"./index-CrHCQ8Nf.js";import"./Loading01-1unV3no7.js";import"./SearchMd-DQrPJQV9.js";import"./input-BRH9Cf1s.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-CcebbiBo.js";import"./X-CK2TCShL.js";import"./form-CHPvar9M.js";import"./label-BhB8mtiL.js";import"./textarea-Bdphv-Mj.js";import"./Check-q1dqks2U.js";import"./ChevronRight-D7UsQHH3.js";const te=G("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=M("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors"),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(K,{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 E;return e[55]!==A||e[56]!==u?(E=s.jsx(V,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}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 Ae(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=F(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=q();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/projects/$slug/settings/general",params:{org:e.slug,project:U,slug: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=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.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(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(R,{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(J,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.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(T,{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(T,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(R,{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!==U}export{Ae as default};
@@ -1 +1 @@
1
- import{c as b,K as E,j as l}from"./index-B84Dx7nI.js";import{u as R}from"./useQuery-CIRdCYZz.js";import{i as j}from"./File06-B7IZdrgj.js";import{i as v}from"./Loading01-aMp99RZI.js";import{e as _}from"./github-icon-Dp3wHhYE.js";function w(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function A(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,r)=>{let t=e;return r.includes("target=")?t=t.replace(/target="[^"]*"/gi,'target="_blank"'):t=t.replace(/>/,' target="_blank">'),r.includes("rel=")?t=t.replace(/rel="[^"]*"/gi,'rel="noopener noreferrer"'):t=t.replace(/>/,' rel="noopener noreferrer">'),t})}function H(s){let e=w(s);return e=A(e),e}async function L(s,e){try{const r=await fetch(`https://api.github.com/repos/${s}/${e}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!r.ok){if(r.status===404)return null;throw new Error(`Failed to fetch README: ${r.statusText}`)}const t=await r.text();return H(t)}catch(r){return console.error("Error fetching README:",r),null}}function D(s){const e=b.c(18),{repository:r,html:t,isLoading:g,queryKey:h}=s;let n,o,a,m;e[0]!==t||e[1]!==h||e[2]!==r?(n=r?_(r):null,o=!!n&&t===void 0,m=R,a=h??E.githubReadme(n?.owner,n?.repo),e[0]=t,e[1]=h,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=m):(n=e[3],o=e[4],a=e[5],m=e[6]);let c;e[7]!==n?(c=async()=>n?L(n.owner,n.repo):null,e[7]=n,e[8]=c):c=e[8];let u;e[9]!==o||e[10]!==a||e[11]!==c?(u={queryKey:a,queryFn:c,enabled:o,staleTime:36e5,gcTime:864e5},e[9]=o,e[10]=a,e[11]=c,e[12]=u):u=e[12];const{data:x,isLoading:y}=m(u),f=t??x;if(g??(o&&y)){let i;return e[13]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(v,{size:32,className:"animate-spin text-muted-foreground"})}),e[13]=i):i=e[13],i}if(!f){let i;return e[14]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[l.jsx(j,{size:48,className:"text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),l.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]}),e[14]=i):i=e[14],i}let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d={backgroundColor:"transparent"},e[15]=d):d=e[15];let p;return e[16]!==f?(p=l.jsx("div",{className:"p-5 markdown-body",style:d,dangerouslySetInnerHTML:{__html:f}}),e[16]=f,e[17]=p):p=e[17],p}export{D as R};
1
+ import{c as b,K as E,j as l}from"./index-D4JwUMfo.js";import{u as R}from"./useQuery-D0xC6l4K.js";import{i as j}from"./File06-BAK1qMG7.js";import{i as v}from"./Loading01-1unV3no7.js";import{e as _}from"./github-icon-Dp3wHhYE.js";function w(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function A(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,r)=>{let t=e;return r.includes("target=")?t=t.replace(/target="[^"]*"/gi,'target="_blank"'):t=t.replace(/>/,' target="_blank">'),r.includes("rel=")?t=t.replace(/rel="[^"]*"/gi,'rel="noopener noreferrer"'):t=t.replace(/>/,' rel="noopener noreferrer">'),t})}function H(s){let e=w(s);return e=A(e),e}async function L(s,e){try{const r=await fetch(`https://api.github.com/repos/${s}/${e}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!r.ok){if(r.status===404)return null;throw new Error(`Failed to fetch README: ${r.statusText}`)}const t=await r.text();return H(t)}catch(r){return console.error("Error fetching README:",r),null}}function D(s){const e=b.c(18),{repository:r,html:t,isLoading:g,queryKey:h}=s;let n,o,a,m;e[0]!==t||e[1]!==h||e[2]!==r?(n=r?_(r):null,o=!!n&&t===void 0,m=R,a=h??E.githubReadme(n?.owner,n?.repo),e[0]=t,e[1]=h,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=m):(n=e[3],o=e[4],a=e[5],m=e[6]);let c;e[7]!==n?(c=async()=>n?L(n.owner,n.repo):null,e[7]=n,e[8]=c):c=e[8];let u;e[9]!==o||e[10]!==a||e[11]!==c?(u={queryKey:a,queryFn:c,enabled:o,staleTime:36e5,gcTime:864e5},e[9]=o,e[10]=a,e[11]=c,e[12]=u):u=e[12];const{data:x,isLoading:y}=m(u),f=t??x;if(g??(o&&y)){let i;return e[13]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(v,{size:32,className:"animate-spin text-muted-foreground"})}),e[13]=i):i=e[13],i}if(!f){let i;return e[14]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[l.jsx(j,{size:48,className:"text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),l.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]}),e[14]=i):i=e[14],i}let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d={backgroundColor:"transparent"},e[15]=d):d=e[15];let p;return e[16]!==f?(p=l.jsx("div",{className:"p-5 markdown-body",style:d,dangerouslySetInnerHTML:{__html:f}}),e[16]=f,e[17]=p):p=e[17],p}export{D as R};
@@ -1,4 +1,4 @@
1
- import{r as S,c as X,u as de,w as Le,c1 as Ke,j as t,B as G,z as ee,x as H,cf as fn,a as gn,i as jn}from"./index-B84Dx7nI.js";import{i as it}from"./CheckCircle-B2wkNkz_.js";import{n as vn}from"./Container-BVSlDn4p.js";import{t as bn}from"./Settings01-DKTz1YSf.js";import{u as Fe}from"./useQuery-CIRdCYZz.js";import{u as Ce}from"./useMutation-Be5QSQym.js";import{a as pe,u as he,h as gs}from"./constants-_xTq0aTt.js";import{u as js}from"./useInfiniteQuery-CFRJ66U9.js";import{B as F}from"./badge-DxYG_XB9.js";import{I as xe}from"./input-NIbTU7RU.js";import{a as Tt,c as Ee,D as It,b as Mt,d as rs,l as is,e as yn}from"./dropdown-menu-DjhC4m2a.js";import{e as vs,a as bs,b as Pt,T as Ie,d as ys,c as Me}from"./table-vuF1fVQ6.js";import{T as Nn,a as ls}from"./toggle-group-DO86EMeS.js";import{u as wn}from"./use-view-mode-3gfyljcZ.js";import{i as Ht}from"./DotsVertical-Cshw63SI.js";import{i as Cn}from"./FilterLines-pJtef_Pv.js";import{i as Ns}from"./Globe01-p5f8j_mm.js";import{i as et}from"./Loading01-aMp99RZI.js";import{i as ws}from"./SearchMd-r7i5BQk7.js";import{b as Et,c as Dt,d as $t,e as At,a as Lt,D as Ot}from"./dialog-B-Kp8Cuq.js";import{i as xt}from"./AlertCircle-DsQlVvig.js";import{n as _n}from"./Download01-DFmX-SGA.js";import{i as as}from"./Upload01-BEhQSPeB.js";import{c as ht,b as pt,d as ft,A as gt,h as jt,e as vt,a as bt,f as yt}from"./alert-dialog-Bbrwo05x.js";import{C as oe}from"./card-CkYe6Ikt.js";import{i as os}from"./CheckVerified02-D6qy17me.js";import{s as wt}from"./Trash01-DJTe1fKw.js";import{L as re}from"./label-B6R7vHKQ.js";import{n as kn,S as Cs,a as _s,b as ks,c as Ss,d as Rt}from"./select-1y3LRFgk.js";import{S as Xe}from"./switch-BA80KxP2.js";import{T as zt}from"./textarea-BW2ziFqJ.js";import{i as Sn}from"./ArrowLeft-CR3SWku2.js";import{i as Rn,u as Qt,t as Tn}from"./use-copy-Ba97e-kV.js";import{s as Wt}from"./RefreshCcw01-DDGad8lb.js";import{i as In}from"./X-DjDetE_c.js";import{i as Mn}from"./Link01-CHaReCKl.js";import{t as Rs}from"./ChevronDown-BR4cCk-W.js";import{C as Pn}from"./checkbox-DhgSL5Cz.js";import{s as Ts}from"./Eye-CHYeRDXI.js";import{n as En}from"./LinkExternal01-Cj5yLC8K.js";import{i as Dn}from"./XCircle-CSLSI6pa.js";import{e as Is}from"./use-collections-BoFyuDa6.js";import{b as Ms}from"./use-connection-DSPQNIQD.js";import{a as $n,b as An,P as Ln}from"./popover-D7xgfP4W.js";import{i as Vt}from"./Check-OSWZCZf9.js";import{a as Kt}from"./Copy01-B595Thpy.js";import{i as On,a as zn}from"./Save01-36pjbcKA.js";import{i as Un}from"./Key01-BP2mhRrj.js";import{s as qn}from"./Plus-Dp8Rr75G.js";import{a as Fn,b as Bn,T as Gn}from"./tooltip-CHJhCJL3.js";import{i as Qn}from"./Play-Dr8AlTmi.js";import"./infiniteQueryObserver-DenS4T97.js";import"./ChevronRight-ByOuE_Vi.js";import"./use-mobile-DznYZ63b.js";import"./index-C8u6axf-.js";const Ps=({size:s=24,color:e="currentColor",...n})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},S.createElement("path",{d:"M10.743 5.092C11.149 5.032 11.569 5 12 5c5.105 0 8.455 4.505 9.58 6.287.137.215.205.323.243.49a1.16 1.16 0 0 1 0 .447c-.038.166-.107.274-.244.492-.3.474-.757 1.141-1.363 1.865M6.724 6.715c-2.162 1.467-3.63 3.504-4.303 4.57-.137.217-.205.325-.243.492a1.173 1.173 0 0 0 0 .446c.038.167.106.274.242.49C3.546 14.495 6.895 19 12 19c2.059 0 3.832-.732 5.289-1.723M3 3l18 18M9.88 9.879a3 3 0 1 0 4.243 4.243"}));Ps.displayName="EyeOff";const Es=({size:s=24,color:e="currentColor",...n})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},S.createElement("path",{d:"M12.5 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H17c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C21 18.395 21 17.93 21 17m-2-9V2m-3 3h6M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4.49 3.418-8.459 7.69c-.476.433-.714.649-.735.836a.5.5 0 0 0 .167.431C6.105 21 6.426 21 7.07 21h9.387c1.44 0 2.159 0 2.724-.242a3 3 0 0 0 1.578-1.578c.242-.565.242-1.285.242-2.724 0-.484 0-.726-.053-.952a2.001 2.001 0 0 0-.374-.778c-.143-.182-.332-.333-.71-.636l-2.797-2.237c-.379-.303-.568-.454-.776-.508a1 1 0 0 0-.557.018c-.205.066-.384.23-.743.555Z"}));Es.displayName="ImagePlus";const Ds=({size:s=24,color:e="currentColor",...n})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},S.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}),S.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));Ds.displayName="StopSquare";const Jt=({size:s=24,color:e="currentColor",...n})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},S.createElement("path",{d:"m6 6 4.5 4.5M6 6H3L2 3l1-1 3 1v3Zm13.259-3.259-2.628 2.628c-.396.396-.594.594-.668.822a1 1 0 0 0 0 .618c.074.228.272.426.668.822l.238.238c.396.396.594.594.822.668a1 1 0 0 0 .618 0c.228-.074.426-.272.822-.668L21.59 5.41a5.5 5.5 0 0 1-6.16 7.485c-.485-.096-.729-.144-.876-.13a.836.836 0 0 0-.373.114c-.13.07-.261.201-.523.463L6.5 20.5a2.121 2.121 0 0 1-3-3l7.157-7.157c.262-.262.393-.393.463-.524a.836.836 0 0 0 .113-.372c.015-.148-.033-.39-.129-.877a5.5 5.5 0 0 1 8.155-5.83ZM12 15l5.5 5.5a2.121 2.121 0 0 0 3-3l-4.525-4.525a5.475 5.475 0 0 1-.934-.17c-.39-.107-.816-.03-1.101.255L12 15Z"}));Jt.displayName="Tool02";const W={all:["private-registry"],items:()=>[...W.all,"items"],itemsList:(s,e,n,r)=>[...W.items(),"list",{search:s,tags:e,categories:n,limit:r}],item:s=>[...W.items(),"item",s],filters:()=>[...W.all,"filters"],registryConfig:()=>[...W.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...W.registryConfig(),s,e],publishRequests:()=>[...W.all,"publish-requests"],publishRequestsByOrg:s=>[...W.publishRequests(),"org",s],publishRequestsList:(s,e,n)=>[...W.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:n??"desc"}],publishRequestsListByOrg:(s,e,n,r)=>[...W.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:n??"created_at",sortDirection:r??"desc"}],publishRequestsCount:()=>[...W.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...W.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...W.all,"publish-api-keys"],monitor:()=>[...W.all,"monitor"],monitorRuns:()=>[...W.monitor(),"runs"],monitorRunsList:s=>[...W.monitorRuns(),"list",{status:s??"all"}],monitorRun:s=>[...W.monitorRuns(),"run",s??"none"],monitorResults:()=>[...W.monitor(),"results"],monitorResultsList:(s,e)=>[...W.monitorResults(),"list",{runId:s??"none",status:e??"all"}],monitorConnections:()=>[...W.monitor(),"connections"],monitorConnectionAuthProbe:s=>[...W.monitorConnections(),"auth-probe",s]};async function Pe(s,e,n){const r=await s.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Vn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_RUN_START",{config:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns()}),e.invalidateQueries({queryKey:W.monitorResults()})])},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Kn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_RUN_CANCEL",{runId:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async(d,m)=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns()}),e.invalidateQueries({queryKey:W.monitorRun(m)})])},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Ut(s){const e=X.c(10),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==s?(l=W.monitorRunsList(s),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==s?(a=async()=>Pe(o,"REGISTRY_MONITOR_RUN_LIST",{status:s,limit:100}),e[4]=o,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==l||e[8]!==a?(i={queryKey:l,queryFn:a,staleTime:5e3},e[7]=l,e[8]=a,e[9]=i):i=e[9],Fe(i)}function Zt(s){const e=X.c(11),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==s?(l=W.monitorRun(s),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==s?(a=async()=>Pe(o,"REGISTRY_MONITOR_RUN_GET",{runId:s}),e[4]=o,e[5]=s,e[6]=a):a=e[6];const i=!!s;let d;return e[7]!==l||e[8]!==a||e[9]!==i?(d={queryKey:l,queryFn:a,enabled:i,refetchInterval:Yn},e[7]=l,e[8]=a,e[9]=i,e[10]=d):d=e[10],Fe(d)}function Yn(s){return s.state.data?.run?.status==="running"?5e3:!1}function Ct(s,e,n){const r=X.c(14),{org:o}=de();let l;r[0]!==o.id?(l={connectionId:pe,orgId:o.id},r[0]=o.id,r[1]=l):l=r[1];const a=he(l);let i;r[2]!==s||r[3]!==e?(i=W.monitorResultsList(s,e),r[2]=s,r[3]=e,r[4]=i):i=r[4];let d;r[5]!==a||r[6]!==s||r[7]!==e?(d=async()=>Pe(a,"REGISTRY_MONITOR_RESULT_LIST",{runId:s,status:e,limit:200,offset:0}),r[5]=a,r[6]=s,r[7]=e,r[8]=d):d=r[8];const m=!!s,u=n==="running"?2500:!1;let x;return r[9]!==i||r[10]!==d||r[11]!==m||r[12]!==u?(x={queryKey:i,queryFn:d,enabled:m,staleTime:5e3,refetchInterval:u},r[9]=i,r[10]=d,r[11]=m,r[12]=u,r[13]=x):x=r[13],Fe(x)}function $s(){const s=X.c(5),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.monitorConnections(),s[2]=o):o=s[2];let l;return s[3]!==r?(l={queryKey:o,queryFn:async()=>Pe(r,"REGISTRY_MONITOR_CONNECTION_LIST",{}),staleTime:1e4},s[3]=r,s[4]=l):l=s[4],Fe(l)}function Hn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async()=>Pe(o,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Wn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>{const{connectionId:m,authStatus:u}=d;return Pe(o,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:m,authStatus:u})},s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}const cs={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:"",llmConnectionId:"",llmModelId:""};function As(){const s=X.c(33),{org:e,project:n}=de();let r;s[0]!==e.id?(r={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=r):r=s[1];const o=he(r),l=Le();let a;s[2]!==n.id?(a=W.registryConfigByPlugin(n.id??"",Ke),s[2]=n.id,s[3]=a):a=s[3];let i;s[4]!==o||s[5]!==n.id?(i=async()=>Pe(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:Ke}),s[4]=o,s[5]=n.id,s[6]=i):i=s[6];const d=!!n.id;let m;s[7]!==a||s[8]!==i||s[9]!==d?(m={queryKey:a,queryFn:i,enabled:d},s[7]=a,s[8]=i,s[9]=d,s[10]=m):m=s[10];const u=Fe(m),x=u.data?.config?.settings,p=x&&typeof x=="object"?x.testConfig:void 0,c=typeof(x?x.monitorMode??x.testMode:void 0)=="string";let v;s[11]!==p?(v=p??{},s[11]=p,s[12]=v):v=s[12];let b;s[13]!==c||s[14]!==x||s[15]!==p?(b=c&&!p?x:{},s[13]=c,s[14]=x,s[15]=p,s[16]=b):b=s[16];let k;s[17]!==v||s[18]!==b?(k={...cs,...v,...b},s[17]=v,s[18]=b,s[19]=k):k=s[19];const R=k;let y;s[20]!==o||s[21]!==n.id?(y=async T=>{const C=(await Pe(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:Ke}))?.config?.settings??{};return Pe(o,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:n.id,pluginId:Ke,settings:{...C,testConfig:{...cs,...C.testConfig??{},...T}}})},s[20]=o,s[21]=n.id,s[22]=y):y=s[22];let f;s[23]!==n.id||s[24]!==l?(f=async()=>{await l.invalidateQueries({queryKey:W.registryConfigByPlugin(n.id??"",Ke)})},s[23]=n.id,s[24]=l,s[25]=f):f=s[25];let M;s[26]!==y||s[27]!==f?(M={mutationFn:y,onSuccess:f},s[26]=y,s[27]=f,s[28]=M):M=s[28];const g=Ce(M);let w;return s[29]!==u.isLoading||s[30]!==g||s[31]!==R?(w={settings:R,isLoading:u.isLoading,saveMutation:g},s[29]=u.isLoading,s[30]=g,s[31]=R,s[32]=w):w=s[32],w}function Jn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_SCHEDULE_SET",d),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.registryConfig()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Zn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_SCHEDULE_CANCEL",{scheduleEventId:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.registryConfig()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Xn(){const s=X.c(3),e=Ut("completed"),n=e.data?.items?.[0]?.id,r=e.data?.items?.[0]?.status,o=Ct(n,"failed",r),l=o.data?.items?.length??0,a=e.isLoading||o.isLoading;let i;return s[0]!==l||s[1]!==a?(i={brokenCount:l,isLoading:a},s[0]=l,s[1]=a,s[2]=i):i=s[2],i}const Ls=24;function er(s){return s.trim()}async function _e(s,e,n){const r=await s.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Os(s){const e=X.c(19),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l,a,i,d;e[2]!==s.categories||e[3]!==s.limit||e[4]!==s.search||e[5]!==s.tags?(a=er(s.search),l=s.limit??Ls,d=js,i=W.itemsList(a,s.tags,s.categories,l),e[2]=s.categories,e[3]=s.limit,e[4]=s.search,e[5]=s.tags,e[6]=l,e[7]=a,e[8]=i,e[9]=d):(l=e[6],a=e[7],i=e[8],d=e[9]);let m;e[10]!==o||e[11]!==l||e[12]!==s.categories||e[13]!==s.tags||e[14]!==a?(m=async x=>{const{pageParam:p}=x,h=a.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:a},{field:["description"],operator:"contains",value:a},{field:["id"],operator:"contains",value:a},{field:["server","name"],operator:"contains",value:a}]}:void 0;return _e(o,"REGISTRY_ITEM_LIST",{cursor:p,limit:l,tags:s.tags.length?s.tags:void 0,categories:s.categories.length?s.categories:void 0,where:h})},e[10]=o,e[11]=l,e[12]=s.categories,e[13]=s.tags,e[14]=a,e[15]=m):m=e[15];let u;return e[16]!==i||e[17]!==m?(u={queryKey:i,queryFn:m,initialPageParam:void 0,getNextPageParam:tr,staleTime:3e4},e[16]=i,e[17]=m,e[18]=u):u=e[18],d(u)}function tr(s){return s.nextCursor}function sr(){const s=X.c(8),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.filters(),s[2]=o):o=s[2];let l;s[3]!==r?(l=async()=>_e(r,"REGISTRY_ITEM_FILTERS",{}),s[3]=r,s[4]=l):l=s[4];let a;s[5]===Symbol.for("react.memo_cache_sentinel")?(a={tags:[],categories:[]},s[5]=a):a=s[5];let i;return s[6]!==l?(i={queryKey:o,queryFn:l,placeholderData:a,staleTime:6e4},s[6]=l,s[7]=i):i=s[7],Fe(i)}function Xt(){const s=X.c(29),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.items()}),e.invalidateQueries({queryKey:W.filters()})])},s[2]=e,s[3]=l):l=s[3];const a=l;let i;s[4]!==o?(i=async f=>(await _e(o,"REGISTRY_ITEM_CREATE",{data:f})).item,s[4]=o,s[5]=i):i=s[5];let d;s[6]!==a||s[7]!==i?(d={mutationFn:i,onSuccess:a},s[6]=a,s[7]=i,s[8]=d):d=s[8];const m=Ce(d);let u;s[9]!==o?(u=async f=>{const{id:M,data:g}=f;return(await _e(o,"REGISTRY_ITEM_UPDATE",{id:M,data:g})).item},s[9]=o,s[10]=u):u=s[10];let x;s[11]!==a||s[12]!==u?(x={mutationFn:u,onSuccess:a},s[11]=a,s[12]=u,s[13]=x):x=s[13];const p=Ce(x);let h;s[14]!==o?(h=async f=>(await _e(o,"REGISTRY_ITEM_DELETE",{id:f})).item,s[14]=o,s[15]=h):h=s[15];let c;s[16]!==a||s[17]!==h?(c={mutationFn:h,onSuccess:a},s[16]=a,s[17]=h,s[18]=c):c=s[18];const v=Ce(c);let b;s[19]!==o?(b=async f=>_e(o,"REGISTRY_ITEM_BULK_CREATE",{items:f}),s[19]=o,s[20]=b):b=s[20];let k;s[21]!==a||s[22]!==b?(k={mutationFn:b,onSuccess:a},s[21]=a,s[22]=b,s[23]=k):k=s[23];const R=Ce(k);let y;return s[24]!==R||s[25]!==m||s[26]!==v||s[27]!==p?(y={createMutation:m,updateMutation:p,deleteMutation:v,bulkCreateMutation:R},s[24]=R,s[25]=m,s[26]=v,s[27]=p,s[28]=y):y=s[28],y}function qt(s){const e=X.c(37),{org:n,project:r}=de();let o;e[0]!==n.id?(o={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=o):o=e[1];const l=he(o),a=Le();let i;e[2]!==s||e[3]!==r.id?(i=W.registryConfigByPlugin(r.id??"",s),e[2]=s,e[3]=r.id,e[4]=i):i=e[4];let d;e[5]!==l||e[6]!==s||e[7]!==r.id?(d=async()=>_e(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:s}),e[5]=l,e[6]=s,e[7]=r.id,e[8]=d):d=e[8];const m=!!r.id;let u;e[9]!==i||e[10]!==d||e[11]!==m?(u={queryKey:i,queryFn:d,enabled:m,staleTime:6e4},e[9]=i,e[10]=d,e[11]=m,e[12]=u):u=e[12];const x=Fe(u);let p;e[13]!==l||e[14]!==s||e[15]!==r.id?(p=async A=>{const P=(await _e(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:s}))?.config?.settings??{};return _e(l,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:r.id,pluginId:s,settings:{...P,...A}})},e[13]=l,e[14]=s,e[15]=r.id,e[16]=p):p=e[16];let h;e[17]!==s||e[18]!==r.id||e[19]!==a?(h=async()=>{await a.invalidateQueries({queryKey:W.registryConfigByPlugin(r.id??"",s)})},e[17]=s,e[18]=r.id,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==p||e[22]!==h?(c={mutationFn:p,onSuccess:h},e[21]=p,e[22]=h,e[23]=c):c=e[23];const v=Ce(c),b=x.data?.config?.settings?.registryName??"Private Registry",k=x.data?.config?.settings?.registryIcon??"",R=x.data?.config?.settings?.llmConnectionId??"",y=x.data?.config?.settings?.llmModelId??"",f=x.data?.config?.settings?.acceptPublishRequests??!1,M=x.data?.config?.settings?.requireApiToken??!1,g=x.data?.config?.settings?.storePrivateOnly??!1,w=x.data?.config?.settings?.rateLimitEnabled??!0,E=x.data?.config?.settings?.rateLimitWindow==="minute"?"minute":"hour",C=x.data?.config?.settings?.rateLimitMax,I=typeof C=="number"&&C>=1?Math.floor(C):100;let N;return e[24]!==f||e[25]!==x.isLoading||e[26]!==w||e[27]!==I||e[28]!==E||e[29]!==k||e[30]!==R||e[31]!==y||e[32]!==b||e[33]!==M||e[34]!==v||e[35]!==g?(N={registryName:b,registryIcon:k,registryLLMConnectionId:R,registryLLMModelId:y,acceptPublishRequests:f,requireApiToken:M,storePrivateOnly:g,rateLimitEnabled:w,rateLimitWindow:E,rateLimitMax:I,isLoadingConfig:x.isLoading,saveRegistryConfigMutation:v},e[24]=f,e[25]=x.isLoading,e[26]=w,e[27]=I,e[28]=E,e[29]=k,e[30]=R,e[31]=y,e[32]=b,e[33]=M,e[34]=v,e[35]=g,e[36]=N):N=e[36],N}function nr(s){const e=X.c(15),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==n.id||e[3]!==s.sortBy||e[4]!==s.sortDirection||e[5]!==s.status?(l=W.publishRequestsListByOrg(n.id,s.status,s.sortBy,s.sortDirection),e[2]=n.id,e[3]=s.sortBy,e[4]=s.sortDirection,e[5]=s.status,e[6]=l):l=e[6];let a;e[7]!==o||e[8]!==s.sortBy||e[9]!==s.sortDirection||e[10]!==s.status?(a=async d=>{const{pageParam:m}=d;return _e(o,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:Ls,offset:m})},e[7]=o,e[8]=s.sortBy,e[9]=s.sortDirection,e[10]=s.status,e[11]=a):a=e[11];let i;return e[12]!==l||e[13]!==a?(i={queryKey:l,queryFn:a,initialPageParam:0,getNextPageParam:rr,staleTime:3e4,refetchOnMount:!0},e[12]=l,e[13]=a,e[14]=i):i=e[14],js(i)}function rr(s,e){const n=e.reduce(ir,0);return n<s.totalCount?n:void 0}function ir(s,e){return s+e.items.length}function lr(){const s=X.c(9),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]!==e.id?(o=W.publishRequestsCountByOrg(e.id),s[2]=e.id,s[3]=o):o=s[3];let l;s[4]!==r?(l=async()=>_e(r,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),s[4]=r,s[5]=l):l=s[5];let a;return s[6]!==o||s[7]!==l?(a={queryKey:o,queryFn:l,staleTime:3e4},s[6]=o,s[7]=l,s[8]=a):a=s[8],Fe(a)}function ar(){const s=X.c(17),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.publishRequests()})])},s[2]=e,s[3]=l):l=s[3];const a=l;let i;s[4]!==o?(i=async c=>_e(o,"REGISTRY_PUBLISH_REQUEST_REVIEW",c),s[4]=o,s[5]=i):i=s[5];let d;s[6]!==a||s[7]!==i?(d={mutationFn:i,onSuccess:a},s[6]=a,s[7]=i,s[8]=d):d=s[8];const m=Ce(d);let u;s[9]!==o?(u=async c=>_e(o,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:c}),s[9]=o,s[10]=u):u=s[10];let x;s[11]!==a||s[12]!==u?(x={mutationFn:u,onSuccess:a},s[11]=a,s[12]=u,s[13]=x):x=s[13];const p=Ce(x);let h;return s[14]!==p||s[15]!==m?(h={reviewMutation:m,deleteMutation:p},s[14]=p,s[15]=m,s[16]=h):h=s[16],h}function or(){const s=X.c(5),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.publishApiKeys(),s[2]=o):o=s[2];let l;return s[3]!==r?(l={queryKey:o,queryFn:async()=>_e(r,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[3]=r,s[4]=l):l=s[4],Fe(l)}function cr(){const s=X.c(19),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async c=>_e(o,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:c}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[4]=e,s[5]=a):a=s[5];let i;s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8];const d=Ce(i);let m;s[9]!==o?(m=async c=>_e(o,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:c}),s[9]=o,s[10]=m):m=s[10];let u;s[11]!==e?(u=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[11]=e,s[12]=u):u=s[12];let x;s[13]!==m||s[14]!==u?(x={mutationFn:m,onSuccess:u},s[13]=m,s[14]=u,s[15]=x):x=s[15];const p=Ce(x);let h;return s[16]!==d||s[17]!==p?(h={generateMutation:d,revokeMutation:p},s[16]=d,s[17]=p,s[18]=h):h=s[18],h}function ds(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function ms(s){const e=[];let n="",r=!1;for(let o=0;o<s.length;o+=1){const l=s[o],a=s[o+1];if(l==='"'){r&&a==='"'?(n+='"',o+=1):r=!r;continue}if(l===","&&!r){e.push(n.trim()),n="";continue}n+=l}return e.push(n.trim()),e}const dr=["id","title"],mr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function ur(s){const e=s.split(/\r?\n/).map(m=>m.trim()).filter(Boolean);if(e.length<2)return{items:[],warnings:[{line:0,message:"CSV must have a header row and at least one data row"}],skipped:0};const n=ms(e[0]??""),r=new Map,o=[];n.forEach((m,u)=>{const x=m.toLowerCase().trim();x&&r.set(x,u)});for(const m of dr)r.has(m)||o.push({line:1,message:`Missing required column: "${m}"`});for(const m of n){const u=m.toLowerCase().trim();u&&!mr.includes(u)&&o.push({line:1,message:`Unknown column "${m}" will be ignored`})}if(!r.has("id")||!r.has("title"))return{items:[],warnings:o,skipped:0};const l=(m,u)=>{const x=r.get(u);return typeof x=="number"?m[x]??"":""},a=[],i=new Set;let d=0;for(let m=1;m<e.length;m+=1){const u=ms(e[m]??""),x=l(u,"id").trim(),p=l(u,"title").trim();if(!x){o.push({line:m+1,message:"Missing id — row skipped"}),d+=1;continue}if(!p){o.push({line:m+1,message:`Missing title for id="${x}" — row skipped`}),d+=1;continue}if(i.has(x)){o.push({line:m+1,message:`Duplicate id="${x}" — row skipped`}),d+=1;continue}i.add(x);const h=l(u,"description").trim(),c=l(u,"remote_url").trim(),b=l(u,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",k=ds(l(u,"tags")),R=ds(l(u,"categories")),y=l(u,"is_public").trim().toLowerCase(),f=y==="true"||y==="1"||y==="yes";a.push({id:x,title:p,description:h||null,is_public:f,_meta:{"mcp.mesh":{...k.length>0?{tags:k}:{},...R.length>0?{categories:R}:{}}},server:{name:x,title:p,description:h||void 0,remotes:c?[{type:b,url:c}]:[]}})}return{items:a,warnings:o,skipped:d}}const xr=`id,title,description,remote_url,remote_type,tags,categories,is_public
1
+ import{r as S,c as X,u as de,w as Le,c1 as Ke,j as t,B as G,z as ee,x as H,cf as fn,a as gn,i as jn}from"./index-D4JwUMfo.js";import{i as it}from"./CheckCircle-DAQqu9C_.js";import{n as vn}from"./Container-BnukWtxV.js";import{t as bn}from"./Settings01-C-jo0YyN.js";import{u as Fe}from"./useQuery-D0xC6l4K.js";import{u as Ce}from"./useMutation-D-zwC1-P.js";import{a as pe,u as he,h as gs}from"./constants-DMTOffGt.js";import{u as js}from"./useInfiniteQuery-BgV83YrM.js";import{B as F}from"./badge-Bgf3f5yM.js";import{I as xe}from"./input-BRH9Cf1s.js";import{a as Tt,c as Ee,D as It,b as Mt,d as rs,l as is,e as yn}from"./dropdown-menu-CXrh9ioK.js";import{e as vs,a as bs,b as Pt,T as Ie,d as ys,c as Me}from"./table-gCgflBYD.js";import{T as Nn,a as ls}from"./toggle-group-DbiUjc4d.js";import{u as wn}from"./use-view-mode-BArlOdRG.js";import{i as Ht}from"./DotsVertical-DxhWxx-U.js";import{i as Cn}from"./FilterLines-D7KpfRSU.js";import{i as Ns}from"./Globe01-yz8Ugxya.js";import{i as et}from"./Loading01-1unV3no7.js";import{i as ws}from"./SearchMd-DQrPJQV9.js";import{b as Et,c as Dt,d as $t,e as At,a as Lt,D as Ot}from"./dialog-CcebbiBo.js";import{i as xt}from"./AlertCircle-BVzUbFpn.js";import{n as _n}from"./Download01-RW_lAP8U.js";import{i as as}from"./Upload01-2a8eC1w5.js";import{c as ht,b as pt,d as ft,A as gt,h as jt,e as vt,a as bt,f as yt}from"./alert-dialog-BpAl1CV2.js";import{C as oe}from"./card-CeKLZLLA.js";import{i as os}from"./CheckVerified02-CZ912ESL.js";import{s as wt}from"./Trash01-DO5SV3mV.js";import{L as re}from"./label-BhB8mtiL.js";import{n as kn,S as Cs,a as _s,b as ks,c as Ss,d as Rt}from"./select-DwZBzl3A.js";import{S as Xe}from"./switch-DZkrSmgJ.js";import{T as zt}from"./textarea-Bdphv-Mj.js";import{i as Sn}from"./ArrowLeft-G2GpUvfS.js";import{i as Rn,u as Qt,t as Tn}from"./use-copy-CqEqSzSC.js";import{s as Wt}from"./RefreshCcw01-D1XgqmbV.js";import{i as In}from"./X-CK2TCShL.js";import{i as Mn}from"./Link01-BSeN3LgC.js";import{t as Rs}from"./ChevronDown-cViiGxn9.js";import{C as Pn}from"./checkbox-DiriJ1bL.js";import{s as Ts}from"./Eye-BY6V0QO1.js";import{n as En}from"./LinkExternal01-Rv_hEkme.js";import{i as Dn}from"./XCircle-0CM-aUam.js";import{e as Is}from"./use-collections-Bs1uQVQJ.js";import{b as Ms}from"./use-connection-96ulKDkp.js";import{a as $n,b as An,P as Ln}from"./popover-BUt6i0bO.js";import{i as Vt}from"./Check-q1dqks2U.js";import{a as Kt}from"./Copy01-DIuxFCYv.js";import{i as On,a as zn}from"./Save01-Ba2I-ry6.js";import{i as Un}from"./Key01-DZIfBgYr.js";import{s as qn}from"./Plus-DRukDy12.js";import{a as Fn,b as Bn,T as Gn}from"./tooltip-BcimsULQ.js";import{i as Qn}from"./Play-Bae0FSDA.js";import"./infiniteQueryObserver-DAdEAsRM.js";import"./ChevronRight-D7UsQHH3.js";import"./use-mobile-DoL_dqtN.js";import"./index-CrHCQ8Nf.js";const Ps=({size:s=24,color:e="currentColor",...n})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},S.createElement("path",{d:"M10.743 5.092C11.149 5.032 11.569 5 12 5c5.105 0 8.455 4.505 9.58 6.287.137.215.205.323.243.49a1.16 1.16 0 0 1 0 .447c-.038.166-.107.274-.244.492-.3.474-.757 1.141-1.363 1.865M6.724 6.715c-2.162 1.467-3.63 3.504-4.303 4.57-.137.217-.205.325-.243.492a1.173 1.173 0 0 0 0 .446c.038.167.106.274.242.49C3.546 14.495 6.895 19 12 19c2.059 0 3.832-.732 5.289-1.723M3 3l18 18M9.88 9.879a3 3 0 1 0 4.243 4.243"}));Ps.displayName="EyeOff";const Es=({size:s=24,color:e="currentColor",...n})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},S.createElement("path",{d:"M12.5 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H17c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C21 18.395 21 17.93 21 17m-2-9V2m-3 3h6M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4.49 3.418-8.459 7.69c-.476.433-.714.649-.735.836a.5.5 0 0 0 .167.431C6.105 21 6.426 21 7.07 21h9.387c1.44 0 2.159 0 2.724-.242a3 3 0 0 0 1.578-1.578c.242-.565.242-1.285.242-2.724 0-.484 0-.726-.053-.952a2.001 2.001 0 0 0-.374-.778c-.143-.182-.332-.333-.71-.636l-2.797-2.237c-.379-.303-.568-.454-.776-.508a1 1 0 0 0-.557.018c-.205.066-.384.23-.743.555Z"}));Es.displayName="ImagePlus";const Ds=({size:s=24,color:e="currentColor",...n})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},S.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}),S.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));Ds.displayName="StopSquare";const Jt=({size:s=24,color:e="currentColor",...n})=>S.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},S.createElement("path",{d:"m6 6 4.5 4.5M6 6H3L2 3l1-1 3 1v3Zm13.259-3.259-2.628 2.628c-.396.396-.594.594-.668.822a1 1 0 0 0 0 .618c.074.228.272.426.668.822l.238.238c.396.396.594.594.822.668a1 1 0 0 0 .618 0c.228-.074.426-.272.822-.668L21.59 5.41a5.5 5.5 0 0 1-6.16 7.485c-.485-.096-.729-.144-.876-.13a.836.836 0 0 0-.373.114c-.13.07-.261.201-.523.463L6.5 20.5a2.121 2.121 0 0 1-3-3l7.157-7.157c.262-.262.393-.393.463-.524a.836.836 0 0 0 .113-.372c.015-.148-.033-.39-.129-.877a5.5 5.5 0 0 1 8.155-5.83ZM12 15l5.5 5.5a2.121 2.121 0 0 0 3-3l-4.525-4.525a5.475 5.475 0 0 1-.934-.17c-.39-.107-.816-.03-1.101.255L12 15Z"}));Jt.displayName="Tool02";const W={all:["private-registry"],items:()=>[...W.all,"items"],itemsList:(s,e,n,r)=>[...W.items(),"list",{search:s,tags:e,categories:n,limit:r}],item:s=>[...W.items(),"item",s],filters:()=>[...W.all,"filters"],registryConfig:()=>[...W.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...W.registryConfig(),s,e],publishRequests:()=>[...W.all,"publish-requests"],publishRequestsByOrg:s=>[...W.publishRequests(),"org",s],publishRequestsList:(s,e,n)=>[...W.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:n??"desc"}],publishRequestsListByOrg:(s,e,n,r)=>[...W.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:n??"created_at",sortDirection:r??"desc"}],publishRequestsCount:()=>[...W.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...W.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...W.all,"publish-api-keys"],monitor:()=>[...W.all,"monitor"],monitorRuns:()=>[...W.monitor(),"runs"],monitorRunsList:s=>[...W.monitorRuns(),"list",{status:s??"all"}],monitorRun:s=>[...W.monitorRuns(),"run",s??"none"],monitorResults:()=>[...W.monitor(),"results"],monitorResultsList:(s,e)=>[...W.monitorResults(),"list",{runId:s??"none",status:e??"all"}],monitorConnections:()=>[...W.monitor(),"connections"],monitorConnectionAuthProbe:s=>[...W.monitorConnections(),"auth-probe",s]};async function Pe(s,e,n){const r=await s.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Vn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_RUN_START",{config:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns()}),e.invalidateQueries({queryKey:W.monitorResults()})])},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Kn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_RUN_CANCEL",{runId:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async(d,m)=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns()}),e.invalidateQueries({queryKey:W.monitorRun(m)})])},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Ut(s){const e=X.c(10),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==s?(l=W.monitorRunsList(s),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==s?(a=async()=>Pe(o,"REGISTRY_MONITOR_RUN_LIST",{status:s,limit:100}),e[4]=o,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==l||e[8]!==a?(i={queryKey:l,queryFn:a,staleTime:5e3},e[7]=l,e[8]=a,e[9]=i):i=e[9],Fe(i)}function Zt(s){const e=X.c(11),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==s?(l=W.monitorRun(s),e[2]=s,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==s?(a=async()=>Pe(o,"REGISTRY_MONITOR_RUN_GET",{runId:s}),e[4]=o,e[5]=s,e[6]=a):a=e[6];const i=!!s;let d;return e[7]!==l||e[8]!==a||e[9]!==i?(d={queryKey:l,queryFn:a,enabled:i,refetchInterval:Yn},e[7]=l,e[8]=a,e[9]=i,e[10]=d):d=e[10],Fe(d)}function Yn(s){return s.state.data?.run?.status==="running"?5e3:!1}function Ct(s,e,n){const r=X.c(14),{org:o}=de();let l;r[0]!==o.id?(l={connectionId:pe,orgId:o.id},r[0]=o.id,r[1]=l):l=r[1];const a=he(l);let i;r[2]!==s||r[3]!==e?(i=W.monitorResultsList(s,e),r[2]=s,r[3]=e,r[4]=i):i=r[4];let d;r[5]!==a||r[6]!==s||r[7]!==e?(d=async()=>Pe(a,"REGISTRY_MONITOR_RESULT_LIST",{runId:s,status:e,limit:200,offset:0}),r[5]=a,r[6]=s,r[7]=e,r[8]=d):d=r[8];const m=!!s,u=n==="running"?2500:!1;let x;return r[9]!==i||r[10]!==d||r[11]!==m||r[12]!==u?(x={queryKey:i,queryFn:d,enabled:m,staleTime:5e3,refetchInterval:u},r[9]=i,r[10]=d,r[11]=m,r[12]=u,r[13]=x):x=r[13],Fe(x)}function $s(){const s=X.c(5),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.monitorConnections(),s[2]=o):o=s[2];let l;return s[3]!==r?(l={queryKey:o,queryFn:async()=>Pe(r,"REGISTRY_MONITOR_CONNECTION_LIST",{}),staleTime:1e4},s[3]=r,s[4]=l):l=s[4],Fe(l)}function Hn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async()=>Pe(o,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Wn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>{const{connectionId:m,authStatus:u}=d;return Pe(o,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:m,authStatus:u})},s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}const cs={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:"",llmConnectionId:"",llmModelId:""};function As(){const s=X.c(33),{org:e,project:n}=de();let r;s[0]!==e.id?(r={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=r):r=s[1];const o=he(r),l=Le();let a;s[2]!==n.id?(a=W.registryConfigByPlugin(n.id??"",Ke),s[2]=n.id,s[3]=a):a=s[3];let i;s[4]!==o||s[5]!==n.id?(i=async()=>Pe(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:Ke}),s[4]=o,s[5]=n.id,s[6]=i):i=s[6];const d=!!n.id;let m;s[7]!==a||s[8]!==i||s[9]!==d?(m={queryKey:a,queryFn:i,enabled:d},s[7]=a,s[8]=i,s[9]=d,s[10]=m):m=s[10];const u=Fe(m),x=u.data?.config?.settings,p=x&&typeof x=="object"?x.testConfig:void 0,c=typeof(x?x.monitorMode??x.testMode:void 0)=="string";let v;s[11]!==p?(v=p??{},s[11]=p,s[12]=v):v=s[12];let b;s[13]!==c||s[14]!==x||s[15]!==p?(b=c&&!p?x:{},s[13]=c,s[14]=x,s[15]=p,s[16]=b):b=s[16];let k;s[17]!==v||s[18]!==b?(k={...cs,...v,...b},s[17]=v,s[18]=b,s[19]=k):k=s[19];const R=k;let y;s[20]!==o||s[21]!==n.id?(y=async T=>{const C=(await Pe(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:Ke}))?.config?.settings??{};return Pe(o,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:n.id,pluginId:Ke,settings:{...C,testConfig:{...cs,...C.testConfig??{},...T}}})},s[20]=o,s[21]=n.id,s[22]=y):y=s[22];let f;s[23]!==n.id||s[24]!==l?(f=async()=>{await l.invalidateQueries({queryKey:W.registryConfigByPlugin(n.id??"",Ke)})},s[23]=n.id,s[24]=l,s[25]=f):f=s[25];let M;s[26]!==y||s[27]!==f?(M={mutationFn:y,onSuccess:f},s[26]=y,s[27]=f,s[28]=M):M=s[28];const g=Ce(M);let w;return s[29]!==u.isLoading||s[30]!==g||s[31]!==R?(w={settings:R,isLoading:u.isLoading,saveMutation:g},s[29]=u.isLoading,s[30]=g,s[31]=R,s[32]=w):w=s[32],w}function Jn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_SCHEDULE_SET",d),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.registryConfig()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Zn(){const s=X.c(9),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async d=>Pe(o,"REGISTRY_MONITOR_SCHEDULE_CANCEL",{scheduleEventId:d}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.registryConfig()})},s[4]=e,s[5]=a):a=s[5];let i;return s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8],Ce(i)}function Xn(){const s=X.c(3),e=Ut("completed"),n=e.data?.items?.[0]?.id,r=e.data?.items?.[0]?.status,o=Ct(n,"failed",r),l=o.data?.items?.length??0,a=e.isLoading||o.isLoading;let i;return s[0]!==l||s[1]!==a?(i={brokenCount:l,isLoading:a},s[0]=l,s[1]=a,s[2]=i):i=s[2],i}const Ls=24;function er(s){return s.trim()}async function _e(s,e,n){const r=await s.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Os(s){const e=X.c(19),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l,a,i,d;e[2]!==s.categories||e[3]!==s.limit||e[4]!==s.search||e[5]!==s.tags?(a=er(s.search),l=s.limit??Ls,d=js,i=W.itemsList(a,s.tags,s.categories,l),e[2]=s.categories,e[3]=s.limit,e[4]=s.search,e[5]=s.tags,e[6]=l,e[7]=a,e[8]=i,e[9]=d):(l=e[6],a=e[7],i=e[8],d=e[9]);let m;e[10]!==o||e[11]!==l||e[12]!==s.categories||e[13]!==s.tags||e[14]!==a?(m=async x=>{const{pageParam:p}=x,h=a.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:a},{field:["description"],operator:"contains",value:a},{field:["id"],operator:"contains",value:a},{field:["server","name"],operator:"contains",value:a}]}:void 0;return _e(o,"REGISTRY_ITEM_LIST",{cursor:p,limit:l,tags:s.tags.length?s.tags:void 0,categories:s.categories.length?s.categories:void 0,where:h})},e[10]=o,e[11]=l,e[12]=s.categories,e[13]=s.tags,e[14]=a,e[15]=m):m=e[15];let u;return e[16]!==i||e[17]!==m?(u={queryKey:i,queryFn:m,initialPageParam:void 0,getNextPageParam:tr,staleTime:3e4},e[16]=i,e[17]=m,e[18]=u):u=e[18],d(u)}function tr(s){return s.nextCursor}function sr(){const s=X.c(8),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.filters(),s[2]=o):o=s[2];let l;s[3]!==r?(l=async()=>_e(r,"REGISTRY_ITEM_FILTERS",{}),s[3]=r,s[4]=l):l=s[4];let a;s[5]===Symbol.for("react.memo_cache_sentinel")?(a={tags:[],categories:[]},s[5]=a):a=s[5];let i;return s[6]!==l?(i={queryKey:o,queryFn:l,placeholderData:a,staleTime:6e4},s[6]=l,s[7]=i):i=s[7],Fe(i)}function Xt(){const s=X.c(29),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.items()}),e.invalidateQueries({queryKey:W.filters()})])},s[2]=e,s[3]=l):l=s[3];const a=l;let i;s[4]!==o?(i=async f=>(await _e(o,"REGISTRY_ITEM_CREATE",{data:f})).item,s[4]=o,s[5]=i):i=s[5];let d;s[6]!==a||s[7]!==i?(d={mutationFn:i,onSuccess:a},s[6]=a,s[7]=i,s[8]=d):d=s[8];const m=Ce(d);let u;s[9]!==o?(u=async f=>{const{id:M,data:g}=f;return(await _e(o,"REGISTRY_ITEM_UPDATE",{id:M,data:g})).item},s[9]=o,s[10]=u):u=s[10];let x;s[11]!==a||s[12]!==u?(x={mutationFn:u,onSuccess:a},s[11]=a,s[12]=u,s[13]=x):x=s[13];const p=Ce(x);let h;s[14]!==o?(h=async f=>(await _e(o,"REGISTRY_ITEM_DELETE",{id:f})).item,s[14]=o,s[15]=h):h=s[15];let c;s[16]!==a||s[17]!==h?(c={mutationFn:h,onSuccess:a},s[16]=a,s[17]=h,s[18]=c):c=s[18];const v=Ce(c);let b;s[19]!==o?(b=async f=>_e(o,"REGISTRY_ITEM_BULK_CREATE",{items:f}),s[19]=o,s[20]=b):b=s[20];let k;s[21]!==a||s[22]!==b?(k={mutationFn:b,onSuccess:a},s[21]=a,s[22]=b,s[23]=k):k=s[23];const R=Ce(k);let y;return s[24]!==R||s[25]!==m||s[26]!==v||s[27]!==p?(y={createMutation:m,updateMutation:p,deleteMutation:v,bulkCreateMutation:R},s[24]=R,s[25]=m,s[26]=v,s[27]=p,s[28]=y):y=s[28],y}function qt(s){const e=X.c(37),{org:n,project:r}=de();let o;e[0]!==n.id?(o={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=o):o=e[1];const l=he(o),a=Le();let i;e[2]!==s||e[3]!==r.id?(i=W.registryConfigByPlugin(r.id??"",s),e[2]=s,e[3]=r.id,e[4]=i):i=e[4];let d;e[5]!==l||e[6]!==s||e[7]!==r.id?(d=async()=>_e(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:s}),e[5]=l,e[6]=s,e[7]=r.id,e[8]=d):d=e[8];const m=!!r.id;let u;e[9]!==i||e[10]!==d||e[11]!==m?(u={queryKey:i,queryFn:d,enabled:m,staleTime:6e4},e[9]=i,e[10]=d,e[11]=m,e[12]=u):u=e[12];const x=Fe(u);let p;e[13]!==l||e[14]!==s||e[15]!==r.id?(p=async A=>{const P=(await _e(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:s}))?.config?.settings??{};return _e(l,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:r.id,pluginId:s,settings:{...P,...A}})},e[13]=l,e[14]=s,e[15]=r.id,e[16]=p):p=e[16];let h;e[17]!==s||e[18]!==r.id||e[19]!==a?(h=async()=>{await a.invalidateQueries({queryKey:W.registryConfigByPlugin(r.id??"",s)})},e[17]=s,e[18]=r.id,e[19]=a,e[20]=h):h=e[20];let c;e[21]!==p||e[22]!==h?(c={mutationFn:p,onSuccess:h},e[21]=p,e[22]=h,e[23]=c):c=e[23];const v=Ce(c),b=x.data?.config?.settings?.registryName??"Private Registry",k=x.data?.config?.settings?.registryIcon??"",R=x.data?.config?.settings?.llmConnectionId??"",y=x.data?.config?.settings?.llmModelId??"",f=x.data?.config?.settings?.acceptPublishRequests??!1,M=x.data?.config?.settings?.requireApiToken??!1,g=x.data?.config?.settings?.storePrivateOnly??!1,w=x.data?.config?.settings?.rateLimitEnabled??!0,E=x.data?.config?.settings?.rateLimitWindow==="minute"?"minute":"hour",C=x.data?.config?.settings?.rateLimitMax,I=typeof C=="number"&&C>=1?Math.floor(C):100;let N;return e[24]!==f||e[25]!==x.isLoading||e[26]!==w||e[27]!==I||e[28]!==E||e[29]!==k||e[30]!==R||e[31]!==y||e[32]!==b||e[33]!==M||e[34]!==v||e[35]!==g?(N={registryName:b,registryIcon:k,registryLLMConnectionId:R,registryLLMModelId:y,acceptPublishRequests:f,requireApiToken:M,storePrivateOnly:g,rateLimitEnabled:w,rateLimitWindow:E,rateLimitMax:I,isLoadingConfig:x.isLoading,saveRegistryConfigMutation:v},e[24]=f,e[25]=x.isLoading,e[26]=w,e[27]=I,e[28]=E,e[29]=k,e[30]=R,e[31]=y,e[32]=b,e[33]=M,e[34]=v,e[35]=g,e[36]=N):N=e[36],N}function nr(s){const e=X.c(15),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:pe,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=he(r);let l;e[2]!==n.id||e[3]!==s.sortBy||e[4]!==s.sortDirection||e[5]!==s.status?(l=W.publishRequestsListByOrg(n.id,s.status,s.sortBy,s.sortDirection),e[2]=n.id,e[3]=s.sortBy,e[4]=s.sortDirection,e[5]=s.status,e[6]=l):l=e[6];let a;e[7]!==o||e[8]!==s.sortBy||e[9]!==s.sortDirection||e[10]!==s.status?(a=async d=>{const{pageParam:m}=d;return _e(o,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:Ls,offset:m})},e[7]=o,e[8]=s.sortBy,e[9]=s.sortDirection,e[10]=s.status,e[11]=a):a=e[11];let i;return e[12]!==l||e[13]!==a?(i={queryKey:l,queryFn:a,initialPageParam:0,getNextPageParam:rr,staleTime:3e4,refetchOnMount:!0},e[12]=l,e[13]=a,e[14]=i):i=e[14],js(i)}function rr(s,e){const n=e.reduce(ir,0);return n<s.totalCount?n:void 0}function ir(s,e){return s+e.items.length}function lr(){const s=X.c(9),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]!==e.id?(o=W.publishRequestsCountByOrg(e.id),s[2]=e.id,s[3]=o):o=s[3];let l;s[4]!==r?(l=async()=>_e(r,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),s[4]=r,s[5]=l):l=s[5];let a;return s[6]!==o||s[7]!==l?(a={queryKey:o,queryFn:l,staleTime:3e4},s[6]=o,s[7]=l,s[8]=a):a=s[8],Fe(a)}function ar(){const s=X.c(17),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.publishRequests()})])},s[2]=e,s[3]=l):l=s[3];const a=l;let i;s[4]!==o?(i=async c=>_e(o,"REGISTRY_PUBLISH_REQUEST_REVIEW",c),s[4]=o,s[5]=i):i=s[5];let d;s[6]!==a||s[7]!==i?(d={mutationFn:i,onSuccess:a},s[6]=a,s[7]=i,s[8]=d):d=s[8];const m=Ce(d);let u;s[9]!==o?(u=async c=>_e(o,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:c}),s[9]=o,s[10]=u):u=s[10];let x;s[11]!==a||s[12]!==u?(x={mutationFn:u,onSuccess:a},s[11]=a,s[12]=u,s[13]=x):x=s[13];const p=Ce(x);let h;return s[14]!==p||s[15]!==m?(h={reviewMutation:m,deleteMutation:p},s[14]=p,s[15]=m,s[16]=h):h=s[16],h}function or(){const s=X.c(5),{org:e}=de();let n;s[0]!==e.id?(n={connectionId:pe,orgId:e.id},s[0]=e.id,s[1]=n):n=s[1];const r=he(n);let o;s[2]===Symbol.for("react.memo_cache_sentinel")?(o=W.publishApiKeys(),s[2]=o):o=s[2];let l;return s[3]!==r?(l={queryKey:o,queryFn:async()=>_e(r,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[3]=r,s[4]=l):l=s[4],Fe(l)}function cr(){const s=X.c(19),e=Le(),{org:n}=de();let r;s[0]!==n.id?(r={connectionId:pe,orgId:n.id},s[0]=n.id,s[1]=r):r=s[1];const o=he(r);let l;s[2]!==o?(l=async c=>_e(o,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:c}),s[2]=o,s[3]=l):l=s[3];let a;s[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[4]=e,s[5]=a):a=s[5];let i;s[6]!==l||s[7]!==a?(i={mutationFn:l,onSuccess:a},s[6]=l,s[7]=a,s[8]=i):i=s[8];const d=Ce(i);let m;s[9]!==o?(m=async c=>_e(o,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:c}),s[9]=o,s[10]=m):m=s[10];let u;s[11]!==e?(u=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[11]=e,s[12]=u):u=s[12];let x;s[13]!==m||s[14]!==u?(x={mutationFn:m,onSuccess:u},s[13]=m,s[14]=u,s[15]=x):x=s[15];const p=Ce(x);let h;return s[16]!==d||s[17]!==p?(h={generateMutation:d,revokeMutation:p},s[16]=d,s[17]=p,s[18]=h):h=s[18],h}function ds(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function ms(s){const e=[];let n="",r=!1;for(let o=0;o<s.length;o+=1){const l=s[o],a=s[o+1];if(l==='"'){r&&a==='"'?(n+='"',o+=1):r=!r;continue}if(l===","&&!r){e.push(n.trim()),n="";continue}n+=l}return e.push(n.trim()),e}const dr=["id","title"],mr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function ur(s){const e=s.split(/\r?\n/).map(m=>m.trim()).filter(Boolean);if(e.length<2)return{items:[],warnings:[{line:0,message:"CSV must have a header row and at least one data row"}],skipped:0};const n=ms(e[0]??""),r=new Map,o=[];n.forEach((m,u)=>{const x=m.toLowerCase().trim();x&&r.set(x,u)});for(const m of dr)r.has(m)||o.push({line:1,message:`Missing required column: "${m}"`});for(const m of n){const u=m.toLowerCase().trim();u&&!mr.includes(u)&&o.push({line:1,message:`Unknown column "${m}" will be ignored`})}if(!r.has("id")||!r.has("title"))return{items:[],warnings:o,skipped:0};const l=(m,u)=>{const x=r.get(u);return typeof x=="number"?m[x]??"":""},a=[],i=new Set;let d=0;for(let m=1;m<e.length;m+=1){const u=ms(e[m]??""),x=l(u,"id").trim(),p=l(u,"title").trim();if(!x){o.push({line:m+1,message:"Missing id — row skipped"}),d+=1;continue}if(!p){o.push({line:m+1,message:`Missing title for id="${x}" — row skipped`}),d+=1;continue}if(i.has(x)){o.push({line:m+1,message:`Duplicate id="${x}" — row skipped`}),d+=1;continue}i.add(x);const h=l(u,"description").trim(),c=l(u,"remote_url").trim(),b=l(u,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",k=ds(l(u,"tags")),R=ds(l(u,"categories")),y=l(u,"is_public").trim().toLowerCase(),f=y==="true"||y==="1"||y==="yes";a.push({id:x,title:p,description:h||null,is_public:f,_meta:{"mcp.mesh":{...k.length>0?{tags:k}:{},...R.length>0?{categories:R}:{}}},server:{name:x,title:p,description:h||void 0,remotes:c?[{type:b,url:c}]:[]}})}return{items:a,warnings:o,skipped:d}}const xr=`id,title,description,remote_url,remote_type,tags,categories,is_public
2
2
  my-mcp-server,My MCP Server,A useful MCP server,https://example.com/mcp,http,ai|tools,productivity,true
3
3
  another-server,Another Server,Another useful server,https://example2.com/mcp,http,data|analytics,data-processing,false`;function hr(){const s=new Blob([xr],{type:"text/csv;charset=utf-8"}),e=URL.createObjectURL(s),n=document.createElement("a");n.href=e,n.download="registry-import-template.csv",n.click(),URL.revokeObjectURL(e)}function pr(s){const e=X.c(63),{open:n,onOpenChange:r,isImporting:o,onImport:l}=s,a=o===void 0?!1:o,[i,d]=S.useState(null),[m,u]=S.useState(null),[x,p]=S.useState(null),h=S.useRef(null);let c;e[0]!==r?(c=Z=>{r(Z),Z||(d(null),u(null),p(null),h.current&&(h.current.value=""))},e[0]=r,e[1]=c):c=e[1];const v=c;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=async Z=>{if(!Z)return;p(Z.name),u(null);const ce=await Z.text();d(ur(ce))},e[2]=b):b=e[2];const k=b;let R;e[3]!==l||e[4]!==i?(R=async()=>{if(!i?.items.length)return;const Z=await l(i.items);u(Z)},e[3]=l,e[4]=i,e[5]=R):R=e[5];const y=R;let f;e[6]!==i?.items?(f=i?.items??[],e[6]=i?.items,e[7]=f):f=e[7];const M=f;let g;e[8]!==i?.warnings?(g=i?.warnings??[],e[8]=i?.warnings,e[9]=g):g=e[9];const w=g;let T;e[10]!==w?(T=w.some(vr),e[10]=w,e[11]=T):T=e[11];const E=T,C=m!==null;let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs(Et,{children:[t.jsx(Dt,{children:"Import MCP Servers from CSV"}),t.jsx($t,{children:"Upload a CSV file to bulk-import MCP servers into the registry."})]}),e[12]=I):I=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=()=>h.current?.click(),e[13]=N):N=e[13];let A;e[14]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(as,{size:14}),e[14]=A):A=e[14];const L=x?"Change file":"Choose CSV file";let P;e[15]!==a||e[16]!==L?(P=t.jsxs(G,{variant:"outline",size:"sm",className:"gap-1.5",onClick:N,disabled:a,children:[A,L]}),e[15]=a,e[16]=L,e[17]=P):P=e[17];let D;e[18]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx("input",{ref:h,type:"file",accept:".csv,text/csv",className:"hidden",onChange:Z=>k(Z.target.files?.[0]??null)}),e[18]=D):D=e[18];let $;e[19]!==x?($=x&&t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),e[19]=x,e[20]=$):$=e[20];let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex-1"}),e[21]=z):z=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(G,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:hr,children:[t.jsx(_n,{size:14}),"Download template"]}),e[22]=O):O=e[22];let B;e[23]!==P||e[24]!==$?(B=t.jsxs("div",{className:"flex items-center gap-3",children:[P,D,$,z,O]}),e[23]=P,e[24]=$,e[25]=B):B=e[25];let Q;e[26]!==w?(Q=w.length>0&&t.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 dark:border-yellow-900 dark:bg-yellow-950/30 p-3 grid gap-1",children:w.map(jr)}),e[26]=w,e[27]=Q):Q=e[27];let j;e[28]!==M||e[29]!==i?(j=M.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium",children:"Preview"}),t.jsxs(F,{variant:"secondary",children:[M.length," items"]}),i?.skipped?t.jsxs(F,{variant:"outline",className:"text-yellow-600",children:[i.skipped," skipped"]}):null]}),t.jsx("div",{className:"border rounded-lg overflow-hidden",children:t.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:t.jsxs(vs,{children:[t.jsx(bs,{children:t.jsxs(Pt,{children:[t.jsx(Ie,{className:"w-[140px]",children:"ID"}),t.jsx(Ie,{children:"Title"}),t.jsx(Ie,{children:"Remote URL"}),t.jsx(Ie,{className:"w-[80px] text-center",children:"Public"}),t.jsx(Ie,{children:"Tags"})]})}),t.jsx(ys,{children:M.map(gr)})]})})})]}),e[28]=M,e[29]=i,e[30]=j):j=e[30];let U;e[31]!==m?(U=m&&t.jsxs("div",{className:"rounded-lg border p-3 grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[t.jsx(it,{size:16,className:"text-emerald-600"}),"Imported ",m.created," item(s) successfully"]}),m.errors.length>0&&t.jsx("div",{className:"grid gap-1 mt-1",children:m.errors.map(fr)})]}),e[31]=m,e[32]=U):U=e[32];let K;e[33]!==C||e[34]!==i?(K=!i&&!C&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t.jsx(as,{size:32,className:"text-muted-foreground/40 mb-3"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a CSV file or download the template to get started."}),t.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Required columns: ",t.jsx("code",{children:"id"}),", ",t.jsx("code",{children:"title"}),". Optional:"," ",t.jsx("code",{children:"description"}),", ",t.jsx("code",{children:"remote_url"}),","," ",t.jsx("code",{children:"remote_type"}),", ",t.jsx("code",{children:"tags"}),","," ",t.jsx("code",{children:"categories"}),", ",t.jsx("code",{children:"is_public"}),"."]}),t.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Use ",t.jsx("code",{children:"|"})," or ",t.jsx("code",{children:";"})," to separate multiple tags/categories within a cell."]})]}),e[33]=C,e[34]=i,e[35]=K):K=e[35];let te;e[36]!==B||e[37]!==Q||e[38]!==j||e[39]!==U||e[40]!==K?(te=t.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[B,Q,j,U,K]}),e[36]=B,e[37]=Q,e[38]=j,e[39]=U,e[40]=K,e[41]=te):te=e[41];let se;e[42]!==v?(se=()=>v(!1),e[42]=v,e[43]=se):se=e[43];const le=C?"Done":"Cancel";let ae;e[44]!==se||e[45]!==le?(ae=t.jsx(G,{variant:"outline",onClick:se,children:le}),e[44]=se,e[45]=le,e[46]=ae):ae=e[46];let me;e[47]!==y||e[48]!==E||e[49]!==C||e[50]!==a||e[51]!==M.length?(me=!C&&t.jsx(G,{onClick:y,disabled:a||M.length===0||E,children:a?"Importing...":`Import ${M.length} item(s)`}),e[47]=y,e[48]=E,e[49]=C,e[50]=a,e[51]=M.length,e[52]=me):me=e[52];let ue;e[53]!==ae||e[54]!==me?(ue=t.jsxs(At,{className:"gap-2 sm:gap-0",children:[ae,me]}),e[53]=ae,e[54]=me,e[55]=ue):ue=e[55];let _;e[56]!==te||e[57]!==ue?(_=t.jsxs(Lt,{className:"sm:max-w-3xl max-h-[85vh] flex flex-col",children:[I,te,ue]}),e[56]=te,e[57]=ue,e[58]=_):_=e[58];let J;return e[59]!==v||e[60]!==n||e[61]!==_?(J=t.jsx(Ot,{open:n,onOpenChange:v,children:_}),e[59]=v,e[60]=n,e[61]=_,e[62]=J):J=e[62],J}function fr(s){return t.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[t.jsx(xt,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[t.jsx("span",{className:"font-mono",children:s.id}),": ",s.error]})]},s.id)}function gr(s){return t.jsxs(Pt,{children:[t.jsx(Me,{className:"font-mono text-xs",children:s.id}),t.jsx(Me,{className:"text-sm",children:s.title}),t.jsx(Me,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:s.server.remotes?.[0]?.url??t.jsx("span",{className:"italic",children:"none"})}),t.jsx(Me,{className:"text-center",children:s.is_public?t.jsx(F,{variant:"secondary",className:"text-[10px] bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400",children:"Yes"}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"No"})}),t.jsx(Me,{className:"text-xs text-muted-foreground",children:(s._meta?.["mcp.mesh"]?.tags??[]).join(", ")||"-"})]},s.id)}function jr(s,e){return t.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-400 flex items-start gap-1.5",children:[t.jsx(xt,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[s.line>0&&t.jsxs("span",{className:"font-mono text-[10px] mr-1",children:["Line ",s.line,":"]}),s.message]})]},`${s.line}-${e}`)}function vr(s){return s.message.startsWith("Missing required column:")}function br(s){const e=X.c(19),{open:n,onOpenChange:r,title:o,isDeleting:l,onConfirm:a}=s,i=l===void 0?!1:l;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(ht,{children:"Delete registry item?"}),e[0]=d):d=e[0];let m;e[1]!==o?(m=t.jsxs(pt,{children:[d,t.jsxs(ft,{children:["This action cannot be undone. Item ",t.jsx("strong",{children:o})," will be permanently removed from this private registry."]})]}),e[1]=o,e[2]=m):m=e[2];let u;e[3]!==i?(u=t.jsx(gt,{disabled:i,children:"Cancel"}),e[3]=i,e[4]=u):u=e[4];const x=i?"Deleting...":"Delete";let p;e[5]!==i||e[6]!==a||e[7]!==x?(p=t.jsx(jt,{disabled:i,onClick:a,children:x}),e[5]=i,e[6]=a,e[7]=x,e[8]=p):p=e[8];let h;e[9]!==u||e[10]!==p?(h=t.jsxs(vt,{children:[u,p]}),e[9]=u,e[10]=p,e[11]=h):h=e[11];let c;e[12]!==m||e[13]!==h?(c=t.jsxs(bt,{children:[m,h]}),e[12]=m,e[13]=h,e[14]=c):c=e[14];let v;return e[15]!==r||e[16]!==n||e[17]!==c?(v=t.jsx(yt,{open:n,onOpenChange:r,children:c}),e[15]=r,e[16]=n,e[17]=c,e[18]=v):v=e[18],v}function yr(s){const[e]=s.id.split("/");return e??"provider"}function Nr(s){return s._meta?.["mcp.mesh"]?.tags??[]}function wr(s){return s._meta?.["mcp.mesh"]?.categories??[]}function Cr(s){return s.server?.icons?.[0]?.src??null}function _r(s){const e=X.c(77),{item:n,onEdit:r,onDelete:o,onToggleVerified:l,onToggleOfficial:a}=s;let i;e[0]!==n?(i=Cr(n),e[0]=n,e[1]=i):i=e[1];const d=i,m=n._meta?.["mcp.mesh"]?.verified===!0,u=n._meta?.["mcp.mesh"]?.official===!0;let x;e[2]!==n?(x=[...Nr(n),...wr(n)],e[2]=n,e[3]=x):x=e[3];const p=x;let h;e[4]!==p?(h=p.slice(0,3),e[4]=p,e[5]=h):h=e[5];const c=h,v=Math.max(0,p.length-c.length);let b;e[6]!==d||e[7]!==n.title?(b=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:d?t.jsx("img",{src:d,alt:n.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n.title.charAt(0).toUpperCase()})}),e[6]=d,e[7]=n.title,e[8]=b):b=e[8];let k;e[9]!==n.title?(k=t.jsx("p",{className:"font-medium truncate",children:n.title}),e[9]=n.title,e[10]=k):k=e[10];let R;e[11]!==n?(R=yr(n),e[11]=n,e[12]=R):R=e[12];let y;e[13]!==R?(y=t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:R}),e[13]=R,e[14]=y):y=e[14];let f;e[15]!==n.is_public?(f=n.is_public?t.jsxs(F,{variant:"default",className:"gap-1",children:[t.jsx(Ns,{size:10}),"Public"]}):t.jsx(F,{variant:"secondary",children:"Private"}),e[15]=n.is_public,e[16]=f):f=e[16];let M;e[17]!==u?(M=u&&t.jsxs(F,{variant:"outline",className:"gap-1 text-primary",children:[t.jsx(os,{size:10}),"Official"]}),e[17]=u,e[18]=M):M=e[18];let g;e[19]!==u||e[20]!==m?(g=!u&&m&&t.jsxs(F,{variant:"outline",className:"gap-1 text-success",children:[t.jsx(os,{size:10}),"Verified"]}),e[19]=u,e[20]=m,e[21]=g):g=e[21];let w;e[22]!==g||e[23]!==y||e[24]!==f||e[25]!==M?(w=t.jsxs("div",{className:"flex items-center gap-2",children:[y,f,M,g]}),e[22]=g,e[23]=y,e[24]=f,e[25]=M,e[26]=w):w=e[26];let T;e[27]!==w||e[28]!==k?(T=t.jsxs("div",{className:"min-w-0 flex-1",children:[k,w]}),e[27]=w,e[28]=k,e[29]=T):T=e[29];let E;e[30]!==T||e[31]!==b?(E=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b,T]}),e[30]=T,e[31]=b,e[32]=E):E=e[32];let C;e[33]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Tt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:t.jsx(Ht,{size:18})})}),e[33]=C):C=e[33];let I;e[34]!==n||e[35]!==r?(I=t.jsx(Ee,{onClick:()=>r(n),children:"Edit"}),e[34]=n,e[35]=r,e[36]=I):I=e[36];let N;e[37]!==n||e[38]!==l?(N=()=>l(n),e[37]=n,e[38]=l,e[39]=N):N=e[39];const A=m?"Unmark as Verified":"Mark as Verified";let L;e[40]!==N||e[41]!==A?(L=t.jsx(Ee,{onClick:N,children:A}),e[40]=N,e[41]=A,e[42]=L):L=e[42];let P;e[43]!==n||e[44]!==a?(P=()=>a(n),e[43]=n,e[44]=a,e[45]=P):P=e[45];const D=u?"Unmark as Official":"Mark as Official";let $;e[46]!==P||e[47]!==D?($=t.jsx(Ee,{onClick:P,children:D}),e[46]=P,e[47]=D,e[48]=$):$=e[48];let z;e[49]!==n||e[50]!==o?(z=()=>o(n),e[49]=n,e[50]=o,e[51]=z):z=e[51];let O;e[52]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(wt,{size:14}),e[52]=O):O=e[52];let B;e[53]!==z?(B=t.jsxs(Ee,{variant:"destructive",onClick:z,children:[O,"Delete"]}),e[53]=z,e[54]=B):B=e[54];let Q;e[55]!==I||e[56]!==L||e[57]!==$||e[58]!==B?(Q=t.jsxs(It,{children:[C,t.jsxs(Mt,{align:"end",children:[I,L,$,B]})]}),e[55]=I,e[56]=L,e[57]=$,e[58]=B,e[59]=Q):Q=e[59];let j;e[60]!==E||e[61]!==Q?(j=t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[E,Q]}),e[60]=E,e[61]=Q,e[62]=j):j=e[62];const U=n._meta?.["mcp.mesh"]?.short_description||n.description||n.server.description||"No description provided.";let K;e[63]!==U?(K=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:U}),e[63]=U,e[64]=K):K=e[64];let te;e[65]!==n.id||e[66]!==c?(te=c.map(me=>t.jsx(F,{variant:"secondary",children:me},`${n.id}-badge-${me}`)),e[65]=n.id,e[66]=c,e[67]=te):te=e[67];let se;e[68]!==v?(se=v>0&&t.jsxs(F,{variant:"outline",children:["+",v]}),e[68]=v,e[69]=se):se=e[69];let le;e[70]!==te||e[71]!==se?(le=t.jsxs("div",{className:"flex flex-wrap gap-1",children:[te,se]}),e[70]=te,e[71]=se,e[72]=le):le=e[72];let ae;return e[73]!==j||e[74]!==K||e[75]!==le?(ae=t.jsxs(oe,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[j,K,le]}),e[73]=j,e[74]=K,e[75]=le,e[76]=ae):ae=e[76],ae}function zs(s){const e=X.c(27),{value:n,onChange:r,onFileUpload:o,error:l,isUploading:a}=s,i=a===void 0?!1:a,[d,m]=S.useState(!1),[u,x]=S.useState(!1),p=S.useRef(null);let h;e[0]!==i?(h=I=>{I.preventDefault(),i||m(!0)},e[0]=i,e[1]=h):h=e[1];const c=h;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=I=>{I.preventDefault(),m(!1)},e[2]=v):v=e[2];const b=v;let k;e[3]!==i||e[4]!==o?(k=async I=>{if(I.preventDefault(),m(!1),i)return;const N=I.dataTransfer.files[0];N&&await o(N)},e[3]=i,e[4]=o,e[5]=k):k=e[5];const R=k;let y;e[6]!==i||e[7]!==o?(y=async I=>{const N=I.target.files?.[0];N&&!i&&await o(N),I.target.value=""},e[6]=i,e[7]=o,e[8]=y):y=e[8];const f=y,M=n.length>0;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(re,{children:"Image"}),e[9]=g):g=e[9];let w;e[10]!==c||e[11]!==R||e[12]!==M||e[13]!==d||e[14]!==i||e[15]!==r||e[16]!==u||e[17]!==n?(w=M?t.jsx("div",{className:"relative group min-h-[180px] rounded-xl border border-border overflow-hidden bg-muted/10",children:t.jsxs("div",{className:"flex items-center gap-3 p-3 h-full",children:[t.jsx("div",{className:"size-20 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:t.jsx("img",{src:n,alt:"Preview",className:"w-full h-full object-cover"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n}),t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>p.current?.click(),disabled:i,children:[t.jsx(Wt,{className:"size-3"}),"Change"]}),t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{r(""),x(!1)},disabled:i,children:[t.jsx(wt,{className:"size-3"}),"Remove"]})]})]})]})}):i?t.jsxs("div",{className:"relative min-h-[180px] rounded-xl border border-border bg-muted/10 flex flex-col items-center justify-center gap-3",children:[t.jsx(et,{className:"size-8 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Uploading image..."})]}):t.jsxs("div",{className:ee("relative min-h-[180px] rounded-xl border-2 border-dashed transition-colors cursor-pointer flex flex-col",d?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30"),onDragOver:c,onDragLeave:b,onDrop:R,onClick:()=>p.current?.click(),children:[t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-6 px-4 flex-1",children:[t.jsx("div",{className:ee("size-10 rounded-lg flex items-center justify-center transition-colors",d?"bg-primary/10 text-primary":"bg-muted/50 text-muted-foreground"),children:t.jsx(Es,{size:20})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:d?"Drop image here":"Click or drag to upload"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"PNG, JPG, SVG up to 2MB"})]})]}),u?t.jsx("div",{className:"border-t border-border px-3 py-2",onClick:kr,children:t.jsx(xe,{placeholder:"https://example.com/logo.png",value:n,className:"text-xs h-8",onChange:I=>r(I.target.value)})}):t.jsx("div",{className:"border-t border-border px-4 py-2",children:t.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors w-full justify-center",onClick:I=>{I.stopPropagation(),x(!0)},children:[t.jsx(Mn,{className:"size-3"}),"Or paste an image URL"]})})]}),e[10]=c,e[11]=R,e[12]=M,e[13]=d,e[14]=i,e[15]=r,e[16]=u,e[17]=n,e[18]=w):w=e[18];let T;e[19]!==f?(T=t.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:f}),e[19]=f,e[20]=T):T=e[20];let E;e[21]!==l?(E=l&&t.jsx("p",{className:"text-xs text-destructive",children:l}),e[21]=l,e[22]=E):E=e[22];let C;return e[23]!==w||e[24]!==T||e[25]!==E?(C=t.jsxs("div",{className:"grid gap-1.5",children:[g,w,T,E]}),e[23]=w,e[24]=T,e[25]=E,e[26]=C):C=e[26],C}function kr(s){return s.stopPropagation()}function Us(){const[s,e]=S.useState("idle"),[n,r]=S.useState(null),{org:o}=de(),l=he({connectionId:pe,orgId:o.id});return{discover:async(d,m)=>{if(!d)return null;e("loading"),r(null);try{const u=await l.callTool({name:"REGISTRY_DISCOVER_TOOLS",arguments:{url:d,type:m==="sse"?"sse":"http"}}),x=u.structuredContent??u;if(u.isError){const p=u.content?.find(h=>h.type==="text")?.text??"Tool returned an error";return r(p),e("error"),null}return x.error?Sr(x.error)?(r(x.error),e("auth_required"),null):(r(x.error),e("error"),null):!x.tools||x.tools.length===0?(r("No tools found on this MCP server."),e("error"),null):(e("success"),x.tools)}catch(u){const x=u instanceof Error?u.message:String(u);return r(x||"Could not discover tools."),e("error"),null}},discoverStatus:s,discoverError:n,resetDiscover:()=>{e("idle"),r(null)}}}function Sr(s){const e=s.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function Rr(s){const e=X.c(54),{tools:n,onChange:r,remoteUrl:o,remoteType:l,externalDiscoverStatus:a,externalDiscoverError:i}=s,[d,m]=S.useState(n.length>0),{discover:u,discoverStatus:x,discoverError:p,resetDiscover:h}=Us(),c=a??x,v=i??p;let b;e[0]!==u||e[1]!==r||e[2]!==l||e[3]!==o?(b=async()=>{if(!o)return;const O=await u(o,l??"http");O&&(r(O),m(!0))},e[0]=u,e[1]=r,e[2]=l,e[3]=o,e[4]=b):b=e[4];const k=b;let R;e[5]!==r||e[6]!==h?(R=()=>{r([]),h()},e[5]=r,e[6]=h,e[7]=R):R=e[7];const y=R;let f;e[8]!==d?(f=()=>m(!d),e[8]=d,e[9]=f):f=e[9];let M,g;e[10]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Jt,{size:14,className:"text-muted-foreground"}),g=t.jsx("span",{children:"Tools"}),e[10]=M,e[11]=g):(M=e[10],g=e[11]);let w;e[12]!==n.length?(w=n.length>0&&t.jsx(F,{variant:"secondary",className:"text-xs px-1.5 py-0",children:n.length}),e[12]=n.length,e[13]=w):w=e[13];let T;e[14]!==d?(T=d?t.jsx(kn,{size:14,className:"text-muted-foreground"}):t.jsx(Rs,{size:14,className:"text-muted-foreground"}),e[14]=d,e[15]=T):T=e[15];let E;e[16]!==f||e[17]!==w||e[18]!==T?(E=t.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:f,children:[M,g,w,T]}),e[16]=f,e[17]=w,e[18]=T,e[19]=E):E=e[19];let C;e[20]!==y||e[21]!==n.length?(C=n.length>0&&t.jsxs(G,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:y,children:[t.jsx(wt,{size:12}),"Clear"]}),e[20]=y,e[21]=n.length,e[22]=C):C=e[22];let I;e[23]!==c||e[24]!==k||e[25]!==o||e[26]!==n.length?(I=o&&t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all",onClick:k,disabled:c==="loading",children:[c==="loading"?t.jsx(et,{size:12,className:"animate-spin"}):t.jsx(Wt,{size:12}),c==="loading"?"Discovering...":n.length>0?"Refresh":"Auto-discover"]}),e[23]=c,e[24]=k,e[25]=o,e[26]=n.length,e[27]=I):I=e[27];let N;e[28]!==I||e[29]!==C?(N=t.jsxs("div",{className:"flex items-center gap-2",children:[C,I]}),e[28]=I,e[29]=C,e[30]=N):N=e[30];let A;e[31]!==N||e[32]!==E?(A=t.jsxs("div",{className:"flex items-center justify-between",children:[E,N]}),e[31]=N,e[32]=E,e[33]=A):A=e[33];let L;e[34]!==c||e[35]!==n.length?(L=c==="success"&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-950/30 rounded-lg px-3 py-2",children:[t.jsx(it,{size:14,className:"shrink-0"}),t.jsxs("span",{children:["Discovered ",n.length," tool",n.length!==1?"s":""," ","successfully."]})]}),e[34]=c,e[35]=n.length,e[36]=L):L=e[36];let P;e[37]!==v||e[38]!==c?(P=c==="error"&&v&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(xt,{size:14,className:"shrink-0"}),t.jsx("span",{children:v})]}),e[37]=v,e[38]=c,e[39]=P):P=e[39];let D;e[40]!==d||e[41]!==n?(D=d&&n.length>0&&t.jsx("div",{className:"rounded-xl border border-border divide-y divide-border overflow-hidden max-h-48 overflow-y-auto",children:n.map(Tr)}),e[40]=d,e[41]=n,e[42]=D):D=e[42];let $;e[43]!==c||e[44]!==d||e[45]!==o||e[46]!==n.length?($=d&&n.length===0&&c==="idle"&&t.jsx("p",{className:"text-xs text-muted-foreground px-1",children:o?'Click "Auto-discover" to load tools from the MCP server.':"Add a Remote URL first, then tools can be auto-discovered."}),e[43]=c,e[44]=d,e[45]=o,e[46]=n.length,e[47]=$):$=e[47];let z;return e[48]!==A||e[49]!==L||e[50]!==P||e[51]!==D||e[52]!==$?(z=t.jsxs("div",{className:"space-y-3",children:[A,L,P,D,$]}),e[48]=A,e[49]=L,e[50]=P,e[51]=D,e[52]=$,e[53]=z):z=e[53],z}function Tr(s){return t.jsx("div",{className:"flex items-center gap-3 px-3 py-2",children:t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-mono truncate",children:s.name}),s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description})]})},s.name)}function qs(s){const{org:e}=de(),[n,r]=S.useState(!1),l=typeof window<"u"&&window.location.hostname==="localhost"?`${e.id}_dev-assets`:null,a=he({connectionId:l??"noop",orgId:e.id});return{uploadImage:async(d,m)=>{if(!l)return H.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!d.type.startsWith("image/"))return H.error("Only image files are supported"),null;if(d.size>5*1024*1024)return H.error("Image size must be less than 5MB"),null;r(!0);try{const u=await a.callTool({name:"PUT_PRESIGNED_URL",arguments:{key:m,contentType:d.type}}),x=u.structuredContent?.url||u.url;if(!x)throw new Error("Failed to get presigned URL");const p=await fetch(x,{method:"PUT",body:d,headers:{"Content-Type":d.type}});if(!p.ok)throw new Error(`Upload failed: ${p.statusText}`);const h=await a.callTool({name:"GET_PRESIGNED_URL",arguments:{key:m,expiresIn:31536e3}}),c=h.structuredContent?.url||h.url;if(!c)throw new Error("Failed to get public URL");return c}catch(u){return console.error("Image upload failed:",u),H.error(u instanceof Error?u.message:"Failed to upload image. Please try again."),null}finally{r(!1)}},isUploading:n}}function Ir(){const{org:s}=de(),[e,n]=S.useState(null),r=S.useRef(0),o=he({connectionId:pe,orgId:s.id});return{generate:async a=>{r.current+=1,n(a.type);try{const i=await o.callTool({name:"REGISTRY_AI_GENERATE",arguments:a});if(i.isError){const d=i.content?.find(m=>m.type==="text")?.text??"Failed to generate content";throw new Error(d)}return i.structuredContent??i}finally{r.current-=1,r.current===0&&n(null)}},loadingType:e,isGenerating:e!==null}}const Mr=new Set(["http","sse","stdio"]),Pr=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,us=["internal","automation","support","sales","ops","ai"],Fs=["productivity","communication","customer-support","development","data","operations"],Er=["Essentials","Details","Advanced"],nt="h-7 text-xs border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all";function xs(s){return s.replace(/^https?:\/\//i,"").trim()}function rt(s){const e=s.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function Ye(s){return s.trim().toLowerCase()}function Nt(s){return Array.from(new Set(s.map(Ye).filter(e=>e.length>0)))}function Ze(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function Dr(s){const e=X.c(4),{current:n}=s;let r;e[0]!==n?(r=Er.map((l,a)=>{const i=a+1,d=i===n,m=i<n;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[a>0&&t.jsx("div",{className:ee("w-4 h-px",m?"bg-primary":"bg-border")}),t.jsxs("div",{className:ee("flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs transition-colors",d?"bg-primary/10 text-primary font-medium":m?"text-primary":"text-muted-foreground"),children:[t.jsx("span",{className:ee("size-5 rounded-full inline-flex items-center justify-center text-[10px] font-semibold shrink-0",d?"bg-primary text-primary-foreground":m?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:i}),t.jsx("span",{className:"hidden sm:inline",children:l})]})]},l)}),e[0]=n,e[1]=r):r=e[1];let o;return e[2]!==r?(o=t.jsx("div",{className:"flex items-center gap-1.5",children:r}),e[2]=r,e[3]=o):o=e[3],o}function $r(s){const e=X.c(28),{id:n,label:r,values:o,availableOptions:l,placeholder:a,onChange:i}=s,[d,m]=S.useState(""),[u,x]=S.useState(!1);let p,h,c,v,b;if(e[0]!==l||e[1]!==n||e[2]!==d||e[3]!==u||e[4]!==r||e[5]!==i||e[6]!==a||e[7]!==o){const y=Nt(l),f=Nt(o),M=new Set(f),g=Ye(d),w=y.filter(P=>!M.has(P)).filter(P=>g?P.includes(g):!0).slice(0,8),T=P=>{const D=Ye(P);!D||M.has(D)||i([...f,D])},E=P=>{i(f.filter(D=>D!==P))},C=()=>{const P=d.split(/[,\n;]/).map(Ye).filter(Boolean);if(P.length===0)return;const D=[...f];for(const $ of P)D.includes($)||D.push($);i(D),m("")},I=g;v="grid gap-2",e[13]!==n||e[14]!==r?(b=t.jsx(re,{htmlFor:n,children:r}),e[13]=n,e[14]=r,e[15]=b):b=e[15],p="relative";let N;e[16]!==n?(N=()=>{const P=document.getElementById(n);P instanceof HTMLInputElement&&P.focus()},e[16]=n,e[17]=N):N=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=()=>x(!0),e[18]=A):A=e[18];let L;e[19]===Symbol.for("react.memo_cache_sentinel")?(L=P=>m(P.target.value),e[19]=L):L=e[19],h=t.jsx("div",{className:"min-h-9 w-full rounded-xl border border-input bg-background px-2.5 py-1.5 text-sm focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",onClick:N,children:t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[f.map(P=>t.jsxs(F,{variant:"secondary",className:"gap-1",children:[P,t.jsx("button",{type:"button",onClick:D=>{D.preventDefault(),D.stopPropagation(),E(P)},children:t.jsx(In,{size:12})})]},`${n}-${P}`)),t.jsx("input",{id:n,className:"flex-1 min-w-[120px] bg-transparent outline-none border-none text-sm",placeholder:f.length?"":a,value:d,onFocus:A,onBlur:()=>{x(!1),C()},onChange:L,onKeyDown:P=>{if(P.key==="Enter"||P.key===","){P.preventDefault(),C();return}P.key==="Backspace"&&!d&&f.length&&E(f[f.length-1]??"")}})]})}),c=u&&t.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-xl border border-border bg-background shadow-lg max-h-56 overflow-y-auto",children:w.length>0?w.map(P=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:Lr,onClick:()=>{T(P),m("")},children:P},`${n}-suggestion-${P}`)):I?t.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:Ar,onClick:()=>{T(I),m("")},children:['Create "',I,'"']}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})}),e[0]=l,e[1]=n,e[2]=d,e[3]=u,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=p,e[9]=h,e[10]=c,e[11]=v,e[12]=b}else p=e[8],h=e[9],c=e[10],v=e[11],b=e[12];let k;e[20]!==p||e[21]!==h||e[22]!==c?(k=t.jsxs("div",{className:p,children:[h,c]}),e[20]=p,e[21]=h,e[22]=c,e[23]=k):k=e[23];let R;return e[24]!==v||e[25]!==b||e[26]!==k?(R=t.jsxs("div",{className:v,children:[b,k]}),e[24]=v,e[25]=b,e[26]=k,e[27]=R):R=e[27],R}function Ar(s){return s.preventDefault()}function Lr(s){return s.preventDefault()}function Or({id:s,value:e,availableOptions:n,onChange:r}){const[o,l]=S.useState(e),[a,i]=S.useState(!1),d=S.useRef(e);d.current!==e&&(d.current=e,l(e));const m=Nt([...Fs,...n,e]).filter(Boolean),u=Ye(o),x=m.filter(h=>u?h.includes(u):!0).slice(0,8),p=h=>{const c=Ye(h);r(c),l(c),i(!1)};return t.jsxs("div",{className:"grid gap-2",children:[t.jsx(re,{htmlFor:s,children:"Category"}),t.jsxs("div",{className:"relative",children:[t.jsx(xe,{id:s,className:"h-9 text-sm",placeholder:"Select or create category",value:o,onFocus:()=>{l(e),i(!0)},onBlur:()=>{p(o)},onChange:h=>l(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.preventDefault(),p(o))}}),e&&t.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground hover:text-foreground",onMouseDown:h=>h.preventDefault(),onClick:()=>{r(""),l("")},children:"clear"}),a&&t.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-xl border border-border bg-background shadow-lg max-h-56 overflow-y-auto",children:x.length>0?x.map(h=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:c=>c.preventDefault(),onClick:()=>p(h),children:h},`${s}-${h}`)):u?t.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:h=>h.preventDefault(),onClick:()=>p(u),children:['Create "',u,'"']}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})})]})]})}function zr({open:s,onOpenChange:e,item:n,draft:r,availableTags:o=[],availableCategories:l=[],defaultLLMConnectionId:a="",defaultLLMModelId:i="",isSubmitting:d=!1,onSubmit:m}){const{org:u}=de(),{uploadImage:x,isUploading:p}=qs(),{generate:h,loadingType:c}=Ir(),{discover:v,discoverStatus:b,discoverError:k,resetDiscover:R}=Us(),y=!!n,f=r?._meta?.["mcp.mesh"],M=n?.title??r?.title??"",g=n?.id?.split("/")[0]??r?.id?.split("/")[0]??"",w=n?.description??r?.description??"",T=n?._meta?.["mcp.mesh"]?.short_description??f?.short_description??"",E=n?._meta?.["mcp.mesh"]?.owner??f?.owner??"",C=n?.server?.repository?.url??r?.server?.repository?.url??"",I=n?._meta?.["mcp.mesh"]?.readme??f?.readme??"",N=n?._meta?.["mcp.mesh"]?.readme_url??f?.readme_url??"",A=xs(n?.server?.remotes?.[0]?.url??r?.server?.remotes?.[0]?.url??""),L=n?.server?.remotes?.[0]?.type??r?.server?.remotes?.[0]?.type??"http",P=n?._meta?.["mcp.mesh"]?.tags??f?.tags??[],D=n?._meta?.["mcp.mesh"]?.categories?.[0]??f?.categories?.[0]??"",$=n?.server?.icons?.[0]?.src??r?.server?.icons?.[0]?.src??"",z=n?._meta?.["mcp.mesh"]?.tools??f?.tools??[],O=n?.is_public??r?.is_public??!1,B=n?._meta?.["mcp.mesh"]?.verified??f?.verified??!1,Q=n?._meta?.["mcp.mesh"]?.official??f?.official??!1,[j,U]=S.useState(1),[K,te]=S.useState(M),[se,le]=S.useState(g),[ae,me]=S.useState(w),[ue,_]=S.useState(T),[J,Z]=S.useState(E),[ce,fe]=S.useState(C),[ke,ye]=S.useState(I),[ie,De]=S.useState(N),[Te,$e]=S.useState(I?"content":"link"),[ne,je]=S.useState(A),[Ne,be]=S.useState(L),[Oe,Ae]=S.useState(P),[Se,Be]=S.useState(D),[He,lt]=S.useState($),[we,tt]=S.useState(z),[V,ge]=S.useState(O),[st,Ge]=S.useState(B),[_t,at]=S.useState(Q),[ve,ot]=S.useState({}),We=!!(a&&i),es=()=>{U(1),te(M),le(g),me(w),_(T),Z(E),fe(C),ye(I),De(N),$e(I?"content":"link"),je(A),be(L),Ae(P),Be(D),lt($),tt(z),ge(O),Ge(B),at(Q),ot({}),R(),kt.current="",Qe.current&&(clearTimeout(Qe.current),Qe.current=null)},Ys=async q=>{if(!q)return;const Y=y?n?.id:`${se}/${K}`.toLowerCase(),Re=Ze(Y||"temp"),ze=q.name.split(".").pop()||"png",Ue=`registry/${u.id}/${Re}/icon.${ze}`,Je=await x(q,Ue);Je?(lt(Je),ot(qe=>({...qe,imageUrl:void 0}))):ot(qe=>({...qe,imageUrl:"Failed to upload image. Please try again."}))},Qe=S.useRef(null),kt=S.useRef(""),Ft=S.useRef(Ne);Ft.current=Ne;const ts=q=>{!q&&Qe.current&&(clearTimeout(Qe.current),Qe.current=null),e(q),q||es()},Hs=async()=>{const q=rt(ne);if(!q)return;kt.current=q;const Y=await v(q,Ft.current);Y&&tt(Y)},Ws=q=>{Qe.current&&clearTimeout(Qe.current);const Y=rt(q);!Y||Y===kt.current||q.includes(".")&&(Qe.current=setTimeout(async()=>{kt.current=Y;const Re=await v(Y,Ft.current);Re&&tt(Re)},800))},ct=()=>We?{llmConnectionId:a,modelId:i}:null,dt=()=>({name:K.trim(),provider:se.trim(),url:rt(ne),owner:J.trim(),repositoryUrl:ce.trim(),description:ae.trim(),shortDescription:ue.trim(),tags:Oe,categories:Se?[Se]:[],availableTags:[...us,...o],availableCategories:[...Fs,...l],tools:we}),Js=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"description",context:dt()});Y.result&&me(Y.result.slice(0,1500))},Zs=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"short_description",context:dt()});Y.result&&_(Y.result.slice(0,160))},Xs=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"tags",context:dt()});Y.items?.length&&Ae(Nt(Y.items))},en=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"categories",context:dt()});Y.items?.[0]&&Be(Ye(Y.items[0]))},tn=async()=>{const q=ct();if(!q)return;const Y=await h({...q,type:"readme",context:dt()});Y.result&&(ye(Y.result.slice(0,5e4)),$e("content"))},ss=q=>{const Y={};if(q===1){const Re=Ze(se),ze=Ze(K),Ue=`${Re}/${ze}`;K.trim()||(Y.title="Name is required."),y||(Re?ze?Pr.test(Ue)||(Y.provider="Use lowercase letters/numbers and separators '/' or '-'."):Y.title="Name must contain valid characters.":Y.provider="Provider is required.");const Je=rt(ne),qe=Ne.trim().toLowerCase();if(qe!=="stdio"&&Je)try{const mt=new URL(Je);["http:","https:"].includes(mt.protocol)||(Y.remoteUrl="Remote URL must be http(s).")}catch{Y.remoteUrl="Remote URL is invalid."}if(qe&&!Mr.has(qe)&&(Y.remoteType="Remote type must be: http, sse or stdio."),He.trim()&&!He.trim().startsWith("data:image/"))try{const Bt=new URL(He.trim());["http:","https:"].includes(Bt.protocol)||(Y.imageUrl="Image URL must be http(s).")}catch{Y.imageUrl="Image URL is invalid."}}if(q===2&&(ae.length>1500&&(Y.description="Description must be 1500 characters or less."),ue.trim().length>160&&(Y.shortDescription="Short description must be 160 characters or less.")),q===3){const Re=ie.trim();if(Re)try{const Ue=new URL(Re);["http:","https:"].includes(Ue.protocol)||(Y.readmeUrl="README URL must be http(s).")}catch{Y.readmeUrl="README URL is invalid."}ke.trim().length>5e4&&(Y.readme="README must be 50 000 characters or less.");const ze=ce.trim();if(ze)try{const Ue=new URL(ze);["http:","https:"].includes(Ue.protocol)||(Y.repositoryUrl="Repository URL must be http(s).")}catch{Y.repositoryUrl="Repository URL is invalid."}}return ot(Y),Object.values(Y).every(Re=>Re===void 0)},sn=()=>{ss(j)&&j<3&&U(j+1)},nn=()=>{j>1&&U(j-1)},rn=async()=>{if(!ss(3))return;const q=K.trim(),Y=Ze(se),Re=Ze(q),ze=`${Y}/${Re}`,Ue=rt(ne),Je=Ne.trim().toLowerCase(),qe=He.trim(),mt=ce.trim(),Bt=ue.trim(),cn=ke.trim(),dn=ie.trim(),mn=Nt(Oe),un=Se?[Ye(Se)]:[],xn=n?n.server?.name??n.id:"",hn=(y?xn:ze).trim(),Gt=ae.trim(),pn=J.trim(),ns={title:q,description:Gt.length>0?Gt:null,is_public:V,_meta:{"mcp.mesh":{verified:st,official:_t,tags:mn,categories:un,short_description:Bt||null,owner:pn||null,readme:cn||null,readme_url:dn||null,...we.length>0?{tools:we}:{}}},server:{name:hn,title:q,description:Gt||void 0,icons:qe?[{src:qe}]:[],repository:mt?{url:mt}:void 0,remotes:Ue?[{type:Je||"http",url:Ue}]:[]}};if(y&&n){await m({id:n.id,data:ns}),e(!1);return}await m({id:ze,...ns}),e(!1),es()},ln=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"row-span-2 grid gap-3 content-start",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-item-provider",children:"Provider"}),t.jsx(xe,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:se,onChange:q=>le(q.target.value),disabled:y}),!y&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Item ID:"," ",t.jsx("span",{className:"font-mono",children:`${Ze(se)||"provider"}/${Ze(K)||"name"}`})]}),ve.provider&&t.jsx("p",{className:"text-xs text-destructive",children:ve.provider})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-item-title",children:"Name"}),t.jsx(xe,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:K,onChange:q=>te(q.target.value)}),ve.title&&t.jsx("p",{className:"text-xs text-destructive",children:ve.title})]})]}),t.jsx("div",{className:"row-span-2 content-start",children:t.jsx(zs,{value:He,onChange:q=>{lt(q),ot(Y=>({...Y,imageUrl:void 0}))},onFileUpload:Ys,error:ve.imageUrl,isUploading:p})}),t.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-remote-url",children:"Remote URL"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex-1 flex items-center rounded-xl border border-input px-3",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground mr-1",children:"https://"}),t.jsx("input",{id:"registry-remote-url",className:"flex-1 h-9 bg-transparent outline-none text-sm",placeholder:"example.com/mcp",value:ne,onChange:q=>{const Y=xs(q.target.value);je(Y),Ws(Y)}})]}),t.jsxs(Cs,{value:Ne,onValueChange:be,children:[t.jsx(_s,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:t.jsx(ks,{placeholder:"Type"})}),t.jsxs(Ss,{children:[t.jsx(Rt,{value:"http",children:"http"}),t.jsx(Rt,{value:"sse",children:"sse"}),t.jsx(Rt,{value:"stdio",children:"stdio"})]})]})]}),ve.remoteUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ve.remoteUrl}),ve.remoteType&&t.jsx("p",{className:"text-xs text-destructive",children:ve.remoteType})]}),ne.trim()&&t.jsxs("div",{className:"col-span-2 space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:ee(nt,"gap-1.5"),onClick:Hs,disabled:b==="loading",children:[b==="loading"?t.jsx(et,{size:12,className:"animate-spin"}):t.jsx(Wt,{size:12}),b==="loading"?"Discovering tools...":we.length>0?"Re-discover tools":"Discover tools from URL"]}),we.length>0&&b!=="loading"&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[we.length," tool",we.length!==1?"s":""," loaded"]})]}),b==="success"&&we.length>0&&t.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-50 dark:bg-green-950/20 px-3 py-2 space-y-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400",children:[t.jsx(it,{size:14,className:"shrink-0"}),t.jsxs("span",{className:"font-medium",children:[we.length," tool",we.length!==1?"s":""," discovered"]})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[we.slice(0,8).map(q=>t.jsx(F,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:q.name},q.name)),we.length>8&&t.jsxs("span",{className:"text-[10px] text-muted-foreground self-center",children:["+",we.length-8," more"]})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"These tools will enrich AI-generated descriptions, tags and categories in the next step."})]}),b==="auth_required"&&k&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/20 border border-amber-500/20 rounded-lg px-3 py-2",children:[t.jsx(xt,{size:14,className:"shrink-0"}),t.jsx("span",{children:"This server requires authentication. The connection is valid but tools cannot be listed without credentials."})]}),b==="error"&&k&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(xt,{size:14,className:"shrink-0"}),t.jsx("span",{children:k})]})]})]}),an=t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(re,{htmlFor:"registry-item-short-description",children:"Short Description"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ue.length,"/160"]}),We&&t.jsx(G,{type:"button",variant:"outline",size:"sm",className:nt,disabled:c==="short_description",onClick:Zs,children:c==="short_description"?"Generating...":"AI Generate"})]})]}),t.jsx(xe,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:"Short summary for the store card",value:ue,maxLength:160,onChange:q=>_(q.target.value)}),ve.shortDescription&&t.jsx("p",{className:"text-xs text-destructive",children:ve.shortDescription})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(re,{htmlFor:"registry-item-description",children:"Description"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ae.length,"/1500"]}),We&&t.jsx(G,{type:"button",variant:"outline",size:"sm",className:nt,disabled:c==="description",onClick:Js,children:c==="description"?"Generating...":"AI Generate"})]})]}),t.jsx(zt,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:"Brief description of this MCP server",rows:2,value:ae,onChange:q=>me(q.target.value)}),ve.description&&t.jsx("p",{className:"text-xs text-destructive",children:ve.description})]}),t.jsx("div",{className:"border-t border-border"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"grid content-start gap-2",children:[t.jsx(Or,{id:"registry-category",value:Se,availableOptions:l,onChange:Be}),We&&t.jsx(G,{type:"button",variant:"outline",size:"sm",className:ee(nt,"justify-self-start"),disabled:c==="categories",onClick:en,children:c==="categories"?"Suggesting...":"AI Suggest"})]}),t.jsxs("div",{className:"grid content-start gap-2",children:[t.jsx($r,{id:"registry-tags",label:"Tags",values:Oe,availableOptions:[...us,...o],placeholder:"Type and press Enter or comma",onChange:Ae}),We&&t.jsx(G,{type:"button",variant:"outline",size:"sm",className:ee(nt,"justify-self-start"),disabled:c==="tags",onClick:Xs,children:c==="tags"?"Suggesting...":"AI Suggest"})]})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(re,{htmlFor:"registry-is-public",className:"text-sm",children:"Public"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Make this MCP visible in the public store URL."})]}),t.jsx(Xe,{id:"registry-is-public",checked:V,onCheckedChange:ge})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(re,{htmlFor:"registry-is-verified",className:"text-sm",children:"Verified"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Curated and approved by deco."})]}),t.jsx(Xe,{id:"registry-is-verified",checked:st,onCheckedChange:Ge})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(re,{htmlFor:"registry-is-official",className:"text-sm",children:"Official"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Made and hosted by the service provider."})]}),t.jsx(Xe,{id:"registry-is-official",checked:_t,onCheckedChange:at})]})]}),on=t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-item-owner",children:"Owner (optional)"}),t.jsx(xe,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:"Team, company, or responsible person",value:J,onChange:q=>Z(q.target.value)})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(re,{htmlFor:"registry-item-repository-url",children:"Repository URL (optional)"}),t.jsx(xe,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:ce,onChange:q=>fe(q.target.value)}),ve.repositoryUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ve.repositoryUrl})]})]}),t.jsxs("div",{className:"rounded-xl border border-border p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(re,{children:"README"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ke.length,"/50000"]})]}),t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:(We?["link","content","generate"]:["link","content"]).map(q=>t.jsx("button",{type:"button",className:ee("px-2.5 py-1 text-xs rounded-md",Te===q?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>$e(q),children:q==="link"?"Link":q==="content"?"Content":"Generate"},q))}),Te==="link"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(xe,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:ie,onChange:q=>De(q.target.value)}),ve.readmeUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ve.readmeUrl})]}),Te==="content"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(zt,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
4
4
 
@@ -1 +1 @@
1
- import"./index-B84Dx7nI.js";import{c as s}from"./constants-_xTq0aTt.js";function m(t){if(!t)return"";const r=t.find(n=>n.name==="COLLECTION_REGISTRY_APP_LIST");if(r)return r.name;const e=t.find(n=>n.name==="REGISTRY_ITEM_LIST");if(e)return e.name;const i=t.find(n=>n.name.startsWith("COLLECTION_REGISTRY_APP_")&&n.name.endsWith("_LIST"));return i?i.name:""}function o(t){if(!t)return"";const r=t.find(n=>n.name==="COLLECTION_REGISTRY_APP_FILTERS");if(r)return r.name;const e=t.find(n=>n.name==="REGISTRY_ITEM_FILTERS");if(e)return e.name;const i=t.find(n=>n.name.startsWith("COLLECTION_REGISTRY_APP_")&&n.name.endsWith("_FILTERS"));return i?i.name:""}function I(t,r){if(!t)return"";const e=t.find(f=>f.name===`COLLECTION_REGISTRY_APP${r}`);if(e)return e.name;const i={_GET:"REGISTRY_ITEM_GET",_VERSIONS:"REGISTRY_ITEM_VERSIONS",_SEARCH:"REGISTRY_ITEM_SEARCH"},n=t.find(f=>f.name===i[r]);if(n)return n.name;const a=t.find(f=>f.name.startsWith("COLLECTION_REGISTRY_APP_")&&f.name.endsWith(r));return a?a.name:""}function R(t){if(!t)return[];const r=[];for(const e of t){let i=[];if(Array.isArray(e))i=e;else if(typeof e=="object"&&e!==null){const n=Object.keys(e).find(a=>Array.isArray(e[a]));n&&(i=e[n])}r.push(...i)}return r}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function E(t){return t?c[t]??t.toUpperCase():null}function _(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function S(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const r=Object.keys(t).find(e=>Array.isArray(t[e]));if(r)return t[r]}return[]}async function d(t,r,e,i){const n=await s({connectionId:t,orgId:r});try{const a=await n.callTool({name:e,arguments:i});return a.structuredContent??a}finally{await n.close().catch(console.error)}}export{R as a,o as b,d as c,I as d,S as e,m as f,E as g,_ as h};
1
+ import"./index-D4JwUMfo.js";import{c as s}from"./constants-DMTOffGt.js";function m(t){if(!t)return"";const r=t.find(n=>n.name==="COLLECTION_REGISTRY_APP_LIST");if(r)return r.name;const e=t.find(n=>n.name==="REGISTRY_ITEM_LIST");if(e)return e.name;const i=t.find(n=>n.name.startsWith("COLLECTION_REGISTRY_APP_")&&n.name.endsWith("_LIST"));return i?i.name:""}function o(t){if(!t)return"";const r=t.find(n=>n.name==="COLLECTION_REGISTRY_APP_FILTERS");if(r)return r.name;const e=t.find(n=>n.name==="REGISTRY_ITEM_FILTERS");if(e)return e.name;const i=t.find(n=>n.name.startsWith("COLLECTION_REGISTRY_APP_")&&n.name.endsWith("_FILTERS"));return i?i.name:""}function I(t,r){if(!t)return"";const e=t.find(f=>f.name===`COLLECTION_REGISTRY_APP${r}`);if(e)return e.name;const i={_GET:"REGISTRY_ITEM_GET",_VERSIONS:"REGISTRY_ITEM_VERSIONS",_SEARCH:"REGISTRY_ITEM_SEARCH"},n=t.find(f=>f.name===i[r]);if(n)return n.name;const a=t.find(f=>f.name.startsWith("COLLECTION_REGISTRY_APP_")&&f.name.endsWith(r));return a?a.name:""}function R(t){if(!t)return[];const r=[];for(const e of t){let i=[];if(Array.isArray(e))i=e;else if(typeof e=="object"&&e!==null){const n=Object.keys(e).find(a=>Array.isArray(e[a]));n&&(i=e[n])}r.push(...i)}return r}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function E(t){return t?c[t]??t.toUpperCase():null}function _(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function S(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const r=Object.keys(t).find(e=>Array.isArray(t[e]));if(r)return t[r]}return[]}async function d(t,r,e,i){const n=await s({connectionId:t,orgId:r});try{const a=await n.callTool({name:e,arguments:i});return a.structuredContent??a}finally{await n.close().catch(console.error)}}export{R as a,o as b,d as c,I as d,S as e,m as f,E as g,_ as h};
@@ -1,3 +1,3 @@
1
- import{r as B,c as M,j as s,c3 as oe,z as K,w as Te,B as he,c4 as Be,x as fe,u as Ue,d as qe,e as Ge,c5 as Ve}from"./index-B84Dx7nI.js";import{c as He}from"./binder-wDmRPNL2.js";import{u as Ne}from"./useQuery-CIRdCYZz.js";import{b as Ke}from"./use-connection-DSPQNIQD.js";import{a as We,u as Qe,h as Ze}from"./constants-_xTq0aTt.js";import{u as xe,P as Je}from"./topbar-portal-BomQ7YMR.js";import{i as ce}from"./Loading01-aMp99RZI.js";import{t as Ye}from"./Settings01-DKTz1YSf.js";import{i as Xe}from"./Check-OSWZCZf9.js";import{t as Pe}from"./ChevronDown-BR4cCk-W.js";import{i as ve}from"./AlertCircle-DsQlVvig.js";import{i as _e}from"./ArrowLeft-CR3SWku2.js";import{n as de}from"./CheckDone01-j6DaSyTU.js";import{s as Me}from"./Clock-BEpmd0mM.js";import{a as et}from"./Copy01-B595Thpy.js";import{n as Ee}from"./Inbox01-csEiEq63.js";import{i as tt}from"./CheckCircle-B2wkNkz_.js";import{i as st}from"./InfoCircle-s0XyUQYC.js";import{i as lt}from"./XCircle-CSLSI6pa.js";import{u as Ie}from"./useMutation-Be5QSQym.js";import{T as se,b as ne,c as le,a as je,d as be,e as ye}from"./table-vuF1fVQ6.js";import{M as nt}from"./markdown-Cqv1T19z.js";import{n as it}from"./ArrowDown-KTP4HONB.js";import{i as ot}from"./ArrowUp-BfaawFDM.js";import{i as rt}from"./CheckVerified02-D6qy17me.js";import{i as Ce}from"./ChevronRight-ByOuE_Vi.js";import{i as at}from"./File02-ZK3-99s4.js";import{s as ct}from"./Hash02-CkWXLlvG.js";import{B as dt}from"./badge-DxYG_XB9.js";import{b as mt,c as ut,d as ft,a as xt,C as pt}from"./card-CkYe6Ikt.js";import{c as Se,d as me,a as $e,b as we,S as ke}from"./select-1y3LRFgk.js";import"./use-collections-BoFyuDa6.js";import"./index-C8u6axf-.js";const Le=({size:t=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M12 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Le.displayName="Columns02";const Ae=({size:t=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M5 12h14"}));Ae.displayName="Minus";const pe=({size:t=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M3 9h18M3 15h18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));pe.displayName="Rows03";const re={reportsList:(t,e,l)=>["reports","list",t,{category:e,status:l}],report:(t,e)=>["reports","detail",t,e],pluginConfig:(t,e)=>["project-plugin-config",t,e]};function ht(){const t=M.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(oe,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No report source connected"}),s.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an MCP server that provides reports to view automated insights, performance audits, security scans, and more."})]}),t[0]=e):e=t[0],e}function gt(t){const e=M.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:a}=t,[i,r]=B.useState(!1),o=B.useRef(null);let d;if(e[0]!==l||e[1]!==n){let m;e[3]!==n?(m=C=>C.id===n,e[3]=n,e[4]=m):m=e[4],d=l.find(m),e[0]=l,e[1]=n,e[2]=d}else d=e[2];const c=d;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=m=>{o.current?.contains(m.relatedTarget)||r(!1)},e[5]=u):u=e[5];const f=u;if(l.length===1){let m;e[6]!==c?(m=c?.icon?s.jsx("img",{src:c.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),e[6]=c,e[7]=m):m=e[7];const C=c?.title||"Reports";let _;e[8]!==C?(_=s.jsx("span",{children:C}),e[8]=C,e[9]=_):_=e[9];let S;return e[10]!==m||e[11]!==_?(S=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m,_]}),e[10]=m,e[11]=_,e[12]=S):S=e[12],S}let p;e[13]!==i?(p=()=>r(!i),e[13]=i,e[14]=p):p=e[14];let x;e[15]!==c?(x=c?.icon?s.jsx("img",{src:c.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),e[15]=c,e[16]=x):x=e[16];const h=c?.title||"Select source";let g;e[17]!==h?(g=s.jsx("span",{children:h}),e[17]=h,e[18]=g):g=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Pe,{size:14}),e[19]=b):b=e[19];let N;e[20]!==p||e[21]!==x||e[22]!==g?(N=s.jsxs("button",{type:"button",onClick:p,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:[x,g,b]}),e[20]=p,e[21]=x,e[22]=g,e[23]=N):N=e[23];let y;e[24]!==l||e[25]!==i||e[26]!==a||e[27]!==n?(y=i&&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(m=>s.jsxs("button",{type:"button",onClick:()=>{a(m.id),r(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[m.icon?s.jsx("img",{src:m.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:m.title}),m.id===n&&s.jsx(Xe,{size:14,className:"text-primary"})]},m.id))}),e[24]=l,e[25]=i,e[26]=a,e[27]=n,e[28]=y):y=e[28];let v;return e[29]!==N||e[30]!==y?(v=s.jsxs("div",{className:"relative",ref:o,onBlur:f,children:[N,y]}),e[29]=N,e[30]=y,e[31]=v):v=e[31],v}function jt(t){const e=M.c(2);let l;return e[0]!==t?(l=s.jsx(gt,{...t}),e[0]=t,e[1]=l):l=e[1],l}const ue={passing:{label:"Passing",color:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400 border-emerald-500/25",icon:tt},warning:{label:"Warning",color:"bg-amber-500/15 text-amber-700 dark:text-amber-400 border-amber-500/25",icon:ve},failing:{label:"Failing",color:"bg-red-500/15 text-red-700 dark:text-red-400 border-red-500/25",icon:lt},info:{label:"Info",color:"bg-blue-500/15 text-blue-700 dark:text-blue-400 border-blue-500/25",icon:st}};function De(t){const e=M.c(10),{status:l,size:n}=t,a=n===void 0?"default":n,i=ue[l]??ue.info,r=i.icon,o=a==="sm",d=o?"px-2 py-0.5":"px-2.5 py-1";let c;e[0]!==i.color||e[1]!==d?(c=K("inline-flex items-center gap-1 rounded-full border text-xs font-medium",d,i.color),e[0]=i.color,e[1]=d,e[2]=c):c=e[2];const u=o?12:14;let f;e[3]!==r||e[4]!==u?(f=s.jsx(r,{size:u}),e[3]=r,e[4]=u,e[5]=f):f=e[5];let p;return e[6]!==i.label||e[7]!==c||e[8]!==f?(p=s.jsxs("span",{className:c,children:[f,i.label]}),e[6]=i.label,e[7]=c,e[8]=f,e[9]=p):p=e[9],p}function ze(t){const e=M.c(11),{connectionId:l,toolCaller:n}=xe();let a;e[0]!==l||e[1]!==t?.category||e[2]!==t?.status?(a=re.reportsList(l,t?.category,t?.status),e[0]=l,e[1]=t?.category,e[2]=t?.status,e[3]=a):a=e[3];let i;e[4]!==t?.category||e[5]!==t?.status||e[6]!==n?(i=async()=>await n("REPORTS_LIST",{category:t?.category,status:t?.status}),e[4]=t?.category,e[5]=t?.status,e[6]=n,e[7]=i):i=e[7];let r;return e[8]!==a||e[9]!==i?(r={queryKey:a,queryFn:i,staleTime:6e4},e[8]=a,e[9]=i,e[10]=r):r=e[10],Ne(r)}function bt(t){const e=M.c(10),{connectionId:l,toolCaller:n}=xe();let a;e[0]!==l||e[1]!==t?(a=re.report(l,t),e[0]=l,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==n?(i=async()=>await n("REPORTS_GET",{id:t}),e[3]=t,e[4]=n,e[5]=i):i=e[5];const r=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==r?(o={queryKey:a,queryFn:i,enabled:r,staleTime:6e4},e[6]=a,e[7]=i,e[8]=r,e[9]=o):o=e[9],Ne(o)}const yt={passing:"bg-emerald-500",warning:"bg-amber-500",failing:"bg-red-500",info:"bg-blue-500"},Re=["#A595FF","#FFC116","#DE3A6E"];function ae(t){const e=M.c(7),{icon:l,title:n}=t;let a;e[0]!==l?(a=s.jsx(l,{size:16,className:"opacity-75 shrink-0 text-foreground"}),e[0]=l,e[1]=a):a=e[1];let i;e[2]!==n?(i=s.jsx("span",{className:"text-base text-foreground opacity-75",children:n}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==a||e[5]!==i?(r=s.jsxs("div",{className:"flex gap-2 items-center",children:[a,i]}),e[4]=a,e[5]=i,e[6]=r):r=e[6],r}function Nt(t){const e=M.c(2),{content:l}=t;let n;return e[0]!==l?(n=s.jsx(nt,{children:l}),e[0]=l,e[1]=n):n=e[1],n}function vt(t){const e=M.c(15),{metric:l}=t;let n;e[0]!==l.unit?(n=l.unit&&s.jsx("span",{className:"text-base text-muted-foreground ml-1",children:l.unit}),e[0]=l.unit,e[1]=n):n=e[1];let a;e[2]!==l.value||e[3]!==n?(a=s.jsxs("div",{className:"text-2xl leading-8 text-foreground font-normal tabular-nums",children:[l.value,n]}),e[2]=l.value,e[3]=n,e[4]=a):a=e[4];let i;e[5]!==l.status?(i=l.status&&s.jsx("span",{className:K("inline-block size-2 rounded-full shrink-0",yt[l.status])}),e[5]=l.status,e[6]=i):i=e[6];let r;e[7]!==l.label?(r=s.jsx("span",{className:"text-sm text-foreground",children:l.label}),e[7]=l.label,e[8]=r):r=e[8];let o;e[9]!==i||e[10]!==r?(o=s.jsxs("div",{className:"flex gap-1.5 items-center",children:[i,r]}),e[9]=i,e[10]=r,e[11]=o):o=e[11];let d;return e[12]!==a||e[13]!==o?(d=s.jsxs("div",{className:"flex flex-col gap-3 items-start justify-end border border-border rounded-lg p-5 flex-1",children:[a,o]}),e[12]=a,e[13]=o,e[14]=d):d=e[14],d}function Oe(t){const e=M.c(12),{title:l,items:n,stacked:a}=t,i=a===void 0?!1:a;let r;e[0]!==l?(r=l&&s.jsx(ae,{icon:pe,title:l}),e[0]=l,e[1]=r):r=e[1];const o=i?"flex-col items-stretch":"items-stretch";let d;e[2]!==o?(d=K("flex gap-4",o),e[2]=o,e[3]=d):d=e[3];let c;e[4]!==n?(c=n.map(_t),e[4]=n,e[5]=c):c=e[5];let u;e[6]!==d||e[7]!==c?(u=s.jsx("div",{className:d,children:c}),e[6]=d,e[7]=c,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==u?(f=s.jsxs("div",{className:"space-y-4",children:[r,u]}),e[9]=r,e[10]=u,e[11]=f):f=e[11],f}function _t(t,e){return s.jsx(vt,{metric:t},`${t.label}-${e}`)}function Ct(t){const e=M.c(16),{title:l,columns:n,rows:a}=t;let i;e[0]!==l?(i=l&&s.jsx(ae,{icon:pe,title:l}),e[0]=l,e[1]=i):i=e[1];let r;e[2]!==n?(r=n.map(wt),e[2]=n,e[3]=r):r=e[3];let o;e[4]!==r?(o=s.jsx(je,{children:s.jsx(ne,{children:r})}),e[4]=r,e[5]=o):o=e[5];let d;e[6]!==a?(d=a.map(St),e[6]=a,e[7]=d):d=e[7];let c;e[8]!==d?(c=s.jsx(be,{children:d}),e[8]=d,e[9]=c):c=e[9];let u;e[10]!==o||e[11]!==c?(u=s.jsx("div",{className:"rounded-lg border overflow-hidden",children:s.jsxs(ye,{children:[o,c]})}),e[10]=o,e[11]=c,e[12]=u):u=e[12];let f;return e[13]!==i||e[14]!==u?(f=s.jsxs("div",{className:"space-y-4",children:[i,u]}),e[13]=i,e[14]=u,e[15]=f):f=e[15],f}function St(t,e){return s.jsx(ne,{children:t.map($t)},e)}function $t(t,e){return s.jsx(le,{className:"text-sm",children:t??s.jsx("span",{className:"text-muted-foreground",children:"—"})},e)}function wt(t){return s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function Fe(t){const e=M.c(11),{title:l,items:n}=t;let a;e[0]!==l?(a=l&&s.jsx(ae,{icon:rt,title:l}),e[0]=l,e[1]=a):a=e[1];let i;if(e[2]!==n){let d;e[4]!==n.length?(d=(c,u)=>s.jsxs("div",{className:"flex gap-4 items-stretch",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center w-4 shrink-0",children:[s.jsx("div",{className:"h-full w-px bg-border"}),s.jsx("div",{className:"w-2 h-4 rounded-full flex",style:{backgroundColor:Re[u%Re.length]}}),s.jsx("div",{className:K("h-full w-px bg-border",u===n.length-1&&"invisible")})]}),s.jsxs("div",{className:"flex flex-col gap-2 items-start py-3 pb-4 min-w-0",children:[s.jsx("span",{className:"text-sm font-medium text-foreground leading-none",children:c.label}),c.description&&s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:c.description})]})]},`${c.label}-${u}`),e[4]=n.length,e[5]=d):d=e[5],i=n.map(d),e[2]=n,e[3]=i}else i=e[3];let r;e[6]!==i?(r=s.jsx("div",{className:"flex flex-col",children:i}),e[6]=i,e[7]=r):r=e[7];let o;return e[8]!==a||e[9]!==r?(o=s.jsxs("div",{className:"space-y-4",children:[a,r]}),e[8]=a,e[9]=r,e[10]=o):o=e[10],o}function kt(t){const e=M.c(3),{content:l}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ae,{icon:at,title:"Notas"}),e[0]=n):n=e[0];let a;return e[1]!==l?(a=s.jsxs("div",{className:"space-y-4",children:[n,s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:l})]}),e[1]=l,e[2]=a):a=e[2],a}function zt(t){const e=M.c(11),{delta:l}=t;if(l===0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("span",{className:"inline-flex items-center justify-center",children:s.jsx(Ae,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0],c}const n=l>0,a=n?"text-emerald-600":"text-destructive";let i;e[1]!==a?(i=K("inline-flex items-center gap-0.5 text-sm font-medium",a),e[1]=a,e[2]=i):i=e[2];let r;e[3]!==n?(r=n?s.jsx(ot,{size:16}):s.jsx(it,{size:16}),e[3]=n,e[4]=r):r=e[4];let o;e[5]!==l?(o=Math.abs(l),e[5]=l,e[6]=o):o=e[6];let d;return e[7]!==i||e[8]!==r||e[9]!==o?(d=s.jsxs("span",{className:i,children:[r,o]}),e[7]=i,e[8]=r,e[9]=o,e[10]=d):d=e[10],d}function Rt(t){if(t.length===0)return[];const e=[...t];for(let l=e.length-1;l>0;l--){const n=Math.max(0,Math.min(e.length-1,l+(l%3===0?-2:l%2===0?1:-1)));[e[l],e[n]]=[e[n],e[l]]}return e.map((l,n)=>({...l,position:n+1,delta:0,reference_position:void 0}))}function ge(t){const e=M.c(14),{rows:l,label:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];const[i,r]=B.useState(a);let o;e[1]!==n?(o=n&&s.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground opacity-60 tracking-wide px-1",children:n}),e[1]=n,e[2]=o):o=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(je,{className:"sticky top-0 bg-background z-10",children:s.jsxs(ne,{children:[s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"#"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"DELTA"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"PRODUTO"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"SCORE"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"GRADE"}),s.jsx(se,{className:"w-10"})]})}),e[3]=d):d=e[3];let c;if(e[4]!==i||e[5]!==l){let p;e[7]!==i?(p=(x,h)=>{const g=i[h]??!1,b=x.note&&typeof x.note=="object"?x.note:null,N=typeof x.note=="string"?!!x.note:b!==null&&Object.keys(b).length>0,y=x.reference_position!==void 0?x.reference_position-x.position:x.delta??0;return s.jsxs(B.Fragment,{children:[s.jsxs(ne,{children:[s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-1 opacity-50",children:[s.jsx(ct,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground tabular-nums",children:x.position})]})}),s.jsx(le,{children:s.jsx(zt,{delta:y})}),s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[x.image&&s.jsx("img",{src:x.image,alt:"",className:"h-12 w-8 object-cover rounded-sm shrink-0 bg-muted"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.label})]})}),x.values.map(Mt),s.jsx(le,{children:N?s.jsx("button",{type:"button",onClick:()=>r(v=>({...v,[h]:!v[h]})),className:"flex items-center justify-center size-6 text-muted-foreground hover:text-foreground transition-colors",children:g?s.jsx(Pe,{size:16}):s.jsx(Ce,{size:16})}):s.jsx(Ce,{size:16,className:"text-muted-foreground opacity-30"})})]}),N&&g&&s.jsx(ne,{className:"bg-muted/25",children:s.jsx(le,{colSpan:6,children:typeof x.note=="string"?s.jsxs("div",{className:"pl-8 pb-2 flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase opacity-50 tracking-wide",children:"MUDANÇA"}),s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:x.note})]}):s.jsx("div",{className:"py-2 px-4",children:s.jsxs(ye,{children:[s.jsx(je,{children:s.jsx(ne,{children:Object.keys(b??{}).map(Pt)})}),s.jsx(be,{children:s.jsx(ne,{children:Object.values(b??{}).map(Tt)})})]})})})},`note-${h}`)]},h)},e[7]=i,e[8]=p):p=e[8],c=l.map(p),e[4]=i,e[5]=l,e[6]=c}else c=e[6];let u;e[9]!==c?(u=s.jsx("div",{className:"border border-border rounded-lg overflow-auto max-h-[520px]",children:s.jsxs(ye,{children:[d,s.jsx(be,{children:c})]})}),e[9]=c,e[10]=u):u=e[10];let f;return e[11]!==o||e[12]!==u?(f=s.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[o,u]}),e[11]=o,e[12]=u,e[13]=f):f=e[13],f}function Tt(t,e){return s.jsx(le,{className:"text-sm tabular-nums",children:t??"—"},e)}function Pt(t){return s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function Mt(t,e){const n=e===1&&typeof t=="string"&&t.endsWith("%")?`${parseFloat(t)-10}%`:t;return s.jsx(le,{className:"text-sm tabular-nums",children:n},e)}function Et(t){const e=M.c(20),{title:l,rows:n}=t,[a,i]=B.useState(!1);let r;e[0]!==n?(r=Rt(n),e[0]=n,e[1]=r):r=e[1];const o=r;let d;e[2]!==l?(d=l&&s.jsx(ae,{icon:pe,title:l}),e[2]=l,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=()=>i(It),e[4]=c):c=e[4];const u=a?"bg-primary text-primary-foreground border-primary":"bg-transparent text-muted-foreground border-border hover:text-foreground hover:border-foreground/30";let f;e[5]!==u?(f=K("inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-1.5 rounded-md border transition-colors",u),e[5]=u,e[6]=f):f=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Le,{size:14}),e[7]=p):p=e[7];let x;e[8]!==f?(x=s.jsxs("button",{type:"button",onClick:c,className:f,children:[p,"Comparar ordenação anterior"]}),e[8]=f,e[9]=x):x=e[9];let h;e[10]!==d||e[11]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d,x]}),e[10]=d,e[11]=x,e[12]=h):h=e[12];let g;e[13]!==o||e[14]!==n||e[15]!==a?(g=a?s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx(ge,{rows:n,label:"Ordenação Proposta"}),s.jsx(ge,{rows:o,label:"Ordenação Atual"})]}):s.jsx(ge,{rows:n}),e[13]=o,e[14]=n,e[15]=a,e[16]=g):g=e[16];let b;return e[17]!==h||e[18]!==g?(b=s.jsxs("div",{className:"space-y-4",children:[h,g]}),e[17]=h,e[18]=g,e[19]=b):b=e[19],b}function It(t){return!t}function Lt(t){const e=M.c(17),{section:l}=t;switch(l.type){case"markdown":{let n;return e[0]!==l.content?(n=s.jsx(Nt,{content:l.content}),e[0]=l.content,e[1]=n):n=e[1],n}case"metrics":{let n;return e[2]!==l.items||e[3]!==l.title?(n=s.jsx(Oe,{title:l.title,items:l.items}),e[2]=l.items,e[3]=l.title,e[4]=n):n=e[4],n}case"table":{let n;return e[5]!==l.columns||e[6]!==l.rows||e[7]!==l.title?(n=s.jsx(Ct,{title:l.title,columns:l.columns,rows:l.rows}),e[5]=l.columns,e[6]=l.rows,e[7]=l.title,e[8]=n):n=e[8],n}case"criteria":{let n;return e[9]!==l.items||e[10]!==l.title?(n=s.jsx(Fe,{title:l.title,items:l.items}),e[9]=l.items,e[10]=l.title,e[11]=n):n=e[11],n}case"note":{let n;return e[12]!==l.content?(n=s.jsx(kt,{content:l.content}),e[12]=l.content,e[13]=n):n=e[13],n}case"ranked-list":{let n;return e[14]!==l.rows||e[15]!==l.title?(n=s.jsx(Et,{title:l.title,rows:l.rows}),e[14]=l.rows,e[15]=l.title,e[16]=n):n=e[16],n}default:return null}}function At(t){return new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function Dt(t){const e=[];e.push(`# ${t.title}`),e.push(""),e.push(`> ${t.summary}`),e.push("");const l=[`**Status:** ${t.status}`,`**Category:** ${t.category}`];t.source&&l.push(`**Source:** ${t.source}`),l.push(`**Updated:** ${t.updatedAt}`),t.tags?.length&&l.push(`**Tags:** ${t.tags.join(", ")}`),e.push(l.join(`
1
+ import{r as B,c as M,j as s,c3 as oe,z as K,w as Te,B as he,c4 as Be,x as fe,u as Ue,d as qe,e as Ge,c5 as Ve}from"./index-D4JwUMfo.js";import{c as He}from"./binder-D6CqvsA8.js";import{u as Ne}from"./useQuery-D0xC6l4K.js";import{b as Ke}from"./use-connection-96ulKDkp.js";import{a as We,u as Qe,h as Ze}from"./constants-DMTOffGt.js";import{u as xe,P as Je}from"./topbar-portal-DecQv7ul.js";import{i as ce}from"./Loading01-1unV3no7.js";import{t as Ye}from"./Settings01-C-jo0YyN.js";import{i as Xe}from"./Check-q1dqks2U.js";import{t as Pe}from"./ChevronDown-cViiGxn9.js";import{i as ve}from"./AlertCircle-BVzUbFpn.js";import{i as _e}from"./ArrowLeft-G2GpUvfS.js";import{n as de}from"./CheckDone01-B7ahPP7j.js";import{s as Me}from"./Clock-uUYVZnmE.js";import{a as et}from"./Copy01-DIuxFCYv.js";import{n as Ee}from"./Inbox01-DI6dcB2-.js";import{i as tt}from"./CheckCircle-DAQqu9C_.js";import{i as st}from"./InfoCircle-BLcCSQhh.js";import{i as lt}from"./XCircle-0CM-aUam.js";import{u as Ie}from"./useMutation-D-zwC1-P.js";import{T as se,b as ne,c as le,a as je,d as be,e as ye}from"./table-gCgflBYD.js";import{M as nt}from"./markdown-Bew8FtWp.js";import{n as it}from"./ArrowDown-BbVCdIIL.js";import{i as ot}from"./ArrowUp-JndBjwJL.js";import{i as rt}from"./CheckVerified02-CZ912ESL.js";import{i as Ce}from"./ChevronRight-D7UsQHH3.js";import{i as at}from"./File02-mE2VQadh.js";import{s as ct}from"./Hash02-B4FAvj_q.js";import{B as dt}from"./badge-Bgf3f5yM.js";import{b as mt,c as ut,d as ft,a as xt,C as pt}from"./card-CeKLZLLA.js";import{c as Se,d as me,a as $e,b as we,S as ke}from"./select-DwZBzl3A.js";import"./use-collections-Bs1uQVQJ.js";import"./index-CrHCQ8Nf.js";const Le=({size:t=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M12 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));Le.displayName="Columns02";const Ae=({size:t=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M5 12h14"}));Ae.displayName="Minus";const pe=({size:t=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M3 9h18M3 15h18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));pe.displayName="Rows03";const re={reportsList:(t,e,l)=>["reports","list",t,{category:e,status:l}],report:(t,e)=>["reports","detail",t,e],pluginConfig:(t,e)=>["project-plugin-config",t,e]};function ht(){const t=M.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(oe,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No report source connected"}),s.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an MCP server that provides reports to view automated insights, performance audits, security scans, and more."})]}),t[0]=e):e=t[0],e}function gt(t){const e=M.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:a}=t,[i,r]=B.useState(!1),o=B.useRef(null);let d;if(e[0]!==l||e[1]!==n){let m;e[3]!==n?(m=C=>C.id===n,e[3]=n,e[4]=m):m=e[4],d=l.find(m),e[0]=l,e[1]=n,e[2]=d}else d=e[2];const c=d;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=m=>{o.current?.contains(m.relatedTarget)||r(!1)},e[5]=u):u=e[5];const f=u;if(l.length===1){let m;e[6]!==c?(m=c?.icon?s.jsx("img",{src:c.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),e[6]=c,e[7]=m):m=e[7];const C=c?.title||"Reports";let _;e[8]!==C?(_=s.jsx("span",{children:C}),e[8]=C,e[9]=_):_=e[9];let S;return e[10]!==m||e[11]!==_?(S=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m,_]}),e[10]=m,e[11]=_,e[12]=S):S=e[12],S}let p;e[13]!==i?(p=()=>r(!i),e[13]=i,e[14]=p):p=e[14];let x;e[15]!==c?(x=c?.icon?s.jsx("img",{src:c.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),e[15]=c,e[16]=x):x=e[16];const h=c?.title||"Select source";let g;e[17]!==h?(g=s.jsx("span",{children:h}),e[17]=h,e[18]=g):g=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Pe,{size:14}),e[19]=b):b=e[19];let N;e[20]!==p||e[21]!==x||e[22]!==g?(N=s.jsxs("button",{type:"button",onClick:p,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:[x,g,b]}),e[20]=p,e[21]=x,e[22]=g,e[23]=N):N=e[23];let y;e[24]!==l||e[25]!==i||e[26]!==a||e[27]!==n?(y=i&&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(m=>s.jsxs("button",{type:"button",onClick:()=>{a(m.id),r(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[m.icon?s.jsx("img",{src:m.icon,alt:"",className:"size-4 rounded"}):s.jsx(oe,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:m.title}),m.id===n&&s.jsx(Xe,{size:14,className:"text-primary"})]},m.id))}),e[24]=l,e[25]=i,e[26]=a,e[27]=n,e[28]=y):y=e[28];let v;return e[29]!==N||e[30]!==y?(v=s.jsxs("div",{className:"relative",ref:o,onBlur:f,children:[N,y]}),e[29]=N,e[30]=y,e[31]=v):v=e[31],v}function jt(t){const e=M.c(2);let l;return e[0]!==t?(l=s.jsx(gt,{...t}),e[0]=t,e[1]=l):l=e[1],l}const ue={passing:{label:"Passing",color:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-400 border-emerald-500/25",icon:tt},warning:{label:"Warning",color:"bg-amber-500/15 text-amber-700 dark:text-amber-400 border-amber-500/25",icon:ve},failing:{label:"Failing",color:"bg-red-500/15 text-red-700 dark:text-red-400 border-red-500/25",icon:lt},info:{label:"Info",color:"bg-blue-500/15 text-blue-700 dark:text-blue-400 border-blue-500/25",icon:st}};function De(t){const e=M.c(10),{status:l,size:n}=t,a=n===void 0?"default":n,i=ue[l]??ue.info,r=i.icon,o=a==="sm",d=o?"px-2 py-0.5":"px-2.5 py-1";let c;e[0]!==i.color||e[1]!==d?(c=K("inline-flex items-center gap-1 rounded-full border text-xs font-medium",d,i.color),e[0]=i.color,e[1]=d,e[2]=c):c=e[2];const u=o?12:14;let f;e[3]!==r||e[4]!==u?(f=s.jsx(r,{size:u}),e[3]=r,e[4]=u,e[5]=f):f=e[5];let p;return e[6]!==i.label||e[7]!==c||e[8]!==f?(p=s.jsxs("span",{className:c,children:[f,i.label]}),e[6]=i.label,e[7]=c,e[8]=f,e[9]=p):p=e[9],p}function ze(t){const e=M.c(11),{connectionId:l,toolCaller:n}=xe();let a;e[0]!==l||e[1]!==t?.category||e[2]!==t?.status?(a=re.reportsList(l,t?.category,t?.status),e[0]=l,e[1]=t?.category,e[2]=t?.status,e[3]=a):a=e[3];let i;e[4]!==t?.category||e[5]!==t?.status||e[6]!==n?(i=async()=>await n("REPORTS_LIST",{category:t?.category,status:t?.status}),e[4]=t?.category,e[5]=t?.status,e[6]=n,e[7]=i):i=e[7];let r;return e[8]!==a||e[9]!==i?(r={queryKey:a,queryFn:i,staleTime:6e4},e[8]=a,e[9]=i,e[10]=r):r=e[10],Ne(r)}function bt(t){const e=M.c(10),{connectionId:l,toolCaller:n}=xe();let a;e[0]!==l||e[1]!==t?(a=re.report(l,t),e[0]=l,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==n?(i=async()=>await n("REPORTS_GET",{id:t}),e[3]=t,e[4]=n,e[5]=i):i=e[5];const r=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==r?(o={queryKey:a,queryFn:i,enabled:r,staleTime:6e4},e[6]=a,e[7]=i,e[8]=r,e[9]=o):o=e[9],Ne(o)}const yt={passing:"bg-emerald-500",warning:"bg-amber-500",failing:"bg-red-500",info:"bg-blue-500"},Re=["#A595FF","#FFC116","#DE3A6E"];function ae(t){const e=M.c(7),{icon:l,title:n}=t;let a;e[0]!==l?(a=s.jsx(l,{size:16,className:"opacity-75 shrink-0 text-foreground"}),e[0]=l,e[1]=a):a=e[1];let i;e[2]!==n?(i=s.jsx("span",{className:"text-base text-foreground opacity-75",children:n}),e[2]=n,e[3]=i):i=e[3];let r;return e[4]!==a||e[5]!==i?(r=s.jsxs("div",{className:"flex gap-2 items-center",children:[a,i]}),e[4]=a,e[5]=i,e[6]=r):r=e[6],r}function Nt(t){const e=M.c(2),{content:l}=t;let n;return e[0]!==l?(n=s.jsx(nt,{children:l}),e[0]=l,e[1]=n):n=e[1],n}function vt(t){const e=M.c(15),{metric:l}=t;let n;e[0]!==l.unit?(n=l.unit&&s.jsx("span",{className:"text-base text-muted-foreground ml-1",children:l.unit}),e[0]=l.unit,e[1]=n):n=e[1];let a;e[2]!==l.value||e[3]!==n?(a=s.jsxs("div",{className:"text-2xl leading-8 text-foreground font-normal tabular-nums",children:[l.value,n]}),e[2]=l.value,e[3]=n,e[4]=a):a=e[4];let i;e[5]!==l.status?(i=l.status&&s.jsx("span",{className:K("inline-block size-2 rounded-full shrink-0",yt[l.status])}),e[5]=l.status,e[6]=i):i=e[6];let r;e[7]!==l.label?(r=s.jsx("span",{className:"text-sm text-foreground",children:l.label}),e[7]=l.label,e[8]=r):r=e[8];let o;e[9]!==i||e[10]!==r?(o=s.jsxs("div",{className:"flex gap-1.5 items-center",children:[i,r]}),e[9]=i,e[10]=r,e[11]=o):o=e[11];let d;return e[12]!==a||e[13]!==o?(d=s.jsxs("div",{className:"flex flex-col gap-3 items-start justify-end border border-border rounded-lg p-5 flex-1",children:[a,o]}),e[12]=a,e[13]=o,e[14]=d):d=e[14],d}function Oe(t){const e=M.c(12),{title:l,items:n,stacked:a}=t,i=a===void 0?!1:a;let r;e[0]!==l?(r=l&&s.jsx(ae,{icon:pe,title:l}),e[0]=l,e[1]=r):r=e[1];const o=i?"flex-col items-stretch":"items-stretch";let d;e[2]!==o?(d=K("flex gap-4",o),e[2]=o,e[3]=d):d=e[3];let c;e[4]!==n?(c=n.map(_t),e[4]=n,e[5]=c):c=e[5];let u;e[6]!==d||e[7]!==c?(u=s.jsx("div",{className:d,children:c}),e[6]=d,e[7]=c,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==u?(f=s.jsxs("div",{className:"space-y-4",children:[r,u]}),e[9]=r,e[10]=u,e[11]=f):f=e[11],f}function _t(t,e){return s.jsx(vt,{metric:t},`${t.label}-${e}`)}function Ct(t){const e=M.c(16),{title:l,columns:n,rows:a}=t;let i;e[0]!==l?(i=l&&s.jsx(ae,{icon:pe,title:l}),e[0]=l,e[1]=i):i=e[1];let r;e[2]!==n?(r=n.map(wt),e[2]=n,e[3]=r):r=e[3];let o;e[4]!==r?(o=s.jsx(je,{children:s.jsx(ne,{children:r})}),e[4]=r,e[5]=o):o=e[5];let d;e[6]!==a?(d=a.map(St),e[6]=a,e[7]=d):d=e[7];let c;e[8]!==d?(c=s.jsx(be,{children:d}),e[8]=d,e[9]=c):c=e[9];let u;e[10]!==o||e[11]!==c?(u=s.jsx("div",{className:"rounded-lg border overflow-hidden",children:s.jsxs(ye,{children:[o,c]})}),e[10]=o,e[11]=c,e[12]=u):u=e[12];let f;return e[13]!==i||e[14]!==u?(f=s.jsxs("div",{className:"space-y-4",children:[i,u]}),e[13]=i,e[14]=u,e[15]=f):f=e[15],f}function St(t,e){return s.jsx(ne,{children:t.map($t)},e)}function $t(t,e){return s.jsx(le,{className:"text-sm",children:t??s.jsx("span",{className:"text-muted-foreground",children:"—"})},e)}function wt(t){return s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function Fe(t){const e=M.c(11),{title:l,items:n}=t;let a;e[0]!==l?(a=l&&s.jsx(ae,{icon:rt,title:l}),e[0]=l,e[1]=a):a=e[1];let i;if(e[2]!==n){let d;e[4]!==n.length?(d=(c,u)=>s.jsxs("div",{className:"flex gap-4 items-stretch",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center w-4 shrink-0",children:[s.jsx("div",{className:"h-full w-px bg-border"}),s.jsx("div",{className:"w-2 h-4 rounded-full flex",style:{backgroundColor:Re[u%Re.length]}}),s.jsx("div",{className:K("h-full w-px bg-border",u===n.length-1&&"invisible")})]}),s.jsxs("div",{className:"flex flex-col gap-2 items-start py-3 pb-4 min-w-0",children:[s.jsx("span",{className:"text-sm font-medium text-foreground leading-none",children:c.label}),c.description&&s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:c.description})]})]},`${c.label}-${u}`),e[4]=n.length,e[5]=d):d=e[5],i=n.map(d),e[2]=n,e[3]=i}else i=e[3];let r;e[6]!==i?(r=s.jsx("div",{className:"flex flex-col",children:i}),e[6]=i,e[7]=r):r=e[7];let o;return e[8]!==a||e[9]!==r?(o=s.jsxs("div",{className:"space-y-4",children:[a,r]}),e[8]=a,e[9]=r,e[10]=o):o=e[10],o}function kt(t){const e=M.c(3),{content:l}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ae,{icon:at,title:"Notas"}),e[0]=n):n=e[0];let a;return e[1]!==l?(a=s.jsxs("div",{className:"space-y-4",children:[n,s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:l})]}),e[1]=l,e[2]=a):a=e[2],a}function zt(t){const e=M.c(11),{delta:l}=t;if(l===0){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("span",{className:"inline-flex items-center justify-center",children:s.jsx(Ae,{size:16,className:"text-muted-foreground"})}),e[0]=c):c=e[0],c}const n=l>0,a=n?"text-emerald-600":"text-destructive";let i;e[1]!==a?(i=K("inline-flex items-center gap-0.5 text-sm font-medium",a),e[1]=a,e[2]=i):i=e[2];let r;e[3]!==n?(r=n?s.jsx(ot,{size:16}):s.jsx(it,{size:16}),e[3]=n,e[4]=r):r=e[4];let o;e[5]!==l?(o=Math.abs(l),e[5]=l,e[6]=o):o=e[6];let d;return e[7]!==i||e[8]!==r||e[9]!==o?(d=s.jsxs("span",{className:i,children:[r,o]}),e[7]=i,e[8]=r,e[9]=o,e[10]=d):d=e[10],d}function Rt(t){if(t.length===0)return[];const e=[...t];for(let l=e.length-1;l>0;l--){const n=Math.max(0,Math.min(e.length-1,l+(l%3===0?-2:l%2===0?1:-1)));[e[l],e[n]]=[e[n],e[l]]}return e.map((l,n)=>({...l,position:n+1,delta:0,reference_position:void 0}))}function ge(t){const e=M.c(14),{rows:l,label:n}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={},e[0]=a):a=e[0];const[i,r]=B.useState(a);let o;e[1]!==n?(o=n&&s.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground opacity-60 tracking-wide px-1",children:n}),e[1]=n,e[2]=o):o=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(je,{className:"sticky top-0 bg-background z-10",children:s.jsxs(ne,{children:[s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"#"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground w-[60px]",children:"DELTA"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"PRODUTO"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"SCORE"}),s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:"GRADE"}),s.jsx(se,{className:"w-10"})]})}),e[3]=d):d=e[3];let c;if(e[4]!==i||e[5]!==l){let p;e[7]!==i?(p=(x,h)=>{const g=i[h]??!1,b=x.note&&typeof x.note=="object"?x.note:null,N=typeof x.note=="string"?!!x.note:b!==null&&Object.keys(b).length>0,y=x.reference_position!==void 0?x.reference_position-x.position:x.delta??0;return s.jsxs(B.Fragment,{children:[s.jsxs(ne,{children:[s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-1 opacity-50",children:[s.jsx(ct,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground tabular-nums",children:x.position})]})}),s.jsx(le,{children:s.jsx(zt,{delta:y})}),s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[x.image&&s.jsx("img",{src:x.image,alt:"",className:"h-12 w-8 object-cover rounded-sm shrink-0 bg-muted"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:x.label})]})}),x.values.map(Mt),s.jsx(le,{children:N?s.jsx("button",{type:"button",onClick:()=>r(v=>({...v,[h]:!v[h]})),className:"flex items-center justify-center size-6 text-muted-foreground hover:text-foreground transition-colors",children:g?s.jsx(Pe,{size:16}):s.jsx(Ce,{size:16})}):s.jsx(Ce,{size:16,className:"text-muted-foreground opacity-30"})})]}),N&&g&&s.jsx(ne,{className:"bg-muted/25",children:s.jsx(le,{colSpan:6,children:typeof x.note=="string"?s.jsxs("div",{className:"pl-8 pb-2 flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase opacity-50 tracking-wide",children:"MUDANÇA"}),s.jsx("p",{className:"text-sm text-foreground opacity-80 leading-5",children:x.note})]}):s.jsx("div",{className:"py-2 px-4",children:s.jsxs(ye,{children:[s.jsx(je,{children:s.jsx(ne,{children:Object.keys(b??{}).map(Pt)})}),s.jsx(be,{children:s.jsx(ne,{children:Object.values(b??{}).map(Tt)})})]})})})},`note-${h}`)]},h)},e[7]=i,e[8]=p):p=e[8],c=l.map(p),e[4]=i,e[5]=l,e[6]=c}else c=e[6];let u;e[9]!==c?(u=s.jsx("div",{className:"border border-border rounded-lg overflow-auto max-h-[520px]",children:s.jsxs(ye,{children:[d,s.jsx(be,{children:c})]})}),e[9]=c,e[10]=u):u=e[10];let f;return e[11]!==o||e[12]!==u?(f=s.jsxs("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[o,u]}),e[11]=o,e[12]=u,e[13]=f):f=e[13],f}function Tt(t,e){return s.jsx(le,{className:"text-sm tabular-nums",children:t??"—"},e)}function Pt(t){return s.jsx(se,{className:"font-mono text-xs uppercase text-muted-foreground",children:t},t)}function Mt(t,e){const n=e===1&&typeof t=="string"&&t.endsWith("%")?`${parseFloat(t)-10}%`:t;return s.jsx(le,{className:"text-sm tabular-nums",children:n},e)}function Et(t){const e=M.c(20),{title:l,rows:n}=t,[a,i]=B.useState(!1);let r;e[0]!==n?(r=Rt(n),e[0]=n,e[1]=r):r=e[1];const o=r;let d;e[2]!==l?(d=l&&s.jsx(ae,{icon:pe,title:l}),e[2]=l,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=()=>i(It),e[4]=c):c=e[4];const u=a?"bg-primary text-primary-foreground border-primary":"bg-transparent text-muted-foreground border-border hover:text-foreground hover:border-foreground/30";let f;e[5]!==u?(f=K("inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-1.5 rounded-md border transition-colors",u),e[5]=u,e[6]=f):f=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Le,{size:14}),e[7]=p):p=e[7];let x;e[8]!==f?(x=s.jsxs("button",{type:"button",onClick:c,className:f,children:[p,"Comparar ordenação anterior"]}),e[8]=f,e[9]=x):x=e[9];let h;e[10]!==d||e[11]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[d,x]}),e[10]=d,e[11]=x,e[12]=h):h=e[12];let g;e[13]!==o||e[14]!==n||e[15]!==a?(g=a?s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx(ge,{rows:n,label:"Ordenação Proposta"}),s.jsx(ge,{rows:o,label:"Ordenação Atual"})]}):s.jsx(ge,{rows:n}),e[13]=o,e[14]=n,e[15]=a,e[16]=g):g=e[16];let b;return e[17]!==h||e[18]!==g?(b=s.jsxs("div",{className:"space-y-4",children:[h,g]}),e[17]=h,e[18]=g,e[19]=b):b=e[19],b}function It(t){return!t}function Lt(t){const e=M.c(17),{section:l}=t;switch(l.type){case"markdown":{let n;return e[0]!==l.content?(n=s.jsx(Nt,{content:l.content}),e[0]=l.content,e[1]=n):n=e[1],n}case"metrics":{let n;return e[2]!==l.items||e[3]!==l.title?(n=s.jsx(Oe,{title:l.title,items:l.items}),e[2]=l.items,e[3]=l.title,e[4]=n):n=e[4],n}case"table":{let n;return e[5]!==l.columns||e[6]!==l.rows||e[7]!==l.title?(n=s.jsx(Ct,{title:l.title,columns:l.columns,rows:l.rows}),e[5]=l.columns,e[6]=l.rows,e[7]=l.title,e[8]=n):n=e[8],n}case"criteria":{let n;return e[9]!==l.items||e[10]!==l.title?(n=s.jsx(Fe,{title:l.title,items:l.items}),e[9]=l.items,e[10]=l.title,e[11]=n):n=e[11],n}case"note":{let n;return e[12]!==l.content?(n=s.jsx(kt,{content:l.content}),e[12]=l.content,e[13]=n):n=e[13],n}case"ranked-list":{let n;return e[14]!==l.rows||e[15]!==l.title?(n=s.jsx(Et,{title:l.title,rows:l.rows}),e[14]=l.rows,e[15]=l.title,e[16]=n):n=e[16],n}default:return null}}function At(t){return new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function Dt(t){const e=[];e.push(`# ${t.title}`),e.push(""),e.push(`> ${t.summary}`),e.push("");const l=[`**Status:** ${t.status}`,`**Category:** ${t.category}`];t.source&&l.push(`**Source:** ${t.source}`),l.push(`**Updated:** ${t.updatedAt}`),t.tags?.length&&l.push(`**Tags:** ${t.tags.join(", ")}`),e.push(l.join(`
2
2
  `)),e.push("");for(const n of t.sections)switch(n.type){case"markdown":e.push(n.content),e.push("");break;case"metrics":{n.title&&(e.push(`## ${n.title}`),e.push(""));const a=["Metric","Value","Previous","Status"],i=n.items.some(r=>r.unit);e.push(`| ${a.join(" | ")} |`),e.push(`| ${a.map(()=>"---").join(" | ")} |`);for(const r of n.items){const o=r.unit==="%"&&typeof r.value=="number"?r.value-10:r.value,d=r.unit==="%"&&typeof r.previousValue=="number"?r.previousValue-10:r.previousValue,c=i&&r.unit?`${o} ${r.unit}`:`${o}`,u=d!=null?i&&r.unit?`${d} ${r.unit}`:`${d}`:"—",f=r.status??"—";e.push(`| ${r.label} | ${c} | ${u} | ${f} |`)}e.push("");break}case"table":{n.title&&(e.push(`## ${n.title}`),e.push("")),e.push(`| ${n.columns.join(" | ")} |`),e.push(`| ${n.columns.map(()=>"---").join(" | ")} |`);for(const a of n.rows)e.push(`| ${a.map(i=>i==null?"—":`${i}`).join(" | ")} |`);e.push("");break}case"criteria":{n.title&&(e.push(`## ${n.title}`),e.push(""));for(const a of n.items){const i=a.description?`: ${a.description}`:"";e.push(`- **${a.label}**${i}`)}e.push("");break}case"note":{e.push(`> ${n.content}`),e.push("");break}case"ranked-list":{n.title&&(e.push(`## ${n.title}`),e.push(""));const a=["#","Item"];e.push(`| ${a.join(" | ")} |`),e.push(`| ${a.map(()=>"---").join(" | ")} |`);for(const i of n.rows){const r=i.reference_position!==void 0?i.reference_position-i.position:i.delta??0,o=r!==0?` (${r>0?"+":""}${r})`:"",d=`${i.position}${o}`,c=i.values.map(u=>`${u}`).join(" | ");e.push(`| ${d} | ${i.label} | ${c} |`)}e.push("");break}}return e.join(`
3
3
  `).trim()}function Ot(t){const e=M.c(86),{reportId:l,onBack:n}=t,{connectionId:a,toolCaller:i}=xe(),r=Te(),{data:o,isLoading:d,error:c}=bt(l),u=o?.lifecycleStatus==="dismissed";let f;e[0]!==u||e[1]!==l||e[2]!==i?(f=async()=>i("REPORTS_UPDATE_STATUS",{reportId:l,lifecycleStatus:u?"read":"dismissed"}),e[0]=u,e[1]=l,e[2]=i,e[3]=f):f=e[3];let p;e[4]!==a||e[5]!==u||e[6]!==n||e[7]!==r?(p=()=>{fe.success(u?"Report restored to inbox":"Report marked as done"),r.invalidateQueries({queryKey:re.reportsList(a)}),n()},e[4]=a,e[5]=u,e[6]=n,e[7]=r,e[8]=p):p=e[8];let x;e[9]!==f||e[10]!==p?(x={mutationFn:f,onSuccess:p,onError:Ut},e[9]=f,e[10]=p,e[11]=x):x=e[11];const h=Ie(x);if(d){let D;return e[12]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(ce,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading report..."})]}),e[12]=D):D=e[12],D}if(c||!o){let D;e[13]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(ve,{size:48,className:"text-destructive mb-4"}),e[13]=D):D=e[13];const Q=c?"Error loading report":"Report not found";let q;e[14]!==Q?(q=s.jsx("h3",{className:"text-lg font-medium mb-2",children:Q}),e[14]=Q,e[15]=q):q=e[15];const Z=c?.message??"The requested report could not be found.";let X;e[16]!==Z?(X=s.jsx("p",{className:"text-muted-foreground text-center mb-4",children:Z}),e[16]=Z,e[17]=X):X=e[17];let ee;e[18]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(_e,{size:14,className:"mr-1"}),e[18]=ee):ee=e[18];let G;e[19]!==n?(G=s.jsxs(he,{variant:"outline",onClick:n,children:[ee,"Back to reports"]}),e[19]=n,e[20]=G):G=e[20];let J;return e[21]!==G||e[22]!==q||e[23]!==X?(J=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[D,q,X,G]}),e[21]=G,e[22]=q,e[23]=X,e[24]=J):J=e[24],J}let g;e[25]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(_e,{size:14}),e[25]=g):g=e[25];let b;e[26]!==n?(b=s.jsxs("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[g,"Reports"]}),e[26]=n,e[27]=b):b=e[27];let N;e[28]!==o?(N=()=>{const D=Dt(o);navigator.clipboard.writeText(D).then(Bt)},e[28]=o,e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(et,{size:14}),e[30]=y):y=e[30];let v;e[31]!==N?(v=s.jsxs(he,{variant:"outline",size:"sm",className:"gap-1.5",onClick:N,children:[y,"Copy as Markdown"]}),e[31]=N,e[32]=v):v=e[32];let m;e[33]!==h?(m=()=>h.mutate(),e[33]=h,e[34]=m):m=e[34];let C;e[35]!==u||e[36]!==h.isPending?(C=h.isPending?s.jsx(ce,{size:14,className:"animate-spin"}):u?s.jsx(Ee,{size:14}):s.jsx(de,{size:14}),e[35]=u,e[36]=h.isPending,e[37]=C):C=e[37];const _=u?"Move to inbox":"Mark as done";let S;e[38]!==h.isPending||e[39]!==C||e[40]!==_||e[41]!==m?(S=s.jsxs(he,{variant:"outline",size:"sm",className:"gap-1.5",onClick:m,disabled:h.isPending,children:[C,_]}),e[38]=h.isPending,e[39]=C,e[40]=_,e[41]=m,e[42]=S):S=e[42];let $;e[43]!==S||e[44]!==v?($=s.jsxs("div",{className:"flex items-center gap-2",children:[v,S]}),e[43]=S,e[44]=v,e[45]=$):$=e[45];let z;e[46]!==$||e[47]!==b?(z=s.jsxs("div",{className:"flex items-center justify-between",children:[b,$]}),e[46]=$,e[47]=b,e[48]=z):z=e[48];let w;e[49]!==o.title?(w=s.jsx("h1",{className:"text-xl font-semibold leading-tight",children:o.title}),e[49]=o.title,e[50]=w):w=e[50];let R;e[51]!==o.summary?(R=s.jsx("p",{className:"text-sm text-muted-foreground",children:o.summary}),e[51]=o.summary,e[52]=R):R=e[52];let E;e[53]!==w||e[54]!==R?(E=s.jsxs("div",{className:"space-y-1 min-w-0",children:[w,R]}),e[53]=w,e[54]=R,e[55]=E):E=e[55];let I;e[56]!==o.status?(I=s.jsx(De,{status:o.status}),e[56]=o.status,e[57]=I):I=e[57];let T;e[58]!==E||e[59]!==I?(T=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[E,I]}),e[58]=E,e[59]=I,e[60]=T):T=e[60];let k;e[61]!==o.category?(k=s.jsx("span",{className:"capitalize",children:o.category}),e[61]=o.category,e[62]=k):k=e[62];let P;e[63]!==o.source?(P=o.source&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-border",children:"|"}),s.jsx("span",{children:o.source})]}),e[63]=o.source,e[64]=P):P=e[64];let L;e[65]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("span",{className:"text-border",children:"|"}),e[65]=L):L=e[65];let O;e[66]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Me,{size:12}),e[66]=O):O=e[66];let A;e[67]!==o.updatedAt?(A=At(o.updatedAt),e[67]=o.updatedAt,e[68]=A):A=e[68];let j;e[69]!==A?(j=s.jsxs("span",{className:"inline-flex items-center gap-1",children:[O,A]}),e[69]=A,e[70]=j):j=e[70];let F;e[71]!==k||e[72]!==P||e[73]!==j?(F=s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[k,P,L,j]}),e[71]=k,e[72]=P,e[73]=j,e[74]=F):F=e[74];let W;e[75]!==z||e[76]!==T||e[77]!==F?(W=s.jsxs("div",{className:"border-b border-border px-6 py-4 space-y-3",children:[z,T,F]}),e[75]=z,e[76]=T,e[77]=F,e[78]=W):W=e[78];let U;e[79]!==o.sections?(U=Be(o.sections??[]).map(Ft),e[79]=o.sections,e[80]=U):U=e[80];let V;e[81]!==U?(V=s.jsx("div",{className:"flex-1 px-6 py-6 space-y-8",children:U}),e[81]=U,e[82]=V):V=e[82];let Y;return e[83]!==W||e[84]!==V?(Y=s.jsxs("div",{className:"flex flex-col h-full overflow-y-auto pb-6",children:[W,V]}),e[83]=W,e[84]=V,e[85]=Y):Y=e[85],Y}function Ft(t){return t.type==="side-by-side"?s.jsxs("div",{className:"flex gap-6 items-start w-full",children:[s.jsx("div",{className:"w-full",children:s.jsx(Fe,{title:t.left.title,items:t.left.items})}),s.jsx("div",{className:"w-full",children:s.jsx(Oe,{title:t.right.title,items:t.right.items,stacked:!0})})]},`${t.leftIdx}-${t.rightIdx}`):s.jsx(Lt,{section:t.section},t.idx)}function Bt(){fe.success("Copied report as Markdown")}function Ut(t){fe.error(`Failed to update report: ${t.message}`)}function qt(t){const e=Date.now()-new Date(t).getTime(),l=Math.floor(e/6e4);if(l<1)return"just now";if(l<60)return`${l}m ago`;const n=Math.floor(l/60);if(n<24)return`${n}h ago`;const a=Math.floor(n/24);return a<30?`${a}d ago`:new Date(t).toLocaleDateString()}function Gt(t){const e=M.c(57),{report:l,isDoneTab:n,onSelect:a,onDismiss:i}=t,r=!l.lifecycleStatus||l.lifecycleStatus==="unread",o=n?"opacity-60":"hover:shadow-md";let d;e[0]!==o?(d=K("group relative cursor-pointer transition-shadow",o),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==a||e[3]!==l.id?(c=()=>a(l.id),e[2]=a,e[3]=l.id,e[4]=c):c=e[4];let u;e[5]!==r?(u=r&&s.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 rounded-l-xl bg-primary"}),e[5]=r,e[6]=u):u=e[6];const f=r&&"font-bold";let p;e[7]!==f?(p=K("text-sm leading-snug line-clamp-2",f),e[7]=f,e[8]=p):p=e[8];let x;e[9]!==l.title||e[10]!==p?(x=s.jsx(mt,{className:p,children:l.title}),e[9]=l.title,e[10]=p,e[11]=x):x=e[11];let h;e[12]!==l.status?(h=s.jsx(De,{status:l.status,size:"sm"}),e[12]=l.status,e[13]=h):h=e[13];const g=n?"Restore to inbox":"Mark as done",b=n?"text-muted-foreground hover:text-foreground hover:bg-accent":"text-muted-foreground/0 group-hover:text-muted-foreground hover:!text-emerald-600 hover:bg-emerald-500/10";let N;e[14]!==b?(N=K("rounded-md p-1 transition-colors",b),e[14]=b,e[15]=N):N=e[15];let y;e[16]!==n||e[17]!==i||e[18]!==l.id?(y=L=>{L.stopPropagation(),i(l.id,!n)},e[16]=n,e[17]=i,e[18]=l.id,e[19]=y):y=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(de,{size:14}),e[20]=v):v=e[20];let m;e[21]!==N||e[22]!==y||e[23]!==g?(m=s.jsx("button",{type:"button",title:g,className:N,onClick:y,children:v}),e[21]=N,e[22]=y,e[23]=g,e[24]=m):m=e[24];let C;e[25]!==m||e[26]!==h?(C=s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[h,m]}),e[25]=m,e[26]=h,e[27]=C):C=e[27];let _;e[28]!==C||e[29]!==x?(_=s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[x,C]}),e[28]=C,e[29]=x,e[30]=_):_=e[30];let S;e[31]!==l.summary?(S=s.jsx(ut,{className:"mt-1 line-clamp-2 text-xs",children:l.summary}),e[31]=l.summary,e[32]=S):S=e[32];let $;e[33]!==_||e[34]!==S?($=s.jsxs(ft,{className:"pb-2 pt-5 px-5",children:[_,S]}),e[33]=_,e[34]=S,e[35]=$):$=e[35];let z;e[36]!==l.category?(z=s.jsx("span",{className:"inline-flex items-center gap-1 capitalize",children:l.category}),e[36]=l.category,e[37]=z):z=e[37];let w;e[38]!==l.source?(w=l.source&&s.jsx("span",{className:"inline-flex items-center gap-1 text-muted-foreground/70",children:l.source}),e[38]=l.source,e[39]=w):w=e[39];let R;e[40]!==z||e[41]!==w?(R=s.jsxs("div",{className:"flex items-center gap-3",children:[z,w]}),e[40]=z,e[41]=w,e[42]=R):R=e[42];let E;e[43]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Me,{size:12}),e[43]=E):E=e[43];let I;e[44]!==l.updatedAt?(I=qt(l.updatedAt),e[44]=l.updatedAt,e[45]=I):I=e[45];let T;e[46]!==I?(T=s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs("span",{className:"inline-flex items-center gap-1",children:[E,I]})}),e[46]=I,e[47]=T):T=e[47];let k;e[48]!==R||e[49]!==T?(k=s.jsx(xt,{className:"px-5 pb-5",children:s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[R,T]})}),e[48]=R,e[49]=T,e[50]=k):k=e[50];let P;return e[51]!==$||e[52]!==d||e[53]!==k||e[54]!==c||e[55]!==u?(P=s.jsxs(pt,{className:d,onClick:c,children:[u,$,k]}),e[51]=$,e[52]=d,e[53]=k,e[54]=c,e[55]=u,e[56]=P):P=e[56],P}function Vt(t){const e=M.c(24),{category:l,status:n,categories:a,onCategoryChange:i,onStatusChange:r}=t,o=l??"__all__";let d;e[0]!==i?(d=_=>i(_==="__all__"?void 0:_),e[0]=i,e[1]=d):d=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx($e,{size:"sm",children:s.jsx(we,{placeholder:"All categories"})}),e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(me,{value:"__all__",children:"All categories"}),e[3]=u):u=e[3];let f;e[4]!==a?(f=a.map(Kt),e[4]=a,e[5]=f):f=e[5];let p;e[6]!==f?(p=s.jsxs(Se,{children:[u,f]}),e[6]=f,e[7]=p):p=e[7];let x;e[8]!==o||e[9]!==d||e[10]!==p?(x=s.jsxs(ke,{value:o,onValueChange:d,children:[c,p]}),e[8]=o,e[9]=d,e[10]=p,e[11]=x):x=e[11];const h=n??"__all__";let g;e[12]!==r?(g=_=>r(_==="__all__"?void 0:_),e[12]=r,e[13]=g):g=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx($e,{size:"sm",children:s.jsx(we,{placeholder:"All statuses"})}),e[14]=b):b=e[14];let N,y;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(me,{value:"__all__",children:"All statuses"}),y=Object.keys(ue),e[15]=N,e[16]=y):(N=e[15],y=e[16]);let v;e[17]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs(Se,{children:[N,y.map(Ht)]}),e[17]=v):v=e[17];let m;e[18]!==h||e[19]!==g?(m=s.jsxs(ke,{value:h,onValueChange:g,children:[b,v]}),e[18]=h,e[19]=g,e[20]=m):m=e[20];let C;return e[21]!==m||e[22]!==x?(C=s.jsxs("div",{className:"flex items-center gap-2",children:[x,m]}),e[21]=m,e[22]=x,e[23]=C):C=e[23],C}function Ht(t){return s.jsx(me,{value:t,children:ue[t].label},t)}function Kt(t){return s.jsx(me,{value:t,children:s.jsx("span",{className:"capitalize",children:t})},t)}function Wt(t){const e=M.c(51),{onSelectReport:l}=t,[n,a]=B.useState("inbox"),[i,r]=B.useState(),[o,d]=B.useState(),{connectionId:c,toolCaller:u}=xe(),f=Te();let p;e[0]!==i||e[1]!==o?(p={category:i,status:o},e[0]=i,e[1]=o,e[2]=p):p=e[2];const{data:x,isLoading:h,error:g}=ze(p),b=x?.reports??[],N=b.filter(Xt),y=b.filter(Yt),v=n==="inbox"?N:y,m=N.filter(Jt).length,{data:C}=ze();let _;e[3]!==C?.reports?(_=[...new Set((C?.reports??[]).map(Zt))].sort(),e[3]=C?.reports,e[4]=_):_=e[4];const S=_;let $;e[5]!==u?($=async H=>{const{reportId:te,lifecycleStatus:ie}=H;return u("REPORTS_UPDATE_STATUS",{reportId:te,lifecycleStatus:ie})},e[5]=u,e[6]=$):$=e[6];let z;e[7]!==c||e[8]!==f?(z=()=>{f.invalidateQueries({queryKey:re.reportsList(c)})},e[7]=c,e[8]=f,e[9]=z):z=e[9];let w;e[10]!==$||e[11]!==z?(w={mutationFn:$,onSuccess:z,onError:Qt},e[10]=$,e[11]=z,e[12]=w):w=e[12];const R=Ie(w);let E;e[13]!==R?(E=(H,te)=>{R.mutate({reportId:H,lifecycleStatus:te?"dismissed":"read"})},e[13]=R,e[14]=E):E=e[14];const I=E;if(g){let H,te;e[15]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(ve,{size:48,className:"text-destructive mb-4"}),te=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading reports"}),e[15]=H,e[16]=te):(H=e[15],te=e[16]);let ie;return e[17]!==g.message?(ie=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[H,te,s.jsx("p",{className:"text-muted-foreground text-center",children:g.message})]}),e[17]=g.message,e[18]=ie):ie=e[18],ie}const T="flex flex-col h-full";let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a("inbox"),e[19]=k):k=e[19];const P=n==="inbox"?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50";let L;e[20]!==P?(L=K("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",P),e[20]=P,e[21]=L):L=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Ee,{size:14}),e[22]=O):O=e[22];let A;e[23]!==h||e[24]!==m?(A=!h&&m>0&&s.jsx(dt,{variant:"default",className:"text-[10px] px-1.5 py-0 h-4",children:m}),e[23]=h,e[24]=m,e[25]=A):A=e[25];let j;e[26]!==L||e[27]!==A?(j=s.jsxs("button",{type:"button",onClick:k,className:L,children:[O,"Inbox",A]}),e[26]=L,e[27]=A,e[28]=j):j=e[28];let F;e[29]===Symbol.for("react.memo_cache_sentinel")?(F=()=>a("done"),e[29]=F):F=e[29];const W=n==="done"?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent/50";let U;e[30]!==W?(U=K("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors",W),e[30]=W,e[31]=U):U=e[31];let V;e[32]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(de,{size:14}),e[32]=V):V=e[32];const Y=!h&&y.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:y.length});let D;e[33]!==U||e[34]!==Y?(D=s.jsxs("button",{type:"button",onClick:F,className:U,children:[V,"Done",Y]}),e[33]=U,e[34]=Y,e[35]=D):D=e[35];let Q;e[36]!==j||e[37]!==D?(Q=s.jsxs("div",{className:"flex items-center gap-1",children:[j,D]}),e[36]=j,e[37]=D,e[38]=Q):Q=e[38];let q;e[39]!==S||e[40]!==i||e[41]!==o?(q=s.jsx(Vt,{category:i,status:o,categories:S,onCategoryChange:r,onStatusChange:d}),e[39]=S,e[40]=i,e[41]=o,e[42]=q):q=e[42];let Z;e[43]!==Q||e[44]!==q?(Z=s.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-border",children:[Q,q]}),e[43]=Q,e[44]=q,e[45]=Z):Z=e[45];const X="flex-1 overflow-y-auto p-6",ee=h?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(ce,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading reports..."})]}):v.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center h-full text-center",children:n==="done"?s.jsxs(s.Fragment,{children:[s.jsx(de,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No dismissed reports"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:"Reports you mark as done will appear here."})]}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:i||o?"No reports match filters":"Inbox is empty"}),s.jsx("p",{className:"text-muted-foreground max-w-sm",children:i||o?"Try adjusting your filters.":"Reports will appear here once the connected MCP server provides them."})]})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:v.map(H=>s.jsx(Gt,{report:H,isDoneTab:n==="done",onSelect:l,onDismiss:I},H.id))});let G;e[46]!==ee?(G=s.jsx("div",{className:X,children:ee}),e[46]=ee,e[47]=G):G=e[47];let J;return e[48]!==Z||e[49]!==G?(J=s.jsxs("div",{className:T,children:[Z,G]}),e[48]=Z,e[49]=G,e[50]=J):J=e[50],J}function Qt(t){fe.error(`Failed to update report: ${t.message}`)}function Zt(t){return t.category}function Jt(t){return!t.lifecycleStatus||t.lifecycleStatus==="unread"}function Yt(t){return t.lifecycleStatus==="dismissed"}function Xt(t){return t.lifecycleStatus!=="dismissed"}function es(t){return t?t.filter(e=>He(e,Ve)):[]}function Ls(){const t=M.c(58),{org:e,project:l}=Ue();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const a=qe(n),i=Ge(),r=Ke(),o=a.reportId??null;let d;t[1]!==i?(d=j=>{i({search:j?{reportId:j}:{},replace:!0})},t[1]=i,t[2]=d):d=t[2];const c=d;let u;t[3]!==e.id?(u={connectionId:We,orgId:e.id},t[3]=e.id,t[4]=u):u=t[4];const f=Qe(u);let p;t[5]!==l.id?(p=re.pluginConfig(l.id??"","reports"),t[5]=l.id,t[6]=p):p=t[6];let x;t[7]!==l.id||t[8]!==f?(x=async()=>{const j=await f.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:"reports"}});return j.structuredContent??j},t[7]=l.id,t[8]=f,t[9]=x):x=t[9];const h=!!l.id;let g;t[10]!==p||t[11]!==x||t[12]!==h?(g={queryKey:p,queryFn:x,enabled:h},t[10]=p,t[11]=x,t[12]=h,t[13]=g):g=t[13];const{data:b,isLoading:N}=Ne(g);let y,v;if(t[14]!==r||t[15]!==b?.config?.connectionId){v=es(r);const j=b?.config?.connectionId;y=j?v.find(F=>F.id===j):null,t[14]=r,t[15]=b?.config?.connectionId,t[16]=y,t[17]=v}else y=t[16],v=t[17];const m=y,C=m?.id;let _;t[18]!==e.id||t[19]!==C?(_={connectionId:C,orgId:e.id},t[18]=e.id,t[19]=C,t[20]=_):_=t[20];const S=Ze(_);let $;t[21]!==e.id||t[22]!==e.name||t[23]!==e.slug?($={id:e.id,slug:e.slug,name:e.name},t[21]=e.id,t[22]=e.name,t[23]=e.slug,t[24]=$):$=t[24];const z=$;if(N){let j;return t[25]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(ce,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),t[25]=j):j=t[25],j}if(v.length===0){let j;return t[26]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(ht,{}),t[26]=j):j=t[26],j}if(!m){let j;return t[27]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[s.jsx(Ye,{size:48,className:"text-muted-foreground mb-2"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]})}),t[27]=j):j=t[27],j}let w;t[28]!==m.app_id||t[29]!==m.app_name||t[30]!==m.description||t[31]!==m.icon||t[32]!==m.id||t[33]!==m.metadata||t[34]!==m.title||t[35]!==m.tools?(w={id:m.id,title:m.title,icon:m.icon,description:m.description,app_name:m.app_name,app_id:m.app_id,tools:m.tools,metadata:m.metadata},t[28]=m.app_id,t[29]=m.app_name,t[30]=m.description,t[31]=m.icon,t[32]=m.id,t[33]=m.metadata,t[34]=m.title,t[35]=m.tools,t[36]=w):w=t[36];let R;t[37]!==S?(R=(j,F)=>S?S.callTool({name:j,arguments:F}).then(ss):Promise.reject(new Error("MCP client is not available")),t[37]=S,t[38]=R):R=t[38];const E=R;let I;t[39]!==m.id||t[40]!==z||t[41]!==w||t[42]!==E?(I={connectionId:m.id,connection:w,toolCaller:E,org:z,session:null},t[39]=m.id,t[40]=z,t[41]=w,t[42]=E,t[43]=I):I=t[43];const T=I;let k;t[44]!==T.connection?(k=[T.connection],t[44]=T.connection,t[45]=k):k=t[45];let P;t[46]!==m.id||t[47]!==k?(P=s.jsx("div",{className:"flex items-center px-6 py-3 border-b border-border",children:s.jsx(jt,{connections:k,selectedConnectionId:m.id,onConnectionChange:ts})}),t[46]=m.id,t[47]=k,t[48]=P):P=t[48];let L;t[49]!==o||t[50]!==c?(L=s.jsx("div",{className:"flex-1 overflow-hidden",children:o?s.jsx(Ot,{reportId:o,onBack:()=>c(null)}):s.jsx(Wt,{onSelectReport:c})}),t[49]=o,t[50]=c,t[51]=L):L=t[51];let O;t[52]!==P||t[53]!==L?(O=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[P,L]}),t[52]=P,t[53]=L,t[54]=O):O=t[54];let A;return t[55]!==T||t[56]!==O?(A=s.jsx(Je,{value:T,children:O}),t[55]=T,t[56]=O,t[57]=A):A=t[57],A}function ts(){}function ss(t){return t.structuredContent??t}export{Ls as default};