decocms 4.113.3 → 4.113.4

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 (437) hide show
  1. package/dist/client/assets/{AlertCircle-C3yBEe62.js → AlertCircle-D3NSbtte.js} +1 -1
  2. package/dist/client/assets/{AreaChart-infhzD-o.js → AreaChart-CVVwbKz-.js} +1 -1
  3. package/dist/client/assets/{ArrowRight-csX1J00v.js → ArrowRight-ByO1s01w.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BMUqiZDH.js → ArrowUp-Cd7BXS0r.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-B0lTHBei.js → ArrowUpRight-OT_eUSGv.js} +1 -1
  6. package/dist/client/assets/{Check-BOCHVTek.js → Check-DexGeb34.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-C06fMtNJ.js → CheckCircle-BHeeUcEs.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-yHcuw3Yi.js → ChevronDown-CHuNudj6.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-BvtCGcbv.js → ChevronRight-CMzdRCrr.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-ClBbaiAV.js → ChevronUp-lRFXwe0H.js} +1 -1
  11. package/dist/client/assets/{Copy01-DjMityLv.js → Copy01-uMwlKnXA.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-C4ZbABhl.js → DotsVertical-BYSP2N_n.js} +1 -1
  13. package/dist/client/assets/{Eye-Drm0H5R_.js → Eye-BctMyF-b.js} +1 -1
  14. package/dist/client/assets/{FilterLines-DqKeoryA.js → FilterLines-CN2zN3dy.js} +1 -1
  15. package/dist/client/assets/{Globe01-BQOw_Ub7.js → Globe01-CdsyprSD.js} +1 -1
  16. package/dist/client/assets/{Globe04-CGcQW0g-.js → Globe04-Bsu11XTy.js} +1 -1
  17. package/dist/client/assets/{HardDrive-CWWkxzA_.js → HardDrive-BbGoyEqj.js} +1 -1
  18. package/dist/client/assets/{Image01-DlFSq1lp.js → Image01-CEPIXDUJ.js} +1 -1
  19. package/dist/client/assets/{Key01-DrW6AdUh.js → Key01-I5rdl_Gb.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-DcUppE8c.js → LayoutLeft-DUKr-FQx.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BboRX9pE.js → LinkExternal01-CerBDso7.js} +1 -1
  22. package/dist/client/assets/{LogOut01-BB-7O4XA.js → LogOut01-BQcYh9Ui.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CcN96Otm.js → Monitor01-bBKqAlRi.js} +1 -1
  24. package/dist/client/assets/{Package-BzQD_Ty_.js → Package-C1L6WXbG.js} +1 -1
  25. package/dist/client/assets/{Palette-Blkp2e-R.js → Palette-DkA-m4II.js} +1 -1
  26. package/dist/client/assets/{Play-D8x6tbEi.js → Play-D5AlhRua.js} +1 -1
  27. package/dist/client/assets/{Plus-CzNYCMBF.js → Plus-B78kfbrH.js} +1 -1
  28. package/dist/client/assets/{SearchLg-ChhVm0Qf.js → SearchLg-HLi9z3k2.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CTSIioHN.js → SearchMd-D9xCjcBT.js} +1 -1
  30. package/dist/client/assets/{Settings02-Cw_4rjJK.js → Settings02-D4D7dHyq.js} +1 -1
  31. package/dist/client/assets/{Shield01-DSa5H3Oo.js → Shield01-C0sINRXL.js} +1 -1
  32. package/dist/client/assets/{Star01-D85zX6Wg.js → Star01-Hh5rtrm_.js} +1 -1
  33. package/dist/client/assets/{Stars01-DTnCAiJN.js → Stars01-BIr-9im_.js} +1 -1
  34. package/dist/client/assets/{Stars02-BOwVjfZL.js → Stars02-x-FNLmKd.js} +1 -1
  35. package/dist/client/assets/{Sun-BgpgdJOh.js → Sun-CbURsFMr.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-DdzfKexZ.js → SwitchHorizontal01-CI53Hh9k.js} +1 -1
  37. package/dist/client/assets/{Tool01-BHPElJg3.js → Tool01-CrK-zdU8.js} +1 -1
  38. package/dist/client/assets/{Tool02-B1WxUTRS.js → Tool02-BLqj76jE.js} +1 -1
  39. package/dist/client/assets/{Trash01-CQs4hG5x.js → Trash01-Df4dKmk-.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-Cjtdx_Mr.js → TrendUp01-CDAx5KLE.js} +1 -1
  41. package/dist/client/assets/{Upload01-2aufxkFJ.js → Upload01-Dy7G4Vqj.js} +1 -1
  42. package/dist/client/assets/{User01-qg2q5EXG.js → User01-B00HeJ3v.js} +1 -1
  43. package/dist/client/assets/{Users01-DecEGc0z.js → Users01-demha86n.js} +1 -1
  44. package/dist/client/assets/{Users03-DvyrEhaR.js → Users03-CK3Zfb7D.js} +1 -1
  45. package/dist/client/assets/{X-ByT759cs.js → X-CehcuOdv.js} +1 -1
  46. package/dist/client/assets/{XCircle-bCCgCduZ.js → XCircle-BaIgTqjQ.js} +1 -1
  47. package/dist/client/assets/{XClose-CZnGWolh.js → XClose-Bf6_Xwqn.js} +1 -1
  48. package/dist/client/assets/{Zap-CqiaHzzF.js → Zap-CqCVe0AY.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-c0rQSrXf.js → ZapSquare-UWBEBtze.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-CrXsudJp.js → ZoomOut-kGLYh1vh.js} +1 -1
  51. package/dist/client/assets/{access-gate-v1EkWw_v.js → access-gate-Brf1uq7w.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-CCmZDfGj.js → add-section-modal-hl41gB3e.js} +1 -1
  53. package/dist/client/assets/{agent-icon-BOnTghRl.js → agent-icon-C5hkjd9d.js} +1 -1
  54. package/dist/client/assets/{agents-list-Bh9Nz4Fw.js → agents-list-DUZLZiO7.js} +1 -1
  55. package/dist/client/assets/{ai-providers-B78j6u61.js → ai-providers-Ddtnde82.js} +1 -1
  56. package/dist/client/assets/{alert-D-rAiL9n.js → alert-C0nUQV3Z.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-BV1C1gcm.js → alert-dialog-CoSPCPpg.js} +1 -1
  58. package/dist/client/assets/{app-editor-0kysJGlw.js → app-editor-C022NrTg.js} +1 -1
  59. package/dist/client/assets/{auth-DrixEdZV.js → auth-3hywqU0Z.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-OgqNGUQu.js → auth-catchall-B4Hu45Ne.js} +1 -1
  61. package/dist/client/assets/{auth-entry-Bu-wAE4C.js → auth-entry-Bd0jbgb_.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-BPjEQYcT.js → auth-split-layout-CY08Qy2Q.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-trH0piDT.js → authenticate-and-persist-oauth-C97UAKVm.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-Hhbhn6Ve.js → automation-list-row-CzqgyFTo.js} +1 -1
  65. package/dist/client/assets/{automation-runs-Cl8NKzOf.js → automation-runs-BJXzFuc5.js} +1 -1
  66. package/dist/client/assets/{automations-C0XROIdQ.js → automations-BNgdqlWi.js} +1 -1
  67. package/dist/client/assets/{autosend-bk9SGLB7.js → autosend-DKunmHJC.js} +1 -1
  68. package/dist/client/assets/{avatar-TfVrzXcD.js → avatar-bZ-OyZ4C.js} +1 -1
  69. package/dist/client/assets/{badge-Dq8tKfND.js → badge-BEoEV_-s.js} +1 -1
  70. package/dist/client/assets/{block-document-CSSMbpaN.js → block-document-Bsh4SSZF.js} +1 -1
  71. package/dist/client/assets/{brand-context-BpSXT9j1.js → brand-context-DsI_N6jC.js} +1 -1
  72. package/dist/client/assets/{buckets-CSQzXH56.js → buckets-66qFPEUl.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-BnemcYrz.js → bulk-category-panel-Cufz0WM3.js} +1 -1
  74. package/dist/client/assets/{calendar-C4A-LflQ.js → calendar-CtwiiKBb.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-BVansliv.js → capability-load-error-BIVVxP4I.js} +1 -1
  76. package/dist/client/assets/{card-CYIXg6Tz.js → card-BzIUIhXj.js} +1 -1
  77. package/dist/client/assets/{category-editor-CQlm8YTD.js → category-editor-CvwKblO3.js} +1 -1
  78. package/dist/client/assets/{chat-context-C0qm1cNd.js → chat-context-Crb9rWHK.js} +1 -1
  79. package/dist/client/assets/{checkbox-CJlLtjz4.js → checkbox-B7FxhNJt.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-xyy-6T0v.js → cli-auth-success-B13-d7YS.js} +1 -1
  81. package/dist/client/assets/{collection-detail-Ber5gOC6.js → collection-detail-CEn6RIOn.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-_9VLEjYD.js → collection-display-button-CzT8Gsvj.js} +1 -1
  83. package/dist/client/assets/{collection-search-DMVP7tq9.js → collection-search-CnQx2Rcs.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-CfaNknkJ.js → collection-table-wrapper-1UMvZ3fa.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-BYtcgqcY.js → collection-tabs-CBtRCQQL.js} +1 -1
  86. package/dist/client/assets/{command-55Q776qF.js → command-C5gxZS1R.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-CwQohRCA.js → commerce-onboarding-CB-WZK2l.js} +1 -1
  88. package/dist/client/assets/{companions-core-BsogTMm0.js → companions-core-42eUIML2.js} +1 -1
  89. package/dist/client/assets/{connect-Dzubmbm6.js → connect-DrIqorJQ.js} +1 -1
  90. package/dist/client/assets/{connect-desktop-dialog-BRyqkebt.js → connect-desktop-dialog-BTzMpZn4.js} +1 -1
  91. package/dist/client/assets/{connection-card-CnHj36QW.js → connection-card-CBIOrMcr.js} +1 -1
  92. package/dist/client/assets/{connection-detail-DioIwvgq.js → connection-detail-CUFaaTIx.js} +1 -1
  93. package/dist/client/assets/{connection-form-helpers-C36oVpDa.js → connection-form-helpers-51wU-tA4.js} +1 -1
  94. package/dist/client/assets/{connections-CMhMeidX.js → connections-fJWiq9na.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-DbXyz4b2.js → decopilot-sse-pool-JL7UXTva.js} +1 -1
  96. package/dist/client/assets/{dialog-Mssh4wvU.js → dialog-BopH09uO.js} +1 -1
  97. package/dist/client/assets/{domain-settings-D5jbLq0-.js → domain-settings-UBCepEd-.js} +1 -1
  98. package/dist/client/assets/{drawer-Df2dZjAh.js → drawer-4wGUz3NV.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-BOgizJmB.js → dropdown-menu-CqUwPgCM.js} +1 -1
  100. package/dist/client/assets/{empty-state-CajaBMj9.js → empty-state-DMQGyp-2.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-Bd7ZbKmz.js → extract-connection-data-Dg2OurD8.js} +1 -1
  102. package/dist/client/assets/{file-explorer-C0-F0HB8.js → file-explorer-Cr2rWfg3.js} +1 -1
  103. package/dist/client/assets/{file-type-icon-DeZBzLiN.js → file-type-icon-Dq1fYczo.js} +1 -1
  104. package/dist/client/assets/{files-DMRbcRYD.js → files-D11P-V12.js} +1 -1
  105. package/dist/client/assets/{form-a5EhWS__.js → form-DGbrQv7O.js} +1 -1
  106. package/dist/client/assets/{general-BXzwd9kr.js → general-ByuqDQPP.js} +1 -1
  107. package/dist/client/assets/{github-repo-picker-BF2G7ylb.js → github-repo-picker-CsJtF4k1.js} +1 -1
  108. package/dist/client/assets/{hooks-BYKqudQZ.js → hooks-Bqa3-ZMc.js} +1 -1
  109. package/dist/client/assets/{index-CDAhksmq.js → index-2cPeCHTJ.js} +1 -1
  110. package/dist/client/assets/{index-D0XkAkng.js → index-BU5jOX-E.js} +1 -1
  111. package/dist/client/assets/{index-ChR3SC6w.js → index-BZ6EPALd.js} +1 -1
  112. package/dist/client/assets/{index-Dd318vVc.js → index-BsEzp8oj.js} +1 -1
  113. package/dist/client/assets/{index-D3QnFu3t.js → index-BzpPy3wE.js} +3 -3
  114. package/dist/client/assets/{index-D8_uS6ju.js → index-CYhwzBFB.js} +1 -1
  115. package/dist/client/assets/{index-BjFrw_Cz.js → index-Cfzztnsx.js} +1 -1
  116. package/dist/client/assets/{index-D6Qe38nY.js → index-D0ar0WVw.js} +1 -1
  117. package/dist/client/assets/{index-BzKhWus-.js → index-D3an6z2y.js} +1 -1
  118. package/dist/client/assets/{index-wa1mGSJt.js → index-DJOz2VN0.js} +5 -5
  119. package/dist/client/assets/{index-i4iJK1qu.js → index-DNl9xlj2.js} +3 -3
  120. package/dist/client/assets/{index-BvXIjHT6.js → index-JokIayzs.js} +1 -1
  121. package/dist/client/assets/{index-DKYptawH.js → index-MOQFWNpJ.js} +1 -1
  122. package/dist/client/assets/{index-redirect-DAwJl3u9.js → index-redirect-C8kzuGQD.js} +1 -1
  123. package/dist/client/assets/{input-DBTIXVeB.js → input-BgKPAcUy.js} +1 -1
  124. package/dist/client/assets/{integration-icon-Cws5p9F1.js → integration-icon-COAmfKM2.js} +1 -1
  125. package/dist/client/assets/{invite-member-dialog-U14K8dLP.js → invite-member-dialog-D_2ikydr.js} +1 -1
  126. package/dist/client/assets/{label-hZbHKQe4.js → label-Bit-k39a.js} +1 -1
  127. package/dist/client/assets/{layout-BbmfwSeT.js → layout-bmMNsy2b.js} +1 -1
  128. package/dist/client/assets/{login-CYk7QqzO.js → login-Bme8dehk.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-BBJ-dCGK.js → mcp-oauth-DtUJKJBX.js} +1 -1
  130. package/dist/client/assets/{members-Br5ZzfAU.js → members-BdjB5MAU.js} +1 -1
  131. package/dist/client/assets/{monaco-editor-B7XD9jse.js → monaco-editor-BrEGduvG.js} +1 -1
  132. package/dist/client/assets/{monitoring-stats-row-CiB1VTGS.js → monitoring-stats-row-CNmPKGSb.js} +1 -1
  133. package/dist/client/assets/{multi-select-DtCSfvTi.js → multi-select-Bu-8nHIy.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-CuoSY6yW.js → oauth-callback-DVtgM464.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-DTd9RCl8.js → oauth-callback-ai-provider-D0dOkVqX.js} +1 -1
  136. package/dist/client/assets/{onboarding-VI53SQy5.js → onboarding-BT0PHxMW.js} +1 -1
  137. package/dist/client/assets/{org-install-BpRHfBoz.js → org-install-CVKBAdf6.js} +1 -1
  138. package/dist/client/assets/{org-layout-Ip0hYM6i.js → org-layout-Dv1Blc3Y.js} +1 -1
  139. package/dist/client/assets/{organization-choice-Ccir5zvX.js → organization-choice-B6BWp_1y.js} +1 -1
  140. package/dist/client/assets/{orgs-BK0nOPLw.js → orgs-Cy8dbVQf.js} +1 -1
  141. package/dist/client/assets/{page-seo-form-CBAWdwBB.js → page-seo-form-CBHtkQ-1.js} +1 -1
  142. package/dist/client/assets/page-seo-sheet-BEV8Rj_2.js +1 -0
  143. package/dist/client/assets/{popover-WvXSsr2A.js → popover-Bk7l46es.js} +1 -1
  144. package/dist/client/assets/{post-editor-GEIG3Qbs.js → post-editor-BFFD4TxR.js} +1 -1
  145. package/dist/client/assets/{primitives-B4b9OMlU.js → primitives-BUqBmg2w.js} +1 -1
  146. package/dist/client/assets/{profile-BJOXihUj.js → profile-_UM8G-04.js} +1 -1
  147. package/dist/client/assets/project-app-view-d8NlTW9s.js +1 -0
  148. package/dist/client/assets/record-editor-D87inyPk.js +1 -0
  149. package/dist/client/assets/redirect-editor-B5p1mIS_.js +1 -0
  150. package/dist/client/assets/registry-Cgy8gH4Y.js +2 -0
  151. package/dist/client/assets/{registry-layout-CUSBCALf.js → registry-layout-DZTQ7Enm.js} +2 -2
  152. package/dist/client/assets/{reports-CJYmnCRR.js → reports-CogLmgwx.js} +2 -2
  153. package/dist/client/assets/{require-capability-BOqOfzCO.js → require-capability-DAXk0d5y.js} +1 -1
  154. package/dist/client/assets/{required-auth-layout-C1iQaX9e.js → required-auth-layout-DVJ0P1R1.js} +1 -1
  155. package/dist/client/assets/{reset-password-ChmXlYVK.js → reset-password-Ba_pBAvO.js} +1 -1
  156. package/dist/client/assets/{roles-CuzTIzcA.js → roles-CXTr00hX.js} +1 -1
  157. package/dist/client/assets/{search-input-Di_KVfz5.js → search-input-C-UMJodP.js} +1 -1
  158. package/dist/client/assets/{secrets-Cwnb5SFR.js → secrets-D88X3IUQ.js} +1 -1
  159. package/dist/client/assets/{sections-editor-BnUP7eos.js → sections-editor-BFKZY_dP.js} +1 -1
  160. package/dist/client/assets/{select-CS3vGjLf.js → select-C-jyJoDt.js} +1 -1
  161. package/dist/client/assets/{select-model-CBkA3Qex.js → select-model-Dgd4xGjo.js} +1 -1
  162. package/dist/client/assets/{self-tool-result-olaCzjy8.js → self-tool-result-DPMrglQq.js} +1 -1
  163. package/dist/client/assets/{seo-editor-BS3PrYY5.js → seo-editor-BY6DSXGz.js} +1 -1
  164. package/dist/client/assets/{settings-layout-BWiwB1ve.js → settings-layout-CkDQpCLh.js} +1 -1
  165. package/dist/client/assets/{settings-section-B42r-p4q.js → settings-section-6MwJAdqF.js} +1 -1
  166. package/dist/client/assets/{shell-controls-CG47bgem.js → shell-controls-CnX0OdDH.js} +1 -1
  167. package/dist/client/assets/{shell-layout-C2jFubEc.js → shell-layout-CN7hhO1J.js} +1 -1
  168. package/dist/client/assets/{sidebar-DhNO0hbl.js → sidebar-C_iv7Nh9.js} +1 -1
  169. package/dist/client/assets/{skeleton-CkFFLL1Z.js → skeleton-DbS6ExIt.js} +1 -1
  170. package/dist/client/assets/{sso-DvIYBwsX.js → sso-B8CdFzAl.js} +1 -1
  171. package/dist/client/assets/{store-D2kZokQ2.js → store-Bnyy1WiV.js} +1 -1
  172. package/dist/client/assets/store-registry-BSo6cvku.js +2 -0
  173. package/dist/client/assets/{studio-tools-Dj_suUV-.js → studio-tools-IiJMHnzv.js} +1 -1
  174. package/dist/client/assets/{switch-CWGgmiWZ.js → switch-yqZ24tl_.js} +1 -1
  175. package/dist/client/assets/{table-B7Z84RDB.js → table-CmSWRFMQ.js} +1 -1
  176. package/dist/client/assets/{tabs-CSjEyx_g.js → tabs-7R3MGlLI.js} +1 -1
  177. package/dist/client/assets/{textarea-DNrJISFS.js → textarea-BE6VI2Sm.js} +1 -1
  178. package/dist/client/assets/{toggle-group-DngQXFC1.js → toggle-group-lTjODskL.js} +1 -1
  179. package/dist/client/assets/{toolbar-icon-button-BPZ8JgHL.js → toolbar-icon-button-DysigV8P.js} +1 -1
  180. package/dist/client/assets/{toolbar-BJAhXpws.js → toolbar-mS39lMFz.js} +1 -1
  181. package/dist/client/assets/{tooltip-BoYfeb4r.js → tooltip-CQ993dHl.js} +1 -1
  182. package/dist/client/assets/{use-ai-providers-B0uEL6GU.js → use-ai-providers-CcQLY3nb.js} +1 -1
  183. package/dist/client/assets/{use-api-keys-BUXdsmWE.js → use-api-keys-DJYutKrk.js} +1 -1
  184. package/dist/client/assets/{use-automations-BX-f2xPQ.js → use-automations-Dhj1E9Ph.js} +1 -1
  185. package/dist/client/assets/{use-autosave-D2xExJSi.js → use-autosave-C2xapmR1.js} +1 -1
  186. package/dist/client/assets/{use-capability-zn_dFQCr.js → use-capability-DyYemPOJ.js} +1 -1
  187. package/dist/client/assets/{use-clock-tick-Daz3W4ZL.js → use-clock-tick-Cy_Qdrwk.js} +1 -1
  188. package/dist/client/assets/{use-connection-CI4KVjBL.js → use-connection-DgItAPXg.js} +1 -1
  189. package/dist/client/assets/{use-copy-BFe-yhR7.js → use-copy-Cl4f2mnT.js} +1 -1
  190. package/dist/client/assets/{use-create-virtual-mcp-BruuOj8R.js → use-create-virtual-mcp-Cr2zciLP.js} +1 -1
  191. package/dist/client/assets/{use-debounced-autosave-C18-WjK7.js → use-debounced-autosave-DacEdb47.js} +1 -1
  192. package/dist/client/assets/{use-debounced-value-CgLjUKeF.js → use-debounced-value-COWnhTlx.js} +1 -1
  193. package/dist/client/assets/{use-deco-credits-Cl6XjjTb.js → use-deco-credits-C258e8Gu.js} +1 -1
  194. package/dist/client/assets/{use-decopilot-events-Opg95yOG.js → use-decopilot-events-C8Qld7KH.js} +1 -1
  195. package/dist/client/assets/{use-delete-connection-CkYrHV-n.js → use-delete-connection-D8xzfXPS.js} +1 -1
  196. package/dist/client/assets/{use-deployment-admin-CWMJlws-.js → use-deployment-admin-CUVPi201.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-CU2Y0Emb.js → use-file-configs-BS9XBoPf.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-mXDq9sbk.js → use-infinite-scroll-CHbZVRlR.js} +1 -1
  199. package/dist/client/assets/{use-join-requests-zFCwv89L.js → use-join-requests-BnVp32Ft.js} +1 -1
  200. package/dist/client/assets/{use-mcp-auth-status-BoHM8OB0.js → use-mcp-auth-status-C_bc7znM.js} +1 -1
  201. package/dist/client/assets/{use-mcp-client-DL89siIV.js → use-mcp-client-rUzkHeFC.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-C4CClJFZ.js → use-mcp-tools-wZzusmBD.js} +1 -1
  203. package/dist/client/assets/{use-members-A3agoGMA.js → use-members-Bs4G8Gn6.js} +1 -1
  204. package/dist/client/assets/{use-mobile-BwfgD4pT.js → use-mobile-Dfk9gz4P.js} +1 -1
  205. package/dist/client/assets/{use-navigate-to-agent-Bc0CpSD2.js → use-navigate-to-agent-D_ROb12r.js} +1 -1
  206. package/dist/client/assets/{use-org-auth-client-BTfVRkCO.js → use-org-auth-client-C2bpFjJB.js} +1 -1
  207. package/dist/client/assets/{use-org-sso-DYo24v3_.js → use-org-sso-o6qtDNhz.js} +1 -1
  208. package/dist/client/assets/{use-organization-roles-DYKLAq-n.js → use-organization-roles-CIhMiXnm.js} +1 -1
  209. package/dist/client/assets/{use-organization-settings-DoCpZun-.js → use-organization-settings-BN6Mbe3T.js} +1 -1
  210. package/dist/client/assets/{use-registry-app-nEihaLca.js → use-registry-app-CdXrR-uL.js} +1 -1
  211. package/dist/client/assets/{use-registry-connections-DuneVuyO.js → use-registry-connections-DUTwru2C.js} +1 -1
  212. package/dist/client/assets/{use-secrets-CG9MzH4M.js → use-secrets-BGQjv51d.js} +1 -1
  213. package/dist/client/assets/{use-status-sounds-C-LWwT7t.js → use-status-sounds-DNfyHXSY.js} +1 -1
  214. package/dist/client/assets/{use-view-mode--BSnFAw6.js → use-view-mode-3AUQk446.js} +1 -1
  215. package/dist/client/assets/{use-virtual-mcp-C6uu6xME.js → use-virtual-mcp-EXgj09hR.js} +1 -1
  216. package/dist/client/assets/useInfiniteQuery-BuJ4N0EZ.js +1 -0
  217. package/dist/client/assets/{useQueries-BT8q2MfJ.js → useQueries-BTxFVSBJ.js} +1 -1
  218. package/dist/client/assets/{useRouterState-BMgTcVFU.js → useRouterState-CSm1vh-t.js} +1 -1
  219. package/dist/client/assets/useSuspenseInfiniteQuery-CnxU3y26.js +1 -0
  220. package/dist/client/assets/{users-BXaOYgw2.js → users-BUKZ3ENb.js} +1 -1
  221. package/dist/client/assets/{variant-calendar-C61DYxyp.js → variant-calendar-BkY_wbhM.js} +1 -1
  222. package/dist/client/assets/{view-mode-toggle-C8Ikqgl7.js → view-mode-toggle-cynxUaRv.js} +1 -1
  223. package/dist/client/index.html +1 -1
  224. package/dist/client/report-og-fallback.png +0 -0
  225. package/dist/server/cli.js +656 -656
  226. package/dist/server/migrate.js +5 -5
  227. package/dist/server/node_modules/@resvg/resvg-js/LICENSE +373 -0
  228. package/dist/server/node_modules/@resvg/resvg-js/README.md +314 -0
  229. package/dist/server/node_modules/@resvg/resvg-js/index.js +23 -0
  230. package/dist/server/node_modules/@resvg/resvg-js/js-binding.js +1 -0
  231. package/dist/server/node_modules/@resvg/resvg-js/package.json +152 -0
  232. package/dist/server/node_modules/@shuding/opentype.js/LICENSE +20 -0
  233. package/dist/server/node_modules/@shuding/opentype.js/README.md +9 -0
  234. package/dist/server/node_modules/@shuding/opentype.js/RELEASES.md +272 -0
  235. package/dist/server/node_modules/@shuding/opentype.js/bin/ot +84 -0
  236. package/dist/server/node_modules/@shuding/opentype.js/bin/server.js +64 -0
  237. package/dist/server/node_modules/@shuding/opentype.js/bin/test-render +96 -0
  238. package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.js +11655 -0
  239. package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.min.js +2 -0
  240. package/dist/server/node_modules/@shuding/opentype.js/dist/opentype.module.js +11639 -0
  241. package/dist/server/node_modules/@shuding/opentype.js/package.json +73 -0
  242. package/dist/server/node_modules/@shuding/opentype.js/src/bbox.js +158 -0
  243. package/dist/server/node_modules/@shuding/opentype.js/src/bidi.js +243 -0
  244. package/dist/server/node_modules/@shuding/opentype.js/src/char.js +43 -0
  245. package/dist/server/node_modules/@shuding/opentype.js/src/check.js +16 -0
  246. package/dist/server/node_modules/@shuding/opentype.js/src/encoding.js +1032 -0
  247. package/dist/server/node_modules/@shuding/opentype.js/src/features/applySubstitution.js +74 -0
  248. package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/arabicPresentationForms.js +83 -0
  249. package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/arabicRequiredLigatures.js +41 -0
  250. package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/contextCheck/arabicSentence.js +43 -0
  251. package/dist/server/node_modules/@shuding/opentype.js/src/features/arab/contextCheck/arabicWord.js +31 -0
  252. package/dist/server/node_modules/@shuding/opentype.js/src/features/featureQuery.js +483 -0
  253. package/dist/server/node_modules/@shuding/opentype.js/src/features/latn/contextCheck/latinWord.js +31 -0
  254. package/dist/server/node_modules/@shuding/opentype.js/src/features/latn/latinLigatures.js +40 -0
  255. package/dist/server/node_modules/@shuding/opentype.js/src/font.js +433 -0
  256. package/dist/server/node_modules/@shuding/opentype.js/src/glyph.js +274 -0
  257. package/dist/server/node_modules/@shuding/opentype.js/src/glyphset.js +150 -0
  258. package/dist/server/node_modules/@shuding/opentype.js/src/hintingtt.js +3062 -0
  259. package/dist/server/node_modules/@shuding/opentype.js/src/index.js +5 -0
  260. package/dist/server/node_modules/@shuding/opentype.js/src/layout.js +357 -0
  261. package/dist/server/node_modules/@shuding/opentype.js/src/opentype.js +375 -0
  262. package/dist/server/node_modules/@shuding/opentype.js/src/parse.js +628 -0
  263. package/dist/server/node_modules/@shuding/opentype.js/src/path.js +212 -0
  264. package/dist/server/node_modules/@shuding/opentype.js/src/position.js +77 -0
  265. package/dist/server/node_modules/@shuding/opentype.js/src/substitution.js +447 -0
  266. package/dist/server/node_modules/@shuding/opentype.js/src/table.js +215 -0
  267. package/dist/server/node_modules/@shuding/opentype.js/src/tables/cff.js +1156 -0
  268. package/dist/server/node_modules/@shuding/opentype.js/src/tables/cmap.js +145 -0
  269. package/dist/server/node_modules/@shuding/opentype.js/src/tables/fvar.js +71 -0
  270. package/dist/server/node_modules/@shuding/opentype.js/src/tables/gdef.js +62 -0
  271. package/dist/server/node_modules/@shuding/opentype.js/src/tables/glyf.js +349 -0
  272. package/dist/server/node_modules/@shuding/opentype.js/src/tables/gpos.js +146 -0
  273. package/dist/server/node_modules/@shuding/opentype.js/src/tables/gsub.js +251 -0
  274. package/dist/server/node_modules/@shuding/opentype.js/src/tables/head.js +35 -0
  275. package/dist/server/node_modules/@shuding/opentype.js/src/tables/hhea.js +27 -0
  276. package/dist/server/node_modules/@shuding/opentype.js/src/tables/hmtx.js +51 -0
  277. package/dist/server/node_modules/@shuding/opentype.js/src/tables/kern.js +69 -0
  278. package/dist/server/node_modules/@shuding/opentype.js/src/tables/loca.js +31 -0
  279. package/dist/server/node_modules/@shuding/opentype.js/src/tables/ltag.js +33 -0
  280. package/dist/server/node_modules/@shuding/opentype.js/src/tables/maxp.js +32 -0
  281. package/dist/server/node_modules/@shuding/opentype.js/src/tables/meta.js +30 -0
  282. package/dist/server/node_modules/@shuding/opentype.js/src/tables/name.js +680 -0
  283. package/dist/server/node_modules/@shuding/opentype.js/src/tables/os2.js +65 -0
  284. package/dist/server/node_modules/@shuding/opentype.js/src/tables/post.js +41 -0
  285. package/dist/server/node_modules/@shuding/opentype.js/src/tokenizer.js +522 -0
  286. package/dist/server/node_modules/@shuding/opentype.js/src/types.js +976 -0
  287. package/dist/server/node_modules/@shuding/opentype.js/src/util.js +17 -0
  288. package/dist/server/node_modules/base64-js/.travis.yml +5 -0
  289. package/dist/server/node_modules/base64-js/LICENSE.MIT +21 -0
  290. package/dist/server/node_modules/base64-js/README.md +31 -0
  291. package/dist/server/node_modules/base64-js/bench/bench.js +19 -0
  292. package/dist/server/node_modules/base64-js/lib/b64.js +124 -0
  293. package/dist/server/node_modules/base64-js/package.json +34 -0
  294. package/dist/server/node_modules/base64-js/test/convert.js +51 -0
  295. package/dist/server/node_modules/base64-js/test/url-safe.js +18 -0
  296. package/dist/server/node_modules/camelize/.eslintrc +24 -0
  297. package/dist/server/node_modules/camelize/.github/FUNDING.yml +12 -0
  298. package/dist/server/node_modules/camelize/CHANGELOG.md +64 -0
  299. package/dist/server/node_modules/camelize/LICENSE +18 -0
  300. package/dist/server/node_modules/camelize/README.md +81 -0
  301. package/dist/server/node_modules/camelize/example/camel.js +12 -0
  302. package/dist/server/node_modules/camelize/index.js +61 -0
  303. package/dist/server/node_modules/camelize/package.json +84 -0
  304. package/dist/server/node_modules/camelize/test/camel.js +48 -0
  305. package/dist/server/node_modules/color-name/LICENSE +8 -0
  306. package/dist/server/node_modules/color-name/README.md +11 -0
  307. package/dist/server/node_modules/color-name/index.js +152 -0
  308. package/dist/server/node_modules/color-name/package.json +28 -0
  309. package/dist/server/node_modules/css-background-parser/LICENSE +22 -0
  310. package/dist/server/node_modules/css-background-parser/README.md +149 -0
  311. package/dist/server/node_modules/css-background-parser/index.js +162 -0
  312. package/dist/server/node_modules/css-background-parser/package.json +19 -0
  313. package/dist/server/node_modules/css-box-shadow/README.md +27 -0
  314. package/dist/server/node_modules/css-box-shadow/index.js +64 -0
  315. package/dist/server/node_modules/css-box-shadow/package.json +14 -0
  316. package/dist/server/node_modules/css-box-shadow/test.js +204 -0
  317. package/dist/server/node_modules/css-color-keywords/LICENSE +15 -0
  318. package/dist/server/node_modules/css-color-keywords/README.md +47 -0
  319. package/dist/server/node_modules/css-color-keywords/colors.json +148 -0
  320. package/dist/server/node_modules/css-color-keywords/index.js +3 -0
  321. package/dist/server/node_modules/css-color-keywords/package.json +27 -0
  322. package/dist/server/node_modules/css-gradient-parser/LICENSE +21 -0
  323. package/dist/server/node_modules/css-gradient-parser/README.md +75 -0
  324. package/dist/server/node_modules/css-gradient-parser/dist/index.cjs +2 -0
  325. package/dist/server/node_modules/css-gradient-parser/dist/index.js +2 -0
  326. package/dist/server/node_modules/css-gradient-parser/package.json +54 -0
  327. package/dist/server/node_modules/css-to-react-native/LICENSE.md +21 -0
  328. package/dist/server/node_modules/css-to-react-native/README.md +115 -0
  329. package/dist/server/node_modules/css-to-react-native/index.js +886 -0
  330. package/dist/server/node_modules/css-to-react-native/package.json +65 -0
  331. package/dist/server/node_modules/css-to-react-native/src/TokenStream.js +74 -0
  332. package/dist/server/node_modules/css-to-react-native/src/__tests__/aspectRatio.js +23 -0
  333. package/dist/server/node_modules/css-to-react-native/src/__tests__/border.js +85 -0
  334. package/dist/server/node_modules/css-to-react-native/src/__tests__/borderColor.js +37 -0
  335. package/dist/server/node_modules/css-to-react-native/src/__tests__/boxModel.js +136 -0
  336. package/dist/server/node_modules/css-to-react-native/src/__tests__/boxShadow.js +83 -0
  337. package/dist/server/node_modules/css-to-react-native/src/__tests__/colors.js +31 -0
  338. package/dist/server/node_modules/css-to-react-native/src/__tests__/flex.js +122 -0
  339. package/dist/server/node_modules/css-to-react-native/src/__tests__/flexFlow.js +22 -0
  340. package/dist/server/node_modules/css-to-react-native/src/__tests__/font.js +117 -0
  341. package/dist/server/node_modules/css-to-react-native/src/__tests__/fontFamily.js +43 -0
  342. package/dist/server/node_modules/css-to-react-native/src/__tests__/fontVariant.js +15 -0
  343. package/dist/server/node_modules/css-to-react-native/src/__tests__/fontWeight.js +8 -0
  344. package/dist/server/node_modules/css-to-react-native/src/__tests__/index.js +204 -0
  345. package/dist/server/node_modules/css-to-react-native/src/__tests__/placeContent.js +19 -0
  346. package/dist/server/node_modules/css-to-react-native/src/__tests__/shadowOffsets.js +13 -0
  347. package/dist/server/node_modules/css-to-react-native/src/__tests__/textDecoration.js +103 -0
  348. package/dist/server/node_modules/css-to-react-native/src/__tests__/textDecorationLine.js +23 -0
  349. package/dist/server/node_modules/css-to-react-native/src/__tests__/textShadow.js +30 -0
  350. package/dist/server/node_modules/css-to-react-native/src/__tests__/transform.js +55 -0
  351. package/dist/server/node_modules/css-to-react-native/src/__tests__/units.js +132 -0
  352. package/dist/server/node_modules/css-to-react-native/src/devPropertiesWithoutUnitsRegExp.js +19 -0
  353. package/dist/server/node_modules/css-to-react-native/src/index.js +90 -0
  354. package/dist/server/node_modules/css-to-react-native/src/tokenTypes.js +75 -0
  355. package/dist/server/node_modules/css-to-react-native/src/transforms/aspectRatio.js +12 -0
  356. package/dist/server/node_modules/css-to-react-native/src/transforms/border.js +53 -0
  357. package/dist/server/node_modules/css-to-react-native/src/transforms/boxShadow.js +11 -0
  358. package/dist/server/node_modules/css-to-react-native/src/transforms/flex.js +65 -0
  359. package/dist/server/node_modules/css-to-react-native/src/transforms/flexFlow.js +37 -0
  360. package/dist/server/node_modules/css-to-react-native/src/transforms/font.js +63 -0
  361. package/dist/server/node_modules/css-to-react-native/src/transforms/fontFamily.js +20 -0
  362. package/dist/server/node_modules/css-to-react-native/src/transforms/fontVariant.js +14 -0
  363. package/dist/server/node_modules/css-to-react-native/src/transforms/index.js +77 -0
  364. package/dist/server/node_modules/css-to-react-native/src/transforms/placeContent.js +24 -0
  365. package/dist/server/node_modules/css-to-react-native/src/transforms/textDecoration.js +53 -0
  366. package/dist/server/node_modules/css-to-react-native/src/transforms/textDecorationLine.js +18 -0
  367. package/dist/server/node_modules/css-to-react-native/src/transforms/textShadow.js +10 -0
  368. package/dist/server/node_modules/css-to-react-native/src/transforms/transform.js +74 -0
  369. package/dist/server/node_modules/css-to-react-native/src/transforms/util.js +99 -0
  370. package/dist/server/node_modules/hex-rgb/index.js +47 -0
  371. package/dist/server/node_modules/hex-rgb/license +9 -0
  372. package/dist/server/node_modules/hex-rgb/package.json +39 -0
  373. package/dist/server/node_modules/hex-rgb/readme.md +86 -0
  374. package/dist/server/node_modules/linebreak/LICENSE +21 -0
  375. package/dist/server/node_modules/linebreak/dist/main.cjs +1369 -0
  376. package/dist/server/node_modules/linebreak/dist/module.mjs +1368 -0
  377. package/dist/server/node_modules/linebreak/package.json +57 -0
  378. package/dist/server/node_modules/linebreak/readme.md +62 -0
  379. package/dist/server/node_modules/parse-css-color/CHANGELOG.md +54 -0
  380. package/dist/server/node_modules/parse-css-color/LICENSE +21 -0
  381. package/dist/server/node_modules/parse-css-color/README.md +110 -0
  382. package/dist/server/node_modules/parse-css-color/dist/index.cjs.js +171 -0
  383. package/dist/server/node_modules/parse-css-color/dist/index.esm.js +167 -0
  384. package/dist/server/node_modules/parse-css-color/dist/index.umd.js +7 -0
  385. package/dist/server/node_modules/parse-css-color/package.json +55 -0
  386. package/dist/server/node_modules/postcss-value-parser/LICENSE +22 -0
  387. package/dist/server/node_modules/postcss-value-parser/README.md +263 -0
  388. package/dist/server/node_modules/postcss-value-parser/lib/index.js +28 -0
  389. package/dist/server/node_modules/postcss-value-parser/lib/parse.js +321 -0
  390. package/dist/server/node_modules/postcss-value-parser/lib/stringify.js +48 -0
  391. package/dist/server/node_modules/postcss-value-parser/lib/unit.js +120 -0
  392. package/dist/server/node_modules/postcss-value-parser/lib/walk.js +22 -0
  393. package/dist/server/node_modules/postcss-value-parser/package.json +58 -0
  394. package/dist/server/node_modules/satori/LICENSE +373 -0
  395. package/dist/server/node_modules/satori/README.md +516 -0
  396. package/dist/server/node_modules/satori/dist/index.cjs +8 -0
  397. package/dist/server/node_modules/satori/dist/index.cjs.LEGAL.txt +4 -0
  398. package/dist/server/node_modules/satori/dist/index.js +8 -0
  399. package/dist/server/node_modules/satori/dist/index.js.LEGAL.txt +4 -0
  400. package/dist/server/node_modules/satori/dist/jsx/index.cjs +2 -0
  401. package/dist/server/node_modules/satori/dist/jsx/index.cjs.LEGAL.txt +0 -0
  402. package/dist/server/node_modules/satori/dist/jsx/index.js +2 -0
  403. package/dist/server/node_modules/satori/dist/jsx/index.js.LEGAL.txt +0 -0
  404. package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.cjs +2 -0
  405. package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.cjs.LEGAL.txt +0 -0
  406. package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.js +2 -0
  407. package/dist/server/node_modules/satori/dist/jsx/jsx-runtime.js.LEGAL.txt +0 -0
  408. package/dist/server/node_modules/satori/dist/standalone.cjs +8 -0
  409. package/dist/server/node_modules/satori/dist/standalone.cjs.LEGAL.txt +4 -0
  410. package/dist/server/node_modules/satori/dist/standalone.js +8 -0
  411. package/dist/server/node_modules/satori/dist/standalone.js.LEGAL.txt +4 -0
  412. package/dist/server/node_modules/satori/package.json +149 -0
  413. package/dist/server/node_modules/satori/yoga.wasm +0 -0
  414. package/dist/server/node_modules/tiny-inflate/LICENSE +21 -0
  415. package/dist/server/node_modules/tiny-inflate/index.js +375 -0
  416. package/dist/server/node_modules/tiny-inflate/package.json +28 -0
  417. package/dist/server/node_modules/tiny-inflate/readme.md +31 -0
  418. package/dist/server/node_modules/tiny-inflate/test/index.js +75 -0
  419. package/dist/server/node_modules/tiny-inflate/test/lorem.txt +199 -0
  420. package/dist/server/node_modules/unicode-trie/LICENSE +8 -0
  421. package/dist/server/node_modules/unicode-trie/README.md +77 -0
  422. package/dist/server/node_modules/unicode-trie/builder.js +966 -0
  423. package/dist/server/node_modules/unicode-trie/index.js +136 -0
  424. package/dist/server/node_modules/unicode-trie/package.json +27 -0
  425. package/dist/server/node_modules/unicode-trie/swap.js +25 -0
  426. package/dist/server/node_modules/unicode-trie/test/mocha.opts +1 -0
  427. package/dist/server/node_modules/unicode-trie/test/test.js +243 -0
  428. package/dist/server/server.js +640 -640
  429. package/package.json +3 -1
  430. package/dist/client/assets/page-seo-sheet-BVOTKmAi.js +0 -1
  431. package/dist/client/assets/project-app-view-BJPw6BEN.js +0 -1
  432. package/dist/client/assets/record-editor-DGNLZeof.js +0 -1
  433. package/dist/client/assets/redirect-editor-rNADegcF.js +0 -1
  434. package/dist/client/assets/registry-DSHcnwR4.js +0 -2
  435. package/dist/client/assets/store-registry-q7deglpz.js +0 -2
  436. package/dist/client/assets/useInfiniteQuery-DVl8ILZo.js +0 -1
  437. package/dist/client/assets/useSuspenseInfiniteQuery-ClimnWE2.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as Z,F as be,n as Ae,o as Ue,e as _e,t as G,b as ce,r as M,j as t,B as Y,k as Ye,m as te,b9 as Ks,ba as Hs}from"./index-i4iJK1qu.js";import{i as Xt,a as ms,t as Vs,c as Gs,n as Qs,b as Ys}from"./Tool02-B1WxUTRS.js";import{i as We}from"./CheckCircle-C06fMtNJ.js";import{s as Lt,c as Ws,b as Js,i as Zs,a as Xs}from"./Settings02-Cw_4rjJK.js";import{S as ze,u as Fe,W as er}from"./use-mcp-client-DL89siIV.js";import{u as gs}from"./useInfiniteQuery-DVl8ILZo.js";import{u as Te}from"./studio-tools-Dj_suUV-.js";import{B as V}from"./badge-Dq8tKfND.js";import{I as ye}from"./input-DBTIXVeB.js";import{D as pt,a as Re,b as ht,c as ft,j as es,k as ts,i as tr}from"./dropdown-menu-BOgizJmB.js";import{c as At,e as Ut,a as Je,d as pe,b as Ft,T as he}from"./table-B7Z84RDB.js";import{a as sr,T as ss}from"./toggle-group-DngQXFC1.js";import{u as rr}from"./use-view-mode--BSnFAw6.js";import{a as $t}from"./DotsVertical-C4ZbABhl.js";import{i as ir}from"./FilterLines-DqKeoryA.js";import{n as nr,i as xs}from"./Globe01-BQOw_Ub7.js";import{i as ar}from"./SearchMd-CTSIioHN.js";import{e as yt,d as jt,b as vt,h as bt,a as Nt,c as Ct}from"./dialog-Mssh4wvU.js";import{i as tt}from"./AlertCircle-C3yBEe62.js";import{i as rs}from"./Upload01-2aufxkFJ.js";import{c as st,d as rt,b as it,f as nt,g as at,e as ot,a as lt,A as ct}from"./alert-dialog-BV1C1gcm.js";import{C as me}from"./card-CYIXg6Tz.js";import{s as dt}from"./Trash01-CQs4hG5x.js";import{L as ae}from"./label-hZbHKQe4.js";import{S as or,a as lr,b as cr,c as dr,d as Dt}from"./select-CS3vGjLf.js";import{S as Ge}from"./switch-CWGgmiWZ.js";import{T as wt}from"./textarea-DNrJISFS.js";import{i as ur}from"./ArrowRight-csX1J00v.js";import{i as mr}from"./X-ByT759cs.js";import{a as gr,i as xr}from"./XCircle-bCCgCduZ.js";import{t as pr}from"./ChevronDown-yHcuw3Yi.js";import{n as hr}from"./ChevronUp-ClBbaiAV.js";import{C as is}from"./checkbox-CJlLtjz4.js";import{s as ps}from"./Eye-Drm0H5R_.js";import{n as fr}from"./LinkExternal01-BboRX9pE.js";import{u as yr}from"./use-infinite-scroll-mXDq9sbk.js";import{u as Tt}from"./use-copy-BFe-yhR7.js";import{i as Mt}from"./Check-BOCHVTek.js";import{a as qt}from"./Copy01-DjMityLv.js";import{i as jr}from"./Key01-DrW6AdUh.js";import{s as vr}from"./Plus-CzNYCMBF.js";import{T as br,a as Nr,c as Cr}from"./tooltip-BoYfeb4r.js";import{i as wr,a as _r}from"./mcp-oauth-BBJ-dCGK.js";import{i as Pr}from"./Play-D8x6tbEi.js";import"./auth-DrixEdZV.js";import"./ChevronRight-BvtCGcbv.js";import"./use-mobile-BwfgD4pT.js";const Ve="private-registry",Rr=`
1
+ import{c as Z,F as be,n as Ae,o as Ue,e as _e,t as G,b as ce,r as M,j as t,B as Y,k as Ye,m as te,b9 as Ks,ba as Hs}from"./index-DNl9xlj2.js";import{i as Xt,a as ms,t as Vs,c as Gs,n as Qs,b as Ys}from"./Tool02-BLqj76jE.js";import{i as We}from"./CheckCircle-BHeeUcEs.js";import{s as Lt,c as Ws,b as Js,i as Zs,a as Xs}from"./Settings02-D4D7dHyq.js";import{S as ze,u as Fe,W as er}from"./use-mcp-client-rUzkHeFC.js";import{u as gs}from"./useInfiniteQuery-BuJ4N0EZ.js";import{u as Te}from"./studio-tools-IiJMHnzv.js";import{B as V}from"./badge-BEoEV_-s.js";import{I as ye}from"./input-BgKPAcUy.js";import{D as pt,a as Re,b as ht,c as ft,j as es,k as ts,i as tr}from"./dropdown-menu-CqUwPgCM.js";import{c as At,e as Ut,a as Je,d as pe,b as Ft,T as he}from"./table-CmSWRFMQ.js";import{a as sr,T as ss}from"./toggle-group-lTjODskL.js";import{u as rr}from"./use-view-mode-3AUQk446.js";import{a as $t}from"./DotsVertical-BYSP2N_n.js";import{i as ir}from"./FilterLines-CN2zN3dy.js";import{n as nr,i as xs}from"./Globe01-CdsyprSD.js";import{i as ar}from"./SearchMd-D9xCjcBT.js";import{e as yt,d as jt,b as vt,h as bt,a as Nt,c as Ct}from"./dialog-BopH09uO.js";import{i as tt}from"./AlertCircle-D3NSbtte.js";import{i as rs}from"./Upload01-Dy7G4Vqj.js";import{c as st,d as rt,b as it,f as nt,g as at,e as ot,a as lt,A as ct}from"./alert-dialog-CoSPCPpg.js";import{C as me}from"./card-BzIUIhXj.js";import{s as dt}from"./Trash01-Df4dKmk-.js";import{L as ae}from"./label-Bit-k39a.js";import{S as or,a as lr,b as cr,c as dr,d as Dt}from"./select-C-jyJoDt.js";import{S as Ge}from"./switch-yqZ24tl_.js";import{T as wt}from"./textarea-BE6VI2Sm.js";import{i as ur}from"./ArrowRight-ByO1s01w.js";import{i as mr}from"./X-CehcuOdv.js";import{a as gr,i as xr}from"./XCircle-BaIgTqjQ.js";import{t as pr}from"./ChevronDown-CHuNudj6.js";import{n as hr}from"./ChevronUp-lRFXwe0H.js";import{C as is}from"./checkbox-B7FxhNJt.js";import{s as ps}from"./Eye-BctMyF-b.js";import{n as fr}from"./LinkExternal01-CerBDso7.js";import{u as yr}from"./use-infinite-scroll-CHbZVRlR.js";import{u as Tt}from"./use-copy-Cl4f2mnT.js";import{i as Mt}from"./Check-DexGeb34.js";import{a as qt}from"./Copy01-uMwlKnXA.js";import{i as jr}from"./Key01-I5rdl_Gb.js";import{s as vr}from"./Plus-B78kfbrH.js";import{T as br,a as Nr,c as Cr}from"./tooltip-CQ993dHl.js";import{i as wr,a as _r}from"./mcp-oauth-DtUJKJBX.js";import{i as Pr}from"./Play-D5AlhRua.js";import"./auth-3hywqU0Z.js";import"./ChevronRight-CMzdRCrr.js";import"./use-mobile-Dfk9gz4P.js";const Ve="private-registry",Rr=`
2
2
  You are an MCP tool tester running automated integration checks.
3
3
 
4
4
  Goal:
@@ -24,4 +24,4 @@ At the end, provide a concise summary of:
24
24
  my-mcp-server,My MCP Server,A useful MCP server,https://example.com/mcp,http,ai|tools,productivity,true
25
25
  another-server,Another Server,Another useful server,https://example2.com/mcp,http,data|analytics,data-processing,false`;function Yr(){const s=new Blob([Qr],{type:"text/csv;charset=utf-8"}),e=URL.createObjectURL(s),r=document.createElement("a");r.href=e,r.download="registry-import-template.csv",r.click(),URL.revokeObjectURL(e)}function Wr(s){const e=Z.c(101),{open:r,onOpenChange:i,isImporting:n,onImport:l}=s,c=n===void 0?!1:n,o=ce(),[a,u]=M.useState(null),[d,m]=M.useState(null),[f,p]=M.useState(null),g=M.useRef(null);let x;e[0]!==i?(x=E=>{i(E),E||(u(null),m(null),p(null),g.current&&(g.current.value=""))},e[0]=i,e[1]=x):x=e[1];const h=x;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=async E=>{if(!E)return;p(E.name),m(null);const O=await E.text();u(Gr(O))},e[2]=y):y=e[2];const N=y;let w;e[3]!==l||e[4]!==a?(w=async()=>{if(!a?.items.length)return;const E=await l(a.items);m(E)},e[3]=l,e[4]=a,e[5]=w):w=e[5];const _=w;let b,L,I,P,R,k,A,q,v,S,D;if(e[6]!==f||e[7]!==_||e[8]!==h||e[9]!==d||e[10]!==c||e[11]!==r||e[12]!==a||e[13]!==o){const E=a?.items??[];let O;e[25]!==a?.warnings?(O=a?.warnings??[],e[25]=a?.warnings,e[26]=O):O=e[26];const j=O;let $;e[27]!==j?($=j.some(Zr),e[27]=j,e[28]=$):$=e[28];const B=$,X=d!==null;I=yt,R=r,k=h,L=jt,S="sm:max-w-3xl max-h-[85vh] flex flex-col";let J;e[29]!==o?(J=o("registry.csvImportDialog.title"),e[29]=o,e[30]=J):J=e[30];let de;e[31]!==J?(de=t.jsx(vt,{children:J}),e[31]=J,e[32]=de):de=e[32];let se;e[33]!==o?(se=o("registry.csvImportDialog.description"),e[33]=o,e[34]=se):se=e[34];let ne;e[35]!==se?(ne=t.jsx(bt,{children:se}),e[35]=se,e[36]=ne):ne=e[36],e[37]!==de||e[38]!==ne?(D=t.jsxs(Nt,{children:[de,ne]}),e[37]=de,e[38]=ne,e[39]=D):D=e[39];let ge;e[40]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>g.current?.click(),e[40]=ge):ge=e[40];let ue;e[41]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(rs,{size:14}),e[41]=ue):ue=e[41];let ie;e[42]!==f||e[43]!==o?(ie=o(f?"registry.csvImportDialog.changeFile":"registry.csvImportDialog.chooseCsvFile"),e[42]=f,e[43]=o,e[44]=ie):ie=e[44];let C;e[45]!==c||e[46]!==ie?(C=t.jsxs(Y,{variant:"outline",size:"sm",className:"gap-1.5",onClick:ge,disabled:c,children:[ue,ie]}),e[45]=c,e[46]=ie,e[47]=C):C=e[47];let K;e[48]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx("input",{ref:g,type:"file",accept:".csv,text/csv",className:"hidden",onChange:je=>N(je.target.files?.[0]??null)}),e[48]=K):K=e[48];let H;e[49]!==f?(H=f&&t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:f}),e[49]=f,e[50]=H):H=e[50];let re;e[51]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx("div",{className:"flex-1"}),e[51]=re):re=e[51];let xe;e[52]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(nr,{size:14}),e[52]=xe):xe=e[52];let oe;e[53]!==o?(oe=o("registry.csvImportDialog.downloadTemplate"),e[53]=o,e[54]=oe):oe=e[54];let Ie;e[55]!==oe?(Ie=t.jsxs(Y,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:Yr,children:[xe,oe]}),e[55]=oe,e[56]=Ie):Ie=e[56];let Ne;e[57]!==C||e[58]!==H||e[59]!==Ie?(Ne=t.jsxs("div",{className:"flex items-center gap-3",children:[C,K,H,re,Ie]}),e[57]=C,e[58]=H,e[59]=Ie,e[60]=Ne):Ne=e[60];let z;e[61]!==o||e[62]!==j?(z=j.length>0&&t.jsx("div",{className:"rounded-lg border border-warning/20 bg-warning/10 p-3 grid gap-1",children:j.map((je,Oe)=>t.jsxs("p",{className:"text-xs text-warning flex items-start gap-1.5",children:[t.jsx(tt,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[je.line>0&&t.jsx("span",{className:"font-mono text-[10px] mr-1",children:o("registry.csvImportDialog.linePrefix",{line:je.line})}),je.message]})]},`${je.line}-${Oe}`))}),e[61]=o,e[62]=j,e[63]=z):z=e[63];const le=E.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:o("registry.csvImportDialog.preview")}),t.jsx(V,{variant:"secondary",children:o("registry.csvImportDialog.itemsCount",{count:E.length})}),a?.skipped?t.jsx(V,{variant:"outline",className:"text-warning",children:o("registry.csvImportDialog.skippedCount",{count:a.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(At,{children:[t.jsx(Ut,{children:t.jsxs(Je,{children:[t.jsx(pe,{className:"w-[140px]",children:o("registry.csvImportDialog.tableIdHeader")}),t.jsx(pe,{children:o("registry.csvImportDialog.tableTitleHeader")}),t.jsx(pe,{children:o("registry.csvImportDialog.tableUrlHeader")}),t.jsx(pe,{className:"w-[80px] text-center",children:o("registry.csvImportDialog.tablePublicHeader")}),t.jsx(pe,{children:o("registry.csvImportDialog.tableTagsHeader")})]})}),t.jsx(Ft,{children:E.map(je=>t.jsxs(Je,{children:[t.jsx(he,{className:"font-mono text-xs",children:je.id}),t.jsx(he,{className:"text-sm",children:je.title}),t.jsx(he,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:je.server.remotes?.[0]?.url??t.jsx("span",{className:"italic",children:o("registry.csvImportDialog.tableNoneValue")})}),t.jsx(he,{className:"text-center",children:je.is_public?t.jsx(V,{variant:"secondary",className:"text-[10px] bg-success/10 text-success",children:o("registry.csvImportDialog.tableYesValue")}):t.jsx("span",{className:"text-xs text-muted-foreground",children:o("registry.csvImportDialog.tableNoValue")})}),t.jsx(he,{className:"text-xs text-muted-foreground",children:(je._meta?.["mcp.mesh"]?.tags??[]).join(", ")||"-"})]},je.id))})]})})})]});let ke;e[64]!==d||e[65]!==o?(ke=d&&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(We,{size:16,className:"text-success"}),o("registry.csvImportDialog.importedCount",{count:d.created})]}),d.errors.length>0&&t.jsx("div",{className:"grid gap-1 mt-1",children:d.errors.map(Jr)})]}),e[64]=d,e[65]=o,e[66]=ke):ke=e[66];let Pe;e[67]!==X||e[68]!==a||e[69]!==o?(Pe=!a&&!X&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t.jsx(rs,{size:32,className:"text-muted-foreground/40 mb-3"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:o("registry.csvImportDialog.emptyStateHint")}),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[67]=X,e[68]=a,e[69]=o,e[70]=Pe):Pe=e[70],e[71]!==Ne||e[72]!==z||e[73]!==le||e[74]!==ke||e[75]!==Pe?(P=t.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[Ne,z,le,ke,Pe]}),e[71]=Ne,e[72]=z,e[73]=le,e[74]=ke,e[75]=Pe,e[76]=P):P=e[76],b=Ct,A="gap-2 sm:gap-0";let $e;e[77]!==h?($e=()=>h(!1),e[77]=h,e[78]=$e):$e=e[78];let Me;e[79]!==X||e[80]!==o?(Me=o(X?"registry.csvImportDialog.doneButton":"registry.csvImportDialog.cancelButton"),e[79]=X,e[80]=o,e[81]=Me):Me=e[81],e[82]!==$e||e[83]!==Me?(q=t.jsx(Y,{variant:"outline",onClick:$e,children:Me}),e[82]=$e,e[83]=Me,e[84]=q):q=e[84],v=!X&&t.jsx(Y,{onClick:_,disabled:c||E.length===0||B,children:c?o("registry.csvImportDialog.importingButton"):o("registry.csvImportDialog.importButton",{count:E.length})}),e[6]=f,e[7]=_,e[8]=h,e[9]=d,e[10]=c,e[11]=r,e[12]=a,e[13]=o,e[14]=b,e[15]=L,e[16]=I,e[17]=P,e[18]=R,e[19]=k,e[20]=A,e[21]=q,e[22]=v,e[23]=S,e[24]=D}else b=e[14],L=e[15],I=e[16],P=e[17],R=e[18],k=e[19],A=e[20],q=e[21],v=e[22],S=e[23],D=e[24];let F;e[85]!==b||e[86]!==A||e[87]!==q||e[88]!==v?(F=t.jsxs(b,{className:A,children:[q,v]}),e[85]=b,e[86]=A,e[87]=q,e[88]=v,e[89]=F):F=e[89];let T;e[90]!==L||e[91]!==P||e[92]!==F||e[93]!==S||e[94]!==D?(T=t.jsxs(L,{className:S,children:[D,P,F]}),e[90]=L,e[91]=P,e[92]=F,e[93]=S,e[94]=D,e[95]=T):T=e[95];let U;return e[96]!==I||e[97]!==R||e[98]!==k||e[99]!==T?(U=t.jsx(I,{open:R,onOpenChange:k,children:T}),e[96]=I,e[97]=R,e[98]=k,e[99]=T,e[100]=U):U=e[100],U}function Jr(s){return t.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[t.jsx(tt,{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 Zr(s){return s.message.startsWith("Missing required column:")}function Xr(s){const e=Z.c(34),{open:r,onOpenChange:i,title:n,isDeleting:l,onConfirm:c}=s,o=l===void 0?!1:l,a=ce();let u;e[0]!==a?(u=a("registry.deleteConfirmDialog.title"),e[0]=a,e[1]=u):u=e[1];let d;e[2]!==u?(d=t.jsx(st,{children:u}),e[2]=u,e[3]=d):d=e[3];let m;e[4]!==a||e[5]!==n?(m=a("registry.deleteConfirmDialog.description",{title:n}),e[4]=a,e[5]=n,e[6]=m):m=e[6];let f;e[7]!==m?(f=t.jsx(rt,{children:m}),e[7]=m,e[8]=f):f=e[8];let p;e[9]!==d||e[10]!==f?(p=t.jsxs(it,{children:[d,f]}),e[9]=d,e[10]=f,e[11]=p):p=e[11];let g;e[12]!==a?(g=a("registry.deleteConfirmDialog.cancel"),e[12]=a,e[13]=g):g=e[13];let x;e[14]!==o||e[15]!==g?(x=t.jsx(nt,{disabled:o,children:g}),e[14]=o,e[15]=g,e[16]=x):x=e[16];let h;e[17]!==o||e[18]!==a?(h=a(o?"registry.deleteConfirmDialog.deleting":"registry.deleteConfirmDialog.delete"),e[17]=o,e[18]=a,e[19]=h):h=e[19];let y;e[20]!==o||e[21]!==c||e[22]!==h?(y=t.jsx(at,{disabled:o,onClick:c,children:h}),e[20]=o,e[21]=c,e[22]=h,e[23]=y):y=e[23];let N;e[24]!==y||e[25]!==x?(N=t.jsxs(ot,{children:[x,y]}),e[24]=y,e[25]=x,e[26]=N):N=e[26];let w;e[27]!==N||e[28]!==p?(w=t.jsxs(lt,{children:[p,N]}),e[27]=N,e[28]=p,e[29]=w):w=e[29];let _;return e[30]!==i||e[31]!==r||e[32]!==w?(_=t.jsx(ct,{open:r,onOpenChange:i,children:w}),e[30]=i,e[31]=r,e[32]=w,e[33]=_):_=e[33],_}function ei(s){const[e]=s.id.split("/");return e??"provider"}function ti(s){return s._meta?.["mcp.mesh"]?.tags??[]}function si(s){return s._meta?.["mcp.mesh"]?.categories??[]}function ri(s){return s.server?.icons?.[0]?.src??null}function ii(s){const e=Z.c(107),{item:r,onEdit:i,onDelete:n,onToggleVerified:l,onToggleOfficial:c}=s,o=ce();let a;e[0]!==r?(a=ri(r),e[0]=r,e[1]=a):a=e[1];const u=a,d=r._meta?.["mcp.mesh"]?.verified===!0,m=r._meta?.["mcp.mesh"]?.official===!0;let f;e[2]!==r?(f=[...ti(r),...si(r)],e[2]=r,e[3]=f):f=e[3];const p=f;let g;e[4]!==p?(g=p.slice(0,3),e[4]=p,e[5]=g):g=e[5];const x=g,h=Math.max(0,p.length-x.length);let y;e[6]!==u||e[7]!==r.title?(y=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:u?t.jsx("img",{src:u,alt:r.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:r.title.charAt(0).toUpperCase()})}),e[6]=u,e[7]=r.title,e[8]=y):y=e[8];let N;e[9]!==r.title?(N=t.jsx("p",{className:"font-medium truncate",children:r.title}),e[9]=r.title,e[10]=N):N=e[10];let w;e[11]!==r?(w=ei(r),e[11]=r,e[12]=w):w=e[12];let _;e[13]!==w?(_=t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w}),e[13]=w,e[14]=_):_=e[14];let b;e[15]!==r.is_public||e[16]!==o?(b=r.is_public?t.jsxs(V,{variant:"default",className:"gap-1",children:[t.jsx(xs,{size:10}),o("registry.registryItemCard.public")]}):t.jsx(V,{variant:"secondary",children:o("registry.registryItemCard.private")}),e[15]=r.is_public,e[16]=o,e[17]=b):b=e[17];let L;e[18]!==m||e[19]!==o?(L=m&&t.jsxs(V,{variant:"outline",className:"gap-1 text-primary",children:[t.jsx(Xt,{size:10}),o("registry.registryItemCard.official")]}),e[18]=m,e[19]=o,e[20]=L):L=e[20];let I;e[21]!==m||e[22]!==d||e[23]!==o?(I=!m&&d&&t.jsxs(V,{variant:"outline",className:"gap-1 text-success",children:[t.jsx(Xt,{size:10}),o("registry.registryItemCard.verified")]}),e[21]=m,e[22]=d,e[23]=o,e[24]=I):I=e[24];let P;e[25]!==I||e[26]!==_||e[27]!==b||e[28]!==L?(P=t.jsxs("div",{className:"flex items-center gap-2",children:[_,b,L,I]}),e[25]=I,e[26]=_,e[27]=b,e[28]=L,e[29]=P):P=e[29];let R;e[30]!==P||e[31]!==N?(R=t.jsxs("div",{className:"min-w-0 flex-1",children:[N,P]}),e[30]=P,e[31]=N,e[32]=R):R=e[32];let k;e[33]!==R||e[34]!==y?(k=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[y,R]}),e[33]=R,e[34]=y,e[35]=k):k=e[35];let A;e[36]!==r.title||e[37]!==o?(A=o("registry.registryItemCard.actionsFor",{title:r.title}),e[36]=r.title,e[37]=o,e[38]=A):A=e[38];let q;e[39]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx($t,{size:18}),e[39]=q):q=e[39];let v;e[40]!==A?(v=t.jsx(pt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":A,children:q})}),e[40]=A,e[41]=v):v=e[41];let S;e[42]!==r||e[43]!==i?(S=()=>i(r),e[42]=r,e[43]=i,e[44]=S):S=e[44];let D;e[45]!==o?(D=o("registry.registryItemCard.edit"),e[45]=o,e[46]=D):D=e[46];let F;e[47]!==S||e[48]!==D?(F=t.jsx(Re,{onClick:S,children:D}),e[47]=S,e[48]=D,e[49]=F):F=e[49];let T;e[50]!==r||e[51]!==l?(T=()=>l(r),e[50]=r,e[51]=l,e[52]=T):T=e[52];let U;e[53]!==d||e[54]!==o?(U=o(d?"registry.registryItemCard.unmarkAsVerified":"registry.registryItemCard.markAsVerified"),e[53]=d,e[54]=o,e[55]=U):U=e[55];let E;e[56]!==T||e[57]!==U?(E=t.jsx(Re,{onClick:T,children:U}),e[56]=T,e[57]=U,e[58]=E):E=e[58];let O;e[59]!==r||e[60]!==c?(O=()=>c(r),e[59]=r,e[60]=c,e[61]=O):O=e[61];let j;e[62]!==m||e[63]!==o?(j=o(m?"registry.registryItemCard.unmarkAsOfficial":"registry.registryItemCard.markAsOfficial"),e[62]=m,e[63]=o,e[64]=j):j=e[64];let $;e[65]!==O||e[66]!==j?($=t.jsx(Re,{onClick:O,children:j}),e[65]=O,e[66]=j,e[67]=$):$=e[67];let B;e[68]!==r||e[69]!==n?(B=()=>n(r),e[68]=r,e[69]=n,e[70]=B):B=e[70];let X;e[71]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(dt,{size:14}),e[71]=X):X=e[71];let J;e[72]!==o?(J=o("registry.registryItemCard.delete"),e[72]=o,e[73]=J):J=e[73];let de;e[74]!==B||e[75]!==J?(de=t.jsxs(Re,{variant:"destructive",onClick:B,children:[X,J]}),e[74]=B,e[75]=J,e[76]=de):de=e[76];let se;e[77]!==F||e[78]!==E||e[79]!==$||e[80]!==de?(se=t.jsxs(ht,{align:"end",children:[F,E,$,de]}),e[77]=F,e[78]=E,e[79]=$,e[80]=de,e[81]=se):se=e[81];let ne;e[82]!==v||e[83]!==se?(ne=t.jsxs(ft,{children:[v,se]}),e[82]=v,e[83]=se,e[84]=ne):ne=e[84];let ge;e[85]!==k||e[86]!==ne?(ge=t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[k,ne]}),e[85]=k,e[86]=ne,e[87]=ge):ge=e[87];let ue;e[88]!==r._meta||e[89]!==r.description||e[90]!==r.server||e[91]!==o?(ue=r._meta?.["mcp.mesh"]?.short_description||r.description||r.server.description||o("registry.registryItemCard.noDescriptionProvided"),e[88]=r._meta,e[89]=r.description,e[90]=r.server,e[91]=o,e[92]=ue):ue=e[92];let ie;e[93]!==ue?(ie=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:ue}),e[93]=ue,e[94]=ie):ie=e[94];let C;e[95]!==r.id||e[96]!==x?(C=x.map(xe=>t.jsx(V,{variant:"secondary",children:xe},`${r.id}-badge-${xe}`)),e[95]=r.id,e[96]=x,e[97]=C):C=e[97];let K;e[98]!==h?(K=h>0&&t.jsxs(V,{variant:"outline",children:["+",h]}),e[98]=h,e[99]=K):K=e[99];let H;e[100]!==C||e[101]!==K?(H=t.jsxs("div",{className:"flex flex-wrap gap-1",children:[C,K]}),e[100]=C,e[101]=K,e[102]=H):H=e[102];let re;return e[103]!==ge||e[104]!==ie||e[105]!==H?(re=t.jsxs(me,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[ge,ie,H]}),e[103]=ge,e[104]=ie,e[105]=H,e[106]=re):re=e[106],re}function bs(s){const e=Z.c(33),{value:r,onChange:i,onBlur:n,onFileUpload:l,error:c,isUploading:o}=s,a=o===void 0?!1:o,u=ce(),[d,m]=M.useState(!1),[f,p]=M.useState(!1),g=M.useRef(null);let x;e[0]!==a?(x=S=>{S.preventDefault(),a||m(!0)},e[0]=a,e[1]=x):x=e[1];const h=x;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=S=>{S.preventDefault(),m(!1)},e[2]=y):y=e[2];const N=y;let w;e[3]!==a||e[4]!==l?(w=async S=>{if(S.preventDefault(),m(!1),a)return;const D=S.dataTransfer.files[0];D&&await l(D)},e[3]=a,e[4]=l,e[5]=w):w=e[5];const _=w;let b;e[6]!==a||e[7]!==l?(b=async S=>{const D=S.target.files?.[0];D&&!a&&await l(D),S.target.value=""},e[6]=a,e[7]=l,e[8]=b):b=e[8];const L=b,I=r.length>0;let P;e[9]!==u?(P=u("registry.imageUpload.image"),e[9]=u,e[10]=P):P=e[10];let R;e[11]!==P?(R=t.jsx(ae,{children:P}),e[11]=P,e[12]=R):R=e[12];let k;e[13]!==h||e[14]!==_||e[15]!==I||e[16]!==d||e[17]!==a||e[18]!==n||e[19]!==i||e[20]!==f||e[21]!==u||e[22]!==r?(k=I?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:r,alt:u("registry.imageUpload.previewAlt"),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:r}),t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsxs(Y,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>g.current?.click(),disabled:a,children:[t.jsx(Lt,{className:"size-3"}),u("registry.imageUpload.change")]}),t.jsxs(Y,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{i(""),p(!1)},disabled:a,children:[t.jsx(dt,{className:"size-3"}),u("registry.imageUpload.remove")]})]})]})]})}):a?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(Ye,{className:"size-8 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:u("registry.imageUpload.uploadingImage")})]}):t.jsxs("div",{className:te("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:h,onDragLeave:N,onDrop:_,onClick:()=>g.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:te("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(Ws,{size:20})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:u(d?"registry.imageUpload.dropImageHere":"registry.imageUpload.clickOrDragToUpload")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:u("registry.imageUpload.supportedFormats")})]})]}),f?t.jsx("div",{className:"border-t border-border px-3 py-2",onClick:ni,children:t.jsx(ye,{placeholder:u("registry.imageUpload.urlPlaceholder"),value:r,className:"text-xs h-8",onChange:S=>i(S.target.value),onBlur:n})}):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:S=>{S.stopPropagation(),p(!0)},children:[t.jsx(gr,{className:"size-3"}),u("registry.imageUpload.orPasteImageUrl")]})})]}),e[13]=h,e[14]=_,e[15]=I,e[16]=d,e[17]=a,e[18]=n,e[19]=i,e[20]=f,e[21]=u,e[22]=r,e[23]=k):k=e[23];let A;e[24]!==L?(A=t.jsx("input",{ref:g,type:"file",accept:"image/*",className:"hidden",onChange:L}),e[24]=L,e[25]=A):A=e[25];let q;e[26]!==c?(q=c&&t.jsx("p",{className:"text-xs text-destructive",children:c}),e[26]=c,e[27]=q):q=e[27];let v;return e[28]!==q||e[29]!==R||e[30]!==k||e[31]!==A?(v=t.jsxs("div",{className:"grid gap-1.5",children:[R,k,A,q]}),e[28]=q,e[29]=R,e[30]=k,e[31]=A,e[32]=v):v=e[32],v}function ni(s){return s.stopPropagation()}function Ns(){const[s,e]=M.useState("idle"),[r,i]=M.useState(null),n=Te();return{discover:async(o,a)=>{if(!o)return null;e("loading"),i(null);try{const u=await n.call("REGISTRY_DISCOVER_TOOLS",{url:o,type:a==="sse"?"sse":"http"});return u.error?ai(u.error)?(i(u.error),e("auth_required"),null):(i(u.error),e("error"),null):!u.tools||u.tools.length===0?(i("No tools found on this MCP server."),e("error"),null):(e("success"),u.tools)}catch(u){const d=u instanceof Error?u.message:String(u);return i(d||"Could not discover tools."),e("error"),null}},discoverStatus:s,discoverError:r,resetDiscover:()=>{e("idle"),i(null)}}}function ai(s){const e=s.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function oi(s){const e=Z.c(62),{tools:r,onChange:i,remoteUrl:n,remoteType:l,externalDiscoverStatus:c,externalDiscoverError:o}=s,a=ce(),[u,d]=M.useState(r.length>0),{discover:m,discoverStatus:f,discoverError:p,resetDiscover:g}=Ns(),x=c??f,h=o??p;let y;e[0]!==m||e[1]!==i||e[2]!==l||e[3]!==n?(y=async()=>{if(!n)return;const j=await m(n,l??"http");j&&(i(j),d(!0))},e[0]=m,e[1]=i,e[2]=l,e[3]=n,e[4]=y):y=e[4];const N=y;let w;e[5]!==i||e[6]!==g?(w=()=>{i([]),g()},e[5]=i,e[6]=g,e[7]=w):w=e[7];const _=w;let b;e[8]!==u?(b=()=>d(!u),e[8]=u,e[9]=b):b=e[9];let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(ms,{size:14,className:"text-muted-foreground"}),e[10]=L):L=e[10];let I;e[11]!==a?(I=a("registry.toolsEditor.tools"),e[11]=a,e[12]=I):I=e[12];let P;e[13]!==I?(P=t.jsx("span",{children:I}),e[13]=I,e[14]=P):P=e[14];let R;e[15]!==r.length?(R=r.length>0&&t.jsx(V,{variant:"secondary",className:"text-xs px-1.5 py-0",children:r.length}),e[15]=r.length,e[16]=R):R=e[16];let k;e[17]!==u?(k=u?t.jsx(hr,{size:14,className:"text-muted-foreground"}):t.jsx(pr,{size:14,className:"text-muted-foreground"}),e[17]=u,e[18]=k):k=e[18];let A;e[19]!==b||e[20]!==P||e[21]!==R||e[22]!==k?(A=t.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:b,children:[L,P,R,k]}),e[19]=b,e[20]=P,e[21]=R,e[22]=k,e[23]=A):A=e[23];let q;e[24]!==_||e[25]!==a||e[26]!==r.length?(q=r.length>0&&t.jsxs(Y,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:_,children:[t.jsx(dt,{size:12}),a("registry.toolsEditor.clear")]}),e[24]=_,e[25]=a,e[26]=r.length,e[27]=q):q=e[27];let v;e[28]!==x||e[29]!==N||e[30]!==n||e[31]!==a||e[32]!==r.length?(v=n&&t.jsxs(Y,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 border-success/30 text-success shadow-[0_0_8px_color-mix(in_oklch,var(--success)_30%,transparent)] hover:shadow-[0_0_14px_color-mix(in_oklch,var(--success)_50%,transparent)] hover:border-success/50 transition-all",onClick:N,disabled:x==="loading",children:[x==="loading"?t.jsx(Ye,{size:12,className:"animate-spin"}):t.jsx(Lt,{size:12}),x==="loading"?a("registry.toolsEditor.discovering"):r.length>0?a("registry.toolsEditor.refresh"):a("registry.toolsEditor.autoDiscover")]}),e[28]=x,e[29]=N,e[30]=n,e[31]=a,e[32]=r.length,e[33]=v):v=e[33];let S;e[34]!==q||e[35]!==v?(S=t.jsxs("div",{className:"flex items-center gap-2",children:[q,v]}),e[34]=q,e[35]=v,e[36]=S):S=e[36];let D;e[37]!==S||e[38]!==A?(D=t.jsxs("div",{className:"flex items-center justify-between",children:[A,S]}),e[37]=S,e[38]=A,e[39]=D):D=e[39];let F;e[40]!==x||e[41]!==a||e[42]!==r.length?(F=x==="success"&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-success bg-success/10 rounded-lg px-3 py-2",children:[t.jsx(We,{size:14,className:"shrink-0"}),t.jsx("span",{children:a("registry.toolsEditor.discoveredSuccess",{count:r.length})})]}),e[40]=x,e[41]=a,e[42]=r.length,e[43]=F):F=e[43];let T;e[44]!==h||e[45]!==x?(T=x==="error"&&h&&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(tt,{size:14,className:"shrink-0"}),t.jsx("span",{children:h})]}),e[44]=h,e[45]=x,e[46]=T):T=e[46];let U;e[47]!==u||e[48]!==r?(U=u&&r.length>0&&t.jsx("div",{className:"rounded-xl border border-border divide-y divide-border overflow-hidden max-h-48 overflow-y-auto",children:r.map(li)}),e[47]=u,e[48]=r,e[49]=U):U=e[49];let E;e[50]!==x||e[51]!==u||e[52]!==n||e[53]!==a||e[54]!==r.length?(E=u&&r.length===0&&x==="idle"&&t.jsx("p",{className:"text-xs text-muted-foreground px-1",children:a(n?"registry.toolsEditor.emptyHintWithUrl":"registry.toolsEditor.emptyHintWithoutUrl")}),e[50]=x,e[51]=u,e[52]=n,e[53]=a,e[54]=r.length,e[55]=E):E=e[55];let O;return e[56]!==D||e[57]!==F||e[58]!==T||e[59]!==U||e[60]!==E?(O=t.jsxs("div",{className:"space-y-3",children:[D,F,T,U,E]}),e[56]=D,e[57]=F,e[58]=T,e[59]=U,e[60]=E,e[61]=O):O=e[61],O}function li(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 Cs(s){const{org:e}=be(),[r,i]=M.useState(!1),l=typeof window<"u"&&window.location.hostname==="localhost"?`${e.id}_dev-assets`:null,c=Fe({connectionId:l??"noop",orgId:e.id,orgSlug:e.slug});return{uploadImage:async(a,u)=>{if(!l)return G.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!a.type.startsWith("image/"))return G.error("Only image files are supported"),null;if(a.size>5*1024*1024)return G.error("Image size must be less than 5MB"),null;i(!0);try{const d=await c.callTool({name:"PUT_PRESIGNED_URL",arguments:{key:u,contentType:a.type}}),m=d.structuredContent?.url||d.url;if(!m)throw new Error("Failed to get presigned URL");const f=await fetch(m,{method:"PUT",body:a,headers:{"Content-Type":a.type}});if(!f.ok)throw new Error(`Upload failed: ${f.statusText}`);const p=await c.callTool({name:"GET_PRESIGNED_URL",arguments:{key:u,expiresIn:31536e3}}),g=p.structuredContent?.url||p.url;if(!g)throw new Error("Failed to get public URL");return g}catch(d){return console.error("Image upload failed:",d),G.error(d instanceof Error?d.message:"Failed to upload image. Please try again."),null}finally{i(!1)}},isUploading:r}}const ci=new Set(["http","sse","stdio"]),di=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,ui=["internal","automation","support","sales","ops","ai"],mi=["productivity","communication","customer-support","development","data","operations"],gi=["registry.registryItemDialog.essentials","registry.registryItemDialog.details","registry.registryItemDialog.advanced"],xi="h-7 text-xs border-success/30 text-success shadow-[0_0_8px_color-mix(in_oklch,var(--success)_30%,transparent)] hover:shadow-[0_0_14px_color-mix(in_oklch,var(--success)_50%,transparent)] hover:border-success/50 transition-all";function ls(s){return s.replace(/^https?:\/\//i,"").trim()}function et(s){const e=s.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function Qe(s){return s.trim().toLowerCase()}function _t(s){return Array.from(new Set(s.map(Qe).filter(e=>e.length>0)))}function Ke(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function pi(s){const e=Z.c(5),{current:r}=s,i=ce();let n;e[0]!==r||e[1]!==i?(n=gi.map((c,o)=>{const a=o+1,u=a===r,d=a<r;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[o>0&&t.jsx("div",{className:te("w-4 h-px",d?"bg-primary":"bg-border")}),t.jsxs("div",{className:te("flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs transition-colors",u?"bg-primary/10 text-primary font-medium":d?"text-primary":"text-muted-foreground"),children:[t.jsx("span",{className:te("size-5 rounded-full inline-flex items-center justify-center text-[10px] font-semibold shrink-0",u?"bg-primary text-primary-foreground":d?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:a}),t.jsx("span",{className:"hidden sm:inline",children:i(c)})]})]},c)}),e[0]=r,e[1]=i,e[2]=n):n=e[2];let l;return e[3]!==n?(l=t.jsx("div",{className:"flex items-center gap-1.5",children:n}),e[3]=n,e[4]=l):l=e[4],l}function hi(s){const e=Z.c(32),{id:r,labelKey:i,values:n,availableOptions:l,placeholderKey:c,onChange:o}=s,a=ce(),[u,d]=M.useState(""),[m,f]=M.useState(!1);let p,g,x,h,y;if(e[0]!==l||e[1]!==r||e[2]!==u||e[3]!==m||e[4]!==i||e[5]!==o||e[6]!==c||e[7]!==a||e[8]!==n){const _=_t(l),b=_t(n),L=new Set(b),I=Qe(u),P=_.filter(T=>!L.has(T)).filter(T=>I?T.includes(I):!0).slice(0,8),R=T=>{const U=Qe(T);!U||L.has(U)||o([...b,U])},k=T=>{o(b.filter(U=>U!==T))},A=()=>{const T=u.split(/[,\n;]/).map(Qe).filter(Boolean);if(T.length===0)return;const U=[...b];for(const E of T)U.includes(E)||U.push(E);o(U),d("")},q=I;h="grid gap-2";let v;e[14]!==i||e[15]!==a?(v=a(i),e[14]=i,e[15]=a,e[16]=v):v=e[16],e[17]!==r||e[18]!==v?(y=t.jsx(ae,{htmlFor:r,children:v}),e[17]=r,e[18]=v,e[19]=y):y=e[19],p="relative";let S;e[20]!==r?(S=()=>{const T=document.getElementById(r);T instanceof HTMLInputElement&&T.focus()},e[20]=r,e[21]=S):S=e[21];let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=()=>f(!0),e[22]=D):D=e[22];let F;e[23]===Symbol.for("react.memo_cache_sentinel")?(F=T=>d(T.target.value),e[23]=F):F=e[23],g=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:S,children:t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[b.map(T=>t.jsxs(V,{variant:"secondary",className:"gap-1",children:[T,t.jsx("button",{type:"button",onClick:U=>{U.preventDefault(),U.stopPropagation(),k(T)},children:t.jsx(mr,{size:12})})]},`${r}-${T}`)),t.jsx("input",{id:r,className:"flex-1 min-w-[120px] bg-transparent outline-none border-none text-sm",placeholder:b.length?"":a(c),value:u,onFocus:D,onBlur:()=>{f(!1),A()},onChange:F,onKeyDown:T=>{if(T.key==="Enter"||T.key===","){T.preventDefault(),A();return}T.key==="Backspace"&&!u&&b.length&&k(b[b.length-1]??"")}})]})}),x=m&&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:P.length>0?P.map(T=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:yi,onClick:()=>{R(T),d("")},children:T},`${r}-suggestion-${T}`)):q?t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:fi,onClick:()=>{R(q),d("")},children:a("registry.registryItemDialog.createTag",{value:q})}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:a("registry.registryItemDialog.typeToSearchOrCreate")})}),e[0]=l,e[1]=r,e[2]=u,e[3]=m,e[4]=i,e[5]=o,e[6]=c,e[7]=a,e[8]=n,e[9]=p,e[10]=g,e[11]=x,e[12]=h,e[13]=y}else p=e[9],g=e[10],x=e[11],h=e[12],y=e[13];let N;e[24]!==p||e[25]!==g||e[26]!==x?(N=t.jsxs("div",{className:p,children:[g,x]}),e[24]=p,e[25]=g,e[26]=x,e[27]=N):N=e[27];let w;return e[28]!==h||e[29]!==y||e[30]!==N?(w=t.jsxs("div",{className:h,children:[y,N]}),e[28]=h,e[29]=y,e[30]=N,e[31]=w):w=e[31],w}function fi(s){return s.preventDefault()}function yi(s){return s.preventDefault()}function ji({id:s,value:e,availableOptions:r,onChange:i}){const n=ce(),[l,c]=M.useState(e),[o,a]=M.useState(!1),u=M.useRef(e);u.current!==e&&(u.current=e,c(e));const d=_t([...mi,...r,e]).filter(Boolean),m=Qe(l),f=d.filter(g=>m?g.includes(m):!0).slice(0,8),p=g=>{const x=Qe(g);i(x),c(x),a(!1)};return t.jsxs("div",{className:"grid gap-2",children:[t.jsx(ae,{htmlFor:s,children:n("registry.registryItemDialog.category")}),t.jsxs("div",{className:"relative",children:[t.jsx(ye,{id:s,className:"h-9 text-sm",placeholder:n("registry.registryItemDialog.selectOrCreateCategory"),value:l,onFocus:()=>{c(e),a(!0)},onBlur:()=>{p(l)},onChange:g=>c(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),p(l))}}),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:g=>g.preventDefault(),onClick:()=>{i(""),c("")},children:n("registry.registryItemDialog.clear")}),o&&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:f.length>0?f.map(g=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:x=>x.preventDefault(),onClick:()=>p(g),children:g},`${s}-${g}`)):m?t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:g=>g.preventDefault(),onClick:()=>p(m),children:n("registry.registryItemDialog.createCategory",{value:m})}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:n("registry.registryItemDialog.typeToSearchOrCreate")})})]})]})}function vi({open:s,onOpenChange:e,item:r,draft:i,availableTags:n=[],availableCategories:l=[],isSubmitting:c=!1,onSubmit:o}){const a=ce(),{org:u}=be(),{uploadImage:d,isUploading:m}=Cs(),{discover:f,discoverStatus:p,discoverError:g,resetDiscover:x}=Ns(),h=!!r,y=i?._meta?.["mcp.mesh"],N=r?.title??i?.title??"",w=r?.id?.split("/")[0]??i?.id?.split("/")[0]??"",_=r?.description??i?.description??"",b=r?._meta?.["mcp.mesh"]?.short_description??y?.short_description??"",L=r?._meta?.["mcp.mesh"]?.owner??y?.owner??"",I=r?.server?.repository?.url??i?.server?.repository?.url??"",P=r?._meta?.["mcp.mesh"]?.readme??y?.readme??"",R=r?._meta?.["mcp.mesh"]?.readme_url??y?.readme_url??"",k=ls(r?.server?.remotes?.[0]?.url??i?.server?.remotes?.[0]?.url??""),A=r?.server?.remotes?.[0]?.type??i?.server?.remotes?.[0]?.type??"http",q=r?._meta?.["mcp.mesh"]?.tags??y?.tags??[],v=r?._meta?.["mcp.mesh"]?.categories?.[0]??y?.categories?.[0]??"",S=r?.server?.icons?.[0]?.src??i?.server?.icons?.[0]?.src??"",D=r?._meta?.["mcp.mesh"]?.tools??y?.tools??[],F=r?.is_public??i?.is_public??!1,T=r?._meta?.["mcp.mesh"]?.verified??y?.verified??!1,U=r?._meta?.["mcp.mesh"]?.official??y?.official??!1,[E,O]=M.useState(1),[j,$]=M.useState(N),[B,X]=M.useState(w),[J,de]=M.useState(_),[se,ne]=M.useState(b),[ge,ue]=M.useState(L),[ie,C]=M.useState(I),[K,H]=M.useState(P),[re,xe]=M.useState(R),[oe,Ie]=M.useState(P?"content":"link"),[Ne,z]=M.useState(k),[le,ke]=M.useState(A),[Pe,$e]=M.useState(q),[Me,je]=M.useState(v),[Oe,Rt]=M.useState(S),[Se,mt]=M.useState(D),[Bt,Kt]=M.useState(F),[Ht,Vt]=M.useState(T),[Gt,Qt]=M.useState(U),[fe,Ze]=M.useState({}),Yt=()=>{O(1),$(N),X(w),de(_),ne(b),ue(L),C(I),H(P),xe(R),Ie(P?"content":"link"),z(k),ke(A),$e(q),je(v),Rt(S),mt(D),Kt(F),Vt(T),Qt(U),Ze({}),x(),gt.current="",Ce.current&&(clearTimeout(Ce.current),Ce.current=null)},Is=async Q=>{if(!Q)return;const ee=h?r?.id:`${B}/${j}`.toLowerCase(),we=Ke(ee||"temp"),qe=Q.name.split(".").pop()||"png",Ee=`registry/${u.id}/${we}/icon.${qe}`,Be=await d(Q,Ee);Be?(Rt(Be),Ze(Le=>({...Le,imageUrl:void 0}))):Ze(Le=>({...Le,imageUrl:a("registry.registryItemDialog.failedToUploadImage")}))},Ce=M.useRef(null),gt=M.useRef(""),It=M.useRef(le);It.current=le;const Wt=Q=>{!Q&&Ce.current&&(clearTimeout(Ce.current),Ce.current=null),e(Q),Q||Yt()},ks=async()=>{const Q=et(Ne);if(!Q)return;Ce.current&&(clearTimeout(Ce.current),Ce.current=null),gt.current=Q;const ee=await f(Q,It.current);ee&&mt(ee)},Ss=Q=>{Ce.current&&clearTimeout(Ce.current);const ee=et(Q);!ee||ee===gt.current||Q.includes(".")&&(Ce.current=setTimeout(async()=>{gt.current=ee;const we=await f(ee,It.current);we&&mt(we)},800))},Jt=Q=>{const ee={};if(Q===1){const we=Ke(B),qe=Ke(j),Ee=`${we}/${qe}`;j.trim()||(ee.title=a("registry.registryItemDialog.nameIsRequired")),h||(we?qe?di.test(Ee)||(ee.provider=a("registry.registryItemDialog.useValidIdFormat")):ee.title=a("registry.registryItemDialog.nameMustContainValidCharacters"):ee.provider=a("registry.registryItemDialog.providerIsRequired"));const Be=et(Ne),Le=le.trim().toLowerCase();if(Le!=="stdio"&&Be)try{const Xe=new URL(Be);["http:","https:"].includes(Xe.protocol)||(ee.remoteUrl=a("registry.registryItemDialog.remoteUrlMustBeHttps"))}catch{ee.remoteUrl=a("registry.registryItemDialog.remoteUrlIsInvalid")}if(Le&&!ci.has(Le)&&(ee.remoteType=a("registry.registryItemDialog.remoteTypeMustBe")),Oe.trim()&&!Oe.trim().startsWith("data:image/"))try{const kt=new URL(Oe.trim());["http:","https:"].includes(kt.protocol)||(ee.imageUrl=a("registry.registryItemDialog.imageUrlMustBeHttps"))}catch{ee.imageUrl=a("registry.registryItemDialog.imageUrlIsInvalid")}}if(Q===2&&(J.length>1500&&(ee.description=a("registry.registryItemDialog.descriptionMaxLength")),se.trim().length>160&&(ee.shortDescription=a("registry.registryItemDialog.shortDescriptionMaxLength"))),Q===3){const we=re.trim();if(we)try{const Ee=new URL(we);["http:","https:"].includes(Ee.protocol)||(ee.readmeUrl=a("registry.registryItemDialog.readmeUrlMustBeHttps"))}catch{ee.readmeUrl=a("registry.registryItemDialog.readmeUrlIsInvalid")}K.trim().length>5e4&&(ee.readme=a("registry.registryItemDialog.readmeMaxLength"));const qe=ie.trim();if(qe)try{const Ee=new URL(qe);["http:","https:"].includes(Ee.protocol)||(ee.repositoryUrl=a("registry.registryItemDialog.repositoryUrlMustBeHttps"))}catch{ee.repositoryUrl=a("registry.registryItemDialog.repositoryUrlIsInvalid")}}return Ze(ee),Object.values(ee).every(we=>we===void 0)},Ds=()=>{Jt(E)&&(E===1&&Ce.current&&(clearTimeout(Ce.current),Ce.current=null),E<3&&O(E+1))},Ts=()=>{E>1&&O(E-1)},Ms=async()=>{if(!Jt(3))return;const Q=j.trim(),ee=Ke(B),we=Ke(Q),qe=`${ee}/${we}`,Ee=et(Ne),Be=le.trim().toLowerCase(),Le=Oe.trim(),Xe=ie.trim(),kt=se.trim(),As=K.trim(),Us=re.trim(),Fs=_t(Pe),$s=Me?[Qe(Me)]:[],zs=r?r.server?.name??r.id:"",Os=(h?zs:qe).trim(),St=J.trim(),Bs=ge.trim(),Zt={title:Q,description:St.length>0?St:null,is_public:Bt,_meta:{"mcp.mesh":{verified:Ht,official:Gt,tags:Fs,categories:$s,short_description:kt||null,owner:Bs||null,readme:As||null,readme_url:Us||null,...Se.length>0?{tools:Se}:{}}},server:{name:Os,title:Q,description:St||void 0,icons:Le?[{src:Le}]:[],repository:Xe?{url:Xe}:void 0,remotes:Ee?[{type:Be||"http",url:Ee}]:[]}};if(h&&r){await o({id:r.id,data:Zt}),e(!1);return}await o({id:qe,...Zt}),e(!1),Yt()},qs=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(ae,{htmlFor:"registry-item-provider",children:a("registry.registryItemDialog.provider")}),t.jsx(ye,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:B,onChange:Q=>X(Q.target.value),disabled:h}),!h&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("registry.registryItemDialog.itemId")," ",t.jsx("span",{className:"font-mono",children:`${Ke(B)||"provider"}/${Ke(j)||"name"}`})]}),fe.provider&&t.jsx("p",{className:"text-xs text-destructive",children:fe.provider})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"registry-item-title",children:a("registry.registryItemDialog.name")}),t.jsx(ye,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:j,onChange:Q=>$(Q.target.value)}),fe.title&&t.jsx("p",{className:"text-xs text-destructive",children:fe.title})]})]}),t.jsx("div",{className:"row-span-2 content-start",children:t.jsx(bs,{value:Oe,onChange:Q=>{Rt(Q),Ze(ee=>({...ee,imageUrl:void 0}))},onFileUpload:Is,error:fe.imageUrl,isUploading:m})}),t.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[t.jsx(ae,{htmlFor:"registry-remote-url",children:a("registry.registryItemDialog.remoteUrl")}),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 ee=ls(Q.target.value);z(ee),Ss(ee)}})]}),t.jsxs(or,{value:le,onValueChange:ke,children:[t.jsx(lr,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:t.jsx(cr,{placeholder:a("registry.registryItemDialog.type")})}),t.jsxs(dr,{children:[t.jsx(Dt,{value:"http",children:"http"}),t.jsx(Dt,{value:"sse",children:"sse"}),t.jsx(Dt,{value:"stdio",children:"stdio"})]})]})]}),fe.remoteUrl&&t.jsx("p",{className:"text-xs text-destructive",children:fe.remoteUrl}),fe.remoteType&&t.jsx("p",{className:"text-xs text-destructive",children:fe.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(Y,{type:"button",variant:"outline",size:"sm",className:te(xi,"gap-1.5"),onClick:ks,disabled:p==="loading",children:[p==="loading"?t.jsx(Ye,{size:12,className:"animate-spin"}):t.jsx(Lt,{size:12}),p==="loading"?a("registry.registryItemDialog.discoveringTools"):Se.length>0?a("registry.registryItemDialog.rediscoverTools"):a("registry.registryItemDialog.discoverToolsFromUrl")]}),Se.length>0&&p!=="loading"&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a("registry.registryItemDialog.toolsLoaded",{count:Se.length.toString()})})]}),p==="success"&&Se.length>0&&t.jsxs("div",{className:"rounded-lg border border-success/20 bg-success/10 px-3 py-2 space-y-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs text-success",children:[t.jsx(We,{size:14,className:"shrink-0"}),t.jsx("span",{className:"font-medium",children:a("registry.registryItemDialog.toolsDiscovered",{count:Se.length.toString()})})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[Se.slice(0,8).map(Q=>t.jsx(V,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:Q.name},Q.name)),Se.length>8&&t.jsx("span",{className:"text-[10px] text-muted-foreground self-center",children:a("registry.registryItemDialog.andMore",{count:(Se.length-8).toString()})})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:a("registry.registryItemDialog.toolsWillEnrich")})]}),p==="auth_required"&&g&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-warning bg-warning/10 border border-warning/20 rounded-lg px-3 py-2",children:[t.jsx(tt,{size:14,className:"shrink-0"}),t.jsx("span",{children:a("registry.registryItemDialog.authRequiredMessage")})]}),p==="error"&&g&&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(tt,{size:14,className:"shrink-0"}),t.jsx("span",{children:g})]})]})]}),Es=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(ae,{htmlFor:"registry-item-short-description",children:a("registry.registryItemDialog.shortDescription")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[se.length,"/160"]})]}),t.jsx(ye,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:a("registry.registryItemDialog.shortSummaryForStoreCard"),value:se,maxLength:160,onChange:Q=>ne(Q.target.value)}),fe.shortDescription&&t.jsx("p",{className:"text-xs text-destructive",children:fe.shortDescription})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(ae,{htmlFor:"registry-item-description",children:a("registry.registryItemDialog.description")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[J.length,"/1500"]})]}),t.jsx(wt,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:a("registry.registryItemDialog.briefDescription"),rows:2,value:J,onChange:Q=>de(Q.target.value)}),fe.description&&t.jsx("p",{className:"text-xs text-destructive",children:fe.description})]}),t.jsx("div",{className:"border-t border-border"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(ji,{id:"registry-category",value:Me,availableOptions:l,onChange:je})}),t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(hi,{id:"registry-tags",labelKey:"registry.registryItemDialog.tags",values:Pe,availableOptions:[...ui,...n],placeholderKey:"registry.registryItemDialog.typeAndPressEnter",onChange:$e})})]}),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(ae,{htmlFor:"registry-is-public",className:"text-sm",children:a("registry.registryItemDialog.public")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("registry.registryItemDialog.makeThisMcpVisible")})]}),t.jsx(Ge,{id:"registry-is-public",checked:Bt,onCheckedChange:Kt})]}),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(ae,{htmlFor:"registry-is-verified",className:"text-sm",children:a("registry.registryItemDialog.verified")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("registry.registryItemDialog.curatedAndApproved")})]}),t.jsx(Ge,{id:"registry-is-verified",checked:Ht,onCheckedChange:Vt})]}),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(ae,{htmlFor:"registry-is-official",className:"text-sm",children:a("registry.registryItemDialog.official")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:a("registry.registryItemDialog.madeAndHostedByServiceProvider")})]}),t.jsx(Ge,{id:"registry-is-official",checked:Gt,onCheckedChange:Qt})]})]}),Ls=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(ae,{htmlFor:"registry-item-owner",children:a("registry.registryItemDialog.ownerOptional")}),t.jsx(ye,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:a("registry.registryItemDialog.teamCompanyOrPerson"),value:ge,onChange:Q=>ue(Q.target.value)})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"registry-item-repository-url",children:a("registry.registryItemDialog.repositoryUrlOptional")}),t.jsx(ye,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:ie,onChange:Q=>C(Q.target.value)}),fe.repositoryUrl&&t.jsx("p",{className:"text-xs text-destructive",children:fe.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(ae,{children:a("registry.registryItemDialog.readme")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[K.length,"/50000"]})]}),t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:["link","content"].map(Q=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md",oe===Q?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>Ie(Q),children:a(Q==="link"?"registry.registryItemDialog.link":"registry.registryItemDialog.content")},Q))}),oe==="link"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ye,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:re,onChange:Q=>xe(Q.target.value)}),fe.readmeUrl&&t.jsx("p",{className:"text-xs text-destructive",children:fe.readmeUrl})]}),oe==="content"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(wt,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
26
26
 
27
- Describe your MCP here...`,rows:6,value:K,onChange:Q=>H(Q.target.value)}),fe.readme&&t.jsx("p",{className:"text-xs text-destructive",children:fe.readme})]})]}),t.jsx(oi,{tools:Se,onChange:mt,remoteUrl:et(Ne)||void 0,remoteType:le,externalDiscoverStatus:p,externalDiscoverError:g})]});return t.jsx(yt,{open:s,onOpenChange:Wt,children:t.jsxs(jt,{className:"sm:max-w-[820px] max-h-[90vh] overflow-hidden flex flex-col",children:[t.jsxs(Nt,{className:"space-y-3",children:[t.jsx(vt,{children:a(h?"registry.registryItemDialog.editMcpServer":"registry.registryItemDialog.addMcpServer")}),t.jsx(pi,{current:E}),t.jsxs(bt,{children:[E===1&&a("registry.registryItemDialog.step1Description"),E===2&&a("registry.registryItemDialog.step2Description"),E===3&&a("registry.registryItemDialog.step3Description")]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 py-2",children:[E===1&&qs,E===2&&Es,E===3&&Ls]}),t.jsxs(Ct,{className:"flex items-center justify-between gap-2 sm:justify-between",children:[t.jsx("div",{children:E>1&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:Ts,children:[t.jsx(Js,{size:14}),a("registry.registryItemDialog.back")]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Y,{variant:"outline",size:"sm",onClick:()=>Wt(!1),disabled:c,children:a("registry.registryItemDialog.cancel")}),E<3?t.jsxs(Y,{size:"sm",onClick:Ds,children:[a("registry.registryItemDialog.next"),t.jsx(ur,{size:14})]}):t.jsx(Y,{size:"sm",onClick:Ms,disabled:c,children:a(c?"registry.registryItemDialog.saving":h?"registry.registryItemDialog.saveChanges":"registry.registryItemDialog.create")})]})]})]})})}function cs(s,e){return s.includes(e)?s.filter(r=>r!==e):[...s,e]}function bi(s){return s._meta?.["mcp.mesh"]?.tags??[]}function Ni(s){return s._meta?.["mcp.mesh"]?.categories??[]}function Ci(s){return s.server?.remotes?.[0]?.url??"-"}function wi(){const s=ce(),e="h-8",[r,i]=M.useState(""),n=M.useDeferredValue(r),[l,c]=M.useState([]),[o,a]=M.useState([]),[u,d]=M.useState(!1),[m,f]=M.useState(!1),[p,g]=M.useState(null),[x,h]=M.useState(null),[y,N]=rr("private-registry-list","cards"),w=M.useRef(null),_=js({search:n,tags:l,categories:o}),b=Lr(),{createMutation:L,updateMutation:I,deleteMutation:P,bulkCreateMutation:R}=Ot(),k=_.data?.pages.flatMap(j=>j.items??[]).filter(Boolean)??[],A=_.data?.pages[0]?.totalCount??k.length,q=l.length>0||o.length>0||n.length>0,v=b.data,S=Array.isArray(v?.tags)?v.tags:[],D=Array.isArray(v?.categories)?v.categories:[],F=j=>{w.current&&(w.current.disconnect(),w.current=null),!(!j||!_.hasNextPage||_.isFetchingNextPage)&&(w.current=new IntersectionObserver($=>{$[0]?.isIntersecting&&_.hasNextPage&&!_.isFetchingNextPage&&_.fetchNextPage()},{rootMargin:"240px 0px"}),w.current.observe(j))},T=async j=>{try{"data"in j?(await I.mutateAsync(j),G.success(s("registry.registryItemsPage.registryItemUpdated"))):(await L.mutateAsync(j),G.success(s("registry.registryItemsPage.registryItemCreated")))}catch($){throw G.error($ instanceof Error?$.message:s("registry.registryItemsPage.failedToSaveItem")),$}},U=async j=>{const $=j._meta?.["mcp.mesh"]?.verified===!0;try{await I.mutateAsync({id:j.id,data:{_meta:{...j._meta,"mcp.mesh":{...j._meta?.["mcp.mesh"],verified:!$}}}}),G.success(s($?"registry.registryItemsPage.removedVerifiedStatus":"registry.registryItemsPage.markedAsVerified"))}catch(B){G.error(B instanceof Error?B.message:s("registry.registryItemsPage.failedToUpdateItem"))}},E=async j=>{const $=j._meta?.["mcp.mesh"]?.official===!0;try{await I.mutateAsync({id:j.id,data:{_meta:{...j._meta,"mcp.mesh":{...j._meta?.["mcp.mesh"],official:!$}}}}),G.success(s($?"registry.registryItemsPage.removedOfficialStatus":"registry.registryItemsPage.markedAsOfficial"))}catch(B){G.error(B instanceof Error?B.message:s("registry.registryItemsPage.failedToUpdateItem"))}},O=async()=>{if(x)try{await P.mutateAsync(x.id),G.success(s("registry.registryItemsPage.registryItemDeleted")),h(null)}catch(j){G.error(j instanceof Error?j.message:s("registry.registryItemsPage.failedToDeleteItem"))}};return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{className:"h-12 px-4 md:px-6 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("h2",{className:"text-sm font-medium",children:s("registry.registryItemsPage.items")}),t.jsx(V,{variant:"secondary",className:"text-xs",children:A})]}),t.jsxs("div",{className:"flex items-center gap-2 self-stretch",children:[t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:te(e,"gap-1.5"),children:[t.jsx(ir,{size:14}),s("registry.registryItemsPage.filters")]})}),t.jsxs(ht,{align:"end",className:"w-[260px]",children:[t.jsx(es,{children:s("registry.registryItemsPage.tags")}),S.length>0?S.map(j=>t.jsxs(ts,{checked:l.includes(j.value),onCheckedChange:()=>c($=>cs($,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(Re,{disabled:!0,children:s("registry.registryItemsPage.noTagsAvailable")}),t.jsx(tr,{}),t.jsx(es,{children:s("registry.registryItemsPage.categories")}),D.length>0?D.map(j=>t.jsxs(ts,{checked:o.includes(j.value),onCheckedChange:()=>a($=>cs($,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(Re,{disabled:!0,children:s("registry.registryItemsPage.noCategoriesAvailable")})]})]}),t.jsxs(sr,{type:"single",value:y,onValueChange:j=>{(j==="cards"||j==="table")&&N(j)},variant:"outline",className:e,children:[t.jsx(ss,{value:"cards","aria-label":s("registry.registryItemsPage.cardsViewAriaLabel"),className:e,children:s("registry.registryItemsPage.cards")}),t.jsx(ss,{value:"table","aria-label":s("registry.registryItemsPage.tableViewAriaLabel"),className:e,children:s("registry.registryItemsPage.table")})]}),t.jsx(Y,{variant:"outline",size:"sm",className:e,onClick:()=>f(!0),children:s("registry.registryItemsPage.importCsv")}),t.jsx(Y,{size:"sm",className:e,onClick:()=>d(!0),children:s("registry.registryItemsPage.addMcpServers")})]})]}),t.jsx("div",{className:"border-t border-border h-12 px-4 md:px-6 flex items-center",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-12 w-full cursor-text",children:[t.jsx(ar,{size:16,className:"text-muted-foreground shrink-0"}),t.jsx(ye,{value:r,onChange:j=>i(j.target.value),placeholder:s("registry.registryItemsPage.searchPlaceholder"),className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),q&&t.jsxs("div",{className:"border-t border-border px-4 md:px-6 py-2 flex flex-wrap items-center gap-2",children:[l.map(j=>t.jsxs(V,{variant:"default",children:["#",j]},`selected-tag-${j}`)),o.map(j=>t.jsx(V,{variant:"outline",children:j},`selected-category-${j}`)),r.trim()&&t.jsxs(V,{variant:"secondary",className:"max-w-[280px] truncate",children:["Search: ",r]}),t.jsx(Y,{size:"sm",variant:"ghost",className:"h-7 ml-auto",onClick:()=>{i(""),c([]),a([])},children:s("registry.registryItemsPage.clearFilters")})]})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[k.length===0?t.jsx("div",{className:"min-h-[320px] rounded-xl border border-dashed border-border flex flex-col items-center justify-center gap-3 p-6 text-center",children:_.isLoading?t.jsxs(t.Fragment,{children:[t.jsx(Ye,{className:"size-5 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:s("registry.registryItemsPage.loadingItems")})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-base font-medium",children:s(q?"registry.registryItemsPage.noItemsFound":"registry.registryItemsPage.noMcpsInRegistry")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:s(q?"registry.registryItemsPage.tryRemovingFilters":"registry.registryItemsPage.addFirstMcpItem")}),!q&&t.jsx(Y,{size:"lg",onClick:()=>d(!0),children:s("registry.registryItemsPage.addMcpServers")})]})}):y==="cards"?t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(j=>t.jsx(ii,{item:j,onEdit:g,onDelete:h,onToggleVerified:U,onToggleOfficial:E},j.id))}),_.hasNextPage&&t.jsx("div",{ref:F,className:"h-2"})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"border rounded-lg overflow-auto",children:t.jsxs(At,{children:[t.jsx(Ut,{children:t.jsxs(Je,{children:[t.jsx(pe,{className:"w-[56px]",children:s("registry.registryItemsPage.icon")}),t.jsx(pe,{children:s("registry.registryItemsPage.title")}),t.jsx(pe,{children:s("registry.registryItemsPage.id")}),t.jsx(pe,{children:s("registry.registryItemsPage.tags")}),t.jsx(pe,{children:s("registry.registryItemsPage.categories")}),t.jsx(pe,{children:s("registry.registryItemsPage.remoteUrl")}),t.jsx(pe,{children:s("registry.registryItemsPage.visibility")}),t.jsx(pe,{className:"text-right w-[68px]",children:s("registry.registryItemsPage.actions")})]})}),t.jsx(Ft,{children:k.map(j=>t.jsxs(Je,{children:[t.jsx(he,{children:t.jsx("div",{className:"size-8 rounded-md border border-border bg-muted/20 overflow-hidden flex items-center justify-center",children:j.server?.icons?.[0]?.src?t.jsx("img",{src:j.server.icons[0].src,alt:j.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:j.title.charAt(0).toUpperCase()})})}),t.jsx(he,{children:j.title}),t.jsx(he,{className:"font-mono",children:j.id}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:bi(j).slice(0,3).map($=>t.jsx(V,{variant:"outline",children:$},`${j.id}-tag-${$}`))})}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:Ni(j).slice(0,3).map($=>t.jsx(V,{variant:"outline",children:$},`${j.id}-category-${$}`))})}),t.jsx(he,{children:Ci(j)}),t.jsx(he,{children:j.is_public?t.jsxs(V,{variant:"default",className:"gap-1",children:[t.jsx(xs,{size:10}),s("registry.registryItemsPage.public")]}):t.jsx(V,{variant:"secondary",children:s("registry.registryItemsPage.private")})}),t.jsx(he,{className:"text-right",children:t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":s("registry.registryItemsPage.actionsFor",{title:j.title}),children:t.jsx($t,{size:18})})}),t.jsxs(ht,{align:"end",children:[t.jsx(Re,{onClick:()=>g(j),children:s("registry.registryItemsPage.edit")}),t.jsx(Re,{variant:"destructive",onClick:()=>h(j),children:s("registry.registryItemsPage.delete")})]})]})})]},j.id))})]})}),_.hasNextPage&&t.jsx("div",{ref:F,className:"h-2"})]}),_.isFetchingNextPage&&t.jsxs("div",{className:"py-4 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(Ye,{className:"size-4 animate-spin"}),s("registry.registryItemsPage.loadingMoreItems")]})]}),t.jsx(vi,{open:u||!!p,onOpenChange:j=>{j||(d(!1),g(null))},item:p,availableTags:S.map(j=>j.value),availableCategories:D.map(j=>j.value),isSubmitting:L.isPending||I.isPending,onSubmit:T},p?.id??"create"),t.jsx(Wr,{open:m,onOpenChange:f,isImporting:R.isPending,onImport:async j=>{try{const $=await R.mutateAsync(j);return G.success(s("registry.registryItemsPage.importedItems",{count:$.created})),$}catch($){throw G.error($ instanceof Error?$.message:s("registry.registryItemsPage.failedToImportCsv")),$}}}),t.jsx(Xr,{open:!!x,onOpenChange:j=>{j||h(null)},title:x?.title??x?.id??"",isDeleting:P.isPending,onConfirm:O})]})}const _i=[{value:"pending",labelKey:"registry.registryRequestsPage.statusPending"},{value:"approved",labelKey:"registry.registryRequestsPage.statusApproved"},{value:"rejected",labelKey:"registry.registryRequestsPage.statusRejected"}];function ds(s){const e=new Date(s);return Number.isNaN(e.getTime())?s:e.toLocaleDateString()}function us(s){return{id:s.requested_id??s.server?.name,title:s.title,description:s.description??"",_meta:s._meta,server:s.server,is_public:!1}}function Et(s){const e=s.server?.icons?.[0]?.src;return typeof e=="string"&&e.length>0?e:null}function xt(s){const e=s._meta?.["mcp.mesh"];return{hasReadmeContent:!!e?.readme?.trim(),hasReadmeLink:!!e?.readme_url?.trim(),readmeContent:e?.readme?.trim()??"",readmeUrl:e?.readme_url?.trim()??""}}function Pi(){const s=ce(),[e,r]=M.useState("pending"),[i,n]=M.useState("created_at"),[l,c]=M.useState("asc"),[o,a]=M.useState(new Set),[u,d]=M.useState(!1),[m,f]=M.useState("private"),[p,g]=M.useState(!1),[x,h]=M.useState(null),[y,N]=M.useState(null),[w,_]=M.useState(null),[b,L]=M.useState(null),[I,P]=M.useState(""),R=Ur({status:e,sortBy:i,sortDirection:l}),{reviewMutation:k,deleteMutation:A}=Or(),{createMutation:q}=Ot(),v=R.data?.pages.flatMap(C=>C.items)??[],S=R.data?.pages[0]?.totalCount??0,D=R.isFetchingNextPage,F=!!R.hasNextPage,T=yr(()=>{R.isFetchingNextPage||R.fetchNextPage()},F,D),U=new Set(v.filter(C=>C.status==="pending").map(C=>C.id)),E=v.filter(C=>U.has(C.id)),O=o.size,j=E.filter(C=>o.has(C.id)),$=v.filter(C=>o.has(C.id)).length,B=E.length>0&&E.every(C=>o.has(C.id)),X=()=>a(new Set),J=(C,K)=>{a(H=>{const re=new Set(H);return K?re.add(C):re.delete(C),re})},de=C=>{a(K=>{const H=new Set(K);return H.has(C)?H.delete(C):H.add(C),H})},se=()=>{a(C=>{const K=new Set(C);for(const H of E)K.add(H.id);return K})},ne=async()=>{const C=y;if(C){N(null),h(C.id);try{await k.mutateAsync({id:C.id,status:"approved",reviewerNotes:void 0});const K=us(C);await q.mutateAsync({id:K.id,title:K.title,description:K.description,_meta:K._meta,server:K.server,is_public:K.is_public}),G.success(s("registry.registryRequestsPage.requestApprovedAndAdded"))}catch(K){const H=K instanceof Error?K.message:"Failed to approve request";H.includes("UNIQUE constraint")||H.includes("already exists")?G.error(s("registry.registryRequestsPage.itemAlreadyExists")):G.error(H)}finally{h(null)}}},ge=async()=>{if(w)try{await k.mutateAsync({id:w.id,status:"rejected",reviewerNotes:I.trim()||void 0}),G.success(s("registry.registryRequestsPage.requestRejected")),_(null),P("")}catch(C){G.error(C instanceof Error?C.message:"Failed to reject request")}},ue=async C=>{try{await A.mutateAsync(C.id),G.success(s("registry.registryRequestsPage.requestDeleted"))}catch(K){G.error(K instanceof Error?K.message:"Failed to delete request")}},ie=async()=>{if(j.length===0||p)return;g(!0),d(!1);let C=0;const K=new Set;for(const re of j)try{await k.mutateAsync({id:re.id,status:"approved",reviewerNotes:void 0});const xe=us(re);await q.mutateAsync({id:xe.id,title:xe.title,description:xe.description,_meta:xe._meta,server:xe.server,is_public:m==="public"}),C++}catch{K.add(re.id)}const H=K.size;C>0&&H===0?G.success(s("registry.registryRequestsPage.bulkApproveSuccess",{approvedCount:C,bulkVisibility:m})):C>0&&H>0?G.warning(s("registry.registryRequestsPage.bulkApprovePartial",{approvedCount:C,failedCount:H})):G.error(s("registry.registryRequestsPage.bulkApproveFailed")),a(K),g(!1)};return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsx("div",{className:"shrink-0 border-b border-border",children:t.jsxs("div",{className:"h-12 px-4 md:px-6 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("h2",{className:"text-sm font-medium",children:s("registry.registryRequestsPage.requestsToPublish")}),t.jsx(V,{variant:"secondary",className:"text-xs",children:S})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:_i.map(C=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md transition-colors",e===C.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r(C.value),onClickCapture:()=>X(),children:s(C.labelKey)},C.value))}),t.jsxs("select",{className:"h-7 rounded-md border border-input bg-background px-2 text-xs",value:`${i}:${l}`,onChange:C=>{const[K,H]=C.target.value.split(":");n(K),c(H)},children:[t.jsx("option",{value:"created_at:asc",children:s("registry.registryRequestsPage.sortCreatedOldest")}),t.jsx("option",{value:"created_at:desc",children:s("registry.registryRequestsPage.sortCreatedNewest")}),t.jsx("option",{value:"title:asc",children:s("registry.registryRequestsPage.sortAlphaAZ")}),t.jsx("option",{value:"title:desc",children:s("registry.registryRequestsPage.sortAlphaZA")})]})]})]})}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[R.isLoading?t.jsx("div",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.loadingRequests")}):R.isError?t.jsxs("div",{className:"p-8 text-center rounded-lg border border-border",children:[t.jsx("p",{className:"text-sm text-destructive",children:s("registry.registryRequestsPage.failedLoadRequests")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:R.error instanceof Error?R.error.message:s("registry.registryRequestsPage.unknownError")})]}):v.length===0?t.jsx("div",{className:"p-8 text-center rounded-lg border border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:s(e==="pending"?"registry.registryRequestsPage.noPendingRequests":e==="approved"?"registry.registryRequestsPage.noApprovedRequests":"registry.registryRequestsPage.noRejectedRequests")})}):t.jsxs(At,{children:[t.jsx(Ut,{children:t.jsxs(Je,{children:[e==="pending"&&t.jsx(pe,{className:"w-10",children:t.jsx(is,{checked:B&&E.length>0,onCheckedChange:C=>{C?se():X()}})}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnName")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnRequester")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnTags")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnStatus")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnDate")}),t.jsx(pe,{className:"text-right",children:s("registry.registryRequestsPage.columnActions")})]})}),t.jsx(Ft,{children:v.map(C=>{const K=Et(C),H=C._meta?.["mcp.mesh"]?.tags??[],re=U.has(C.id),xe=o.has(C.id);return t.jsxs(Je,{className:te(re&&"cursor-pointer",xe&&"bg-accent/20"),onClick:()=>{re&&de(C.id)},children:[e==="pending"&&t.jsx(he,{children:t.jsx(is,{checked:xe,onCheckedChange:oe=>J(C.id,oe===!0),onClick:oe=>oe.stopPropagation()})}),t.jsx(he,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-7 rounded-md border border-border bg-muted/30 overflow-hidden shrink-0 flex items-center justify-center",children:K?t.jsx("img",{src:K,alt:C.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:C.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:C.description})]})]})}),t.jsx(he,{children:t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:C.requester_name||C.requester_email||"-"})}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:H.slice(0,3).map(oe=>t.jsx(V,{variant:"secondary",className:"text-[10px]",children:oe},`${C.id}-tag-${oe}`))})}),t.jsx(he,{children:t.jsx(V,{variant:"secondary",className:"capitalize text-[11px]",children:C.status})}),t.jsx(he,{children:t.jsx("span",{className:"text-sm text-muted-foreground",children:ds(C.created_at)})}),t.jsx(he,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsxs(Y,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:oe=>{oe.stopPropagation(),L(C)},children:[t.jsx(ps,{size:13}),s("registry.registryRequestsPage.buttonView")]}),re?t.jsxs(t.Fragment,{children:[t.jsxs(Y,{size:"sm",className:"h-7 text-xs px-2",onClick:oe=>{oe.stopPropagation(),N(C)},disabled:x!==null||p||xe,children:[t.jsx(We,{size:13}),x===C.id?s("registry.registryRequestsPage.approving"):s(xe?"registry.registryRequestsPage.selected":"registry.registryRequestsPage.buttonApprove")]}),t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:oe=>{oe.stopPropagation(),_(C),P("")},disabled:k.isPending,children:[t.jsx(xr,{size:13}),s("registry.registryRequestsPage.buttonReject")]})]}):t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:oe=>{oe.stopPropagation(),ue(C)},disabled:A.isPending,children:[t.jsx(dt,{size:13}),s("registry.registryRequestsPage.buttonDelete")]})]})})]},C.id)})})]}),v.length>0&&F?t.jsx("div",{ref:T,className:"h-1 w-full"}):null,D&&v.length>0?t.jsx("div",{className:"pt-3 text-xs text-muted-foreground",children:s("registry.registryRequestsPage.loadingMoreRequests")}):null]}),O>0?t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground pr-1",children:s("registry.registryRequestsPage.selectedCount",{selectedCount:O})}),t.jsx(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:se,disabled:B,children:s("registry.registryRequestsPage.selectAll")}),t.jsx(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:X,children:s("registry.registryRequestsPage.clearSelection")}),t.jsxs(Y,{size:"sm",className:"h-7 text-xs px-2",onClick:()=>d(!0),disabled:p,children:[t.jsx(We,{size:13}),s("registry.registryRequestsPage.approveSelected")]})]})}):null,t.jsx(yt,{open:!!b,onOpenChange:C=>{C||L(null)},children:t.jsxs(jt,{className:"sm:max-w-[720px] max-h-[85vh] overflow-hidden flex flex-col",children:[t.jsxs(Nt,{children:[t.jsx(vt,{children:b?.title??s("registry.registryRequestsPage.requestDetails")}),t.jsx(bt,{children:s("registry.registryRequestsPage.reviewMetadataDescription")})]}),b&&t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 space-y-4",children:[t.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3 flex items-center gap-3",children:[t.jsx("div",{className:"size-16 rounded-lg border border-border bg-muted/30 overflow-hidden shrink-0 flex items-center justify-center",children:Et(b)?t.jsx("img",{src:Et(b)||"",alt:b.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-lg font-semibold text-muted-foreground",children:b.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:b.title}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.server?.name||b.id})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelStatus")}),t.jsx("span",{className:"capitalize",children:b.status})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelSubmitted")}),t.jsx("span",{children:ds(b.created_at)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelRequester")}),t.jsx("span",{children:b.requester_name||"-"})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelEmail")}),t.jsx("span",{children:b.requester_email||"-"})]})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelRemoteURL")}),t.jsx("code",{className:"text-xs rounded-md border border-border bg-muted/30 px-2.5 py-2 break-all",children:b.server?.remotes?.[0]?.url??"-"})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelDescription")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:b.description||s("registry.registryRequestsPage.noDescriptionProvided")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelTags")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(b._meta?.["mcp.mesh"]?.tags??[]).length?(b._meta?.["mcp.mesh"]?.tags??[]).map(C=>t.jsx(V,{variant:"secondary",children:C},`${b.id}-detail-tag-${C}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelCategories")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(b._meta?.["mcp.mesh"]?.categories??[]).length?(b._meta?.["mcp.mesh"]?.categories??[]).map(C=>t.jsx(V,{variant:"secondary",children:C},`${b.id}-detail-category-${C}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelREADME")}),xt(b).hasReadmeContent?t.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap max-h-40 overflow-y-auto rounded-md border border-border bg-muted/20 px-2.5 py-2",children:xt(b).readmeContent}):xt(b).hasReadmeLink?t.jsxs("a",{href:xt(b).readmeUrl,target:"_blank",rel:"noreferrer",className:"text-sm inline-flex items-center gap-1.5 text-primary hover:underline",children:[s("registry.registryRequestsPage.openREADMELink"),t.jsx(fr,{size:14})]}):t.jsx("span",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.noREADMEProvided")})]})]}),t.jsx(Ct,{children:t.jsx(Y,{variant:"outline",onClick:()=>L(null),children:s("registry.registryRequestsPage.buttonClose")})})]})}),t.jsx(ct,{open:!!y,onOpenChange:C=>{C||N(null)},children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:s("registry.registryRequestsPage.approvePublishRequestTitle")}),t.jsx(rt,{children:s("registry.registryRequestsPage.approvePublishRequestDesc",{title:y?.title??""})})]}),t.jsxs(ot,{children:[t.jsx(nt,{children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(at,{onClick:ne,children:s("registry.registryRequestsPage.buttonApprove")})]})]})}),t.jsx(ct,{open:u,onOpenChange:d,children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:s("registry.registryRequestsPage.approveSelectedRequestsTitle")}),t.jsx(rt,{children:s("registry.registryRequestsPage.approveSelectedRequestsDesc",{count:j.length})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"bulk-visibility",children:s("registry.registryRequestsPage.visibilityForAll")}),t.jsxs("select",{id:"bulk-visibility",className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:m,onChange:C=>f(C.target.value),children:[t.jsx("option",{value:"private",children:s("registry.registryRequestsPage.visibilityPrivate")}),t.jsx("option",{value:"public",children:s("registry.registryRequestsPage.visibilityPublic")})]})]}),t.jsxs(ot,{children:[t.jsx(nt,{disabled:p,children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(at,{onClick:ie,disabled:p||$===0,children:s(p?"registry.registryRequestsPage.approving":"registry.registryRequestsPage.approveSelected")})]})]})}),t.jsx(yt,{open:!!w,onOpenChange:C=>{C||(_(null),P(""))},children:t.jsxs(jt,{children:[t.jsxs(Nt,{children:[t.jsx(vt,{children:s("registry.registryRequestsPage.rejectPublishRequestTitle")}),t.jsx(bt,{children:s("registry.registryRequestsPage.rejectPublishRequestDesc")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"reject-notes",children:s("registry.registryRequestsPage.reviewerNotes")}),t.jsx(wt,{id:"reject-notes",rows:4,value:I,onChange:C=>P(C.target.value),placeholder:s("registry.registryRequestsPage.reasonForRejectionPlaceholder")})]}),t.jsxs(Ct,{children:[t.jsx(Y,{variant:"outline",onClick:()=>{_(null),P("")},children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(Y,{onClick:ge,disabled:k.isPending,children:k.isPending?s("registry.registryRequestsPage.rejecting"):s("registry.registryRequestsPage.buttonReject")})]})]})})]})}function Ri({revealedKey:s,onRevealedKeyChange:e}){const r=ce(),{org:i}=be(),{uploadImage:n,isUploading:l}=Cs(),{registryName:c,registryIcon:o,acceptPublishRequests:a,requireApiToken:u,storePrivateOnly:d,rateLimitEnabled:m,rateLimitWindow:f,rateLimitMax:p,isSaving:g,updateConfig:x}=vs(Ve),[h,y]=M.useState(c),[N,w]=M.useState(c);c!==N&&(w(c),y(c));const[_,b]=M.useState(o),[L,I]=M.useState(o);o!==L&&(I(o),b(o));const[P,R]=M.useState(String(p)),[k,A]=M.useState(p);p!==k&&(A(p),R(String(p)));const q=Br(),{generateMutation:v,revokeMutation:S}=Kr(),[D,F]=M.useState(""),[T,U]=M.useState(!1),[E,O]=M.useState(null),{handleCopy:j,copied:$}=Tt(),{handleCopy:B,copied:X}=Tt(),{handleCopy:J,copied:de}=Tt(),se=js({search:"",tags:[],categories:[],limit:50}),ne=`${window.location.origin}/org/${i.slug}/registry/mcp`,ue=(se.data?.pages.flatMap(z=>z.items??[])??[]).filter(z=>z.is_public).length,ie=`${window.location.origin}/org/${i.slug}/registry/publish-request`,C=s?.slice(0,12)??null,K=!!(C&&(q.data?.items??[]).some(z=>z.prefix===C)),H=g||l,re=()=>{const z=h.trim();!z||z===c||x({registryName:z})},xe=()=>{const z=Number.parseInt(P,10),le=Number.isFinite(z)&&z>=1?z:100;R(String(le)),le!==p&&x({rateLimitMax:le})},oe=async z=>{if(!z)return;const le=z.name.split(".").pop()||"png",ke=`registry/${i.id}/identity/icon.${le}`,Pe=await n(z,ke);Pe?(b(Pe),x({registryIcon:Pe})):G.error(r("registry.registrySettingsPage.failedUploadIcon"))},Ie=async()=>{const z=D.trim();if(z)try{const le=await v.mutateAsync(z);le?.key&&(e(le.key),U(!1),F(""),G.success(r("registry.registrySettingsPage.apiKeyGenerated")))}catch(le){G.error(le instanceof Error?le.message:r("registry.registrySettingsPage.failedGenerateApiKey"))}},Ne=async z=>{try{await S.mutateAsync(z),e(null),O(null),G.success(r("registry.registrySettingsPage.apiKeyRevoked"))}catch(le){G.error(le instanceof Error?le.message:r("registry.registrySettingsPage.failedRevokeApiKey"))}};return t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4",children:[t.jsxs("div",{className:"grid grid-cols-1 gap-4 items-start xl:grid-cols-2",children:[t.jsx("div",{className:"grid gap-4 min-w-0 content-start",children:t.jsxs(me,{className:"min-w-0 p-4 grid gap-4 content-start",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:r("registry.registrySettingsPage.registryIdentity")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.configureNameIcon")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"identity-name",children:r("registry.registrySettingsPage.name")}),t.jsx(ye,{id:"identity-name",value:h,onChange:z=>y(z.target.value),onBlur:re,disabled:H,placeholder:r("registry.registrySettingsPage.namePlaceholder")})]}),t.jsx(bs,{value:_,onChange:b,onBlur:()=>{const z=_.trim();z!==o&&x({registryIcon:z})},onFileUpload:oe,isUploading:l})]})}),t.jsxs("div",{className:"grid gap-4 min-w-0 content-start",children:[t.jsxs(me,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:r("registry.registrySettingsPage.publicRegistry")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.publicRegistryDescription")})]}),t.jsxs(V,{variant:"secondary",children:[ue," ",r(ue===1?"registry.registrySettingsPage.publicItem":"registry.registrySettingsPage.publicItems")]})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-xs font-mono break-all leading-5 min-w-0 flex-1 select-all",children:ne}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>j(ne),children:$?t.jsx(Mt,{size:14}):t.jsx(qt,{size:14})})]})]}),t.jsxs(me,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:r("registry.registrySettingsPage.storeVisibility")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.storeVisibilityDescription")})]}),t.jsx(Ge,{id:"store-private-only",checked:d,onCheckedChange:z=>x({storePrivateOnly:z}),disabled:H})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.storeVisibilityHelp")})]}),t.jsxs(me,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:r("registry.registrySettingsPage.publishRequests")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.publishRequestsDescription")})]}),t.jsx(Ge,{id:"accept-publish-requests",checked:a,onCheckedChange:z=>x({acceptPublishRequests:z}),disabled:H})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-xs font-mono break-all leading-5 min-w-0 flex-1 select-all",children:ie}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>B(ie),children:X?t.jsx(Mt,{size:14}):t.jsx(qt,{size:14})})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(ae,{className:"text-sm font-medium",children:r("registry.registrySettingsPage.requireApiToken")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.requireApiTokenHelp")})]}),t.jsx(Ge,{id:"require-api-token",checked:u,onCheckedChange:z=>x({requireApiToken:z}),disabled:H})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(ae,{className:"text-sm font-medium",children:r("registry.registrySettingsPage.rateLimit")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.rateLimitHelp")})]}),t.jsx(Ge,{id:"publish-rate-limit",checked:m,onCheckedChange:z=>x({rateLimitEnabled:z}),disabled:H})]}),m&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:"rate-limit-max",className:"text-sm font-medium",children:r("registry.registrySettingsPage.maxRequests")}),t.jsx(ye,{id:"rate-limit-max",inputMode:"numeric",min:1,type:"number",value:P,onChange:z=>R(z.target.value),onBlur:xe,disabled:H,placeholder:r("registry.registrySettingsPage.maxRequestsPlaceholder")})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:"rate-limit-window",className:"text-sm font-medium",children:r("registry.registrySettingsPage.window")}),t.jsxs("select",{id:"rate-limit-window",className:"h-9 rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",value:f,onChange:z=>x({rateLimitWindow:z.target.value}),disabled:H,children:[t.jsx("option",{value:"minute",children:r("registry.registrySettingsPage.perMinute")}),t.jsx("option",{value:"hour",children:r("registry.registrySettingsPage.perHour")})]})]})]}),a&&u&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[t.jsx(jr,{size:14,className:"text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:r("registry.registrySettingsPage.apiKeys")})]}),s&&!K&&t.jsxs("div",{className:"rounded-md border border-border bg-muted/20 px-3 py-2 grid gap-1.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.newKeyRefreshing")}),t.jsx(ye,{readOnly:!0,value:s,className:"h-8 text-xs font-mono bg-background"})]}),t.jsxs("div",{className:"flex items-end gap-2",children:[t.jsxs("div",{className:"grid gap-1.5 flex-1",children:[t.jsx(ae,{htmlFor:"api-key-name",className:"text-xs",children:r("registry.registrySettingsPage.keyName")}),t.jsx(ye,{id:"api-key-name",value:D,onChange:z=>F(z.target.value),placeholder:r("registry.registrySettingsPage.keyNamePlaceholder"),className:"h-8 text-sm"})]}),t.jsxs(Y,{variant:"outline",size:"sm",className:"h-8 gap-1.5",disabled:!D.trim()||v.isPending,onClick:Ie,children:[v.isPending?t.jsx(Ye,{size:14,className:"animate-spin"}):t.jsx(vr,{size:14}),r("registry.registrySettingsPage.generate")]})]}),(q.data?.items?.length??0)>0&&t.jsx("div",{className:"grid gap-2",children:q.data?.items?.map(z=>t.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background px-3 py-2",children:[t.jsxs("div",{className:"grid gap-1 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate leading-none",children:z.name}),C===z.prefix?t.jsx(ye,{readOnly:!0,value:T?s??"":"••••••••••••••••••••••••••••••••••••••••••••••••••••",className:"h-8 text-xs font-mono bg-muted/20"}):t.jsx(ye,{readOnly:!0,value:`${z.prefix}••••••••`,className:"h-8 text-xs font-mono bg-muted/20 text-muted-foreground"})]}),t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C===z.prefix&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>U(le=>!le),children:T?t.jsx(Zs,{size:14}):t.jsx(ps,{size:14})}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:!s,onClick:()=>s&&J(s),children:de?t.jsx(Mt,{size:14}):t.jsx(qt,{size:14})})]}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:text-destructive",disabled:S.isPending,onClick:()=>O({id:z.id,name:z.name}),children:t.jsx(dt,{size:14})})]})]},z.id))})]})]})]})]}),t.jsx(ct,{open:!!E,onOpenChange:z=>{!z&&!S.isPending&&O(null)},children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:r("registry.registrySettingsPage.revokeApiKeyTitle")}),t.jsx(rt,{children:r("registry.registrySettingsPage.revokeApiKeyDescription",{keyName:E?.name??""})})]}),t.jsxs(ot,{children:[t.jsx(nt,{disabled:S.isPending,children:r("registry.registrySettingsPage.cancel")}),t.jsx(at,{disabled:!E||S.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>E&&Ne(E.id),children:S.isPending?r("registry.registrySettingsPage.revoking"):r("registry.registrySettingsPage.revokeKey")})]})]})})]})}function Ii(s){const e=Z.c(8),{results:r}=s,i=ce();if(r.length===0){let c;e[0]!==i?(c=i("registry.brokenMcpList.noBrokenMcps"),e[0]=i,e[1]=c):c=e[1];let o;return e[2]!==c?(o=t.jsx(me,{className:"p-4 text-sm text-muted-foreground text-center",children:c}),e[2]=c,e[3]=o):o=e[3],o}let n;e[4]!==r?(n=r.map(ki),e[4]=r,e[5]=n):n=e[5];let l;return e[6]!==n?(l=t.jsx("div",{className:"space-y-2",children:n}),e[6]=n,e[7]=l):l=e[7],l}function ki(s){return t.jsx(Si,{result:s},s.id)}function Si(s){const e=Z.c(56),{result:r}=s,i=ce(),[n,l]=M.useState(!1);let c;if(e[0]!==n||e[1]!==r.action_taken||e[2]!==r.connection_ok||e[3]!==r.duration_ms||e[4]!==r.error_message||e[5]!==r.id||e[6]!==r.item_title||e[7]!==r.status||e[8]!==r.tool_results||e[9]!==r.tools_listed||e[10]!==i){const o=r.tool_results.filter(Mi);let a;e[12]!==n?(a=()=>l(!n),e[12]=n,e[13]=a):a=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-destructive text-sm mt-0.5",children:"✗"}),e[14]=u):u=e[14];let d;e[15]!==r.item_title?(d=t.jsx("h4",{className:"text-sm font-medium truncate",children:r.item_title}),e[15]=r.item_title,e[16]=d):d=e[16];let m;e[17]!==r.status?(m=r.status.replace("_"," "),e[17]=r.status,e[18]=m):m=e[18];let f;e[19]!==m?(f=t.jsx(V,{variant:"destructive",className:"capitalize text-[10px] shrink-0",children:m}),e[19]=m,e[20]=f):f=e[20];let p;e[21]!==d||e[22]!==f?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[d,f]}),e[21]=d,e[22]=f,e[23]=p):p=e[23];let g;e[24]!==i?(g=i("registry.brokenMcpList.connStatus"),e[24]=i,e[25]=g):g=e[25];const x=r.connection_ok?"✓":"✗";let h;e[26]!==g||e[27]!==x?(h=t.jsxs("span",{children:[g,":"," ",x]}),e[26]=g,e[27]=x,e[28]=h):h=e[28];let y;e[29]!==i?(y=i("registry.brokenMcpList.toolsListed"),e[29]=i,e[30]=y):y=e[30];const N=r.tools_listed?"✓":"✗";let w;e[31]!==y||e[32]!==N?(w=t.jsxs("span",{children:[y,":"," ",N]}),e[31]=y,e[32]=N,e[33]=w):w=e[33];let _;e[34]!==r.duration_ms?(_=t.jsxs("span",{children:[r.duration_ms,"ms"]}),e[34]=r.duration_ms,e[35]=_):_=e[35];const b=o.length>0&&t.jsx("span",{className:"text-destructive",children:i("registry.brokenMcpList.toolsFailed",{count:o.length})});let L;e[36]!==r.action_taken?(L=r.action_taken!=="none"&&t.jsx(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:r.action_taken.replace(/_/g," ")}),e[36]=r.action_taken,e[37]=L):L=e[37];let I;e[38]!==h||e[39]!==w||e[40]!==_||e[41]!==b||e[42]!==L?(I=t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground flex-wrap",children:[h,w,_,b,L]}),e[38]=h,e[39]=w,e[40]=_,e[41]=b,e[42]=L,e[43]=I):I=e[43];let P;e[44]!==r.error_message?(P=r.error_message&&t.jsx("p",{className:"text-xs text-destructive line-clamp-2",children:r.error_message}),e[44]=r.error_message,e[45]=P):P=e[45];let R;e[46]!==I||e[47]!==P||e[48]!==p?(R=t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[p,I,P]}),e[46]=I,e[47]=P,e[48]=p,e[49]=R):R=e[49];const k=n?"▲":"▼";let A;e[50]!==k?(A=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-1",children:k}),e[50]=k,e[51]=A):A=e[51];let q;e[52]!==R||e[53]!==a||e[54]!==A?(q=t.jsxs("button",{type:"button",className:"w-full text-left p-3 flex items-start gap-3 hover:bg-muted/30 transition-colors",onClick:a,children:[u,R,A]}),e[52]=R,e[53]=a,e[54]=A,e[55]=q):q=e[55],c=t.jsxs(me,{className:"overflow-hidden",children:[q,n&&t.jsxs("div",{className:"border-t border-border p-3 space-y-2 bg-muted/10",children:[r.error_message&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.brokenMcpList.fullError")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2.5 py-1.5 whitespace-pre-wrap break-all text-destructive",children:r.error_message})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.brokenMcpList.connectionLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?i("registry.brokenMcpList.statusOk"):i("registry.brokenMcpList.statusFailed")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.brokenMcpList.toolsListedLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?i("registry.brokenMcpList.yes"):i("registry.brokenMcpList.no")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.brokenMcpList.durationLabel")}),t.jsxs("p",{className:"text-xs font-medium",children:[r.duration_ms,"ms"]})]})]}),o.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.brokenMcpList.failedToolsHeader",{count:o.length})}),o.map(v=>t.jsxs("div",{className:"rounded border border-destructive/10 bg-destructive/5 px-2.5 py-1.5 space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs font-mono font-medium text-destructive",children:v.toolName}),t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[v.durationMs,"ms"]})]}),v.error&&t.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all text-destructive",children:v.error})]},`${r.id}-${v.toolName}`))]}),r.tool_results.length>0&&r.tool_results.some(Ti)&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.brokenMcpList.passingTools")}),t.jsx("div",{className:"flex flex-wrap gap-1",children:r.tool_results.filter(Di).map(v=>t.jsxs(V,{variant:"secondary",className:"text-[10px]",children:["✓ ",v.toolName]},`${r.id}-${v.toolName}-pass`))})]})]})]}),e[0]=n,e[1]=r.action_taken,e[2]=r.connection_ok,e[3]=r.duration_ms,e[4]=r.error_message,e[5]=r.id,e[6]=r.item_title,e[7]=r.status,e[8]=r.tool_results,e[9]=r.tools_listed,e[10]=i,e[11]=c}else c=e[11];return c}function Di(s){return s.success}function Ti(s){return s.success}function Mi(s){return!s.success}function qi(s,e){return s.onFailure!==e.onFailure||s.perMcpTimeoutMs!==e.perMcpTimeoutMs||s.perToolTimeoutMs!==e.perToolTimeoutMs||s.maxAgentSteps!==e.maxAgentSteps||s.testPublicOnly!==e.testPublicOnly||s.testPrivateOnly!==e.testPrivateOnly||s.includePendingRequests!==e.includePendingRequests||(s.agentContext??"")!==(e.agentContext??"")}function Ei(){const s=ce(),{settings:e,saveMutation:r}=fs(),i=M.useRef(e),[n,l]=M.useState(e),[c,o]=M.useState(!1),[a,u]=M.useState(!1);i.current!==e&&(i.current=e,l(e));const d=qi(n,e),m=p=>{o(!1),l(g=>({...g,...p}))},f=async()=>{const p={...n,agentContext:(n.agentContext??"").trim()};await r.mutateAsync(p),l(p),o(!0),setTimeout(()=>o(!1),3e3)};return t.jsxs(me,{className:"p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:s("registry.monitorConfiguration.qaConfiguration")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("registry.monitorConfiguration.description")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[d&&t.jsx(V,{className:"bg-warning/10 text-warning border-warning/20 text-[10px]",children:s("registry.monitorConfiguration.unsavedChanges")}),c&&t.jsxs(V,{className:"bg-success/10 text-success border-success/20 text-[10px]",children:["✓ ",s("registry.monitorConfiguration.saved")]}),t.jsx(Y,{size:"sm",onClick:f,disabled:r.isPending||!d,children:r.isPending?s("registry.monitorConfiguration.saving"):s("registry.monitorConfiguration.saveSettings")})]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.onFailureLabel"),hint:s("registry.monitorConfiguration.onFailureHint")}),t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:n.onFailure,onChange:p=>m({onFailure:p.target.value}),children:[t.jsx("option",{value:"none",children:s("registry.monitorConfiguration.onFailureNone")}),t.jsx("option",{value:"unlisted",children:s("registry.monitorConfiguration.onFailureUnlisted")}),t.jsx("option",{value:"remove_public",children:s("registry.monitorConfiguration.onFailureRemovePublic")}),t.jsx("option",{value:"remove_private",children:s("registry.monitorConfiguration.onFailureRemovePrivate")}),t.jsx("option",{value:"remove_all",children:s("registry.monitorConfiguration.onFailureRemoveAll")})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.testScopeLabel"),hint:s("registry.monitorConfiguration.testScopeHint")}),t.jsxs("div",{className:"flex items-center gap-4 rounded-md border border-input px-3 py-2",children:[t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:n.testPublicOnly,onChange:p=>m({testPublicOnly:p.target.checked,testPrivateOnly:p.target.checked?!1:n.testPrivateOnly})}),s("registry.monitorConfiguration.publicOnly")]}),t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:n.testPrivateOnly,onChange:p=>m({testPrivateOnly:p.target.checked,testPublicOnly:p.target.checked?!1:n.testPublicOnly})}),s("registry.monitorConfiguration.privateOnly")]})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.publishRequestsLabel"),hint:s("registry.monitorConfiguration.publishRequestsHint")}),t.jsx("div",{className:"flex items-center gap-4 rounded-md border border-input px-3 py-2",children:t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:n.includePendingRequests,onChange:p=>m({includePendingRequests:p.target.checked})}),s("registry.monitorConfiguration.includePendingRequests")]})})]}),t.jsxs("div",{className:"space-y-1 md:col-span-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx(He,{label:s("registry.monitorConfiguration.additionalTestContextLabel"),hint:s("registry.monitorConfiguration.additionalTestContextHint")}),t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7",onClick:()=>u(p=>!p),children:[s(a?"registry.monitorConfiguration.hideDefaultPrompt":"registry.monitorConfiguration.viewDefaultPrompt")," ",s("registry.monitorConfiguration.defaultSystemPrompt")]})]}),t.jsx(wt,{value:n.agentContext??"",onChange:p=>m({agentContext:p.target.value}),placeholder:s("registry.monitorConfiguration.agentContextPlaceholder"),rows:3}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:s("registry.monitorConfiguration.agentContextHelper")}),a&&t.jsx("pre",{className:"text-[11px] bg-muted/50 border border-border rounded px-3 py-2 whitespace-pre-wrap max-h-64 overflow-auto",children:Rr})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.perMcpTimeoutLabel"),hint:s("registry.monitorConfiguration.perMcpTimeoutHint")}),t.jsx(ye,{type:"number",value:n.perMcpTimeoutMs,onChange:p=>m({perMcpTimeoutMs:Number(p.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.perToolTimeoutLabel"),hint:s("registry.monitorConfiguration.perToolTimeoutHint")}),t.jsx(ye,{type:"number",value:n.perToolTimeoutMs,onChange:p=>m({perToolTimeoutMs:Number(p.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.maxAgentStepsLabel"),hint:s("registry.monitorConfiguration.maxAgentStepsHint")}),t.jsx(ye,{type:"number",value:n.maxAgentSteps,onChange:p=>m({maxAgentSteps:Number(p.target.value)}),min:1,max:30})]})]})]})}function He(s){const e=Z.c(16),{label:r,hint:i}=s,n=ce();let l;e[0]!==r?(l=t.jsx(ae,{children:r}),e[0]=r,e[1]=l):l=e[1];let c;e[2]!==r||e[3]!==n?(c=n("registry.monitorConfiguration.aboutLabel",{label:r}),e[2]=r,e[3]=n,e[4]=c):c=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Vs,{size:14}),e[5]=o):o=e[5];let a;e[6]!==c?(a=t.jsx(br,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors","aria-label":c,children:o})}),e[6]=c,e[7]=a):a=e[7];let u;e[8]!==i?(u=t.jsx(Nr,{side:"top",className:"max-w-72",children:i}),e[8]=i,e[9]=u):u=e[9];let d;e[10]!==a||e[11]!==u?(d=t.jsxs(Cr,{children:[a,u]}),e[10]=a,e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==l||e[14]!==d?(m=t.jsxs("div",{className:"flex items-center gap-1.5",children:[l,d]}),e[13]=l,e[14]=d,e[15]=m):m=e[15],m}function Li(s){switch(s){case"authenticated":return"bg-success/10 text-success border-success/20";case"needs_auth":return"bg-warning/10 text-warning border-warning/20";default:return"bg-muted text-muted-foreground border-border"}}function Ai(s,e){switch(s){case"authenticated":return e("registry.monitorConnectionsPanel.authenticated");case"needs_auth":return e("registry.monitorConnectionsPanel.needsAuth");default:return e("registry.monitorConnectionsPanel.notChecked")}}function Ui(s){const e=Z.c(4),{icon:r,title:i}=s,[n,l]=M.useState(!1);let c;return e[0]!==r||e[1]!==n||e[2]!==i?(c=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:r&&!n?t.jsx("img",{src:r,alt:i,className:"h-full w-full object-cover",loading:"lazy",onError:()=>l(!0)}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:i.charAt(0).toUpperCase()})}),e[0]=r,e[1]=n,e[2]=i,e[3]=c):c=e[3],c}function Fi({entry:s,onAuthChanged:e,failedToolsCount:r,failedResultCount:i}){const[n,l]=M.useState(!1),[c,o]=M.useState(""),[a,u]=M.useState(!1),d=ce(),m=Tr(),{updateMutation:f}=Ot(),{org:p}=be(),g=Te(),x=Ue(),h=s.mapping.connection_id,y=s.mapping.auth_status,N=s.item?.title??s.mapping.item_id,w=s.item?.server?.icons?.[0]?.src??null,_=s.item?.is_public??!1,b=s.item?.is_unlisted??!1,L=s.source==="request",I=Ae({queryKey:W.monitorConnectionAuthProbe(p.id,h),queryFn:async()=>wr({url:`/api/${p.slug}/mcp/${h}`,token:null,orgId:p.id}),staleTime:1e4,retry:1,refetchOnWindowFocus:!1}),P=I.data,R=I.isLoading,k=P?.supportsOAuth??!1,A=P?.hasOAuthToken??!1,q=P?.isServerError??!1,v=P?.isAuthenticated??!1,S=q?void 0:P?.error,D=R?"checking":q?"server_error":S?"unreachable":k?v?A?"oauth_connected":"connected":"oauth_available":v?"connected":"token_required",F=()=>{m.mutate({connectionId:h,authStatus:"authenticated"},{onSuccess:()=>{e(),Ks(h),x.invalidateQueries({predicate:B=>B.queryKey[1]===Hs&&B.queryKey[3]===h})},onError:B=>G.error(d("registry.monitorConnectionsPanel.failedToSaveAuthStatus",{title:N,error:B instanceof Error?B.message:String(B)}))})},T=async()=>{l(!0);try{const X=(await I.refetch()).data;if(!X){G.error(d("registry.monitorConnectionsPanel.couldNotReachConnection",{title:N}));return}if(X.isAuthenticated){G.success(d("registry.monitorConnectionsPanel.connectionReachable",{title:N}));return}if(X.isServerError){G.error(d("registry.monitorConnectionsPanel.serverErrorConnection",{title:N}));return}if(X.error){G.error(d("registry.monitorConnectionsPanel.connectionUnreachable",{title:N,error:X.error}));return}if(!X.supportsOAuth){G.warning(d("registry.monitorConnectionsPanel.noOAuthSupport",{title:N}));return}G.info(d("registry.monitorConnectionsPanel.openingAuthWindow",{title:N}));const J=await _r({connectionId:h,orgSlug:p.slug,clientName:`MCP Test - ${N}`,timeout:18e4,scope:"offline_access"});if(J.error){G.error(d("registry.monitorConnectionsPanel.oauthFailed",{title:N,error:J.error}));return}if(J.tokenInfo){if(!(await fetch(`/api/${p.slug}/connections/${h}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:J.tokenInfo.accessToken,refreshToken:J.tokenInfo.refreshToken,expiresIn:J.tokenInfo.expiresIn,scope:J.tokenInfo.scope,clientId:J.tokenInfo.clientId,clientSecret:J.tokenInfo.clientSecret,tokenEndpoint:J.tokenInfo.tokenEndpoint})})).ok)if(J.token)await U(J.token);else{G.error(d("registry.monitorConnectionsPanel.failedToSaveOAuthTokens",{title:N}));return}}else J.token&&await U(J.token);G.success(d("registry.monitorConnectionsPanel.connectionAuthenticated",{title:N})),F(),await I.refetch()}catch(B){console.error("[MonitorConnectionsPanel] Auth error:",B),G.error(d("registry.monitorConnectionsPanel.authError",{error:B instanceof Error?B.message:String(B)}))}finally{l(!1)}},U=async B=>{await g.call("COLLECTION_CONNECTIONS_UPDATE",{id:h,data:{connection_token:B}})},E=async()=>{if(!c.trim()){G.error(d("registry.monitorConnectionsPanel.tokenCannotBeEmpty"));return}l(!0);try{await U(c),G.success(d("registry.monitorConnectionsPanel.tokenSaved",{title:N})),u(!1),o(""),F(),await I.refetch()}catch(B){G.error(d("registry.monitorConnectionsPanel.errorSavingToken",{error:B instanceof Error?B.message:String(B)}))}finally{l(!1)}},O=!R&&y==="authenticated"&&!A&&!a&&c.length===0,j=R&&y==="authenticated"&&!a&&c.length===0,$=async B=>{if(L){G.info(d("registry.monitorConnectionsPanel.visibilityOnlyForStore"));return}if(!s.item){G.error(d("registry.monitorConnectionsPanel.registryItemNotFound"));return}try{await f.mutateAsync({id:s.item.id,data:B}),G.success(d("registry.monitorConnectionsPanel.visibilityUpdated")),e()}catch(X){G.error(X instanceof Error?X.message:d("registry.monitorConnectionsPanel.failedToUpdateVisibility"))}};return t.jsxs(me,{className:"p-3 space-y-3 h-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[t.jsx(Ui,{icon:w,title:N},w??N),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N}),t.jsx("p",{className:"text-xs text-muted-foreground break-all",children:s.remoteUrl??"-"}),t.jsxs("div",{className:"mt-1 flex items-center gap-1.5 flex-wrap",children:[t.jsx(V,{variant:"outline",className:te("text-[10px]",Li(y)),children:Ai(y,d)}),t.jsx(V,{variant:_?"default":"secondary",className:"text-[10px]",children:d(_?"registry.monitorConnectionsPanel.public":"registry.monitorConnectionsPanel.notPublic")}),t.jsx(V,{variant:"outline",className:"text-[10px]",children:d(L?"registry.monitorConnectionsPanel.request":"registry.monitorConnectionsPanel.store")}),t.jsxs(V,{variant:"outline",className:te("text-[10px]",D==="server_error"||D==="unreachable"?"border-destructive/40 text-destructive":D==="oauth_connected"?"border-success/30 text-success":D==="oauth_available"?"border-sky-500/30 text-sky-600":D==="token_required"?"border-warning/30 text-warning":"text-muted-foreground"),children:[D==="checking"&&d("registry.monitorConnectionsPanel.checkingAuth"),D==="server_error"&&d("registry.monitorConnectionsPanel.serverError"),D==="unreachable"&&d("registry.monitorConnectionsPanel.unreachable"),D==="oauth_connected"&&d("registry.monitorConnectionsPanel.oauthConnected"),D==="oauth_available"&&d("registry.monitorConnectionsPanel.oauthAvailable"),D==="token_required"&&d("registry.monitorConnectionsPanel.tokenManualAuth"),D==="connected"&&d("registry.monitorConnectionsPanel.connected")]}),b&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:d("registry.monitorConnectionsPanel.hiddenInPrivate")}),(i>0||r>0)&&t.jsx(V,{variant:"destructive",className:"text-[10px]",children:d("registry.monitorConnectionsPanel.failedCount",{mcpCount:i,toolsCount:r})})]})]})]}),t.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":d("registry.monitorConnectionsPanel.actionsFor",{title:N}),children:t.jsx($t,{size:16})})}),t.jsx(ht,{align:"end",children:L?t.jsx(Re,{disabled:!0,children:d("registry.monitorConnectionsPanel.requestItemNoControls")}):t.jsxs(t.Fragment,{children:[t.jsx(Re,{onClick:()=>$({is_public:!1}),children:d("registry.monitorConnectionsPanel.hideFromPublicStore")}),t.jsx(Re,{onClick:()=>$({is_unlisted:!0}),children:d("registry.monitorConnectionsPanel.hideFromPrivateStore")}),t.jsx(Re,{onClick:()=>$({is_public:!0,is_unlisted:!1}),children:d("registry.monitorConnectionsPanel.showInBothStores")})]})})]})})]}),t.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 flex-wrap",children:[k&&t.jsx(Y,{size:"sm",onClick:T,disabled:n,children:n?"...":d(A?"registry.monitorConnectionsPanel.reAuthOAuth":"registry.monitorConnectionsPanel.oauth")}),t.jsx(Y,{size:"sm",variant:"outline",onClick:()=>I.refetch(),disabled:n||R,children:d(R?"registry.monitorConnectionsPanel.checking":"registry.monitorConnectionsPanel.reCheck")})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:d("registry.monitorConnectionsPanel.tokenApiKeyDescription")}),j?t.jsx("div",{className:"h-8 px-3 flex items-center rounded-md border border-border bg-muted/30 text-muted-foreground text-xs",children:d("registry.monitorConnectionsPanel.checkingAuth")}):O?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-8 px-3 flex items-center rounded-md border border-border bg-muted/50 text-muted-foreground font-mono text-xs",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u(!0),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted",title:d("registry.monitorConnectionsPanel.replaceToken"),children:d("registry.monitorConnectionsPanel.edit")})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ye,{type:"password",placeholder:d("registry.monitorConnectionsPanel.pasteApiTokenPlaceholder"),value:c,onChange:B=>o(B.target.value),className:"h-8 text-xs flex-1",onKeyDown:B=>{B.key==="Enter"&&E()}}),t.jsx(Y,{size:"sm",className:"h-8 text-xs",onClick:E,disabled:n||!c.trim(),children:d("registry.monitorConnectionsPanel.save")}),t.jsx(Y,{size:"sm",variant:"ghost",className:"h-8 text-xs","aria-label":d("registry.monitorConnectionsPanel.cancelReplaceToken"),onClick:()=>{u(!1),o("")},children:"✕"})]})]})]})}function $i(){const s=Z.c(87),e=ce(),r=hs(),n=Pt("completed").data?.items?.[0],l=ut(n?.id,void 0,n?.status),c=Dr(),[o,a]=M.useState("all");let u,d,m,f,p,g;if(s[0]!==r||s[1]!==l.data?.items||s[2]!==o||s[3]!==c||s[4]!==e){const y=r.data?.items??[];let N;s[11]!==l.data?.items?(N=(l.data?.items??[]).reduce(zi,{}),s[11]=l.data?.items,s[12]=N):N=s[12];const w=N;let _;s[13]!==o?(_=H=>o==="all"?!0:H.source===o,s[13]=o,s[14]=_):_=s[14];const b=y.filter(_);u=me,p="p-4 space-y-3";let L;s[15]!==e?(L=e("registry.monitorConnectionsPanel.title"),s[15]=e,s[16]=L):L=s[16];let I;s[17]!==L?(I=t.jsx("h3",{className:"text-sm font-semibold",children:L}),s[17]=L,s[18]=I):I=s[18];let P;s[19]!==e?(P=e("registry.monitorConnectionsPanel.description1"),s[19]=e,s[20]=P):P=s[20];let R;s[21]!==P?(R=t.jsx("p",{className:"text-[10px] text-muted-foreground",children:P}),s[21]=P,s[22]=R):R=s[22];let k;s[23]!==e?(k=e("registry.monitorConnectionsPanel.description2"),s[23]=e,s[24]=k):k=s[24];let A;s[25]!==k?(A=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:k}),s[25]=k,s[26]=A):A=s[26];let q;s[27]!==e?(q=e("registry.monitorConnectionsPanel.description3"),s[27]=e,s[28]=q):q=s[28];let v;s[29]!==q?(v=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:q}),s[29]=q,s[30]=v):v=s[30];const S=o==="all"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let D;s[31]!==S?(D=te("px-2.5 py-1 text-xs rounded-md transition-colors",S),s[31]=S,s[32]=D):D=s[32];let F;s[33]===Symbol.for("react.memo_cache_sentinel")?(F=()=>a("all"),s[33]=F):F=s[33];let T;s[34]!==e?(T=e("registry.monitorConnectionsPanel.filterAll"),s[34]=e,s[35]=T):T=s[35];let U;s[36]!==D||s[37]!==T?(U=t.jsx("button",{type:"button",className:D,onClick:F,children:T}),s[36]=D,s[37]=T,s[38]=U):U=s[38];const E=o==="store"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let O;s[39]!==E?(O=te("px-2.5 py-1 text-xs rounded-md transition-colors",E),s[39]=E,s[40]=O):O=s[40];let j;s[41]===Symbol.for("react.memo_cache_sentinel")?(j=()=>a("store"),s[41]=j):j=s[41];let $;s[42]!==e?($=e("registry.monitorConnectionsPanel.filterStore"),s[42]=e,s[43]=$):$=s[43];let B;s[44]!==O||s[45]!==$?(B=t.jsx("button",{type:"button",className:O,onClick:j,children:$}),s[44]=O,s[45]=$,s[46]=B):B=s[46];const X=o==="request"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let J;s[47]!==X?(J=te("px-2.5 py-1 text-xs rounded-md transition-colors",X),s[47]=X,s[48]=J):J=s[48];let de;s[49]===Symbol.for("react.memo_cache_sentinel")?(de=()=>a("request"),s[49]=de):de=s[49];let se;s[50]!==e?(se=e("registry.monitorConnectionsPanel.filterRequests"),s[50]=e,s[51]=se):se=s[51];let ne;s[52]!==J||s[53]!==se?(ne=t.jsx("button",{type:"button",className:J,onClick:de,children:se}),s[52]=J,s[53]=se,s[54]=ne):ne=s[54];let ge;s[55]!==U||s[56]!==B||s[57]!==ne?(ge=t.jsxs("div",{className:"mt-2 inline-flex rounded-lg border border-border p-0.5",children:[U,B,ne]}),s[55]=U,s[56]=B,s[57]=ne,s[58]=ge):ge=s[58];let ue;s[59]!==R||s[60]!==A||s[61]!==v||s[62]!==ge||s[63]!==I?(ue=t.jsxs("div",{children:[I,R,A,v,ge]}),s[59]=R,s[60]=A,s[61]=v,s[62]=ge,s[63]=I,s[64]=ue):ue=s[64];let ie;s[65]!==c||s[66]!==e?(ie=()=>{c.mutate(void 0,{onSuccess:()=>G.success(e("registry.monitorConnectionsPanel.connectionsSynced")),onError:H=>G.error(e("registry.monitorConnectionsPanel.syncFailed",{error:H.message}))})},s[65]=c,s[66]=e,s[67]=ie):ie=s[67];let C;s[68]!==c.isPending||s[69]!==e?(C=c.isPending?e("registry.monitorConnectionsPanel.syncing"):e("registry.monitorConnectionsPanel.sync"),s[68]=c.isPending,s[69]=e,s[70]=C):C=s[70];let K;s[71]!==c.isPending||s[72]!==ie||s[73]!==C?(K=t.jsx(Y,{size:"sm",variant:"outline",onClick:ie,disabled:c.isPending,children:C}),s[71]=c.isPending,s[72]=ie,s[73]=C,s[74]=K):K=s[74],s[75]!==ue||s[76]!==K?(g=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ue,K]}),s[75]=ue,s[76]=K,s[77]=g):g=s[77],d="space-y-2",m=r.isLoading?t.jsx("p",{className:"text-xs text-muted-foreground text-center py-3",children:e("registry.monitorConnectionsPanel.loadingConnections")}):r.isError?t.jsxs("div",{className:"p-8 text-center rounded-lg border border-border",children:[t.jsx("p",{className:"text-sm text-destructive",children:e("registry.monitorConnectionsPanel.loadFailed")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r.error instanceof Error?r.error.message:e("registry.monitorConnectionsPanel.unknownError")})]}):b.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-3",children:e("registry.monitorConnectionsPanel.noConnectionsForFilter")}),f=!r.isLoading&&!r.isError&&b.length>0&&t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:b.map(H=>{const re=w[H.mapping.item_id]??{failedTools:0,failedResults:0};return t.jsx(Fi,{entry:H,onAuthChanged:()=>r.refetch(),failedToolsCount:re.failedTools,failedResultCount:re.failedResults},H.mapping.id)})}),s[0]=r,s[1]=l.data?.items,s[2]=o,s[3]=c,s[4]=e,s[5]=u,s[6]=d,s[7]=m,s[8]=f,s[9]=p,s[10]=g}else u=s[5],d=s[6],m=s[7],f=s[8],p=s[9],g=s[10];let x;s[78]!==d||s[79]!==m||s[80]!==f?(x=t.jsxs("div",{className:d,children:[m,f]}),s[78]=d,s[79]=m,s[80]=f,s[81]=x):x=s[81];let h;return s[82]!==u||s[83]!==p||s[84]!==g||s[85]!==x?(h=t.jsxs(u,{className:p,children:[g,x]}),s[82]=u,s[83]=p,s[84]=g,s[85]=x,s[86]=h):h=s[86],h}function zi(s,e){const r=s[e.item_id]??{failedTools:0,failedResults:0},i=e.tool_results.filter(Oi).length;return r.failedTools=r.failedTools+i,(e.status==="failed"||e.status==="error")&&(r.failedResults=r.failedResults+1),s[e.item_id]=r,s}function Oi(s){return!s.success}function ws(s){switch(s){case"running":return"bg-primary/10 text-primary border-primary/20";case"completed":return"bg-success/10 text-success border-success/20";case"failed":return"bg-destructive/10 text-destructive border-destructive/20";case"cancelled":return"bg-muted text-muted-foreground border-border";case"pending":return"bg-warning/10 text-warning border-warning/20";default:return""}}function _s(s,e){if(!s)return null;const r=e?new Date(e).getTime():Date.now(),i=new Date(s).getTime(),n=r-i;return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.round(n%6e4/1e3)}s`}function Bi(s){const e=new Map;for(const r of s)e.has(r.toolName)&&e.delete(r.toolName),e.set(r.toolName,r);return Array.from(e.values())}function Ps(s){const e=Bi(s),r=e.every(c=>c.outputPreview==="health_check: not called"),i=e.filter(c=>c.outputPreview!=="health_check: not called"),n=i.filter(c=>c.success).length,l=i.filter(c=>!c.success).length;return{latestToolResults:e,realToolTests:i,isHealthCheck:r,passedTools:n,failedTools:l,hasToolTests:i.length>0}}function Ki(s){return s.total_items?Math.min(100,Math.round(s.tested_items/s.total_items*100)):0}function Hi(s){if(!s)return null;const e=s.match(/Not executed tools \((\d+)\/(\d+)\):/i);if(!e)return null;const r=Number(e[2]);return Number.isFinite(r)&&r>=0?r:null}function Vi(s){const e=Z.c(45),{result:r,index:i,icon:n}=s,l=ce(),[c,o]=M.useState(!1);let a;if(e[0]!==c||e[1]!==n||e[2]!==i||e[3]!==r.action_taken||e[4]!==r.agent_summary||e[5]!==r.connection_ok||e[6]!==r.duration_ms||e[7]!==r.error_message||e[8]!==r.id||e[9]!==r.item_title||e[10]!==r.status||e[11]!==r.tool_results||e[12]!==r.tools_listed||e[13]!==l){const{latestToolResults:u,realToolTests:d,isHealthCheck:m,passedTools:f,failedTools:p,hasToolTests:g}=Ps(r.tool_results),x=d.length;let h;e[15]!==r.agent_summary?(h=Hi(r.agent_summary),e[15]=r.agent_summary,e[16]=h):h=e[16];const y=h,N=Math.max(u.length,y??0),w=N>0?l("registry.monitorDashboard.toolsTestedCount",{tested:x,discovered:N}):l("registry.monitorDashboard.noTools");let _;e[17]!==c?(_=()=>o(!c),e[17]=c,e[18]=_):_=e[18];const b=i+1;let L;e[19]!==b?(L=t.jsx("span",{className:"text-muted-foreground w-5 text-right shrink-0",children:b}),e[19]=b,e[20]=L):L=e[20];let I;e[21]!==n||e[22]!==r.item_title?(I=t.jsx("div",{className:"size-5 rounded border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:n?t.jsx("img",{src:n,alt:r.item_title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[9px] font-semibold text-muted-foreground",children:r.item_title.charAt(0).toUpperCase()})}),e[21]=n,e[22]=r.item_title,e[23]=I):I=e[23];const P=r.status==="passed"?"text-success":r.status==="needs_auth"?"text-warning":"text-destructive";let R;e[24]!==P?(R=te("shrink-0",P),e[24]=P,e[25]=R):R=e[25];const k=r.status==="passed"?"✓":r.status==="needs_auth"?"🔑":"✗";let A;e[26]!==R||e[27]!==k?(A=t.jsx("span",{className:R,children:k}),e[26]=R,e[27]=k,e[28]=A):A=e[28];let q;e[29]!==r.item_title?(q=t.jsx("span",{className:"font-medium truncate flex-1 min-w-0",children:r.item_title}),e[29]=r.item_title,e[30]=q):q=e[30];let v;e[31]!==r.duration_ms?(v=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.duration_ms,"ms"]}),e[31]=r.duration_ms,e[32]=v):v=e[32];const S=r.status==="passed"?"text-success border-success/20":r.status==="needs_auth"?"text-warning border-warning/20":"text-destructive border-destructive/20";let D;e[33]!==S?(D=te("text-[9px] capitalize shrink-0",S),e[33]=S,e[34]=D):D=e[34];let F;e[35]!==r.status?(F=r.status.replace("_"," "),e[35]=r.status,e[36]=F):F=e[36];let T;e[37]!==D||e[38]!==F?(T=t.jsx(V,{variant:"outline",className:D,children:F}),e[37]=D,e[38]=F,e[39]=T):T=e[39];let U;e[40]!==r.connection_ok||e[41]!==l?(U=r.connection_ok?t.jsx("span",{className:"text-[10px] text-success shrink-0",title:l("registry.monitorDashboard.connOkTitle"),children:"conn✓"}):t.jsx("span",{className:"text-[10px] text-destructive shrink-0",title:l("registry.monitorDashboard.connFailTitle"),children:"conn✗"}),e[40]=r.connection_ok,e[41]=l,e[42]=U):U=e[42];const E=c?"▲":"▼";let O;e[43]!==E?(O=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:E}),e[43]=E,e[44]=O):O=e[44],a=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[t.jsxs("button",{type:"button",className:"w-full text-left flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-muted/30 transition-colors",onClick:_,children:[L,I,A,q,v,T,U,r.tools_listed&&t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:g?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-success",children:[f,"✓"]})," ",t.jsxs("span",{className:te(p>0?"text-destructive":""),children:[p,"✗"]})]}):m&&u.length>0?t.jsx("span",{children:l("registry.monitorDashboard.toolsFoundCount",{count:u.length})}):l("registry.monitorDashboard.noToolsLabel")}),t.jsx(V,{variant:"outline",className:"text-[9px] shrink-0",children:w}),O]}),c&&t.jsxs("div",{className:"border-t border-border px-3 py-2 space-y-2 bg-muted/10",children:[r.error_message&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:l("registry.monitorDashboard.errorLabel")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-destructive max-h-20 overflow-auto",children:r.error_message})]}),t.jsxs("div",{className:"flex items-center gap-3 text-[10px] flex-wrap",children:[t.jsxs("span",{children:[l("registry.monitorDashboard.connectionLabel")," ",t.jsx("span",{className:te(r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?l("registry.monitorDashboard.statusOk"):l("registry.monitorDashboard.statusFailed")})]}),t.jsxs("span",{children:[l("registry.monitorDashboard.toolsListedLabel")," ",t.jsx("span",{className:te(r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?l("registry.monitorDashboard.yes"):l("registry.monitorDashboard.no")})]}),r.action_taken!=="none"&&t.jsxs(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]})]}),g?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:l("registry.monitorDashboard.toolsTestedDetails",{passed:f,failed:p})}),t.jsx("div",{className:"space-y-0.5",children:d.map((j,$)=>t.jsx(Gi,{tool:j},`${r.id}-${j.toolName}-${$}`))})]}):m&&u.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:l("registry.monitorDashboard.toolsDiscoveredHealthCheck",{count:u.length})}),t.jsx("div",{className:"flex flex-wrap gap-1",children:u.map((j,$)=>t.jsx(V,{variant:"outline",className:"text-[10px] font-mono",children:j.toolName},`${r.id}-${j.toolName}-${$}`))})]}):r.tools_listed?t.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:l("registry.monitorDashboard.noToolsFound")}):null,r.agent_summary&&t.jsx("p",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5",children:r.agent_summary})]})]}),e[0]=c,e[1]=n,e[2]=i,e[3]=r.action_taken,e[4]=r.agent_summary,e[5]=r.connection_ok,e[6]=r.duration_ms,e[7]=r.error_message,e[8]=r.id,e[9]=r.item_title,e[10]=r.status,e[11]=r.tool_results,e[12]=r.tools_listed,e[13]=l,e[14]=a}else a=e[14];return a}function Gi(s){const e=Z.c(31),{tool:r}=s,i=ce(),[n,l]=M.useState(!1);let c;e[0]!==n?(c=()=>l(!n),e[0]=n,e[1]=c):c=e[1];const o=r.success?"text-success":"text-destructive";let a;e[2]!==o?(a=te("font-bold",o),e[2]=o,e[3]=a):a=e[3];const u=r.success?"✓":"✗";let d;e[4]!==a||e[5]!==u?(d=t.jsx("span",{className:a,children:u}),e[4]=a,e[5]=u,e[6]=d):d=e[6];let m;e[7]!==r.toolName?(m=t.jsx("span",{className:"font-mono truncate flex-1",children:r.toolName}),e[7]=r.toolName,e[8]=m):m=e[8];let f;e[9]!==r.durationMs?(f=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=f):f=e[10];let p;e[11]!==r.error?(p=r.error&&t.jsx("span",{className:"text-destructive truncate max-w-28",title:r.error,children:r.error}),e[11]=r.error,e[12]=p):p=e[12];const g=n?"▲":"▼";let x;e[13]!==g?(x=t.jsx("span",{className:"text-muted-foreground",children:g}),e[13]=g,e[14]=x):x=e[14];let h;e[15]!==c||e[16]!==x||e[17]!==d||e[18]!==m||e[19]!==f||e[20]!==p?(h=t.jsxs("button",{type:"button",className:"w-full text-left flex items-center gap-2 px-2 py-1 text-[11px] hover:bg-muted/30 transition-colors",onClick:c,children:[d,m,f,p,x]}),e[15]=c,e[16]=x,e[17]=d,e[18]=m,e[19]=f,e[20]=p,e[21]=h):h=e[21];let y;e[22]!==n||e[23]!==i||e[24]!==r.error||e[25]!==r.input||e[26]!==r.outputPreview?(y=n&&t.jsxs("div",{className:"border-t border-border px-2 py-1.5 space-y-1 bg-muted/10 text-[11px]",children:[r.error&&t.jsx("pre",{className:"bg-destructive/5 border border-destructive/10 rounded px-2 py-1 whitespace-pre-wrap break-all text-destructive max-h-20 overflow-auto",children:r.error}),r.input&&Object.keys(r.input).length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorDashboard.inputLabel")}),t.jsx("pre",{className:"bg-muted/50 rounded px-2 py-1 whitespace-pre-wrap break-all max-h-16 overflow-auto",children:JSON.stringify(r.input,null,2)})]}),r.outputPreview&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorDashboard.outputLabel")}),t.jsx("pre",{className:"bg-muted/50 rounded px-2 py-1 whitespace-pre-wrap break-all max-h-16 overflow-auto",children:r.outputPreview})]})]}),e[22]=n,e[23]=i,e[24]=r.error,e[25]=r.input,e[26]=r.outputPreview,e[27]=y):y=e[27];let N;return e[28]!==h||e[29]!==y?(N=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[h,y]}),e[28]=h,e[29]=y,e[30]=N):N=e[30],N}function Qi({activeRunId:s,onRunChange:e}){const r=ce(),{settings:i}=fs(),[n,l]=M.useState(null),[c,o]=M.useState(!1),a=M.useRef(0),u=M.useRef(null),d=Ir(),m=kr(),f=zt(s),p=Pt(),g=hs(),x=f.data?.run??null,h=x?.status,y=x?.config_snapshot?.monitorMode??x?.config_snapshot?.testMode,N=ut(s,void 0,h),w=(p.data?.items??[]).find(v=>v.status==="running"),_=p.data?.items?.[0]?.id;!s&&_&&u.current!==_&&(u.current=_,queueMicrotask(()=>{e(_)}));const b=async()=>{const v=Date.now();if(v-a.current<1e3)return;a.current=v;const S=n??i.monitorMode,D=await d.mutateAsync({...i,monitorMode:S});e(D.run.id)},L=async()=>{if(w&&w.id!==s&&w.status==="running"){o(!0);return}await b()},I=async()=>{s&&await m.mutateAsync(s)},P=x?.status==="running",R=x?_s(x.started_at,x.finished_at):null,k=N.data?.items??[],A=(g.data?.items??[]).reduce((v,S)=>(v[S.mapping.item_id]=S.item?.server?.icons?.[0]?.src??null,v),{}),q=n??i.monitorMode;return t.jsxs("div",{className:"space-y-4 min-w-0",children:[t.jsxs("div",{className:"space-y-4 min-w-0",children:[t.jsxs(me,{className:"p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:r("registry.monitorDashboard.currentQaRunTitle")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.currentQaRunDescription")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[w&&w.id!==s&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.runInProgressBadge",{runId:w.id.slice(0,8)})}),t.jsxs(Y,{size:"sm",onClick:L,disabled:d.isPending||P,className:"gap-1.5",children:[t.jsx(Pr,{size:14}),d.isPending?r("registry.monitorDashboard.startingButton"):w&&w.id!==s?r("registry.monitorDashboard.startAnotherRunButton"):r("registry.monitorDashboard.startQaRunButton")]}),t.jsxs(Y,{size:"sm",variant:"outline",onClick:I,disabled:!s||!P,className:"gap-1.5",children:[t.jsx(Gs,{size:14}),r("registry.monitorDashboard.cancelButton")]})]})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:r("registry.monitorDashboard.qaModeLabel")}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:q,onChange:v=>l(v.target.value),disabled:P,children:[t.jsx("option",{value:"health_check",children:r("registry.monitorDashboard.modeHealthCheck")}),t.jsx("option",{value:"tool_call",children:r("registry.monitorDashboard.modeToolCall")}),t.jsx("option",{value:"full_agent",children:r("registry.monitorDashboard.modeAgentic")})]})]}),t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:r("registry.monitorDashboard.qaRunHistoryLabel")}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:s??"",onChange:v=>e(v.target.value||void 0),children:[t.jsx("option",{value:"",children:r("registry.monitorDashboard.autoSelectLatestRun")}),(p.data?.items??[]).map(v=>t.jsxs("option",{value:v.id,children:[new Date(v.created_at).toLocaleString()," -"," ",v.status]},v.id))]})]})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground rounded-md bg-muted/30 px-2.5 py-2",children:r(q==="health_check"?"registry.monitorDashboard.modeDescriptionHealthCheck":q==="tool_call"?"registry.monitorDashboard.modeDescriptionToolCall":"registry.monitorDashboard.modeDescriptionAgentic")}),x?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx(V,{className:te("capitalize",ws(x.status),x.status==="running"?"animate-pulse":""),children:x.status}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.itemsTestedCount",{tested:x.tested_items,total:x.total_items})}),R&&t.jsx("span",{className:"text-xs text-muted-foreground",children:R}),P&&x.current_item_id&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-64",children:[r("registry.monitorDashboard.qaOnLabel")," ",t.jsx("span",{className:"font-mono",children:x.current_item_id})]})]}),t.jsx("div",{className:"h-2.5 rounded-full bg-muted overflow-hidden",children:t.jsx("div",{className:te("h-full transition-all duration-500",x.failed_items>0?"bg-warning":"bg-success",P?"animate-pulse":""),style:{width:`${Ki(x)}%`}})}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-success",children:r("registry.monitorDashboard.passedLabel")}),t.jsx("p",{className:"text-lg font-bold text-success",children:x.passed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-destructive",children:r("registry.monitorDashboard.failedLabel")}),t.jsx("p",{className:"text-lg font-bold text-destructive",children:x.failed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:r("registry.monitorDashboard.skippedLabel")}),t.jsx("p",{className:"text-lg font-bold",children:x.skipped_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:r("registry.monitorDashboard.totalLabel")}),t.jsx("p",{className:"text-lg font-bold",children:x.total_items})]})]})]}):t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.noRunSelectedMessage")})]}),t.jsxs(me,{className:"p-4 space-y-2 min-h-[360px]",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:r("registry.monitorDashboard.qaResultsLogTitle",{count:k.length})}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:r("registry.monitorDashboard.qaResultsLogDescription")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[P&&t.jsx(V,{className:"bg-primary/10 text-primary border-primary/20 animate-pulse",children:r("registry.monitorDashboard.runInProgressLabel")}),x&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.progressBadge",{tested:x.tested_items,total:x.total_items})}),y&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.modeBadge",{mode:y.replace("_"," ")})})]})]}),k.length===0?t.jsx("div",{className:"h-[280px] rounded border border-dashed border-border flex items-center justify-center text-xs text-muted-foreground",children:r("registry.monitorDashboard.noResultsYetMessage")}):t.jsx("div",{ref:v=>{v&&P&&v.scrollHeight-v.scrollTop-v.clientHeight<120&&requestAnimationFrame(()=>{v.scrollTop=v.scrollHeight})},className:"space-y-1 max-h-[60vh] overflow-auto pr-1",children:k.map((v,S)=>t.jsx(Vi,{result:v,index:S,icon:A[v.item_id]},v.id))})]})]}),t.jsx(ct,{open:c,onOpenChange:o,children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:r("registry.monitorDashboard.confirmStartTitle")}),t.jsx(rt,{children:r("registry.monitorDashboard.confirmStartDescription",{runId:w?` (${w.id})`:""})})]}),t.jsxs(ot,{children:[t.jsx(nt,{children:r("registry.monitorDashboard.cancelButtonDialog")}),t.jsx(at,{onClick:()=>{o(!1),b()},children:r("registry.monitorDashboard.startAnywayButton")})]})]})})]})}function Rs(s){switch(s){case"passed":return"bg-success/10 text-success border-success/20";case"failed":case"error":return"bg-destructive/10 text-destructive border-destructive/20";case"needs_auth":return"bg-warning/10 text-warning border-warning/20";case"skipped":return"bg-muted text-muted-foreground border-border";default:return""}}function Yi(s){switch(s){case"passed":return"✓";case"failed":return"✗";case"error":return"⚠";case"needs_auth":return"🔑";case"skipped":return"⏭";default:return"?"}}function Wi(s){const e=Z.c(28),{tool:r}=s,i=ce(),[n,l]=M.useState(!1);let c;e[0]!==n?(c=()=>l(!n),e[0]=n,e[1]=c):c=e[1];const o=r.success?"text-success":"text-destructive";let a;e[2]!==o?(a=te("text-xs font-bold",o),e[2]=o,e[3]=a):a=e[3];const u=r.success?"✓":"✗";let d;e[4]!==a||e[5]!==u?(d=t.jsx("span",{className:a,children:u}),e[4]=a,e[5]=u,e[6]=d):d=e[6];let m;e[7]!==r.toolName?(m=t.jsx("span",{className:"text-xs font-mono truncate flex-1",children:r.toolName}),e[7]=r.toolName,e[8]=m):m=e[8];let f;e[9]!==r.durationMs?(f=t.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=f):f=e[10];const p=n?"▲":"▼";let g;e[11]!==p?(g=t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p}),e[11]=p,e[12]=g):g=e[12];let x;e[13]!==c||e[14]!==d||e[15]!==m||e[16]!==f||e[17]!==g?(x=t.jsxs("button",{type:"button",className:"w-full text-left px-3 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",onClick:c,children:[d,m,f,g]}),e[13]=c,e[14]=d,e[15]=m,e[16]=f,e[17]=g,e[18]=x):x=e[18];let h;e[19]!==n||e[20]!==i||e[21]!==r.error||e[22]!==r.input||e[23]!==r.outputPreview?(h=n&&t.jsxs("div",{className:"border-t border-border px-3 py-2 space-y-1.5 bg-muted/20",children:[r.error&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.monitorRunDetail.error")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-destructive",children:r.error})]}),r.input&&Object.keys(r.input).length>0&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.input")}),t.jsx("pre",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5 whitespace-pre-wrap break-all max-h-24 overflow-auto",children:JSON.stringify(r.input,null,2)})]}),r.outputPreview&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.outputPreview")}),t.jsx("pre",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5 whitespace-pre-wrap break-all max-h-24 overflow-auto",children:r.outputPreview})]}),!r.error&&!r.outputPreview&&(!r.input||Object.keys(r.input).length===0)&&t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.noAdditionalDetails")})]}),e[19]=n,e[20]=i,e[21]=r.error,e[22]=r.input,e[23]=r.outputPreview,e[24]=h):h=e[24];let y;return e[25]!==x||e[26]!==h?(y=t.jsxs("div",{className:"rounded border border-border",children:[x,h]}),e[25]=x,e[26]=h,e[27]=y):y=e[27],y}function Ji(s){const e=Z.c(60),{result:r}=s,i=ce(),[n,l]=M.useState(r.status!=="passed");let c;if(e[0]!==n||e[1]!==r.action_taken||e[2]!==r.agent_summary||e[3]!==r.connection_ok||e[4]!==r.duration_ms||e[5]!==r.error_message||e[6]!==r.id||e[7]!==r.item_title||e[8]!==r.status||e[9]!==r.tool_results||e[10]!==r.tools_listed||e[11]!==i){const{latestToolResults:o,realToolTests:a,isHealthCheck:u,passedTools:d,failedTools:m,hasToolTests:f}=Ps(r.tool_results);let p;e[13]!==n?(p=()=>l(!n),e[13]=n,e[14]=p):p=e[14];let g;e[15]!==r.status?(g=Yi(r.status),e[15]=r.status,e[16]=g):g=e[16];let x;e[17]!==g?(x=t.jsx("span",{className:"text-base shrink-0",children:g}),e[17]=g,e[18]=x):x=e[18];let h;e[19]!==r.item_title?(h=t.jsx("p",{className:"text-sm font-medium truncate",children:r.item_title}),e[19]=r.item_title,e[20]=h):h=e[20];let y;e[21]!==r.duration_ms?(y=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[r.duration_ms,"ms"]}),e[21]=r.duration_ms,e[22]=y):y=e[22];let N;e[23]!==i?(N=i("registry.monitorRunDetail.conn"),e[23]=i,e[24]=N):N=e[24];const w=r.connection_ok?"✓":"✗";let _;e[25]!==N||e[26]!==w?(_=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[N,":"," ",w]}),e[25]=N,e[26]=w,e[27]=_):_=e[27];let b;e[28]!==i?(b=i("registry.monitorRunDetail.toolsListed"),e[28]=i,e[29]=b):b=e[29];const L=r.tools_listed?"✓":"✗";let I;e[30]!==b||e[31]!==L?(I=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[b,":"," ",L]}),e[30]=b,e[31]=L,e[32]=I):I=e[32];const P=o.length>0&&t.jsx("span",{className:"text-[10px] text-muted-foreground",children:f?t.jsxs(t.Fragment,{children:[i("registry.monitorRunDetail.tools"),": ",d,"✓"," ",m,"✗"]}):t.jsxs(t.Fragment,{children:[o.length," ",i("registry.monitorRunDetail.toolsFound")]})});let R;e[33]!==r.action_taken||e[34]!==i?(R=r.action_taken!=="none"&&t.jsxs(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:[i("registry.monitorRunDetail.action"),": ",r.action_taken]}),e[33]=r.action_taken,e[34]=i,e[35]=R):R=e[35];let k;e[36]!==I||e[37]!==P||e[38]!==R||e[39]!==y||e[40]!==_?(k=t.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[y,_,I,P,R]}),e[36]=I,e[37]=P,e[38]=R,e[39]=y,e[40]=_,e[41]=k):k=e[41];let A;e[42]!==k||e[43]!==h?(A=t.jsxs("div",{className:"min-w-0 flex-1",children:[h,k]}),e[42]=k,e[43]=h,e[44]=A):A=e[44];let q;e[45]!==r.status?(q=te("capitalize shrink-0",Rs(r.status)),e[45]=r.status,e[46]=q):q=e[46];let v;e[47]!==r.status?(v=r.status.replace("_"," "),e[47]=r.status,e[48]=v):v=e[48];let S;e[49]!==q||e[50]!==v?(S=t.jsx(V,{className:q,children:v}),e[49]=q,e[50]=v,e[51]=S):S=e[51];const D=n?"▲":"▼";let F;e[52]!==D?(F=t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:D}),e[52]=D,e[53]=F):F=e[53];let T;e[54]!==A||e[55]!==S||e[56]!==p||e[57]!==F||e[58]!==x?(T=t.jsxs("button",{type:"button",className:"w-full text-left px-4 py-3 flex items-center gap-3 hover:bg-muted/30 transition-colors",onClick:p,children:[x,A,S,F]}),e[54]=A,e[55]=S,e[56]=p,e[57]=F,e[58]=x,e[59]=T):T=e[59],c=t.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[T,n&&t.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-2 bg-muted/10",children:[t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.connection")}),t.jsx("p",{className:te("text-xs font-medium",r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?i("registry.monitorRunDetail.connected"):i("registry.monitorRunDetail.failed")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.toolsListedLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?i("registry.monitorRunDetail.yesWithCount",{count:o.length}):i("registry.monitorRunDetail.no")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.duration")}),t.jsxs("p",{className:"text-xs font-medium",children:[r.duration_ms,"ms"]})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.actionTaken")}),t.jsx("p",{className:"text-xs font-medium capitalize",children:r.action_taken.replace(/_/g," ")})]})]}),r.error_message&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.monitorRunDetail.errorMessage")}),t.jsx("pre",{className:"text-xs bg-destructive/5 border border-destructive/10 rounded px-3 py-2 whitespace-pre-wrap break-all text-destructive",children:r.error_message})]}),f?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.toolResults",{passed:d,failed:m})}),t.jsx("div",{className:"space-y-1",children:a.map((U,E)=>t.jsx(Wi,{tool:U},`${r.id}-${U.toolName}-${E}`))})]}):u&&o.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.toolsDiscovered",{count:o.length})}),t.jsx("div",{className:"flex flex-wrap gap-1",children:o.map((U,E)=>t.jsx(V,{variant:"outline",className:"text-[10px] font-mono",children:U.toolName},`${r.id}-${U.toolName}-${E}`))})]}):null,r.agent_summary&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.agentSummary")}),t.jsx("p",{className:"text-xs bg-muted/50 rounded px-3 py-2",children:r.agent_summary})]})]})]}),e[0]=n,e[1]=r.action_taken,e[2]=r.agent_summary,e[3]=r.connection_ok,e[4]=r.duration_ms,e[5]=r.error_message,e[6]=r.id,e[7]=r.item_title,e[8]=r.status,e[9]=r.tool_results,e[10]=r.tools_listed,e[11]=i,e[12]=c}else c=e[12];return c}function Zi(s){const e=Z.c(4),{value:r,onChange:i}=s,n=ce();let l;if(e[0]!==i||e[1]!==n||e[2]!==r){const c=[{value:"all",labelKey:"registry.monitorRunDetail.filterAll"},{value:"passed",labelKey:"registry.monitorRunDetail.filterPassed"},{value:"failed",labelKey:"registry.monitorRunDetail.filterFailed"},{value:"error",labelKey:"registry.monitorRunDetail.filterError"},{value:"needs_auth",labelKey:"registry.monitorRunDetail.filterNeedsAuth"},{value:"skipped",labelKey:"registry.monitorRunDetail.filterSkipped"}];l=t.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:c.map(o=>t.jsx("button",{type:"button",className:te("text-[11px] px-2 py-0.5 rounded-full border transition-colors",r===o.value?"bg-primary text-primary-foreground border-primary":"bg-muted/30 border-border hover:bg-muted/50"),onClick:()=>i(o.value),children:n(o.labelKey)},o.value))}),e[0]=i,e[1]=n,e[2]=r,e[3]=l}else l=e[3];return l}function Xi(s){const e=Z.c(81),{runId:r}=s,i=ce(),[n,l]=M.useState("all"),c=zt(r),o=c.data?.run,a=ut(r,void 0,o?.status);let u,d,m,f,p,g,x,h,y,N,w,_,b;if(e[0]!==a||e[1]!==o||e[2]!==r||e[3]!==c||e[4]!==n||e[5]!==i){p=Symbol.for("react.early_return_sentinel");e:{if(u=a.data?.items??[],d=n==="all"?u:u.filter(j=>j.status===n),!r){let j;e[19]!==i?(j=i("registry.monitorRunDetail.selectRunToInspect"),e[19]=i,e[20]=j):j=e[20];let $;e[21]!==j?($=t.jsx(me,{className:"p-6 text-center space-y-2",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:j})}),e[21]=j,e[22]=$):$=e[22],p=$;break e}w="space-y-3";let q;e[23]!==i?(q=i("registry.monitorRunDetail.runDetail"),e[23]=i,e[24]=q):q=e[24];let v;e[25]!==q?(v=t.jsx("h3",{className:"text-sm font-semibold",children:q}),e[25]=q,e[26]=v):v=e[26];let S;e[27]!==r?(S=t.jsx("p",{className:"text-[10px] text-muted-foreground font-mono",children:r}),e[27]=r,e[28]=S):S=e[28];let D;e[29]!==v||e[30]!==S?(D=t.jsxs("div",{children:[v,S]}),e[29]=v,e[30]=S,e[31]=D):D=e[31];let F;e[32]!==o?(F=o&&t.jsx(V,{className:te("capitalize",Rs(o.status)),children:o.status}),e[32]=o,e[33]=F):F=e[33];let T;e[34]!==a||e[35]!==c?(T=()=>{c.refetch(),a.refetch()},e[34]=a,e[35]=c,e[36]=T):T=e[36];let U;e[37]!==i?(U=i("registry.monitorRunDetail.refresh"),e[37]=i,e[38]=U):U=e[38];let E;e[39]!==T||e[40]!==U?(E=t.jsx(Y,{size:"sm",variant:"outline",onClick:T,children:U}),e[39]=T,e[40]=U,e[41]=E):E=e[41];let O;e[42]!==F||e[43]!==E?(O=t.jsxs("div",{className:"flex items-center gap-2",children:[F,E]}),e[42]=F,e[43]=E,e[44]=O):O=e[44],e[45]!==D||e[46]!==O?(_=t.jsx(me,{className:"p-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[D,O]})}),e[45]=D,e[46]=O,e[47]=_):_=e[47],e[48]!==o||e[49]!==i?(b=o&&t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.total")}),t.jsx("p",{className:"text-lg font-bold",children:o.total_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.tested")}),t.jsx("p",{className:"text-lg font-bold",children:o.tested_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-success",children:i("registry.monitorRunDetail.passed")}),t.jsx("p",{className:"text-lg font-bold text-success",children:o.passed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-destructive",children:i("registry.monitorRunDetail.failed")}),t.jsx("p",{className:"text-lg font-bold text-destructive",children:o.failed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.skipped")}),t.jsx("p",{className:"text-lg font-bold",children:o.skipped_items})]})]}),e[48]=o,e[49]=i,e[50]=b):b=e[50],e[51]!==o||e[52]!==i?(f=o&&(o.started_at||o.finished_at)&&t.jsxs(me,{className:"p-3 flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:[o.started_at&&t.jsxs("span",{children:[i("registry.monitorRunDetail.started"),":"," ",new Date(o.started_at).toLocaleString()]}),o.finished_at&&t.jsxs("span",{children:[i("registry.monitorRunDetail.finished"),":"," ",new Date(o.finished_at).toLocaleString()]}),o.started_at&&o.finished_at&&t.jsxs("span",{className:"font-medium text-foreground",children:[i("registry.monitorRunDetail.durationLabel"),":"," ",((new Date(o.finished_at).getTime()-new Date(o.started_at).getTime())/1e3).toFixed(1),"s"]})]}),e[51]=o,e[52]=i,e[53]=f):f=e[53],y="flex items-center justify-between gap-2",e[54]!==n?(N=t.jsx(Zi,{value:n,onChange:l}),e[54]=n,e[55]=N):N=e[55],m="text-xs text-muted-foreground",g=d.length,x=" ",h=i("registry.monitorRunDetail.result",{count:d.length})}e[0]=a,e[1]=o,e[2]=r,e[3]=c,e[4]=n,e[5]=i,e[6]=u,e[7]=d,e[8]=m,e[9]=f,e[10]=p,e[11]=g,e[12]=x,e[13]=h,e[14]=y,e[15]=N,e[16]=w,e[17]=_,e[18]=b}else u=e[6],d=e[7],m=e[8],f=e[9],p=e[10],g=e[11],x=e[12],h=e[13],y=e[14],N=e[15],w=e[16],_=e[17],b=e[18];if(p!==Symbol.for("react.early_return_sentinel"))return p;let L;e[56]!==m||e[57]!==g||e[58]!==x||e[59]!==h?(L=t.jsxs("span",{className:m,children:[g,x,h]}),e[56]=m,e[57]=g,e[58]=x,e[59]=h,e[60]=L):L=e[60];let I;e[61]!==L||e[62]!==y||e[63]!==N?(I=t.jsxs("div",{className:y,children:[N,L]}),e[61]=L,e[62]=y,e[63]=N,e[64]=I):I=e[64];let P;e[65]!==u||e[66]!==d.length||e[67]!==i?(P=d.length===0&&t.jsx(me,{className:"p-4 text-sm text-muted-foreground text-center",children:u.length===0?i("registry.monitorRunDetail.noTestResultsYet"):i("registry.monitorRunDetail.noResultsMatchFilter")}),e[65]=u,e[66]=d.length,e[67]=i,e[68]=P):P=e[68];let R;e[69]!==d?(R=d.map(en),e[69]=d,e[70]=R):R=e[70];let k;e[71]!==P||e[72]!==R?(k=t.jsxs("div",{className:"space-y-2",children:[P,R]}),e[71]=P,e[72]=R,e[73]=k):k=e[73];let A;return e[74]!==f||e[75]!==I||e[76]!==k||e[77]!==w||e[78]!==_||e[79]!==b?(A=t.jsxs("div",{className:w,children:[_,b,f,I,k]}),e[74]=f,e[75]=I,e[76]=k,e[77]=w,e[78]=_,e[79]=b,e[80]=A):A=e[80],A}function en(s){return t.jsx(Ji,{result:s},s.id)}function tn(s){return s.tested_items?`${Math.round(s.passed_items/s.tested_items*100)}%`:"-"}function sn(s){const e=Z.c(20),{selectedRunId:r,onSelectRun:i}=s,n=Pt();let l;e[0]!==n.data?.items?(l=n.data?.items??[],e[0]=n.data?.items,e[1]=l):l=e[1];const c=l;let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"QA run history"}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Browse previous QA executions and reopen their logs."})]}),e[2]=o):o=e[2];let a;e[3]!==n?(a=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o,t.jsx(Y,{size:"sm",variant:"outline",onClick:()=>n.refetch(),children:"Refresh"})]}),e[3]=n,e[4]=a):a=e[4];let u;e[5]!==c.length?(u=c.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No runs yet. Start QA from the Dashboard tab."}),e[5]=c.length,e[6]=u):u=e[6];let d;if(e[7]!==i||e[8]!==c||e[9]!==r){let p;e[11]!==i||e[12]!==r?(p=g=>{const x=_s(g.started_at,g.finished_at),h=tn(g),y=r===g.id;return t.jsxs("button",{type:"button",onClick:()=>i(g.id),className:te("w-full text-left rounded-lg border p-3 transition-colors",y?"border-primary bg-primary/5":"border-border hover:bg-muted/30"),children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("div",{className:"min-w-0 flex-1",children:t.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(g.created_at).toLocaleString()})}),t.jsx(V,{className:te("capitalize",ws(g.status)),children:g.status})]}),t.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs flex-wrap",children:[t.jsxs("span",{className:"text-muted-foreground",children:[g.tested_items,"/",g.total_items," tested"]}),t.jsxs("span",{className:"text-success font-medium",children:[g.passed_items," passed"]}),g.failed_items>0&&t.jsxs("span",{className:"text-destructive font-medium",children:[g.failed_items," failed"]}),g.skipped_items>0&&t.jsxs("span",{className:"text-muted-foreground",children:[g.skipped_items," skipped"]}),t.jsxs("span",{className:"text-muted-foreground",children:["pass rate: ",h]}),x&&t.jsx("span",{className:"text-muted-foreground",children:x})]}),g.config_snapshot&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[t.jsx(V,{variant:"outline",className:"text-[9px]",children:(g.config_snapshot.monitorMode??g.config_snapshot.testMode??"health_check").replace("_"," ")}),g.config_snapshot.onFailure!=="none"&&t.jsxs(V,{variant:"outline",className:"text-[9px] text-destructive",children:["on fail:"," ",g.config_snapshot.onFailure.replace(/_/g," ")]})]})]},g.id)},e[11]=i,e[12]=r,e[13]=p):p=e[13],d=c.map(p),e[7]=i,e[8]=c,e[9]=r,e[10]=d}else d=e[10];let m;e[14]!==u||e[15]!==d?(m=t.jsxs("div",{className:"space-y-2 max-h-[520px] overflow-auto",children:[u,d]}),e[14]=u,e[15]=d,e[16]=m):m=e[16];let f;return e[17]!==a||e[18]!==m?(f=t.jsx(me,{className:"p-4",children:t.jsxs("div",{className:"space-y-3",children:[a,m]})}),e[17]=a,e[18]=m,e[19]=f):f=e[19],f}function rn(){const s=Z.c(21),e=ce(),[r,i]=M.useState(void 0),[n,l]=M.useState("tests"),o=zt(r).data?.run?.status,a=ut(r,void 0,o);let u;s[0]!==a.data?.items?(u=a.data?.items??[],s[0]=a.data?.items,s[1]=u):u=s[1];let d;s[2]!==u?(d=u.filter(nn),s[2]=u,s[3]=d):d=s[3];const m=d;let f;s[4]!==n||s[5]!==e?(f=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:[{id:"tests",labelKey:"registry.registryMonitorPage.tabTests"},{id:"configuration",labelKey:"registry.registryMonitorPage.tabConfiguration"},{id:"connections",labelKey:"registry.registryMonitorPage.tabConnections"}].map(y=>{const N=n===y.id;return t.jsx("button",{type:"button",className:te("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center whitespace-nowrap",N?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),onClick:()=>l(y.id),children:t.jsx("span",{children:e(y.labelKey)})},y.id)})}),s[4]=n,s[5]=e,s[6]=f):f=s[6];let p;s[7]!==r||s[8]!==n||s[9]!==m||s[10]!==e?(p=n==="tests"&&t.jsxs("div",{className:"space-y-6",children:[t.jsx(Qi,{activeRunId:r,onRunChange:i}),t.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-4 items-start",children:[t.jsxs("div",{className:"xl:col-span-8 space-y-6 min-w-0",children:[r&&t.jsx(Xi,{runId:r}),t.jsx(sn,{selectedRunId:r,onSelectRun:i})]}),t.jsxs("div",{className:"xl:col-span-4 space-y-2 min-w-0",children:[t.jsxs("h3",{className:"text-sm font-semibold",children:[e("registry.registryMonitorPage.brokenMcps")," ",m.length>0&&t.jsx(V,{variant:"destructive",className:"text-[10px] ml-1",children:m.length})]}),t.jsx(Ii,{results:m})]})]})]}),s[7]=r,s[8]=n,s[9]=m,s[10]=e,s[11]=p):p=s[11];let g;s[12]!==n?(g=n==="configuration"&&t.jsx(Ei,{}),s[12]=n,s[13]=g):g=s[13];let x;s[14]!==n?(x=n==="connections"&&t.jsx($i,{}),s[14]=n,s[15]=x):x=s[15];let h;return s[16]!==f||s[17]!==p||s[18]!==g||s[19]!==x?(h=t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4 space-y-6",children:[f,p,g,x]}),s[16]=f,s[17]=p,s[18]=g,s[19]=x,s[20]=h):h=s[20],h}function nn(s){return s.status==="failed"||s.status==="error"}function an(s){const e=Z.c(9),{activeTab:r,onChange:i,items:n}=s;let l;if(e[0]!==r||e[1]!==n||e[2]!==i){let o;e[4]!==r||e[5]!==i?(o=a=>{const u=r===a.tab,d=a.icon;return t.jsxs("button",{type:"button",className:te("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center whitespace-nowrap",u?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),onClick:()=>i(a.tab),children:[t.jsx(d,{size:14}),t.jsx("span",{children:a.label}),typeof a.count=="number"&&a.count>0&&t.jsx("span",{className:"min-w-4 h-4 px-1 inline-flex items-center justify-center rounded-full bg-primary/15 text-[10px] font-semibold",children:a.count})]},a.id)},e[4]=r,e[5]=i,e[6]=o):o=e[6],l=n.map(o),e[0]=r,e[1]=n,e[2]=i,e[3]=l}else l=e[3];let c;return e[7]!==l?(c=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:l}),e[7]=l,e[8]=c):c=e[8],c}function ea(s){const e=Z.c(59),{onBack:r}=s,i=ce(),[n,l]=M.useState("items"),[c,o]=M.useState(null),{registryName:a,registryIcon:u,acceptPublishRequests:d}=vs(Ve),m=zr(),f=Mr();!d&&n==="requests"&&l("items");const p=m.data?.pending??0;let g;e[0]!==i?(g=i("registry.registryLayout.itemsTab"),e[0]=i,e[1]=g):g=e[1];const x=f.brokenCount>0?f.brokenCount:void 0;let h;e[2]!==g||e[3]!==x?(h={id:"items",label:g,icon:Qs,tab:"items",count:x},e[2]=g,e[3]=x,e[4]=h):h=e[4];let y;e[5]!==d||e[6]!==p||e[7]!==i?(y=d?[{id:"requests",label:i("registry.registryLayout.requestsTab"),icon:We,tab:"requests",count:p}]:[],e[5]=d,e[6]=p,e[7]=i,e[8]=y):y=e[8];let N;e[9]!==i?(N=i("registry.registryLayout.qaTab"),e[9]=i,e[10]=N):N=e[10];let w;e[11]!==N?(w={id:"qa",label:N,icon:ms,tab:"qa"},e[11]=N,e[12]=w):w=e[12];let _;e[13]!==i?(_=i("registry.registryLayout.settingsTab"),e[13]=i,e[14]=_):_=e[14];let b;e[15]!==_?(b={id:"settings",label:_,icon:Xs,tab:"settings"},e[15]=_,e[16]=b):b=e[16];let L;e[17]!==h||e[18]!==y||e[19]!==w||e[20]!==b?(L=[h,...y,w,b],e[17]=h,e[18]=y,e[19]=w,e[20]=b,e[21]=L):L=e[21];const I=L;let P;e[22]!==r?(P=r&&t.jsx("button",{type:"button",className:"shrink-0 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer",onClick:r,children:t.jsx(Ys,{size:16})}),e[22]=r,e[23]=P):P=e[23];let R;e[24]===Symbol.for("react.memo_cache_sentinel")?(R=()=>l("settings"),e[24]=R):R=e[24];let k;e[25]!==u||e[26]!==a?(k=t.jsx("div",{className:"size-7 rounded-lg border border-border overflow-hidden bg-muted/20 flex items-center justify-center shrink-0",children:u?t.jsx("img",{src:u,alt:a,className:"h-full w-full object-cover"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:a.slice(0,1).toUpperCase()})}),e[25]=u,e[26]=a,e[27]=k):k=e[27];let A;e[28]!==a?(A=t.jsx("span",{className:"text-sm font-medium truncate max-w-[220px]",children:a}),e[28]=a,e[29]=A):A=e[29];let q;e[30]!==k||e[31]!==A?(q=t.jsxs("button",{type:"button",className:"min-w-0 flex items-center gap-2 hover:opacity-90 transition-opacity cursor-pointer",onClick:R,children:[k,A]}),e[30]=k,e[31]=A,e[32]=q):q=e[32];let v;e[33]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-6 w-px bg-border shrink-0"}),e[33]=v):v=e[33];let S;e[34]!==n||e[35]!==I?(S=t.jsx(an,{activeTab:n,onChange:l,items:I}),e[34]=n,e[35]=I,e[36]=S):S=e[36];let D;e[37]!==P||e[38]!==q||e[39]!==S?(D=t.jsx("header",{className:"shrink-0 w-full border-b border-border h-12 overflow-x-auto flex items-center justify-between gap-3 px-4 min-w-max",children:t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[P,q,v,S]})}),e[37]=P,e[38]=q,e[39]=S,e[40]=D):D=e[40];let F;e[41]!==n?(F=n==="items"&&t.jsx(wi,{}),e[41]=n,e[42]=F):F=e[42];let T;e[43]!==d||e[44]!==n?(T=n==="requests"&&d&&t.jsx(Pi,{}),e[43]=d,e[44]=n,e[45]=T):T=e[45];let U;e[46]!==n?(U=n==="qa"&&t.jsx(rn,{}),e[46]=n,e[47]=U):U=e[47];let E;e[48]!==n||e[49]!==c?(E=n==="settings"&&t.jsx(Ri,{revealedKey:c,onRevealedKeyChange:o}),e[48]=n,e[49]=c,e[50]=E):E=e[50];let O;e[51]!==F||e[52]!==T||e[53]!==U||e[54]!==E?(O=t.jsxs("main",{className:"flex-1 min-w-0 overflow-hidden",children:[F,T,U,E]}),e[51]=F,e[52]=T,e[53]=U,e[54]=E,e[55]=O):O=e[55];let j;return e[56]!==D||e[57]!==O?(j=t.jsxs("div",{className:"h-full flex flex-col bg-background overflow-hidden",children:[D,O]}),e[56]=D,e[57]=O,e[58]=j):j=e[58],j}export{ea as default};
27
+ Describe your MCP here...`,rows:6,value:K,onChange:Q=>H(Q.target.value)}),fe.readme&&t.jsx("p",{className:"text-xs text-destructive",children:fe.readme})]})]}),t.jsx(oi,{tools:Se,onChange:mt,remoteUrl:et(Ne)||void 0,remoteType:le,externalDiscoverStatus:p,externalDiscoverError:g})]});return t.jsx(yt,{open:s,onOpenChange:Wt,children:t.jsxs(jt,{className:"sm:max-w-[820px] max-h-[90vh] overflow-hidden flex flex-col",children:[t.jsxs(Nt,{className:"space-y-3",children:[t.jsx(vt,{children:a(h?"registry.registryItemDialog.editMcpServer":"registry.registryItemDialog.addMcpServer")}),t.jsx(pi,{current:E}),t.jsxs(bt,{children:[E===1&&a("registry.registryItemDialog.step1Description"),E===2&&a("registry.registryItemDialog.step2Description"),E===3&&a("registry.registryItemDialog.step3Description")]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 py-2",children:[E===1&&qs,E===2&&Es,E===3&&Ls]}),t.jsxs(Ct,{className:"flex items-center justify-between gap-2 sm:justify-between",children:[t.jsx("div",{children:E>1&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:Ts,children:[t.jsx(Js,{size:14}),a("registry.registryItemDialog.back")]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Y,{variant:"outline",size:"sm",onClick:()=>Wt(!1),disabled:c,children:a("registry.registryItemDialog.cancel")}),E<3?t.jsxs(Y,{size:"sm",onClick:Ds,children:[a("registry.registryItemDialog.next"),t.jsx(ur,{size:14})]}):t.jsx(Y,{size:"sm",onClick:Ms,disabled:c,children:a(c?"registry.registryItemDialog.saving":h?"registry.registryItemDialog.saveChanges":"registry.registryItemDialog.create")})]})]})]})})}function cs(s,e){return s.includes(e)?s.filter(r=>r!==e):[...s,e]}function bi(s){return s._meta?.["mcp.mesh"]?.tags??[]}function Ni(s){return s._meta?.["mcp.mesh"]?.categories??[]}function Ci(s){return s.server?.remotes?.[0]?.url??"-"}function wi(){const s=ce(),e="h-8",[r,i]=M.useState(""),n=M.useDeferredValue(r),[l,c]=M.useState([]),[o,a]=M.useState([]),[u,d]=M.useState(!1),[m,f]=M.useState(!1),[p,g]=M.useState(null),[x,h]=M.useState(null),[y,N]=rr("private-registry-list","cards"),w=M.useRef(null),_=js({search:n,tags:l,categories:o}),b=Lr(),{createMutation:L,updateMutation:I,deleteMutation:P,bulkCreateMutation:R}=Ot(),k=_.data?.pages.flatMap(j=>j.items??[]).filter(Boolean)??[],A=_.data?.pages[0]?.totalCount??k.length,q=l.length>0||o.length>0||n.length>0,v=b.data,S=Array.isArray(v?.tags)?v.tags:[],D=Array.isArray(v?.categories)?v.categories:[],F=j=>{w.current&&(w.current.disconnect(),w.current=null),!(!j||!_.hasNextPage||_.isFetchingNextPage)&&(w.current=new IntersectionObserver($=>{$[0]?.isIntersecting&&_.hasNextPage&&!_.isFetchingNextPage&&_.fetchNextPage()},{rootMargin:"240px 0px"}),w.current.observe(j))},T=async j=>{try{"data"in j?(await I.mutateAsync(j),G.success(s("registry.registryItemsPage.registryItemUpdated"))):(await L.mutateAsync(j),G.success(s("registry.registryItemsPage.registryItemCreated")))}catch($){throw G.error($ instanceof Error?$.message:s("registry.registryItemsPage.failedToSaveItem")),$}},U=async j=>{const $=j._meta?.["mcp.mesh"]?.verified===!0;try{await I.mutateAsync({id:j.id,data:{_meta:{...j._meta,"mcp.mesh":{...j._meta?.["mcp.mesh"],verified:!$}}}}),G.success(s($?"registry.registryItemsPage.removedVerifiedStatus":"registry.registryItemsPage.markedAsVerified"))}catch(B){G.error(B instanceof Error?B.message:s("registry.registryItemsPage.failedToUpdateItem"))}},E=async j=>{const $=j._meta?.["mcp.mesh"]?.official===!0;try{await I.mutateAsync({id:j.id,data:{_meta:{...j._meta,"mcp.mesh":{...j._meta?.["mcp.mesh"],official:!$}}}}),G.success(s($?"registry.registryItemsPage.removedOfficialStatus":"registry.registryItemsPage.markedAsOfficial"))}catch(B){G.error(B instanceof Error?B.message:s("registry.registryItemsPage.failedToUpdateItem"))}},O=async()=>{if(x)try{await P.mutateAsync(x.id),G.success(s("registry.registryItemsPage.registryItemDeleted")),h(null)}catch(j){G.error(j instanceof Error?j.message:s("registry.registryItemsPage.failedToDeleteItem"))}};return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{className:"h-12 px-4 md:px-6 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("h2",{className:"text-sm font-medium",children:s("registry.registryItemsPage.items")}),t.jsx(V,{variant:"secondary",className:"text-xs",children:A})]}),t.jsxs("div",{className:"flex items-center gap-2 self-stretch",children:[t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:te(e,"gap-1.5"),children:[t.jsx(ir,{size:14}),s("registry.registryItemsPage.filters")]})}),t.jsxs(ht,{align:"end",className:"w-[260px]",children:[t.jsx(es,{children:s("registry.registryItemsPage.tags")}),S.length>0?S.map(j=>t.jsxs(ts,{checked:l.includes(j.value),onCheckedChange:()=>c($=>cs($,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(Re,{disabled:!0,children:s("registry.registryItemsPage.noTagsAvailable")}),t.jsx(tr,{}),t.jsx(es,{children:s("registry.registryItemsPage.categories")}),D.length>0?D.map(j=>t.jsxs(ts,{checked:o.includes(j.value),onCheckedChange:()=>a($=>cs($,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(Re,{disabled:!0,children:s("registry.registryItemsPage.noCategoriesAvailable")})]})]}),t.jsxs(sr,{type:"single",value:y,onValueChange:j=>{(j==="cards"||j==="table")&&N(j)},variant:"outline",className:e,children:[t.jsx(ss,{value:"cards","aria-label":s("registry.registryItemsPage.cardsViewAriaLabel"),className:e,children:s("registry.registryItemsPage.cards")}),t.jsx(ss,{value:"table","aria-label":s("registry.registryItemsPage.tableViewAriaLabel"),className:e,children:s("registry.registryItemsPage.table")})]}),t.jsx(Y,{variant:"outline",size:"sm",className:e,onClick:()=>f(!0),children:s("registry.registryItemsPage.importCsv")}),t.jsx(Y,{size:"sm",className:e,onClick:()=>d(!0),children:s("registry.registryItemsPage.addMcpServers")})]})]}),t.jsx("div",{className:"border-t border-border h-12 px-4 md:px-6 flex items-center",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-12 w-full cursor-text",children:[t.jsx(ar,{size:16,className:"text-muted-foreground shrink-0"}),t.jsx(ye,{value:r,onChange:j=>i(j.target.value),placeholder:s("registry.registryItemsPage.searchPlaceholder"),className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),q&&t.jsxs("div",{className:"border-t border-border px-4 md:px-6 py-2 flex flex-wrap items-center gap-2",children:[l.map(j=>t.jsxs(V,{variant:"default",children:["#",j]},`selected-tag-${j}`)),o.map(j=>t.jsx(V,{variant:"outline",children:j},`selected-category-${j}`)),r.trim()&&t.jsxs(V,{variant:"secondary",className:"max-w-[280px] truncate",children:["Search: ",r]}),t.jsx(Y,{size:"sm",variant:"ghost",className:"h-7 ml-auto",onClick:()=>{i(""),c([]),a([])},children:s("registry.registryItemsPage.clearFilters")})]})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[k.length===0?t.jsx("div",{className:"min-h-[320px] rounded-xl border border-dashed border-border flex flex-col items-center justify-center gap-3 p-6 text-center",children:_.isLoading?t.jsxs(t.Fragment,{children:[t.jsx(Ye,{className:"size-5 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:s("registry.registryItemsPage.loadingItems")})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-base font-medium",children:s(q?"registry.registryItemsPage.noItemsFound":"registry.registryItemsPage.noMcpsInRegistry")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:s(q?"registry.registryItemsPage.tryRemovingFilters":"registry.registryItemsPage.addFirstMcpItem")}),!q&&t.jsx(Y,{size:"lg",onClick:()=>d(!0),children:s("registry.registryItemsPage.addMcpServers")})]})}):y==="cards"?t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(j=>t.jsx(ii,{item:j,onEdit:g,onDelete:h,onToggleVerified:U,onToggleOfficial:E},j.id))}),_.hasNextPage&&t.jsx("div",{ref:F,className:"h-2"})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"border rounded-lg overflow-auto",children:t.jsxs(At,{children:[t.jsx(Ut,{children:t.jsxs(Je,{children:[t.jsx(pe,{className:"w-[56px]",children:s("registry.registryItemsPage.icon")}),t.jsx(pe,{children:s("registry.registryItemsPage.title")}),t.jsx(pe,{children:s("registry.registryItemsPage.id")}),t.jsx(pe,{children:s("registry.registryItemsPage.tags")}),t.jsx(pe,{children:s("registry.registryItemsPage.categories")}),t.jsx(pe,{children:s("registry.registryItemsPage.remoteUrl")}),t.jsx(pe,{children:s("registry.registryItemsPage.visibility")}),t.jsx(pe,{className:"text-right w-[68px]",children:s("registry.registryItemsPage.actions")})]})}),t.jsx(Ft,{children:k.map(j=>t.jsxs(Je,{children:[t.jsx(he,{children:t.jsx("div",{className:"size-8 rounded-md border border-border bg-muted/20 overflow-hidden flex items-center justify-center",children:j.server?.icons?.[0]?.src?t.jsx("img",{src:j.server.icons[0].src,alt:j.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:j.title.charAt(0).toUpperCase()})})}),t.jsx(he,{children:j.title}),t.jsx(he,{className:"font-mono",children:j.id}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:bi(j).slice(0,3).map($=>t.jsx(V,{variant:"outline",children:$},`${j.id}-tag-${$}`))})}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:Ni(j).slice(0,3).map($=>t.jsx(V,{variant:"outline",children:$},`${j.id}-category-${$}`))})}),t.jsx(he,{children:Ci(j)}),t.jsx(he,{children:j.is_public?t.jsxs(V,{variant:"default",className:"gap-1",children:[t.jsx(xs,{size:10}),s("registry.registryItemsPage.public")]}):t.jsx(V,{variant:"secondary",children:s("registry.registryItemsPage.private")})}),t.jsx(he,{className:"text-right",children:t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":s("registry.registryItemsPage.actionsFor",{title:j.title}),children:t.jsx($t,{size:18})})}),t.jsxs(ht,{align:"end",children:[t.jsx(Re,{onClick:()=>g(j),children:s("registry.registryItemsPage.edit")}),t.jsx(Re,{variant:"destructive",onClick:()=>h(j),children:s("registry.registryItemsPage.delete")})]})]})})]},j.id))})]})}),_.hasNextPage&&t.jsx("div",{ref:F,className:"h-2"})]}),_.isFetchingNextPage&&t.jsxs("div",{className:"py-4 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(Ye,{className:"size-4 animate-spin"}),s("registry.registryItemsPage.loadingMoreItems")]})]}),t.jsx(vi,{open:u||!!p,onOpenChange:j=>{j||(d(!1),g(null))},item:p,availableTags:S.map(j=>j.value),availableCategories:D.map(j=>j.value),isSubmitting:L.isPending||I.isPending,onSubmit:T},p?.id??"create"),t.jsx(Wr,{open:m,onOpenChange:f,isImporting:R.isPending,onImport:async j=>{try{const $=await R.mutateAsync(j);return G.success(s("registry.registryItemsPage.importedItems",{count:$.created})),$}catch($){throw G.error($ instanceof Error?$.message:s("registry.registryItemsPage.failedToImportCsv")),$}}}),t.jsx(Xr,{open:!!x,onOpenChange:j=>{j||h(null)},title:x?.title??x?.id??"",isDeleting:P.isPending,onConfirm:O})]})}const _i=[{value:"pending",labelKey:"registry.registryRequestsPage.statusPending"},{value:"approved",labelKey:"registry.registryRequestsPage.statusApproved"},{value:"rejected",labelKey:"registry.registryRequestsPage.statusRejected"}];function ds(s){const e=new Date(s);return Number.isNaN(e.getTime())?s:e.toLocaleDateString()}function us(s){return{id:s.requested_id??s.server?.name,title:s.title,description:s.description??"",_meta:s._meta,server:s.server,is_public:!1}}function Et(s){const e=s.server?.icons?.[0]?.src;return typeof e=="string"&&e.length>0?e:null}function xt(s){const e=s._meta?.["mcp.mesh"];return{hasReadmeContent:!!e?.readme?.trim(),hasReadmeLink:!!e?.readme_url?.trim(),readmeContent:e?.readme?.trim()??"",readmeUrl:e?.readme_url?.trim()??""}}function Pi(){const s=ce(),[e,r]=M.useState("pending"),[i,n]=M.useState("created_at"),[l,c]=M.useState("asc"),[o,a]=M.useState(new Set),[u,d]=M.useState(!1),[m,f]=M.useState("private"),[p,g]=M.useState(!1),[x,h]=M.useState(null),[y,N]=M.useState(null),[w,_]=M.useState(null),[b,L]=M.useState(null),[I,P]=M.useState(""),R=Ur({status:e,sortBy:i,sortDirection:l}),{reviewMutation:k,deleteMutation:A}=Or(),{createMutation:q}=Ot(),v=R.data?.pages.flatMap(C=>C.items)??[],S=R.data?.pages[0]?.totalCount??0,D=R.isFetchingNextPage,F=!!R.hasNextPage,T=yr(()=>{R.isFetchingNextPage||R.fetchNextPage()},F,D),U=new Set(v.filter(C=>C.status==="pending").map(C=>C.id)),E=v.filter(C=>U.has(C.id)),O=o.size,j=E.filter(C=>o.has(C.id)),$=v.filter(C=>o.has(C.id)).length,B=E.length>0&&E.every(C=>o.has(C.id)),X=()=>a(new Set),J=(C,K)=>{a(H=>{const re=new Set(H);return K?re.add(C):re.delete(C),re})},de=C=>{a(K=>{const H=new Set(K);return H.has(C)?H.delete(C):H.add(C),H})},se=()=>{a(C=>{const K=new Set(C);for(const H of E)K.add(H.id);return K})},ne=async()=>{const C=y;if(C){N(null),h(C.id);try{await k.mutateAsync({id:C.id,status:"approved",reviewerNotes:void 0});const K=us(C);await q.mutateAsync({id:K.id,title:K.title,description:K.description,_meta:K._meta,server:K.server,is_public:K.is_public}),G.success(s("registry.registryRequestsPage.requestApprovedAndAdded"))}catch(K){const H=K instanceof Error?K.message:"Failed to approve request";H.includes("UNIQUE constraint")||H.includes("already exists")?G.error(s("registry.registryRequestsPage.itemAlreadyExists")):G.error(H)}finally{h(null)}}},ge=async()=>{if(w)try{await k.mutateAsync({id:w.id,status:"rejected",reviewerNotes:I.trim()||void 0}),G.success(s("registry.registryRequestsPage.requestRejected")),_(null),P("")}catch(C){G.error(C instanceof Error?C.message:"Failed to reject request")}},ue=async C=>{try{await A.mutateAsync(C.id),G.success(s("registry.registryRequestsPage.requestDeleted"))}catch(K){G.error(K instanceof Error?K.message:"Failed to delete request")}},ie=async()=>{if(j.length===0||p)return;g(!0),d(!1);let C=0;const K=new Set;for(const re of j)try{await k.mutateAsync({id:re.id,status:"approved",reviewerNotes:void 0});const xe=us(re);await q.mutateAsync({id:xe.id,title:xe.title,description:xe.description,_meta:xe._meta,server:xe.server,is_public:m==="public"}),C++}catch{K.add(re.id)}const H=K.size;C>0&&H===0?G.success(s("registry.registryRequestsPage.bulkApproveSuccess",{approvedCount:C,bulkVisibility:m})):C>0&&H>0?G.warning(s("registry.registryRequestsPage.bulkApprovePartial",{approvedCount:C,failedCount:H})):G.error(s("registry.registryRequestsPage.bulkApproveFailed")),a(K),g(!1)};return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsx("div",{className:"shrink-0 border-b border-border",children:t.jsxs("div",{className:"h-12 px-4 md:px-6 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("h2",{className:"text-sm font-medium",children:s("registry.registryRequestsPage.requestsToPublish")}),t.jsx(V,{variant:"secondary",className:"text-xs",children:S})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:_i.map(C=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md transition-colors",e===C.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r(C.value),onClickCapture:()=>X(),children:s(C.labelKey)},C.value))}),t.jsxs("select",{className:"h-7 rounded-md border border-input bg-background px-2 text-xs",value:`${i}:${l}`,onChange:C=>{const[K,H]=C.target.value.split(":");n(K),c(H)},children:[t.jsx("option",{value:"created_at:asc",children:s("registry.registryRequestsPage.sortCreatedOldest")}),t.jsx("option",{value:"created_at:desc",children:s("registry.registryRequestsPage.sortCreatedNewest")}),t.jsx("option",{value:"title:asc",children:s("registry.registryRequestsPage.sortAlphaAZ")}),t.jsx("option",{value:"title:desc",children:s("registry.registryRequestsPage.sortAlphaZA")})]})]})]})}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[R.isLoading?t.jsx("div",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.loadingRequests")}):R.isError?t.jsxs("div",{className:"p-8 text-center rounded-lg border border-border",children:[t.jsx("p",{className:"text-sm text-destructive",children:s("registry.registryRequestsPage.failedLoadRequests")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:R.error instanceof Error?R.error.message:s("registry.registryRequestsPage.unknownError")})]}):v.length===0?t.jsx("div",{className:"p-8 text-center rounded-lg border border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:s(e==="pending"?"registry.registryRequestsPage.noPendingRequests":e==="approved"?"registry.registryRequestsPage.noApprovedRequests":"registry.registryRequestsPage.noRejectedRequests")})}):t.jsxs(At,{children:[t.jsx(Ut,{children:t.jsxs(Je,{children:[e==="pending"&&t.jsx(pe,{className:"w-10",children:t.jsx(is,{checked:B&&E.length>0,onCheckedChange:C=>{C?se():X()}})}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnName")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnRequester")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnTags")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnStatus")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnDate")}),t.jsx(pe,{className:"text-right",children:s("registry.registryRequestsPage.columnActions")})]})}),t.jsx(Ft,{children:v.map(C=>{const K=Et(C),H=C._meta?.["mcp.mesh"]?.tags??[],re=U.has(C.id),xe=o.has(C.id);return t.jsxs(Je,{className:te(re&&"cursor-pointer",xe&&"bg-accent/20"),onClick:()=>{re&&de(C.id)},children:[e==="pending"&&t.jsx(he,{children:t.jsx(is,{checked:xe,onCheckedChange:oe=>J(C.id,oe===!0),onClick:oe=>oe.stopPropagation()})}),t.jsx(he,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-7 rounded-md border border-border bg-muted/30 overflow-hidden shrink-0 flex items-center justify-center",children:K?t.jsx("img",{src:K,alt:C.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:C.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:C.description})]})]})}),t.jsx(he,{children:t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:C.requester_name||C.requester_email||"-"})}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:H.slice(0,3).map(oe=>t.jsx(V,{variant:"secondary",className:"text-[10px]",children:oe},`${C.id}-tag-${oe}`))})}),t.jsx(he,{children:t.jsx(V,{variant:"secondary",className:"capitalize text-[11px]",children:C.status})}),t.jsx(he,{children:t.jsx("span",{className:"text-sm text-muted-foreground",children:ds(C.created_at)})}),t.jsx(he,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsxs(Y,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:oe=>{oe.stopPropagation(),L(C)},children:[t.jsx(ps,{size:13}),s("registry.registryRequestsPage.buttonView")]}),re?t.jsxs(t.Fragment,{children:[t.jsxs(Y,{size:"sm",className:"h-7 text-xs px-2",onClick:oe=>{oe.stopPropagation(),N(C)},disabled:x!==null||p||xe,children:[t.jsx(We,{size:13}),x===C.id?s("registry.registryRequestsPage.approving"):s(xe?"registry.registryRequestsPage.selected":"registry.registryRequestsPage.buttonApprove")]}),t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:oe=>{oe.stopPropagation(),_(C),P("")},disabled:k.isPending,children:[t.jsx(xr,{size:13}),s("registry.registryRequestsPage.buttonReject")]})]}):t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:oe=>{oe.stopPropagation(),ue(C)},disabled:A.isPending,children:[t.jsx(dt,{size:13}),s("registry.registryRequestsPage.buttonDelete")]})]})})]},C.id)})})]}),v.length>0&&F?t.jsx("div",{ref:T,className:"h-1 w-full"}):null,D&&v.length>0?t.jsx("div",{className:"pt-3 text-xs text-muted-foreground",children:s("registry.registryRequestsPage.loadingMoreRequests")}):null]}),O>0?t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground pr-1",children:s("registry.registryRequestsPage.selectedCount",{selectedCount:O})}),t.jsx(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:se,disabled:B,children:s("registry.registryRequestsPage.selectAll")}),t.jsx(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:X,children:s("registry.registryRequestsPage.clearSelection")}),t.jsxs(Y,{size:"sm",className:"h-7 text-xs px-2",onClick:()=>d(!0),disabled:p,children:[t.jsx(We,{size:13}),s("registry.registryRequestsPage.approveSelected")]})]})}):null,t.jsx(yt,{open:!!b,onOpenChange:C=>{C||L(null)},children:t.jsxs(jt,{className:"sm:max-w-[720px] max-h-[85vh] overflow-hidden flex flex-col",children:[t.jsxs(Nt,{children:[t.jsx(vt,{children:b?.title??s("registry.registryRequestsPage.requestDetails")}),t.jsx(bt,{children:s("registry.registryRequestsPage.reviewMetadataDescription")})]}),b&&t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 space-y-4",children:[t.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3 flex items-center gap-3",children:[t.jsx("div",{className:"size-16 rounded-lg border border-border bg-muted/30 overflow-hidden shrink-0 flex items-center justify-center",children:Et(b)?t.jsx("img",{src:Et(b)||"",alt:b.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-lg font-semibold text-muted-foreground",children:b.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:b.title}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.server?.name||b.id})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelStatus")}),t.jsx("span",{className:"capitalize",children:b.status})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelSubmitted")}),t.jsx("span",{children:ds(b.created_at)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelRequester")}),t.jsx("span",{children:b.requester_name||"-"})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelEmail")}),t.jsx("span",{children:b.requester_email||"-"})]})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelRemoteURL")}),t.jsx("code",{className:"text-xs rounded-md border border-border bg-muted/30 px-2.5 py-2 break-all",children:b.server?.remotes?.[0]?.url??"-"})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelDescription")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:b.description||s("registry.registryRequestsPage.noDescriptionProvided")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelTags")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(b._meta?.["mcp.mesh"]?.tags??[]).length?(b._meta?.["mcp.mesh"]?.tags??[]).map(C=>t.jsx(V,{variant:"secondary",children:C},`${b.id}-detail-tag-${C}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelCategories")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(b._meta?.["mcp.mesh"]?.categories??[]).length?(b._meta?.["mcp.mesh"]?.categories??[]).map(C=>t.jsx(V,{variant:"secondary",children:C},`${b.id}-detail-category-${C}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelREADME")}),xt(b).hasReadmeContent?t.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap max-h-40 overflow-y-auto rounded-md border border-border bg-muted/20 px-2.5 py-2",children:xt(b).readmeContent}):xt(b).hasReadmeLink?t.jsxs("a",{href:xt(b).readmeUrl,target:"_blank",rel:"noreferrer",className:"text-sm inline-flex items-center gap-1.5 text-primary hover:underline",children:[s("registry.registryRequestsPage.openREADMELink"),t.jsx(fr,{size:14})]}):t.jsx("span",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.noREADMEProvided")})]})]}),t.jsx(Ct,{children:t.jsx(Y,{variant:"outline",onClick:()=>L(null),children:s("registry.registryRequestsPage.buttonClose")})})]})}),t.jsx(ct,{open:!!y,onOpenChange:C=>{C||N(null)},children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:s("registry.registryRequestsPage.approvePublishRequestTitle")}),t.jsx(rt,{children:s("registry.registryRequestsPage.approvePublishRequestDesc",{title:y?.title??""})})]}),t.jsxs(ot,{children:[t.jsx(nt,{children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(at,{onClick:ne,children:s("registry.registryRequestsPage.buttonApprove")})]})]})}),t.jsx(ct,{open:u,onOpenChange:d,children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:s("registry.registryRequestsPage.approveSelectedRequestsTitle")}),t.jsx(rt,{children:s("registry.registryRequestsPage.approveSelectedRequestsDesc",{count:j.length})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"bulk-visibility",children:s("registry.registryRequestsPage.visibilityForAll")}),t.jsxs("select",{id:"bulk-visibility",className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:m,onChange:C=>f(C.target.value),children:[t.jsx("option",{value:"private",children:s("registry.registryRequestsPage.visibilityPrivate")}),t.jsx("option",{value:"public",children:s("registry.registryRequestsPage.visibilityPublic")})]})]}),t.jsxs(ot,{children:[t.jsx(nt,{disabled:p,children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(at,{onClick:ie,disabled:p||$===0,children:s(p?"registry.registryRequestsPage.approving":"registry.registryRequestsPage.approveSelected")})]})]})}),t.jsx(yt,{open:!!w,onOpenChange:C=>{C||(_(null),P(""))},children:t.jsxs(jt,{children:[t.jsxs(Nt,{children:[t.jsx(vt,{children:s("registry.registryRequestsPage.rejectPublishRequestTitle")}),t.jsx(bt,{children:s("registry.registryRequestsPage.rejectPublishRequestDesc")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"reject-notes",children:s("registry.registryRequestsPage.reviewerNotes")}),t.jsx(wt,{id:"reject-notes",rows:4,value:I,onChange:C=>P(C.target.value),placeholder:s("registry.registryRequestsPage.reasonForRejectionPlaceholder")})]}),t.jsxs(Ct,{children:[t.jsx(Y,{variant:"outline",onClick:()=>{_(null),P("")},children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(Y,{onClick:ge,disabled:k.isPending,children:k.isPending?s("registry.registryRequestsPage.rejecting"):s("registry.registryRequestsPage.buttonReject")})]})]})})]})}function Ri({revealedKey:s,onRevealedKeyChange:e}){const r=ce(),{org:i}=be(),{uploadImage:n,isUploading:l}=Cs(),{registryName:c,registryIcon:o,acceptPublishRequests:a,requireApiToken:u,storePrivateOnly:d,rateLimitEnabled:m,rateLimitWindow:f,rateLimitMax:p,isSaving:g,updateConfig:x}=vs(Ve),[h,y]=M.useState(c),[N,w]=M.useState(c);c!==N&&(w(c),y(c));const[_,b]=M.useState(o),[L,I]=M.useState(o);o!==L&&(I(o),b(o));const[P,R]=M.useState(String(p)),[k,A]=M.useState(p);p!==k&&(A(p),R(String(p)));const q=Br(),{generateMutation:v,revokeMutation:S}=Kr(),[D,F]=M.useState(""),[T,U]=M.useState(!1),[E,O]=M.useState(null),{handleCopy:j,copied:$}=Tt(),{handleCopy:B,copied:X}=Tt(),{handleCopy:J,copied:de}=Tt(),se=js({search:"",tags:[],categories:[],limit:50}),ne=`${window.location.origin}/org/${i.slug}/registry/mcp`,ue=(se.data?.pages.flatMap(z=>z.items??[])??[]).filter(z=>z.is_public).length,ie=`${window.location.origin}/org/${i.slug}/registry/publish-request`,C=s?.slice(0,12)??null,K=!!(C&&(q.data?.items??[]).some(z=>z.prefix===C)),H=g||l,re=()=>{const z=h.trim();!z||z===c||x({registryName:z})},xe=()=>{const z=Number.parseInt(P,10),le=Number.isFinite(z)&&z>=1?z:100;R(String(le)),le!==p&&x({rateLimitMax:le})},oe=async z=>{if(!z)return;const le=z.name.split(".").pop()||"png",ke=`registry/${i.id}/identity/icon.${le}`,Pe=await n(z,ke);Pe?(b(Pe),x({registryIcon:Pe})):G.error(r("registry.registrySettingsPage.failedUploadIcon"))},Ie=async()=>{const z=D.trim();if(z)try{const le=await v.mutateAsync(z);le?.key&&(e(le.key),U(!1),F(""),G.success(r("registry.registrySettingsPage.apiKeyGenerated")))}catch(le){G.error(le instanceof Error?le.message:r("registry.registrySettingsPage.failedGenerateApiKey"))}},Ne=async z=>{try{await S.mutateAsync(z),e(null),O(null),G.success(r("registry.registrySettingsPage.apiKeyRevoked"))}catch(le){G.error(le instanceof Error?le.message:r("registry.registrySettingsPage.failedRevokeApiKey"))}};return t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4",children:[t.jsxs("div",{className:"grid grid-cols-1 gap-4 items-start xl:grid-cols-2",children:[t.jsx("div",{className:"grid gap-4 min-w-0 content-start",children:t.jsxs(me,{className:"min-w-0 p-4 grid gap-4 content-start",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:r("registry.registrySettingsPage.registryIdentity")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.configureNameIcon")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"identity-name",children:r("registry.registrySettingsPage.name")}),t.jsx(ye,{id:"identity-name",value:h,onChange:z=>y(z.target.value),onBlur:re,disabled:H,placeholder:r("registry.registrySettingsPage.namePlaceholder")})]}),t.jsx(bs,{value:_,onChange:b,onBlur:()=>{const z=_.trim();z!==o&&x({registryIcon:z})},onFileUpload:oe,isUploading:l})]})}),t.jsxs("div",{className:"grid gap-4 min-w-0 content-start",children:[t.jsxs(me,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:r("registry.registrySettingsPage.publicRegistry")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.publicRegistryDescription")})]}),t.jsxs(V,{variant:"secondary",children:[ue," ",r(ue===1?"registry.registrySettingsPage.publicItem":"registry.registrySettingsPage.publicItems")]})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-xs font-mono break-all leading-5 min-w-0 flex-1 select-all",children:ne}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>j(ne),children:$?t.jsx(Mt,{size:14}):t.jsx(qt,{size:14})})]})]}),t.jsxs(me,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:r("registry.registrySettingsPage.storeVisibility")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.storeVisibilityDescription")})]}),t.jsx(Ge,{id:"store-private-only",checked:d,onCheckedChange:z=>x({storePrivateOnly:z}),disabled:H})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.storeVisibilityHelp")})]}),t.jsxs(me,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:r("registry.registrySettingsPage.publishRequests")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.publishRequestsDescription")})]}),t.jsx(Ge,{id:"accept-publish-requests",checked:a,onCheckedChange:z=>x({acceptPublishRequests:z}),disabled:H})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-xs font-mono break-all leading-5 min-w-0 flex-1 select-all",children:ie}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>B(ie),children:X?t.jsx(Mt,{size:14}):t.jsx(qt,{size:14})})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(ae,{className:"text-sm font-medium",children:r("registry.registrySettingsPage.requireApiToken")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.requireApiTokenHelp")})]}),t.jsx(Ge,{id:"require-api-token",checked:u,onCheckedChange:z=>x({requireApiToken:z}),disabled:H})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(ae,{className:"text-sm font-medium",children:r("registry.registrySettingsPage.rateLimit")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.rateLimitHelp")})]}),t.jsx(Ge,{id:"publish-rate-limit",checked:m,onCheckedChange:z=>x({rateLimitEnabled:z}),disabled:H})]}),m&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:"rate-limit-max",className:"text-sm font-medium",children:r("registry.registrySettingsPage.maxRequests")}),t.jsx(ye,{id:"rate-limit-max",inputMode:"numeric",min:1,type:"number",value:P,onChange:z=>R(z.target.value),onBlur:xe,disabled:H,placeholder:r("registry.registrySettingsPage.maxRequestsPlaceholder")})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{htmlFor:"rate-limit-window",className:"text-sm font-medium",children:r("registry.registrySettingsPage.window")}),t.jsxs("select",{id:"rate-limit-window",className:"h-9 rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",value:f,onChange:z=>x({rateLimitWindow:z.target.value}),disabled:H,children:[t.jsx("option",{value:"minute",children:r("registry.registrySettingsPage.perMinute")}),t.jsx("option",{value:"hour",children:r("registry.registrySettingsPage.perHour")})]})]})]}),a&&u&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[t.jsx(jr,{size:14,className:"text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:r("registry.registrySettingsPage.apiKeys")})]}),s&&!K&&t.jsxs("div",{className:"rounded-md border border-border bg-muted/20 px-3 py-2 grid gap-1.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.newKeyRefreshing")}),t.jsx(ye,{readOnly:!0,value:s,className:"h-8 text-xs font-mono bg-background"})]}),t.jsxs("div",{className:"flex items-end gap-2",children:[t.jsxs("div",{className:"grid gap-1.5 flex-1",children:[t.jsx(ae,{htmlFor:"api-key-name",className:"text-xs",children:r("registry.registrySettingsPage.keyName")}),t.jsx(ye,{id:"api-key-name",value:D,onChange:z=>F(z.target.value),placeholder:r("registry.registrySettingsPage.keyNamePlaceholder"),className:"h-8 text-sm"})]}),t.jsxs(Y,{variant:"outline",size:"sm",className:"h-8 gap-1.5",disabled:!D.trim()||v.isPending,onClick:Ie,children:[v.isPending?t.jsx(Ye,{size:14,className:"animate-spin"}):t.jsx(vr,{size:14}),r("registry.registrySettingsPage.generate")]})]}),(q.data?.items?.length??0)>0&&t.jsx("div",{className:"grid gap-2",children:q.data?.items?.map(z=>t.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background px-3 py-2",children:[t.jsxs("div",{className:"grid gap-1 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate leading-none",children:z.name}),C===z.prefix?t.jsx(ye,{readOnly:!0,value:T?s??"":"••••••••••••••••••••••••••••••••••••••••••••••••••••",className:"h-8 text-xs font-mono bg-muted/20"}):t.jsx(ye,{readOnly:!0,value:`${z.prefix}••••••••`,className:"h-8 text-xs font-mono bg-muted/20 text-muted-foreground"})]}),t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C===z.prefix&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>U(le=>!le),children:T?t.jsx(Zs,{size:14}):t.jsx(ps,{size:14})}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:!s,onClick:()=>s&&J(s),children:de?t.jsx(Mt,{size:14}):t.jsx(qt,{size:14})})]}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:text-destructive",disabled:S.isPending,onClick:()=>O({id:z.id,name:z.name}),children:t.jsx(dt,{size:14})})]})]},z.id))})]})]})]})]}),t.jsx(ct,{open:!!E,onOpenChange:z=>{!z&&!S.isPending&&O(null)},children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:r("registry.registrySettingsPage.revokeApiKeyTitle")}),t.jsx(rt,{children:r("registry.registrySettingsPage.revokeApiKeyDescription",{keyName:E?.name??""})})]}),t.jsxs(ot,{children:[t.jsx(nt,{disabled:S.isPending,children:r("registry.registrySettingsPage.cancel")}),t.jsx(at,{disabled:!E||S.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>E&&Ne(E.id),children:S.isPending?r("registry.registrySettingsPage.revoking"):r("registry.registrySettingsPage.revokeKey")})]})]})})]})}function Ii(s){const e=Z.c(8),{results:r}=s,i=ce();if(r.length===0){let c;e[0]!==i?(c=i("registry.brokenMcpList.noBrokenMcps"),e[0]=i,e[1]=c):c=e[1];let o;return e[2]!==c?(o=t.jsx(me,{className:"p-4 text-sm text-muted-foreground text-center",children:c}),e[2]=c,e[3]=o):o=e[3],o}let n;e[4]!==r?(n=r.map(ki),e[4]=r,e[5]=n):n=e[5];let l;return e[6]!==n?(l=t.jsx("div",{className:"space-y-2",children:n}),e[6]=n,e[7]=l):l=e[7],l}function ki(s){return t.jsx(Si,{result:s},s.id)}function Si(s){const e=Z.c(56),{result:r}=s,i=ce(),[n,l]=M.useState(!1);let c;if(e[0]!==n||e[1]!==r.action_taken||e[2]!==r.connection_ok||e[3]!==r.duration_ms||e[4]!==r.error_message||e[5]!==r.id||e[6]!==r.item_title||e[7]!==r.status||e[8]!==r.tool_results||e[9]!==r.tools_listed||e[10]!==i){const o=r.tool_results.filter(Mi);let a;e[12]!==n?(a=()=>l(!n),e[12]=n,e[13]=a):a=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-destructive text-sm mt-0.5",children:"✗"}),e[14]=u):u=e[14];let d;e[15]!==r.item_title?(d=t.jsx("h4",{className:"text-sm font-medium truncate",children:r.item_title}),e[15]=r.item_title,e[16]=d):d=e[16];let m;e[17]!==r.status?(m=r.status.replace("_"," "),e[17]=r.status,e[18]=m):m=e[18];let f;e[19]!==m?(f=t.jsx(V,{variant:"destructive",className:"capitalize text-[10px] shrink-0",children:m}),e[19]=m,e[20]=f):f=e[20];let p;e[21]!==d||e[22]!==f?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[d,f]}),e[21]=d,e[22]=f,e[23]=p):p=e[23];let g;e[24]!==i?(g=i("registry.brokenMcpList.connStatus"),e[24]=i,e[25]=g):g=e[25];const x=r.connection_ok?"✓":"✗";let h;e[26]!==g||e[27]!==x?(h=t.jsxs("span",{children:[g,":"," ",x]}),e[26]=g,e[27]=x,e[28]=h):h=e[28];let y;e[29]!==i?(y=i("registry.brokenMcpList.toolsListed"),e[29]=i,e[30]=y):y=e[30];const N=r.tools_listed?"✓":"✗";let w;e[31]!==y||e[32]!==N?(w=t.jsxs("span",{children:[y,":"," ",N]}),e[31]=y,e[32]=N,e[33]=w):w=e[33];let _;e[34]!==r.duration_ms?(_=t.jsxs("span",{children:[r.duration_ms,"ms"]}),e[34]=r.duration_ms,e[35]=_):_=e[35];const b=o.length>0&&t.jsx("span",{className:"text-destructive",children:i("registry.brokenMcpList.toolsFailed",{count:o.length})});let L;e[36]!==r.action_taken?(L=r.action_taken!=="none"&&t.jsx(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:r.action_taken.replace(/_/g," ")}),e[36]=r.action_taken,e[37]=L):L=e[37];let I;e[38]!==h||e[39]!==w||e[40]!==_||e[41]!==b||e[42]!==L?(I=t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground flex-wrap",children:[h,w,_,b,L]}),e[38]=h,e[39]=w,e[40]=_,e[41]=b,e[42]=L,e[43]=I):I=e[43];let P;e[44]!==r.error_message?(P=r.error_message&&t.jsx("p",{className:"text-xs text-destructive line-clamp-2",children:r.error_message}),e[44]=r.error_message,e[45]=P):P=e[45];let R;e[46]!==I||e[47]!==P||e[48]!==p?(R=t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[p,I,P]}),e[46]=I,e[47]=P,e[48]=p,e[49]=R):R=e[49];const k=n?"▲":"▼";let A;e[50]!==k?(A=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-1",children:k}),e[50]=k,e[51]=A):A=e[51];let q;e[52]!==R||e[53]!==a||e[54]!==A?(q=t.jsxs("button",{type:"button",className:"w-full text-left p-3 flex items-start gap-3 hover:bg-muted/30 transition-colors",onClick:a,children:[u,R,A]}),e[52]=R,e[53]=a,e[54]=A,e[55]=q):q=e[55],c=t.jsxs(me,{className:"overflow-hidden",children:[q,n&&t.jsxs("div",{className:"border-t border-border p-3 space-y-2 bg-muted/10",children:[r.error_message&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.brokenMcpList.fullError")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2.5 py-1.5 whitespace-pre-wrap break-all text-destructive",children:r.error_message})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.brokenMcpList.connectionLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?i("registry.brokenMcpList.statusOk"):i("registry.brokenMcpList.statusFailed")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.brokenMcpList.toolsListedLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?i("registry.brokenMcpList.yes"):i("registry.brokenMcpList.no")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.brokenMcpList.durationLabel")}),t.jsxs("p",{className:"text-xs font-medium",children:[r.duration_ms,"ms"]})]})]}),o.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.brokenMcpList.failedToolsHeader",{count:o.length})}),o.map(v=>t.jsxs("div",{className:"rounded border border-destructive/10 bg-destructive/5 px-2.5 py-1.5 space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs font-mono font-medium text-destructive",children:v.toolName}),t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[v.durationMs,"ms"]})]}),v.error&&t.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all text-destructive",children:v.error})]},`${r.id}-${v.toolName}`))]}),r.tool_results.length>0&&r.tool_results.some(Ti)&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.brokenMcpList.passingTools")}),t.jsx("div",{className:"flex flex-wrap gap-1",children:r.tool_results.filter(Di).map(v=>t.jsxs(V,{variant:"secondary",className:"text-[10px]",children:["✓ ",v.toolName]},`${r.id}-${v.toolName}-pass`))})]})]})]}),e[0]=n,e[1]=r.action_taken,e[2]=r.connection_ok,e[3]=r.duration_ms,e[4]=r.error_message,e[5]=r.id,e[6]=r.item_title,e[7]=r.status,e[8]=r.tool_results,e[9]=r.tools_listed,e[10]=i,e[11]=c}else c=e[11];return c}function Di(s){return s.success}function Ti(s){return s.success}function Mi(s){return!s.success}function qi(s,e){return s.onFailure!==e.onFailure||s.perMcpTimeoutMs!==e.perMcpTimeoutMs||s.perToolTimeoutMs!==e.perToolTimeoutMs||s.maxAgentSteps!==e.maxAgentSteps||s.testPublicOnly!==e.testPublicOnly||s.testPrivateOnly!==e.testPrivateOnly||s.includePendingRequests!==e.includePendingRequests||(s.agentContext??"")!==(e.agentContext??"")}function Ei(){const s=ce(),{settings:e,saveMutation:r}=fs(),i=M.useRef(e),[n,l]=M.useState(e),[c,o]=M.useState(!1),[a,u]=M.useState(!1);i.current!==e&&(i.current=e,l(e));const d=qi(n,e),m=p=>{o(!1),l(g=>({...g,...p}))},f=async()=>{const p={...n,agentContext:(n.agentContext??"").trim()};await r.mutateAsync(p),l(p),o(!0),setTimeout(()=>o(!1),3e3)};return t.jsxs(me,{className:"p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:s("registry.monitorConfiguration.qaConfiguration")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("registry.monitorConfiguration.description")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[d&&t.jsx(V,{className:"bg-warning/10 text-warning border-warning/20 text-[10px]",children:s("registry.monitorConfiguration.unsavedChanges")}),c&&t.jsxs(V,{className:"bg-success/10 text-success border-success/20 text-[10px]",children:["✓ ",s("registry.monitorConfiguration.saved")]}),t.jsx(Y,{size:"sm",onClick:f,disabled:r.isPending||!d,children:r.isPending?s("registry.monitorConfiguration.saving"):s("registry.monitorConfiguration.saveSettings")})]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.onFailureLabel"),hint:s("registry.monitorConfiguration.onFailureHint")}),t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:n.onFailure,onChange:p=>m({onFailure:p.target.value}),children:[t.jsx("option",{value:"none",children:s("registry.monitorConfiguration.onFailureNone")}),t.jsx("option",{value:"unlisted",children:s("registry.monitorConfiguration.onFailureUnlisted")}),t.jsx("option",{value:"remove_public",children:s("registry.monitorConfiguration.onFailureRemovePublic")}),t.jsx("option",{value:"remove_private",children:s("registry.monitorConfiguration.onFailureRemovePrivate")}),t.jsx("option",{value:"remove_all",children:s("registry.monitorConfiguration.onFailureRemoveAll")})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.testScopeLabel"),hint:s("registry.monitorConfiguration.testScopeHint")}),t.jsxs("div",{className:"flex items-center gap-4 rounded-md border border-input px-3 py-2",children:[t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:n.testPublicOnly,onChange:p=>m({testPublicOnly:p.target.checked,testPrivateOnly:p.target.checked?!1:n.testPrivateOnly})}),s("registry.monitorConfiguration.publicOnly")]}),t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:n.testPrivateOnly,onChange:p=>m({testPrivateOnly:p.target.checked,testPublicOnly:p.target.checked?!1:n.testPublicOnly})}),s("registry.monitorConfiguration.privateOnly")]})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.publishRequestsLabel"),hint:s("registry.monitorConfiguration.publishRequestsHint")}),t.jsx("div",{className:"flex items-center gap-4 rounded-md border border-input px-3 py-2",children:t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:n.includePendingRequests,onChange:p=>m({includePendingRequests:p.target.checked})}),s("registry.monitorConfiguration.includePendingRequests")]})})]}),t.jsxs("div",{className:"space-y-1 md:col-span-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx(He,{label:s("registry.monitorConfiguration.additionalTestContextLabel"),hint:s("registry.monitorConfiguration.additionalTestContextHint")}),t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7",onClick:()=>u(p=>!p),children:[s(a?"registry.monitorConfiguration.hideDefaultPrompt":"registry.monitorConfiguration.viewDefaultPrompt")," ",s("registry.monitorConfiguration.defaultSystemPrompt")]})]}),t.jsx(wt,{value:n.agentContext??"",onChange:p=>m({agentContext:p.target.value}),placeholder:s("registry.monitorConfiguration.agentContextPlaceholder"),rows:3}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:s("registry.monitorConfiguration.agentContextHelper")}),a&&t.jsx("pre",{className:"text-[11px] bg-muted/50 border border-border rounded px-3 py-2 whitespace-pre-wrap max-h-64 overflow-auto",children:Rr})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.perMcpTimeoutLabel"),hint:s("registry.monitorConfiguration.perMcpTimeoutHint")}),t.jsx(ye,{type:"number",value:n.perMcpTimeoutMs,onChange:p=>m({perMcpTimeoutMs:Number(p.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.perToolTimeoutLabel"),hint:s("registry.monitorConfiguration.perToolTimeoutHint")}),t.jsx(ye,{type:"number",value:n.perToolTimeoutMs,onChange:p=>m({perToolTimeoutMs:Number(p.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.maxAgentStepsLabel"),hint:s("registry.monitorConfiguration.maxAgentStepsHint")}),t.jsx(ye,{type:"number",value:n.maxAgentSteps,onChange:p=>m({maxAgentSteps:Number(p.target.value)}),min:1,max:30})]})]})]})}function He(s){const e=Z.c(16),{label:r,hint:i}=s,n=ce();let l;e[0]!==r?(l=t.jsx(ae,{children:r}),e[0]=r,e[1]=l):l=e[1];let c;e[2]!==r||e[3]!==n?(c=n("registry.monitorConfiguration.aboutLabel",{label:r}),e[2]=r,e[3]=n,e[4]=c):c=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Vs,{size:14}),e[5]=o):o=e[5];let a;e[6]!==c?(a=t.jsx(br,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors","aria-label":c,children:o})}),e[6]=c,e[7]=a):a=e[7];let u;e[8]!==i?(u=t.jsx(Nr,{side:"top",className:"max-w-72",children:i}),e[8]=i,e[9]=u):u=e[9];let d;e[10]!==a||e[11]!==u?(d=t.jsxs(Cr,{children:[a,u]}),e[10]=a,e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==l||e[14]!==d?(m=t.jsxs("div",{className:"flex items-center gap-1.5",children:[l,d]}),e[13]=l,e[14]=d,e[15]=m):m=e[15],m}function Li(s){switch(s){case"authenticated":return"bg-success/10 text-success border-success/20";case"needs_auth":return"bg-warning/10 text-warning border-warning/20";default:return"bg-muted text-muted-foreground border-border"}}function Ai(s,e){switch(s){case"authenticated":return e("registry.monitorConnectionsPanel.authenticated");case"needs_auth":return e("registry.monitorConnectionsPanel.needsAuth");default:return e("registry.monitorConnectionsPanel.notChecked")}}function Ui(s){const e=Z.c(4),{icon:r,title:i}=s,[n,l]=M.useState(!1);let c;return e[0]!==r||e[1]!==n||e[2]!==i?(c=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:r&&!n?t.jsx("img",{src:r,alt:i,className:"h-full w-full object-cover",loading:"lazy",onError:()=>l(!0)}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:i.charAt(0).toUpperCase()})}),e[0]=r,e[1]=n,e[2]=i,e[3]=c):c=e[3],c}function Fi({entry:s,onAuthChanged:e,failedToolsCount:r,failedResultCount:i}){const[n,l]=M.useState(!1),[c,o]=M.useState(""),[a,u]=M.useState(!1),d=ce(),m=Tr(),{updateMutation:f}=Ot(),{org:p}=be(),g=Te(),x=Ue(),h=s.mapping.connection_id,y=s.mapping.auth_status,N=s.item?.title??s.mapping.item_id,w=s.item?.server?.icons?.[0]?.src??null,_=s.item?.is_public??!1,b=s.item?.is_unlisted??!1,L=s.source==="request",I=Ae({queryKey:W.monitorConnectionAuthProbe(p.id,h),queryFn:async()=>wr({url:`/api/${p.slug}/mcp/${h}`,token:null,orgId:p.id}),staleTime:1e4,retry:1,refetchOnWindowFocus:!1}),P=I.data,R=I.isLoading,k=P?.supportsOAuth??!1,A=P?.hasOAuthToken??!1,q=P?.isServerError??!1,v=P?.isAuthenticated??!1,S=q?void 0:P?.error,D=R?"checking":q?"server_error":S?"unreachable":k?v?A?"oauth_connected":"connected":"oauth_available":v?"connected":"token_required",F=()=>{m.mutate({connectionId:h,authStatus:"authenticated"},{onSuccess:()=>{e(),Ks(h),x.invalidateQueries({predicate:B=>B.queryKey[1]===Hs&&B.queryKey[3]===h})},onError:B=>G.error(d("registry.monitorConnectionsPanel.failedToSaveAuthStatus",{title:N,error:B instanceof Error?B.message:String(B)}))})},T=async()=>{l(!0);try{const X=(await I.refetch()).data;if(!X){G.error(d("registry.monitorConnectionsPanel.couldNotReachConnection",{title:N}));return}if(X.isAuthenticated){G.success(d("registry.monitorConnectionsPanel.connectionReachable",{title:N}));return}if(X.isServerError){G.error(d("registry.monitorConnectionsPanel.serverErrorConnection",{title:N}));return}if(X.error){G.error(d("registry.monitorConnectionsPanel.connectionUnreachable",{title:N,error:X.error}));return}if(!X.supportsOAuth){G.warning(d("registry.monitorConnectionsPanel.noOAuthSupport",{title:N}));return}G.info(d("registry.monitorConnectionsPanel.openingAuthWindow",{title:N}));const J=await _r({connectionId:h,orgSlug:p.slug,clientName:`MCP Test - ${N}`,timeout:18e4,scope:"offline_access"});if(J.error){G.error(d("registry.monitorConnectionsPanel.oauthFailed",{title:N,error:J.error}));return}if(J.tokenInfo){if(!(await fetch(`/api/${p.slug}/connections/${h}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:J.tokenInfo.accessToken,refreshToken:J.tokenInfo.refreshToken,expiresIn:J.tokenInfo.expiresIn,scope:J.tokenInfo.scope,clientId:J.tokenInfo.clientId,clientSecret:J.tokenInfo.clientSecret,tokenEndpoint:J.tokenInfo.tokenEndpoint})})).ok)if(J.token)await U(J.token);else{G.error(d("registry.monitorConnectionsPanel.failedToSaveOAuthTokens",{title:N}));return}}else J.token&&await U(J.token);G.success(d("registry.monitorConnectionsPanel.connectionAuthenticated",{title:N})),F(),await I.refetch()}catch(B){console.error("[MonitorConnectionsPanel] Auth error:",B),G.error(d("registry.monitorConnectionsPanel.authError",{error:B instanceof Error?B.message:String(B)}))}finally{l(!1)}},U=async B=>{await g.call("COLLECTION_CONNECTIONS_UPDATE",{id:h,data:{connection_token:B}})},E=async()=>{if(!c.trim()){G.error(d("registry.monitorConnectionsPanel.tokenCannotBeEmpty"));return}l(!0);try{await U(c),G.success(d("registry.monitorConnectionsPanel.tokenSaved",{title:N})),u(!1),o(""),F(),await I.refetch()}catch(B){G.error(d("registry.monitorConnectionsPanel.errorSavingToken",{error:B instanceof Error?B.message:String(B)}))}finally{l(!1)}},O=!R&&y==="authenticated"&&!A&&!a&&c.length===0,j=R&&y==="authenticated"&&!a&&c.length===0,$=async B=>{if(L){G.info(d("registry.monitorConnectionsPanel.visibilityOnlyForStore"));return}if(!s.item){G.error(d("registry.monitorConnectionsPanel.registryItemNotFound"));return}try{await f.mutateAsync({id:s.item.id,data:B}),G.success(d("registry.monitorConnectionsPanel.visibilityUpdated")),e()}catch(X){G.error(X instanceof Error?X.message:d("registry.monitorConnectionsPanel.failedToUpdateVisibility"))}};return t.jsxs(me,{className:"p-3 space-y-3 h-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[t.jsx(Ui,{icon:w,title:N},w??N),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N}),t.jsx("p",{className:"text-xs text-muted-foreground break-all",children:s.remoteUrl??"-"}),t.jsxs("div",{className:"mt-1 flex items-center gap-1.5 flex-wrap",children:[t.jsx(V,{variant:"outline",className:te("text-[10px]",Li(y)),children:Ai(y,d)}),t.jsx(V,{variant:_?"default":"secondary",className:"text-[10px]",children:d(_?"registry.monitorConnectionsPanel.public":"registry.monitorConnectionsPanel.notPublic")}),t.jsx(V,{variant:"outline",className:"text-[10px]",children:d(L?"registry.monitorConnectionsPanel.request":"registry.monitorConnectionsPanel.store")}),t.jsxs(V,{variant:"outline",className:te("text-[10px]",D==="server_error"||D==="unreachable"?"border-destructive/40 text-destructive":D==="oauth_connected"?"border-success/30 text-success":D==="oauth_available"?"border-sky-500/30 text-sky-600":D==="token_required"?"border-warning/30 text-warning":"text-muted-foreground"),children:[D==="checking"&&d("registry.monitorConnectionsPanel.checkingAuth"),D==="server_error"&&d("registry.monitorConnectionsPanel.serverError"),D==="unreachable"&&d("registry.monitorConnectionsPanel.unreachable"),D==="oauth_connected"&&d("registry.monitorConnectionsPanel.oauthConnected"),D==="oauth_available"&&d("registry.monitorConnectionsPanel.oauthAvailable"),D==="token_required"&&d("registry.monitorConnectionsPanel.tokenManualAuth"),D==="connected"&&d("registry.monitorConnectionsPanel.connected")]}),b&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:d("registry.monitorConnectionsPanel.hiddenInPrivate")}),(i>0||r>0)&&t.jsx(V,{variant:"destructive",className:"text-[10px]",children:d("registry.monitorConnectionsPanel.failedCount",{mcpCount:i,toolsCount:r})})]})]})]}),t.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":d("registry.monitorConnectionsPanel.actionsFor",{title:N}),children:t.jsx($t,{size:16})})}),t.jsx(ht,{align:"end",children:L?t.jsx(Re,{disabled:!0,children:d("registry.monitorConnectionsPanel.requestItemNoControls")}):t.jsxs(t.Fragment,{children:[t.jsx(Re,{onClick:()=>$({is_public:!1}),children:d("registry.monitorConnectionsPanel.hideFromPublicStore")}),t.jsx(Re,{onClick:()=>$({is_unlisted:!0}),children:d("registry.monitorConnectionsPanel.hideFromPrivateStore")}),t.jsx(Re,{onClick:()=>$({is_public:!0,is_unlisted:!1}),children:d("registry.monitorConnectionsPanel.showInBothStores")})]})})]})})]}),t.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 flex-wrap",children:[k&&t.jsx(Y,{size:"sm",onClick:T,disabled:n,children:n?"...":d(A?"registry.monitorConnectionsPanel.reAuthOAuth":"registry.monitorConnectionsPanel.oauth")}),t.jsx(Y,{size:"sm",variant:"outline",onClick:()=>I.refetch(),disabled:n||R,children:d(R?"registry.monitorConnectionsPanel.checking":"registry.monitorConnectionsPanel.reCheck")})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:d("registry.monitorConnectionsPanel.tokenApiKeyDescription")}),j?t.jsx("div",{className:"h-8 px-3 flex items-center rounded-md border border-border bg-muted/30 text-muted-foreground text-xs",children:d("registry.monitorConnectionsPanel.checkingAuth")}):O?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-8 px-3 flex items-center rounded-md border border-border bg-muted/50 text-muted-foreground font-mono text-xs",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u(!0),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted",title:d("registry.monitorConnectionsPanel.replaceToken"),children:d("registry.monitorConnectionsPanel.edit")})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ye,{type:"password",placeholder:d("registry.monitorConnectionsPanel.pasteApiTokenPlaceholder"),value:c,onChange:B=>o(B.target.value),className:"h-8 text-xs flex-1",onKeyDown:B=>{B.key==="Enter"&&!n&&c.trim()&&E()}}),t.jsx(Y,{size:"sm",className:"h-8 text-xs",onClick:E,disabled:n||!c.trim(),children:d("registry.monitorConnectionsPanel.save")}),t.jsx(Y,{size:"sm",variant:"ghost",className:"h-8 text-xs","aria-label":d("registry.monitorConnectionsPanel.cancelReplaceToken"),onClick:()=>{u(!1),o("")},children:"✕"})]})]})]})}function $i(){const s=Z.c(87),e=ce(),r=hs(),n=Pt("completed").data?.items?.[0],l=ut(n?.id,void 0,n?.status),c=Dr(),[o,a]=M.useState("all");let u,d,m,f,p,g;if(s[0]!==r||s[1]!==l.data?.items||s[2]!==o||s[3]!==c||s[4]!==e){const y=r.data?.items??[];let N;s[11]!==l.data?.items?(N=(l.data?.items??[]).reduce(zi,{}),s[11]=l.data?.items,s[12]=N):N=s[12];const w=N;let _;s[13]!==o?(_=H=>o==="all"?!0:H.source===o,s[13]=o,s[14]=_):_=s[14];const b=y.filter(_);u=me,p="p-4 space-y-3";let L;s[15]!==e?(L=e("registry.monitorConnectionsPanel.title"),s[15]=e,s[16]=L):L=s[16];let I;s[17]!==L?(I=t.jsx("h3",{className:"text-sm font-semibold",children:L}),s[17]=L,s[18]=I):I=s[18];let P;s[19]!==e?(P=e("registry.monitorConnectionsPanel.description1"),s[19]=e,s[20]=P):P=s[20];let R;s[21]!==P?(R=t.jsx("p",{className:"text-[10px] text-muted-foreground",children:P}),s[21]=P,s[22]=R):R=s[22];let k;s[23]!==e?(k=e("registry.monitorConnectionsPanel.description2"),s[23]=e,s[24]=k):k=s[24];let A;s[25]!==k?(A=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:k}),s[25]=k,s[26]=A):A=s[26];let q;s[27]!==e?(q=e("registry.monitorConnectionsPanel.description3"),s[27]=e,s[28]=q):q=s[28];let v;s[29]!==q?(v=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:q}),s[29]=q,s[30]=v):v=s[30];const S=o==="all"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let D;s[31]!==S?(D=te("px-2.5 py-1 text-xs rounded-md transition-colors",S),s[31]=S,s[32]=D):D=s[32];let F;s[33]===Symbol.for("react.memo_cache_sentinel")?(F=()=>a("all"),s[33]=F):F=s[33];let T;s[34]!==e?(T=e("registry.monitorConnectionsPanel.filterAll"),s[34]=e,s[35]=T):T=s[35];let U;s[36]!==D||s[37]!==T?(U=t.jsx("button",{type:"button",className:D,onClick:F,children:T}),s[36]=D,s[37]=T,s[38]=U):U=s[38];const E=o==="store"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let O;s[39]!==E?(O=te("px-2.5 py-1 text-xs rounded-md transition-colors",E),s[39]=E,s[40]=O):O=s[40];let j;s[41]===Symbol.for("react.memo_cache_sentinel")?(j=()=>a("store"),s[41]=j):j=s[41];let $;s[42]!==e?($=e("registry.monitorConnectionsPanel.filterStore"),s[42]=e,s[43]=$):$=s[43];let B;s[44]!==O||s[45]!==$?(B=t.jsx("button",{type:"button",className:O,onClick:j,children:$}),s[44]=O,s[45]=$,s[46]=B):B=s[46];const X=o==="request"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let J;s[47]!==X?(J=te("px-2.5 py-1 text-xs rounded-md transition-colors",X),s[47]=X,s[48]=J):J=s[48];let de;s[49]===Symbol.for("react.memo_cache_sentinel")?(de=()=>a("request"),s[49]=de):de=s[49];let se;s[50]!==e?(se=e("registry.monitorConnectionsPanel.filterRequests"),s[50]=e,s[51]=se):se=s[51];let ne;s[52]!==J||s[53]!==se?(ne=t.jsx("button",{type:"button",className:J,onClick:de,children:se}),s[52]=J,s[53]=se,s[54]=ne):ne=s[54];let ge;s[55]!==U||s[56]!==B||s[57]!==ne?(ge=t.jsxs("div",{className:"mt-2 inline-flex rounded-lg border border-border p-0.5",children:[U,B,ne]}),s[55]=U,s[56]=B,s[57]=ne,s[58]=ge):ge=s[58];let ue;s[59]!==R||s[60]!==A||s[61]!==v||s[62]!==ge||s[63]!==I?(ue=t.jsxs("div",{children:[I,R,A,v,ge]}),s[59]=R,s[60]=A,s[61]=v,s[62]=ge,s[63]=I,s[64]=ue):ue=s[64];let ie;s[65]!==c||s[66]!==e?(ie=()=>{c.mutate(void 0,{onSuccess:()=>G.success(e("registry.monitorConnectionsPanel.connectionsSynced")),onError:H=>G.error(e("registry.monitorConnectionsPanel.syncFailed",{error:H.message}))})},s[65]=c,s[66]=e,s[67]=ie):ie=s[67];let C;s[68]!==c.isPending||s[69]!==e?(C=c.isPending?e("registry.monitorConnectionsPanel.syncing"):e("registry.monitorConnectionsPanel.sync"),s[68]=c.isPending,s[69]=e,s[70]=C):C=s[70];let K;s[71]!==c.isPending||s[72]!==ie||s[73]!==C?(K=t.jsx(Y,{size:"sm",variant:"outline",onClick:ie,disabled:c.isPending,children:C}),s[71]=c.isPending,s[72]=ie,s[73]=C,s[74]=K):K=s[74],s[75]!==ue||s[76]!==K?(g=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ue,K]}),s[75]=ue,s[76]=K,s[77]=g):g=s[77],d="space-y-2",m=r.isLoading?t.jsx("p",{className:"text-xs text-muted-foreground text-center py-3",children:e("registry.monitorConnectionsPanel.loadingConnections")}):r.isError?t.jsxs("div",{className:"p-8 text-center rounded-lg border border-border",children:[t.jsx("p",{className:"text-sm text-destructive",children:e("registry.monitorConnectionsPanel.loadFailed")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r.error instanceof Error?r.error.message:e("registry.monitorConnectionsPanel.unknownError")})]}):b.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-3",children:e("registry.monitorConnectionsPanel.noConnectionsForFilter")}),f=!r.isLoading&&!r.isError&&b.length>0&&t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:b.map(H=>{const re=w[H.mapping.item_id]??{failedTools:0,failedResults:0};return t.jsx(Fi,{entry:H,onAuthChanged:()=>r.refetch(),failedToolsCount:re.failedTools,failedResultCount:re.failedResults},H.mapping.id)})}),s[0]=r,s[1]=l.data?.items,s[2]=o,s[3]=c,s[4]=e,s[5]=u,s[6]=d,s[7]=m,s[8]=f,s[9]=p,s[10]=g}else u=s[5],d=s[6],m=s[7],f=s[8],p=s[9],g=s[10];let x;s[78]!==d||s[79]!==m||s[80]!==f?(x=t.jsxs("div",{className:d,children:[m,f]}),s[78]=d,s[79]=m,s[80]=f,s[81]=x):x=s[81];let h;return s[82]!==u||s[83]!==p||s[84]!==g||s[85]!==x?(h=t.jsxs(u,{className:p,children:[g,x]}),s[82]=u,s[83]=p,s[84]=g,s[85]=x,s[86]=h):h=s[86],h}function zi(s,e){const r=s[e.item_id]??{failedTools:0,failedResults:0},i=e.tool_results.filter(Oi).length;return r.failedTools=r.failedTools+i,(e.status==="failed"||e.status==="error")&&(r.failedResults=r.failedResults+1),s[e.item_id]=r,s}function Oi(s){return!s.success}function ws(s){switch(s){case"running":return"bg-primary/10 text-primary border-primary/20";case"completed":return"bg-success/10 text-success border-success/20";case"failed":return"bg-destructive/10 text-destructive border-destructive/20";case"cancelled":return"bg-muted text-muted-foreground border-border";case"pending":return"bg-warning/10 text-warning border-warning/20";default:return""}}function _s(s,e){if(!s)return null;const r=e?new Date(e).getTime():Date.now(),i=new Date(s).getTime(),n=r-i;return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.round(n%6e4/1e3)}s`}function Bi(s){const e=new Map;for(const r of s)e.has(r.toolName)&&e.delete(r.toolName),e.set(r.toolName,r);return Array.from(e.values())}function Ps(s){const e=Bi(s),r=e.every(c=>c.outputPreview==="health_check: not called"),i=e.filter(c=>c.outputPreview!=="health_check: not called"),n=i.filter(c=>c.success).length,l=i.filter(c=>!c.success).length;return{latestToolResults:e,realToolTests:i,isHealthCheck:r,passedTools:n,failedTools:l,hasToolTests:i.length>0}}function Ki(s){return s.total_items?Math.min(100,Math.round(s.tested_items/s.total_items*100)):0}function Hi(s){if(!s)return null;const e=s.match(/Not executed tools \((\d+)\/(\d+)\):/i);if(!e)return null;const r=Number(e[2]);return Number.isFinite(r)&&r>=0?r:null}function Vi(s){const e=Z.c(45),{result:r,index:i,icon:n}=s,l=ce(),[c,o]=M.useState(!1);let a;if(e[0]!==c||e[1]!==n||e[2]!==i||e[3]!==r.action_taken||e[4]!==r.agent_summary||e[5]!==r.connection_ok||e[6]!==r.duration_ms||e[7]!==r.error_message||e[8]!==r.id||e[9]!==r.item_title||e[10]!==r.status||e[11]!==r.tool_results||e[12]!==r.tools_listed||e[13]!==l){const{latestToolResults:u,realToolTests:d,isHealthCheck:m,passedTools:f,failedTools:p,hasToolTests:g}=Ps(r.tool_results),x=d.length;let h;e[15]!==r.agent_summary?(h=Hi(r.agent_summary),e[15]=r.agent_summary,e[16]=h):h=e[16];const y=h,N=Math.max(u.length,y??0),w=N>0?l("registry.monitorDashboard.toolsTestedCount",{tested:x,discovered:N}):l("registry.monitorDashboard.noTools");let _;e[17]!==c?(_=()=>o(!c),e[17]=c,e[18]=_):_=e[18];const b=i+1;let L;e[19]!==b?(L=t.jsx("span",{className:"text-muted-foreground w-5 text-right shrink-0",children:b}),e[19]=b,e[20]=L):L=e[20];let I;e[21]!==n||e[22]!==r.item_title?(I=t.jsx("div",{className:"size-5 rounded border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:n?t.jsx("img",{src:n,alt:r.item_title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[9px] font-semibold text-muted-foreground",children:r.item_title.charAt(0).toUpperCase()})}),e[21]=n,e[22]=r.item_title,e[23]=I):I=e[23];const P=r.status==="passed"?"text-success":r.status==="needs_auth"?"text-warning":"text-destructive";let R;e[24]!==P?(R=te("shrink-0",P),e[24]=P,e[25]=R):R=e[25];const k=r.status==="passed"?"✓":r.status==="needs_auth"?"🔑":"✗";let A;e[26]!==R||e[27]!==k?(A=t.jsx("span",{className:R,children:k}),e[26]=R,e[27]=k,e[28]=A):A=e[28];let q;e[29]!==r.item_title?(q=t.jsx("span",{className:"font-medium truncate flex-1 min-w-0",children:r.item_title}),e[29]=r.item_title,e[30]=q):q=e[30];let v;e[31]!==r.duration_ms?(v=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.duration_ms,"ms"]}),e[31]=r.duration_ms,e[32]=v):v=e[32];const S=r.status==="passed"?"text-success border-success/20":r.status==="needs_auth"?"text-warning border-warning/20":"text-destructive border-destructive/20";let D;e[33]!==S?(D=te("text-[9px] capitalize shrink-0",S),e[33]=S,e[34]=D):D=e[34];let F;e[35]!==r.status?(F=r.status.replace("_"," "),e[35]=r.status,e[36]=F):F=e[36];let T;e[37]!==D||e[38]!==F?(T=t.jsx(V,{variant:"outline",className:D,children:F}),e[37]=D,e[38]=F,e[39]=T):T=e[39];let U;e[40]!==r.connection_ok||e[41]!==l?(U=r.connection_ok?t.jsx("span",{className:"text-[10px] text-success shrink-0",title:l("registry.monitorDashboard.connOkTitle"),children:"conn✓"}):t.jsx("span",{className:"text-[10px] text-destructive shrink-0",title:l("registry.monitorDashboard.connFailTitle"),children:"conn✗"}),e[40]=r.connection_ok,e[41]=l,e[42]=U):U=e[42];const E=c?"▲":"▼";let O;e[43]!==E?(O=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:E}),e[43]=E,e[44]=O):O=e[44],a=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[t.jsxs("button",{type:"button",className:"w-full text-left flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-muted/30 transition-colors",onClick:_,children:[L,I,A,q,v,T,U,r.tools_listed&&t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:g?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-success",children:[f,"✓"]})," ",t.jsxs("span",{className:te(p>0?"text-destructive":""),children:[p,"✗"]})]}):m&&u.length>0?t.jsx("span",{children:l("registry.monitorDashboard.toolsFoundCount",{count:u.length})}):l("registry.monitorDashboard.noToolsLabel")}),t.jsx(V,{variant:"outline",className:"text-[9px] shrink-0",children:w}),O]}),c&&t.jsxs("div",{className:"border-t border-border px-3 py-2 space-y-2 bg-muted/10",children:[r.error_message&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:l("registry.monitorDashboard.errorLabel")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-destructive max-h-20 overflow-auto",children:r.error_message})]}),t.jsxs("div",{className:"flex items-center gap-3 text-[10px] flex-wrap",children:[t.jsxs("span",{children:[l("registry.monitorDashboard.connectionLabel")," ",t.jsx("span",{className:te(r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?l("registry.monitorDashboard.statusOk"):l("registry.monitorDashboard.statusFailed")})]}),t.jsxs("span",{children:[l("registry.monitorDashboard.toolsListedLabel")," ",t.jsx("span",{className:te(r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?l("registry.monitorDashboard.yes"):l("registry.monitorDashboard.no")})]}),r.action_taken!=="none"&&t.jsxs(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]})]}),g?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:l("registry.monitorDashboard.toolsTestedDetails",{passed:f,failed:p})}),t.jsx("div",{className:"space-y-0.5",children:d.map((j,$)=>t.jsx(Gi,{tool:j},`${r.id}-${j.toolName}-${$}`))})]}):m&&u.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:l("registry.monitorDashboard.toolsDiscoveredHealthCheck",{count:u.length})}),t.jsx("div",{className:"flex flex-wrap gap-1",children:u.map((j,$)=>t.jsx(V,{variant:"outline",className:"text-[10px] font-mono",children:j.toolName},`${r.id}-${j.toolName}-${$}`))})]}):r.tools_listed?t.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:l("registry.monitorDashboard.noToolsFound")}):null,r.agent_summary&&t.jsx("p",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5",children:r.agent_summary})]})]}),e[0]=c,e[1]=n,e[2]=i,e[3]=r.action_taken,e[4]=r.agent_summary,e[5]=r.connection_ok,e[6]=r.duration_ms,e[7]=r.error_message,e[8]=r.id,e[9]=r.item_title,e[10]=r.status,e[11]=r.tool_results,e[12]=r.tools_listed,e[13]=l,e[14]=a}else a=e[14];return a}function Gi(s){const e=Z.c(31),{tool:r}=s,i=ce(),[n,l]=M.useState(!1);let c;e[0]!==n?(c=()=>l(!n),e[0]=n,e[1]=c):c=e[1];const o=r.success?"text-success":"text-destructive";let a;e[2]!==o?(a=te("font-bold",o),e[2]=o,e[3]=a):a=e[3];const u=r.success?"✓":"✗";let d;e[4]!==a||e[5]!==u?(d=t.jsx("span",{className:a,children:u}),e[4]=a,e[5]=u,e[6]=d):d=e[6];let m;e[7]!==r.toolName?(m=t.jsx("span",{className:"font-mono truncate flex-1",children:r.toolName}),e[7]=r.toolName,e[8]=m):m=e[8];let f;e[9]!==r.durationMs?(f=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=f):f=e[10];let p;e[11]!==r.error?(p=r.error&&t.jsx("span",{className:"text-destructive truncate max-w-28",title:r.error,children:r.error}),e[11]=r.error,e[12]=p):p=e[12];const g=n?"▲":"▼";let x;e[13]!==g?(x=t.jsx("span",{className:"text-muted-foreground",children:g}),e[13]=g,e[14]=x):x=e[14];let h;e[15]!==c||e[16]!==x||e[17]!==d||e[18]!==m||e[19]!==f||e[20]!==p?(h=t.jsxs("button",{type:"button",className:"w-full text-left flex items-center gap-2 px-2 py-1 text-[11px] hover:bg-muted/30 transition-colors",onClick:c,children:[d,m,f,p,x]}),e[15]=c,e[16]=x,e[17]=d,e[18]=m,e[19]=f,e[20]=p,e[21]=h):h=e[21];let y;e[22]!==n||e[23]!==i||e[24]!==r.error||e[25]!==r.input||e[26]!==r.outputPreview?(y=n&&t.jsxs("div",{className:"border-t border-border px-2 py-1.5 space-y-1 bg-muted/10 text-[11px]",children:[r.error&&t.jsx("pre",{className:"bg-destructive/5 border border-destructive/10 rounded px-2 py-1 whitespace-pre-wrap break-all text-destructive max-h-20 overflow-auto",children:r.error}),r.input&&Object.keys(r.input).length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorDashboard.inputLabel")}),t.jsx("pre",{className:"bg-muted/50 rounded px-2 py-1 whitespace-pre-wrap break-all max-h-16 overflow-auto",children:JSON.stringify(r.input,null,2)})]}),r.outputPreview&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorDashboard.outputLabel")}),t.jsx("pre",{className:"bg-muted/50 rounded px-2 py-1 whitespace-pre-wrap break-all max-h-16 overflow-auto",children:r.outputPreview})]})]}),e[22]=n,e[23]=i,e[24]=r.error,e[25]=r.input,e[26]=r.outputPreview,e[27]=y):y=e[27];let N;return e[28]!==h||e[29]!==y?(N=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[h,y]}),e[28]=h,e[29]=y,e[30]=N):N=e[30],N}function Qi({activeRunId:s,onRunChange:e}){const r=ce(),{settings:i}=fs(),[n,l]=M.useState(null),[c,o]=M.useState(!1),a=M.useRef(0),u=M.useRef(null),d=Ir(),m=kr(),f=zt(s),p=Pt(),g=hs(),x=f.data?.run??null,h=x?.status,y=x?.config_snapshot?.monitorMode??x?.config_snapshot?.testMode,N=ut(s,void 0,h),w=(p.data?.items??[]).find(v=>v.status==="running"),_=p.data?.items?.[0]?.id;!s&&_&&u.current!==_&&(u.current=_,queueMicrotask(()=>{e(_)}));const b=async()=>{const v=Date.now();if(v-a.current<1e3)return;a.current=v;const S=n??i.monitorMode,D=await d.mutateAsync({...i,monitorMode:S});e(D.run.id)},L=async()=>{if(w&&w.id!==s&&w.status==="running"){o(!0);return}await b()},I=async()=>{s&&await m.mutateAsync(s)},P=x?.status==="running",R=x?_s(x.started_at,x.finished_at):null,k=N.data?.items??[],A=(g.data?.items??[]).reduce((v,S)=>(v[S.mapping.item_id]=S.item?.server?.icons?.[0]?.src??null,v),{}),q=n??i.monitorMode;return t.jsxs("div",{className:"space-y-4 min-w-0",children:[t.jsxs("div",{className:"space-y-4 min-w-0",children:[t.jsxs(me,{className:"p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:r("registry.monitorDashboard.currentQaRunTitle")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.currentQaRunDescription")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[w&&w.id!==s&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.runInProgressBadge",{runId:w.id.slice(0,8)})}),t.jsxs(Y,{size:"sm",onClick:L,disabled:d.isPending||P,className:"gap-1.5",children:[t.jsx(Pr,{size:14}),d.isPending?r("registry.monitorDashboard.startingButton"):w&&w.id!==s?r("registry.monitorDashboard.startAnotherRunButton"):r("registry.monitorDashboard.startQaRunButton")]}),t.jsxs(Y,{size:"sm",variant:"outline",onClick:I,disabled:!s||!P,className:"gap-1.5",children:[t.jsx(Gs,{size:14}),r("registry.monitorDashboard.cancelButton")]})]})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:r("registry.monitorDashboard.qaModeLabel")}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:q,onChange:v=>l(v.target.value),disabled:P,children:[t.jsx("option",{value:"health_check",children:r("registry.monitorDashboard.modeHealthCheck")}),t.jsx("option",{value:"tool_call",children:r("registry.monitorDashboard.modeToolCall")}),t.jsx("option",{value:"full_agent",children:r("registry.monitorDashboard.modeAgentic")})]})]}),t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:r("registry.monitorDashboard.qaRunHistoryLabel")}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:s??"",onChange:v=>e(v.target.value||void 0),children:[t.jsx("option",{value:"",children:r("registry.monitorDashboard.autoSelectLatestRun")}),(p.data?.items??[]).map(v=>t.jsxs("option",{value:v.id,children:[new Date(v.created_at).toLocaleString()," -"," ",v.status]},v.id))]})]})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground rounded-md bg-muted/30 px-2.5 py-2",children:r(q==="health_check"?"registry.monitorDashboard.modeDescriptionHealthCheck":q==="tool_call"?"registry.monitorDashboard.modeDescriptionToolCall":"registry.monitorDashboard.modeDescriptionAgentic")}),x?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx(V,{className:te("capitalize",ws(x.status),x.status==="running"?"animate-pulse":""),children:x.status}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.itemsTestedCount",{tested:x.tested_items,total:x.total_items})}),R&&t.jsx("span",{className:"text-xs text-muted-foreground",children:R}),P&&x.current_item_id&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-64",children:[r("registry.monitorDashboard.qaOnLabel")," ",t.jsx("span",{className:"font-mono",children:x.current_item_id})]})]}),t.jsx("div",{className:"h-2.5 rounded-full bg-muted overflow-hidden",children:t.jsx("div",{className:te("h-full transition-all duration-500",x.failed_items>0?"bg-warning":"bg-success",P?"animate-pulse":""),style:{width:`${Ki(x)}%`}})}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-success",children:r("registry.monitorDashboard.passedLabel")}),t.jsx("p",{className:"text-lg font-bold text-success",children:x.passed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-destructive",children:r("registry.monitorDashboard.failedLabel")}),t.jsx("p",{className:"text-lg font-bold text-destructive",children:x.failed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:r("registry.monitorDashboard.skippedLabel")}),t.jsx("p",{className:"text-lg font-bold",children:x.skipped_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:r("registry.monitorDashboard.totalLabel")}),t.jsx("p",{className:"text-lg font-bold",children:x.total_items})]})]})]}):t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.noRunSelectedMessage")})]}),t.jsxs(me,{className:"p-4 space-y-2 min-h-[360px]",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:r("registry.monitorDashboard.qaResultsLogTitle",{count:k.length})}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:r("registry.monitorDashboard.qaResultsLogDescription")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[P&&t.jsx(V,{className:"bg-primary/10 text-primary border-primary/20 animate-pulse",children:r("registry.monitorDashboard.runInProgressLabel")}),x&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.progressBadge",{tested:x.tested_items,total:x.total_items})}),y&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.modeBadge",{mode:y.replace("_"," ")})})]})]}),k.length===0?t.jsx("div",{className:"h-[280px] rounded border border-dashed border-border flex items-center justify-center text-xs text-muted-foreground",children:r("registry.monitorDashboard.noResultsYetMessage")}):t.jsx("div",{ref:v=>{v&&P&&v.scrollHeight-v.scrollTop-v.clientHeight<120&&requestAnimationFrame(()=>{v.scrollTop=v.scrollHeight})},className:"space-y-1 max-h-[60vh] overflow-auto pr-1",children:k.map((v,S)=>t.jsx(Vi,{result:v,index:S,icon:A[v.item_id]},v.id))})]})]}),t.jsx(ct,{open:c,onOpenChange:o,children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:r("registry.monitorDashboard.confirmStartTitle")}),t.jsx(rt,{children:r("registry.monitorDashboard.confirmStartDescription",{runId:w?` (${w.id})`:""})})]}),t.jsxs(ot,{children:[t.jsx(nt,{children:r("registry.monitorDashboard.cancelButtonDialog")}),t.jsx(at,{onClick:()=>{o(!1),b()},children:r("registry.monitorDashboard.startAnywayButton")})]})]})})]})}function Rs(s){switch(s){case"passed":return"bg-success/10 text-success border-success/20";case"failed":case"error":return"bg-destructive/10 text-destructive border-destructive/20";case"needs_auth":return"bg-warning/10 text-warning border-warning/20";case"skipped":return"bg-muted text-muted-foreground border-border";default:return""}}function Yi(s){switch(s){case"passed":return"✓";case"failed":return"✗";case"error":return"⚠";case"needs_auth":return"🔑";case"skipped":return"⏭";default:return"?"}}function Wi(s){const e=Z.c(28),{tool:r}=s,i=ce(),[n,l]=M.useState(!1);let c;e[0]!==n?(c=()=>l(!n),e[0]=n,e[1]=c):c=e[1];const o=r.success?"text-success":"text-destructive";let a;e[2]!==o?(a=te("text-xs font-bold",o),e[2]=o,e[3]=a):a=e[3];const u=r.success?"✓":"✗";let d;e[4]!==a||e[5]!==u?(d=t.jsx("span",{className:a,children:u}),e[4]=a,e[5]=u,e[6]=d):d=e[6];let m;e[7]!==r.toolName?(m=t.jsx("span",{className:"text-xs font-mono truncate flex-1",children:r.toolName}),e[7]=r.toolName,e[8]=m):m=e[8];let f;e[9]!==r.durationMs?(f=t.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=f):f=e[10];const p=n?"▲":"▼";let g;e[11]!==p?(g=t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p}),e[11]=p,e[12]=g):g=e[12];let x;e[13]!==c||e[14]!==d||e[15]!==m||e[16]!==f||e[17]!==g?(x=t.jsxs("button",{type:"button",className:"w-full text-left px-3 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",onClick:c,children:[d,m,f,g]}),e[13]=c,e[14]=d,e[15]=m,e[16]=f,e[17]=g,e[18]=x):x=e[18];let h;e[19]!==n||e[20]!==i||e[21]!==r.error||e[22]!==r.input||e[23]!==r.outputPreview?(h=n&&t.jsxs("div",{className:"border-t border-border px-3 py-2 space-y-1.5 bg-muted/20",children:[r.error&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.monitorRunDetail.error")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-destructive",children:r.error})]}),r.input&&Object.keys(r.input).length>0&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.input")}),t.jsx("pre",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5 whitespace-pre-wrap break-all max-h-24 overflow-auto",children:JSON.stringify(r.input,null,2)})]}),r.outputPreview&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.outputPreview")}),t.jsx("pre",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5 whitespace-pre-wrap break-all max-h-24 overflow-auto",children:r.outputPreview})]}),!r.error&&!r.outputPreview&&(!r.input||Object.keys(r.input).length===0)&&t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.noAdditionalDetails")})]}),e[19]=n,e[20]=i,e[21]=r.error,e[22]=r.input,e[23]=r.outputPreview,e[24]=h):h=e[24];let y;return e[25]!==x||e[26]!==h?(y=t.jsxs("div",{className:"rounded border border-border",children:[x,h]}),e[25]=x,e[26]=h,e[27]=y):y=e[27],y}function Ji(s){const e=Z.c(60),{result:r}=s,i=ce(),[n,l]=M.useState(r.status!=="passed");let c;if(e[0]!==n||e[1]!==r.action_taken||e[2]!==r.agent_summary||e[3]!==r.connection_ok||e[4]!==r.duration_ms||e[5]!==r.error_message||e[6]!==r.id||e[7]!==r.item_title||e[8]!==r.status||e[9]!==r.tool_results||e[10]!==r.tools_listed||e[11]!==i){const{latestToolResults:o,realToolTests:a,isHealthCheck:u,passedTools:d,failedTools:m,hasToolTests:f}=Ps(r.tool_results);let p;e[13]!==n?(p=()=>l(!n),e[13]=n,e[14]=p):p=e[14];let g;e[15]!==r.status?(g=Yi(r.status),e[15]=r.status,e[16]=g):g=e[16];let x;e[17]!==g?(x=t.jsx("span",{className:"text-base shrink-0",children:g}),e[17]=g,e[18]=x):x=e[18];let h;e[19]!==r.item_title?(h=t.jsx("p",{className:"text-sm font-medium truncate",children:r.item_title}),e[19]=r.item_title,e[20]=h):h=e[20];let y;e[21]!==r.duration_ms?(y=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[r.duration_ms,"ms"]}),e[21]=r.duration_ms,e[22]=y):y=e[22];let N;e[23]!==i?(N=i("registry.monitorRunDetail.conn"),e[23]=i,e[24]=N):N=e[24];const w=r.connection_ok?"✓":"✗";let _;e[25]!==N||e[26]!==w?(_=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[N,":"," ",w]}),e[25]=N,e[26]=w,e[27]=_):_=e[27];let b;e[28]!==i?(b=i("registry.monitorRunDetail.toolsListed"),e[28]=i,e[29]=b):b=e[29];const L=r.tools_listed?"✓":"✗";let I;e[30]!==b||e[31]!==L?(I=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[b,":"," ",L]}),e[30]=b,e[31]=L,e[32]=I):I=e[32];const P=o.length>0&&t.jsx("span",{className:"text-[10px] text-muted-foreground",children:f?t.jsxs(t.Fragment,{children:[i("registry.monitorRunDetail.tools"),": ",d,"✓"," ",m,"✗"]}):t.jsxs(t.Fragment,{children:[o.length," ",i("registry.monitorRunDetail.toolsFound")]})});let R;e[33]!==r.action_taken||e[34]!==i?(R=r.action_taken!=="none"&&t.jsxs(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:[i("registry.monitorRunDetail.action"),": ",r.action_taken]}),e[33]=r.action_taken,e[34]=i,e[35]=R):R=e[35];let k;e[36]!==I||e[37]!==P||e[38]!==R||e[39]!==y||e[40]!==_?(k=t.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[y,_,I,P,R]}),e[36]=I,e[37]=P,e[38]=R,e[39]=y,e[40]=_,e[41]=k):k=e[41];let A;e[42]!==k||e[43]!==h?(A=t.jsxs("div",{className:"min-w-0 flex-1",children:[h,k]}),e[42]=k,e[43]=h,e[44]=A):A=e[44];let q;e[45]!==r.status?(q=te("capitalize shrink-0",Rs(r.status)),e[45]=r.status,e[46]=q):q=e[46];let v;e[47]!==r.status?(v=r.status.replace("_"," "),e[47]=r.status,e[48]=v):v=e[48];let S;e[49]!==q||e[50]!==v?(S=t.jsx(V,{className:q,children:v}),e[49]=q,e[50]=v,e[51]=S):S=e[51];const D=n?"▲":"▼";let F;e[52]!==D?(F=t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:D}),e[52]=D,e[53]=F):F=e[53];let T;e[54]!==A||e[55]!==S||e[56]!==p||e[57]!==F||e[58]!==x?(T=t.jsxs("button",{type:"button",className:"w-full text-left px-4 py-3 flex items-center gap-3 hover:bg-muted/30 transition-colors",onClick:p,children:[x,A,S,F]}),e[54]=A,e[55]=S,e[56]=p,e[57]=F,e[58]=x,e[59]=T):T=e[59],c=t.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[T,n&&t.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-2 bg-muted/10",children:[t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.connection")}),t.jsx("p",{className:te("text-xs font-medium",r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?i("registry.monitorRunDetail.connected"):i("registry.monitorRunDetail.failed")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.toolsListedLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?i("registry.monitorRunDetail.yesWithCount",{count:o.length}):i("registry.monitorRunDetail.no")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.duration")}),t.jsxs("p",{className:"text-xs font-medium",children:[r.duration_ms,"ms"]})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.actionTaken")}),t.jsx("p",{className:"text-xs font-medium capitalize",children:r.action_taken.replace(/_/g," ")})]})]}),r.error_message&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.monitorRunDetail.errorMessage")}),t.jsx("pre",{className:"text-xs bg-destructive/5 border border-destructive/10 rounded px-3 py-2 whitespace-pre-wrap break-all text-destructive",children:r.error_message})]}),f?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.toolResults",{passed:d,failed:m})}),t.jsx("div",{className:"space-y-1",children:a.map((U,E)=>t.jsx(Wi,{tool:U},`${r.id}-${U.toolName}-${E}`))})]}):u&&o.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.toolsDiscovered",{count:o.length})}),t.jsx("div",{className:"flex flex-wrap gap-1",children:o.map((U,E)=>t.jsx(V,{variant:"outline",className:"text-[10px] font-mono",children:U.toolName},`${r.id}-${U.toolName}-${E}`))})]}):null,r.agent_summary&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.agentSummary")}),t.jsx("p",{className:"text-xs bg-muted/50 rounded px-3 py-2",children:r.agent_summary})]})]})]}),e[0]=n,e[1]=r.action_taken,e[2]=r.agent_summary,e[3]=r.connection_ok,e[4]=r.duration_ms,e[5]=r.error_message,e[6]=r.id,e[7]=r.item_title,e[8]=r.status,e[9]=r.tool_results,e[10]=r.tools_listed,e[11]=i,e[12]=c}else c=e[12];return c}function Zi(s){const e=Z.c(4),{value:r,onChange:i}=s,n=ce();let l;if(e[0]!==i||e[1]!==n||e[2]!==r){const c=[{value:"all",labelKey:"registry.monitorRunDetail.filterAll"},{value:"passed",labelKey:"registry.monitorRunDetail.filterPassed"},{value:"failed",labelKey:"registry.monitorRunDetail.filterFailed"},{value:"error",labelKey:"registry.monitorRunDetail.filterError"},{value:"needs_auth",labelKey:"registry.monitorRunDetail.filterNeedsAuth"},{value:"skipped",labelKey:"registry.monitorRunDetail.filterSkipped"}];l=t.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:c.map(o=>t.jsx("button",{type:"button",className:te("text-[11px] px-2 py-0.5 rounded-full border transition-colors",r===o.value?"bg-primary text-primary-foreground border-primary":"bg-muted/30 border-border hover:bg-muted/50"),onClick:()=>i(o.value),children:n(o.labelKey)},o.value))}),e[0]=i,e[1]=n,e[2]=r,e[3]=l}else l=e[3];return l}function Xi(s){const e=Z.c(81),{runId:r}=s,i=ce(),[n,l]=M.useState("all"),c=zt(r),o=c.data?.run,a=ut(r,void 0,o?.status);let u,d,m,f,p,g,x,h,y,N,w,_,b;if(e[0]!==a||e[1]!==o||e[2]!==r||e[3]!==c||e[4]!==n||e[5]!==i){p=Symbol.for("react.early_return_sentinel");e:{if(u=a.data?.items??[],d=n==="all"?u:u.filter(j=>j.status===n),!r){let j;e[19]!==i?(j=i("registry.monitorRunDetail.selectRunToInspect"),e[19]=i,e[20]=j):j=e[20];let $;e[21]!==j?($=t.jsx(me,{className:"p-6 text-center space-y-2",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:j})}),e[21]=j,e[22]=$):$=e[22],p=$;break e}w="space-y-3";let q;e[23]!==i?(q=i("registry.monitorRunDetail.runDetail"),e[23]=i,e[24]=q):q=e[24];let v;e[25]!==q?(v=t.jsx("h3",{className:"text-sm font-semibold",children:q}),e[25]=q,e[26]=v):v=e[26];let S;e[27]!==r?(S=t.jsx("p",{className:"text-[10px] text-muted-foreground font-mono",children:r}),e[27]=r,e[28]=S):S=e[28];let D;e[29]!==v||e[30]!==S?(D=t.jsxs("div",{children:[v,S]}),e[29]=v,e[30]=S,e[31]=D):D=e[31];let F;e[32]!==o?(F=o&&t.jsx(V,{className:te("capitalize",Rs(o.status)),children:o.status}),e[32]=o,e[33]=F):F=e[33];let T;e[34]!==a||e[35]!==c?(T=()=>{c.refetch(),a.refetch()},e[34]=a,e[35]=c,e[36]=T):T=e[36];let U;e[37]!==i?(U=i("registry.monitorRunDetail.refresh"),e[37]=i,e[38]=U):U=e[38];let E;e[39]!==T||e[40]!==U?(E=t.jsx(Y,{size:"sm",variant:"outline",onClick:T,children:U}),e[39]=T,e[40]=U,e[41]=E):E=e[41];let O;e[42]!==F||e[43]!==E?(O=t.jsxs("div",{className:"flex items-center gap-2",children:[F,E]}),e[42]=F,e[43]=E,e[44]=O):O=e[44],e[45]!==D||e[46]!==O?(_=t.jsx(me,{className:"p-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[D,O]})}),e[45]=D,e[46]=O,e[47]=_):_=e[47],e[48]!==o||e[49]!==i?(b=o&&t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.total")}),t.jsx("p",{className:"text-lg font-bold",children:o.total_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.tested")}),t.jsx("p",{className:"text-lg font-bold",children:o.tested_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-success",children:i("registry.monitorRunDetail.passed")}),t.jsx("p",{className:"text-lg font-bold text-success",children:o.passed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-destructive",children:i("registry.monitorRunDetail.failed")}),t.jsx("p",{className:"text-lg font-bold text-destructive",children:o.failed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.skipped")}),t.jsx("p",{className:"text-lg font-bold",children:o.skipped_items})]})]}),e[48]=o,e[49]=i,e[50]=b):b=e[50],e[51]!==o||e[52]!==i?(f=o&&(o.started_at||o.finished_at)&&t.jsxs(me,{className:"p-3 flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:[o.started_at&&t.jsxs("span",{children:[i("registry.monitorRunDetail.started"),":"," ",new Date(o.started_at).toLocaleString()]}),o.finished_at&&t.jsxs("span",{children:[i("registry.monitorRunDetail.finished"),":"," ",new Date(o.finished_at).toLocaleString()]}),o.started_at&&o.finished_at&&t.jsxs("span",{className:"font-medium text-foreground",children:[i("registry.monitorRunDetail.durationLabel"),":"," ",((new Date(o.finished_at).getTime()-new Date(o.started_at).getTime())/1e3).toFixed(1),"s"]})]}),e[51]=o,e[52]=i,e[53]=f):f=e[53],y="flex items-center justify-between gap-2",e[54]!==n?(N=t.jsx(Zi,{value:n,onChange:l}),e[54]=n,e[55]=N):N=e[55],m="text-xs text-muted-foreground",g=d.length,x=" ",h=i("registry.monitorRunDetail.result",{count:d.length})}e[0]=a,e[1]=o,e[2]=r,e[3]=c,e[4]=n,e[5]=i,e[6]=u,e[7]=d,e[8]=m,e[9]=f,e[10]=p,e[11]=g,e[12]=x,e[13]=h,e[14]=y,e[15]=N,e[16]=w,e[17]=_,e[18]=b}else u=e[6],d=e[7],m=e[8],f=e[9],p=e[10],g=e[11],x=e[12],h=e[13],y=e[14],N=e[15],w=e[16],_=e[17],b=e[18];if(p!==Symbol.for("react.early_return_sentinel"))return p;let L;e[56]!==m||e[57]!==g||e[58]!==x||e[59]!==h?(L=t.jsxs("span",{className:m,children:[g,x,h]}),e[56]=m,e[57]=g,e[58]=x,e[59]=h,e[60]=L):L=e[60];let I;e[61]!==L||e[62]!==y||e[63]!==N?(I=t.jsxs("div",{className:y,children:[N,L]}),e[61]=L,e[62]=y,e[63]=N,e[64]=I):I=e[64];let P;e[65]!==u||e[66]!==d.length||e[67]!==i?(P=d.length===0&&t.jsx(me,{className:"p-4 text-sm text-muted-foreground text-center",children:u.length===0?i("registry.monitorRunDetail.noTestResultsYet"):i("registry.monitorRunDetail.noResultsMatchFilter")}),e[65]=u,e[66]=d.length,e[67]=i,e[68]=P):P=e[68];let R;e[69]!==d?(R=d.map(en),e[69]=d,e[70]=R):R=e[70];let k;e[71]!==P||e[72]!==R?(k=t.jsxs("div",{className:"space-y-2",children:[P,R]}),e[71]=P,e[72]=R,e[73]=k):k=e[73];let A;return e[74]!==f||e[75]!==I||e[76]!==k||e[77]!==w||e[78]!==_||e[79]!==b?(A=t.jsxs("div",{className:w,children:[_,b,f,I,k]}),e[74]=f,e[75]=I,e[76]=k,e[77]=w,e[78]=_,e[79]=b,e[80]=A):A=e[80],A}function en(s){return t.jsx(Ji,{result:s},s.id)}function tn(s){return s.tested_items?`${Math.round(s.passed_items/s.tested_items*100)}%`:"-"}function sn(s){const e=Z.c(20),{selectedRunId:r,onSelectRun:i}=s,n=Pt();let l;e[0]!==n.data?.items?(l=n.data?.items??[],e[0]=n.data?.items,e[1]=l):l=e[1];const c=l;let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"QA run history"}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Browse previous QA executions and reopen their logs."})]}),e[2]=o):o=e[2];let a;e[3]!==n?(a=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o,t.jsx(Y,{size:"sm",variant:"outline",onClick:()=>n.refetch(),children:"Refresh"})]}),e[3]=n,e[4]=a):a=e[4];let u;e[5]!==c.length?(u=c.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No runs yet. Start QA from the Dashboard tab."}),e[5]=c.length,e[6]=u):u=e[6];let d;if(e[7]!==i||e[8]!==c||e[9]!==r){let p;e[11]!==i||e[12]!==r?(p=g=>{const x=_s(g.started_at,g.finished_at),h=tn(g),y=r===g.id;return t.jsxs("button",{type:"button",onClick:()=>i(g.id),className:te("w-full text-left rounded-lg border p-3 transition-colors",y?"border-primary bg-primary/5":"border-border hover:bg-muted/30"),children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("div",{className:"min-w-0 flex-1",children:t.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(g.created_at).toLocaleString()})}),t.jsx(V,{className:te("capitalize",ws(g.status)),children:g.status})]}),t.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs flex-wrap",children:[t.jsxs("span",{className:"text-muted-foreground",children:[g.tested_items,"/",g.total_items," tested"]}),t.jsxs("span",{className:"text-success font-medium",children:[g.passed_items," passed"]}),g.failed_items>0&&t.jsxs("span",{className:"text-destructive font-medium",children:[g.failed_items," failed"]}),g.skipped_items>0&&t.jsxs("span",{className:"text-muted-foreground",children:[g.skipped_items," skipped"]}),t.jsxs("span",{className:"text-muted-foreground",children:["pass rate: ",h]}),x&&t.jsx("span",{className:"text-muted-foreground",children:x})]}),g.config_snapshot&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[t.jsx(V,{variant:"outline",className:"text-[9px]",children:(g.config_snapshot.monitorMode??g.config_snapshot.testMode??"health_check").replace("_"," ")}),g.config_snapshot.onFailure!=="none"&&t.jsxs(V,{variant:"outline",className:"text-[9px] text-destructive",children:["on fail:"," ",g.config_snapshot.onFailure.replace(/_/g," ")]})]})]},g.id)},e[11]=i,e[12]=r,e[13]=p):p=e[13],d=c.map(p),e[7]=i,e[8]=c,e[9]=r,e[10]=d}else d=e[10];let m;e[14]!==u||e[15]!==d?(m=t.jsxs("div",{className:"space-y-2 max-h-[520px] overflow-auto",children:[u,d]}),e[14]=u,e[15]=d,e[16]=m):m=e[16];let f;return e[17]!==a||e[18]!==m?(f=t.jsx(me,{className:"p-4",children:t.jsxs("div",{className:"space-y-3",children:[a,m]})}),e[17]=a,e[18]=m,e[19]=f):f=e[19],f}function rn(){const s=Z.c(21),e=ce(),[r,i]=M.useState(void 0),[n,l]=M.useState("tests"),o=zt(r).data?.run?.status,a=ut(r,void 0,o);let u;s[0]!==a.data?.items?(u=a.data?.items??[],s[0]=a.data?.items,s[1]=u):u=s[1];let d;s[2]!==u?(d=u.filter(nn),s[2]=u,s[3]=d):d=s[3];const m=d;let f;s[4]!==n||s[5]!==e?(f=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:[{id:"tests",labelKey:"registry.registryMonitorPage.tabTests"},{id:"configuration",labelKey:"registry.registryMonitorPage.tabConfiguration"},{id:"connections",labelKey:"registry.registryMonitorPage.tabConnections"}].map(y=>{const N=n===y.id;return t.jsx("button",{type:"button",className:te("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center whitespace-nowrap",N?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),onClick:()=>l(y.id),children:t.jsx("span",{children:e(y.labelKey)})},y.id)})}),s[4]=n,s[5]=e,s[6]=f):f=s[6];let p;s[7]!==r||s[8]!==n||s[9]!==m||s[10]!==e?(p=n==="tests"&&t.jsxs("div",{className:"space-y-6",children:[t.jsx(Qi,{activeRunId:r,onRunChange:i}),t.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-4 items-start",children:[t.jsxs("div",{className:"xl:col-span-8 space-y-6 min-w-0",children:[r&&t.jsx(Xi,{runId:r}),t.jsx(sn,{selectedRunId:r,onSelectRun:i})]}),t.jsxs("div",{className:"xl:col-span-4 space-y-2 min-w-0",children:[t.jsxs("h3",{className:"text-sm font-semibold",children:[e("registry.registryMonitorPage.brokenMcps")," ",m.length>0&&t.jsx(V,{variant:"destructive",className:"text-[10px] ml-1",children:m.length})]}),t.jsx(Ii,{results:m})]})]})]}),s[7]=r,s[8]=n,s[9]=m,s[10]=e,s[11]=p):p=s[11];let g;s[12]!==n?(g=n==="configuration"&&t.jsx(Ei,{}),s[12]=n,s[13]=g):g=s[13];let x;s[14]!==n?(x=n==="connections"&&t.jsx($i,{}),s[14]=n,s[15]=x):x=s[15];let h;return s[16]!==f||s[17]!==p||s[18]!==g||s[19]!==x?(h=t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4 space-y-6",children:[f,p,g,x]}),s[16]=f,s[17]=p,s[18]=g,s[19]=x,s[20]=h):h=s[20],h}function nn(s){return s.status==="failed"||s.status==="error"}function an(s){const e=Z.c(9),{activeTab:r,onChange:i,items:n}=s;let l;if(e[0]!==r||e[1]!==n||e[2]!==i){let o;e[4]!==r||e[5]!==i?(o=a=>{const u=r===a.tab,d=a.icon;return t.jsxs("button",{type:"button",className:te("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center whitespace-nowrap",u?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),onClick:()=>i(a.tab),children:[t.jsx(d,{size:14}),t.jsx("span",{children:a.label}),typeof a.count=="number"&&a.count>0&&t.jsx("span",{className:"min-w-4 h-4 px-1 inline-flex items-center justify-center rounded-full bg-primary/15 text-[10px] font-semibold",children:a.count})]},a.id)},e[4]=r,e[5]=i,e[6]=o):o=e[6],l=n.map(o),e[0]=r,e[1]=n,e[2]=i,e[3]=l}else l=e[3];let c;return e[7]!==l?(c=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:l}),e[7]=l,e[8]=c):c=e[8],c}function ea(s){const e=Z.c(59),{onBack:r}=s,i=ce(),[n,l]=M.useState("items"),[c,o]=M.useState(null),{registryName:a,registryIcon:u,acceptPublishRequests:d}=vs(Ve),m=zr(),f=Mr();!d&&n==="requests"&&l("items");const p=m.data?.pending??0;let g;e[0]!==i?(g=i("registry.registryLayout.itemsTab"),e[0]=i,e[1]=g):g=e[1];const x=f.brokenCount>0?f.brokenCount:void 0;let h;e[2]!==g||e[3]!==x?(h={id:"items",label:g,icon:Qs,tab:"items",count:x},e[2]=g,e[3]=x,e[4]=h):h=e[4];let y;e[5]!==d||e[6]!==p||e[7]!==i?(y=d?[{id:"requests",label:i("registry.registryLayout.requestsTab"),icon:We,tab:"requests",count:p}]:[],e[5]=d,e[6]=p,e[7]=i,e[8]=y):y=e[8];let N;e[9]!==i?(N=i("registry.registryLayout.qaTab"),e[9]=i,e[10]=N):N=e[10];let w;e[11]!==N?(w={id:"qa",label:N,icon:ms,tab:"qa"},e[11]=N,e[12]=w):w=e[12];let _;e[13]!==i?(_=i("registry.registryLayout.settingsTab"),e[13]=i,e[14]=_):_=e[14];let b;e[15]!==_?(b={id:"settings",label:_,icon:Xs,tab:"settings"},e[15]=_,e[16]=b):b=e[16];let L;e[17]!==h||e[18]!==y||e[19]!==w||e[20]!==b?(L=[h,...y,w,b],e[17]=h,e[18]=y,e[19]=w,e[20]=b,e[21]=L):L=e[21];const I=L;let P;e[22]!==r?(P=r&&t.jsx("button",{type:"button",className:"shrink-0 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer",onClick:r,children:t.jsx(Ys,{size:16})}),e[22]=r,e[23]=P):P=e[23];let R;e[24]===Symbol.for("react.memo_cache_sentinel")?(R=()=>l("settings"),e[24]=R):R=e[24];let k;e[25]!==u||e[26]!==a?(k=t.jsx("div",{className:"size-7 rounded-lg border border-border overflow-hidden bg-muted/20 flex items-center justify-center shrink-0",children:u?t.jsx("img",{src:u,alt:a,className:"h-full w-full object-cover"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:a.slice(0,1).toUpperCase()})}),e[25]=u,e[26]=a,e[27]=k):k=e[27];let A;e[28]!==a?(A=t.jsx("span",{className:"text-sm font-medium truncate max-w-[220px]",children:a}),e[28]=a,e[29]=A):A=e[29];let q;e[30]!==k||e[31]!==A?(q=t.jsxs("button",{type:"button",className:"min-w-0 flex items-center gap-2 hover:opacity-90 transition-opacity cursor-pointer",onClick:R,children:[k,A]}),e[30]=k,e[31]=A,e[32]=q):q=e[32];let v;e[33]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-6 w-px bg-border shrink-0"}),e[33]=v):v=e[33];let S;e[34]!==n||e[35]!==I?(S=t.jsx(an,{activeTab:n,onChange:l,items:I}),e[34]=n,e[35]=I,e[36]=S):S=e[36];let D;e[37]!==P||e[38]!==q||e[39]!==S?(D=t.jsx("header",{className:"shrink-0 w-full border-b border-border h-12 overflow-x-auto flex items-center justify-between gap-3 px-4 min-w-max",children:t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[P,q,v,S]})}),e[37]=P,e[38]=q,e[39]=S,e[40]=D):D=e[40];let F;e[41]!==n?(F=n==="items"&&t.jsx(wi,{}),e[41]=n,e[42]=F):F=e[42];let T;e[43]!==d||e[44]!==n?(T=n==="requests"&&d&&t.jsx(Pi,{}),e[43]=d,e[44]=n,e[45]=T):T=e[45];let U;e[46]!==n?(U=n==="qa"&&t.jsx(rn,{}),e[46]=n,e[47]=U):U=e[47];let E;e[48]!==n||e[49]!==c?(E=n==="settings"&&t.jsx(Ri,{revealedKey:c,onRevealedKeyChange:o}),e[48]=n,e[49]=c,e[50]=E):E=e[50];let O;e[51]!==F||e[52]!==T||e[53]!==U||e[54]!==E?(O=t.jsxs("main",{className:"flex-1 min-w-0 overflow-hidden",children:[F,T,U,E]}),e[51]=F,e[52]=T,e[53]=U,e[54]=E,e[55]=O):O=e[55];let j;return e[56]!==D||e[57]!==O?(j=t.jsxs("div",{className:"h-full flex flex-col bg-background overflow-hidden",children:[D,O]}),e[56]=D,e[57]=O,e[58]=j):j=e[58],j}export{ea as default};