@decocms/mesh 2.132.0 → 2.133.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/client/assets/{AlertCircle-Dvy3oHwl.js → AlertCircle-DtdVhcv9.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-C1Pd8crU.js → AlignLeft-CRHzRLnb.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-B0XF9QfR.js → ArrowDown-CD9f6dVF.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-Ddv8Es1G.js → ArrowLeft-Dse_UWo5.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CjPyEOxC.js → ArrowUp-C5pU0t20.js} +1 -1
  6. package/dist/client/assets/{Check-BGWNBpXb.js → Check-llxZXJNk.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CDdaecse.js → CheckCircle-naMxBwcc.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-DgNkGXSd.js → CheckDone01-DArNoCeR.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-yC2IepeU.js → CheckVerified02-B5N8FkZi.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-CxLgy5uI.js → ChevronDown-BPvdqfh0.js} +1 -1
  11. package/dist/client/assets/ChevronLeft-BmfUl3Br.js +1 -0
  12. package/dist/client/assets/{ChevronRight-B-dZm0Fo.js → ChevronRight-bI92hTEK.js} +1 -1
  13. package/dist/client/assets/{Clock-DjTfMWYb.js → Clock-DCqyBdVg.js} +1 -1
  14. package/dist/client/assets/{Code01-C4dpeKsY.js → Code01-Cw3aSJX_.js} +1 -1
  15. package/dist/client/assets/{Container-CH2V2ATa.js → Container-BcN3rU1W.js} +1 -1
  16. package/dist/client/assets/{Copy01-Ba42JLNP.js → Copy01-DOsfcAr7.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-Dbafm5jn.js → Dataflow03-BzHLq4N3.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-DF0XToJT.js → DotsHorizontal-jg8p8szZ.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-D-x0DTAA.js → DotsVertical-D7GBR06C.js} +1 -1
  20. package/dist/client/assets/{Download01-x2RmdAQh.js → Download01-Dqv2OtJR.js} +1 -1
  21. package/dist/client/assets/{Edit01-NXKv8M2Y.js → Edit01-PGiGF51x.js} +1 -1
  22. package/dist/client/assets/{Eye-Da9OHWjs.js → Eye-BHQjRrk8.js} +1 -1
  23. package/dist/client/assets/{File02-BBbAYdh-.js → File02-8H6UbpEV.js} +1 -1
  24. package/dist/client/assets/{File06-CZSeKcKm.js → File06-C1Sd5E1A.js} +1 -1
  25. package/dist/client/assets/{FilterLines-CR4t6v_B.js → FilterLines-C4D0sIiB.js} +1 -1
  26. package/dist/client/assets/{Globe01-sstJp1qH.js → Globe01-DvHitX1A.js} +1 -1
  27. package/dist/client/assets/{Globe02-DED7nhMo.js → Globe02-8eZbLs7z.js} +1 -1
  28. package/dist/client/assets/{Grid01-C85povgK.js → Grid01-CfCG1RrY.js} +1 -1
  29. package/dist/client/assets/{Hash02-B-r__uQj.js → Hash02-B4zt7eqf.js} +1 -1
  30. package/dist/client/assets/{Home02-P9zxIWnB.js → Home02-BgWCBPhH.js} +1 -1
  31. package/dist/client/assets/{Image01-CyQ-9pmM.js → Image01-B8svV61f.js} +1 -1
  32. package/dist/client/assets/{Inbox01-DUxLR6jm.js → Inbox01-DktY8c3P.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-ORvzz6Jj.js → InfoCircle-DDBpFLdR.js} +1 -1
  34. package/dist/client/assets/{Key01-B3LfJVTz.js → Key01-eAlJ77G3.js} +1 -1
  35. package/dist/client/assets/{LayersTwo01-D0hB1mlt.js → LayersTwo01-Cre7WmYe.js} +1 -1
  36. package/dist/client/assets/{LayoutLeft-CIizJ9p-.js → LayoutLeft-BdPuu6bH.js} +1 -1
  37. package/dist/client/assets/{LinkExternal01-zIQsCZyp.js → LinkExternal01-1-7TA6Ra.js} +1 -1
  38. package/dist/client/assets/{List-Dy03iFlP.js → List-uQZNVPQ-.js} +1 -1
  39. package/dist/client/assets/{Loading01-DvHkBn5K.js → Loading01-DUUFtL7S.js} +1 -1
  40. package/dist/client/assets/{Lock01-b36hjLYg.js → Lock01-BqRcOfbm.js} +1 -1
  41. package/dist/client/assets/{Play-B4gSKcOc.js → Play-DTlFqxwD.js} +1 -1
  42. package/dist/client/assets/{Plus-C48LE9QF.js → Plus-2wrCLrAD.js} +1 -1
  43. package/dist/client/assets/{RefreshCcw01-B_P3Otqi.js → RefreshCcw01-CmQ_Zyfb.js} +1 -1
  44. package/dist/client/assets/{Rows03-RYFV31vk.js → Rows03-CeP6X8F6.js} +1 -1
  45. package/dist/client/assets/{Save01-C9eXS7Z1.js → Save01-Cq59fc-a.js} +1 -1
  46. package/dist/client/assets/{SearchMd-Bec1mZCp.js → SearchMd-DOdaT51-.js} +1 -1
  47. package/dist/client/assets/{Settings01-CGjDKLLq.js → Settings01-jEDDrq49.js} +1 -1
  48. package/dist/client/assets/{Shield01-QPvxKI9B.js → Shield01-_lpY_BlD.js} +1 -1
  49. package/dist/client/assets/{Terminal-Dg9FTns0.js → Terminal-CZIzfu4H.js} +1 -1
  50. package/dist/client/assets/{Trash01-DfwWsbuW.js → Trash01-DJpn1VG4.js} +1 -1
  51. package/dist/client/assets/{Upload01-CBnp-ZgO.js → Upload01-c6QpJwvP.js} +1 -1
  52. package/dist/client/assets/{Users03-zNQ-U5kI.js → Users03--eiqKjb_.js} +1 -1
  53. package/dist/client/assets/{X-BaOBrQh9.js → X-BGHsyt4s.js} +1 -1
  54. package/dist/client/assets/{XCircle-CGBoiIiF.js → XCircle-BJSW1V34.js} +1 -1
  55. package/dist/client/assets/{XClose-D5oa0b17.js → XClose-CYrOe1GU.js} +1 -1
  56. package/dist/client/assets/{Zap-B8kjj6jV.js → Zap-Div5wKlF.js} +1 -1
  57. package/dist/client/assets/{agent-connections-preview-CpRlCZek.js → agent-connections-preview-B33aUr8j.js} +1 -1
  58. package/dist/client/assets/agent-detail-B1r6DbgP.js +2 -0
  59. package/dist/client/assets/agents--1wlh1On.js +1 -0
  60. package/dist/client/assets/{alert-dialog-CHhoNaC0.js → alert-dialog-WtbKGn3h.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-Bks-N8b9.js → auth-catchall-C-FIrDOU.js} +1 -1
  62. package/dist/client/assets/{avatar-DX9xarA9.js → avatar-C0Za2Leb.js} +1 -1
  63. package/dist/client/assets/{badge-CMOYVtO8.js → badge-zns1OAW0.js} +1 -1
  64. package/dist/client/assets/{binder-CN-yhtfQ.js → binder-C2Kwp5aI.js} +1 -1
  65. package/dist/client/assets/{breadcrumb-CtNnsyqL.js → breadcrumb-BF7wgZMj.js} +1 -1
  66. package/dist/client/assets/{card-BECXECFc.js → card-yVoc5Dl_.js} +1 -1
  67. package/dist/client/assets/{chart-CA07zGfe.js → chart-C09J-0j8.js} +1 -1
  68. package/dist/client/assets/{checkbox-Bs5NWE_x.js → checkbox-C_yzLnRo.js} +1 -1
  69. package/dist/client/assets/{circle-alert-CEhC-Q81.js → circle-alert-DEWKfuYJ.js} +1 -1
  70. package/dist/client/assets/collapsible-e1478K7w.js +23 -0
  71. package/dist/client/assets/{collection-detail-CNXxywSm.js → collection-detail-12bPsl9i.js} +3 -3
  72. package/dist/client/assets/{collection-search-aEfiIRVT.js → collection-search-g7bCyEl4.js} +1 -1
  73. package/dist/client/assets/collection-tab-hxaftEha.js +1 -0
  74. package/dist/client/assets/{collection-table-wrapper-hM0ppyEG.js → collection-table-wrapper-Bx_0GgHe.js} +1 -1
  75. package/dist/client/assets/{collection-tabs-Dc6gZtTz.js → collection-tabs-CGvjmn7e.js} +1 -1
  76. package/dist/client/assets/{command-DI3JwfrE.js → command-DvXRXkaf.js} +1 -1
  77. package/dist/client/assets/{connect-C0SuJwzK.js → connect-BHcfLUsx.js} +1 -1
  78. package/dist/client/assets/{connection-card-CzCUOjTN.js → connection-card-Of-LfoL9.js} +1 -1
  79. package/dist/client/assets/connection-detail-Bfp_CthH.js +1 -0
  80. package/dist/client/assets/connections-CMRFgF2z.js +1 -0
  81. package/dist/client/assets/constants-BMZNxJu4.js +1 -0
  82. package/dist/client/assets/{constants-0JLhMmM7.js → constants-DLWxw8L_.js} +1 -1
  83. package/dist/client/assets/{create-organization-dialog-BRKsH8XB.js → create-organization-dialog-DHmNDQVx.js} +1 -1
  84. package/dist/client/assets/{create-project-dialog-BUAUU3kY.js → create-project-dialog-BURFxz7l.js} +1 -1
  85. package/dist/client/assets/{danger--r_qw5of.js → danger-D0vNOgTj.js} +1 -1
  86. package/dist/client/assets/{danger-zone-fH4LWpAE.js → danger-zone-Dhz8OLxh.js} +1 -1
  87. package/dist/client/assets/decopilot-events-C1i2IOcF.js +1 -0
  88. package/dist/client/assets/{dependencies-CfLZZ12D.js → dependencies-DQgcVkpb.js} +1 -1
  89. package/dist/client/assets/{dialog-CzmRWg_H.js → dialog-B8ODwZHJ.js} +1 -1
  90. package/dist/client/assets/{dropdown-menu-bZQdGgsX.js → dropdown-menu-Bv0kDZGf.js} +1 -1
  91. package/dist/client/assets/{dynamic-plugin-layout-B44KCK2N.js → dynamic-plugin-layout-CfJ2iWdk.js} +1 -1
  92. package/dist/client/assets/editable-task-title-BECK0S9m.js +16 -0
  93. package/dist/client/assets/{empty-state-BuKC-FeY.js → empty-state-CS91-o6R.js} +1 -1
  94. package/dist/client/assets/{env-vars-editor-BUYd05S1.js → env-vars-editor-BoUKrNdn.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-CDK2P3aY.js → extract-connection-data-DPrPXrw7.js} +1 -1
  96. package/dist/client/assets/{file-browser-B8HL2Mki.js → file-browser-Dyg6fn_p.js} +2 -2
  97. package/dist/client/assets/{form-EW4LFI0z.js → form-Bqy3P0kv.js} +1 -1
  98. package/dist/client/assets/{general-B-SJAejg.js → general-CcOfiluy.js} +1 -1
  99. package/dist/client/assets/{grid-view-B2G72x7D.js → grid-view-uc2-Xd10.js} +1 -1
  100. package/dist/client/assets/{home-C_Jstend.js → home-DYjBdnSm.js} +1 -1
  101. package/dist/client/assets/{index-RIE02s6T.js → index-1pfseT2B.js} +1 -1
  102. package/dist/client/assets/{index-BeKO7nFo.js → index-5XdaBbnC.js} +1 -1
  103. package/dist/client/assets/{index-hfshaOuF.js → index-B1uFfuid.js} +1 -1
  104. package/dist/client/assets/{index-gksA6r5d.js → index-BLvVZqmB.js} +1 -1
  105. package/dist/client/assets/{index-kE57LLiG.js → index-Br7gqIns.js} +22 -22
  106. package/dist/client/assets/{index-Cp50RRud.js → index-CLZkaGlC.js} +1 -1
  107. package/dist/client/assets/index-CUEtQJPr.css +1 -0
  108. package/dist/client/assets/index-CjU9lWJN.js +1 -0
  109. package/dist/client/assets/{index-CzFqQvXW.js → index-DVHuYwO5.js} +4 -4
  110. package/dist/client/assets/{index-V5ecgDUm.js → index-tDb6lai2.js} +1 -1
  111. package/dist/client/assets/{infiniteQueryObserver-B0QSZ6Wg.js → infiniteQueryObserver-BU31NXJd.js} +1 -1
  112. package/dist/client/assets/{input-Rcf9et7W.js → input-CImrwNsE.js} +1 -1
  113. package/dist/client/assets/{integration-icon-Cr629JYK.js → integration-icon-CqdgwTQM.js} +1 -1
  114. package/dist/client/assets/{label-DdGHGWov.js → label-BEcdY3zl.js} +1 -1
  115. package/dist/client/assets/{layout-CUeJn5m4.js → layout-Cegg55DQ.js} +1 -1
  116. package/dist/client/assets/{layout-DvurrRZC.js → layout-D1FJR7dQ.js} +1 -1
  117. package/dist/client/assets/localstorage-keys-B3yhvN27.js +1 -0
  118. package/dist/client/assets/{login-C70j40x2.js → login-gpMZSjc_.js} +1 -1
  119. package/dist/client/assets/{markdown-BsZjpnFH.js → markdown-DigmZCi5.js} +1 -1
  120. package/dist/client/assets/{mcp-app-renderer-aRjr0jcc.js → mcp-app-renderer-elbh_bK3.js} +1 -1
  121. package/dist/client/assets/{mcp-oauth-Dk3osgIf.js → mcp-oauth-BJK3oSr3.js} +1 -1
  122. package/dist/client/assets/{mcp-server-card-znSfWcaP.js → mcp-server-card-B_3KckAV.js} +1 -1
  123. package/dist/client/assets/{mcp-server-detail-Csm9j29j.js → mcp-server-detail-BGmK7vBO.js} +2 -2
  124. package/dist/client/assets/{members-WbcVb7yX.js → members-DkvmaHrL.js} +1 -1
  125. package/dist/client/assets/{monitoring-dashboard-edit-ChxkdsCv.js → monitoring-dashboard-edit-Dq449CGn.js} +1 -1
  126. package/dist/client/assets/{monitoring-dashboard-view-CL8P3Zx7.js → monitoring-dashboard-view-KyEbCseW.js} +2 -2
  127. package/dist/client/assets/{monitoring-Dth-Uzfq.js → monitoring-mMb4oyh8.js} +2 -2
  128. package/dist/client/assets/{oauth-callback-CXzK_RYv.js → oauth-callback-BWIw_10O.js} +1 -1
  129. package/dist/client/assets/page-LuWQuTOB.js +1 -0
  130. package/dist/client/assets/{page-CCrDZNhS.js → page-MLghIZgZ.js} +1 -1
  131. package/dist/client/assets/{plugin-empty-state-D7gmiZlA.js → plugin-empty-state-BYi0xCDZ.js} +1 -1
  132. package/dist/client/assets/{plugin-empty-state-BIuYztei.js → plugin-empty-state-CfkX75Qn.js} +1 -1
  133. package/dist/client/assets/{plugin-header-BLBENlfU.js → plugin-header-Bpxodj_N.js} +1 -1
  134. package/dist/client/assets/{plugin-header-CmlDS_hv.js → plugin-header-C8NyMNoe.js} +1 -1
  135. package/dist/client/assets/plugins-VAc5tGcP.js +1 -0
  136. package/dist/client/assets/{popover-C5F2AcFP.js → popover-R_PT2IPW.js} +1 -1
  137. package/dist/client/assets/{project-app-view-NryMJvXO.js → project-app-view-Bai-Qf0R.js} +1 -1
  138. package/dist/client/assets/project-layout-daZ99y7q.js +1 -0
  139. package/dist/client/assets/{project-plugins-QbLHCPXi.js → project-plugins-D9btRO1g.js} +1 -1
  140. package/dist/client/assets/{projects-list-B_wyuNYf.js → projects-list-DLyGtlCx.js} +1 -1
  141. package/dist/client/assets/{ranking-layout-CVBOyQIw.js → ranking-layout-Difw19Tu.js} +1 -1
  142. package/dist/client/assets/{readme-viewer-BmxWIpiS.js → readme-viewer-DMIs62Jq.js} +1 -1
  143. package/dist/client/assets/{registry-layout-DHUM9TZu.js → registry-layout-DUQv-gnE.js} +1 -1
  144. package/dist/client/assets/{registry-utils-DRX9Fl5Z.js → registry-utils-BL3Z-ZuV.js} +1 -1
  145. package/dist/client/assets/{reports-layout-GUNpInzx.js → reports-layout-DOweGRAi.js} +1 -1
  146. package/dist/client/assets/{reset-password-C_jAWNzd.js → reset-password-gTGJs4eA.js} +1 -1
  147. package/dist/client/assets/{resizable-CmbMtBt6.js → resizable-C-gCkuLt.js} +1 -1
  148. package/dist/client/assets/{save-actions-CH-zbfme.js → save-actions-CdZGxDIR.js} +1 -1
  149. package/dist/client/assets/{scroll-area-B5BKtcc-.js → scroll-area-DsCd8vj6.js} +1 -1
  150. package/dist/client/assets/{select-CSl7KVC3.js → select-CZ5oa2ZG.js} +1 -1
  151. package/dist/client/assets/shell-layout-D95AudRc.js +3 -0
  152. package/dist/client/assets/{sidebar-settings-98pHpdNk.js → sidebar-settings-DoYo5_2f.js} +1 -1
  153. package/dist/client/assets/{skeleton-BGGjmBE-.js → skeleton-DIOpAjh1.js} +1 -1
  154. package/dist/client/assets/{spinner-BubUCjpb.js → spinner-B-yGP95y.js} +1 -1
  155. package/dist/client/assets/{store-invite-BidZUMAQ.js → store-invite-COyr13nI.js} +1 -1
  156. package/dist/client/assets/{switch-D_s2nP_j.js → switch-C_rwAMG7.js} +1 -1
  157. package/dist/client/assets/{table-C7IfzCau.js → table-BwN-DdG1.js} +1 -1
  158. package/dist/client/assets/tabs-CTOkjsDF.js +1 -0
  159. package/dist/client/assets/tasks-CxbK_rAM.js +1 -0
  160. package/dist/client/assets/tasks-panel-CI07RnJW.js +1 -0
  161. package/dist/client/assets/{textarea-CumbsokS.js → textarea-BOlS_fKd.js} +1 -1
  162. package/dist/client/assets/{time-range-picker-Brh1Ym1N.js → time-range-picker-DWAp9G7R.js} +4 -4
  163. package/dist/client/assets/{toggle-group-DaSKpJH5.js → toggle-group-CRwxfPk7.js} +1 -1
  164. package/dist/client/assets/{tools-list-BvNNjQQL.js → tools-list-CQrrEoBF.js} +1 -1
  165. package/dist/client/assets/{tooltip-BGn6dJhi.js → tooltip-BsUirxUt.js} +1 -1
  166. package/dist/client/assets/{topbar-portal-mNbAP1zZ.js → topbar-portal-Cy4hr4gX.js} +1 -1
  167. package/dist/client/assets/{types-CnosXlf3.js → types-gEqZqH3b.js} +1 -1
  168. package/dist/client/assets/{use-binding-Ctbwf5zu.js → use-binding-Dx_NAnJa.js} +1 -1
  169. package/dist/client/assets/{use-connection-CmCfM9T5.js → use-connection-CwB1S0Lk.js} +1 -1
  170. package/dist/client/assets/{use-copy-Dn5NzC6Z.js → use-copy-uCRP4yn6.js} +1 -1
  171. package/dist/client/assets/{use-create-virtual-mcp-b6Af6scy.js → use-create-virtual-mcp-Bm7L9HAR.js} +1 -1
  172. package/dist/client/assets/{use-install-from-registry-D4coW5d-.js → use-install-from-registry-CMYlie1K.js} +1 -1
  173. package/dist/client/assets/use-list-state-EN77XpOY.js +1 -0
  174. package/dist/client/assets/{use-llm-CPv795TN.js → use-llm-C5Q0H0cZ.js} +1 -1
  175. package/dist/client/assets/{use-mcp-resources--6yZ25c2.js → use-mcp-resources-kkSzYGiM.js} +1 -1
  176. package/dist/client/assets/{use-mcp-tools-BTHDM3P3.js → use-mcp-tools-CT-LTM8z.js} +1 -1
  177. package/dist/client/assets/{use-members-Dzw-FOpA.js → use-members-CYCHCBAZ.js} +1 -1
  178. package/dist/client/assets/{use-mobile-DIBT-lEk.js → use-mobile-Bot_hVI8.js} +1 -1
  179. package/dist/client/assets/{use-project-Bd8syAM2.js → use-project-C5wS8512.js} +1 -1
  180. package/dist/client/assets/{use-settings-modal-D-rqbyuf.js → use-settings-modal-TyiexX8v.js} +1 -1
  181. package/dist/client/assets/{use-view-mode-k6uWDVq8.js → use-view-mode-CS5zZIj8.js} +1 -1
  182. package/dist/client/assets/{use-virtual-mcp-CaM9kbfY.js → use-virtual-mcp-CGnbrFrJ.js} +1 -1
  183. package/dist/client/assets/useInfiniteQuery-CutnJ4kj.js +1 -0
  184. package/dist/client/assets/{useMutation-DsQcwaJP.js → useMutation-BskhtN65.js} +1 -1
  185. package/dist/client/assets/useQuery-CxvwMb--.js +1 -0
  186. package/dist/client/assets/useSuspenseInfiniteQuery-DrLfXfJc.js +1 -0
  187. package/dist/client/assets/user-BRVh4xuS.js +1 -0
  188. package/dist/client/assets/workflow-D7s-e1ZH.js +1 -0
  189. package/dist/client/index.html +2 -2
  190. package/dist/server/cli.js +2 -1
  191. package/dist/server/server.js +2 -1
  192. package/package.json +1 -1
  193. package/dist/client/assets/AlertOctagon-Y8Xx5Uc4.js +0 -1
  194. package/dist/client/assets/agent-detail-ge8lRsMy.js +0 -2
  195. package/dist/client/assets/agents-CYp6eaDL.js +0 -1
  196. package/dist/client/assets/collapsible-KhZqz8s6.js +0 -1
  197. package/dist/client/assets/collection-tab-ByOYG4eu.js +0 -1
  198. package/dist/client/assets/connection-detail-FUvYBL_f.js +0 -1
  199. package/dist/client/assets/connections-CZWiV45b.js +0 -1
  200. package/dist/client/assets/constants-BnCnMsvC.js +0 -1
  201. package/dist/client/assets/context-CnW_lI9R.js +0 -23
  202. package/dist/client/assets/decopilot-events-Brt4gAR6.js +0 -1
  203. package/dist/client/assets/editable-thread-title-BT5MJN2M.js +0 -16
  204. package/dist/client/assets/index-Bl1kPuE1.css +0 -1
  205. package/dist/client/assets/index-CLgM5v39.js +0 -1
  206. package/dist/client/assets/localstorage-keys-DtK7peUq.js +0 -1
  207. package/dist/client/assets/page-JQWUx5cS.js +0 -1
  208. package/dist/client/assets/plugins-kPtsND7u.js +0 -1
  209. package/dist/client/assets/project-layout-CDz2d0hE.js +0 -1
  210. package/dist/client/assets/shell-layout-DH6hyOML.js +0 -3
  211. package/dist/client/assets/tabs-BzChyqs4.js +0 -1
  212. package/dist/client/assets/tasks-fA5J94Ed.js +0 -1
  213. package/dist/client/assets/use-list-state-pp-Ywt5d.js +0 -1
  214. package/dist/client/assets/use-mcp-prompts-Bvv0Gku4.js +0 -1
  215. package/dist/client/assets/use-preferences-fTjyFgCz.js +0 -1
  216. package/dist/client/assets/useInfiniteQuery-BRjF-D1B.js +0 -1
  217. package/dist/client/assets/useQuery-BE7O7fKt.js +0 -1
  218. package/dist/client/assets/useSuspenseInfiniteQuery-BSW1dpRq.js +0 -1
  219. package/dist/client/assets/workflow-BfURwr1_.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as j,c as b,j as s,v as D,E as ee,u as te,d as se,B as ie}from"./index-DVHuYwO5.js";import{V as le,C as h}from"./index-Br7gqIns.js";import{E as re,C as Z}from"./editable-task-title-BECK0S9m.js";import{a as G}from"./tasks-panel-CI07RnJW.js";import{u as U,a as oe}from"./collapsible-e1478K7w.js";import{I as J}from"./integration-icon-CqdgwTQM.js";import{b as ne,P as ae,a as ce}from"./popover-R_PT2IPW.js";import{S as q}from"./skeleton-DIOpAjh1.js";import{i as me,d as de}from"./constants-DLWxw8L_.js";import{b as fe}from"./use-virtual-mcp-CGnbrFrJ.js";import{i as ue}from"./ChevronRight-bI92hTEK.js";import{t as Q}from"./Users03--eiqKjb_.js";import{P as $}from"./index-5XdaBbnC.js";import{R,a as F,b as K}from"./resizable-C-gCkuLt.js";import"./spinner-B-yGP95y.js";import"./tooltip-BsUirxUt.js";import"./index-BLvVZqmB.js";import"./decopilot-events-C1i2IOcF.js";import"./useQuery-CxvwMb--.js";import"./dialog-B8ODwZHJ.js";import"./X-BGHsyt4s.js";import"./form-Bqy3P0kv.js";import"./label-BEcdY3zl.js";import"./input-CImrwNsE.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-C5pU0t20.js";import"./ChevronDown-BPvdqfh0.js";import"./Edit01-PGiGF51x.js";import"./XCircle-BJSW1V34.js";import"./AlertCircle-DtdVhcv9.js";import"./select-CZ5oa2ZG.js";import"./Check-llxZXJNk.js";import"./tabs-CTOkjsDF.js";import"./localstorage-keys-B3yhvN27.js";import"./useMutation-BskhtN65.js";import"./ArrowLeft-Dse_UWo5.js";import"./use-copy-uCRP4yn6.js";import"./badge-zns1OAW0.js";import"./Code01-Cw3aSJX_.js";import"./SearchMd-DOdaT51-.js";import"./use-create-virtual-mcp-Bm7L9HAR.js";import"./use-mcp-resources-kkSzYGiM.js";import"./Copy01-DOsfcAr7.js";import"./marked.esm-BaswSlok.js";import"./markdown-DigmZCi5.js";import"./mcp-app-renderer-elbh_bK3.js";import"./types-gEqZqH3b.js";import"./Eye-BHQjRrk8.js";import"./Globe02-8eZbLs7z.js";import"./LayersTwo01-Cre7WmYe.js";import"./XClose-CYrOe1GU.js";import"./collection-search-g7bCyEl4.js";import"./Loading01-DUUFtL7S.js";import"./use-connection-CwB1S0Lk.js";import"./generate-id-Dyweu44Y.js";import"./Clock-DCqyBdVg.js";import"./Trash01-DJpn1VG4.js";import"./CheckCircle-naMxBwcc.js";import"./ChevronLeft-BmfUl3Br.js";import"./user-BRVh4xuS.js";import"./avatar-C0Za2Leb.js";import"./format-time-CMKyl-GC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-2wrCLrAD.js";import"./use-llm-C5Q0H0cZ.js";import"./use-binding-Dx_NAnJa.js";import"./binder-C2Kwp5aI.js";import"./checkbox-C_yzLnRo.js";import"./AlignLeft-CRHzRLnb.js";import"./Image01-B8svV61f.js";import"./RefreshCcw01-CmQ_Zyfb.js";import"./Settings01-jEDDrq49.js";import"./useSuspenseInfiniteQuery-DrLfXfJc.js";import"./infiniteQueryObserver-BU31NXJd.js";import"./Container-BcN3rU1W.js";const X=({size:e=24,color:t="currentColor",...i})=>j.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},j.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));X.displayName="LayoutRight";const Y=({size:e=24,color:t="currentColor",...i})=>j.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},j.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));Y.displayName="MessageChatSquare";function pe(e){const t=b.c(15),{agent:i}=e,{setVirtualMcpId:p}=U();let c;t[0]!==i.id||t[1]!==p?(c=()=>{p(i.id)},t[0]=i.id,t[1]=p,t[2]=c):c=t[2];const r=c;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=D("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const f=`Select agent ${i.title}`;let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Q,{size:20}),t[4]=o):o=t[4];let n;t[5]!==i.icon||t[6]!==i.title?(n=s.jsx(J,{icon:i.icon,name:i.title,fallbackIcon:o}),t[5]=i.icon,t[6]=i.title,t[7]=n):n=t[7];let l;t[8]!==i.title?(l=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=l):l=t[9];let a;return t[10]!==r||t[11]!==f||t[12]!==n||t[13]!==l?(a=s.jsxs("button",{type:"button",onClick:r,className:m,"aria-label":f,children:[n,l]}),t[10]=r,t[11]=f,t[12]=n,t[13]=l,t[14]=a):a=t[14],a}function xe(e){const t=b.c(14),{virtualMcps:i,selectedVirtualMcpId:p,onVirtualMcpChange:c}=e,[r,m]=j.useState(!1),f=j.useRef(null);let o,n;t[0]!==r?(o=()=>{r&&setTimeout(()=>{f.current?.focus()},0)},n=[r],t[0]=r,t[1]=o,t[2]=n):(o=t[1],n=t[2]),j.useEffect(o,n);let l;t[3]!==c?(l=N=>{c(N),m(!1)},t[3]=c,t[4]=l):l=t[4];const a=l;let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=D("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=d):d=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ne,{asChild:!0,children:s.jsxs("button",{type:"button",className:d,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(ue,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=u):u=t[6];let x;t[7]!==a||t[8]!==p||t[9]!==i?(x=s.jsx(ae,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(le,{virtualMcps:i,selectedVirtualMcpId:p,onVirtualMcpChange:a,searchInputRef:f})}),t[7]=a,t[8]=p,t[9]=i,t[10]=x):x=t[10];let A;return t[11]!==r||t[12]!==x?(A=s.jsxs(ce,{open:r,onOpenChange:m,children:[u,x]}),t[11]=r,t[12]=x,t[13]=A):A=t[13],A}function he(){const e=b.c(20),t=fe(),{selectedVirtualMcp:i,setVirtualMcpId:p}=U();let c,r,m,f,o,n;if(e[0]!==t){o=Symbol.for("react.early_return_sentinel");e:{const x=t.filter(be).slice(0,6);if(x.length===0){o=null;break e}n=t.map(ge),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=f):f=e[7],c="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",r=x.map(je)}e[0]=t,e[1]=c,e[2]=r,e[3]=m,e[4]=f,e[5]=o,e[6]=n}else c=e[1],r=e[2],m=e[3],f=e[4],o=e[5],n=e[6];if(o!==Symbol.for("react.early_return_sentinel"))return o;const l=i?.id??null;let a;e[8]!==p||e[9]!==l||e[10]!==n?(a=s.jsx(xe,{virtualMcps:n,selectedVirtualMcpId:l,onVirtualMcpChange:p}),e[8]=p,e[9]=l,e[10]=n,e[11]=a):a=e[11];let d;e[12]!==c||e[13]!==r||e[14]!==a?(d=s.jsxs("div",{className:c,children:[r,a]}),e[12]=c,e[13]=r,e[14]=a,e[15]=d):d=e[15];let u;return e[16]!==m||e[17]!==f||e[18]!==d?(u=s.jsxs("div",{className:m,children:[f,d]}),e[16]=m,e[17]=f,e[18]=d,e[19]=u):u=e[19],u}function je(e){return s.jsx(pe,{agent:e},e.id??"default")}function ge(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function be(e){return e.id!==null&&!me(e.id)}function Ne(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(q,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(Ce)})]}),e[1]=i):i=e[1],i}function Ce(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(q,{className:"size-6 rounded-md shrink-0"}),s.jsx(q,{className:"h-4 w-full"})]},t)}function ve(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(j.Suspense,{fallback:s.jsx(Ne,{}),children:s.jsx(he,{})}),e[0]=t):t=e[0],t}function Se(){const e=b.c(50),{org:t}=te(),{data:i}=se.useSession(),{modelsConnections:p,isChatEmpty:c,activeTaskId:r,tasks:m,selectedVirtualMcp:f}=oe();let o;if(e[0]!==r||e[1]!==m){let g;e[3]!==r?(g=P=>P.id===r,e[3]=r,e[4]=g):g=e[4],o=m.find(g),e[0]=r,e[1]=m,e[2]=o}else o=e[2];const n=o,[l,a]=j.useState(!1);let d;e[5]!==i?.user?.name?(d=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=d):d=e[6];const u=d;let x;e[7]!==t.id?(x=de(t.id),e[7]=t.id,e[8]=x):x=e[8];const N=f??x;if(p.length===0){let g,P;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(R,{defaultSize:20,minSize:10,id:"tasks",order:1,children:s.jsx(G,{})}),P=s.jsx(F,{className:"bg-border/30"}),e[9]=g,e[10]=P):(g=e[9],P=e[10]);const W=l?50:80;let V;e[11]!==t?(V=s.jsx("div",{className:"flex flex-col h-full bg-background items-center justify-center",children:s.jsx(h.NoLlmBindingEmptyState,{org:t})}),e[11]=t,e[12]=V):V=e[12];let E;e[13]!==W||e[14]!==V?(E=s.jsx(R,{defaultSize:W,minSize:30,id:"main",order:2,children:V}),e[13]=W,e[14]=V,e[15]=E):E=e[15];let I;e[16]!==l?(I=l&&s.jsxs(s.Fragment,{children:[s.jsx(F,{className:"bg-border/30"}),s.jsx(R,{defaultSize:30,minSize:15,id:"context",order:3,children:s.jsx(Z,{onClose:()=>a(!1)})})]}),e[16]=l,e[17]=I):I=e[17];let B;return e[18]!==E||e[19]!==I?(B=s.jsxs(K,{direction:"horizontal",className:"size-full",children:[g,P,E,I]}),e[18]=E,e[19]=I,e[20]=B):B=e[20],B}let H,L;e[21]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(R,{defaultSize:20,minSize:10,id:"tasks",order:1,children:s.jsx(G,{})}),L=s.jsx(F,{className:"bg-border/30"}),e[21]=H,e[22]=L):(H=e[21],L=e[22]);const O=l?50:80;let C;e[23]!==n?(C=n?.title&&s.jsx(re,{taskId:n.id,text:n.title,className:"text-sm font-medium text-foreground"}),e[23]=n,e[24]=C):C=e[24];let v;e[25]!==C?(v=s.jsx($.Header.Left,{className:"gap-2",children:C}),e[25]=C,e[26]=v):v=e[26];let S;e[27]!==c||e[28]!==l?(S=!c&&s.jsx("button",{type:"button",onClick:()=>a(ye),className:D("flex size-7 items-center justify-center rounded-md border border-input hover:bg-accent transition-colors",l&&"bg-accent"),title:"Toggle context panel",children:s.jsx(X,{size:14,className:"text-muted-foreground"})}),e[27]=c,e[28]=l,e[29]=S):S=e[29];let y;e[30]!==S?(y=s.jsx($.Header.Right,{className:"gap-1",children:S}),e[30]=S,e[31]=y):y=e[31];let k;e[32]!==v||e[33]!==y?(k=s.jsxs($.Header,{className:"flex-none z-10 bg-background",children:[v,y]}),e[32]=v,e[33]=y,e[34]=k):k=e[34];let _;e[35]!==N||e[36]!==c||e[37]!==u?(_=c?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(J,{icon:N.icon,name:N.title,size:"md",fallbackIcon:s.jsx(Q,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsx("div",{className:"text-center mb-8",children:s.jsxs("p",{className:"text-xl font-medium text-foreground",children:["What's on your mind, ",u,"?"]})}),s.jsx("div",{className:"w-full",children:s.jsx(h.Input,{})}),s.jsx(h.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(ve,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(h.Main,{children:s.jsx(h.Messages,{})}),s.jsx(h.Footer,{children:s.jsx(h.Input,{onOpenContextPanel:()=>a(!0)})})]}),e[35]=N,e[36]=c,e[37]=u,e[38]=_):_=e[38];let z;e[39]!==k||e[40]!==_?(z=s.jsxs(h,{className:"h-full bg-background",children:[k,_]}),e[39]=k,e[40]=_,e[41]=z):z=e[41];let w;e[42]!==z||e[43]!==O?(w=s.jsx(R,{defaultSize:O,minSize:30,id:"main",order:2,children:z}),e[42]=z,e[43]=O,e[44]=w):w=e[44];let M;e[45]!==l?(M=l&&s.jsxs(s.Fragment,{children:[s.jsx(F,{className:"bg-border/30"}),s.jsx(R,{defaultSize:30,minSize:15,id:"context",order:3,children:s.jsx(Z,{onClose:()=>a(!1)})})]}),e[45]=l,e[46]=M):M=e[46];let T;return e[47]!==w||e[48]!==M?(T=s.jsxs(K,{direction:"horizontal",className:"size-full",children:[H,L,w,M]}),e[47]=w,e[48]=M,e[49]=T):T=e[49],T}function ye(e){return!e}function ke(e){const t=b.c(14),{error:i,onRetry:p}=e,c=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs($.Header,{className:"flex-none",children:[s.jsx($.Header.Left,{className:"gap-2"}),s.jsx($.Header.Right,{className:"gap-1"})]}),t[0]=r):r=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(Y,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const f=c?"Unable to load models":"Something went wrong";let o;t[2]!==f?(o=s.jsx("h3",{className:"text-lg font-medium",children:f}),t[2]=f,t[3]=o):o=t[3];const n=c?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let l;t[4]!==n?(l=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),t[4]=n,t[5]=l):l=t[5];let a;t[6]!==o||t[7]!==l?(a=s.jsxs("div",{className:"space-y-2",children:[o,l]}),t[6]=o,t[7]=l,t[8]=a):a=t[8];let d;t[9]!==p?(d=s.jsx(ie,{variant:"outline",onClick:p,children:"Try again"}),t[9]=p,t[10]=d):d=t[10];let u;return t[11]!==a||t[12]!==d?(u=s.jsxs(h,{children:[r,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,d]})})]}),t[11]=a,t[12]=d,t[13]=u):u=t[13],u}function Kt(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ee,{fallback:_e,children:s.jsx(j.Suspense,{fallback:s.jsx(h.Skeleton,{}),children:s.jsx(Se,{})})}),e[0]=t):t=e[0],t}function _e(e){const{error:t,resetError:i}=e;return s.jsx(ke,{error:t,onRetry:i})}export{Kt as default};
@@ -1 +1 @@
1
- import{c as Q,r as U,u as re,K as ie,b$ as we,j as t,v as oe,B as Y,b as de,_ as me,$ as ue,O as fe,d as Ie,aC as Te,c0 as ne,E as Re,aE as Pe}from"./index-CzFqQvXW.js";import{P as X}from"./index-BeKO7nFo.js";import{B as $e,a as ke,b as ze,c as Le}from"./breadcrumb-CtNnsyqL.js";import{i as xe}from"./FilterLines-CR4t6v_B.js";import{n as ge}from"./Inbox01-DUxLR6jm.js";import{i as se}from"./Loading01-DvHkBn5K.js";import{i as pe}from"./SearchMd-Bec1mZCp.js";import{u as he}from"./useQuery-BE7O7fKt.js";import{u as Fe}from"./useInfiniteQuery-BRjF-D1B.js";import{a as Ee,f as Oe,b as _e}from"./registry-utils-DRX9Fl5Z.js";import{u as je,W as Ke,a as Ae,h as Me,b as Be}from"./constants-0JLhMmM7.js";import{f as De,g as ye,h as Ge}from"./use-connection-CmCfM9T5.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{C as Ve,E as qe}from"./collection-search-aEfiIRVT.js";import{M as ae}from"./mcp-server-card-znSfWcaP.js";import{I as Ue}from"./input-Rcf9et7W.js";import{a as ve,b as be,P as Ne}from"./popover-C5F2AcFP.js";import{i as Ce}from"./Check-BGWNBpXb.js";import{t as Se}from"./ChevronDown-CxLgy5uI.js";import{s as te}from"./XClose-D5oa0b17.js";import{s as He}from"./Plus-C48LE9QF.js";import{u as Je}from"./use-binding-Ctbwf5zu.js";import{L as Qe,u as Ye}from"./localstorage-keys-DtK7peUq.js";import"./tooltip-BGn6dJhi.js";import"./index-gksA6r5d.js";import"./ChevronRight-B-dZm0Fo.js";import"./infiniteQueryObserver-B0QSZ6Wg.js";import"./useMutation-DsQcwaJP.js";import"./CheckVerified02-yC2IepeU.js";import"./Globe02-DED7nhMo.js";import"./Lock01-b36hjLYg.js";import"./Terminal-Dg9FTns0.js";import"./card-BECXECFc.js";import"./integration-icon-Cr629JYK.js";import"./Container-CH2V2ATa.js";import"./github-icon-Dp3wHhYE.js";import"./binder-CN-yhtfQ.js";function Ze(s,e){const r=Q.c(4),[l,d]=U.useState(s),n=U.useRef(null),i=U.useRef(!0);let c,a;return r[0]!==e||r[1]!==s?(c=()=>{if(i.current){i.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{d(s)},e),()=>{n.current&&clearTimeout(n.current)}},a=[s,e],r[0]=e,r[1]=s,r[2]=c,r[3]=a):(c=r[2],a=r[3]),U.useEffect(c,a),l}function Xe(s){const e=Q.c(14),r=U.useRef(null),l=`scroll-position:${s}`,d=U.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const i=n;let c;e[2]!==l?(c=()=>{if(d.current===l)return;const j=sessionStorage.getItem(l);if(j&&r.current){const S=Number.parseInt(j,10);r.current.scrollTop=S}d.current=l},e[2]=l,e[3]=c):c=e[3];const a=c;let g;e[4]!==a||e[5]!==l?(g=()=>{d.current!==l&&a()},e[4]=a,e[5]=l,e[6]=g):g=e[6];const I=g;let o;e[7]!==a||e[8]!==l?(o=j=>{r.current=j,j&&d.current!==l&&requestAnimationFrame(()=>{a()})},e[7]=a,e[8]=l,e[9]=o):o=e[9];const p=o;let m;return e[10]!==I||e[11]!==i||e[12]!==p?(m={scrollRef:p,saveScrollPosition:i,handleScroll:I},e[10]=I,e[11]=i,e[12]=p,e[13]=m):m=e[13],m}const et=24;function tt(s){const e=Q.c(54),{registryId:r,listToolName:l,filtersToolName:d,search:n}=s,{org:i}=re();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,g]=U.useState(c);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[1]=I):I=e[1];const[o,p]=U.useState(I),m=r||null;let j;e[2]!==i.id||e[3]!==m?(j={connectionId:m,orgId:i.id},e[2]=i.id,e[3]=m,e[4]=j):j=e[4];const S=je(j),R=!!d;let b;e[5]!==d||e[6]!==r?(b=ie.toolCall(r,d||"no-filters","{}"),e[5]=d,e[6]=r,e[7]=b):b=e[7];let N;e[8]!==S||e[9]!==d?(N=async()=>{if(!d)return{tags:[],categories:[]};const f=await S.callTool({name:d,arguments:{}});return f.structuredContent??f},e[8]=S,e[9]=d,e[10]=N):N=e[10];let P;e[11]!==b||e[12]!==N?(P={queryKey:b,queryFn:N,staleTime:36e5,retry:2},e[11]=b,e[12]=N,e[13]=P):P=e[13];const{data:$}=he(P);let h,C,k;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==o||e[18]!==a){const f=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:et,...a.length>0&&{tags:a},...o.length>0&&{categories:o},...f&&{where:f}},k=Fe,C=ie.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=o,e[18]=a,e[19]=h,e[20]=C,e[21]=k}else h=e[19],C=e[20],k=e[21];let v;e[22]!==S||e[23]!==h||e[24]!==l?(v=async f=>{const{pageParam:Z}=f,le=Z?{...h,cursor:Z}:h,ee=await S.callTool({name:l,arguments:le});return ee.structuredContent??ee},e[22]=S,e[23]=h,e[24]=l,e[25]=v):v=e[25];let z;e[26]!==v||e[27]!==C?(z={queryKey:C,queryFn:v,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=v,e[27]=C,e[28]=z):z=e[28];const{data:w,fetchNextPage:x,hasNextPage:y,isFetchingNextPage:u,isFetching:T,isLoading:L,error:F}=k(z);let _;e:{if(!w?.pages||w.pages.length===0){_=null;break e}const f=w.pages[0];if(typeof f=="object"&&f!==null&&"totalCount"in f&&typeof f.totalCount=="number"){_=f.totalCount;break e}_=null}const K=_,E=w?.pages;let G;e[29]!==E?(G=Ee(E),e[29]=E,e[30]=G):G=e[30];const H=G;let W;e[31]!==n||e[32]!==o.length||e[33]!==a.length?(W=a.length>0||o.length>0||!!n?.trim(),e[31]=n,e[32]=o.length,e[33]=a.length,e[34]=W):W=e[34];const D=W,B=T&&!u&&!L&&D;let A;e[35]!==x||e[36]!==y||e[37]!==u?(A=()=>{y&&!u&&x()},e[35]=x,e[36]=y,e[37]=u,e[38]=A):A=e[38];const V=A,O=y??!1,M=R?$?.tags:void 0,q=R?$?.categories:void 0;let J;return e[39]!==D||e[40]!==T||e[41]!==u||e[42]!==B||e[43]!==L||e[44]!==H||e[45]!==F||e[46]!==V||e[47]!==o||e[48]!==a||e[49]!==O||e[50]!==M||e[51]!==q||e[52]!==K?(J={items:H,totalCount:K,hasMore:O,isLoadingMore:u,isFiltering:B,isInitialLoading:L,isFetching:T,error:F,loadMore:V,availableTags:M,availableCategories:q,selectedTags:a,selectedCategories:o,setSelectedTags:g,setSelectedCategories:p,hasActiveFilters:D},e[39]=D,e[40]=T,e[41]=u,e[42]=B,e[43]=L,e[44]=H,e[45]=F,e[46]=V,e[47]=o,e[48]=a,e[49]=O,e[50]=M,e[51]=q,e[52]=K,e[53]=J):J=e[53],J}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,l)=>l.count-r.count).slice(0,e)}function ce(s){const e=Q.c(52),{label:r,items:l,selectedItems:d,onToggle:n,onClear:i}=s,[c,a]=U.useState(""),[g,I]=U.useState(!1);let o,p,m,j,S,R,b,N,P,$,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==g||e[4]!==c||e[5]!==d){const x=[...c?l.filter(E=>E.value.toLowerCase().includes(c.toLowerCase())):l].sort(lt);m=d.length,p=ve,P=g,$=I;let y;e[17]!==r?(y=t.jsx("span",{children:r}),e[17]=r,e[18]=y):y=e[18];let u;e[19]!==m?(u=m>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:m}),e[19]=m,e[20]=u):u=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=T):T=e[21],e[22]!==u||e[23]!==y?(h=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[y,u,T]})}),e[22]=u,e[23]=y,e[24]=h):h=e[24],o=Ne,R="w-64 p-0",b="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let F;e[26]!==r?(F=r.toLowerCase(),e[26]=r,e[27]=F):F=e[27];const _=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=E=>a(E.target.value),e[28]=K):K=e[28],e[29]!==c||e[30]!==_?(N=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,t.jsx(Ue,{type:"text",placeholder:_,value:c,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=_,e[31]=N):N=e[31],j="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",S=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const G=d.includes(E.value);return t.jsxs("button",{onClick:()=>n(E.value),className:oe("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=g,e[4]=c,e[5]=d,e[6]=o,e[7]=p,e[8]=m,e[9]=j,e[10]=S,e[11]=R,e[12]=b,e[13]=N,e[14]=P,e[15]=$,e[16]=h}else o=e[6],p=e[7],m=e[8],j=e[9],S=e[10],R=e[11],b=e[12],N=e[13],P=e[14],$=e[15],h=e[16];let C;e[32]!==j||e[33]!==S?(C=t.jsx("div",{className:j,children:S}),e[32]=j,e[33]=S,e[34]=C):C=e[34];let k;e[35]!==r||e[36]!==i||e[37]!==m?(k=m>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:i,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=i,e[37]=m,e[38]=k):k=e[38];let v;e[39]!==o||e[40]!==k||e[41]!==R||e[42]!==b||e[43]!==N||e[44]!==C?(v=t.jsxs(o,{className:R,align:b,children:[N,C,k]}),e[39]=o,e[40]=k,e[41]=R,e[42]=b,e[43]=N,e[44]=C,e[45]=v):v=e[45];let z;return e[46]!==p||e[47]!==v||e[48]!==P||e[49]!==$||e[50]!==h?(z=t.jsxs(p,{open:P,onOpenChange:$,children:[h,v]}),e[46]=p,e[47]=v,e[48]=P,e[49]=$,e[50]=h,e[51]=z):z=e[51],z}function lt(s,e){return e.count-s.count}function nt(s){const e=Q.c(67),{availableTags:r,availableCategories:l,selectedTags:d,selectedCategories:n,onTagChange:i,onCategoryChange:c}=s,a=r&&r.length>0||l&&l.length>0,g=d.length>0||n.length>0;if(!a)return null;let I;e[0]!==i||e[1]!==d?(I=y=>{d.includes(y)?i(d.filter(u=>u!==y)):i([...d,y])},e[0]=i,e[1]=d,e[2]=I):I=e[2];const o=I;let p;e[3]!==c||e[4]!==n?(p=y=>{n.includes(y)?c(n.filter(u=>u!==y)):c([...n,y])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const m=p;let j;e[6]!==c||e[7]!==i?(j=()=>{i([]),c([])},e[6]=c,e[7]=i,e[8]=j):j=e[8];const S=j;let R,b,N,P,$,h,C;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==i||e[13]!==n||e[14]!==d||e[15]!==m||e[16]!==o){const y=l?rt(l,6):[];R=n,b=d,C=new Set(y.map(it)),$="flex items-center border-b border-border";let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(xe,{size:16})}),e[24]=u):u=e[24];let T;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==m?(T=l&&l.length>0&&t.jsx(ce,{label:"Categories",items:l,selectedItems:n,onToggle:m,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=m,e[29]=T):T=e[29];let L;e[30]!==r||e[31]!==i||e[32]!==d||e[33]!==o?(L=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:d,onToggle:o,onClear:()=>i([])}),e[30]=r,e[31]=i,e[32]=d,e[33]=o,e[34]=L):L=e[34],e[35]!==L||e[36]!==T?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[u,T,L]}),e[35]=L,e[36]=T,e[37]=h):h=e[37],N="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==n||e[39]!==m?(F=_=>{const K=n.includes(_.value);return t.jsxs("div",{onClick:()=>m(_.value),className:oe("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:_.value}),K&&t.jsx("span",{onClick:E=>{E.stopPropagation(),m(_.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},_.value)},e[38]=n,e[39]=m,e[40]=F):F=e[40],P=y.map(F),e[9]=l,e[10]=r,e[11]=c,e[12]=i,e[13]=n,e[14]=d,e[15]=m,e[16]=o,e[17]=R,e[18]=b,e[19]=N,e[20]=P,e[21]=$,e[22]=h,e[23]=C}else R=e[17],b=e[18],N=e[19],P=e[20],$=e[21],h=e[22],C=e[23];let k;if(e[41]!==R||e[42]!==m||e[43]!==C){let y;e[45]!==C?(y=T=>!C.has(T),e[45]=C,e[46]=y):y=e[46];let u;e[47]!==m?(u=T=>t.jsxs("div",{onClick:()=>m(T),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:T}),t.jsx("span",{onClick:L=>{L.stopPropagation(),m(T)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`cat-${T}`),e[47]=m,e[48]=u):u=e[48],k=R.filter(y).map(u),e[41]=R,e[42]=m,e[43]=C,e[44]=k}else k=e[44];let v;if(e[49]!==b||e[50]!==o){let y;e[52]!==o?(y=u=>t.jsxs("div",{onClick:()=>o(u),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:u}),t.jsx("span",{onClick:T=>{T.stopPropagation(),o(u)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`tag-${u}`),e[52]=o,e[53]=y):y=e[53],v=b.map(y),e[49]=b,e[50]=o,e[51]=v}else v=e[51];let z;e[54]!==S||e[55]!==g?(z=g&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:S,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(te,{size:14}),"Clear all"]}),e[54]=S,e[55]=g,e[56]=z):z=e[56];let w;e[57]!==z||e[58]!==N||e[59]!==P||e[60]!==k||e[61]!==v?(w=t.jsxs("div",{className:N,children:[P,k,v,z]}),e[57]=z,e[58]=N,e[59]=P,e[60]=k,e[61]=v,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==$||e[65]!==h?(x=t.jsxs("div",{className:$,children:[h,w]}),e[63]=w,e[64]=$,e[65]=h,e[66]=x):x=e[66],x}function it(s){return s.value}function ot(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=Q.c(55),{registryId:r,listToolName:l,filtersToolName:d,storePrivateOnly:n}=s,[i,c]=U.useState(""),a=Ze(i,300),g=de(),{org:I}=re(),{scrollRef:o,saveScrollPosition:p,handleScroll:m}=Xe(`store-discovery:${r}`);let j;e[0]!==a||e[1]!==d||e[2]!==l||e[3]!==r?(j={registryId:r,listToolName:l,filtersToolName:d,search:a},e[0]=a,e[1]=d,e[2]=l,e[3]=r,e[4]=j):j=e[4];const{items:S,hasMore:R,isLoadingMore:b,isInitialLoading:N,isFetching:P,error:$,loadMore:h,availableTags:C,availableCategories:k,selectedTags:v,selectedCategories:z,setSelectedTags:w,setSelectedCategories:x,hasActiveFilters:y}=tt(j);let u,T,L,F;if(e[5]!==a||e[6]!==P||e[7]!==N||e[8]!==S||e[9]!==i||e[10]!==n){const O=i?ot(S,i):S;F=n?O.filter(mt):O,u=(i!==a||P)&&!N&&!!i,L=F.filter(at),T=F.filter(M=>!L.find(q=>q.id===M.id)),e[5]=a,e[6]=P,e[7]=N,e[8]=S,e[9]=i,e[10]=n,e[11]=u,e[12]=T,e[13]=L,e[14]=F}else u=e[11],T=e[12],L=e[13],F=e[14];const _=T;let K;e[15]!==g||e[16]!==I.slug||e[17]!==r||e[18]!==p?(K=O=>{p();const M=We(O.name||O.title||O.server?.title||""),q=typeof O.id=="string"&&O.id.includes("/"),J=typeof O.server?.name=="string"&&O.server.name.includes("/"),f=q&&!J?O.id:O.server?.name||O.id||"";g({to:"/$org/$project/store/$appName",params:{org:I.slug,project:fe,appName:M},search:{registryId:r,serverName:f}})},e[15]=g,e[16]=I.slug,e[17]=r,e[18]=p,e[19]=K):K=e[19];const E=K;let G;e[20]!==m||e[21]!==R||e[22]!==b||e[23]!==h?(G=O=>{if(m(),!R||b)return;const M=O.currentTarget;M.scrollHeight-M.scrollTop-M.clientHeight<200&&h()},e[20]=m,e[21]=R,e[22]=b,e[23]=h,e[24]=G):G=e[24];const H=G;let W;e[25]!==u||e[26]!==i?(W=t.jsx(Ve,{value:i,onChange:c,placeholder:"Search for an MCP Server...",isSearching:u}),e[25]=u,e[26]=i,e[27]=W):W=e[27];let D;e[28]!==k||e[29]!==C||e[30]!==z||e[31]!==v||e[32]!==x||e[33]!==w?(D=t.jsx(nt,{availableTags:C,availableCategories:k,selectedTags:v,selectedCategories:z,onTagChange:w,onCategoryChange:x}),e[28]=k,e[29]=C,e[30]=z,e[31]=v,e[32]=x,e[33]=w,e[34]=D):D=e[34];let B;e[35]!==_||e[36]!==$||e[37]!==E||e[38]!==y||e[39]!==R||e[40]!==N||e[41]!==b||e[42]!==u||e[43]!==i||e[44]!==L||e[45]!==F?(B=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:$&&!N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(me,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),$.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:$.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:dt,children:[t.jsx(ue,{className:"size-4"}),"Try again"]})]}):N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):F.length===0&&!y?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(ge,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):F.length===0&&y&&!i?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):i&&F.length===0&&!u?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[u&&F.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),L.length>0&&t.jsx(ae,{items:L,title:"Verified",onItemClick:E}),_.length>0&&t.jsx(ae,{items:_,title:L.length>0?"All":"",onItemClick:E}),R&&b&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(se,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[35]=_,e[36]=$,e[37]=E,e[38]=y,e[39]=R,e[40]=N,e[41]=b,e[42]=u,e[43]=i,e[44]=L,e[45]=F,e[46]=B):B=e[46];let A;e[47]!==H||e[48]!==o||e[49]!==B?(A=t.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",onScroll:H,children:B}),e[47]=H,e[48]=o,e[49]=B,e[50]=A):A=e[50];let V;return e[51]!==W||e[52]!==D||e[53]!==A?(V=t.jsxs("div",{className:"flex flex-col h-full",children:[W,D,A]}),e[51]=W,e[52]=D,e[53]=A,e[54]=V):V=e[54],V}function dt(){return window.location.reload()}function mt(s){return s.is_public!==!0}function ut(s){const e=Q.c(11),{registryId:r,storePrivateOnly:l}=s,d=De(r),n=d?.tools;let i;e[0]!==n?(i=Oe(n),e[0]=n,e[1]=i):i=e[1];const c=i;if(!c){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),e[2]=m):m=e[2];let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[m,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=j):j=e[3],j}const a=d?.tools;let g;e[4]!==a?(g=_e(a),e[4]=a,e[5]=g):g=e[5];const o=g||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==o?(p=t.jsx(ct,{registryId:r,listToolName:c,filtersToolName:o,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=o,e[10]=p):p=e[10],p}function ft(s){const e=Q.c(43),{registries:r,value:l,onValueChange:d,onAddWellKnown:n,wellKnownRegistries:i,placeholder:c}=s,a=c===void 0?"Select a registry...":c,[g,I]=U.useState(!1);let o,p,m,j,S,R,b,N;if(e[0]!==g||e[1]!==a||e[2]!==r||e[3]!==l){let w;e[12]!==l?(w=y=>y.id===l,e[12]=l,e[13]=w):w=e[13];const x=r.find(w);p=ve,b=g,N=I,o=be,R=!0,m="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(j=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=j):j=e[14],S=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:a}),e[0]=g,e[1]=a,e[2]=r,e[3]=l,e[4]=o,e[5]=p,e[6]=m,e[7]=j,e[8]=S,e[9]=R,e[10]=b,e[11]=N}else o=e[4],p=e[5],m=e[6],j=e[7],S=e[8],R=e[9],b=e[10],N=e[11];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=P):P=e[15];let $;e[16]!==m||e[17]!==j||e[18]!==S?($=t.jsxs("button",{type:m,className:j,children:[S,P]}),e[16]=m,e[17]=j,e[18]=S,e[19]=$):$=e[19];let h;e[20]!==o||e[21]!==R||e[22]!==$?(h=t.jsx(o,{asChild:R,children:$}),e[20]=o,e[21]=R,e[22]=$,e[23]=h):h=e[23];let C;if(e[24]!==d||e[25]!==r||e[26]!==l){let w;e[28]!==d||e[29]!==l?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{d(x.id??x.name),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),l===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=d,e[29]=l,e[30]=w):w=e[30],C=r.map(w),e[24]=d,e[25]=r,e[26]=l,e[27]=C}else C=e[27];let k;e[31]!==n||e[32]!==i?(k=i.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),i.map(w=>t.jsxs("button",{type:"button",onClick:()=>{n(w),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(He,{size:16})})]},w.id??w.title))]}),e[31]=n,e[32]=i,e[33]=k):k=e[33];let v;e[34]!==C||e[35]!==k?(v=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[C,k]}),e[34]=C,e[35]=k,e[36]=v):v=e[36];let z;return e[37]!==p||e[38]!==h||e[39]!==v||e[40]!==b||e[41]!==N?(z=t.jsxs(p,{open:b,onOpenChange:N,children:[h,v]}),e[37]=p,e[38]=h,e[39]=v,e[40]=b,e[41]=N,e[42]=z):z=e[42],z}function xt({registries:s,onConnected:e}){const r=ye(),{org:{slug:l}}=re(),{data:d}=Ie.useSession(),n=de(),[i,c]=U.useState(!1),a=s[0],g=async()=>{if(!(!a||!d?.user?.id)){c(!0);try{const o=await r.create.mutateAsync(a);e?.(o.id)}finally{c(!1)}}},I=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:fe},search:{action:"create"}})};return t.jsx(qe,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:g,disabled:i||!a,children:[a?.icon&&t.jsx("img",{src:a.icon,alt:"",className:"size-4"}),i?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:I,children:"Custom Connection"})]})})}function gt(s){const e=Q.c(15),{error:r,onRetry:l,registryName:d}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(me,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=i):i=e[1];let c;e[2]!==d?(c=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:d})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=d,e[3]=c):c=e[3];let a;e[4]!==r?(a=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=a):a=e[5];let g;e[6]!==c||e[7]!==a?(g=t.jsxs("div",{className:"space-y-2",children:[i,c,a]}),e[6]=c,e[7]=a,e[8]=g):g=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{className:"size-4"}),e[9]=I):I=e[9];let o;e[10]!==l?(o=t.jsxs(Y,{variant:"outline",size:"sm",onClick:l,children:[I,"Try again"]}),e[10]=l,e[11]=o):o=e[11];let p;return e[12]!==g||e[13]!==o?(p=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,g,o]}),e[12]=g,e[13]=o,e[14]=p):p=e[14],p}function ts(){const s=Q.c(49),{org:e,project:r}=re(),l=Ge(),d=ye(),n=Te(),i=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=Je(l);let a;s[0]!==e.id?(a=Ke.SELF(e.id),s[0]=e.id,s[1]=a):a=s[1];const g=a,I=r.enabledPlugins,o=I==null||I.includes(ne),p=c.filter(f=>f.id!==g?!0:o);let m;s[2]!==g?(m=f=>f.id===g,s[2]=g,s[3]=m):m=s[3];const j=p.some(m);let S;s[4]!==e.id?(S={connectionId:Ae,orgId:e.id},s[4]=e.id,s[5]=S):S=s[5];const R=je(S);let b;s[6]!==r.id||s[7]!==R?(b=async()=>{const f=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ne}});return f.structuredContent??f},s[6]=r.id,s[7]=R,s[8]=b):b=s[8];const{data:N}=he({queryKey:ie.projectPluginConfig(r.id??"",ne),queryFn:b,enabled:j&&!!r.id,staleTime:6e4}),P=N?.config?.settings;let $;s[9]!==P||s[10]!==g?($=f=>f.id===g&&P?{id:f.id,name:P.registryName||f.title,icon:P.registryIcon||f.icon||void 0}:{id:f.id,name:f.title,icon:f.icon||void 0},s[9]=P,s[10]=g,s[11]=$):$=s[11];const h=p.map($);let C;s[12]!==e.slug?(C=Qe.selectedRegistry(e.slug),s[12]=e.slug,s[13]=C):C=s[13];const[k,v]=Ye(C,ht);let z;s[14]!==k?(z=f=>f.id===k,s[14]=k,s[15]=z):z=s[15];const x=p.find(z)?.id||p[0]?.id||"",y=x===g&&P?.storePrivateOnly===!0;let u;s[16]!==e.id?(u=Me(e.id),s[16]=e.id,s[17]=u):u=s[17];let T;s[18]!==u?(T=[u],s[18]=u,s[19]=T):T=s[19];const L=T;let F;s[20]===Symbol.for("react.memo_cache_sentinel")?(F=[Be()],s[20]=F):F=s[20];const _=F;let K;s[21]!==d.create||s[22]!==v?(K=async f=>{const Z=await d.create.mutateAsync(f);v(Z.id)},s[21]=d.create,s[22]=v,s[23]=K):K=s[23];const E=K,G=new Set(p.map(pt)),H=L.filter(f=>f.id&&!G.has(f.id)),W=_.filter(f=>f.id&&!G.has(f.id));if(i){let f;return s[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Pe,{}),s[24]=f):f=s[24],f}let D;s[25]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X.Header.Left,{children:t.jsx($e,{children:t.jsx(ke,{children:t.jsx(ze,{children:t.jsx(Le,{children:"Store"})})})})}),s[25]=D):D=s[25];let B;s[26]!==E?(B=async f=>E(f),s[26]=E,s[27]=B):B=s[27];let A;s[28]!==H||s[29]!==x||s[30]!==h||s[31]!==v||s[32]!==B?(A=t.jsxs(X.Header,{children:[D,t.jsx(X.Header.Right,{children:t.jsx(ft,{wellKnownRegistries:H,registries:h,value:x,onValueChange:v,onAddWellKnown:B,placeholder:"Select store..."})})]}),s[28]=H,s[29]=x,s[30]=h,s[31]=v,s[32]=B,s[33]=A):A=s[33];let V;s[34]!==x||s[35]!==h?(V=f=>{const{error:Z,resetError:le}=f;return t.jsx(gt,{error:Z,onRetry:le,registryName:h.find(ee=>ee.id===x)?.name??"registry"})},s[34]=x,s[35]=h,s[36]=V):V=s[36];let O;s[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=O):O=s[37];let M;s[38]!==W||s[39]!==x||s[40]!==v||s[41]!==y?(M=t.jsx(U.Suspense,{fallback:O,children:x?t.jsx(ut,{registryId:x,storePrivateOnly:y}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(xt,{registries:W,onConnected:f=>{v(f)}})})}),s[38]=W,s[39]=x,s[40]=v,s[41]=y,s[42]=M):M=s[42];let q;s[43]!==V||s[44]!==M?(q=t.jsx(X.Content,{children:t.jsx(Re,{fallback:V,children:M})}),s[43]=V,s[44]=M,s[45]=q):q=s[45];let J;return s[46]!==A||s[47]!==q?(J=t.jsxs(X,{children:[A,q]}),s[46]=A,s[47]=q,s[48]=J):J=s[48],J}function pt(s){return s.id}function ht(s){return s??""}export{ts as default};
1
+ import{c as Q,r as U,u as re,K as ie,b$ as we,j as t,v as oe,B as Y,b as de,_ as me,$ as ue,O as fe,d as Ie,aC as Te,c0 as ne,E as Re,aE as Pe}from"./index-DVHuYwO5.js";import{P as X}from"./index-5XdaBbnC.js";import{B as $e,a as ke,b as ze,c as Le}from"./breadcrumb-BF7wgZMj.js";import{i as xe}from"./FilterLines-C4D0sIiB.js";import{n as ge}from"./Inbox01-DktY8c3P.js";import{i as se}from"./Loading01-DUUFtL7S.js";import{i as pe}from"./SearchMd-DOdaT51-.js";import{u as he}from"./useQuery-CxvwMb--.js";import{u as Fe}from"./useInfiniteQuery-CutnJ4kj.js";import{a as Ee,f as Oe,b as _e}from"./registry-utils-BL3Z-ZuV.js";import{u as je,W as Ke,a as Ae,h as Me,b as Be}from"./constants-DLWxw8L_.js";import{f as De,g as ye,h as Ge}from"./use-connection-CwB1S0Lk.js";import{s as We}from"./slugify-CEUa2lfQ.js";import{C as Ve,E as qe}from"./collection-search-g7bCyEl4.js";import{M as ae}from"./mcp-server-card-B_3KckAV.js";import{I as Ue}from"./input-CImrwNsE.js";import{a as ve,b as be,P as Ne}from"./popover-R_PT2IPW.js";import{i as Ce}from"./Check-llxZXJNk.js";import{t as Se}from"./ChevronDown-BPvdqfh0.js";import{s as te}from"./XClose-CYrOe1GU.js";import{s as He}from"./Plus-2wrCLrAD.js";import{u as Je}from"./use-binding-Dx_NAnJa.js";import{L as Qe,u as Ye}from"./localstorage-keys-B3yhvN27.js";import"./tooltip-BsUirxUt.js";import"./index-BLvVZqmB.js";import"./ChevronRight-bI92hTEK.js";import"./infiniteQueryObserver-BU31NXJd.js";import"./useMutation-BskhtN65.js";import"./CheckVerified02-B5N8FkZi.js";import"./Globe02-8eZbLs7z.js";import"./Lock01-BqRcOfbm.js";import"./Terminal-CZIzfu4H.js";import"./card-yVoc5Dl_.js";import"./integration-icon-CqdgwTQM.js";import"./Container-BcN3rU1W.js";import"./github-icon-Dp3wHhYE.js";import"./binder-C2Kwp5aI.js";function Ze(s,e){const r=Q.c(4),[l,d]=U.useState(s),n=U.useRef(null),i=U.useRef(!0);let c,a;return r[0]!==e||r[1]!==s?(c=()=>{if(i.current){i.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{d(s)},e),()=>{n.current&&clearTimeout(n.current)}},a=[s,e],r[0]=e,r[1]=s,r[2]=c,r[3]=a):(c=r[2],a=r[3]),U.useEffect(c,a),l}function Xe(s){const e=Q.c(14),r=U.useRef(null),l=`scroll-position:${s}`,d=U.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const i=n;let c;e[2]!==l?(c=()=>{if(d.current===l)return;const j=sessionStorage.getItem(l);if(j&&r.current){const S=Number.parseInt(j,10);r.current.scrollTop=S}d.current=l},e[2]=l,e[3]=c):c=e[3];const a=c;let g;e[4]!==a||e[5]!==l?(g=()=>{d.current!==l&&a()},e[4]=a,e[5]=l,e[6]=g):g=e[6];const I=g;let o;e[7]!==a||e[8]!==l?(o=j=>{r.current=j,j&&d.current!==l&&requestAnimationFrame(()=>{a()})},e[7]=a,e[8]=l,e[9]=o):o=e[9];const p=o;let m;return e[10]!==I||e[11]!==i||e[12]!==p?(m={scrollRef:p,saveScrollPosition:i,handleScroll:I},e[10]=I,e[11]=i,e[12]=p,e[13]=m):m=e[13],m}const et=24;function tt(s){const e=Q.c(54),{registryId:r,listToolName:l,filtersToolName:d,search:n}=s,{org:i}=re();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,g]=U.useState(c);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[1]=I):I=e[1];const[o,p]=U.useState(I),m=r||null;let j;e[2]!==i.id||e[3]!==m?(j={connectionId:m,orgId:i.id},e[2]=i.id,e[3]=m,e[4]=j):j=e[4];const S=je(j),R=!!d;let b;e[5]!==d||e[6]!==r?(b=ie.toolCall(r,d||"no-filters","{}"),e[5]=d,e[6]=r,e[7]=b):b=e[7];let N;e[8]!==S||e[9]!==d?(N=async()=>{if(!d)return{tags:[],categories:[]};const f=await S.callTool({name:d,arguments:{}});return f.structuredContent??f},e[8]=S,e[9]=d,e[10]=N):N=e[10];let P;e[11]!==b||e[12]!==N?(P={queryKey:b,queryFn:N,staleTime:36e5,retry:2},e[11]=b,e[12]=N,e[13]=P):P=e[13];const{data:$}=he(P);let h,C,k;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==o||e[18]!==a){const f=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:et,...a.length>0&&{tags:a},...o.length>0&&{categories:o},...f&&{where:f}},k=Fe,C=ie.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=o,e[18]=a,e[19]=h,e[20]=C,e[21]=k}else h=e[19],C=e[20],k=e[21];let v;e[22]!==S||e[23]!==h||e[24]!==l?(v=async f=>{const{pageParam:Z}=f,le=Z?{...h,cursor:Z}:h,ee=await S.callTool({name:l,arguments:le});return ee.structuredContent??ee},e[22]=S,e[23]=h,e[24]=l,e[25]=v):v=e[25];let z;e[26]!==v||e[27]!==C?(z={queryKey:C,queryFn:v,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=v,e[27]=C,e[28]=z):z=e[28];const{data:w,fetchNextPage:x,hasNextPage:y,isFetchingNextPage:u,isFetching:T,isLoading:L,error:F}=k(z);let _;e:{if(!w?.pages||w.pages.length===0){_=null;break e}const f=w.pages[0];if(typeof f=="object"&&f!==null&&"totalCount"in f&&typeof f.totalCount=="number"){_=f.totalCount;break e}_=null}const K=_,E=w?.pages;let G;e[29]!==E?(G=Ee(E),e[29]=E,e[30]=G):G=e[30];const H=G;let W;e[31]!==n||e[32]!==o.length||e[33]!==a.length?(W=a.length>0||o.length>0||!!n?.trim(),e[31]=n,e[32]=o.length,e[33]=a.length,e[34]=W):W=e[34];const D=W,B=T&&!u&&!L&&D;let A;e[35]!==x||e[36]!==y||e[37]!==u?(A=()=>{y&&!u&&x()},e[35]=x,e[36]=y,e[37]=u,e[38]=A):A=e[38];const V=A,O=y??!1,M=R?$?.tags:void 0,q=R?$?.categories:void 0;let J;return e[39]!==D||e[40]!==T||e[41]!==u||e[42]!==B||e[43]!==L||e[44]!==H||e[45]!==F||e[46]!==V||e[47]!==o||e[48]!==a||e[49]!==O||e[50]!==M||e[51]!==q||e[52]!==K?(J={items:H,totalCount:K,hasMore:O,isLoadingMore:u,isFiltering:B,isInitialLoading:L,isFetching:T,error:F,loadMore:V,availableTags:M,availableCategories:q,selectedTags:a,selectedCategories:o,setSelectedTags:g,setSelectedCategories:p,hasActiveFilters:D},e[39]=D,e[40]=T,e[41]=u,e[42]=B,e[43]=L,e[44]=H,e[45]=F,e[46]=V,e[47]=o,e[48]=a,e[49]=O,e[50]=M,e[51]=q,e[52]=K,e[53]=J):J=e[53],J}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,l)=>l.count-r.count).slice(0,e)}function ce(s){const e=Q.c(52),{label:r,items:l,selectedItems:d,onToggle:n,onClear:i}=s,[c,a]=U.useState(""),[g,I]=U.useState(!1);let o,p,m,j,S,R,b,N,P,$,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==g||e[4]!==c||e[5]!==d){const x=[...c?l.filter(E=>E.value.toLowerCase().includes(c.toLowerCase())):l].sort(lt);m=d.length,p=ve,P=g,$=I;let y;e[17]!==r?(y=t.jsx("span",{children:r}),e[17]=r,e[18]=y):y=e[18];let u;e[19]!==m?(u=m>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:m}),e[19]=m,e[20]=u):u=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=T):T=e[21],e[22]!==u||e[23]!==y?(h=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[y,u,T]})}),e[22]=u,e[23]=y,e[24]=h):h=e[24],o=Ne,R="w-64 p-0",b="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let F;e[26]!==r?(F=r.toLowerCase(),e[26]=r,e[27]=F):F=e[27];const _=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=E=>a(E.target.value),e[28]=K):K=e[28],e[29]!==c||e[30]!==_?(N=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,t.jsx(Ue,{type:"text",placeholder:_,value:c,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=_,e[31]=N):N=e[31],j="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",S=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const G=d.includes(E.value);return t.jsxs("button",{onClick:()=>n(E.value),className:oe("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=g,e[4]=c,e[5]=d,e[6]=o,e[7]=p,e[8]=m,e[9]=j,e[10]=S,e[11]=R,e[12]=b,e[13]=N,e[14]=P,e[15]=$,e[16]=h}else o=e[6],p=e[7],m=e[8],j=e[9],S=e[10],R=e[11],b=e[12],N=e[13],P=e[14],$=e[15],h=e[16];let C;e[32]!==j||e[33]!==S?(C=t.jsx("div",{className:j,children:S}),e[32]=j,e[33]=S,e[34]=C):C=e[34];let k;e[35]!==r||e[36]!==i||e[37]!==m?(k=m>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:i,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=i,e[37]=m,e[38]=k):k=e[38];let v;e[39]!==o||e[40]!==k||e[41]!==R||e[42]!==b||e[43]!==N||e[44]!==C?(v=t.jsxs(o,{className:R,align:b,children:[N,C,k]}),e[39]=o,e[40]=k,e[41]=R,e[42]=b,e[43]=N,e[44]=C,e[45]=v):v=e[45];let z;return e[46]!==p||e[47]!==v||e[48]!==P||e[49]!==$||e[50]!==h?(z=t.jsxs(p,{open:P,onOpenChange:$,children:[h,v]}),e[46]=p,e[47]=v,e[48]=P,e[49]=$,e[50]=h,e[51]=z):z=e[51],z}function lt(s,e){return e.count-s.count}function nt(s){const e=Q.c(67),{availableTags:r,availableCategories:l,selectedTags:d,selectedCategories:n,onTagChange:i,onCategoryChange:c}=s,a=r&&r.length>0||l&&l.length>0,g=d.length>0||n.length>0;if(!a)return null;let I;e[0]!==i||e[1]!==d?(I=y=>{d.includes(y)?i(d.filter(u=>u!==y)):i([...d,y])},e[0]=i,e[1]=d,e[2]=I):I=e[2];const o=I;let p;e[3]!==c||e[4]!==n?(p=y=>{n.includes(y)?c(n.filter(u=>u!==y)):c([...n,y])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const m=p;let j;e[6]!==c||e[7]!==i?(j=()=>{i([]),c([])},e[6]=c,e[7]=i,e[8]=j):j=e[8];const S=j;let R,b,N,P,$,h,C;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==i||e[13]!==n||e[14]!==d||e[15]!==m||e[16]!==o){const y=l?rt(l,6):[];R=n,b=d,C=new Set(y.map(it)),$="flex items-center border-b border-border";let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(xe,{size:16})}),e[24]=u):u=e[24];let T;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==m?(T=l&&l.length>0&&t.jsx(ce,{label:"Categories",items:l,selectedItems:n,onToggle:m,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=m,e[29]=T):T=e[29];let L;e[30]!==r||e[31]!==i||e[32]!==d||e[33]!==o?(L=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:d,onToggle:o,onClear:()=>i([])}),e[30]=r,e[31]=i,e[32]=d,e[33]=o,e[34]=L):L=e[34],e[35]!==L||e[36]!==T?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[u,T,L]}),e[35]=L,e[36]=T,e[37]=h):h=e[37],N="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==n||e[39]!==m?(F=_=>{const K=n.includes(_.value);return t.jsxs("div",{onClick:()=>m(_.value),className:oe("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:_.value}),K&&t.jsx("span",{onClick:E=>{E.stopPropagation(),m(_.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},_.value)},e[38]=n,e[39]=m,e[40]=F):F=e[40],P=y.map(F),e[9]=l,e[10]=r,e[11]=c,e[12]=i,e[13]=n,e[14]=d,e[15]=m,e[16]=o,e[17]=R,e[18]=b,e[19]=N,e[20]=P,e[21]=$,e[22]=h,e[23]=C}else R=e[17],b=e[18],N=e[19],P=e[20],$=e[21],h=e[22],C=e[23];let k;if(e[41]!==R||e[42]!==m||e[43]!==C){let y;e[45]!==C?(y=T=>!C.has(T),e[45]=C,e[46]=y):y=e[46];let u;e[47]!==m?(u=T=>t.jsxs("div",{onClick:()=>m(T),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:T}),t.jsx("span",{onClick:L=>{L.stopPropagation(),m(T)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`cat-${T}`),e[47]=m,e[48]=u):u=e[48],k=R.filter(y).map(u),e[41]=R,e[42]=m,e[43]=C,e[44]=k}else k=e[44];let v;if(e[49]!==b||e[50]!==o){let y;e[52]!==o?(y=u=>t.jsxs("div",{onClick:()=>o(u),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:u}),t.jsx("span",{onClick:T=>{T.stopPropagation(),o(u)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`tag-${u}`),e[52]=o,e[53]=y):y=e[53],v=b.map(y),e[49]=b,e[50]=o,e[51]=v}else v=e[51];let z;e[54]!==S||e[55]!==g?(z=g&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:S,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(te,{size:14}),"Clear all"]}),e[54]=S,e[55]=g,e[56]=z):z=e[56];let w;e[57]!==z||e[58]!==N||e[59]!==P||e[60]!==k||e[61]!==v?(w=t.jsxs("div",{className:N,children:[P,k,v,z]}),e[57]=z,e[58]=N,e[59]=P,e[60]=k,e[61]=v,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==$||e[65]!==h?(x=t.jsxs("div",{className:$,children:[h,w]}),e[63]=w,e[64]=$,e[65]=h,e[66]=x):x=e[66],x}function it(s){return s.value}function ot(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=Q.c(55),{registryId:r,listToolName:l,filtersToolName:d,storePrivateOnly:n}=s,[i,c]=U.useState(""),a=Ze(i,300),g=de(),{org:I}=re(),{scrollRef:o,saveScrollPosition:p,handleScroll:m}=Xe(`store-discovery:${r}`);let j;e[0]!==a||e[1]!==d||e[2]!==l||e[3]!==r?(j={registryId:r,listToolName:l,filtersToolName:d,search:a},e[0]=a,e[1]=d,e[2]=l,e[3]=r,e[4]=j):j=e[4];const{items:S,hasMore:R,isLoadingMore:b,isInitialLoading:N,isFetching:P,error:$,loadMore:h,availableTags:C,availableCategories:k,selectedTags:v,selectedCategories:z,setSelectedTags:w,setSelectedCategories:x,hasActiveFilters:y}=tt(j);let u,T,L,F;if(e[5]!==a||e[6]!==P||e[7]!==N||e[8]!==S||e[9]!==i||e[10]!==n){const O=i?ot(S,i):S;F=n?O.filter(mt):O,u=(i!==a||P)&&!N&&!!i,L=F.filter(at),T=F.filter(M=>!L.find(q=>q.id===M.id)),e[5]=a,e[6]=P,e[7]=N,e[8]=S,e[9]=i,e[10]=n,e[11]=u,e[12]=T,e[13]=L,e[14]=F}else u=e[11],T=e[12],L=e[13],F=e[14];const _=T;let K;e[15]!==g||e[16]!==I.slug||e[17]!==r||e[18]!==p?(K=O=>{p();const M=We(O.name||O.title||O.server?.title||""),q=typeof O.id=="string"&&O.id.includes("/"),J=typeof O.server?.name=="string"&&O.server.name.includes("/"),f=q&&!J?O.id:O.server?.name||O.id||"";g({to:"/$org/$project/store/$appName",params:{org:I.slug,project:fe,appName:M},search:{registryId:r,serverName:f}})},e[15]=g,e[16]=I.slug,e[17]=r,e[18]=p,e[19]=K):K=e[19];const E=K;let G;e[20]!==m||e[21]!==R||e[22]!==b||e[23]!==h?(G=O=>{if(m(),!R||b)return;const M=O.currentTarget;M.scrollHeight-M.scrollTop-M.clientHeight<200&&h()},e[20]=m,e[21]=R,e[22]=b,e[23]=h,e[24]=G):G=e[24];const H=G;let W;e[25]!==u||e[26]!==i?(W=t.jsx(Ve,{value:i,onChange:c,placeholder:"Search for an MCP Server...",isSearching:u}),e[25]=u,e[26]=i,e[27]=W):W=e[27];let D;e[28]!==k||e[29]!==C||e[30]!==z||e[31]!==v||e[32]!==x||e[33]!==w?(D=t.jsx(nt,{availableTags:C,availableCategories:k,selectedTags:v,selectedCategories:z,onTagChange:w,onCategoryChange:x}),e[28]=k,e[29]=C,e[30]=z,e[31]=v,e[32]=x,e[33]=w,e[34]=D):D=e[34];let B;e[35]!==_||e[36]!==$||e[37]!==E||e[38]!==y||e[39]!==R||e[40]!==N||e[41]!==b||e[42]!==u||e[43]!==i||e[44]!==L||e[45]!==F?(B=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:$&&!N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(me,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),$.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:$.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:dt,children:[t.jsx(ue,{className:"size-4"}),"Try again"]})]}):N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):F.length===0&&!y?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(ge,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):F.length===0&&y&&!i?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):i&&F.length===0&&!u?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[u&&F.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),L.length>0&&t.jsx(ae,{items:L,title:"Verified",onItemClick:E}),_.length>0&&t.jsx(ae,{items:_,title:L.length>0?"All":"",onItemClick:E}),R&&b&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(se,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[35]=_,e[36]=$,e[37]=E,e[38]=y,e[39]=R,e[40]=N,e[41]=b,e[42]=u,e[43]=i,e[44]=L,e[45]=F,e[46]=B):B=e[46];let A;e[47]!==H||e[48]!==o||e[49]!==B?(A=t.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",onScroll:H,children:B}),e[47]=H,e[48]=o,e[49]=B,e[50]=A):A=e[50];let V;return e[51]!==W||e[52]!==D||e[53]!==A?(V=t.jsxs("div",{className:"flex flex-col h-full",children:[W,D,A]}),e[51]=W,e[52]=D,e[53]=A,e[54]=V):V=e[54],V}function dt(){return window.location.reload()}function mt(s){return s.is_public!==!0}function ut(s){const e=Q.c(11),{registryId:r,storePrivateOnly:l}=s,d=De(r),n=d?.tools;let i;e[0]!==n?(i=Oe(n),e[0]=n,e[1]=i):i=e[1];const c=i;if(!c){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),e[2]=m):m=e[2];let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[m,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=j):j=e[3],j}const a=d?.tools;let g;e[4]!==a?(g=_e(a),e[4]=a,e[5]=g):g=e[5];const o=g||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==o?(p=t.jsx(ct,{registryId:r,listToolName:c,filtersToolName:o,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=o,e[10]=p):p=e[10],p}function ft(s){const e=Q.c(43),{registries:r,value:l,onValueChange:d,onAddWellKnown:n,wellKnownRegistries:i,placeholder:c}=s,a=c===void 0?"Select a registry...":c,[g,I]=U.useState(!1);let o,p,m,j,S,R,b,N;if(e[0]!==g||e[1]!==a||e[2]!==r||e[3]!==l){let w;e[12]!==l?(w=y=>y.id===l,e[12]=l,e[13]=w):w=e[13];const x=r.find(w);p=ve,b=g,N=I,o=be,R=!0,m="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(j=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=j):j=e[14],S=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:a}),e[0]=g,e[1]=a,e[2]=r,e[3]=l,e[4]=o,e[5]=p,e[6]=m,e[7]=j,e[8]=S,e[9]=R,e[10]=b,e[11]=N}else o=e[4],p=e[5],m=e[6],j=e[7],S=e[8],R=e[9],b=e[10],N=e[11];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=P):P=e[15];let $;e[16]!==m||e[17]!==j||e[18]!==S?($=t.jsxs("button",{type:m,className:j,children:[S,P]}),e[16]=m,e[17]=j,e[18]=S,e[19]=$):$=e[19];let h;e[20]!==o||e[21]!==R||e[22]!==$?(h=t.jsx(o,{asChild:R,children:$}),e[20]=o,e[21]=R,e[22]=$,e[23]=h):h=e[23];let C;if(e[24]!==d||e[25]!==r||e[26]!==l){let w;e[28]!==d||e[29]!==l?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{d(x.id??x.name),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),l===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=d,e[29]=l,e[30]=w):w=e[30],C=r.map(w),e[24]=d,e[25]=r,e[26]=l,e[27]=C}else C=e[27];let k;e[31]!==n||e[32]!==i?(k=i.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),i.map(w=>t.jsxs("button",{type:"button",onClick:()=>{n(w),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(He,{size:16})})]},w.id??w.title))]}),e[31]=n,e[32]=i,e[33]=k):k=e[33];let v;e[34]!==C||e[35]!==k?(v=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[C,k]}),e[34]=C,e[35]=k,e[36]=v):v=e[36];let z;return e[37]!==p||e[38]!==h||e[39]!==v||e[40]!==b||e[41]!==N?(z=t.jsxs(p,{open:b,onOpenChange:N,children:[h,v]}),e[37]=p,e[38]=h,e[39]=v,e[40]=b,e[41]=N,e[42]=z):z=e[42],z}function xt({registries:s,onConnected:e}){const r=ye(),{org:{slug:l}}=re(),{data:d}=Ie.useSession(),n=de(),[i,c]=U.useState(!1),a=s[0],g=async()=>{if(!(!a||!d?.user?.id)){c(!0);try{const o=await r.create.mutateAsync(a);e?.(o.id)}finally{c(!1)}}},I=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:fe},search:{action:"create"}})};return t.jsx(qe,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:g,disabled:i||!a,children:[a?.icon&&t.jsx("img",{src:a.icon,alt:"",className:"size-4"}),i?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:I,children:"Custom Connection"})]})})}function gt(s){const e=Q.c(15),{error:r,onRetry:l,registryName:d}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(me,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=i):i=e[1];let c;e[2]!==d?(c=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:d})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=d,e[3]=c):c=e[3];let a;e[4]!==r?(a=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=a):a=e[5];let g;e[6]!==c||e[7]!==a?(g=t.jsxs("div",{className:"space-y-2",children:[i,c,a]}),e[6]=c,e[7]=a,e[8]=g):g=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{className:"size-4"}),e[9]=I):I=e[9];let o;e[10]!==l?(o=t.jsxs(Y,{variant:"outline",size:"sm",onClick:l,children:[I,"Try again"]}),e[10]=l,e[11]=o):o=e[11];let p;return e[12]!==g||e[13]!==o?(p=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,g,o]}),e[12]=g,e[13]=o,e[14]=p):p=e[14],p}function ts(){const s=Q.c(49),{org:e,project:r}=re(),l=Ge(),d=ye(),n=Te(),i=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=Je(l);let a;s[0]!==e.id?(a=Ke.SELF(e.id),s[0]=e.id,s[1]=a):a=s[1];const g=a,I=r.enabledPlugins,o=I==null||I.includes(ne),p=c.filter(f=>f.id!==g?!0:o);let m;s[2]!==g?(m=f=>f.id===g,s[2]=g,s[3]=m):m=s[3];const j=p.some(m);let S;s[4]!==e.id?(S={connectionId:Ae,orgId:e.id},s[4]=e.id,s[5]=S):S=s[5];const R=je(S);let b;s[6]!==r.id||s[7]!==R?(b=async()=>{const f=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ne}});return f.structuredContent??f},s[6]=r.id,s[7]=R,s[8]=b):b=s[8];const{data:N}=he({queryKey:ie.projectPluginConfig(r.id??"",ne),queryFn:b,enabled:j&&!!r.id,staleTime:6e4}),P=N?.config?.settings;let $;s[9]!==P||s[10]!==g?($=f=>f.id===g&&P?{id:f.id,name:P.registryName||f.title,icon:P.registryIcon||f.icon||void 0}:{id:f.id,name:f.title,icon:f.icon||void 0},s[9]=P,s[10]=g,s[11]=$):$=s[11];const h=p.map($);let C;s[12]!==e.slug?(C=Qe.selectedRegistry(e.slug),s[12]=e.slug,s[13]=C):C=s[13];const[k,v]=Ye(C,ht);let z;s[14]!==k?(z=f=>f.id===k,s[14]=k,s[15]=z):z=s[15];const x=p.find(z)?.id||p[0]?.id||"",y=x===g&&P?.storePrivateOnly===!0;let u;s[16]!==e.id?(u=Me(e.id),s[16]=e.id,s[17]=u):u=s[17];let T;s[18]!==u?(T=[u],s[18]=u,s[19]=T):T=s[19];const L=T;let F;s[20]===Symbol.for("react.memo_cache_sentinel")?(F=[Be()],s[20]=F):F=s[20];const _=F;let K;s[21]!==d.create||s[22]!==v?(K=async f=>{const Z=await d.create.mutateAsync(f);v(Z.id)},s[21]=d.create,s[22]=v,s[23]=K):K=s[23];const E=K,G=new Set(p.map(pt)),H=L.filter(f=>f.id&&!G.has(f.id)),W=_.filter(f=>f.id&&!G.has(f.id));if(i){let f;return s[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Pe,{}),s[24]=f):f=s[24],f}let D;s[25]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X.Header.Left,{children:t.jsx($e,{children:t.jsx(ke,{children:t.jsx(ze,{children:t.jsx(Le,{children:"Store"})})})})}),s[25]=D):D=s[25];let B;s[26]!==E?(B=async f=>E(f),s[26]=E,s[27]=B):B=s[27];let A;s[28]!==H||s[29]!==x||s[30]!==h||s[31]!==v||s[32]!==B?(A=t.jsxs(X.Header,{children:[D,t.jsx(X.Header.Right,{children:t.jsx(ft,{wellKnownRegistries:H,registries:h,value:x,onValueChange:v,onAddWellKnown:B,placeholder:"Select store..."})})]}),s[28]=H,s[29]=x,s[30]=h,s[31]=v,s[32]=B,s[33]=A):A=s[33];let V;s[34]!==x||s[35]!==h?(V=f=>{const{error:Z,resetError:le}=f;return t.jsx(gt,{error:Z,onRetry:le,registryName:h.find(ee=>ee.id===x)?.name??"registry"})},s[34]=x,s[35]=h,s[36]=V):V=s[36];let O;s[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=O):O=s[37];let M;s[38]!==W||s[39]!==x||s[40]!==v||s[41]!==y?(M=t.jsx(U.Suspense,{fallback:O,children:x?t.jsx(ut,{registryId:x,storePrivateOnly:y}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(xt,{registries:W,onConnected:f=>{v(f)}})})}),s[38]=W,s[39]=x,s[40]=v,s[41]=y,s[42]=M):M=s[42];let q;s[43]!==V||s[44]!==M?(q=t.jsx(X.Content,{children:t.jsx(Re,{fallback:V,children:M})}),s[43]=V,s[44]=M,s[45]=q):q=s[45];let J;return s[46]!==A||s[47]!==q?(J=t.jsxs(X,{children:[A,q]}),s[46]=A,s[47]=q,s[48]=J):J=s[48],J}function pt(s){return s.id}function ht(s){return s??""}export{ts as default};
@@ -1 +1 @@
1
- import{c as s,j as t}from"./index-CzFqQvXW.js";import{e as r}from"./Dataflow03-Dbafm5jn.js";function a(){const o=s.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(r,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),o[0]=e):e=o[0],e}export{a as default};
1
+ import{c as s,j as t}from"./index-DVHuYwO5.js";import{e as r}from"./Dataflow03-BzHLq4N3.js";function a(){const o=s.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(r,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),o[0]=e):e=o[0],e}export{a as default};
@@ -1 +1 @@
1
- import{c as a,j as t,aA as n}from"./index-CzFqQvXW.js";function c(){const s=a.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
1
+ import{c as a,j as t,aA as n}from"./index-DVHuYwO5.js";function c(){const s=a.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
@@ -1 +1 @@
1
- import{c as S,j as s,r as w}from"./index-CzFqQvXW.js";import{i as R}from"./Check-BGWNBpXb.js";import{t as _}from"./ChevronDown-CxLgy5uI.js";import{e as y}from"./Dataflow03-Dbafm5jn.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:r,onConnectionChange:N}=x,[n,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==r){let t;e[3]!==r?(t=u=>u.id===r,e[3]=r,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=r,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==n?(o=()=>z(!n),e[13]=n,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==n||e[26]!==N||e[27]!==r?(m=n&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===r&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=n,e[26]=N,e[27]=r,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function H(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{H as default};
1
+ import{c as S,j as s,r as w}from"./index-DVHuYwO5.js";import{i as R}from"./Check-llxZXJNk.js";import{t as _}from"./ChevronDown-BPvdqfh0.js";import{e as y}from"./Dataflow03-BzHLq4N3.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:r,onConnectionChange:N}=x,[n,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==r){let t;e[3]!==r?(t=u=>u.id===r,e[3]=r,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=r,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==n?(o=()=>z(!n),e[13]=n,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==n||e[26]!==N||e[27]!==r?(m=n&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===r&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=n,e[26]=N,e[27]=r,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function H(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{H as default};
@@ -1 +1 @@
1
- import{c as w,j as s,r as S,aA as y}from"./index-CzFqQvXW.js";import{i as _}from"./Check-BGWNBpXb.js";import{t as k}from"./ChevronDown-CxLgy5uI.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
1
+ import{c as w,j as s,r as S,aA as y}from"./index-DVHuYwO5.js";import{i as _}from"./Check-llxZXJNk.js";import{t as k}from"./ChevronDown-BPvdqfh0.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
@@ -0,0 +1 @@
1
+ import{c as r,j as i}from"./index-DVHuYwO5.js";import{P as m}from"./project-plugins-D9btRO1g.js";import"./useQuery-CxvwMb--.js";import"./useMutation-BskhtN65.js";import"./constants-DLWxw8L_.js";import"./switch-C_rwAMG7.js";import"./label-BEcdY3zl.js";import"./Container-BcN3rU1W.js";import"./use-connection-CwB1S0Lk.js";import"./use-binding-Dx_NAnJa.js";import"./binder-C2Kwp5aI.js";import"./use-install-from-registry-CMYlie1K.js";import"./extract-connection-data-DPrPXrw7.js";import"./constants-BMZNxJu4.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BL3Z-ZuV.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-DUUFtL7S.js";import"./Plus-2wrCLrAD.js";import"./select-CZ5oa2ZG.js";import"./index-BLvVZqmB.js";import"./Check-llxZXJNk.js";import"./ChevronDown-BPvdqfh0.js";function q(){const o=r.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(m,{}),o[0]=t):t=o[0],t}export{q as default};
@@ -1 +1 @@
1
- import{r as i,G as $,j as c,aW as H,aH as G,I as A,H as _,M as g,aU as b,T as j,aV as L,aX as w,b0 as z,b1 as U,U as K,b2 as V,b3 as W,b4 as Z,aY as X,aZ as Y,a$ as q,c as R,v as B}from"./index-CzFqQvXW.js";var C="Popover",[E]=K(C,[w]),P=w(),[J,d]=E(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(H,{...p,children:c.jsx(J,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",Q=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Q.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),M=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(L,{asChild:!0,container:n,children:r})})})};M.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=d(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return z(a)},[]),c.jsx(U,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(T,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),m=P(o);return W(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(X,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Y,{"data-state":k(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),I="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(I,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=I;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=ae;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=M,ue=D;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{ge as P,fe as a,ve as b};
1
+ import{r as i,G as $,j as c,aW as H,aH as G,I as A,H as _,M as g,aU as b,T as j,aV as L,aX as w,b0 as z,b1 as U,U as K,b2 as V,b3 as W,b4 as Z,aY as X,aZ as Y,a$ as q,c as R,v as B}from"./index-DVHuYwO5.js";var C="Popover",[E]=K(C,[w]),P=w(),[J,d]=E(C),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:C});return c.jsx(H,{...p,children:c.jsx(J,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=C;var F="PopoverAnchor",Q=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(b,{...s,...r,ref:e})});Q.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),s=P(o),a=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(b,{asChild:!0,...s,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=E(O,{forceMount:void 0}),M=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||s.open,children:c.jsx(L,{asChild:!0,container:n,children:r})})})};M.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=d(v,t.__scopePopover);return c.jsx(j,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=V("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return z(a)},[]),c.jsx(U,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(T,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),m=P(o);return W(),c.jsx(Z,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(X,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Y,{"data-state":k(f.open),role:"dialog",id:f.contentId,...m,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),I="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(I,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=I;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=ae;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=M,ue=D;function fe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{ge as P,fe as a,ve as b};
@@ -1 +1 @@
1
- import{c as x,e as g,j as i,r as _,E as I,u as P}from"./index-CzFqQvXW.js";import{f as C}from"./use-connection-CmCfM9T5.js";import{u as M}from"./constants-0JLhMmM7.js";import{u as R}from"./use-mcp-tools-BTHDM3P3.js";import{M as $}from"./mcp-app-renderer-aRjr0jcc.js";import{g as b,M as h}from"./types-CnosXlf3.js";import"./useMutation-DsQcwaJP.js";import"./useQuery-BE7O7fKt.js";import"./use-mcp-resources--6yZ25c2.js";const j={};function y(t){const e=x.c(8),{client:o,toolName:c,resourceURI:a}=t;let s;e[0]!==o||e[1]!==c?(s={client:o,toolName:c,toolArguments:j},e[0]=o,e[1]=c,e[2]=s):s=e[2];const{data:n}=R(s);let l;return e[3]!==o||e[4]!==a||e[5]!==c||e[6]!==n?(l=i.jsx($,{resourceURI:a,toolName:c,toolInput:j,toolResult:n,displayMode:"fullscreen",minHeight:h.fullscreen.minHeight,maxHeight:h.fullscreen.maxHeight,client:o,className:"h-full"}),e[3]=o,e[4]=a,e[5]=c,e[6]=n,e[7]=l):l=e[7],l}function v(t){const e=x.c(16),{connectionId:o,toolName:c}=t,{org:a}=P();let s;e[0]!==o||e[1]!==a.id?(s={connectionId:o,orgId:a.id},e[0]=o,e[1]=a.id,e[2]=s):s=e[2];const n=M(s),l=C(o),m=decodeURIComponent(c);let d,f;if(e[3]!==l?.tools||e[4]!==m){let r;e[7]!==m?(r=N=>N.name===m,e[7]=m,e[8]=r):r=e[8],f=(l?.tools??[]).find(r),d=f?._meta?b(f._meta):void 0,e[3]=l?.tools,e[4]=m,e[5]=d,e[6]=f}else d=e[5],f=e[6];const u=d;if(!l){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found"})}),e[9]=r):r=e[9],r}if(!f||!u){let r;return e[10]!==m?(r=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',m,'" not found or has no UI']})}),e[10]=m,e[11]=r):r=e[11],r}let p;return e[12]!==n||e[13]!==m||e[14]!==u?(p=i.jsx(y,{client:n,toolName:m,resourceURI:u}),e[12]=n,e[13]=m,e[14]=u,e[15]=p):p=e[15],p}function w(){const t=x.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/apps/$connectionId/$toolName"},t[0]=e):e=t[0];const{connectionId:o,toolName:c}=g(e),a=`${o}:${c}`;let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),i.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),t[1]=s):s=t[1];let n;t[2]!==o||t[3]!==c?(n=i.jsx(_.Suspense,{fallback:s,children:i.jsx(v,{connectionId:o,toolName:c})}),t[2]=o,t[3]=c,t[4]=n):n=t[4];let l;return t[5]!==a||t[6]!==n?(l=i.jsx(I,{fallback:void 0,children:n},a),t[5]=a,t[6]=n,t[7]=l):l=t[7],l}export{w as default};
1
+ import{c as x,e as g,j as i,r as _,E as I,u as P}from"./index-DVHuYwO5.js";import{f as C}from"./use-connection-CwB1S0Lk.js";import{u as M}from"./constants-DLWxw8L_.js";import{u as R}from"./use-mcp-tools-CT-LTM8z.js";import{M as $}from"./mcp-app-renderer-elbh_bK3.js";import{g as b,M as h}from"./types-gEqZqH3b.js";import"./useMutation-BskhtN65.js";import"./useQuery-CxvwMb--.js";import"./use-mcp-resources-kkSzYGiM.js";const j={};function y(t){const e=x.c(8),{client:o,toolName:c,resourceURI:a}=t;let s;e[0]!==o||e[1]!==c?(s={client:o,toolName:c,toolArguments:j},e[0]=o,e[1]=c,e[2]=s):s=e[2];const{data:n}=R(s);let l;return e[3]!==o||e[4]!==a||e[5]!==c||e[6]!==n?(l=i.jsx($,{resourceURI:a,toolName:c,toolInput:j,toolResult:n,displayMode:"fullscreen",minHeight:h.fullscreen.minHeight,maxHeight:h.fullscreen.maxHeight,client:o,className:"h-full"}),e[3]=o,e[4]=a,e[5]=c,e[6]=n,e[7]=l):l=e[7],l}function v(t){const e=x.c(16),{connectionId:o,toolName:c}=t,{org:a}=P();let s;e[0]!==o||e[1]!==a.id?(s={connectionId:o,orgId:a.id},e[0]=o,e[1]=a.id,e[2]=s):s=e[2];const n=M(s),l=C(o),m=decodeURIComponent(c);let d,f;if(e[3]!==l?.tools||e[4]!==m){let r;e[7]!==m?(r=N=>N.name===m,e[7]=m,e[8]=r):r=e[8],f=(l?.tools??[]).find(r),d=f?._meta?b(f._meta):void 0,e[3]=l?.tools,e[4]=m,e[5]=d,e[6]=f}else d=e[5],f=e[6];const u=d;if(!l){let r;return e[9]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found"})}),e[9]=r):r=e[9],r}if(!f||!u){let r;return e[10]!==m?(r=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',m,'" not found or has no UI']})}),e[10]=m,e[11]=r):r=e[11],r}let p;return e[12]!==n||e[13]!==m||e[14]!==u?(p=i.jsx(y,{client:n,toolName:m,resourceURI:u}),e[12]=n,e[13]=m,e[14]=u,e[15]=p):p=e[15],p}function w(){const t=x.c(8);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/apps/$connectionId/$toolName"},t[0]=e):e=t[0];const{connectionId:o,toolName:c}=g(e),a=`${o}:${c}`;let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[i.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),i.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),t[1]=s):s=t[1];let n;t[2]!==o||t[3]!==c?(n=i.jsx(_.Suspense,{fallback:s,children:i.jsx(v,{connectionId:o,toolName:c})}),t[2]=o,t[3]=c,t[4]=n):n=t[4];let l;return t[5]!==a||t[6]!==n?(l=i.jsx(I,{fallback:void 0,children:n},a),t[5]=a,t[6]=n,t[7]=l):l=t[7],l}export{w as default};
@@ -0,0 +1 @@
1
+ import{r as v,c as I,d as at,j as s,v as ue,t as Pe,aA as xs,o as ps,s as Re,b as rt,u as me,n as At,l as hs,k as gs,K as mt,B as ce,c7 as Pt,O as Ee,P as It,S as et,e as vs,aE as ys}from"./index-DVHuYwO5.js";import{u as Et}from"./use-project-C5wS8512.js";import{c as bs,d as js,b as Ns,a as Ot,D as Lt}from"./dialog-B8ODwZHJ.js";import{i as Dt}from"./X-BGHsyt4s.js";import{S as ne}from"./skeleton-DIOpAjh1.js";import{t as Ss,i as lt,u as ws}from"./use-settings-modal-TyiexX8v.js";import{A as Tt}from"./avatar-C0Za2Leb.js";import{t as Cs}from"./Settings01-jEDDrq49.js";import{i as _s}from"./Zap-Div5wKlF.js";import{a as ks,b as As,c as Ps,T as Is}from"./tooltip-BsUirxUt.js";import{i as Es}from"./Check-llxZXJNk.js";import{a as Os}from"./Copy01-DOsfcAr7.js";import{S as Le}from"./switch-C_rwAMG7.js";import{S as Ls,a as Ds,d as We,c as Ts}from"./select-CZ5oa2ZG.js";import{i as zs}from"./Code01-Cw3aSJX_.js";import{i as $s}from"./Shield01-_lpY_BlD.js";import{u as zt,a as Ms,T as Fe,b as Ue,c as Bs}from"./tabs-CTOkjsDF.js";import{u as Gs}from"./useMutation-BskhtN65.js";import{a as Rs,F as Ve,b as Ke,c as Ye,d as He,f as qe,e as Ws}from"./form-Bqy3P0kv.js";import{I as Ie}from"./input-CImrwNsE.js";import{i as Fs}from"./Upload01-c6QpJwvP.js";import{P as Us}from"./project-plugins-D9btRO1g.js";import{u as Vs,a as Ks,b as Ys,i as ie,r as Me,D as $t,c as Be,d as fe,s as ft,e as xt,Z as Mt,g as Bt,f as Gt,h as Rt,j as ke,k as nt,l as Ge,m as it,n as Hs,o as qs,p as Wt,q as ot,t as ct,v as Ft,w as Qs,x as Ut,y as pt,z as Xs,A as Js,B as Zs,R as ea,S as ta,C as sa,E as aa,F as Vt,G as ra,H as la,I as na,J as ia,K as oa,L as ca,M as da,N as ua,O as De,P as ma,Q as ht,T as gt,U as vt,V as fa,W as Kt,X as xa,Y as Ne,_ as pa,$ as ha,a0 as ga,a1 as va,a2 as ya,a3 as Qe,a4 as ba,a5 as Te,a6 as ja,a7 as Na,a8 as J,a9 as Yt,aa as Sa,ab as wa,ac as Ca,ad as _a,ae as ka,af as Aa,ag as Pa,ah as Ia,ai as Ea,aj as Oa,ak as La,al as Da,am as Ta,an as za,ao as $a,ap as Ma,aq as Ba,ar as Ga}from"./chart-C09J-0j8.js";import{L as Ae}from"./label-BEcdY3zl.js";import{B as Ra}from"./badge-zns1OAW0.js";import{i as Wa}from"./AlertCircle-DtdVhcv9.js";import{s as Ht}from"./Plus-2wrCLrAD.js";import{s as Fa}from"./RefreshCcw01-CmQ_Zyfb.js";import{u as _e,a as dt,K as Ua}from"./constants-DLWxw8L_.js";import{h as Va}from"./use-connection-CwB1S0Lk.js";import{b as oe,a as qt}from"./use-mcp-tools-CT-LTM8z.js";import{u as Ka}from"./use-members-CYCHCBAZ.js";import{c as Ya,A as Ha}from"./use-binding-Dx_NAnJa.js";import"./useQuery-CxvwMb--.js";import"./index-BLvVZqmB.js";import"./ChevronDown-BPvdqfh0.js";import"./localstorage-keys-B3yhvN27.js";import"./Container-BcN3rU1W.js";import"./use-install-from-registry-CMYlie1K.js";import"./extract-connection-data-DPrPXrw7.js";import"./constants-BMZNxJu4.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BL3Z-ZuV.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-DUUFtL7S.js";import"./index-B1uFfuid.js";import"./binder-C2Kwp5aI.js";const Qt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));Qt.displayName="Beaker01";const Xt=({size:t=24,color:e="currentColor",...r})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},v.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Xt.displayName="Bell01";function qa(t){const e=I.c(26),{activeSection:r,onNavigate:a}=t,{data:n}=at.useSession(),l=n?.user,i=l?.image,o=l?.name??"Profile",d=l?.name??"U";let m;e[0]!==d||e[1]!==i?(m=s.jsx(Tt,{url:i,fallback:d,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),e[0]=d,e[1]=i,e[2]=m):m=e[2];let c;e[3]!==o||e[4]!==m?(c={key:"account.profile",label:o,icon:m},e[3]=o,e[4]=m,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u={key:"account.preferences",label:"Preferences",icon:s.jsx(Cs,{size:14})},e[6]=u):u=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f={key:"account.experimental",label:"Experimental",icon:s.jsx(Qt,{size:14})},e[7]=f):f=e[7];let x;e[8]!==c?(x=[c,u,f],e[8]=c,e[9]=x):x=e[9];const h=x;let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p={key:"org.general",label:"General",icon:s.jsx(Ss,{size:14})},e[10]=p):p=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g={key:"org.plugins",label:"Features",icon:s.jsx(_s,{size:14})},e[11]=g):g=e[11];let y;e[12]===Symbol.for("react.memo_cache_sentinel")?(y=[p,g,{key:"org.billing",label:"Billing",icon:s.jsx(lt,{size:14})}],e[12]=y):y=e[12];const S=y;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),e[13]=N):N=e[13];let b;e[14]!==h||e[15]!==r||e[16]!==a?(b=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[N,h.map(_=>s.jsxs("button",{type:"button",onClick:()=>a(_.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===_.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:_.icon}),s.jsx("span",{className:"truncate",children:_.label})]},_.key))]}),e[14]=h,e[15]=r,e[16]=a,e[17]=b):b=e[17];let w;e[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),e[18]=w):w=e[18];let j;e[19]!==r||e[20]!==a?(j=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[w,S.map(_=>s.jsxs("button",{type:"button",onClick:()=>a(_.key),className:ue("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",r===_.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:_.icon}),s.jsx("span",{className:"truncate",children:_.label})]},_.key))]}),e[19]=r,e[20]=a,e[21]=j):j=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"mt-auto px-4 pb-1",children:s.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v","2.133.0"]})}),e[22]=C):C=e[22];let k;return e[23]!==b||e[24]!==j?(k=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[b,j,C]}),e[23]=b,e[24]=j,e[25]=k):k=e[25],k}function Qa(){const t=I.c(32),{data:e}=at.useSession(),[r,a]=v.useState(!1),n=e?.user,l=n?.image;let i;t[0]!==n?(i=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})},t[0]=n,t[1]=i):i=t[1];const o=i;let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),t[2]=d):d=t[2];const m=n?.name??"U";let c;t[3]!==m||t[4]!==l?(c=s.jsx(Tt,{url:l,fallback:m,shape:"circle",size:"xl",className:"size-16 shrink-0"}),t[3]=m,t[4]=l,t[5]=c):c=t[5];const u=n?.name??"User";let f;t[6]!==u?(f=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:u}),t[6]=u,t[7]=f):f=t[7];const x=n?.email;let h;t[8]!==x?(h=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:x}),t[8]=x,t[9]=h):h=t[9];let p;t[10]!==f||t[11]!==h?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[f,h]}),t[10]=f,t[11]=h,t[12]=p):p=t[12];let g;t[13]!==c||t[14]!==p?(g=s.jsxs("div",{className:"flex items-center gap-4",children:[c,p]}),t[13]=c,t[14]=p,t[15]=g):g=t[15];let y;t[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),t[16]=y):y=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),t[17]=S):S=t[17];const N=n?.id;let b;t[18]!==N?(b=s.jsx("span",{className:"font-mono text-sm",children:N}),t[18]=N,t[19]=b):b=t[19];let w;t[20]!==r?(w=r?s.jsx(Es,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Os,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),t[20]=r,t[21]=w):w=t[21];let j;t[22]!==o||t[23]!==b||t[24]!==w?(j=s.jsx(ks,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:o,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[b,w]})}),t[22]=o,t[23]=b,t[24]=w,t[25]=j):j=t[25];let C;t[26]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(As,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),t[26]=C):C=t[26];let k;t[27]!==j?(k=s.jsxs("div",{className:"flex flex-col",children:[y,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[S,s.jsx(Ps,{children:s.jsxs(Is,{children:[j,C]})})]})]}),t[27]=j,t[28]=k):k=t[28];let _;return t[29]!==k||t[30]!==g?(_=s.jsxs("div",{className:"flex flex-col gap-8",children:[d,g,k]}),t[29]=k,t[30]=g,t[31]=_):_=t[31],_}function Xe(t){const e=I.c(27),{icon:r,label:a,description:n,control:l,onClick:i,disabled:o}=t,d=o?void 0:i,m=i?"button":void 0,c=i&&!o?0:void 0;let u;e[0]!==o||e[1]!==i?(u=i&&!o?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),i())}:void 0,e[0]=o,e[1]=i,e[2]=u):u=e[2];const f=i&&!o?"pointer":void 0;let x;e[3]!==f?(x={cursor:f},e[3]=f,e[4]=x):x=e[4];let h;e[5]!==r?(h=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[5]=r,e[6]=h):h=e[6];let p;e[7]!==a?(p=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[7]=a,e[8]=p):p=e[8];let g;e[9]!==n?(g=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:n}),e[9]=n,e[10]=g):g=e[10];let y;e[11]!==p||e[12]!==g?(y=s.jsxs("div",{className:"min-w-0",children:[p,g]}),e[11]=p,e[12]=g,e[13]=y):y=e[13];let S;e[14]!==y||e[15]!==h?(S=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[h,y]}),e[14]=y,e[15]=h,e[16]=S):S=e[16];let N;e[17]!==l?(N=s.jsx("div",{onClick:Xa,className:"shrink-0",children:l}),e[17]=l,e[18]=N):N=e[18];let b;return e[19]!==d||e[20]!==S||e[21]!==N||e[22]!==m||e[23]!==c||e[24]!==u||e[25]!==x?(b=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:d,role:m,tabIndex:c,onKeyDown:u,style:x,children:[S,N]}),e[19]=d,e[20]=S,e[21]=N,e[22]=m,e[23]=c,e[24]=u,e[25]=x,e[26]=b):b=e[26],b}function Xa(t){return t.stopPropagation()}function yt(){const t=I.c(35),[e,r]=zt();let a;t[0]!==r?(a=async C=>{if(C&&await Notification.requestPermission()!=="granted"){Pe.error("Notifications denied. Please enable them in your browser settings."),r(Za);return}r(k=>({...k,enableNotifications:C}))},t[0]=r,t[1]=a):a=t[1];const n=a;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),t[2]=l):l=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(zs,{size:16}),t[3]=i):i=t[3];let o;t[4]!==r?(o=()=>r(Ja),t[4]=r,t[5]=o):o=t[5];let d;t[6]!==r?(d=C=>r(k=>({...k,devMode:C})),t[6]=r,t[7]=d):d=t[7];let m;t[8]!==e.devMode||t[9]!==d?(m=s.jsx(Le,{checked:e.devMode,onCheckedChange:d}),t[8]=e.devMode,t[9]=d,t[10]=m):m=t[10];let c;t[11]!==o||t[12]!==m?(c=s.jsx(Xe,{icon:i,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:o,control:m}),t[11]=o,t[12]=m,t[13]=c):c=t[13];let u;t[14]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Xt,{size:16}),t[14]=u):u=t[14];let f;t[15]!==n||t[16]!==e.enableNotifications?(f=s.jsx(Xe,{icon:u,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>n(!e.enableNotifications),control:s.jsx(Le,{disabled:typeof Notification>"u",checked:e.enableNotifications,onCheckedChange:n})}),t[15]=n,t[16]=e.enableNotifications,t[17]=f):f=t[17];let x;t[18]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx($s,{size:16}),t[18]=x):x=t[18];let h;t[19]!==r?(h=C=>r(k=>({...k,toolApprovalLevel:C})),t[19]=r,t[20]=h):h=t[20];let p;t[21]===Symbol.for("react.memo_cache_sentinel")?(p={none:"Always ask",readonly:"Skip read-only",yolo:"Auto-approve all"},t[21]=p):p=t[21];const g=p[e.toolApprovalLevel];let y;t[22]!==g?(y=s.jsx(Ds,{className:"w-36",children:s.jsx("span",{children:g})}),t[22]=g,t[23]=y):y=t[23];let S;t[24]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(We,{value:"none",textValue:"Always ask",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Always ask"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),t[24]=S):S=t[24];let N;t[25]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(We,{value:"readonly",textValue:"Skip read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Skip read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),t[25]=N):N=t[25];let b;t[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs(Ts,{children:[S,N,s.jsx(We,{value:"yolo",textValue:"Auto-approve all",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Auto-approve all"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),t[26]=b):b=t[26];let w;t[27]!==e.toolApprovalLevel||t[28]!==h||t[29]!==y?(w=s.jsx(Xe,{icon:x,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(Ls,{value:e.toolApprovalLevel,onValueChange:h,children:[y,b]})}),t[27]=e.toolApprovalLevel,t[28]=h,t[29]=y,t[30]=w):w=t[30];let j;return t[31]!==w||t[32]!==c||t[33]!==f?(j=s.jsxs("div",{className:"flex flex-col gap-6",children:[l,s.jsxs("div",{className:"flex flex-col",children:[c,f,w]})]}),t[31]=w,t[32]=c,t[33]=f,t[34]=j):j=t[34],j}function Ja(t){return{...t,devMode:!t.devMode}}function Za(t){return{...t,enableNotifications:!1}}function er(t){const e=I.c(22),{icon:r,label:a,description:n,checked:l,onCheckedChange:i}=t;let o;e[0]!==l||e[1]!==i?(o=()=>i(!l),e[0]=l,e[1]=i,e[2]=o):o=e[2];let d;e[3]!==r?(d=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:r}),e[3]=r,e[4]=d):d=e[4];let m;e[5]!==a?(m=s.jsx("p",{className:"text-sm font-medium text-foreground",children:a}),e[5]=a,e[6]=m):m=e[6];let c;e[7]!==n?(c=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:n}),e[7]=n,e[8]=c):c=e[8];let u;e[9]!==m||e[10]!==c?(u=s.jsxs("div",{className:"min-w-0",children:[m,c]}),e[9]=m,e[10]=c,e[11]=u):u=e[11];let f;e[12]!==d||e[13]!==u?(f=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[d,u]}),e[12]=d,e[13]=u,e[14]=f):f=e[14];let x;e[15]!==l||e[16]!==i?(x=s.jsx("div",{onClick:tr,className:"shrink-0",children:s.jsx(Le,{checked:l,onCheckedChange:i})}),e[15]=l,e[16]=i,e[17]=x):x=e[17];let h;return e[18]!==o||e[19]!==f||e[20]!==x?(h=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:o,children:[f,x]}),e[18]=o,e[19]=f,e[20]=x,e[21]=h):h=e[21],h}function tr(t){return t.stopPropagation()}function sr(){const t=I.c(7),[e,r]=zt();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),t[0]=a):a=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(xs,{size:16}),t[1]=n):n=t[1];let l;t[2]!==r?(l=o=>r(d=>({...d,experimental_projects:o})),t[2]=r,t[3]=l):l=t[3];let i;return t[4]!==e.experimental_projects||t[5]!==l?(i=s.jsxs("div",{className:"flex flex-col gap-6",children:[a,s.jsx("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:s.jsx(er,{icon:n,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:e.experimental_projects,onCheckedChange:l})})]}),t[4]=e.experimental_projects,t[5]=l,t[6]=i):i=t[6],i}const ar=ps({name:Re().min(1,"Name is required").max(255,"Name is too long"),slug:Re().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:Re().optional()});function rr(t){const e=I.c(24),{value:r,onChange:a,name:n}=t,l=v.useRef(null);let i;e[0]!==a?(i=b=>{const w=b.target.files?.[0];if(w){if(w.size>2097152){Pe.error("Image must be smaller than 2MB");return}const j=new FileReader;j.onerror=()=>{const C=j.error;console.error("FileReader error:",C),Pe.error(C?.message||"Failed to read image file. Please try again."),l.current&&(l.current.value="")},j.onloadend=()=>{if(j.readyState===FileReader.DONE&&j.result){const C=j.result;a(C)}},j.readAsDataURL(w)}},e[0]=a,e[1]=i):i=e[1];const o=i;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{l.current?.click()},e[2]=d):d=e[2];const m=d;let c;e[3]!==a?(c=b=>{b.stopPropagation(),a("")},e[3]=a,e[4]=c):c=e[4];const u=c;let f;e[5]!==o?(f=s.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:o}),e[5]=o,e[6]=f):f=e[6];let x;e[7]!==u||e[8]!==n||e[9]!==r?(x=r?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:r,alt:n||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:u,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Dt,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:m,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Fs,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=u,e[8]=n,e[9]=r,e[10]=x):x=e[10];const h=r?"Change Logo":"Upload Logo";let p;e[11]!==h?(p=s.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:m,className:"mb-2",children:h}),e[11]=h,e[12]=p):p=e[12];let g;e[13]!==u||e[14]!==r?(g=r&&s.jsx(ce,{type:"button",variant:"ghost",size:"sm",onClick:u,className:"ml-2",children:"Remove"}),e[13]=u,e[14]=r,e[15]=g):g=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=y):y=e[16];let S;e[17]!==p||e[18]!==g?(S=s.jsxs("div",{className:"flex-1",children:[p,g,y]}),e[17]=p,e[18]=g,e[19]=S):S=e[19];let N;return e[20]!==S||e[21]!==f||e[22]!==x?(N=s.jsxs("div",{className:"flex items-start gap-4",children:[f,x,S]}),e[20]=S,e[21]=f,e[22]=x,e[23]=N):N=e[23],N}function lr(){const t=rt(),{org:e,project:r}=me(),a=At(),[n,l]=v.useState(!1),i=hs({resolver:gs(ar),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),o=Gs({mutationFn:async c=>{const u={name:c.name,slug:c.slug};c.logo&&(u.logo=c.logo);const f=await at.organization.update({organizationId:e.id,data:u});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:c=>{a.invalidateQueries({queryKey:mt.organizations()}),a.invalidateQueries({queryKey:mt.activeOrganization(e.slug)}),Pe.success("Organization settings updated successfully"),c?.data?.slug&&c.data.slug!==e.slug&&t({to:"/$org/$project/settings",params:{org:c.data.slug,project:r.slug}})},onError:c=>{Pe.error(c instanceof Error?c.message:"Failed to update organization")},onSettled:()=>{l(!1)}}),d=c=>{l(!0),o.mutate(c)},m=i.formState.isDirty;return s.jsx(Rs,{...i,children:s.jsxs("form",{onSubmit:i.handleSubmit(d),className:"space-y-6",children:[s.jsx(Ve,{control:i.control,name:"name",render:({field:c})=>s.jsxs(Ke,{children:[s.jsx(Ye,{children:"Organization Name"}),s.jsx(He,{children:s.jsx(Ie,{placeholder:"My Organization",...c,disabled:n})}),s.jsx(qe,{})]})}),s.jsx(Ve,{control:i.control,name:"slug",render:({field:c})=>s.jsxs(Ke,{children:[s.jsx(Ye,{children:"Organization Slug"}),s.jsx(He,{children:s.jsx(Ie,{placeholder:"my-organization",...c,disabled:n,onChange:u=>{const f=u.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");c.onChange(f)}})}),s.jsx(Ws,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(qe,{})]})}),s.jsx(Ve,{control:i.control,name:"logo",render:({field:c})=>s.jsxs(Ke,{children:[s.jsx(Ye,{children:"Logo"}),s.jsx(He,{children:s.jsx(rr,{value:c.value,onChange:c.onChange,name:i.watch("name")})}),s.jsx(qe,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(ce,{type:"submit",disabled:!m||n,className:"min-w-24",children:n?"Saving...":"Save Changes"}),m&&s.jsx(ce,{type:"button",variant:"outline",onClick:()=>i.reset(),disabled:n,children:"Cancel"})]})]})})}function nr(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(lr,{})]}),t[0]=e):e=t[0],e}var bt=function(e,r){for(var a=arguments.length,n=new Array(a>2?a-2:0),l=2;l<a;l++)n[l-2]=arguments[l];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var i=0;console.warn(r.replace(/%s/g,()=>n[i++]))}},ir=["x1","y1","x2","y2","key"],or=["offset"],cr=["xAxisId","yAxisId"],dr=["xAxisId","yAxisId"];function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(a){ur(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function ur(t,e,r){return(e=mr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mr(t){var e=fr(t,"string");return typeof e=="symbol"?e:e+""}function fr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xe(){return xe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},xe.apply(null,arguments)}function ze(t,e){if(t==null)return{};var r,a,n=xr(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xr(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var pr=t=>{var{fill:e}=t;if(!e||e==="none")return null;var{fillOpacity:r,x:a,y:n,width:l,height:i,ry:o}=t;return v.createElement("rect",{x:a,y:n,ry:o,width:l,height:i,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Jt(t){var{option:e,lineItemProps:r}=t,a;if(v.isValidElement(e))a=v.cloneElement(e,r);else if(typeof e=="function")a=e(r);else{var n,{x1:l,y1:i,x2:o,y2:d,key:m}=r,c=ze(r,ir),u=(n=nt(c))!==null&&n!==void 0?n:{},{offset:f}=u,x=ze(u,or);a=v.createElement("line",xe({},x,{x1:l,y1:i,x2:o,y2:d,fill:"none",key:m}))}return a}function hr(t){var{x:e,width:r,horizontal:a=!0,horizontalPoints:n}=t;if(!a||!n||!n.length)return null;var{xAxisId:l,yAxisId:i}=t,o=ze(t,cr),d=n.map((m,c)=>{var u=Z(Z({},o),{},{x1:e,y1:m,x2:e+r,y2:m,key:"line-".concat(c),index:c});return v.createElement(Jt,{key:"line-".concat(c),option:a,lineItemProps:u})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function gr(t){var{y:e,height:r,vertical:a=!0,verticalPoints:n}=t;if(!a||!n||!n.length)return null;var{xAxisId:l,yAxisId:i}=t,o=ze(t,dr),d=n.map((m,c)=>{var u=Z(Z({},o),{},{x1:m,y1:e,x2:m,y2:e+r,key:"line-".concat(c),index:c});return v.createElement(Jt,{option:a,lineItemProps:u,key:"line-".concat(c)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function vr(t){var{horizontalFill:e,fillOpacity:r,x:a,y:n,width:l,height:i,horizontalPoints:o,horizontal:d=!0}=t;if(!d||!e||!e.length||o==null)return null;var m=o.map(u=>Math.round(u+n-n)).sort((u,f)=>u-f);n!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var x=m[f+1],h=x==null,p=h?n+i-u:x-u;if(p<=0)return null;var g=f%e.length;return v.createElement("rect",{key:"react-".concat(f),y:u,x:a,height:p,width:l,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},c)}function yr(t){var{vertical:e=!0,verticalFill:r,fillOpacity:a,x:n,y:l,width:i,height:o,verticalPoints:d}=t;if(!e||!r||!r.length)return null;var m=d.map(u=>Math.round(u+n-n)).sort((u,f)=>u-f);n!==m[0]&&m.unshift(0);var c=m.map((u,f)=>{var x=m[f+1],h=x==null,p=h?n+i-u:x-u;if(p<=0)return null;var g=f%r.length;return v.createElement("rect",{key:"react-".concat(f),x:u,y:l,width:p,height:o,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},c)}var br=(t,e)=>{var{xAxis:r,width:a,height:n,offset:l}=t;return Bt(Gt(Z(Z(Z({},ke),r),{},{ticks:Rt(r),viewBox:{x:0,y:0,width:a,height:n}})),l.left,l.left+l.width,e)},jr=(t,e)=>{var{yAxis:r,width:a,height:n,offset:l}=t;return Bt(Gt(Z(Z(Z({},ke),r),{},{ticks:Rt(r),viewBox:{x:0,y:0,width:a,height:n}})),l.top,l.top+l.height,e)},Nr={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:$t.grid};function Zt(t){var e=Vs(),r=Ks(),a=Ys(),n=Z(Z({},Me(t,Nr)),{},{x:ie(t.x)?t.x:a.left,y:ie(t.y)?t.y:a.top,width:ie(t.width)?t.width:a.width,height:ie(t.height)?t.height:a.height}),{xAxisId:l,yAxisId:i,x:o,y:d,width:m,height:c,syncWithTicks:u,horizontalValues:f,verticalValues:x}=n,h=Be(),p=fe(_=>ft(_,"xAxis",l,h)),g=fe(_=>ft(_,"yAxis",i,h));if(!xt(m)||!xt(c)||!ie(o)||!ie(d))return null;var y=n.verticalCoordinatesGenerator||br,S=n.horizontalCoordinatesGenerator||jr,{horizontalPoints:N,verticalPoints:b}=n;if((!N||!N.length)&&typeof S=="function"){var w=f&&f.length,j=S({yAxis:g?Z(Z({},g),{},{ticks:w?f:g.ticks}):void 0,width:e??m,height:r??c,offset:a},w?!0:u);bt(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(N=j)}if((!b||!b.length)&&typeof y=="function"){var C=x&&x.length,k=y({xAxis:p?Z(Z({},p),{},{ticks:C?x:p.ticks}):void 0,width:e??m,height:r??c,offset:a},C?!0:u);bt(Array.isArray(k),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof k,"]")),Array.isArray(k)&&(b=k)}return v.createElement(Mt,{zIndex:n.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(pr,{fill:n.fill,fillOpacity:n.fillOpacity,x:n.x,y:n.y,width:n.width,height:n.height,ry:n.ry}),v.createElement(vr,xe({},n,{horizontalPoints:N})),v.createElement(yr,xe({},n,{verticalPoints:b})),v.createElement(hr,xe({},n,{offset:a,horizontalPoints:N,xAxis:p,yAxis:g})),v.createElement(gr,xe({},n,{offset:a,verticalPoints:b,xAxis:p,yAxis:g}))))}Zt.displayName="CartesianGrid";var es=(t,e,r)=>Wt(t,"xAxis",ot(t,e),r),ts=(t,e,r)=>Ft(t,"xAxis",ot(t,e),r),ss=(t,e,r)=>Wt(t,"yAxis",ct(t,e),r),as=(t,e,r)=>Ft(t,"yAxis",ct(t,e),r),Sr=Ge([it,es,ss,ts,as],(t,e,r,a,n)=>Ut(t,"xAxis")?pt(e,a,!1):pt(r,n,!1)),wr=(t,e)=>e,rs=Ge([Xs,wr],(t,e)=>t.filter(r=>r.type==="area").find(r=>r.id===e)),ls=t=>{var e=it(t),r=Ut(e,"xAxis");return r?"yAxis":"xAxis"},Cr=(t,e)=>{var r=ls(t);return r==="yAxis"?ct(t,e):ot(t,e)},_r=(t,e,r)=>Js(t,ls(t),Cr(t,e),r),kr=Ge([rs,_r],(t,e)=>{var r;if(!(t==null||e==null)){var{stackId:a}=t,n=Qs(t);if(!(a==null||n==null)){var l=(r=e[a])===null||r===void 0?void 0:r.stackedData,i=l?.find(o=>o.key===n);if(i!=null)return i.map(o=>[o[0],o[1]])}}}),Ar=Ge([it,es,ss,ts,as,kr,Hs,Sr,rs,qs],(t,e,r,a,n,l,i,o,d,m)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:f}=i;if(!(d==null||t!=="horizontal"&&t!=="vertical"||e==null||r==null||a==null||n==null||a.length===0||n.length===0||o==null)){var{data:x}=d,h;if(x&&x.length>0?h=x:h=c?.slice(u,f+1),h!=null)return Yr({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:n,dataStartIndex:u,areaSettings:d,stackedData:l,displayedData:h,chartBaseValue:m,bandSize:o})}}),Pr=["id"],Ir=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pe.apply(null,arguments)}function ns(t,e){if(t==null)return{};var r,a,n=Er(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Er(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nt(Object(r),!0).forEach(function(a){Or(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Or(t,e,r){return(e=Lr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lr(t){var e=Dr(t,"string");return typeof e=="symbol"?e:e+""}function Dr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $e(t,e){return t&&t!=="none"?t:e}var Tr=t=>{var{dataKey:e,name:r,stroke:a,fill:n,legendType:l,hide:i}=t;return[{inactive:i,dataKey:e,type:l,color:$e(a,n),value:Vt(r,e),payload:t}]},zr=v.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:n,fill:l,name:i,hide:o,unit:d,tooltipType:m,id:c}=t,u={dataDefinedOnItem:r,getPosition:la,settings:{stroke:a,strokeWidth:n,fill:l,dataKey:e,nameKey:void 0,name:Vt(i,e),hide:o,type:m,color:$e(a,l),unit:d,graphicalItemId:c}};return v.createElement(ra,{tooltipEntrySettings:u})});function $r(t){var{clipPathId:e,points:r,props:a}=t,{needClip:n,dot:l,dataKey:i}=a,o=nt(a);return v.createElement(ba,{points:r,dot:l,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:i,baseProps:o,needClip:n,clipPathId:e})}function Mr(t){var{showLabels:e,children:r,points:a}=t,n=a.map(l=>{var i,o,d={x:(i=l.x)!==null&&i!==void 0?i:0,y:(o=l.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Se(Se({},d),{},{value:l.value,payload:l.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return v.createElement(va,{value:e?n:void 0},r)}function St(t){var{points:e,baseLine:r,needClip:a,clipPathId:n,props:l}=t,{layout:i,type:o,stroke:d,connectNulls:m,isRange:c}=l,{id:u}=l,f=ns(l,Pr),x=nt(f),h=ya(f);return v.createElement(v.Fragment,null,e?.length>1&&v.createElement(De,{clipPath:a?"url(#clipPath-".concat(n,")"):void 0},v.createElement(Qe,pe({},h,{id:u,points:e,connectNulls:m,type:o,baseLine:r,layout:i,stroke:"none",className:"recharts-area-area"})),d!=="none"&&v.createElement(Qe,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:e})),d!=="none"&&c&&v.createElement(Qe,pe({},x,{className:"recharts-area-curve",layout:i,type:o,connectNulls:m,fill:"none",points:r}))),v.createElement($r,{points:e,props:f,clipPathId:n}))}function Br(t){var e,r,{alpha:a,baseLine:n,points:l,strokeWidth:i}=t,o=(e=l[0])===null||e===void 0?void 0:e.y,d=(r=l[l.length-1])===null||r===void 0?void 0:r.y;if(!Te(o)||!Te(d))return null;var m=a*Math.abs(o-d),c=Math.max(...l.map(u=>u.x||0));return ie(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(u=>u.x||0),c)),ie(c)?v.createElement("rect",{x:0,y:o<d?o:o-m,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(m)}):null}function Gr(t){var e,r,{alpha:a,baseLine:n,points:l,strokeWidth:i}=t,o=(e=l[0])===null||e===void 0?void 0:e.x,d=(r=l[l.length-1])===null||r===void 0?void 0:r.x;if(!Te(o)||!Te(d))return null;var m=a*Math.abs(o-d),c=Math.max(...l.map(u=>u.y||0));return ie(n)?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max(...n.map(u=>u.y||0),c)),ie(c)?v.createElement("rect",{x:o<d?o:o-m,y:0,width:m,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function Rr(t){var{alpha:e,layout:r,points:a,baseLine:n,strokeWidth:l}=t;return r==="vertical"?v.createElement(Br,{alpha:e,points:a,baseLine:n,strokeWidth:l}):v.createElement(Gr,{alpha:e,points:a,baseLine:n,strokeWidth:l})}function Wr(t){var{needClip:e,clipPathId:r,props:a,previousPointsRef:n,previousBaselineRef:l}=t,{points:i,baseLine:o,isAnimationActive:d,animationBegin:m,animationDuration:c,animationEasing:u,onAnimationStart:f,onAnimationEnd:x}=a,h=v.useMemo(()=>({points:i,baseLine:o}),[i,o]),p=fa(h,"recharts-area-"),g=Kt(),[y,S]=v.useState(!1),N=!y,b=v.useCallback(()=>{typeof x=="function"&&x(),S(!1)},[x]),w=v.useCallback(()=>{typeof f=="function"&&f(),S(!0)},[f]);if(g==null)return null;var j=n.current,C=l.current;return v.createElement(Mr,{showLabels:N,points:i},a.children,v.createElement(xa,{animationId:p,begin:m,duration:c,isActive:d,easing:u,onAnimationEnd:b,onAnimationStart:w,key:p},k=>{if(j){var _=j.length/i.length,E=k===1?i:i.map((A,L)=>{var O=Math.floor(L*_);if(j[O]){var D=j[O];return Se(Se({},A),{},{x:Ne(D.x,A.x,k),y:Ne(D.y,A.y,k)})}return A}),z;return ie(o)?z=Ne(C,o,k):pa(o)||ha(o)?z=Ne(C,0,k):z=o.map((A,L)=>{var O=Math.floor(L*_);if(Array.isArray(C)&&C[O]){var D=C[O];return Se(Se({},A),{},{x:Ne(D.x,A.x,k),y:Ne(D.y,A.y,k)})}return A}),k>0&&(n.current=E,l.current=z),v.createElement(St,{points:E,baseLine:z,needClip:e,clipPathId:r,props:a})}return k>0&&(n.current=i,l.current=o),v.createElement(De,null,d&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(r)},v.createElement(Rr,{alpha:k,points:i,baseLine:o,layout:g,strokeWidth:a.strokeWidth}))),v.createElement(De,{clipPath:"url(#animationClipPath-".concat(r,")")},v.createElement(St,{points:i,baseLine:o,needClip:e,clipPathId:r,props:a})))}),v.createElement(ga,{label:a.label}))}function Fr(t){var{needClip:e,clipPathId:r,props:a}=t,n=v.useRef(null),l=v.useRef();return v.createElement(Wr,{needClip:e,clipPathId:r,props:a,previousPointsRef:n,previousBaselineRef:l})}class Ur extends v.PureComponent{render(){var{hide:e,dot:r,points:a,className:n,top:l,left:i,needClip:o,xAxisId:d,yAxisId:m,width:c,height:u,id:f,baseLine:x,zIndex:h}=this.props;if(e)return null;var p=Pt("recharts-area",n),g=f,{r:y,strokeWidth:S}=da(r),N=ua(r),b=y*2+S,w=o?"url(#clipPath-".concat(N?"":"dots-").concat(g,")"):void 0;return v.createElement(Mt,{zIndex:h},v.createElement(De,{className:p},o&&v.createElement("defs",null,v.createElement(ma,{clipPathId:g,xAxisId:d,yAxisId:m}),!N&&v.createElement("clipPath",{id:"clipPath-dots-".concat(g)},v.createElement("rect",{x:i-b/2,y:l-b/2,width:c+b,height:u+b}))),v.createElement(Fr,{needClip:o,clipPathId:g,props:this.props})),v.createElement(ht,{points:a,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}),this.props.isRange&&Array.isArray(x)&&v.createElement(ht,{points:x,mainColor:$e(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:w}))}}var is={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:$t.area};function Vr(t){var e,r=Me(t,is),{activeDot:a,animationBegin:n,animationDuration:l,animationEasing:i,connectNulls:o,dot:d,fill:m,fillOpacity:c,hide:u,isAnimationActive:f,legendType:x,stroke:h,xAxisId:p,yAxisId:g}=r,y=ns(r,Ir),S=na(),N=ia(),{needClip:b}=oa(p,g),w=Be(),{points:j,isRange:C,baseLine:k}=(e=fe(O=>Ar(O,t.id,w)))!==null&&e!==void 0?e:{},_=ca();if(S!=="horizontal"&&S!=="vertical"||_==null||N!=="AreaChart"&&N!=="ComposedChart")return null;var{height:E,width:z,x:A,y:L}=_;return!j||!j.length?null:v.createElement(Ur,pe({},y,{activeDot:a,animationBegin:n,animationDuration:l,animationEasing:i,baseLine:k,connectNulls:o,dot:d,fill:m,fillOpacity:c,height:E,hide:u,layout:S,isAnimationActive:f==="auto"?!ja.isSsr:f,isRange:C,legendType:x,needClip:b,points:j,stroke:h,width:z,left:A,top:L,xAxisId:p,yAxisId:g}))}var Kr=(t,e,r,a,n)=>{var l=r??e;if(ie(l))return l;var i=t==="horizontal"?n:a,o=i.scale.domain();if(i.type==="number"){var d=Math.max(o[0],o[1]),m=Math.min(o[0],o[1]);return l==="dataMin"?m:l==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return l==="dataMin"?o[0]:l==="dataMax"?o[1]:o[0]};function Yr(t){var{areaSettings:{connectNulls:e,baseValue:r,dataKey:a},stackedData:n,layout:l,chartBaseValue:i,xAxis:o,yAxis:d,displayedData:m,dataStartIndex:c,xAxisTicks:u,yAxisTicks:f,bandSize:x}=t,h=n&&n.length,p=Kr(l,i,r,o,d),g=l==="horizontal",y=!1,S=m.map((b,w)=>{var j,C,k,_;if(h)_=n[c+w];else{var E=gt(b,a);Array.isArray(E)?(_=E,y=!0):_=[p,E]}var z=(j=(C=_)===null||C===void 0?void 0:C[1])!==null&&j!==void 0?j:null,A=z==null||h&&!e&&gt(b,a)==null;if(g){var L;return{x:vt({axis:o,ticks:u,bandSize:x,entry:b,index:w}),y:A?null:(L=d.scale.map(z))!==null&&L!==void 0?L:null,value:_,payload:b}}return{x:A?null:(k=o.scale.map(z))!==null&&k!==void 0?k:null,y:vt({axis:d,ticks:f,bandSize:x,entry:b,index:w}),value:_,payload:b}}),N;return h||y?N=S.map(b=>{var w,j=Array.isArray(b.value)?b.value[0]:null;if(g){var C;return{x:b.x,y:j!=null&&b.y!=null&&(C=d.scale.map(j))!==null&&C!==void 0?C:null,payload:b.payload}}return{x:j!=null&&(w=o.scale.map(j))!==null&&w!==void 0?w:null,y:b.y,payload:b.payload}}):N=g?d.scale.map(p):o.scale.map(p),{points:S,baseLine:N??0,isRange:y}}function Hr(t){var e=Me(t,is),r=Be();return v.createElement(ea,{id:e.id,type:"area"},a=>v.createElement(v.Fragment,null,v.createElement(ta,{legendPayload:Tr(e)}),v.createElement(zr,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),v.createElement(sa,{type:"area",id:a,data:e.data,dataKey:e.dataKey,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,stackId:aa(e.stackId),hide:e.hide,barSize:void 0,baseValue:e.baseValue,isPanorama:r,connectNulls:e.connectNulls}),v.createElement(Vr,pe({},e,{id:a}))))}var os=v.memo(Hr,Zs);os.displayName="Area";var qr=["type"],Qr=["dangerouslySetInnerHTML","ticks","scale"],Xr=["id","scale"];function tt(){return tt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},tt.apply(null,arguments)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,a)}return r}function Ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(a){Jr(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Jr(t,e,r){return(e=Zr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zr(t){var e=el(t,"string");return typeof e=="symbol"?e:e+""}function el(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function st(t,e){if(t==null)return{};var r,a,n=tl(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(a=0;a<l.length;a++)r=l[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tl(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function sl(t){var e=Yt(),r=v.useRef(null),a=Kt(),{type:n}=t,l=st(t,qr),i=Da(a,"yAxis",n),o=v.useMemo(()=>{if(i!=null)return Ct(Ct({},l),{},{type:i})},[i,l]);return v.useLayoutEffect(()=>{o!=null&&(r.current===null?e(Sa(o)):r.current!==o&&e(wa({prev:r.current,next:o})),r.current=o)},[o,e]),v.useLayoutEffect(()=>()=>{r.current&&(e(Ca(r.current)),r.current=null)},[e]),null}function al(t){var{yAxisId:e,className:r,width:a,label:n}=t,l=v.useRef(null),i=v.useRef(null),o=fe(_a),d=Be(),m=Yt(),c="yAxis",u=fe(j=>ka(j,e)),f=fe(j=>Aa(j,e)),x=fe(j=>Pa(j,c,e,d)),h=fe(j=>Ia(j,e));if(v.useLayoutEffect(()=>{if(!(a!=="auto"||!u||Ea(n)||v.isValidElement(n)||h==null)){var j=l.current;if(j){var C=j.getCalculatedWidth();Math.round(u.width)!==Math.round(C)&&m(Oa({id:e,width:C}))}}},[x,u,m,n,e,a,h]),u==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:p,ticks:g,scale:y}=t,S=st(t,Qr),{id:N,scale:b}=h,w=st(h,Xr);return v.createElement(La,tt({},S,w,{ref:l,labelRef:i,x:f.x,y:f.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:u.width,height:u.height,className:Pt("recharts-".concat(c," ").concat(c),r),viewBox:o,ticks:x,axisType:c}))}var rl={allowDataOverflow:J.allowDataOverflow,allowDecimals:J.allowDecimals,allowDuplicatedCategory:J.allowDuplicatedCategory,angle:J.angle,axisLine:ke.axisLine,hide:!1,includeHidden:J.includeHidden,interval:J.interval,label:!1,minTickGap:J.minTickGap,mirror:J.mirror,orientation:J.orientation,padding:J.padding,reversed:J.reversed,scale:J.scale,tick:J.tick,tickCount:J.tickCount,tickLine:ke.tickLine,tickSize:ke.tickSize,type:J.type,width:J.width,yAxisId:0},ll=t=>{var e=Me(t,rl);return v.createElement(v.Fragment,null,v.createElement(sl,{interval:e.interval,id:e.yAxisId,scale:e.scale,type:e.type,domain:e.domain,allowDataOverflow:e.allowDataOverflow,dataKey:e.dataKey,allowDuplicatedCategory:e.allowDuplicatedCategory,allowDecimals:e.allowDecimals,tickCount:e.tickCount,padding:e.padding,includeHidden:e.includeHidden,reversed:e.reversed,ticks:e.ticks,width:e.width,orientation:e.orientation,mirror:e.mirror,hide:e.hide,unit:e.unit,name:e.name,angle:e.angle,minTickGap:e.minTickGap,tick:e.tick,tickFormatter:e.tickFormatter}),v.createElement(al,e))},cs=v.memo(ll,Na);cs.displayName="YAxis";var nl=["axis"],il=v.forwardRef((t,e)=>v.createElement(Ta,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:nl,tooltipPayloadSearcher:za,categoricalChartProps:t,ref:e}));const we="$.providerMetadata.openrouter.usage.cost";function ut(t){const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=new Date(r);a.setDate(a.getDate()+1);const n=new Date(r),l=t==="7d"?7:t==="30d"?30:90;return n.setDate(n.getDate()-l),{startDate:n.toISOString(),endDate:a.toISOString()}}function Ce(t){return t.structuredContent}function V(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const ds="gateway-chip-period";function ol(){try{const t=localStorage.getItem(ds);if(t==="daily"||t==="weekly"||t==="monthly")return t}catch{}return"daily"}function cl(t){try{localStorage.setItem(ds,t)}catch{}}const dl={low:"Low confidence",medium:"Medium confidence",high:"High confidence"},ul={daily:"daily",weekly:"weekly",monthly:"monthly"},ml=[5,10,25,50,100],fl=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"none",label:"No reset"}];function xl(t){const e=I.c(51),{open:r,onOpenChange:a,connectionId:n,currentLimitUsd:l,billingMode:i,currentLimitPeriod:o}=t,{org:d}=me(),[m,c]=v.useState(null),[u,f]=v.useState(""),[x,h]=v.useState(null),[p,g]=v.useState(null),[y,S]=v.useState(o??"none");let N;e[0]!==n||e[1]!==d.id?(N={connectionId:n,orgId:d.id},e[0]=n,e[1]=d.id,e[2]=N):N=e[2];const b=_e(N);let w;e[3]!==b?(w={client:b},e[3]=b,e[4]=w):w=e[4];const{mutate:j,isPending:C}=qt(w),k=At(),_=i==="postpaid";let E;e[5]!==u?(E=u?Number.parseFloat(u):null,e[5]=u,e[6]=E):E=e[6];const A=m??E,L=y==="none"?null:y,O=_&&A!=null&&A===l&&L===o;let D;e[7]!==b?(D=Ua.mcpToolCall(b,"GATEWAY_USAGE",JSON.stringify({})),e[7]=b,e[8]=D):D=e[8];const G=D;let K;e[9]!==G||e[10]!==k?(K=async()=>{await k.invalidateQueries({queryKey:G,exact:!0}),await k.refetchQueries({queryKey:G,exact:!0,type:"active"})},e[9]=G,e[10]=k,e[11]=K):K=e[11];const F=K;let T,$;e[12]!==i||e[13]!==o||e[14]!==l||e[15]!==A||e[16]!==_||e[17]!==y||e[18]!==j||e[19]!==a||e[20]!==F?($=()=>{if(!A||A<=0)return;const B=_?A:l+A;g(null);const ae={limit_usd:B,billing_mode:i,return_url:window.location.href};_&&(ae.limit_period=y),j({name:"GATEWAY_SET_LIMIT",arguments:ae},{onSuccess:async re=>{const te=re.structuredContent;te?.checkout_url||await F(),te?.checkout_url?h(te.checkout_url):T()},onError:re=>{g(re.message??"Failed to update limit.")}})},T=()=>{c(null),f(""),h(null),g(null),S(o??"none"),a(!1)},e[12]=i,e[13]=o,e[14]=l,e[15]=A,e[16]=_,e[17]=y,e[18]=j,e[19]=a,e[20]=F,e[21]=T,e[22]=$):(T=e[21],$=e[22]);const Y=_?"Configure Spending Limit":"Add Credit",H=_?"Set a spending limit for your AI Gateway. The limit resets automatically based on the selected period.":"Choose how much credit to add to your AI Gateway.",M=_?"New limit":"Select amount",U=_?"Set Limit":"Continue";let q;e[23]!==Y?(q=s.jsx(bs,{children:Y}),e[23]=Y,e[24]=q):q=e[24];let ee;e[25]!==H?(ee=s.jsx(js,{children:H}),e[25]=H,e[26]=ee):ee=e[26];let R;e[27]!==q||e[28]!==ee?(R=s.jsxs(Ns,{children:[q,ee]}),e[27]=q,e[28]=ee,e[29]=R):R=e[29];let W;e[30]!==M||e[31]!==x||e[32]!==U||e[33]!==l||e[34]!==u||e[35]!==A||e[36]!==p||e[37]!==$||e[38]!==C||e[39]!==_||e[40]!==O||e[41]!==y||e[42]!==m?(W=x?s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your payment link is ready. Click below to complete the purchase. You'll be redirected back here after payment."}),s.jsx(ce,{asChild:!0,className:"gap-2",children:s.jsxs("a",{href:x,children:[s.jsx(lt,{size:15}),"Complete Payment"]})})]}):s.jsxs("div",{className:"flex flex-col gap-5 pt-2",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(Ae,{className:"text-xs text-muted-foreground",children:M}),s.jsx("div",{className:"grid grid-cols-5 gap-2",children:ml.map(B=>s.jsxs("button",{type:"button",onClick:()=>{c(B),f("")},className:ue("rounded-md border px-3 py-2 text-sm font-medium transition-colors",m===B?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:["$",B]},B))})]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Ae,{htmlFor:"custom-amount",className:"text-xs text-muted-foreground",children:_?"Or enter the exact new limit":"Or enter a custom amount"}),s.jsxs("div",{className:"relative",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),s.jsx(Ie,{id:"custom-amount",type:"number",min:"0.01",step:"0.01",placeholder:"0.00",className:"pl-7",value:u,onChange:B=>{f(B.target.value),c(null)}})]})]}),_&&s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(Ae,{className:"text-xs text-muted-foreground",children:"Reset period"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:fl.map(B=>{const{value:ae,label:re}=B;return s.jsx("button",{type:"button",onClick:()=>S(ae),className:ue("rounded-md border px-2 py-2 text-xs font-medium transition-colors",y===ae?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted"),children:re},ae)})})]}),p&&s.jsx("p",{className:"text-xs text-destructive",children:p}),s.jsxs("div",{className:"flex items-center justify-between pt-1",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:_?s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:l>0?V(l):"none"})]}):s.jsxs(s.Fragment,{children:["Current limit:"," ",s.jsx("span",{className:"font-medium text-foreground",children:V(l)})]})}),s.jsx(ce,{onClick:$,disabled:C||!A||A<=0||O,className:"gap-2",children:C?"Updating...":U})]})]}),e[30]=M,e[31]=x,e[32]=U,e[33]=l,e[34]=u,e[35]=A,e[36]=p,e[37]=$,e[38]=C,e[39]=_,e[40]=O,e[41]=y,e[42]=m,e[43]=W):W=e[43];let Q;e[44]!==R||e[45]!==W?(Q=s.jsxs(Ot,{className:"sm:max-w-md",children:[R,W]}),e[44]=R,e[45]=W,e[46]=Q):Q=e[46];let se;return e[47]!==T||e[48]!==r||e[49]!==Q?(se=s.jsx(Lt,{open:r,onOpenChange:T,children:Q}),e[47]=T,e[48]=r,e[49]=Q,e[50]=se):se=e[50],se}function pl(t){const e=I.c(22),{estimation:r}=t;if(!r)return null;const{estimatedDaysRemaining:a,estimatedDepletionDate:n,avgDailySpend:l}=r;if(a==null)return null;let i;e[0]!==n?(i=n?new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null,e[0]=n,e[1]=i):i=e[1];const o=i,d=a!==1?"s":"";let m;e[2]!==a||e[3]!==d?(m=s.jsxs("span",{className:"tabular-nums font-medium text-foreground",children:["~",a," day",d," ","remaining"]}),e[2]=a,e[3]=d,e[4]=m):m=e[4];let c;e[5]!==o?(c=o&&s.jsxs("span",{children:["(until ",o,")"]}),e[5]=o,e[6]=c):c=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),e[7]=u):u=e[7];let f;e[8]!==l?(f=V(l),e[8]=l,e[9]=f):f=e[9];let x;e[10]!==f?(x=s.jsxs("span",{className:"tabular-nums",children:["avg ",f,"/day"]}),e[10]=f,e[11]=x):x=e[11];let h;e[12]!==r.resetsBeforeDepletion?(h=r.resetsBeforeDepletion&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-muted-foreground/60",children:"|"}),s.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Resets before depletion"})]}),e[12]=r.resetsBeforeDepletion,e[13]=h):h=e[13];const p=dl[r.confidence];let g;e[14]!==p?(g=s.jsx(Ra,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-4 font-normal",children:p}),e[14]=p,e[15]=g):g=e[15];let y;return e[16]!==g||e[17]!==m||e[18]!==c||e[19]!==x||e[20]!==h?(y=s.jsxs("div",{className:"mt-3 flex items-center gap-2 flex-wrap text-xs text-muted-foreground",children:[m,c,u,x,h,g]}),e[16]=g,e[17]=m,e[18]=c,e[19]=x,e[20]=h,e[21]=y):y=e[21],y}function hl(t){const e=I.c(37),{usage:r,limit:a,limitPeriod:n,onConfigureLimit:l,connectionId:i,alert:o}=t,d=a.total!=null&&a.total>0;let m;e[0]!==d||e[1]!==a.remaining||e[2]!==a.total?(m=d?Math.min(100,Math.round((a.total-(a.remaining??0))/a.total*100)):null,e[0]=d,e[1]=a.remaining,e[2]=a.total,e[3]=m):m=e[3];const c=m;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Spending"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[4]=u):u=e[4];let f;e[5]!==r.total?(f=V(r.total),e[5]=r.total,e[6]=f):f=e[6];let x;e[7]!==f?(x=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:f}),e[7]=f,e[8]=x):x=e[8];let h;e[9]!==d||e[10]!==a.total||e[11]!==n?(h=d&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",V(a.total)," limit",n&&s.jsxs("span",{className:"ml-1.5 inline-flex items-center gap-1",children:[s.jsx(Fa,{size:10}),ul[n]]})]}),e[9]=d,e[10]=a.total,e[11]=n,e[12]=h):h=e[12];let p;e[13]!==d?(p=!d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No limit configured"}),e[13]=d,e[14]=p):p=e[14];let g;e[15]!==x||e[16]!==h||e[17]!==p?(g=s.jsxs("div",{className:"flex flex-col gap-1",children:[u,x,h,p]}),e[15]=x,e[16]=h,e[17]=p,e[18]=g):g=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ht,{size:16}),e[19]=y):y=e[19];const S=d?"Configure Limit":"Set Limit";let N;e[20]!==l||e[21]!==S?(N=s.jsxs(ce,{onClick:l,variant:"outline",className:"gap-2",children:[y,S]}),e[20]=l,e[21]=S,e[22]=N):N=e[22];let b;e[23]!==N||e[24]!==g?(b=s.jsxs("div",{className:"flex items-center justify-between",children:[g,N]}),e[23]=N,e[24]=g,e[25]=b):b=e[25];let w;e[26]!==d||e[27]!==a.reset||e[28]!==c?(w=d&&c!=null&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:ue("h-full rounded-full transition-all",c>=90?"bg-destructive":c>=70?"bg-amber-500":"bg-primary"),style:{width:`${c}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c,"% used",a.reset&&s.jsxs("span",{className:"ml-2",children:["· resets ",a.reset]})]})]}),e[26]=d,e[27]=a.reset,e[28]=c,e[29]=w):w=e[29];let j;e[30]!==o||e[31]!==i?(j=s.jsx(us,{connectionId:i,alert:o,billingMode:"postpaid"}),e[30]=o,e[31]=i,e[32]=j):j=e[32];let C;return e[33]!==b||e[34]!==w||e[35]!==j?(C=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[b,w,j]}),e[33]=b,e[34]=w,e[35]=j,e[36]=C):C=e[36],C}function gl(t){const e=I.c(30),{available:r,total:a,estimation:n,onAddCredit:l,connectionId:i,alert:o}=t,d=a>0?Math.max(0,Math.min(100,(a-r)/a*100)):0;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Available Credit"}),s.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"· Deco AI Gateway"})]}),e[0]=m):m=e[0];let c;e[1]!==r?(c=V(r),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=s.jsx("p",{className:"text-3xl font-bold tabular-nums text-foreground tracking-tight",children:c}),e[3]=c,e[4]=u):u=e[4];let f;e[5]!==a?(f=a>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["of ",V(a)," total"]}),e[5]=a,e[6]=f):f=e[6];let x;e[7]!==u||e[8]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,u,f]}),e[7]=u,e[8]=f,e[9]=x):x=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ht,{size:16}),e[10]=h):h=e[10];let p;e[11]!==l?(p=s.jsxs(ce,{onClick:l,className:"gap-2 px-5",children:[h,"Add Credit"]}),e[11]=l,e[12]=p):p=e[12];let g;e[13]!==x||e[14]!==p?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[x,p]}),e[13]=x,e[14]=p,e[15]=g):g=e[15];let y;e[16]!==r||e[17]!==a||e[18]!==d?(y=a>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"h-1.5 w-full rounded-full bg-muted overflow-hidden",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${d}%`}})}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[V(Math.max(0,a-r))," used"]})]}),e[16]=r,e[17]=a,e[18]=d,e[19]=y):y=e[19];let S;e[20]!==n?(S=s.jsx(pl,{estimation:n}),e[20]=n,e[21]=S):S=e[21];let N;e[22]!==o||e[23]!==i?(N=s.jsx(us,{connectionId:i,alert:o,billingMode:"prepaid"}),e[22]=o,e[23]=i,e[24]=N):N=e[24];let b;return e[25]!==S||e[26]!==N||e[27]!==g||e[28]!==y?(b=s.jsxs("div",{className:"relative overflow-hidden rounded-xl border border-border bg-gradient-to-br from-card via-card to-muted/30 p-6",children:[g,y,S,N]}),e[25]=S,e[26]=N,e[27]=g,e[28]=y,e[29]=b):b=e[29],b}function us(t){const e=I.c(78),{connectionId:r,alert:a,billingMode:n}=t,{org:l}=me(),[i,o]=v.useState(!1),[d,m]=v.useState(a.enabled),[c,u]=v.useState(String(a.threshold_usd)),[f,x]=v.useState(a.email??""),[h,p]=v.useState(!1),[g,y]=v.useState(null);let S;e[0]!==r||e[1]!==l.id?(S={connectionId:r,orgId:l.id},e[0]=r,e[1]=l.id,e[2]=S):S=e[2];const N=_e(S);let b;e[3]!==N?(b={client:N},e[3]=N,e[4]=b):b=e[4];const{mutate:w,isPending:j}=qt(b),C=d!==a.enabled||c!==String(a.threshold_usd)||f!==(a.email??"");let k;e[5]!==f||e[6]!==d||e[7]!==w||e[8]!==c?(k=()=>{y(null),p(!1);const X=parseFloat(c);if(d&&(!f||!f.includes("@"))){y("A valid email is required to enable alerts.");return}if(Number.isNaN(X)||X<=0){y("Threshold must be a positive number.");return}w({name:"GATEWAY_SET_ALERT",arguments:{enabled:d,threshold_usd:X,...f?{email:f}:{}}},{onSuccess:()=>{p(!0),setTimeout(()=>p(!1),3e3)},onError:he=>{y(he.message??"Failed to save alert config.")}})},e[5]=f,e[6]=d,e[7]=w,e[8]=c,e[9]=k):k=e[9];const _=k,E=n==="postpaid"?"Usage Alert":"Low-Balance Alert",z=n==="postpaid"?"Get notified when spending reaches a threshold":"Get notified when credit drops below a threshold";if(!i){let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=()=>o(!0),e[10]=X):X=e[10];let he;e[11]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx("div",{className:"flex items-center justify-center size-7 rounded-md bg-muted shrink-0",children:s.jsx(Wa,{size:14,className:"text-muted-foreground"})}),e[11]=he):he=e[11];let ge;e[12]!==E?(ge=s.jsx("p",{className:"text-xs font-medium text-foreground",children:E}),e[12]=E,e[13]=ge):ge=e[13];let ve;e[14]!==a.enabled||e[15]!==a.threshold_usd||e[16]!==n?(ve=a.enabled?n==="postpaid"?`Enabled · Alert at ${V(a.threshold_usd)}`:`Enabled · Alert below ${V(a.threshold_usd)}`:n==="postpaid"?"Get notified before your spending limit runs out":"Get notified before your credit balance runs out",e[14]=a.enabled,e[15]=a.threshold_usd,e[16]=n,e[17]=ve):ve=e[17];let ye;e[18]!==ve?(ye=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:ve}),e[18]=ve,e[19]=ye):ye=e[19];let be;e[20]!==ge||e[21]!==ye?(be=s.jsxs("div",{className:"flex-1 min-w-0",children:[ge,ye]}),e[20]=ge,e[21]=ye,e[22]=be):be=e[22];let je;e[23]!==a.enabled?(je=a.enabled&&s.jsx("span",{className:"shrink-0 rounded-full bg-green-500/15 px-2 py-0.5 text-[10px] font-medium text-green-600 dark:text-green-400",children:"On"}),e[23]=a.enabled,e[24]=je):je=e[24];let Oe;return e[25]!==je||e[26]!==be?(Oe=s.jsxs("button",{type:"button",onClick:X,className:"mt-4 flex items-center gap-3 rounded-lg border border-dashed border-border/60 px-4 py-3 w-full text-left transition-colors hover:bg-muted/50 hover:border-border",children:[he,be,je]}),e[25]=je,e[26]=be,e[27]=Oe):Oe=e[27],Oe}let A;e[28]!==E?(A=s.jsx("p",{className:"text-xs font-medium text-foreground",children:E}),e[28]=E,e[29]=A):A=e[29];let L;e[30]!==z?(L=s.jsx("p",{className:"text-[11px] text-muted-foreground",children:z}),e[30]=z,e[31]=L):L=e[31];let O;e[32]!==A||e[33]!==L?(O=s.jsxs("div",{children:[A,L]}),e[32]=A,e[33]=L,e[34]=O):O=e[34];let D;e[35]!==d?(D=s.jsx(Le,{checked:d,onCheckedChange:m}),e[35]=d,e[36]=D):D=e[36];let G;e[37]!==O||e[38]!==D?(G=s.jsxs("div",{className:"flex items-center justify-between",children:[O,D]}),e[37]=O,e[38]=D,e[39]=G):G=e[39];const K=!d&&"opacity-50 pointer-events-none";let F;e[40]!==K?(F=ue("flex flex-col gap-3 transition-opacity",K),e[40]=K,e[41]=F):F=e[41];const T=n==="postpaid"?"Notify at":"Notify below";let $;e[42]!==T?($=s.jsx(Ae,{htmlFor:"alert-threshold",className:"text-[11px] text-muted-foreground",children:T}),e[42]=T,e[43]=$):$=e[43];let Y;e[44]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:"$"}),e[44]=Y):Y=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=X=>u(X.target.value),e[45]=H):H=e[45];let M;e[46]!==c?(M=s.jsxs("div",{className:"relative",children:[Y,s.jsx(Ie,{id:"alert-threshold",type:"number",min:"1",step:"1",className:"h-8 pl-7 text-xs",value:c,onChange:H})]}),e[46]=c,e[47]=M):M=e[47];let U;e[48]!==$||e[49]!==M?(U=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[$,M]}),e[48]=$,e[49]=M,e[50]=U):U=e[50];let q;e[51]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ae,{htmlFor:"alert-email",className:"text-[11px] text-muted-foreground",children:"Notification email"}),e[51]=q):q=e[51];let ee;e[52]===Symbol.for("react.memo_cache_sentinel")?(ee=X=>x(X.target.value),e[52]=ee):ee=e[52];let R;e[53]!==f?(R=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[q,s.jsx(Ie,{id:"alert-email",type:"email",placeholder:"you@example.com",className:"h-8 text-xs",value:f,onChange:ee})]}),e[53]=f,e[54]=R):R=e[54];let W;e[55]!==U||e[56]!==R?(W=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[U,R]}),e[55]=U,e[56]=R,e[57]=W):W=e[57];let Q;e[58]!==g?(Q=g&&s.jsx("p",{className:"text-[11px] text-destructive",children:g}),e[58]=g,e[59]=Q):Q=e[59];let se;e[60]!==F||e[61]!==W||e[62]!==Q?(se=s.jsxs("div",{className:F,children:[W,Q]}),e[60]=F,e[61]=W,e[62]=Q,e[63]=se):se=e[63];let B;e[64]!==h?(B=h&&s.jsx("span",{className:"text-[11px] text-green-600 dark:text-green-400",children:"Saved"}),e[64]=h,e[65]=B):B=e[65];let ae;e[66]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(ce,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>o(!1),children:"Cancel"}),e[66]=ae):ae=e[66];const re=j||!C,te=j?"Saving...":"Save Alert";let le;e[67]!==_||e[68]!==re||e[69]!==te?(le=s.jsx(ce,{size:"sm",className:"h-7 text-xs",onClick:_,disabled:re,children:te}),e[67]=_,e[68]=re,e[69]=te,e[70]=le):le=e[70];let de;e[71]!==B||e[72]!==le?(de=s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[B,ae,le]}),e[71]=B,e[72]=le,e[73]=de):de=e[73];let P;return e[74]!==se||e[75]!==de||e[76]!==G?(P=s.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-lg border border-border bg-muted/20 p-4",children:[G,se,de]}),e[74]=se,e[75]=de,e[76]=G,e[77]=P):P=e[77],P}const vl={cost:{label:"Cost",color:"var(--chart-1)"}};function yl(){const t=I.c(54),{org:e}=me(),[r,a]=v.useState("30d");let n;t[0]!==r?(n=ut(r),t[0]=r,t[1]=n):n=t[1];const l=n;let i;t[2]!==e.id?(i={connectionId:dt,orgId:e.id},t[2]=e.id,t[3]=i):i=t[3];const o=_e(i);let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d={type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},t[4]=d):d=t[4];let m;t[5]!==l?(m={widget:d,timeRange:l},t[5]=l,t[6]=m):m=t[6];let c;t[7]!==o||t[8]!==m?(c={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:m,staleTime:6e4,select:Ce},t[7]=o,t[8]=m,t[9]=c):c=t[9];const{data:u}=oe(c);let f;t[10]===Symbol.for("react.memo_cache_sentinel")?(f={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"count_all"}},t[10]=f):f=t[10];let x;t[11]!==l?(x={widget:f,timeRange:l},t[11]=l,t[12]=x):x=t[12];let h;t[13]!==o||t[14]!==x?(h={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:x,staleTime:6e4,select:Ce},t[13]=o,t[14]=x,t[15]=h):h=t[15];const{data:p}=oe(h);let g;t[16]===Symbol.for("react.memo_cache_sentinel")?(g={type:"metric",source:{path:we,from:"output"},aggregation:{fn:"sum",groupByColumn:"connection_title"}},t[16]=g):g=t[16];let y;t[17]!==l?(y={widget:g,timeRange:l},t[17]=l,t[18]=y):y=t[18];let S;t[19]!==o||t[20]!==y?(S={client:o,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:y,staleTime:6e4,select:Ce},t[19]=o,t[20]=y,t[21]=S):S=t[21];const{data:N}=oe(S);let b;t[22]!==u?.timeseries?(b=u?.timeseries??[],t[22]=u?.timeseries,t[23]=b):b=t[23];let w;t[24]!==b?(w=b.map(Cl),t[24]=b,t[25]=w):w=t[25];const j=w;let C;if(t[26]!==p?.value||t[27]!==j||t[28]!==N?.groups||t[29]!==u?.timeseries||t[30]!==r){const k=(u?.timeseries??[]).reduce(wl,0),_=p?.value??0,E=(N?.groups??[]).filter(Sl).sort(Nl).slice(0,5),z=r==="7d"?"last 7 days":r==="30d"?"last 30 days":"last 90 days";let A;t[32]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Usage"}),t[32]=A):A=t[32];const L=V(k);let O;t[33]!==L?(O=s.jsx("p",{className:"text-2xl font-bold tabular-nums text-foreground tracking-tight",children:L}),t[33]=L,t[34]=O):O=t[34];let D;t[35]!==z?(D=s.jsx("p",{className:"text-xs text-muted-foreground",children:z}),t[35]=z,t[36]=D):D=t[36];let G;t[37]!==O||t[38]!==D?(G=s.jsxs("div",{className:"flex items-baseline gap-2",children:[O,D]}),t[37]=O,t[38]=D,t[39]=G):G=t[39];let K;t[40]!==_?(K=_.toLocaleString(),t[40]=_,t[41]=K):K=t[41];let F;t[42]!==K?(F=s.jsxs("p",{className:"text-xs text-muted-foreground tabular-nums",children:[K," tool calls"]}),t[42]=K,t[43]=F):F=t[43];let T;t[44]!==G||t[45]!==F?(T=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[A,G,F]}),t[44]=G,t[45]=F,t[46]=T):T=t[46];let $;t[47]!==r?($=s.jsx(ms,{period:r,onPeriodChange:a}),t[47]=r,t[48]=$):$=t[48];let Y;t[49]!==T||t[50]!==$?(Y=s.jsxs("div",{className:"flex items-center justify-between",children:[T,$]}),t[49]=T,t[50]=$,t[51]=Y):Y=t[51];let H;t[52]!==j?(H=j.length>0?s.jsx($a,{config:vl,className:"h-[200px] w-full",children:s.jsxs(il,{data:j,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"fillCost",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",stopColor:"var(--color-cost)",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"var(--color-cost)",stopOpacity:0})]})}),s.jsx(Zt,{vertical:!1,strokeDasharray:"3 3"}),s.jsx(Ma,{dataKey:"date",tickLine:!1,axisLine:!1,tickMargin:8,fontSize:11,interval:"preserveStartEnd"}),s.jsx(cs,{tickLine:!1,axisLine:!1,tickMargin:4,fontSize:11,tickFormatter:jl}),s.jsx(Ba,{content:s.jsx(Ga,{formatter:bl})}),s.jsx(os,{type:"monotone",dataKey:"cost",stroke:"var(--color-cost)",fill:"url(#fillCost)",strokeWidth:2})]})}):s.jsx("div",{className:"h-[200px] flex items-center justify-center text-xs text-muted-foreground",children:"No usage data available for this period"}),t[52]=j,t[53]=H):H=t[53],C=s.jsxs("div",{className:"flex flex-col gap-4 rounded-xl border border-border bg-card p-5",children:[Y,H,E.length>0&&s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:"Cost by Connection"}),s.jsx("div",{className:"flex flex-col gap-1.5",children:E.map((M,U)=>{const q=k>0?Math.min(M.value/k*100,100):0;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:M.key}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:"h-full transition-all duration-500 ease-out rounded-sm",style:{width:`${q}%`,backgroundColor:`var(--chart-${U%5+1})`}})}),s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:V(M.value)})]},M.key)})})]})]}),t[26]=p?.value,t[27]=j,t[28]=N?.groups,t[29]=u?.timeseries,t[30]=r,t[31]=C}else C=t[31];return C}function bl(t){return V(t)}function jl(t){return`$${t}`}function Nl(t,e){return e.value-t.value}function Sl(t){return t.value>0}function wl(t,e){return t+e.value}function Cl(t){return{date:new Date(t.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),cost:t.value}}function _l(){const t=I.c(6),[e,r]=v.useState(ol);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=m=>{r(m),cl(m)},t[0]=a):a=t[0];const n=a;let l,i;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Sidebar Display Period"}),i=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Choose which usage period is shown in the sidebar when no limit is set."}),t[1]=l,t[2]=i):(l=t[1],i=t[2]);let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=["daily","weekly","monthly"],t[3]=o):o=t[3];let d;return t[4]!==e?(d=s.jsxs("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card p-5",children:[l,i,s.jsx("div",{className:"flex gap-2 mt-1",children:o.map(m=>s.jsx("button",{type:"button",onClick:()=>n(m),className:ue("rounded-md border px-3 py-1.5 text-xs font-medium capitalize transition-colors",e===m?"border-primary bg-primary/10 text-primary":"border-border hover:bg-muted text-muted-foreground"),children:m},m))})]}),t[4]=e,t[5]=d):d=t[5],d}function Je(t){const e=I.c(20),{label:r,value:a,subValue:n,maxValue:l,color:i}=t,o=i===void 0?"bg-chart-1":i;let d;e[0]!==a?(d=parseFloat(a.replace(/[^0-9.]/g,""))||0,e[0]=a,e[1]=d):d=e[1];const m=d,c=l>0?Math.min(m/l*100,100):0;let u;e[2]!==r?(u=s.jsx("span",{className:"text-xs text-foreground truncate min-w-0 w-36 shrink-0",children:r}),e[2]=r,e[3]=u):u=e[3];let f;e[4]!==o?(f=ue("h-full transition-all duration-500 ease-out",o),e[4]=o,e[5]=f):f=e[5];const x=`${c}%`;let h;e[6]!==x?(h={width:x},e[6]=x,e[7]=h):h=e[7];let p;e[8]!==f||e[9]!==h?(p=s.jsx("div",{className:"relative h-2 bg-muted/50 overflow-hidden flex-1 rounded-sm",children:s.jsx("div",{className:f,style:h})}),e[8]=f,e[9]=h,e[10]=p):p=e[10];let g;e[11]!==a?(g=s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-foreground font-medium",children:a}),e[11]=a,e[12]=g):g=e[12];let y;e[13]!==n?(y=n&&s.jsx("span",{className:"text-xs tabular-nums shrink-0 text-muted-foreground",children:n}),e[13]=n,e[14]=y):y=e[14];let S;return e[15]!==u||e[16]!==p||e[17]!==g||e[18]!==y?(S=s.jsxs("div",{className:"flex items-center gap-2",children:[u,p,g,y]}),e[15]=u,e[16]=p,e[17]=g,e[18]=y,e[19]=S):S=e[19],S}function Ze(t){const e=I.c(8),{title:r,children:a,empty:n}=t;let l;e[0]!==r?(l=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:r}),e[0]=r,e[1]=l):l=e[1];let i;e[2]!==a||e[3]!==n?(i=n?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No data available for this period"}):a,e[2]=a,e[3]=n,e[4]=i):i=e[4];let o;return e[5]!==l||e[6]!==i?(o=s.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-border bg-card p-5",children:[l,i]}),e[5]=l,e[6]=i,e[7]=o):o=e[7],o}const _t={"7d":"7 days","30d":"30 days","90d":"90 days"};function ms(t){const e=I.c(4),{period:r,onPeriodChange:a}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Object.keys(_t),e[0]=n):n=e[0];let l;return e[1]!==a||e[2]!==r?(l=s.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5 self-start",children:n.map(i=>s.jsx("button",{type:"button",onClick:()=>a(i),className:ue("px-2.5 py-1 text-xs font-medium rounded-sm transition-colors",r===i?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:_t[i]},i))}),e[1]=a,e[2]=r,e[3]=l):l=e[3],l}function kt(t,e){const r=new Map(e.map(a=>[a.key,a.value]));return t.map(a=>({key:a.key,cost:a.value,calls:r.get(a.key)??0})).sort((a,n)=>n.cost-a.cost)}function kl(){const t=I.c(27),{org:e}=me(),[r,a]=v.useState("30d"),n=ut(r),{data:l}=Ka(),i=l?.data?.members??[],o=new Map(i.map(Ll));let d;t[0]!==e.id?(d={connectionId:dt,orgId:e.id},t[0]=e.id,t[1]=d):d=t[1];const m=_e(d),c=P=>({client:m,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:{widget:{type:"table",source:{path:we,from:"output"},aggregation:{fn:P.fn,...P.groupByColumn&&{groupByColumn:P.groupByColumn}}},timeRange:n},staleTime:6e4,select:Ce}),{data:u,isLoading:f}=oe(c({fn:"sum",groupByColumn:"connection_title"})),{data:x,isLoading:h}=oe(c({fn:"count_all",groupByColumn:"connection_title"})),{data:p,isLoading:g}=oe(c({fn:"sum",groupByColumn:"user_id"})),{data:y,isLoading:S}=oe(c({fn:"count_all",groupByColumn:"user_id"})),{data:N,isLoading:b}=oe(c({fn:"sum",groupByColumn:"tool_name"}));let w;t[2]===Symbol.for("react.memo_cache_sentinel")?(w={fn:"count_all",groupByColumn:"tool_name"},t[2]=w):w=t[2];const{data:j,isLoading:C}=oe(c(w));if(f||h||g||S||b||C){let P;t[3]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(ne,{className:"h-8 w-48"}),t[3]=P):P=t[3];let X;return t[4]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsxs("div",{className:"flex flex-col gap-4",children:[P,s.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:Array.from({length:3}).map(Ol)})]}),t[4]=X):X=t[4],X}const _=kt(u?.groups??[],x?.groups??[]),E=kt(p?.groups??[],y?.groups??[]).map(P=>({...P,key:o.get(P.key)??P.key})),z=j?.groups??[],A=new Map((N?.groups??[]).map(El)),L=z.map(P=>({name:P.key,calls:P.value,cost:A.get(P.key)??0})).sort(Il).slice(0,20),O=_.reduce(Pl,0),D=_.reduce(Al,0),G=_[0]?.cost??1,K=E[0]?.cost??1,F=L[0]?.calls??1;let T;t[5]!==r?(T=s.jsx(ms,{period:r,onPeriodChange:a}),t[5]=r,t[6]=T):T=t[6];const $="grid grid-cols-1 gap-4 sm:grid-cols-2",Y=_.length===0,H=_.slice(0,8).map(P=>s.jsx(Je,{label:P.key,value:V(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:G,color:"bg-chart-1"},P.key));let M;t[7]!==H?(M=s.jsx("div",{className:"space-y-2.5",children:H}),t[7]=H,t[8]=M):M=t[8];let U;t[9]!==Y||t[10]!==M?(U=s.jsx(Ze,{title:"Cost by Connection",empty:Y,children:M}),t[9]=Y,t[10]=M,t[11]=U):U=t[11];const q=E.length===0,ee=E.slice(0,8).map(P=>s.jsx(Je,{label:P.key,value:V(P.cost),subValue:`${P.calls.toLocaleString()} calls`,maxValue:K,color:"bg-chart-4"},P.key));let R;t[12]!==ee?(R=s.jsx("div",{className:"space-y-2.5",children:ee}),t[12]=ee,t[13]=R):R=t[13];let W;t[14]!==R||t[15]!==q?(W=s.jsx(Ze,{title:"Cost by User",empty:q,children:R}),t[14]=R,t[15]=q,t[16]=W):W=t[16];const Q=Ze,se="Top Tools",B=L.length===0,ae="space-y-2.5",re=L.slice(0,8).map(P=>s.jsx(Je,{label:P.name,value:P.calls.toLocaleString(),subValue:P.cost>0?V(P.cost):void 0,maxValue:F,color:"bg-chart-3"},P.name));let te;t[17]!==re?(te=s.jsx("div",{className:ae,children:re}),t[17]=re,t[18]=te):te=t[18];let le;t[19]!==Q||t[20]!==B||t[21]!==te?(le=s.jsx(Q,{title:se,empty:B,children:te}),t[19]=Q,t[20]=B,t[21]=te,t[22]=le):le=t[22];let de;return t[23]!==W||t[24]!==le||t[25]!==U?(de=s.jsxs("div",{className:$,children:[U,W,le]}),t[23]=W,t[24]=le,t[25]=U,t[26]=de):de=t[26],s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex gap-4 text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:["Total:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:V(O)})]}),s.jsxs("span",{className:"text-muted-foreground",children:["Calls:"," ",s.jsx("span",{className:"font-semibold text-foreground",children:D.toLocaleString()})]})]}),T]}),de]})}function Al(t,e){return t+e.calls}function Pl(t,e){return t+e.cost}function Il(t,e){return e.calls-t.calls}function El(t){return[t.key,t.value]}function Ol(t,e){return s.jsx(ne,{className:"h-40 rounded-xl"},e)}function Ll(t){return[t.userId,t.user.name??t.user.email]}function Dl(t,e){const r=new Map;for(const a of t){const l=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(l)??{cost:0,calls:0};r.set(l,{cost:i.cost+a.value,calls:i.calls})}for(const a of e){const l=new Date(a.timestamp).toLocaleDateString("en-US",{month:"short",year:"2-digit"}),i=r.get(l)??{cost:0,calls:0};r.set(l,{cost:i.cost,calls:i.calls+a.value})}return Array.from(r.entries()).map(([a,n])=>({month:a,...n})).reverse()}function Tl(){const t=I.c(27),{org:e}=me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=ut("90d"),t[0]=r):r=t[0];const a=r;let n;t[1]!==e.id?(n={connectionId:dt,orgId:e.id},t[1]=e.id,t[2]=n):n=t[2];const l=_e(n);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"sum",interval:"1d"}},timeRange:a},t[3]=i):i=t[3];let o;t[4]!==l?(o={client:l,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:i,staleTime:6e4,select:Ce},t[4]=l,t[5]=o):o=t[5];const{data:d,isLoading:m}=oe(o);let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c={widget:{type:"timeseries",source:{path:we,from:"output"},aggregation:{fn:"count_all",interval:"1d"}},timeRange:a},t[6]=c):c=t[6];let u;t[7]!==l?(u={client:l,toolName:"MONITORING_WIDGET_PREVIEW",toolArguments:c,staleTime:6e4,select:Ce},t[7]=l,t[8]=u):u=t[8];const{data:f,isLoading:x}=oe(u);if(m||x){let w;return t[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(ne,{className:"h-8 w-48"}),s.jsx(ne,{className:"h-48 rounded-xl"})]}),t[9]=w):w=t[9],w}let h,p,g,y,S;if(t[10]!==f?.timeseries||t[11]!==d?.timeseries){const w=Dl(d?.timeseries??[],f?.timeseries??[]);S="flex flex-col gap-4",t[17]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Usage history from monitoring logs (last 90 days)"}),t[17]=h):h=t[17],p="flex flex-col gap-3 rounded-xl border border-border bg-card p-5",t[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("p",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase",children:"Monthly Usage"}),t[18]=g):g=t[18],y=w.length===0?s.jsx("p",{className:"text-xs text-muted-foreground py-4 text-center",children:"No usage data available for this period"}):s.jsxs("div",{className:"w-full",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 pb-1.5 border-b border-border text-[11px] font-medium text-muted-foreground uppercase tracking-wide",children:[s.jsx("span",{children:"Month"}),s.jsx("span",{className:"text-right",children:"Cost"}),s.jsx("span",{className:"text-right",children:"Calls"})]}),s.jsx("div",{className:"divide-y divide-border",children:w.map(zl)})]}),t[10]=f?.timeseries,t[11]=d?.timeseries,t[12]=h,t[13]=p,t[14]=g,t[15]=y,t[16]=S}else h=t[12],p=t[13],g=t[14],y=t[15],S=t[16];let N;t[19]!==p||t[20]!==g||t[21]!==y?(N=s.jsxs("div",{className:p,children:[g,y]}),t[19]=p,t[20]=g,t[21]=y,t[22]=N):N=t[22];let b;return t[23]!==h||t[24]!==N||t[25]!==S?(b=s.jsxs("div",{className:S,children:[h,N]}),t[23]=h,t[24]=N,t[25]=S,t[26]=b):b=t[26],b}function zl(t){return s.jsxs("div",{className:"grid grid-cols-3 gap-x-4 py-2 text-xs",children:[s.jsx("span",{className:"text-foreground font-medium",children:t.month}),s.jsx("span",{className:"text-right tabular-nums text-foreground",children:V(t.cost)}),s.jsx("span",{className:"text-right tabular-nums text-muted-foreground",children:t.calls.toLocaleString()})]},t.month)}function $l(t){const e=I.c(31),{connectionId:r}=t,{org:a}=me(),[n,l]=v.useState(!1);let i;e[0]!==r||e[1]!==a.id?(i={connectionId:r,orgId:a.id},e[0]=r,e[1]=a.id,e[2]=i):i=e[2];const o=_e(i);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let m;e[4]!==o?(m={client:o,toolName:"GATEWAY_USAGE",toolArguments:d,staleTime:3e4,select:Ml},e[4]=o,e[5]=m):m=e[5];const{data:c,isLoading:u}=oe(m);if(u){let E;return e[6]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(ne,{className:"h-36 rounded-xl"}),e[6]=E):E=e[6],E}if(!c)return null;const f=c.limit.remaining??0,x=c.limit.total??0,h=c.usage,p=c.billing.mode,g=c.billing.limitPeriod??null,y=c.estimation??null;let S;e[7]!==c.alert?(S=c.alert??{enabled:!1,threshold_usd:10,email:null},e[7]=c.alert,e[8]=S):S=e[8];const N=S,b=c.limit,w=p==="postpaid"&&(x==null||x===0);let j;e[9]!==N||e[10]!==f||e[11]!==p||e[12]!==r||e[13]!==y||e[14]!==b||e[15]!==g||e[16]!==x||e[17]!==h?(j=p==="postpaid"?s.jsx(hl,{usage:h,limit:b,limitPeriod:g,onConfigureLimit:()=>l(!0),connectionId:r,alert:N}):s.jsx(gl,{available:f,total:x,estimation:y,onAddCredit:()=>l(!0),connectionId:r,alert:N}),e[9]=N,e[10]=f,e[11]=p,e[12]=r,e[13]=y,e[14]=b,e[15]=g,e[16]=x,e[17]=h,e[18]=j):j=e[18];let C;e[19]!==w?(C=w&&s.jsx(_l,{}),e[19]=w,e[20]=C):C=e[20];let k;e[21]!==p||e[22]!==r||e[23]!==n||e[24]!==g||e[25]!==x?(k=s.jsx(xl,{open:n,onOpenChange:l,connectionId:r,currentLimitUsd:x,billingMode:p,currentLimitPeriod:g}),e[21]=p,e[22]=r,e[23]=n,e[24]=g,e[25]=x,e[26]=k):k=e[26];let _;return e[27]!==j||e[28]!==C||e[29]!==k?(_=s.jsxs(s.Fragment,{children:[j,C,k]}),e[27]=j,e[28]=C,e[29]=k,e[30]=_):_=e[30],_}function Ml(t){return t.structuredContent}function Bl(t){const e=I.c(11),{gatewayConnectionId:r}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),e[0]=a):a=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(Ms,{variant:"underline",children:[s.jsx(Fe,{value:"summary",variant:"underline",children:"Summary"}),s.jsx(Fe,{value:"breakdown",variant:"underline",children:"Breakdown"}),s.jsx(Fe,{value:"history",variant:"underline",children:"History"})]}),e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&s.jsx($l,{connectionId:r}),e[2]=r,e[3]=l):l=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(yl,{}),e[4]=i):i=e[4];let o;e[5]!==l?(o=s.jsxs(Ue,{value:"summary",className:"flex flex-col gap-4 pt-2",children:[l,i]}),e[5]=l,e[6]=o):o=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ue,{value:"breakdown",className:"pt-2",children:s.jsx(kl,{})}),e[7]=d):d=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(Ue,{value:"history",className:"pt-2",children:s.jsx(Tl,{})}),e[8]=m):m=e[8];let c;return e[9]!==o?(c=s.jsxs(s.Fragment,{children:[a,s.jsxs(Bs,{defaultValue:"summary",variant:"underline",children:[n,o,d,m]})]}),e[9]=o,e[10]=c):c=e[10],c}function Gl(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx(ne,{className:"h-5 w-32"}),s.jsx(ne,{className:"h-4 w-64 mt-1.5"})]}),s.jsx(ne,{className:"h-28 rounded-xl"}),s.jsx(ne,{className:"h-[260px] rounded-lg"})]}),t[0]=e):e=t[0],e}function Rl(){const t=I.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Billing"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex items-center justify-center size-10 rounded-full bg-muted",children:s.jsx(lt,{size:20,className:"text-muted-foreground"})}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-6",children:[e,s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 rounded-lg border border-dashed border-border",children:[r,s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-[300px]",children:"Unable to load billing data. Please try again later."})]})]})]}),t[2]=a):a=t[2],a}class Wl extends v.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){}render(){return this.state.hasError?s.jsx(Rl,{}):this.props.children}}function Fl(){const t=I.c(4),e=Va();let r;t[0]!==e?(r=e.find(Ul),t[0]=e,t[1]=r):r=t[1];const n=r?.id??null;let l;return t[2]!==n?(l=s.jsx(Bl,{gatewayConnectionId:n}),t[2]=n,t[3]=l):l=t[3],l}function Ul(t){return Ya(t,Ha)}function Vl(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-col gap-6",children:s.jsx(Wl,{children:s.jsx(v.Suspense,{fallback:s.jsx(Gl,{}),children:s.jsx(Fl,{})})})}),t[0]=e):e=t[0],e}function fs(){const t=I.c(3);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"h-6 w-48"}),r=s.jsx(ne,{className:"h-4 w-80"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[e,r,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(ne,{className:"h-12 w-full"}),s.jsx(ne,{className:"h-12 w-full"})]})]}),t[2]=a):a=t[2],a}function Kl(t){const e=I.c(14),{projectSlug:r,children:a}=t,{org:n}=me(),{data:l,isLoading:i}=Et(n.id,r);if(i||!l){let u;return e[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(fs,{}),e[0]=u):u=e[0],u}const o=r===Ee;let d;e[1]!==l.description||e[2]!==l.enabledPlugins||e[3]!==l.id||e[4]!==l.name||e[5]!==l.organizationId||e[6]!==l.slug||e[7]!==l.ui||e[8]!==o?(d={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:o},e[1]=l.description,e[2]=l.enabledPlugins,e[3]=l.id,e[4]=l.name,e[5]=l.organizationId,e[6]=l.slug,e[7]=l.ui,e[8]=o,e[9]=d):d=e[9];const m=d;let c;return e[10]!==a||e[11]!==m||e[12]!==n?(c=s.jsx(It,{org:n,project:m,children:a}),e[10]=a,e[11]=m,e[12]=n,e[13]=c):c=e[13],c}function Yl(t){const e=I.c(7),{section:r}=t;switch(r){case"account.profile":{let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Qa,{}),e[0]=a):a=e[0],a}case"account.preferences":{let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[1]=a):a=e[1],a}case"account.experimental":{let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(sr,{}),e[2]=a):a=e[2],a}case"org.general":{let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(nr,{}),e[3]=a):a=e[3],a}case"org.plugins":{let a;return e[4]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Kl,{projectSlug:Ee,children:s.jsx(Us,{})}),e[4]=a):a=e[4],a}case"org.billing":{let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Vl,{}),e[5]=a):a=e[5],a}default:{let a;return e[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(yt,{}),e[6]=a):a=e[6],a}}}function Hl(){const t=I.c(23),{isOpen:e,activeSection:r,open:a,close:n}=ws();let l;t[0]!==n?(l=g=>!g&&n(),t[0]=n,t[1]=l):l=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),t[2]=i):i=t[2];let o;t[3]!==r||t[4]!==a?(o=s.jsx(v.Suspense,{fallback:i,children:s.jsx(qa,{activeSection:r,onNavigate:a})}),t[3]=r,t[4]=a,t[5]=o):o=t[5];let d,m;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Dt,{size:16}),m=s.jsx("span",{className:"sr-only",children:"Close"}),t[6]=d,t[7]=m):(d=t[6],m=t[7]);let c;t[8]!==n?(c=s.jsxs("button",{type:"button",onClick:n,className:"sticky top-4 float-right mr-4 mt-4 z-10 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[d,m]}),t[8]=n,t[9]=c):c=t[9];let u;t[10]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(fs,{}),t[10]=u):u=t[10];let f;t[11]!==r?(f=s.jsx("div",{className:"p-8",children:s.jsx(v.Suspense,{fallback:u,children:s.jsx(Yl,{section:r})})}),t[11]=r,t[12]=f):f=t[12];let x;t[13]!==c||t[14]!==f?(x=s.jsxs("div",{className:"flex-1 overflow-y-auto min-w-0 relative",children:[c,f]}),t[13]=c,t[14]=f,t[15]=x):x=t[15];let h;t[16]!==o||t[17]!==x?(h=s.jsx(Ot,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[o,x]})}),t[16]=o,t[17]=x,t[18]=h):h=t[18];let p;return t[19]!==e||t[20]!==l||t[21]!==h?(p=s.jsx(Lt,{open:e,onOpenChange:l,children:h}),t[19]=e,t[20]=l,t[21]=h,t[22]=p):p=t[22],p}function ql(t){const e=I.c(12),{projectSlug:r,orgSlug:a,error:n}=t,l=rt();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),e[0]=i):i=e[0];let o;e[1]!==r?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',r,'".']}),e[1]=r,e[2]=o):o=e[2];let d;e[3]!==n.message?(d=s.jsx("p",{className:"text-sm text-muted-foreground",children:n.message}),e[3]=n.message,e[4]=d):d=e[4];let m;e[5]!==l||e[6]!==a?(m=s.jsx(ce,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[5]=l,e[6]=a,e[7]=m):m=e[7];let c;return e[8]!==o||e[9]!==d||e[10]!==m?(c=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[i,o,d,m]}),e[8]=o,e[9]=d,e[10]=m,e[11]=c):c=e[11],c}function Ql(t){const e=I.c(9),{projectSlug:r,orgSlug:a}=t,n=rt();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),e[0]=l):l=e[0];let i;e[1]!==r?(i=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',r,'" does not exist in this organization.']}),e[1]=r,e[2]=i):i=e[2];let o;e[3]!==n||e[4]!==a?(o=s.jsx(ce,{variant:"link",onClick:()=>n({to:"/$org/$project",params:{org:a,project:Ee}}),children:"Go to organization home"}),e[3]=n,e[4]=a,e[5]=o):o=e[5];let d;return e[6]!==i||e[7]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,i,o]}),e[6]=i,e[7]=o,e[8]=d):d=e[8],d}function Xl(){const t=I.c(23);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const r=vs(e),{org:a}=me(),n=r.org,l=r.project,{data:i,isLoading:o,error:d}=Et(a.id,l);if(o){let p;return t[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(et,{}),t[1]=p):p=t[1],p}if(d){let p;return t[2]!==d||t[3]!==n||t[4]!==l?(p=s.jsx(ql,{projectSlug:l,orgSlug:n,error:d}),t[2]=d,t[3]=n,t[4]=l,t[5]=p):p=t[5],p}if(!i){let p;return t[6]!==n||t[7]!==l?(p=s.jsx(Ql,{projectSlug:l,orgSlug:n}),t[6]=n,t[7]=l,t[8]=p):p=t[8],p}const m=i.slug===Ee;let c;t[9]!==i.description||t[10]!==i.enabledPlugins||t[11]!==i.id||t[12]!==i.name||t[13]!==i.organizationId||t[14]!==i.slug||t[15]!==i.ui||t[16]!==m?(c={id:i.id,organizationId:i.organizationId,slug:i.slug,name:i.name,description:i.description,enabledPlugins:i.enabledPlugins,ui:i.ui,isOrgAdmin:m},t[9]=i.description,t[10]=i.enabledPlugins,t[11]=i.id,t[12]=i.name,t[13]=i.organizationId,t[14]=i.slug,t[15]=i.ui,t[16]=m,t[17]=c):c=t[17];const u=c;let f,x;t[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(v.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(ys,{})}),x=s.jsx(Hl,{}),t[18]=f,t[19]=x):(f=t[18],x=t[19]);let h;return t[20]!==u||t[21]!==a?(h=s.jsxs(It,{org:a,project:u,children:[f,x]}),t[20]=u,t[21]=a,t[22]=h):h=t[22],h}function Kn(){const t=I.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(v.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(Xl,{})}),t[0]=e):e=t[0],e}export{Kn as default};