decocms 2.186.6 → 2.186.8
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.
- package/dist/client/assets/{AlertCircle-CMykqSBg.js → AlertCircle-BD5gSXQu.js} +1 -1
- package/dist/client/assets/{ArrowLeft-uGR-9mNu.js → ArrowLeft-DN3D0Zrv.js} +1 -1
- package/dist/client/assets/{ArrowUp-nzMjud7y.js → ArrowUp-D6ltkV3R.js} +1 -1
- package/dist/client/assets/{Check-xiDQ8BtU.js → Check-Dczm9Dfw.js} +1 -1
- package/dist/client/assets/{ChevronDown-Br-9w7at.js → ChevronDown-CDxBhn_l.js} +1 -1
- package/dist/client/assets/{ChevronRight-9oNUepCi.js → ChevronRight-Dxvchjxo.js} +1 -1
- package/dist/client/assets/{ChevronUp-Cn8mueH6.js → ChevronUp-BLNd6dNq.js} +1 -1
- package/dist/client/assets/{Container-2jV0v6El.js → Container-CMPDG7Cp.js} +1 -1
- package/dist/client/assets/{Dataflow03-DxoSS6Mb.js → Dataflow03-slF1Ax9G.js} +1 -1
- package/dist/client/assets/{FolderClosed-rSkxBpcc.js → FolderClosed-BKB_NgWm.js} +1 -1
- package/dist/client/assets/{Loading01-BcvCGReP.js → Loading01-BVCg1O_G.js} +1 -1
- package/dist/client/assets/{Play-CfPk1Jil.js → Play-Bb4cvvVL.js} +1 -1
- package/dist/client/assets/{Plus-_0WPT4fC.js → Plus-DcVtqCMV.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-7vLfxx-h.js → RefreshCcw01-Co0-i94o.js} +1 -1
- package/dist/client/assets/{SearchMd-Drvt0RJI.js → SearchMd-CVvF1HpM.js} +1 -1
- package/dist/client/assets/{Settings01-BWfYiv65.js → Settings01-DpZ_tsoX.js} +1 -1
- package/dist/client/assets/{Trash01-1xYo27RH.js → Trash01-CBP9WLeP.js} +1 -1
- package/dist/client/assets/{Type01-BYtXAD5n.js → Type01-CySkENi6.js} +1 -1
- package/dist/client/assets/{Upload01-B0BJCQ_e.js → Upload01-BzGPegBj.js} +1 -1
- package/dist/client/assets/{User01-BeQd85RG.js → User01-CItwHvE1.js} +1 -1
- package/dist/client/assets/{X-COxH8ezg.js → X-Dr-hR03I.js} +1 -1
- package/dist/client/assets/{XCircle-DF_H_9sl.js → XCircle-Z-JTmQ8v.js} +1 -1
- package/dist/client/assets/{XClose-DN7ytwf7.js → XClose-BLvk3pvY.js} +1 -1
- package/dist/client/assets/{Zap-EKbyzC1z.js → Zap-CiHJmamA.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-BJR4An4x.js → agent-connections-preview-BQSZMPrI.js} +1 -1
- package/dist/client/assets/{agent-detail-S7Xnyf74.js → agent-detail-eyC4qU2J.js} +1 -1
- package/dist/client/assets/{agents-DGMB2xM-.js → agents-DrhC84qH.js} +1 -1
- package/dist/client/assets/{ai-providers-logos-AsQMrQkI.js → ai-providers-logos-idzpcoUr.js} +1 -1
- package/dist/client/assets/{alert-dialog-CahR3t2-.js → alert-dialog-Bke1xnyn.js} +1 -1
- package/dist/client/assets/{auth-catchall-CuUUPNMf.js → auth-catchall-omtOF0fb.js} +1 -1
- package/dist/client/assets/{automation-detail-D21R_NZo.js → automation-detail-Bc9ASowB.js} +1 -1
- package/dist/client/assets/{automations-BDE5mXwW.js → automations-Bp3tAuBH.js} +1 -1
- package/dist/client/assets/{avatar-CUJtyPo2.js → avatar-BZ4Frci2.js} +1 -1
- package/dist/client/assets/{badge-CED9DV1z.js → badge-DGQ0gFlp.js} +1 -1
- package/dist/client/assets/{breadcrumb-CCQEGtsd.js → breadcrumb-BBMvtdg-.js} +1 -1
- package/dist/client/assets/{card-CPxXaS9B.js → card-CKN-JP9M.js} +1 -1
- package/dist/client/assets/{checkbox-BkHtMStR.js → checkbox-Dzy6oaRF.js} +1 -1
- package/dist/client/assets/{collapsible-B030Rvpo.js → collapsible-D84K6rP8.js} +1 -1
- package/dist/client/assets/{collection-detail-6j0HNb-_.js → collection-detail-w8yO-_Ye.js} +1 -1
- package/dist/client/assets/{collection-display-button--wDfVH13.js → collection-display-button-ZvHBt_eA.js} +1 -1
- package/dist/client/assets/{collection-search-DpxIEj2Y.js → collection-search-fzGK39qM.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-fDncVs5S.js → collection-table-wrapper-DsHGysPH.js} +1 -1
- package/dist/client/assets/{collection-tabs-CqPectm8.js → collection-tabs-vUhndfXI.js} +1 -1
- package/dist/client/assets/{collections-D4sy0Xs0.js → collections-BsFnKFn5.js} +1 -1
- package/dist/client/assets/{command-BeBA7wJA.js → command-BnzawGxz.js} +1 -1
- package/dist/client/assets/{connection-card-Bji8m80q.js → connection-card-D7msIZJv.js} +1 -1
- package/dist/client/assets/{connection-detail-CGya4X8s.js → connection-detail-D84CXhKZ.js} +1 -1
- package/dist/client/assets/{connections-CzVW7p9D.js → connections-CbWHLS_c.js} +1 -1
- package/dist/client/assets/constants-BqeudQjB.js +1 -0
- package/dist/client/assets/{constants-C2mKle9u.js → constants-TLV7MTwP.js} +1 -1
- package/dist/client/assets/{context-BiAMhAiB.js → context-BSzlpoxW.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-MUEiKqL8.js → create-organization-dialog-OZCitfn2.js} +1 -1
- package/dist/client/assets/{create-project-dialog-B8VM2kbV.js → create-project-dialog-RIITFpVV.js} +1 -1
- package/dist/client/assets/{danger-CCuvZ302.js → danger-DuoByYJO.js} +1 -1
- package/dist/client/assets/{danger-zone-R1YnFMha.js → danger-zone-CEP2ON89.js} +1 -1
- package/dist/client/assets/{dependencies-usSRHhHV.js → dependencies-LZwXzbBO.js} +1 -1
- package/dist/client/assets/{dialog-DkflQEEK.js → dialog-DCrLu7TC.js} +1 -1
- package/dist/client/assets/{drawer-CWTdsYcu.js → drawer-CwKj53Jm.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CPUZgeQt.js → dropdown-menu-BK29e1o0.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-COn0BiTQ.js → dynamic-plugin-layout-C5CHlaVD.js} +1 -1
- package/dist/client/assets/{editable-task-title-CXF21pnu.js → editable-task-title-HEFeF21g.js} +1 -1
- package/dist/client/assets/{empty-state-mZytJ7Og.js → empty-state-B8NhLY9v.js} +1 -1
- package/dist/client/assets/{empty-state-DLNIkqnc.js → empty-state-D4ck9NGY.js} +1 -1
- package/dist/client/assets/{env-vars-editor-74-7rifU.js → env-vars-editor-CvqhjBEu.js} +1 -1
- package/dist/client/assets/{extract-connection-data-0iT2_wST.js → extract-connection-data-NSojo21r.js} +1 -1
- package/dist/client/assets/{form-DTthvfe9.js → form-DPsme8JL.js} +1 -1
- package/dist/client/assets/{general-g1xkIict.js → general-CPYyC5Rn.js} +1 -1
- package/dist/client/assets/{home-29e6ki_m.js → home-Cg6y-M7X.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-1gjK7_AP.js → import-from-deco-dialog-CBUqBAZP.js} +1 -1
- package/dist/client/assets/{index--5l6Kd5l.js → index-2hR_U2H-.js} +1 -1
- package/dist/client/assets/{index-DcP_WR0J.js → index-3WTtRDrt.js} +1 -1
- package/dist/client/assets/{index-DIiriVeM.js → index-BZyxukAe.js} +1 -1
- package/dist/client/assets/{index-Cb6NnGWb.js → index-Bgix03M4.js} +1 -1
- package/dist/client/assets/{index-DTnP3oIT.js → index-BkAoKVx8.js} +1 -1
- package/dist/client/assets/{index-CuI-2Tt-.js → index-CoIN7QlF.js} +1 -1
- package/dist/client/assets/{index-B_aEJlRD.js → index-CtkIjbbq.js} +1 -1
- package/dist/client/assets/{index-DIir8pgm.js → index-D49VqQ7Q.js} +2 -2
- package/dist/client/assets/{index-DoQQIBf1.js → index-D_CXrtwd.js} +1 -1
- package/dist/client/assets/{index-ZixwJ1Pk.js → index-Dg9iIj2F.js} +1 -1
- package/dist/client/assets/{index-Dz9R7lP6.js → index-DxaXuxCe.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D_1D5AYq.js → infiniteQueryObserver-DiY9IZXI.js} +1 -1
- package/dist/client/assets/{input-BVAvDQ_C.js → input-BoNWsfmK.js} +1 -1
- package/dist/client/assets/{integration-icon-B_0G_X87.js → integration-icon-ByIZ-Vgj.js} +1 -1
- package/dist/client/assets/{label-C6omQTs_.js → label-DF2jcg2U.js} +1 -1
- package/dist/client/assets/{layout-AYXb28rc.js → layout-CgN1mZAZ.js} +1 -1
- package/dist/client/assets/{layout-D4tWA0bw.js → layout-Dp8uiQPy.js} +1 -1
- package/dist/client/assets/{login-Cx7hoJoT.js → login-EJWlcxg3.js} +1 -1
- package/dist/client/assets/{logo-upload-FTAEWKjw.js → logo-upload-D5UEFEut.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DDZtzzcL.js → mcp-app-renderer-C8wEMNqP.js} +1 -1
- package/dist/client/assets/{mcp-server-card-C8wXu9yO.js → mcp-server-card-xRGKpDYM.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-BVknczom.js → mcp-server-detail-Dfcu5k0K.js} +2 -2
- package/dist/client/assets/{members-CczX95O-.js → members-b1hYnwix.js} +1 -1
- package/dist/client/assets/{monaco-editor-BF2WLfQD.js → monaco-editor-D1C0-UAW.js} +1 -1
- package/dist/client/assets/{monitoring-9XsThidn.js → monitoring-DmCgdBgZ.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-6dYajQ_1.js → monitoring-dashboard-edit-DL4fVGYY.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-C154UPGx.js → monitoring-dashboard-view-BfDYcRJx.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C6qBbHow.js → monitoring-stats-row-Bzy3PCZQ.js} +1 -1
- package/dist/client/assets/{oauth-callback-3Syoq1nk.js → oauth-callback-N1SniIFs.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-udnTMnIE.js → oauth-callback-ai-provider-BZ8yDxr9.js} +1 -1
- package/dist/client/assets/{org-ai-providers-BZX8CBbC.js → org-ai-providers-DFHn6TCP.js} +1 -1
- package/dist/client/assets/{page-B8I6CLK9.js → page-B721jXQm.js} +1 -1
- package/dist/client/assets/{page-DG6axqmW.js → page-BgKYb-6_.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Bt8UXvj0.js → plugin-empty-state-BIg-myPi.js} +1 -1
- package/dist/client/assets/{plugin-header-DT9lR12I.js → plugin-header-CBfXQAQ5.js} +1 -1
- package/dist/client/assets/plugins-D7XVdEz7.js +1 -0
- package/dist/client/assets/{popover-BMBGvHQ_.js → popover-CvIauBBG.js} +1 -1
- package/dist/client/assets/{project-app-view-fuhRg8H7.js → project-app-view-Wq81-D6Q.js} +1 -1
- package/dist/client/assets/{project-layout-DWnRAr4s.js → project-layout-ByRNQhjx.js} +1 -1
- package/dist/client/assets/{project-plugins-CRqpdPvu.js → project-plugins-8LQo3YBE.js} +1 -1
- package/dist/client/assets/{projects-list-Dl8bD1xL.js → projects-list-CfdMQhGh.js} +1 -1
- package/dist/client/assets/{registry-layout-CdBoBkB6.js → registry-layout-BfWTztsz.js} +1 -1
- package/dist/client/assets/{registry-utils-pfpET92F.js → registry-utils-Cz03qmOa.js} +1 -1
- package/dist/client/assets/{reset-password-BL4AtRcT.js → reset-password-Cj1A6uL-.js} +1 -1
- package/dist/client/assets/{resizable-CcW4J8VD.js → resizable-BceA9DHD.js} +1 -1
- package/dist/client/assets/{save-actions-3dOJ5Mjm.js → save-actions-BENpgKCD.js} +1 -1
- package/dist/client/assets/{scroll-area-Bqfa6wPc.js → scroll-area-4KH7xRn7.js} +1 -1
- package/dist/client/assets/{select-CBE7xbF4.js → select-DaOZXaTi.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-Bco91LS8.js → select-virtual-mcp-CjfXEnho.js} +1 -1
- package/dist/client/assets/{shell-layout-BVpZ2wZ-.js → shell-layout-85fLFVwf.js} +2 -2
- package/dist/client/assets/{sidebar-settings-BpXHJmnQ.js → sidebar-settings-CvK0z-ir.js} +1 -1
- package/dist/client/assets/{skeleton-CQd2QEI9.js → skeleton-CLUePAN0.js} +1 -1
- package/dist/client/assets/{spinner-DCPsu4ZG.js → spinner-7bhznOFa.js} +1 -1
- package/dist/client/assets/{store-invite-D4qgWC83.js → store-invite-fWGyKl7o.js} +1 -1
- package/dist/client/assets/{switch-CDhXZx5x.js → switch-yIP7Yj81.js} +1 -1
- package/dist/client/assets/{table-CGhKFeKb.js → table-w828HACk.js} +1 -1
- package/dist/client/assets/{tabs-BMh4okm_.js → tabs-Du7uGFqP.js} +1 -1
- package/dist/client/assets/{task-status-2ts0kYwT.js → task-status-RaaIa42V.js} +1 -1
- package/dist/client/assets/{tasks-panel-0RmxrVW1.js → tasks-panel-CT_8gQvL.js} +1 -1
- package/dist/client/assets/tasks-x-XNinod.js +1 -0
- package/dist/client/assets/{textarea-CdQzy4Ij.js → textarea-D30IrLHN.js} +1 -1
- package/dist/client/assets/{time-range-picker-obtb96_y.js → time-range-picker-DVyznax9.js} +1 -1
- package/dist/client/assets/{toggle-group-BvQ8i1-N.js → toggle-group-DN_3BuPh.js} +1 -1
- package/dist/client/assets/{tools-list-SV45eRcg.js → tools-list-BQiqsKN2.js} +1 -1
- package/dist/client/assets/{tooltip-iG9fvlrZ.js → tooltip-DJkxXViN.js} +1 -1
- package/dist/client/assets/{types-BJ15oicG.js → types-llndI7Ky.js} +1 -1
- package/dist/client/assets/{use-automations-DDYigIn8.js → use-automations-DhJnP2CA.js} +1 -1
- package/dist/client/assets/{use-collections-CeVeE6L5.js → use-collections-Dmxer7H8.js} +1 -1
- package/dist/client/assets/{use-connection-B3ekSVUc.js → use-connection-Yjy9d1tW.js} +1 -1
- package/dist/client/assets/{use-copy-DFqHt08d.js → use-copy-DYNuGKRz.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-J-6A5Uhg.js → use-create-virtual-mcp-CEBO__7d.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DbO9lGzn.js → use-infinite-scroll-JQzncaIM.js} +1 -1
- package/dist/client/assets/{use-install-from-registry-BKwLRanW.js → use-install-from-registry-Du1Xu864.js} +1 -1
- package/dist/client/assets/{use-list-state-BSx7RPGJ.js → use-list-state-BG8gUSh9.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-ClavsAnj.js → use-mcp-prompts-DY_yf0WC.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-BuE1rP0c.js → use-mcp-resources-BnmpykKD.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-JDKA9UZ8.js → use-mcp-tools-CmOfbC2t.js} +1 -1
- package/dist/client/assets/{use-members-DNGgajFa.js → use-members-BZM-R1qG.js} +1 -1
- package/dist/client/assets/{use-project-DvVOFuu-.js → use-project-W-5l7vWa.js} +1 -1
- package/dist/client/assets/{use-store-discovery-dPavPbA-.js → use-store-discovery-DfcEdPeQ.js} +1 -1
- package/dist/client/assets/{use-view-mode-BijqAGDe.js → use-view-mode-BGEJ9JzM.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DXFVfjMZ.js → use-virtual-mcp-2qhGJdPe.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D8TjRj27.js +1 -0
- package/dist/client/assets/{useMutation-DPjXSTSD.js → useMutation-BTUmJffP.js} +1 -1
- package/dist/client/assets/useQuery-CvkH2gG1.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DRfcYfXZ.js +1 -0
- package/dist/client/assets/{user-BAgoGcDp.js → user-DXILGeu2.js} +1 -1
- package/dist/client/assets/{workflow-DCKJ21al.js → workflow-CBGVBFDu.js} +1 -1
- package/dist/client/assets/{workflow-CrjjFLE3.js → workflow-ClE3y6g8.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +341 -340
- package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
- package/dist/server/node_modules/ansi-styles/index.js +223 -0
- package/dist/server/node_modules/ansi-styles/package.json +54 -0
- package/dist/server/node_modules/ansi-styles/readme.md +173 -0
- package/dist/server/node_modules/mimic-fn/index.d.ts +54 -0
- package/dist/server/node_modules/mimic-fn/index.js +13 -0
- package/dist/server/node_modules/mimic-fn/license +9 -0
- package/dist/server/node_modules/{onetime → mimic-fn}/package.json +15 -16
- package/dist/server/node_modules/mimic-fn/readme.md +69 -0
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-array/index.d.ts +4 -0
- package/dist/server/node_modules/postgres-array/index.js +97 -0
- package/dist/server/node_modules/{pg/LICENSE → postgres-array/license} +6 -6
- package/dist/server/node_modules/postgres-array/package.json +35 -0
- package/dist/server/node_modules/postgres-array/readme.md +43 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/postgres-bytea/license +21 -0
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-date/index.js +116 -0
- package/dist/server/node_modules/postgres-date/license +21 -0
- package/dist/server/node_modules/postgres-date/package.json +33 -0
- package/dist/server/node_modules/postgres-date/readme.md +49 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/split2/LICENSE +13 -0
- package/dist/server/node_modules/split2/README.md +85 -0
- package/dist/server/node_modules/split2/bench.js +27 -0
- package/dist/server/node_modules/split2/index.js +141 -0
- package/dist/server/node_modules/split2/package.json +39 -0
- package/dist/server/node_modules/split2/test.js +409 -0
- package/dist/server/server.js +269 -269
- package/package.json +1 -1
- package/dist/client/assets/constants-CUwoz2Qc.js +0 -1
- package/dist/client/assets/plugins-S0nxg7Xk.js +0 -1
- package/dist/client/assets/tasks-DR3nWr8j.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DfmHdhse.js +0 -1
- package/dist/client/assets/useQuery-BJg_09kQ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-xbYvMmn4.js +0 -1
- package/dist/server/node_modules/onetime/index.d.ts +0 -64
- package/dist/server/node_modules/onetime/index.js +0 -44
- package/dist/server/node_modules/onetime/readme.md +0 -94
- package/dist/server/node_modules/pg/README.md +0 -95
- package/dist/server/node_modules/pg/esm/index.mjs +0 -20
- package/dist/server/node_modules/pg/lib/client.js +0 -743
- package/dist/server/node_modules/pg/lib/connection-parameters.js +0 -171
- package/dist/server/node_modules/pg/lib/connection.js +0 -221
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +0 -122
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +0 -212
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +0 -43
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +0 -89
- package/dist/server/node_modules/pg/lib/crypto/utils.js +0 -9
- package/dist/server/node_modules/pg/lib/defaults.js +0 -91
- package/dist/server/node_modules/pg/lib/index.js +0 -73
- package/dist/server/node_modules/pg/lib/native/client.js +0 -323
- package/dist/server/node_modules/pg/lib/native/index.js +0 -2
- package/dist/server/node_modules/pg/lib/native/query.js +0 -165
- package/dist/server/node_modules/pg/lib/query.js +0 -252
- package/dist/server/node_modules/pg/lib/result.js +0 -109
- package/dist/server/node_modules/pg/lib/stream.js +0 -83
- package/dist/server/node_modules/pg/lib/type-overrides.js +0 -35
- package/dist/server/node_modules/pg/lib/utils.js +0 -217
- package/dist/server/node_modules/pg/package.json +0 -76
- /package/dist/server/node_modules/{onetime → ansi-styles}/license +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bm as ce,o as qs,q as Ot,d as N,j as o,E as Dn,r as _,c as Z,v as Ks,y as R,X as Js,e as Gs,H as at,O as dt,B as Y,w as zn,bO as X,cR as Xs,b6 as Qs,$ as Xt,a2 as pe,a4 as Wn,b7 as Ys,Z as Qt,b5 as Zs,b8 as Fn,a0 as Hn,be as eo,bf as to,a5 as Vn,bg as no,cS as Yt,cT as so,aa as oo,bh as ro,Y as io,x as lo,k as Ne,cU as co,cV as ao,cW as Un}from"./index-DIir8pgm.js";import{E as Bn}from"./empty-state-mZytJ7Og.js";import{d as Zt,u as en}from"./use-collections-CeVeE6L5.js";import{u as ae,g as Ye,i as uo}from"./constants-C2mKle9u.js";import{F as Rt,a as fo,b as tn,d as nn}from"./form-DTthvfe9.js";import{I as sn}from"./input-BVAvDQ_C.js";import{T as Ft}from"./textarea-CdQzy4Ij.js";import{a as qn,b as Kn,V as we}from"./layout-D4tWA0bw.js";import{S as Jn}from"./save-actions-3dOJ5Mjm.js";import{M as mo}from"./mcp-app-renderer-DDZtzzcL.js";import{g as po,M as Nn}from"./types-BJ15oicG.js";import{S as Ht,a as Vt,b as Ut,c as Bt,d as Ge}from"./select-CBE7xbF4.js";import{c as on,T as ut,a as ft,b as mt}from"./tooltip-iG9fvlrZ.js";import{i as xo}from"./AlertCircle-CMykqSBg.js";import{I as Qe,a3 as ho,a4 as go,a5 as bo,f as jo,a6 as vo,a7 as So,a8 as yo,a9 as wo,Q as No,aa as Gn,E as Co,ab as ko,ac as Io,T as At}from"./integration-icon-B_0G_X87.js";import{s as _o,i as Cn,b as To}from"./Type01-BYtXAD5n.js";import{i as rn,c as $o}from"./Play-CfPk1Jil.js";import{i as jt}from"./Loading01-BcvCGReP.js";import{B as Xn,a as Qn,b as He,d as pt,e as xt,c as Yn}from"./breadcrumb-CCQEGtsd.js";import{u as Eo,O as Oo,M as Ro,F as Ao,v as Mo}from"./index-DcP_WR0J.js";import{g as Ze}from"./connection-slug-Bw8dtz1U.js";import{u as ln,b as et}from"./use-connection-B3ekSVUc.js";import{d as cn,b as an,a as dn}from"./use-mcp-tools-JDKA9UZ8.js";import{c as Po}from"./content-blocks-o63cs2vh.js";import{T as Lo}from"./tools-list-SV45eRcg.js";import{u as Do,c as zo}from"./context-BiAMhAiB.js";import{a as Wo}from"./index-B_aEJlRD.js";import{M as Ve}from"./monaco-editor-BF2WLfQD.js";import{E as un}from"./empty-state-DLNIkqnc.js";import{n as Fo}from"./Container-2jV0v6El.js";import{D as Ho}from"./workflow-DCKJ21al.js";import{b as Zn}from"./use-virtual-mcp-DXFVfjMZ.js";import{b as Vo,R as kn,a as Uo}from"./resizable-CcW4J8VD.js";import{B as ve}from"./badge-CED9DV1z.js";import{S as vt}from"./spinner-DCPsu4ZG.js";import{V as Bo}from"./collection-display-button--wDfVH13.js";import{d as qo}from"./registry-utils-pfpET92F.js";import{b as Ko,c as Jo,e as Go,d as Xo,D as Qo,a as Yo}from"./dialog-DkflQEEK.js";import"./index-Dz9R7lP6.js";import{N as Zo,S as er,a as tr,c as nr,m as lt,P as sr,i as or,R as rr,u as ir,b as lr,d as In,E as cr}from"./index-Cb6NnGWb.js";import{s as es}from"./Plus-_0WPT4fC.js";import{i as St}from"./Check-xiDQ8BtU.js";import{s as fn}from"./XClose-DN7ytwf7.js";import{D as ar,a as dr,b as ur,c as _n}from"./dropdown-menu-CPUZgeQt.js";import{T as fr,R as mr,b as pr,c as ts}from"./index-ZixwJ1Pk.js";import{i as xr}from"./ChevronRight-9oNUepCi.js";import{a as hr,S as gr}from"./scroll-area-Bqfa6wPc.js";import"./index--5l6Kd5l.js";import{i as ns}from"./X-COxH8ezg.js";import"./useMutation-DPjXSTSD.js";import"./label-C6omQTs_.js";import"./XCircle-DF_H_9sl.js";import"./use-mcp-resources-BuE1rP0c.js";import"./useQuery-BJg_09kQ.js";import"./index-BdQq_4o_.js";import"./index-DTnP3oIT.js";import"./ChevronDown-Br-9w7at.js";import"./ChevronUp-Cn8mueH6.js";import"./ArrowUp-nzMjud7y.js";import"./ArrowLeft-uGR-9mNu.js";import"./RefreshCcw01-7vLfxx-h.js";import"./Dataflow03-DxoSS6Mb.js";import"./FolderClosed-rSkxBpcc.js";import"./SearchMd-Drvt0RJI.js";import"./Settings01-BWfYiv65.js";import"./Trash01-1xYo27RH.js";import"./Upload01-B0BJCQ_e.js";import"./User01-BeQd85RG.js";import"./Zap-EKbyzC1z.js";import"./constants-CUwoz2Qc.js";import"./collections-D4sy0Xs0.js";import"./extract-connection-data-0iT2_wST.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BKwLRanW.js";import"./index-DoQQIBf1.js";import"./index-DIiriVeM.js";import"./select-virtual-mcp-Bco91LS8.js";import"./popover-BMBGvHQ_.js";import"./use-create-virtual-mcp-J-6A5Uhg.js";import"./slugify-CEUa2lfQ.js";import"./collection-search-DpxIEj2Y.js";import"./collection-table-wrapper-fDncVs5S.js";import"./table-CGhKFeKb.js";import"./card-CPxXaS9B.js";import"./decopilot-events-Brt4gAR6.js";const ss=ce("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const os=ce("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const mn=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pn=ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const br=ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const jr=ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const vr=ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const rs=ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const is=ce("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const ls=ce("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Sr=ce("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const cs=ce("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const as=ce("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);qs({title:Ot().min(1),description:Ot().nullable(),body:Ot()});function Mt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function yr(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function wr(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(Rt,{control:n.control,name:"title",render:kr}),o.jsx(Rt,{control:n.control,name:"description",render:Cr})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(Rt,{control:n.control,name:"body",render:Nr})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(fo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function Nr(t){const{field:e}=t;return o.jsx(tn,{children:o.jsx(nn,{children:o.jsx(Ft,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Cr(t){const{field:e}=t;return o.jsxs(tn,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(nn,{children:o.jsx(sn,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function kr(t){const{field:e}=t;return o.jsxs(tn,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(nn,{children:o.jsx(sn,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Ir(t){const e=N.c(35),{providerId:n,promptId:s}=t,{org:i}=Z(),r=n||null;let l;e[0]!==i.id||e[1]!==r?(l={connectionId:r,orgId:i.id},e[0]=i.id,e[1]=r,e[2]=l):l=e[2];const c=ae(l),a=Zt(n,"PROMPT",s,c),d=en(n,"PROMPT",c),u=d.update.isPending;let f;e[3]!==a?(f=a?{title:a.title,description:a.description??null,body:Mt(a)}:void 0,e[3]=a,e[4]=f):f=e[4];let m;e[5]!==f?(m={values:f},e[5]=f,e[6]=m):m=e[6];const x=Ks(m);let p;e[7]!==x||e[8]!==a?(p=()=>{a&&x.reset({title:a.title,description:a.description??null,body:Mt(a)})},e[7]=x,e[8]=a,e[9]=p):p=e[9];const h=p;let g;e[10]!==d.update||e[11]!==x||e[12]!==s?(g=x.handleSubmit(async I=>{const E=await d.update.mutateAsync({id:s,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});x.reset({title:E.title,description:E.description??null,body:Mt(E)})}),e[10]=d.update,e[11]=x,e[12]=s,e[13]=g):g=e[13];const b=g;if(!a){let I;return e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=I):I=e[14],I}let j;e[15]!==a.title?(j=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=j):j=e[16];let S;e[17]!==a.description?(S=a.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[17]=a.description,e[18]=S):S=e[18];let y;e[19]!==j||e[20]!==S?(y=o.jsx(Kn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j,S]})}),e[19]=j,e[20]=S,e[21]=y):y=e[21];let v;e[22]!==b?(v=()=>{b()},e[22]=b,e[23]=v):v=e[23];let w;e[24]!==x.formState.isDirty||e[25]!==u||e[26]!==h||e[27]!==v?(w=o.jsx(qn,{children:o.jsx(Jn,{onSave:v,onUndo:h,isDirty:x.formState.isDirty,isSaving:u})}),e[24]=x.formState.isDirty,e[25]=u,e[26]=h,e[27]=v,e[28]=w):w=e[28];let C;e[29]!==x?(C=o.jsx("div",{className:"h-full",children:o.jsx(wr,{form:x})}),e[29]=x,e[30]=C):C=e[30];let k;return e[31]!==w||e[32]!==C||e[33]!==y?(k=o.jsxs(we,{children:[y,w,C]}),e[31]=w,e[32]=C,e[33]=y,e[34]=k):k=e[34],k}function _r(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=yr(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx(Dn,{children:o.jsx(_.Suspense,{fallback:null,children:o.jsx(Ir,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const Tr=Js("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function $r(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=R(Tr({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Er(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=R("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Or(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=R("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const Rr=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ar(t){const e=N.c(11),{toolName:n,connectionId:s,siblings:i,onSelectInstance:r,onBack:l}=t;let c;e[0]!==s?(c={connectionId:s},e[0]=s,e[1]=c):c=e[1];const a=Eo(c);if(!a.isAuthenticated){let f;return e[2]!==a.supportsOAuth||e[3]!==l?(f=o.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?o.jsx(Oo,{onAuthenticate:()=>l(),buttonText:"Go back to authenticate"}):o.jsx(Ro,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=l,e[4]=f):f=e[4],f}const d=`${s}:${n}`;let u;return e[5]!==s||e[6]!==r||e[7]!==i||e[8]!==d||e[9]!==n?(u=o.jsx(Mr,{toolName:n,connectionId:s,siblings:i,onSelectInstance:r},d),e[5]=s,e[6]=r,e[7]=i,e[8]=d,e[9]=n,e[10]=u):u=e[10],u}function Mr({toolName:t,connectionId:e,siblings:n,onSelectInstance:s}){const{replayId:i}=Gs({strict:!1}),r=(()=>{if(!i)return null;const $=`replay-${i}`,P=sessionStorage.getItem($);if(!P)return null;sessionStorage.removeItem($);try{return JSON.parse(P)}catch{return null}})(),l=(()=>{if(!r)return null;const $={};for(const[P,H]of Object.entries(r))H!==null&&typeof H=="object"?$[P]=JSON.stringify(H,null,2):$[P]=H;return $})(),[c,a]=_.useState(l??{}),[d,u]=_.useState(r?JSON.stringify(r,null,2):"{}"),[f,m]=_.useState(null),[x,p]=_.useState(null),[h,g]=_.useState(null),[b,j]=_.useState(null),[S,y]=_.useState(!1),[v,w]=_.useState(null),{org:C}=Z(),k=ln(e),{sendMessage:I,setAppContext:E,clearAppContext:M}=Do(),[,z]=Wo(),T=`${e}:${t}`,A=ae({connectionId:e,orgId:C.id}),W=cn({client:A}),O=W.data?.tools?.find($=>$.name===t),V=po(O?._meta),L=$=>{const P=Po($.content);P.content.length>0&&(z(!0),I(P))},[F,Q]=_.useState("json"),[fe,ee]=_.useState(!1);V&&!fe&&(Q("ui"),ee(!0));const U=O?.inputSchema?.properties,J=U?Object.keys(U):[],B=J.length>0,G={};if(B&&O?.inputSchema?.properties)for(const $ of J)G[$]=O.inputSchema.required?.includes($)?"":void 0;const te=$=>Object.prototype.hasOwnProperty.call(c,$),de=async()=>{y(!0),j(null),m(null),p(null),g(null),w(null);const $=performance.now();try{if(!A)throw new Error("MCP client is not available");const P=B?{...G,...c}:(()=>{const je=d.trim();if(!je)return{};const le=JSON.parse(je);if(le&&typeof le=="object")return le;throw new Error("Raw JSON input must be an object.")})();B&&O?.inputSchema?.properties&&Object.entries(O.inputSchema.properties).forEach(([je,le])=>{if((le.type==="object"||le.type==="array")&&typeof P[je]=="string")try{P[je]=JSON.parse(P[je])}catch{}});const H=await A.callTool({name:t,arguments:P}),ge=H.structuredContent??H,qe=performance.now(),Ke=Math.round(qe-$);m(ge),p(H),g(P);const be=JSON.stringify(ge),rt=new TextEncoder().encode(be).length;w({duration:`${Ke}ms`,bytes:`${rt} bytes`,tokens:`~${Math.ceil(rt/4)} tokens`,cost:"$0.0000"})}catch(P){const H=P instanceof Error?P.message:String(P);j(H||"Unknown error occurred");const ge=performance.now();w({duration:`${Math.round(ge-$)}ms`})}finally{y(!1)}},ne=($,P)=>{a(H=>({...H,[$]:P}))},oe=()=>{m(null),p(null),g(null),j(null),w(null)},ue=O?.name??Rr(t),re=o.jsx(Xn,{children:o.jsxs(Qn,{children:[o.jsx(He,{children:o.jsx(pt,{asChild:!0,children:o.jsx(at,{to:"/$org/$project/mcps",params:{org:C.slug,project:dt},children:"Connections"})})}),o.jsx(xt,{}),k&&o.jsxs(o.Fragment,{children:[o.jsx(He,{children:o.jsx(pt,{asChild:!0,children:o.jsx(at,{to:"/$org/$project/mcps/$appSlug",params:{org:C.slug,project:dt,appSlug:Ze(k)},search:{tab:"tools"},children:k.title})})}),o.jsx(xt,{})]}),o.jsx(He,{children:o.jsx(Yn,{children:ue})})]})}),ie=n.length>1&&o.jsxs(Ht,{value:e,onValueChange:s,children:[o.jsx(Vt,{className:"h-8 w-auto min-w-[200px]",children:o.jsx(Ut,{})}),o.jsx(Bt,{children:n.map($=>o.jsx(Ge,{value:$.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qe,{icon:$.icon,name:$.title,size:"xs",className:"shrink-0"}),$.title]})},$.id))})]}),q=o.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),O?.inputSchema?.required&&O.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:B&&O?.inputSchema?.properties?Object.entries(O.inputSchema.properties).map(([$,P])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[$,O.inputSchema?.required?.includes($)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:P.type})]}),P.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:P.description}),P.type==="object"||P.type==="array"?o.jsx(Ft,{className:"font-mono text-xs",value:te($)?c[$]??"":G[$]??"",onChange:H=>ne($,H.target.value),placeholder:`Enter ${$} as JSON...`,rows:3}):P.type==="boolean"?o.jsxs(Ht,{value:te($)?String(c[$]??""):"",onValueChange:H=>ne($,H==="true"),children:[o.jsx(Vt,{children:o.jsx(Ut,{placeholder:"Select true or false..."})}),o.jsxs(Bt,{children:[o.jsx(Ge,{value:"true",children:"true"}),o.jsx(Ge,{value:"false",children:"false"})]})]}):o.jsx(sn,{value:te($)?c[$]??"":G[$]??"",onChange:H=>ne($,H.target.value),placeholder:`Enter ${$}...`})]},$)):O?.inputSchema&&!B?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Ft,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:$=>u($.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),o.jsx("div",{className:"flex items-center gap-2 pt-2",children:S?o.jsxs(Y,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:oe,children:[o.jsx(ho,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(Y,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:de,children:[o.jsx(rn,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Se=o.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsxs("div",{className:"flex items-center gap-3",children:[v&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(_o,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(go,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(bo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]}),V&&o.jsx(on,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(ut,{children:[o.jsx(ft,{asChild:!0,children:o.jsx(Y,{size:"icon",variant:F==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Q("ui"),children:o.jsx(jo,{size:14})})}),o.jsx(mt,{children:"Interactive view"})]}),o.jsxs(ut,{children:[o.jsx(ft,{asChild:!0,children:o.jsx(Y,{size:"icon",variant:F==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Q("json"),children:o.jsx(Cn,{size:14})})}),o.jsx(mt,{children:"JSON view"})]})]})})]})]}),b&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx($r,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(xo,{className:"h-4 w-4"}),o.jsx(Er,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Or,{className:"text-xs text-destructive",children:b})]})})}),o.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:V&&F==="ui"&&A?o.jsx(_.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(mo,{resourceURI:V,toolInfo:O?{tool:O}:void 0,toolInput:h??void 0,toolResult:x??void 0,displayMode:"fullscreen",minHeight:Nn.view.minHeight,maxHeight:Nn.view.maxHeight,client:A,onMessage:L,onUpdateModelContext:$=>E(T,$),onTeardown:()=>M(T),className:"h-full"})}):f?o.jsxs(o.Fragment,{children:[o.jsx(Ve,{code:JSON.stringify(f,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(Y,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(f,null,2)),zn.success("Copied to clipboard")},children:o.jsx($o,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(Cn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return o.jsx(we,{breadcrumb:re,children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[o.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Qe,{icon:k?.icon||null,name:k?.title||t,size:"xl",className:"shrink-0"}),o.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[W.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):W.isLoading?o.jsx(jt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:W.isSuccess?"ready":W.isLoading?"connecting":"error"})]}),o.jsx(Lo,{annotations:O?.annotations,_meta:O?._meta}),o.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:ie})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:O?.description||"No description available"})]}),n.length>1&&o.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),ie]}),o.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:o.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[o.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:q}),Se]})})]})})}function Pr(t){const e=N.c(10),{itemId:n,siblings:s,onBack:i}=t,[r,l]=_.useState(s[0]?.id??"");let c;e[0]!==r||e[1]!==s?(c=s.find(m=>m.id===r)?.id??s[0]?.id??"",e[0]=r,e[1]=s,e[2]=c):c=e[2];const a=c;if(!ln(a||void 0)||!a){let m;return e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=m):m=e[3],m}let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(jt,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=u):u=e[4];let f;return e[5]!==a||e[6]!==i||e[7]!==s||e[8]!==n?(f=o.jsx(_.Suspense,{fallback:u,children:o.jsx(Ar,{toolName:n,connectionId:a,siblings:s,onSelectInstance:l,onBack:i})}),e[5]=a,e[6]=i,e[7]=s,e[8]=n,e[9]=f):f=e[9],f}const Tn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},xn=(t=>t?Tn(t):Tn),Lr=t=>t;function qt(t,e=Lr){const n=X.useSyncExternalStore(t.subscribe,X.useCallback(()=>e(t.getState()),[t,e]),X.useCallback(()=>e(t.getInitialState()),[t,e]));return X.useDebugValue(n),n}const Dr=t=>{const e=xn(t),n=s=>qt(e,s);return Object.assign(n,e),n},zr=(t=>Dr);function ds(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Kt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Kt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Kt(s)(n)}}}},Wr=(t,e)=>(n,s,i)=>{let r={storage:ds(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:x)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Kt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),p||x},us=Wr,{useSyncExternalStoreWithSelector:Fr}=Xs,Hr=t=>t;function Vr(t,e=Hr,n){const s=Fr(t.subscribe,t.getState,t.getInitialState,e,n);return X.useDebugValue(s),s}const $n=t=>Symbol.iterator in t,En=t=>"entries"in t,On=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Ur=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Br(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:$n(t)&&$n(e)?En(t)&&En(e)?On(t,e):Ur(t,e):On({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function qr(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{bm as ce,o as qs,q as Ot,d as N,j as o,E as Dn,r as _,c as Z,v as Ks,y as R,X as Js,e as Gs,H as at,O as dt,B as Y,w as zn,bO as X,cR as Xs,b6 as Qs,$ as Xt,a2 as pe,a4 as Wn,b7 as Ys,Z as Qt,b5 as Zs,b8 as Fn,a0 as Hn,be as eo,bf as to,a5 as Vn,bg as no,cS as Yt,cT as so,aa as oo,bh as ro,Y as io,x as lo,k as Ne,cU as co,cV as ao,cW as Un}from"./index-D49VqQ7Q.js";import{E as Bn}from"./empty-state-B8NhLY9v.js";import{d as Zt,u as en}from"./use-collections-Dmxer7H8.js";import{u as ae,g as Ye,i as uo}from"./constants-TLV7MTwP.js";import{F as Rt,a as fo,b as tn,d as nn}from"./form-DPsme8JL.js";import{I as sn}from"./input-BoNWsfmK.js";import{T as Ft}from"./textarea-D30IrLHN.js";import{a as qn,b as Kn,V as we}from"./layout-Dp8uiQPy.js";import{S as Jn}from"./save-actions-BENpgKCD.js";import{M as mo}from"./mcp-app-renderer-C8wEMNqP.js";import{g as po,M as Nn}from"./types-llndI7Ky.js";import{S as Ht,a as Vt,b as Ut,c as Bt,d as Ge}from"./select-DaOZXaTi.js";import{c as on,T as ut,a as ft,b as mt}from"./tooltip-DJkxXViN.js";import{i as xo}from"./AlertCircle-BD5gSXQu.js";import{I as Qe,a3 as ho,a4 as go,a5 as bo,f as jo,a6 as vo,a7 as So,a8 as yo,a9 as wo,Q as No,aa as Gn,E as Co,ab as ko,ac as Io,T as At}from"./integration-icon-ByIZ-Vgj.js";import{s as _o,i as Cn,b as To}from"./Type01-CySkENi6.js";import{i as rn,c as $o}from"./Play-Bb4cvvVL.js";import{i as jt}from"./Loading01-BVCg1O_G.js";import{B as Xn,a as Qn,b as He,d as pt,e as xt,c as Yn}from"./breadcrumb-BBMvtdg-.js";import{u as Eo,O as Oo,M as Ro,F as Ao,v as Mo}from"./index-3WTtRDrt.js";import{g as Ze}from"./connection-slug-Bw8dtz1U.js";import{u as ln,b as et}from"./use-connection-Yjy9d1tW.js";import{d as cn,b as an,a as dn}from"./use-mcp-tools-CmOfbC2t.js";import{c as Po}from"./content-blocks-o63cs2vh.js";import{T as Lo}from"./tools-list-BQiqsKN2.js";import{u as Do,c as zo}from"./context-BSzlpoxW.js";import{a as Wo}from"./index-CtkIjbbq.js";import{M as Ve}from"./monaco-editor-D1C0-UAW.js";import{E as un}from"./empty-state-D4ck9NGY.js";import{n as Fo}from"./Container-CMPDG7Cp.js";import{D as Ho}from"./workflow-CBGVBFDu.js";import{b as Zn}from"./use-virtual-mcp-2qhGJdPe.js";import{b as Vo,R as kn,a as Uo}from"./resizable-BceA9DHD.js";import{B as ve}from"./badge-DGQ0gFlp.js";import{S as vt}from"./spinner-7bhznOFa.js";import{V as Bo}from"./collection-display-button-ZvHBt_eA.js";import{d as qo}from"./registry-utils-Cz03qmOa.js";import{b as Ko,c as Jo,e as Go,d as Xo,D as Qo,a as Yo}from"./dialog-DCrLu7TC.js";import"./index-DxaXuxCe.js";import{N as Zo,S as er,a as tr,c as nr,m as lt,P as sr,i as or,R as rr,u as ir,b as lr,d as In,E as cr}from"./index-Bgix03M4.js";import{s as es}from"./Plus-DcVtqCMV.js";import{i as St}from"./Check-Dczm9Dfw.js";import{s as fn}from"./XClose-BLvk3pvY.js";import{D as ar,a as dr,b as ur,c as _n}from"./dropdown-menu-BK29e1o0.js";import{T as fr,R as mr,b as pr,c as ts}from"./index-Dg9iIj2F.js";import{i as xr}from"./ChevronRight-Dxvchjxo.js";import{a as hr,S as gr}from"./scroll-area-4KH7xRn7.js";import"./index-2hR_U2H-.js";import{i as ns}from"./X-Dr-hR03I.js";import"./useMutation-BTUmJffP.js";import"./label-DF2jcg2U.js";import"./XCircle-Z-JTmQ8v.js";import"./use-mcp-resources-BnmpykKD.js";import"./useQuery-CvkH2gG1.js";import"./index-BdQq_4o_.js";import"./index-BkAoKVx8.js";import"./ChevronDown-CDxBhn_l.js";import"./ChevronUp-BLNd6dNq.js";import"./ArrowUp-D6ltkV3R.js";import"./ArrowLeft-DN3D0Zrv.js";import"./RefreshCcw01-Co0-i94o.js";import"./Dataflow03-slF1Ax9G.js";import"./FolderClosed-BKB_NgWm.js";import"./SearchMd-CVvF1HpM.js";import"./Settings01-DpZ_tsoX.js";import"./Trash01-CBP9WLeP.js";import"./Upload01-BzGPegBj.js";import"./User01-CItwHvE1.js";import"./Zap-CiHJmamA.js";import"./constants-BqeudQjB.js";import"./collections-BsFnKFn5.js";import"./extract-connection-data-NSojo21r.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-Du1Xu864.js";import"./index-D_CXrtwd.js";import"./index-BZyxukAe.js";import"./select-virtual-mcp-CjfXEnho.js";import"./popover-CvIauBBG.js";import"./use-create-virtual-mcp-CEBO__7d.js";import"./slugify-CEUa2lfQ.js";import"./collection-search-fzGK39qM.js";import"./collection-table-wrapper-DsHGysPH.js";import"./table-w828HACk.js";import"./card-CKN-JP9M.js";import"./decopilot-events-Brt4gAR6.js";const ss=ce("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const os=ce("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const mn=ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pn=ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const br=ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const jr=ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const vr=ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const rs=ce("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const is=ce("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const ls=ce("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Sr=ce("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const cs=ce("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const as=ce("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);qs({title:Ot().min(1),description:Ot().nullable(),body:Ot()});function Mt(t){for(const e of t.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function yr(){const t=window.location.pathname.split("/").filter(Boolean),e=t.findIndex(s=>s==="mcps"),n=e>=0?t[e+1]:void 0;return n?decodeURIComponent(n):void 0}function wr(t){const e=N.c(13),{form:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=s):s=e[0];let i;e[1]!==n.control?(i=o.jsxs("div",{className:"flex flex-col gap-4",children:[s,o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[o.jsx(Rt,{control:n.control,name:"title",render:kr}),o.jsx(Rt,{control:n.control,name:"description",render:Cr})]})]}),e[1]=n.control,e[2]=i):i=e[2];let r,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),l=o.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=l):(r=e[3],l=e[4]);let c;e[5]!==n.control?(c=o.jsxs("div",{className:"flex flex-col gap-2",children:[r,l,o.jsx(Rt,{control:n.control,name:"body",render:Nr})]}),e[5]=n.control,e[6]=c):c=e[6];let a;e[7]!==i||e[8]!==c?(a=o.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[i,c]}),e[7]=i,e[8]=c,e[9]=a):a=e[9];let d;return e[10]!==n||e[11]!==a?(d=o.jsx(fo,{...n,children:a}),e[10]=n,e[11]=a,e[12]=d):d=e[12],d}function Nr(t){const{field:e}=t;return o.jsx(tn,{children:o.jsx(nn,{children:o.jsx(Ft,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Cr(t){const{field:e}=t;return o.jsxs(tn,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),o.jsx(nn,{children:o.jsx(sn,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function kr(t){const{field:e}=t;return o.jsxs(tn,{children:[o.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),o.jsx(nn,{children:o.jsx(sn,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Ir(t){const e=N.c(35),{providerId:n,promptId:s}=t,{org:i}=Z(),r=n||null;let l;e[0]!==i.id||e[1]!==r?(l={connectionId:r,orgId:i.id},e[0]=i.id,e[1]=r,e[2]=l):l=e[2];const c=ae(l),a=Zt(n,"PROMPT",s,c),d=en(n,"PROMPT",c),u=d.update.isPending;let f;e[3]!==a?(f=a?{title:a.title,description:a.description??null,body:Mt(a)}:void 0,e[3]=a,e[4]=f):f=e[4];let m;e[5]!==f?(m={values:f},e[5]=f,e[6]=m):m=e[6];const x=Ks(m);let p;e[7]!==x||e[8]!==a?(p=()=>{a&&x.reset({title:a.title,description:a.description??null,body:Mt(a)})},e[7]=x,e[8]=a,e[9]=p):p=e[9];const h=p;let g;e[10]!==d.update||e[11]!==x||e[12]!==s?(g=x.handleSubmit(async I=>{const E=await d.update.mutateAsync({id:s,data:{title:I.title,description:I.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:I.body}}]}});x.reset({title:E.title,description:E.description??null,body:Mt(E)})}),e[10]=d.update,e[11]=x,e[12]=s,e[13]=g):g=e[13];const b=g;if(!a){let I;return e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bn,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[14]=I):I=e[14],I}let j;e[15]!==a.title?(j=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title}),e[15]=a.title,e[16]=j):j=e[16];let S;e[17]!==a.description?(S=a.description?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:a.description})]}):null,e[17]=a.description,e[18]=S):S=e[18];let y;e[19]!==j||e[20]!==S?(y=o.jsx(Kn,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[j,S]})}),e[19]=j,e[20]=S,e[21]=y):y=e[21];let v;e[22]!==b?(v=()=>{b()},e[22]=b,e[23]=v):v=e[23];let w;e[24]!==x.formState.isDirty||e[25]!==u||e[26]!==h||e[27]!==v?(w=o.jsx(qn,{children:o.jsx(Jn,{onSave:v,onUndo:h,isDirty:x.formState.isDirty,isSaving:u})}),e[24]=x.formState.isDirty,e[25]=u,e[26]=h,e[27]=v,e[28]=w):w=e[28];let C;e[29]!==x?(C=o.jsx("div",{className:"h-full",children:o.jsx(wr,{form:x})}),e[29]=x,e[30]=C):C=e[30];let k;return e[31]!==w||e[32]!==C||e[33]!==y?(k=o.jsxs(we,{children:[y,w,C]}),e[31]=w,e[32]=C,e[33]=y,e[34]=k):k=e[34],k}function _r(t){const e=N.c(4),{itemId:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=yr(),e[0]=s):s=e[0];const i=s;if(!i){let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(Bn,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=l):l=e[1],l}let r;return e[2]!==n?(r=o.jsx(Dn,{children:o.jsx(_.Suspense,{fallback:null,children:o.jsx(Ir,{providerId:i,promptId:n})})}),e[2]=n,e[3]=r):r=e[3],r}const Tr=Js("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function $r(t){const e=N.c(10);let n,s,i;e[0]!==t?({className:n,variant:i,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i):(n=e[1],s=e[2],i=e[3]);let r;e[4]!==n||e[5]!==i?(r=R(Tr({variant:i}),n),e[4]=n,e[5]=i,e[6]=r):r=e[6];let l;return e[7]!==s||e[8]!==r?(l=o.jsx("div",{"data-slot":"alert",role:"alert",className:r,...s}),e[7]=s,e[8]=r,e[9]=l):l=e[9],l}function Er(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=R("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-title",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}function Or(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let i;e[3]!==n?(i=R("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=i):i=e[4];let r;return e[5]!==s||e[6]!==i?(r=o.jsx("div",{"data-slot":"alert-description",className:i,...s}),e[5]=s,e[6]=i,e[7]=r):r=e[7],r}const Rr=t=>t.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ar(t){const e=N.c(11),{toolName:n,connectionId:s,siblings:i,onSelectInstance:r,onBack:l}=t;let c;e[0]!==s?(c={connectionId:s},e[0]=s,e[1]=c):c=e[1];const a=Eo(c);if(!a.isAuthenticated){let f;return e[2]!==a.supportsOAuth||e[3]!==l?(f=o.jsx("div",{className:"flex h-full items-center justify-center",children:a.supportsOAuth?o.jsx(Oo,{onAuthenticate:()=>l(),buttonText:"Go back to authenticate"}):o.jsx(Ro,{hasReadme:!1})}),e[2]=a.supportsOAuth,e[3]=l,e[4]=f):f=e[4],f}const d=`${s}:${n}`;let u;return e[5]!==s||e[6]!==r||e[7]!==i||e[8]!==d||e[9]!==n?(u=o.jsx(Mr,{toolName:n,connectionId:s,siblings:i,onSelectInstance:r},d),e[5]=s,e[6]=r,e[7]=i,e[8]=d,e[9]=n,e[10]=u):u=e[10],u}function Mr({toolName:t,connectionId:e,siblings:n,onSelectInstance:s}){const{replayId:i}=Gs({strict:!1}),r=(()=>{if(!i)return null;const $=`replay-${i}`,P=sessionStorage.getItem($);if(!P)return null;sessionStorage.removeItem($);try{return JSON.parse(P)}catch{return null}})(),l=(()=>{if(!r)return null;const $={};for(const[P,H]of Object.entries(r))H!==null&&typeof H=="object"?$[P]=JSON.stringify(H,null,2):$[P]=H;return $})(),[c,a]=_.useState(l??{}),[d,u]=_.useState(r?JSON.stringify(r,null,2):"{}"),[f,m]=_.useState(null),[x,p]=_.useState(null),[h,g]=_.useState(null),[b,j]=_.useState(null),[S,y]=_.useState(!1),[v,w]=_.useState(null),{org:C}=Z(),k=ln(e),{sendMessage:I,setAppContext:E,clearAppContext:M}=Do(),[,z]=Wo(),T=`${e}:${t}`,A=ae({connectionId:e,orgId:C.id}),W=cn({client:A}),O=W.data?.tools?.find($=>$.name===t),V=po(O?._meta),L=$=>{const P=Po($.content);P.content.length>0&&(z(!0),I(P))},[F,Q]=_.useState("json"),[fe,ee]=_.useState(!1);V&&!fe&&(Q("ui"),ee(!0));const U=O?.inputSchema?.properties,J=U?Object.keys(U):[],B=J.length>0,G={};if(B&&O?.inputSchema?.properties)for(const $ of J)G[$]=O.inputSchema.required?.includes($)?"":void 0;const te=$=>Object.prototype.hasOwnProperty.call(c,$),de=async()=>{y(!0),j(null),m(null),p(null),g(null),w(null);const $=performance.now();try{if(!A)throw new Error("MCP client is not available");const P=B?{...G,...c}:(()=>{const je=d.trim();if(!je)return{};const le=JSON.parse(je);if(le&&typeof le=="object")return le;throw new Error("Raw JSON input must be an object.")})();B&&O?.inputSchema?.properties&&Object.entries(O.inputSchema.properties).forEach(([je,le])=>{if((le.type==="object"||le.type==="array")&&typeof P[je]=="string")try{P[je]=JSON.parse(P[je])}catch{}});const H=await A.callTool({name:t,arguments:P}),ge=H.structuredContent??H,qe=performance.now(),Ke=Math.round(qe-$);m(ge),p(H),g(P);const be=JSON.stringify(ge),rt=new TextEncoder().encode(be).length;w({duration:`${Ke}ms`,bytes:`${rt} bytes`,tokens:`~${Math.ceil(rt/4)} tokens`,cost:"$0.0000"})}catch(P){const H=P instanceof Error?P.message:String(P);j(H||"Unknown error occurred");const ge=performance.now();w({duration:`${Math.round(ge-$)}ms`})}finally{y(!1)}},ne=($,P)=>{a(H=>({...H,[$]:P}))},oe=()=>{m(null),p(null),g(null),j(null),w(null)},ue=O?.name??Rr(t),re=o.jsx(Xn,{children:o.jsxs(Qn,{children:[o.jsx(He,{children:o.jsx(pt,{asChild:!0,children:o.jsx(at,{to:"/$org/$project/mcps",params:{org:C.slug,project:dt},children:"Connections"})})}),o.jsx(xt,{}),k&&o.jsxs(o.Fragment,{children:[o.jsx(He,{children:o.jsx(pt,{asChild:!0,children:o.jsx(at,{to:"/$org/$project/mcps/$appSlug",params:{org:C.slug,project:dt,appSlug:Ze(k)},search:{tab:"tools"},children:k.title})})}),o.jsx(xt,{})]}),o.jsx(He,{children:o.jsx(Yn,{children:ue})})]})}),ie=n.length>1&&o.jsxs(Ht,{value:e,onValueChange:s,children:[o.jsx(Vt,{className:"h-8 w-auto min-w-[200px]",children:o.jsx(Ut,{})}),o.jsx(Bt,{children:n.map($=>o.jsx(Ge,{value:$.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Qe,{icon:$.icon,name:$.title,size:"xs",className:"shrink-0"}),$.title]})},$.id))})]}),q=o.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),O?.inputSchema?.required&&O.inputSchema.required.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),o.jsx("div",{className:"space-y-4",children:B&&O?.inputSchema?.properties?Object.entries(O.inputSchema.properties).map(([$,P])=>o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[$,O.inputSchema?.required?.includes($)&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),o.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:P.type})]}),P.description&&o.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:P.description}),P.type==="object"||P.type==="array"?o.jsx(Ft,{className:"font-mono text-xs",value:te($)?c[$]??"":G[$]??"",onChange:H=>ne($,H.target.value),placeholder:`Enter ${$} as JSON...`,rows:3}):P.type==="boolean"?o.jsxs(Ht,{value:te($)?String(c[$]??""):"",onValueChange:H=>ne($,H==="true"),children:[o.jsx(Vt,{children:o.jsx(Ut,{placeholder:"Select true or false..."})}),o.jsxs(Bt,{children:[o.jsx(Ge,{value:"true",children:"true"}),o.jsx(Ge,{value:"false",children:"false"})]})]}):o.jsx(sn,{value:te($)?c[$]??"":G[$]??"",onChange:H=>ne($,H.target.value),placeholder:`Enter ${$}...`})]},$)):O?.inputSchema&&!B?o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),o.jsx(Ft,{className:"font-mono text-xs min-h-[120px]",value:d,onChange:$=>u($.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):o.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:o.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),o.jsx("div",{className:"flex items-center gap-2 pt-2",children:S?o.jsxs(Y,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:oe,children:[o.jsx(ho,{className:"h-3.5 w-3.5"}),"Cancel"]}):o.jsxs(Y,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:de,children:[o.jsx(rn,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Se=o.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[o.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),o.jsxs("div",{className:"flex items-center gap-3",children:[v&&o.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(_o,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.duration})]}),v.tokens&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(go,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.tokens})]}),v.bytes&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(bo,{className:"h-3 w-3 text-muted-foreground"}),o.jsx("span",{className:"font-mono text-foreground",children:v.bytes})]}),v.cost&&o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx("span",{className:"font-mono text-foreground",children:v.cost})})]}),V&&o.jsx(on,{children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(ut,{children:[o.jsx(ft,{asChild:!0,children:o.jsx(Y,{size:"icon",variant:F==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Q("ui"),children:o.jsx(jo,{size:14})})}),o.jsx(mt,{children:"Interactive view"})]}),o.jsxs(ut,{children:[o.jsx(ft,{asChild:!0,children:o.jsx(Y,{size:"icon",variant:F==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Q("json"),children:o.jsx(Cn,{size:14})})}),o.jsx(mt,{children:"JSON view"})]})]})})]})]}),b&&o.jsx("div",{className:"px-6 py-4 bg-background",children:o.jsx($r,{variant:"destructive",children:o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(xo,{className:"h-4 w-4"}),o.jsx(Er,{className:"mb-0",children:"Execution Failed"})]}),o.jsx(Or,{className:"text-xs text-destructive",children:b})]})})}),o.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:V&&F==="ui"&&A?o.jsx(_.Suspense,{fallback:o.jsx("div",{className:"flex items-center justify-center h-48",children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),o.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:o.jsx(mo,{resourceURI:V,toolInfo:O?{tool:O}:void 0,toolInput:h??void 0,toolResult:x??void 0,displayMode:"fullscreen",minHeight:Nn.view.minHeight,maxHeight:Nn.view.maxHeight,client:A,onMessage:L,onUpdateModelContext:$=>E(T,$),onTeardown:()=>M(T),className:"h-full"})}):f?o.jsxs(o.Fragment,{children:[o.jsx(Ve,{code:JSON.stringify(f,null,2),language:"json",height:"100%",readOnly:!0}),o.jsx(Y,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(f,null,2)),zn.success("Copied to clipboard")},children:o.jsx($o,{className:"h-3.5 w-3.5"})})]}):o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[o.jsx(Cn,{className:"h-12 w-12 mb-3 opacity-40"}),o.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return o.jsx(we,{breadcrumb:re,children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[o.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Qe,{icon:k?.icon||null,name:k?.title||t,size:"xl",className:"shrink-0"}),o.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:t}),o.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[W.isSuccess?o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):W.isLoading?o.jsx(jt,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):o.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),o.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:W.isSuccess?"ready":W.isLoading?"connecting":"error"})]}),o.jsx(Lo,{annotations:O?.annotations,_meta:O?._meta}),o.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:ie})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:O?.description||"No description available"})]}),n.length>1&&o.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[o.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),ie]}),o.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:o.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[o.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:q}),Se]})})]})})}function Pr(t){const e=N.c(10),{itemId:n,siblings:s,onBack:i}=t,[r,l]=_.useState(s[0]?.id??"");let c;e[0]!==r||e[1]!==s?(c=s.find(m=>m.id===r)?.id??s[0]?.id??"",e[0]=r,e[1]=s,e[2]=c):c=e[2];const a=c;if(!ln(a||void 0)||!a){let m;return e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=m):m=e[3],m}let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(jt,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=u):u=e[4];let f;return e[5]!==a||e[6]!==i||e[7]!==s||e[8]!==n?(f=o.jsx(_.Suspense,{fallback:u,children:o.jsx(Ar,{toolName:n,connectionId:a,siblings:s,onSelectInstance:l,onBack:i})}),e[5]=a,e[6]=i,e[7]=s,e[8]=n,e[9]=f):f=e[9],f}const Tn=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},xn=(t=>t?Tn(t):Tn),Lr=t=>t;function qt(t,e=Lr){const n=X.useSyncExternalStore(t.subscribe,X.useCallback(()=>e(t.getState()),[t,e]),X.useCallback(()=>e(t.getInitialState()),[t,e]));return X.useDebugValue(n),n}const Dr=t=>{const e=xn(t),n=s=>qt(e,s);return Object.assign(n,e),n},zr=(t=>Dr);function ds(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Kt=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Kt(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Kt(s)(n)}}}},Wr=(t,e)=>(n,s,i)=>{let r={storage:ds(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const j=++c;l=!1,a.forEach(y=>{var v;return y((v=s())!=null?v:x)});const S=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Kt(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const v=r.migrate(y.state,y.version);return v instanceof Promise?v.then(w=>[!0,w]):[!0,v]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var v;if(j!==c)return;const[w,C]=y;if(p=r.merge(C,(v=s())!=null?v:x),n(p,!0),w)return f()}).then(()=>{j===c&&(S?.(p,void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{j===c&&S?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),p||x},us=Wr,{useSyncExternalStoreWithSelector:Fr}=Xs,Hr=t=>t;function Vr(t,e=Hr,n){const s=Fr(t.subscribe,t.getState,t.getInitialState,e,n);return X.useDebugValue(s),s}const $n=t=>Symbol.iterator in t,En=t=>"entries"in t,On=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Ur=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Br(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:$n(t)&&$n(e)?En(t)&&En(e)?On(t,e):Ur(t,e):On({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function qr(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
|
|
3
3
|
`:""} ${d}${f}: ${n(u)};`}).join(`
|
|
4
4
|
`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as U,r as F,y as b,j as s,B as te}from"./index-
|
|
1
|
+
import{d as U,r as F,y as b,j as s,B as te}from"./index-D49VqQ7Q.js";import{c as X,a as se,b as le,D as oe}from"./dropdown-menu-BK29e1o0.js";import{i as ie,n as ne}from"./ArrowUp-D6ltkV3R.js";import{i as Y}from"./Check-Dczm9Dfw.js";import{c as re}from"./Type01-CySkENi6.js";import{k as ae,l as ce}from"./integration-icon-ByIZ-Vgj.js";import{a as de,b as ue,c as fe,T as xe}from"./tooltip-DJkxXViN.js";import{B as me}from"./badge-DGQ0gFlp.js";const pe={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function he(r){const e=U.c(66),{value:l,onValueChange:a,options:t,size:w,fullWidth:z,className:j}=r,S=w===void 0?"sm":w,x=z===void 0?!1:z,C=F.useRef(null),k=F.useRef(null);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={left:0,width:0,opacity:0},e[0]=c):c=e[0];const[m,_]=F.useState(c);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=A=>{if(!A.current)return;const{offsetLeft:Z,offsetWidth:ee}=A.current;_({left:Z,width:ee,opacity:1})},e[1]=g):g=e[1];const N=g;let d;e[2]!==t[0].value||e[3]!==l?(d=()=>{const A=l===t[0].value?C:k;N(A)},e[2]=t[0].value,e[3]=l,e[4]=d):d=e[4];let v;e[5]!==t||e[6]!==l?(v=[l,t],e[5]=t,e[6]=l,e[7]=v):v=e[7],F.useEffect(d,v);const o=pe[S];let i;e[8]!==j?(i=b("relative flex gap-0 bg-muted rounded-lg",j),e[8]=j,e[9]=i):i=e[9];let n;e[10]!==a||e[11]!==t[0].value?(n=()=>a(t[0].value),e[10]=a,e[11]=t[0].value,e[12]=n):n=e[12];const p=x?"flex-1 h-12 px-4":o.button,h=!x&&t[0].label?"px-3":"";let u;e[13]!==h||e[14]!==p?(u=b("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",p,h),e[13]=h,e[14]=p,e[15]=u):u=e[15];const y=l===t[0].value?"text-foreground":"text-muted-foreground";let f;e[16]!==o.icon||e[17]!==y?(f=b("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",o.icon,y),e[16]=o.icon,e[17]=y,e[18]=f):f=e[18];let D;e[19]!==t[0].icon||e[20]!==f?(D=s.jsx("span",{className:f,children:t[0].icon}),e[19]=t[0].icon,e[20]=f,e[21]=D):D=e[21];let T;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==l?(T=t[0].label&&s.jsx("span",{className:b("text-xs transition-colors ease-out duration-200 whitespace-nowrap",l===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=l,e[25]=T):T=e[25];let M;e[26]!==u||e[27]!==D||e[28]!==T||e[29]!==n?(M=s.jsxs("button",{ref:C,type:"button",onClick:n,className:u,children:[D,T]}),e[26]=u,e[27]=D,e[28]=T,e[29]=n,e[30]=M):M=e[30];let $;e[31]!==a||e[32]!==t[1].value?($=()=>a(t[1].value),e[31]=a,e[32]=t[1].value,e[33]=$):$=e[33];const K=x?"flex-1 h-12 px-4":o.button,q=!x&&t[1].label?"px-3":"";let R;e[34]!==K||e[35]!==q?(R=b("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",K,q),e[34]=K,e[35]=q,e[36]=R):R=e[36];const G=l===t[1].value?"text-foreground":"text-muted-foreground";let B;e[37]!==o.icon||e[38]!==G?(B=b("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",o.icon,G),e[37]=o.icon,e[38]=G,e[39]=B):B=e[39];let V;e[40]!==t[1].icon||e[41]!==B?(V=s.jsx("span",{className:B,children:t[1].icon}),e[40]=t[1].icon,e[41]=B,e[42]=V):V=e[42];let E;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==l?(E=t[1].label&&s.jsx("span",{className:b("text-xs transition-colors ease-out duration-200 whitespace-nowrap",l===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=l,e[46]=E):E=e[46];let W;e[47]!==$||e[48]!==R||e[49]!==V||e[50]!==E?(W=s.jsxs("button",{ref:k,type:"button",onClick:$,className:R,children:[V,E]}),e[47]=$,e[48]=R,e[49]=V,e[50]=E,e[51]=W):W=e[51];const H=x?"h-12":o.button;let I;e[52]!==H?(I=b("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",H),e[52]=H,e[53]=I):I=e[53];const J=`${m.left}px`,Q=`${m.width}px`;let L;e[54]!==m.opacity||e[55]!==J||e[56]!==Q?(L={left:J,width:Q,opacity:m.opacity},e[54]=m.opacity,e[55]=J,e[56]=Q,e[57]=L):L=e[57];let P;e[58]!==I||e[59]!==L?(P=s.jsx("div",{className:I,style:L}),e[58]=I,e[59]=L,e[60]=P):P=e[60];let O;return e[61]!==M||e[62]!==W||e[63]!==P||e[64]!==i?(O=s.jsxs("div",{className:i,children:[M,W,P]}),e[61]=M,e[62]=W,e[63]=P,e[64]=i,e[65]=O):O=e[65],O}function Se(r){const e=U.c(31),{viewMode:l,onViewModeChange:a,sortKey:t,sortDirection:w,onSort:z,sortOptions:j,filters:S}=r;let x;e[0]!==j?(x=j===void 0?[]:j,e[0]=j,e[1]=x):x=e[1];const C=x;let k;e[2]!==S?(k=S===void 0?[]:S,e[2]=S,e[3]=k):k=e[3];const c=k;let m;e[4]!==c?(m=c.filter(ge),e[4]=c,e[5]=m):m=e[5];const _=m.length;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ae,{size:16}),e[6]=g):g=e[6];let N;e[7]!==_?(N=_>0&&s.jsx(me,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:_}),e[7]=_,e[8]=N):N=e[8];let d;e[9]!==N?(d=s.jsx(de,{asChild:!0,children:s.jsx(se,{asChild:!0,children:s.jsxs(te,{variant:"outline",size:"icon",className:"size-7 border border-input relative",children:[g,N]})})}),e[9]=N,e[10]=d):d=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(ue,{children:"Display & filters"}),e[11]=v):v=e[11];let o;e[12]!==d?(o=s.jsx(fe,{children:s.jsxs(xe,{children:[d,v]})}),e[12]=d,e[13]=o):o=e[13];let i;e[14]!==a||e[15]!==l?(i=a&&l&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(he,{value:l,onValueChange:a,fullWidth:!0,options:[{value:"table",icon:s.jsx(ce,{})},{value:"cards",icon:s.jsx(re,{})}]})}),e[14]=a,e[15]=l,e[16]=i):i=e[16];let n;e[17]!==z||e[18]!==w||e[19]!==t||e[20]!==C?(n=C.length>0&&z&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),C.map(y=>{const f=t===y.id;return s.jsx(X,{onClick:()=>z(y.id),className:b("h-8 px-2 py-0 cursor-pointer",f&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[f&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!f&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),f&&w&&(w==="asc"?s.jsx(ie,{size:16,className:"text-foreground shrink-0"}):s.jsx(ne,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=z,e[18]=w,e[19]=t,e[20]=C,e[21]=n):n=e[21];let p;e[22]!==c?(p=c.map(be),e[22]=c,e[23]=p):p=e[23];let h;e[24]!==i||e[25]!==n||e[26]!==p?(h=s.jsxs(le,{align:"end",className:"w-[200px] p-0 gap-0",children:[i,n,p]}),e[24]=i,e[25]=n,e[26]=p,e[27]=h):h=e[27];let u;return e[28]!==o||e[29]!==h?(u=s.jsxs(oe,{children:[o,h]}),e[28]=o,e[29]=h,e[30]=u):u=e[30],u}function be(r){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:r.label}),r.options.map(e=>{const l=r.value===e.id;return s.jsx(X,{onClick:()=>r.onChange(e.id),className:b("h-8 px-2 py-0 cursor-pointer",l&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[l&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!l&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},r.label)}function ge(r){return r.value!=="ALL"}export{Se as C,he as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as v,y as b,j as i}from"./index-
|
|
1
|
+
import{d as v,y as b,j as i}from"./index-D49VqQ7Q.js";import{i as w}from"./Loading01-BVCg1O_G.js";import{i as C}from"./SearchMd-CVvF1HpM.js";import{I as k}from"./input-BoNWsfmK.js";function I(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let l;e[6]!==d?(l=N=>d(N.target.value),e[6]=d,e[7]=l):l=e[7];let o;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==l||e[12]!==m?(o=i.jsx(k,{value:m,onChange:l,onKeyDown:f,placeholder:x,disabled:n,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[8]=n,e[9]=f,e[10]=x,e[11]=l,e[12]=m,e[13]=o):o=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==o?(a=i.jsxs("label",{className:s,children:[r,o]}),e[14]=s,e[15]=r,e[16]=o,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{I as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as k,j as s,y}from"./index-
|
|
1
|
+
import{d as k,j as s,y}from"./index-D49VqQ7Q.js";import{c as S,a as R,b as T,e as H,d as L,T as z}from"./table-w828HACk.js";import{i as D,n as E}from"./ArrowUp-D6ltkV3R.js";function I(C){const e=k.c(29),{columns:r,data:f,sortKey:u,sortDirection:x,onSort:i,onRowClick:n,rowClassName:c}=C;let p;e[0]!==x?(p=function(t,h){return s.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?s.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):s.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let l;if(e[3]!==r||e[4]!==i||e[5]!==b||e[6]!==u){let o;e[8]!==r.length||e[9]!==i||e[10]!==b||e[11]!==u?(o=(t,h)=>{const N=u===t.id;return s.jsx(S,{className:y(a(h,r.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:s.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=r.length,e[9]=i,e[10]=b,e[11]=u,e[12]=o):o=e[12],l=r.map(o),e[3]=r,e[4]=i,e[5]=b,e[6]=u,e[7]=l}else l=e[7];let g;e[13]!==l?(g=s.jsx(R,{className:"border-b-0",children:s.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:l})}),e[13]=l,e[14]=g):g=e[14];let j;if(e[15]!==r||e[16]!==f||e[17]!==n||e[18]!==c){let o;e[20]!==r||e[21]!==n||e[22]!==c?(o=(t,h)=>{const N=c?.(t);return s.jsx(T,{"data-row-index":h,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:r.map(m=>s.jsx(H,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:s.jsx("div",{className:y(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=r,e[21]=n,e[22]=c,e[23]=o):o=e[23],j=f.map(o),e[15]=r,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=s.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=s.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function B(C){const e=k.c(12),{columns:r,data:f,isLoading:u,sortKey:x,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=C;if(u===void 0?!1:u){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let l;return e[3]!==a?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=l):l=e[4],l}let d;return e[5]!==r||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==x?(d=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(I,{columns:r,data:f,sortKey:x,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=r,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=x,e[11]=d):d=e[11],d}export{B as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f,y as u,j as m}from"./index-
|
|
1
|
+
import{d as f,y as u,j as m}from"./index-D49VqQ7Q.js";import{B as g}from"./badge-DGQ0gFlp.js";function h(x){const e=f.c(12),{tabs:c,activeTab:n,onTabChange:s,className:d}=x;let t;e[0]!==d?(t=u("flex items-center gap-2 overflow-x-auto no-scrollbar",d),e[0]=d,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==c){let l;e[6]!==n||e[7]!==s?(l=o=>{const a=n===o.id;return m.jsxs("button",{type:"button",onClick:()=>s(o.id),className:u("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",a&&"bg-accent border-border text-foreground",!a&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&m.jsx(g,{variant:"secondary",className:u("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",a?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=l):l=e[8],r=c.map(l),e[2]=n,e[3]=s,e[4]=c,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=m.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{h as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as t,aK as c,aL as a,q as i,aM as p,aN as r,aO as m,aP as h,aQ as b}from"./index-
|
|
1
|
+
import{o as t,aK as c,aL as a,q as i,aM as p,aN as r,aO as m,aP as h,aQ as b}from"./index-D49VqQ7Q.js";const N=t({id:i().describe("Unique identifier for the entity"),title:i().describe("Human-readable title for the entity"),description:i().nullish().describe("Description of the entity"),created_at:i().datetime(),updated_at:i().datetime(),created_by:i().optional(),updated_by:i().optional()}),f=t({field:a(i()),operator:r(["eq","gt","gte","lt","lte","in","like","contains"]),value:b()}),u=m(()=>h([f,t({operator:r(["and","or","not"]),conditions:a(u)})])),C=t({field:a(i()),direction:r(["asc","desc"]),nulls:r(["first","last"]).optional()}),S=t({where:u.optional().describe("Filter expression"),orderBy:a(C).optional().describe("Sort expressions"),limit:c().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:c().int().min(0).optional().describe("Number of items to skip")});function O(e){return t({items:a(e).describe("Array of collection items"),totalCount:c().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:p().optional().describe("Whether there are more items available")})}const y=t({id:i().describe("ID of the entity to retrieve")});function E(e){return t({item:e.nullable().describe("The retrieved item, or null if not found")})}function I(e){return t({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function L(e){return t({item:e.describe("The created entity with generated id")})}function T(e){return t({id:i().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function _(e){return t({item:e.describe("The updated entity")})}const D=t({id:i().describe("ID of the entity to delete")});function g(e){return t({item:e.describe("The deleted entity")})}function v(e,n,l){const o=e.toUpperCase(),d=l?.readOnly??!1,s=[{name:`COLLECTION_${o}_LIST`,inputSchema:S,outputSchema:O(n)},{name:`COLLECTION_${o}_GET`,inputSchema:y,outputSchema:E(n)}];return d||s.push({name:`COLLECTION_${o}_CREATE`,inputSchema:I(n),outputSchema:L(n),opt:!0},{name:`COLLECTION_${o}_UPDATE`,inputSchema:T(n),outputSchema:_(n),opt:!0},{name:`COLLECTION_${o}_DELETE`,inputSchema:D,outputSchema:g(n),opt:!0}),s}export{N as B,v as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as r,y as m,j as n}from"./index-
|
|
1
|
+
import{d as r,y as m,j as n}from"./index-D49VqQ7Q.js";import{_ as d}from"./index-BZyxukAe.js";import{i}from"./SearchMd-CVvF1HpM.js";function x(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d,{"data-slot":"command",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function g(l){const e=r.c(9);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(i,{className:"size-5 shrink-0 text-foreground"}),e[3]=o):o=e[3];let a;e[4]!==t?(a=m("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),e[4]=t,e[5]=a):a=e[5];let c;return e[6]!==s||e[7]!==a?(c=n.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-10 items-center gap-2 border-b px-3",children:[o,n.jsx(d.Input,{"data-slot":"command-input",className:a,...s})]}),e[6]=s,e[7]=a,e[8]=c):c=e[8],c}function h(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.List,{"data-slot":"command-list",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function N(l){const e=r.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=n.jsx(d.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Group,{"data-slot":"command-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function b(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("bg-border -mx-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Separator,{"data-slot":"command-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function y(l){const e=r.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=m("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[3]=t,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=n.jsx(d.Item,{"data-slot":"command-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}export{v as C,h as a,x as b,g as c,N as d,y as e,b as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as E,y as I,j as t}from"./index-
|
|
1
|
+
import{d as E,y as I,j as t}from"./index-D49VqQ7Q.js";import{C as P}from"./card-CKN-JP9M.js";import{I as R}from"./integration-icon-ByIZ-Vgj.js";function B(h){const e=E.c(37),{connection:s,onClick:u,headerActions:j,headerActionsAlwaysVisible:A,body:v,footer:N,className:b,fallbackIcon:y}=h,C=A===void 0?!1:A,k=u&&"hover:bg-muted/50";let i;e[0]!==b||e[1]!==k?(i=I("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",k,b),e[0]=b,e[1]=k,e[2]=i):i=e[2];let l;e[3]!==s.icon||e[4]!==s.title||e[5]!==y?(l=t.jsx(R,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:y}),e[3]=s.icon,e[4]=s.title,e[5]=y,e[6]=l):l=e[6];let o;e[7]!==j||e[8]!==C?(o=j&&t.jsx("div",{className:I("transition-opacity",!C&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:_,children:j}),e[7]=j,e[8]=C,e[9]=o):o=e[9];let n;e[10]!==o?(n=t.jsx("div",{className:"relative",children:o}),e[10]=o,e[11]=n):n=e[11];let c;e[12]!==l||e[13]!==n?(c=t.jsxs("div",{className:"flex items-start justify-between",children:[l,n]}),e[12]=l,e[13]=n,e[14]=c):c=e[14];let r;e[15]!==s.title?(r=t.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[15]=s.title,e[16]=r):r=e[16];const w=s.description||"No description";let a;e[17]!==w?(a=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:w}),e[17]=w,e[18]=a):a=e[18];let d;e[19]!==a||e[20]!==r?(d=t.jsxs("div",{className:"flex flex-col gap-1",children:[r,a]}),e[19]=a,e[20]=r,e[21]=d):d=e[21];let f;e[22]!==v?(f=v&&t.jsx("div",{children:v}),e[22]=v,e[23]=f):f=e[23];let m;e[24]!==d||e[25]!==f||e[26]!==c?(m=t.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[c,d,f]}),e[24]=d,e[25]=f,e[26]=c,e[27]=m):m=e[27];let x;e[28]!==N?(x=N&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:V,children:N})}),e[28]=N,e[29]=x):x=e[29];let p;e[30]!==m||e[31]!==x?(p=t.jsxs("div",{className:"flex flex-col flex-1",children:[m,x]}),e[30]=m,e[31]=x,e[32]=p):p=e[32];let g;return e[33]!==u||e[34]!==p||e[35]!==i?(g=t.jsx(P,{className:i,onClick:u,children:p}),e[33]=u,e[34]=p,e[35]=i,e[36]=g):g=e[36],g}function V(h){return h.stopPropagation()}function _(h){return h.stopPropagation()}export{B as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as $,j as t,B as H,r as W,y as Ne,c as oe,z as Pe,K as le,O as q,H as ye,f as re,bV as xe,D as Oe,p as Ve,E as Me,k as ze,x as Ee,v as Re,t as Le,i as Ue,b as Fe,w as Z,a as Be}from"./index-DIir8pgm.js";import{g as He}from"./generate-id-Dyweu44Y.js";import{E as _e}from"./empty-state-mZytJ7Og.js";import{E as Xe,c as Ge,r as We,e as Ce}from"./env-vars-editor-74-7rifU.js";import{d as Ke}from"./registry-utils-pfpET92F.js";import{u as Se,S as Qe}from"./index-DcP_WR0J.js";import{u as qe}from"./use-members-DNGgajFa.js";import{A as Je}from"./avatar-CUJtyPo2.js";import{u as we,b as Ye,a as ke}from"./use-connection-B3ekSVUc.js";import{u as ce,a as Ze}from"./constants-C2mKle9u.js";import{d as et}from"./use-mcp-tools-JDKA9UZ8.js";import{b as tt}from"./use-mcp-resources-BuE1rP0c.js";import{a as st}from"./use-mcp-prompts-ClavsAnj.js";import{B as nt,a as ot,b as pe,d as rt,e as it,c as at}from"./breadcrumb-CCQEGtsd.js";import{I as ie,t as Te,E as lt,S as ct,T as dt,s as te,i as mt}from"./integration-icon-B_0G_X87.js";import{i as Ae}from"./Loading01-BcvCGReP.js";import{s as ut}from"./Plus-_0WPT4fC.js";import{t as Ie}from"./Settings01-BWfYiv65.js";import{s as de}from"./Trash01-1xYo27RH.js";import{f as xt,a as pt,b as ht,c as ft,d as gt,e as jt,A as vt,h as bt}from"./alert-dialog-CahR3t2-.js";import{S as Nt,b as yt,c as _t,d as Ct,e as St}from"./index-B_aEJlRD.js";import{F as L,b as U,c as F,d as E,f as B,e as wt,a as kt}from"./form-DTthvfe9.js";import{I as G}from"./input-BVAvDQ_C.js";import{g as me}from"./connection-slug-Bw8dtz1U.js";import{V as Tt}from"./layout-D4tWA0bw.js";import{c as At,C as It,B as Dt,a as $t,b as Pt,d as Ot,e as Vt}from"./monitoring-stats-row-C6qBbHow.js";import{b as Mt}from"./use-virtual-mcp-DXFVfjMZ.js";import{i as De}from"./ChevronRight-9oNUepCi.js";import{T as se,a as zt,b as ne,c as Et}from"./tabs-BMh4okm_.js";import{g as ue}from"./types-BJ15oicG.js";import{M as Rt}from"./mcp-app-renderer-DDZtzzcL.js";import{C as Lt}from"./collection-search-DpxIEj2Y.js";import{T as Ut}from"./tools-list-SV45eRcg.js";import{C as Ft}from"./card-CPxXaS9B.js";import{B as Bt}from"./badge-CED9DV1z.js";import{D as Ht,a as Xt,b as Gt,c as he}from"./dropdown-menu-CPUZgeQt.js";import{S as fe,a as ge,b as je,c as ve,d as R}from"./select-CBE7xbF4.js";import{c as Wt}from"./XCircle-DF_H_9sl.js";import{t as Kt}from"./ChevronDown-Br-9w7at.js";import{n as Qt}from"./Container-2jV0v6El.js";import{a as qt}from"./RefreshCcw01-7vLfxx-h.js";import{s as Jt}from"./XClose-DN7ytwf7.js";import"./workflow-DCKJ21al.js";import"./collections-D4sy0Xs0.js";import"./Play-CfPk1Jil.js";import"./constants-CUwoz2Qc.js";import"./extract-connection-data-0iT2_wST.js";import"./use-install-from-registry-BKwLRanW.js";import"./index-Dz9R7lP6.js";import"./index-DoQQIBf1.js";import"./index-BdQq_4o_.js";import"./index-DIiriVeM.js";import"./select-virtual-mcp-Bco91LS8.js";import"./popover-BMBGvHQ_.js";import"./tooltip-iG9fvlrZ.js";import"./index-DTnP3oIT.js";import"./Check-xiDQ8BtU.js";import"./SearchMd-Drvt0RJI.js";import"./use-create-virtual-mcp-J-6A5Uhg.js";import"./User01-BeQd85RG.js";import"./use-collections-CeVeE6L5.js";import"./useMutation-DPjXSTSD.js";import"./useQuery-BJg_09kQ.js";import"./AlertCircle-CMykqSBg.js";import"./ArrowUp-nzMjud7y.js";import"./ArrowLeft-uGR-9mNu.js";import"./Type01-BYtXAD5n.js";import"./ChevronUp-Cn8mueH6.js";import"./Dataflow03-DxoSS6Mb.js";import"./FolderClosed-rSkxBpcc.js";import"./Upload01-B0BJCQ_e.js";import"./X-COxH8ezg.js";import"./Zap-EKbyzC1z.js";import"./label-C6omQTs_.js";import"./slugify-CEUa2lfQ.js";import"./collection-display-button--wDfVH13.js";import"./collection-table-wrapper-fDncVs5S.js";import"./table-CGhKFeKb.js";function Yt(s){const e=$.c(39),{instance:n,onConfigure:r,onAuthenticate:i,onDelete:o}=s;let l;e[0]!==n.id?(l={connectionId:n.id},e[0]=n.id,e[1]=l):l=e[1];const c=Se(l),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,x=d?"border-destructive/50 bg-destructive/5 px-4 py-2.5":"border-transparent";let p;e[2]!==x?(p=Ne("flex items-center gap-3 rounded-lg border transition-colors",x),e[2]=x,e[3]=p):p=e[3];let a;e[4]!==n.icon||e[5]!==n.title?(a=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a):a=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let b;e[11]!==f||e[12]!==g?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=b):b=e[13];let v;e[14]!==n||e[15]!==d||e[16]!==i?(v=d&&t.jsx(H,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>i(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=i,e[17]=v):v=e[17];let j;e[18]!==n||e[19]!==r?(j=()=>r(n),e[18]=n,e[19]=r,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Ie,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let C;e[24]!==n||e[25]!==o?(C=()=>o(n),e[24]=n,e[25]=o,e[26]=C):C=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(de,{size:13}),e[27]=N):N=e[27];let k;e[28]!==C?(k=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:C,title:"Delete",children:N}),e[28]=C,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==v?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v,w,k]}),e[30]=w,e[31]=k,e[32]=v,e[33]=y):y=e[33];let T;return e[34]!==y||e[35]!==p||e[36]!==a||e[37]!==b?(T=t.jsxs("div",{className:p,children:[a,b,y]}),e[34]=y,e[35]=p,e[36]=a,e[37]=b,e[38]=T):T=e[38],T}function Zt(s){const e=$.c(15),{instance:n,onConfigure:r}=s;let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let l;e[5]!==n||e[6]!==r?(l=()=>r(n),e[5]=n,e[6]=r,e[7]=l):l=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ie,{size:13}),e[8]=c):c=e[8];let u;e[9]!==l?(u=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l,title:"Configure",children:c})}),e[9]=l,e[10]=u):u=e[10];let d;return e[11]!==i||e[12]!==o||e[13]!==u?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent transition-colors",children:[i,o,u]}),e[11]=i,e[12]=o,e[13]=u,e[14]=d):d=e[14],d}function es(s){const e=$.c(25),{instances:n,onConfigure:r,onAuthenticate:i,onDelete:o,onAdd:l,isAdding:c}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let d;e[0]!==u?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=d):d=e[1];let x;e[2]!==c?(x=c?t.jsx(Ae,{size:13,className:"animate-spin"}):t.jsx(ut,{size:13}),e[2]=c,e[3]=x):x=e[3];let p;e[4]!==c||e[5]!==l||e[6]!==x?(p=t.jsxs(H,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:l,disabled:c,children:[x,"Add instance"]}),e[4]=c,e[5]=l,e[6]=x,e[7]=p):p=e[7];let a;e[8]!==d||e[9]!==p?(a=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=a):a=e[10];let f;if(e[11]!==n||e[12]!==i||e[13]!==r||e[14]!==o){let v;e[16]!==i||e[17]!==r||e[18]!==o?(v=j=>t.jsx(W.Suspense,{fallback:t.jsx(Zt,{instance:j,onConfigure:r}),children:t.jsx(Yt,{instance:j,onConfigure:r,onAuthenticate:i,onDelete:o})},j.id),e[16]=i,e[17]=r,e[18]=o,e[19]=v):v=e[19],f=n.map(v),e[11]=n,e[12]=i,e[13]=r,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let b;return e[22]!==a||e[23]!==g?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,g]}),e[22]=a,e[23]=g,e[24]=b):b=e[24],b}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=$.c(3),{connectionId:n,orgId:r,timeframe:i}=s;let o;e[0]!==r?(o={connectionId:Ze,orgId:r},e[0]=r,e[1]=o):o=e[1];const l=ce(o),c=ss(i),{data:u}=Pe({queryKey:le.connectionActivity(n,i,r),queryFn:async()=>{const f=await l.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:c.startDate.toISOString(),endDate:c.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return f.structuredContent??f},staleTime:3e5}),d=At(u?.logs??[],c),x=d.data,p=d.totalCalls>0;let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=a):a=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:d.totalCalls.toLocaleString()}),a]}),d.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:d.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),d.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(d.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(It,{config:ns,className:"h-16 w-full",children:t.jsxs(Dt,{data:x,barCategoryGap:"4%",children:[t.jsx($t,{content:t.jsx(Pt,{labelFormatter:is}),cursor:{fill:"var(--muted)"}}),t.jsx(Ot,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(rs)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function rs(s,e){return t.jsx(Vt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function is(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=$.c(13),{connectionId:n}=s,[r,i]=W.useState("14d"),{org:o}=oe();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=l):l=e[0];let c;e[1]!==r?(c=ts.map(a=>t.jsx("button",{type:"button",onClick:()=>i(a.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",r===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value)),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[l,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=u):u=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(as,{}),e[5]=d):d=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==r?(x=t.jsx(W.Suspense,{fallback:d,children:t.jsx(os,{connectionId:n,orgId:o.id,timeframe:r})}),e[6]=n,e[7]=o.id,e[8]=r,e[9]=x):x=e[9];let p;return e[10]!==u||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[u,x]}),e[10]=u,e[11]=x,e[12]=p):p=e[12],p}function cs(s){const e=$.c(14),{virtualMcp:n,org:r}=s;let i;e[0]!==r||e[1]!==n.id?(i={org:r,project:q,agentId:n.id},e[0]=r,e[1]=n.id,e[2]=i):i=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Te,{size:16}),e[3]=o):o=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:o}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let c;e[7]!==n.title?(c=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(De,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=u):u=e[9];let d;return e[10]!==i||e[11]!==l||e[12]!==c?(d=t.jsxs(ye,{to:"/$org/$project/agents/$agentId/",params:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,c,u]}),e[10]=i,e[11]=l,e[12]=c,e[13]=d):d=e[13],d}function ds(s){const e=$.c(7),{virtualMcps:n,org:r}=s;let i;if(e[0]!==r||e[1]!==n){let l;e[3]!==r?(l=c=>t.jsx(cs,{virtualMcp:c,org:r},c.id),e[3]=r,e[4]=l):l=e[4],i=n.map(l),e[0]=r,e[1]=n,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:i})}),e[5]=i,e[6]=o):o=e[6],o}function ms(s){const e=$.c(7),{connection:n}=s,{org:r}=oe();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const o=Mt(i);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let u;return e[4]!==r.slug||e[5]!==o?(u=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ds,{virtualMcps:o,org:r.slug})})]}),e[4]=r.slug,e[5]=o,e[6]=u):u=e[6],u}function us(s){const e=$.c(30),{tools:n,connectionId:r,org:i}=s,o=re(),{org:l}=oe();let c;e[0]!==r||e[1]!==l.id?(c={connectionId:r,orgId:l.id},e[0]=r,e[1]=l.id,e[2]=c):c=e[2];const u=ce(c),d=we(r);let x;e[3]!==d||e[4]!==r?(x=d?me(d):r,e[3]=d,e[4]=r,e[5]=x):x=e[5];const p=x,[a,f]=W.useState("");let g,b,v,j;if(e[6]!==p||e[7]!==u||e[8]!==o||e[9]!==i||e[10]!==a||e[11]!==n){const C=(n??[]).filter(xs),N=a.toLowerCase().trim(),k=N?C.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):C;let y;e[16]!==p||e[17]!==o||e[18]!==i?(y=h=>{o({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:i,project:q,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[16]=p,e[17]=o,e[18]=i,e[19]=y):y=e[19];const T=y;v="flex flex-col h-full overflow-hidden";let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[20]=A):A=e[20],e[21]!==a?(j=t.jsx(Lt,{value:a,onChange:f,placeholder:"Search apps...",onKeyDown:A}),e[21]=a,e[22]=j):j=e[22],g="flex-1 overflow-auto p-5",b=k.length===0?t.jsx(_e,{image:null,title:a?"No apps found":"No apps available",description:a?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:k.map(h=>{const I=ue(h._meta);return t.jsxs(Ft,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>T(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Rt,{resourceURI:I,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:u})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Ut,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[6]=p,e[7]=u,e[8]=o,e[9]=i,e[10]=a,e[11]=n,e[12]=g,e[13]=b,e[14]=v,e[15]=j}else g=e[12],b=e[13],v=e[14],j=e[15];let _;e[23]!==g||e[24]!==b?(_=t.jsx("div",{className:g,children:b}),e[23]=g,e[24]=b,e[25]=_):_=e[25];let w;return e[26]!==v||e[27]!==j||e[28]!==_?(w=t.jsxs("div",{className:v,children:[j,_]}),e[26]=v,e[27]=j,e[28]=_,e[29]=w):w=e[29],w}function xs(s){return!!ue(s._meta)}function $e(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),r=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),i=e.map(n),o=e[e.length-1];return i.length>=2&&o&&r.has(o)?[i.pop(),...i].join(" "):i.join(" ")}function ae(s){const e=$.c(2),{label:n}=s;let r;return e[0]!==n?(r=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=r):r=e[1],r}function ps(s){const e=$.c(50),{tools:n,prompts:r,resources:i,connectionId:o,org:l}=s;let c;e[0]!==r?(c=r===void 0?[]:r,e[0]=r,e[1]=c):c=e[1];const u=c;let d;e[2]!==i?(d=i===void 0?[]:i,e[2]=i,e[3]=d):d=e[3];const x=d,p=re(),a=we(o??"");let f;e[4]!==a||e[5]!==o?(f=a?me(a):o,e[4]=a,e[5]=o,e[6]=f):f=e[6];const g=f;let b;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==l?(b=function(J){!o||!l||p({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:l,project:q,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(J)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=l,e[11]=b):b=e[11];const v=b;let j;e[12]!==o||e[13]!==l||e[14]!==n?(j=o&&l&&n.some(gs),e[12]=o,e[13]=l,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+u.length+x.length===0){let D;return e[16]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=D):D=e[16],D}let C;e[17]!==n.length?(C=t.jsxs(se,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=C):C=e[18];let N;e[19]!==_?(N=_&&t.jsx(se,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(se,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(se,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let T;e[23]!==C||e[24]!==N?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,N,k,y]})}),e[23]=C,e[24]=N,e[25]=T):T=e[25];let A;e[26]!==v||e[27]!==n?(A=n.length>0?n.map(D=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>v(D.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:$e(D.name)}),D.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:D.description})]}),t.jsx(De,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},D.name)):t.jsx(ae,{label:"tools"}),e[26]=v,e[27]=n,e[28]=A):A=e[28];let h;e[29]!==A?(h=t.jsx(ne,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[29]=A,e[30]=h):h=e[30];let I;e[31]!==o||e[32]!==_||e[33]!==l||e[34]!==n?(I=_&&t.jsx(ne,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(us,{tools:n,connectionId:o,org:l})}),e[31]=o,e[32]=_,e[33]=l,e[34]=n,e[35]=I):I=e[35];let M;e[36]!==u?(M=u.length>0?u.map(fs):t.jsx(ae,{label:"prompts"}),e[36]=u,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(ne,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let S;e[40]!==x?(S=x.length>0?x.map(hs):t.jsx(ae,{label:"resources"}),e[40]=x,e[41]=S):S=e[41];let V;e[42]!==S?(V=t.jsx(ne,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[42]=S,e[43]=V):V=e[43];let X;return e[44]!==T||e[45]!==h||e[46]!==I||e[47]!==O||e[48]!==V?(X=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,h,I,O,V]})}),e[44]=T,e[45]=h,e[46]=I,e[47]=O,e[48]=V,e[49]=X):X=e[49],X}function hs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ct,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:$e(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function gs(s){return ue(s._meta)}function js(s){const e=$.c(13),{connection:n,displayTitle:r}=s,i=r??n.title;let o;e[0]!==n.icon||e[1]!==i?(o=t.jsx(ie,{icon:n.icon,name:i,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=i,e[2]=o):o=e[2];let l;e[3]!==i?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[3]=i,e[4]=l):l=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let u;e[7]!==l||e[8]!==c?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,c]}),e[7]=l,e[8]=c,e[9]=u):u=e[9];let d;return e[10]!==o||e[11]!==u?(d=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,u]}),e[10]=o,e[11]=u,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:r,onRemoveOAuth:i}){const o=xe({control:s.control,name:"ui_type"}),l=xe({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Oe(),u=(()=>{if(typeof l!="string"||!l)return!1;try{const a=new URL(l);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Ve(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(fe,{value:a.value,onValueChange:a.onChange,children:[t.jsx(E,{children:t.jsxs(ge,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(te,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(je,{})]})}),t.jsxs(ve,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(U,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(fe,{value:a.value,onValueChange:a.onChange,children:[t.jsx(E,{children:t.jsx(ge,{className:"h-10",children:t.jsx(je,{})})}),t.jsxs(ve,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(te,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(te,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(te,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Qt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(G,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(Xe,{value:a.value??[],onChange:a.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:u?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ht,{children:[t.jsx(Xt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(Wt,{size:12}),"Authenticated via OAuth",t.jsx(Kt,{size:12})]})})}),t.jsxs(Gt,{align:"start",children:[t.jsxs(he,{onClick:r,children:[t.jsx(qt,{size:16}),"Re-authenticate"]}),t.jsxs(he,{variant:"destructive",onClick:i,children:[t.jsx(de,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Jt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(G,{type:"password",placeholder:u?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),u&&t.jsxs(wt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(B,{})]})})]})}function bs(s){return s.command==="npx"}function Ns(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function _s(s,e){const n={command:"npx",args:["-y",s]},r=Ce(e);return Object.keys(r).length>0&&(n.envVars=r),n}function Cs(s,e,n,r){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const o=Ce(r);return Object.keys(o).length>0&&(i.envVars=o),i}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const r=s.connection_headers,i=We(r.envVars);if(bs(r)){const l=Ns(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const o=ys(r);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,r=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=_s(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Cs(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",r=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:r,tools:i,prompts:o,resources:l,siblings:c}){const u=re({from:"/$org/$project/mcps/$appSlug"}),d=Ee(),x=ke(),[p,a]=W.useState(null),[f,g]=W.useState(null),[b,v]=W.useState(!1),j=Se({connectionId:e}),{data:_}=qe(),w=_?.data?.members??[],C=p??s,N=w.find(m=>m.userId===C.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,A=Ke({connections:[s],binding:"MCP"}).length>0,h=Re({resolver:Le(Ge),values:be(p??s)}),I=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const z=h.getValues(),P=Ss(z),K=p?.id??e;await x.update.mutateAsync({id:K,data:P}),h.reset(z)},O=()=>{h.reset(be(p??s))},S=async m=>{const{token:z,tokenInfo:P,error:K}=await Be({connectionId:m});if(K||!z){Z.error(`Authentication failed: ${K}`);return}if(P)try{const Q=await fetch(`/api/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:P.accessToken,refreshToken:P.refreshToken,expiresIn:P.expiresIn,scope:P.scope,clientId:P.clientId,clientSecret:P.clientSecret,tokenEndpoint:P.tokenEndpoint})});if(!Q.ok)console.error("Failed to save OAuth token:",await Q.text()),await x.update.mutateAsync({id:m,data:{connection_token:z}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(Q){console.error("Error saving OAuth token:",Q),await x.update.mutateAsync({id:m,data:{connection_token:z}})}else await x.update.mutateAsync({id:m,data:{connection_token:z}});const Y=new URL(`/mcp/${m}`,window.location.origin);await d.invalidateQueries({queryKey:le.isMCPAuthenticated(Y.href,null)}),Z.success("Authentication successful")},V=()=>S(s.id),X=async()=>{try{const m=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const P=await m.text();Z.error(`Failed to remove OAuth: ${P}`);return}const z=new URL(`/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:le.isMCPAuthenticated(z.href,null)}),Z.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),Z.error("Failed to remove OAuth")}},D=async m=>{await x.delete.mutateAsync(m.id),c.length<=1&&u({to:"/$org/$project/mcps",params:{org:n,project:q}}),g(null)},J=t.jsx(nt,{children:t.jsxs(ot,{children:[t.jsx(pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ye,{to:"/$org/$project/mcps",params:{org:n,project:q},children:"Connections"})})}),t.jsx(it,{}),t.jsx(pe,{children:t.jsx(at,{children:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()})})]})});return t.jsxs(t.Fragment,{children:[t.jsx(xt,{open:f!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(pt,{children:[t.jsxs(ht,{children:[t.jsx(ft,{children:"Disconnect instance?"}),t.jsxs(gt,{children:["This will permanently remove"," ",t.jsx("span",{className:"font-medium text-foreground",children:f?.title}),". This action cannot be undone."]})]}),t.jsxs(jt,{children:[t.jsx(vt,{children:"Cancel"}),t.jsx(bt,{onClick:()=>f&&D(f),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]})}),t.jsx(Nt,{open:p!==null,onOpenChange:m=>{m||a(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(_t,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Ct,{className:"text-base",children:p?.title??s.title}),t.jsx(St,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Je,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(kt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:h.control,name:"title",render:({field:m})=>t.jsxs(U,{children:[t.jsx(F,{children:"Name"}),t.jsx(E,{children:t.jsx(G,{...m})}),t.jsx(B,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:m})=>t.jsxs(U,{children:[t.jsx(F,{children:"Description"}),t.jsx(E,{children:t.jsx(G,{...m,value:m.value||""})}),t.jsx(B,{})]})})]}),t.jsx(vs,{form:h,connection:p??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:V,onRemoveOAuth:X}),t.jsx(Qe,{connection:p??s,form:h,hasMcpBinding:A,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:V,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(H,{onClick:M,disabled:!I||r,className:"flex-1",children:r?"Saving…":"Save changes"}),I&&t.jsx(H,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(H,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=p??s;a(null),g(m)},children:[t.jsx(de,{size:15}),"Delete"]})]})]},p?.id??s.id)]})}),t.jsx(Tt,{breadcrumb:J,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(js,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:c,onConfigure:m=>a(m),onAuthenticate:m=>S(m.id),onDelete:m=>g(m),isAdding:b,onAdd:async()=>{v(!0);try{const m=c[0]??s,z=m.title.replace(/\s*\(\d+\)\s*$/,""),P=c.length+1,K=`${z} (${P})`,Y=He("conn");await x.create.mutateAsync({id:Y,title:K,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const Q=new URL(`/mcp/${Y}`,window.location.origin),ee=await Ue({url:Q.href,token:null});ee.supportsOAuth&&!ee.isAuthenticated&&await S(Y)}finally{v(!1)}}}),t.jsx(ms,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ps,{tools:i,prompts:o,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=$.c(30);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$appSlug"},s[0]=e):e=s[0];const n=re(e);let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/$project/mcps/$appSlug"},s[1]=r):r=s[1];const{appSlug:i,org:o}=ze(r),{org:l}=oe(),c=Ye(),u=ke();let d;s[2]!==i?(d=S=>S.connection_type!=="VIRTUAL"&&me(S)===i,s[2]=i,s[3]=d):d=s[3];const x=c.filter(d),p=x[0]??null,a=p?.id??"",f=ce({connectionId:a||null,orgId:l.id});let g;s[4]!==f?(g={client:f},s[4]=f,s[5]=g):g=s[5];const{data:b}=et(g),v=b?b.tools.map(Ps):(p?.tools??[]).map($s);let j;e:{if(x.length<=1){j=v;break e}const S=new Set,V=[],X=Is;for(const D of x){const J=D.id===a?v:X(D.tools);for(const m of J)S.has(m.name)||(S.add(m.name),V.push(m))}j=V.length>0?V:v}const _=j;let w;s[6]!==f?(w={client:f},s[6]=f,s[7]=w):w=s[7];const{data:C}=st(w);let N;s[8]!==f?(N={client:f},s[8]=f,s[9]=N):N=s[9];const{data:k}=tt(N);let y;s[10]!==C?.prompts?(y=C?.prompts??[],s[10]=C?.prompts,s[11]=y):y=s[11];let T;s[12]!==y?(T=y.map(As),s[12]=y,s[13]=T):T=s[13];const A=T;let h;s[14]!==k?.resources?(h=k?.resources??[],s[14]=k?.resources,s[15]=h):h=s[15];let I;s[16]!==h?(I=h.map(Ts),s[16]=h,s[17]=I):I=s[17];const M=I;if(!p){let S;return s[18]!==n||s[19]!==o?(S=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:o,project:q}}),children:"Back to connections"})})}),s[18]=n,s[19]=o,s[20]=S):S=s[20],S}let O;return s[21]!==u.update.isPending||s[22]!==_||s[23]!==p||s[24]!==a||s[25]!==o||s[26]!==A||s[27]!==M||s[28]!==x?(O=t.jsx(ws,{org:o,connection:p,connectionId:a,isUpdating:u.update.isPending,tools:_,prompts:A,resources:M,siblings:x}),s[21]=u.update.isPending,s[22]=_,s[23]=p,s[24]=a,s[25]=o,s[26]=A,s[27]=M,s[28]=x,s[29]=O):O=s[29],O}function Ts(s){return{name:s.name,description:s.description,uri:s.uri}}function As(s){return{name:s.name,description:s.description}}function Is(s){return(s??[]).map(Ds)}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function io(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{io as default};
|
|
1
|
+
import{d as $,j as t,B as H,r as W,y as Ne,c as oe,z as Pe,K as le,O as q,H as ye,f as re,bV as xe,D as Oe,p as Ve,E as Me,k as ze,x as Ee,v as Re,t as Le,i as Ue,b as Fe,w as Z,a as Be}from"./index-D49VqQ7Q.js";import{g as He}from"./generate-id-Dyweu44Y.js";import{E as _e}from"./empty-state-B8NhLY9v.js";import{E as Xe,c as Ge,r as We,e as Ce}from"./env-vars-editor-CvqhjBEu.js";import{d as Ke}from"./registry-utils-Cz03qmOa.js";import{u as Se,S as Qe}from"./index-3WTtRDrt.js";import{u as qe}from"./use-members-BZM-R1qG.js";import{A as Je}from"./avatar-BZ4Frci2.js";import{u as we,b as Ye,a as ke}from"./use-connection-Yjy9d1tW.js";import{u as ce,a as Ze}from"./constants-TLV7MTwP.js";import{d as et}from"./use-mcp-tools-CmOfbC2t.js";import{b as tt}from"./use-mcp-resources-BnmpykKD.js";import{a as st}from"./use-mcp-prompts-DY_yf0WC.js";import{B as nt,a as ot,b as pe,d as rt,e as it,c as at}from"./breadcrumb-BBMvtdg-.js";import{I as ie,t as Te,E as lt,S as ct,T as dt,s as te,i as mt}from"./integration-icon-ByIZ-Vgj.js";import{i as Ae}from"./Loading01-BVCg1O_G.js";import{s as ut}from"./Plus-DcVtqCMV.js";import{t as Ie}from"./Settings01-DpZ_tsoX.js";import{s as de}from"./Trash01-CBP9WLeP.js";import{f as xt,a as pt,b as ht,c as ft,d as gt,e as jt,A as vt,h as bt}from"./alert-dialog-Bke1xnyn.js";import{S as Nt,b as yt,c as _t,d as Ct,e as St}from"./index-CtkIjbbq.js";import{F as L,b as U,c as F,d as E,f as B,e as wt,a as kt}from"./form-DPsme8JL.js";import{I as G}from"./input-BoNWsfmK.js";import{g as me}from"./connection-slug-Bw8dtz1U.js";import{V as Tt}from"./layout-Dp8uiQPy.js";import{c as At,C as It,B as Dt,a as $t,b as Pt,d as Ot,e as Vt}from"./monitoring-stats-row-Bzy3PCZQ.js";import{b as Mt}from"./use-virtual-mcp-2qhGJdPe.js";import{i as De}from"./ChevronRight-Dxvchjxo.js";import{T as se,a as zt,b as ne,c as Et}from"./tabs-Du7uGFqP.js";import{g as ue}from"./types-llndI7Ky.js";import{M as Rt}from"./mcp-app-renderer-C8wEMNqP.js";import{C as Lt}from"./collection-search-fzGK39qM.js";import{T as Ut}from"./tools-list-BQiqsKN2.js";import{C as Ft}from"./card-CKN-JP9M.js";import{B as Bt}from"./badge-DGQ0gFlp.js";import{D as Ht,a as Xt,b as Gt,c as he}from"./dropdown-menu-BK29e1o0.js";import{S as fe,a as ge,b as je,c as ve,d as R}from"./select-DaOZXaTi.js";import{c as Wt}from"./XCircle-Z-JTmQ8v.js";import{t as Kt}from"./ChevronDown-CDxBhn_l.js";import{n as Qt}from"./Container-CMPDG7Cp.js";import{a as qt}from"./RefreshCcw01-Co0-i94o.js";import{s as Jt}from"./XClose-BLvk3pvY.js";import"./workflow-CBGVBFDu.js";import"./collections-BsFnKFn5.js";import"./Play-Bb4cvvVL.js";import"./constants-BqeudQjB.js";import"./extract-connection-data-NSojo21r.js";import"./use-install-from-registry-Du1Xu864.js";import"./index-DxaXuxCe.js";import"./index-D_CXrtwd.js";import"./index-BdQq_4o_.js";import"./index-BZyxukAe.js";import"./select-virtual-mcp-CjfXEnho.js";import"./popover-CvIauBBG.js";import"./tooltip-DJkxXViN.js";import"./index-BkAoKVx8.js";import"./Check-Dczm9Dfw.js";import"./SearchMd-CVvF1HpM.js";import"./use-create-virtual-mcp-CEBO__7d.js";import"./User01-CItwHvE1.js";import"./use-collections-Dmxer7H8.js";import"./useMutation-BTUmJffP.js";import"./useQuery-CvkH2gG1.js";import"./AlertCircle-BD5gSXQu.js";import"./ArrowUp-D6ltkV3R.js";import"./ArrowLeft-DN3D0Zrv.js";import"./Type01-CySkENi6.js";import"./ChevronUp-BLNd6dNq.js";import"./Dataflow03-slF1Ax9G.js";import"./FolderClosed-BKB_NgWm.js";import"./Upload01-BzGPegBj.js";import"./X-Dr-hR03I.js";import"./Zap-CiHJmamA.js";import"./label-DF2jcg2U.js";import"./slugify-CEUa2lfQ.js";import"./collection-display-button-ZvHBt_eA.js";import"./collection-table-wrapper-DsHGysPH.js";import"./table-w828HACk.js";function Yt(s){const e=$.c(39),{instance:n,onConfigure:r,onAuthenticate:i,onDelete:o}=s;let l;e[0]!==n.id?(l={connectionId:n.id},e[0]=n.id,e[1]=l):l=e[1];const c=Se(l),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,x=d?"border-destructive/50 bg-destructive/5 px-4 py-2.5":"border-transparent";let p;e[2]!==x?(p=Ne("flex items-center gap-3 rounded-lg border transition-colors",x),e[2]=x,e[3]=p):p=e[3];let a;e[4]!==n.icon||e[5]!==n.title?(a=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a):a=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let b;e[11]!==f||e[12]!==g?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=b):b=e[13];let v;e[14]!==n||e[15]!==d||e[16]!==i?(v=d&&t.jsx(H,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>i(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=i,e[17]=v):v=e[17];let j;e[18]!==n||e[19]!==r?(j=()=>r(n),e[18]=n,e[19]=r,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Ie,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let C;e[24]!==n||e[25]!==o?(C=()=>o(n),e[24]=n,e[25]=o,e[26]=C):C=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(de,{size:13}),e[27]=N):N=e[27];let k;e[28]!==C?(k=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:C,title:"Delete",children:N}),e[28]=C,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==v?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v,w,k]}),e[30]=w,e[31]=k,e[32]=v,e[33]=y):y=e[33];let T;return e[34]!==y||e[35]!==p||e[36]!==a||e[37]!==b?(T=t.jsxs("div",{className:p,children:[a,b,y]}),e[34]=y,e[35]=p,e[36]=a,e[37]=b,e[38]=T):T=e[38],T}function Zt(s){const e=$.c(15),{instance:n,onConfigure:r}=s;let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let l;e[5]!==n||e[6]!==r?(l=()=>r(n),e[5]=n,e[6]=r,e[7]=l):l=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ie,{size:13}),e[8]=c):c=e[8];let u;e[9]!==l?(u=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:l,title:"Configure",children:c})}),e[9]=l,e[10]=u):u=e[10];let d;return e[11]!==i||e[12]!==o||e[13]!==u?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent transition-colors",children:[i,o,u]}),e[11]=i,e[12]=o,e[13]=u,e[14]=d):d=e[14],d}function es(s){const e=$.c(25),{instances:n,onConfigure:r,onAuthenticate:i,onDelete:o,onAdd:l,isAdding:c}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let d;e[0]!==u?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=d):d=e[1];let x;e[2]!==c?(x=c?t.jsx(Ae,{size:13,className:"animate-spin"}):t.jsx(ut,{size:13}),e[2]=c,e[3]=x):x=e[3];let p;e[4]!==c||e[5]!==l||e[6]!==x?(p=t.jsxs(H,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:l,disabled:c,children:[x,"Add instance"]}),e[4]=c,e[5]=l,e[6]=x,e[7]=p):p=e[7];let a;e[8]!==d||e[9]!==p?(a=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=a):a=e[10];let f;if(e[11]!==n||e[12]!==i||e[13]!==r||e[14]!==o){let v;e[16]!==i||e[17]!==r||e[18]!==o?(v=j=>t.jsx(W.Suspense,{fallback:t.jsx(Zt,{instance:j,onConfigure:r}),children:t.jsx(Yt,{instance:j,onConfigure:r,onAuthenticate:i,onDelete:o})},j.id),e[16]=i,e[17]=r,e[18]=o,e[19]=v):v=e[19],f=n.map(v),e[11]=n,e[12]=i,e[13]=r,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let b;return e[22]!==a||e[23]!==g?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[a,g]}),e[22]=a,e[23]=g,e[24]=b):b=e[24],b}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=$.c(3),{connectionId:n,orgId:r,timeframe:i}=s;let o;e[0]!==r?(o={connectionId:Ze,orgId:r},e[0]=r,e[1]=o):o=e[1];const l=ce(o),c=ss(i),{data:u}=Pe({queryKey:le.connectionActivity(n,i,r),queryFn:async()=>{const f=await l.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:c.startDate.toISOString(),endDate:c.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return f.structuredContent??f},staleTime:3e5}),d=At(u?.logs??[],c),x=d.data,p=d.totalCalls>0;let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[2]=a):a=e[2],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:d.totalCalls.toLocaleString()}),a]}),d.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:d.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),d.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(d.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),p?t.jsxs("div",{children:[t.jsx(It,{config:ns,className:"h-16 w-full",children:t.jsxs(Dt,{data:x,barCategoryGap:"4%",children:[t.jsx($t,{content:t.jsx(Pt,{labelFormatter:is}),cursor:{fill:"var(--muted)"}}),t.jsx(Ot,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(rs)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function rs(s,e){return t.jsx(Vt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function is(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ls(s){const e=$.c(13),{connectionId:n}=s,[r,i]=W.useState("14d"),{org:o}=oe();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=l):l=e[0];let c;e[1]!==r?(c=ts.map(a=>t.jsx("button",{type:"button",onClick:()=>i(a.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",r===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value)),e[1]=r,e[2]=c):c=e[2];let u;e[3]!==c?(u=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[l,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=u):u=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(as,{}),e[5]=d):d=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==r?(x=t.jsx(W.Suspense,{fallback:d,children:t.jsx(os,{connectionId:n,orgId:o.id,timeframe:r})}),e[6]=n,e[7]=o.id,e[8]=r,e[9]=x):x=e[9];let p;return e[10]!==u||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[u,x]}),e[10]=u,e[11]=x,e[12]=p):p=e[12],p}function cs(s){const e=$.c(14),{virtualMcp:n,org:r}=s;let i;e[0]!==r||e[1]!==n.id?(i={org:r,project:q,agentId:n.id},e[0]=r,e[1]=n.id,e[2]=i):i=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Te,{size:16}),e[3]=o):o=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(ie,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:o}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let c;e[7]!==n.title?(c=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(De,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=u):u=e[9];let d;return e[10]!==i||e[11]!==l||e[12]!==c?(d=t.jsxs(ye,{to:"/$org/$project/agents/$agentId/",params:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,c,u]}),e[10]=i,e[11]=l,e[12]=c,e[13]=d):d=e[13],d}function ds(s){const e=$.c(7),{virtualMcps:n,org:r}=s;let i;if(e[0]!==r||e[1]!==n){let l;e[3]!==r?(l=c=>t.jsx(cs,{virtualMcp:c,org:r},c.id),e[3]=r,e[4]=l):l=e[4],i=n.map(l),e[0]=r,e[1]=n,e[2]=i}else i=e[2];let o;return e[5]!==i?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:i})}),e[5]=i,e[6]=o):o=e[6],o}function ms(s){const e=$.c(7),{connection:n}=s,{org:r}=oe();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const o=Mt(i);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let u;return e[4]!==r.slug||e[5]!==o?(u=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ds,{virtualMcps:o,org:r.slug})})]}),e[4]=r.slug,e[5]=o,e[6]=u):u=e[6],u}function us(s){const e=$.c(30),{tools:n,connectionId:r,org:i}=s,o=re(),{org:l}=oe();let c;e[0]!==r||e[1]!==l.id?(c={connectionId:r,orgId:l.id},e[0]=r,e[1]=l.id,e[2]=c):c=e[2];const u=ce(c),d=we(r);let x;e[3]!==d||e[4]!==r?(x=d?me(d):r,e[3]=d,e[4]=r,e[5]=x):x=e[5];const p=x,[a,f]=W.useState("");let g,b,v,j;if(e[6]!==p||e[7]!==u||e[8]!==o||e[9]!==i||e[10]!==a||e[11]!==n){const C=(n??[]).filter(xs),N=a.toLowerCase().trim(),k=N?C.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):C;let y;e[16]!==p||e[17]!==o||e[18]!==i?(y=h=>{o({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:i,project:q,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[16]=p,e[17]=o,e[18]=i,e[19]=y):y=e[19];const T=y;v="flex flex-col h-full overflow-hidden";let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[20]=A):A=e[20],e[21]!==a?(j=t.jsx(Lt,{value:a,onChange:f,placeholder:"Search apps...",onKeyDown:A}),e[21]=a,e[22]=j):j=e[22],g="flex-1 overflow-auto p-5",b=k.length===0?t.jsx(_e,{image:null,title:a?"No apps found":"No apps available",description:a?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:k.map(h=>{const I=ue(h._meta);return t.jsxs(Ft,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>T(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Rt,{resourceURI:I,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:u})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Ut,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[6]=p,e[7]=u,e[8]=o,e[9]=i,e[10]=a,e[11]=n,e[12]=g,e[13]=b,e[14]=v,e[15]=j}else g=e[12],b=e[13],v=e[14],j=e[15];let _;e[23]!==g||e[24]!==b?(_=t.jsx("div",{className:g,children:b}),e[23]=g,e[24]=b,e[25]=_):_=e[25];let w;return e[26]!==v||e[27]!==j||e[28]!==_?(w=t.jsxs("div",{className:v,children:[j,_]}),e[26]=v,e[27]=j,e[28]=_,e[29]=w):w=e[29],w}function xs(s){return!!ue(s._meta)}function $e(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),r=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),i=e.map(n),o=e[e.length-1];return i.length>=2&&o&&r.has(o)?[i.pop(),...i].join(" "):i.join(" ")}function ae(s){const e=$.c(2),{label:n}=s;let r;return e[0]!==n?(r=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=r):r=e[1],r}function ps(s){const e=$.c(50),{tools:n,prompts:r,resources:i,connectionId:o,org:l}=s;let c;e[0]!==r?(c=r===void 0?[]:r,e[0]=r,e[1]=c):c=e[1];const u=c;let d;e[2]!==i?(d=i===void 0?[]:i,e[2]=i,e[3]=d):d=e[3];const x=d,p=re(),a=we(o??"");let f;e[4]!==a||e[5]!==o?(f=a?me(a):o,e[4]=a,e[5]=o,e[6]=f):f=e[6];const g=f;let b;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==l?(b=function(J){!o||!l||p({to:"/$org/$project/mcps/$appSlug/$collectionName/$itemId",params:{org:l,project:q,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(J)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=l,e[11]=b):b=e[11];const v=b;let j;e[12]!==o||e[13]!==l||e[14]!==n?(j=o&&l&&n.some(gs),e[12]=o,e[13]=l,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+u.length+x.length===0){let D;return e[16]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=D):D=e[16],D}let C;e[17]!==n.length?(C=t.jsxs(se,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=C):C=e[18];let N;e[19]!==_?(N=_&&t.jsx(se,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(se,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(se,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let T;e[23]!==C||e[24]!==N?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,N,k,y]})}),e[23]=C,e[24]=N,e[25]=T):T=e[25];let A;e[26]!==v||e[27]!==n?(A=n.length>0?n.map(D=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>v(D.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:$e(D.name)}),D.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:D.description})]}),t.jsx(De,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},D.name)):t.jsx(ae,{label:"tools"}),e[26]=v,e[27]=n,e[28]=A):A=e[28];let h;e[29]!==A?(h=t.jsx(ne,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[29]=A,e[30]=h):h=e[30];let I;e[31]!==o||e[32]!==_||e[33]!==l||e[34]!==n?(I=_&&t.jsx(ne,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(us,{tools:n,connectionId:o,org:l})}),e[31]=o,e[32]=_,e[33]=l,e[34]=n,e[35]=I):I=e[35];let M;e[36]!==u?(M=u.length>0?u.map(fs):t.jsx(ae,{label:"prompts"}),e[36]=u,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(ne,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let S;e[40]!==x?(S=x.length>0?x.map(hs):t.jsx(ae,{label:"resources"}),e[40]=x,e[41]=S):S=e[41];let V;e[42]!==S?(V=t.jsx(ne,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[42]=S,e[43]=V):V=e[43];let X;return e[44]!==T||e[45]!==h||e[46]!==I||e[47]!==O||e[48]!==V?(X=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,h,I,O,V]})}),e[44]=T,e[45]=h,e[46]=I,e[47]=O,e[48]=V,e[49]=X):X=e[49],X}function hs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ct,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:$e(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function gs(s){return ue(s._meta)}function js(s){const e=$.c(13),{connection:n,displayTitle:r}=s,i=r??n.title;let o;e[0]!==n.icon||e[1]!==i?(o=t.jsx(ie,{icon:n.icon,name:i,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=i,e[2]=o):o=e[2];let l;e[3]!==i?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[3]=i,e[4]=l):l=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let u;e[7]!==l||e[8]!==c?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,c]}),e[7]=l,e[8]=c,e[9]=u):u=e[9];let d;return e[10]!==o||e[11]!==u?(d=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,u]}),e[10]=o,e[11]=u,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:r,onRemoveOAuth:i}){const o=xe({control:s.control,name:"ui_type"}),l=xe({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Oe(),u=(()=>{if(typeof l!="string"||!l)return!1;try{const a=new URL(l);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Ve(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(fe,{value:a.value,onValueChange:a.onChange,children:[t.jsx(E,{children:t.jsxs(ge,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(te,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(je,{})]})}),t.jsxs(ve,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(U,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(G,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(fe,{value:a.value,onValueChange:a.onChange,children:[t.jsx(E,{children:t.jsx(ge,{className:"h-10",children:t.jsx(je,{})})}),t.jsxs(ve,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(te,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(te,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(te,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Qt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(G,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(G,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(G,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(G,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(Xe,{value:a.value??[],onChange:a.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:a})=>t.jsxs(U,{className:"flex flex-col gap-3",children:[t.jsx(F,{className:"text-xs text-muted-foreground font-medium",children:u?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ht,{children:[t.jsx(Xt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(Wt,{size:12}),"Authenticated via OAuth",t.jsx(Kt,{size:12})]})})}),t.jsxs(Gt,{align:"start",children:[t.jsxs(he,{onClick:r,children:[t.jsx(qt,{size:16}),"Re-authenticate"]}),t.jsxs(he,{variant:"destructive",onClick:i,children:[t.jsx(de,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Jt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(G,{type:"password",placeholder:u?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),u&&t.jsxs(wt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(B,{})]})})]})}function bs(s){return s.command==="npx"}function Ns(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function _s(s,e){const n={command:"npx",args:["-y",s]},r=Ce(e);return Object.keys(r).length>0&&(n.envVars=r),n}function Cs(s,e,n,r){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const o=Ce(r);return Object.keys(o).length>0&&(i.envVars=o),i}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const r=s.connection_headers,i=We(r.envVars);if(bs(r)){const l=Ns(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const o=ys(r);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:i}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,r=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=_s(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Cs(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",r=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:r,tools:i,prompts:o,resources:l,siblings:c}){const u=re({from:"/$org/$project/mcps/$appSlug"}),d=Ee(),x=ke(),[p,a]=W.useState(null),[f,g]=W.useState(null),[b,v]=W.useState(!1),j=Se({connectionId:e}),{data:_}=qe(),w=_?.data?.members??[],C=p??s,N=w.find(m=>m.userId===C.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,A=Ke({connections:[s],binding:"MCP"}).length>0,h=Re({resolver:Le(Ge),values:be(p??s)}),I=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const z=h.getValues(),P=Ss(z),K=p?.id??e;await x.update.mutateAsync({id:K,data:P}),h.reset(z)},O=()=>{h.reset(be(p??s))},S=async m=>{const{token:z,tokenInfo:P,error:K}=await Be({connectionId:m});if(K||!z){Z.error(`Authentication failed: ${K}`);return}if(P)try{const Q=await fetch(`/api/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:P.accessToken,refreshToken:P.refreshToken,expiresIn:P.expiresIn,scope:P.scope,clientId:P.clientId,clientSecret:P.clientSecret,tokenEndpoint:P.tokenEndpoint})});if(!Q.ok)console.error("Failed to save OAuth token:",await Q.text()),await x.update.mutateAsync({id:m,data:{connection_token:z}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(Q){console.error("Error saving OAuth token:",Q),await x.update.mutateAsync({id:m,data:{connection_token:z}})}else await x.update.mutateAsync({id:m,data:{connection_token:z}});const Y=new URL(`/mcp/${m}`,window.location.origin);await d.invalidateQueries({queryKey:le.isMCPAuthenticated(Y.href,null)}),Z.success("Authentication successful")},V=()=>S(s.id),X=async()=>{try{const m=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const P=await m.text();Z.error(`Failed to remove OAuth: ${P}`);return}const z=new URL(`/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:le.isMCPAuthenticated(z.href,null)}),Z.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),Z.error("Failed to remove OAuth")}},D=async m=>{await x.delete.mutateAsync(m.id),c.length<=1&&u({to:"/$org/$project/mcps",params:{org:n,project:q}}),g(null)},J=t.jsx(nt,{children:t.jsxs(ot,{children:[t.jsx(pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ye,{to:"/$org/$project/mcps",params:{org:n,project:q},children:"Connections"})})}),t.jsx(it,{}),t.jsx(pe,{children:t.jsx(at,{children:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()})})]})});return t.jsxs(t.Fragment,{children:[t.jsx(xt,{open:f!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(pt,{children:[t.jsxs(ht,{children:[t.jsx(ft,{children:"Disconnect instance?"}),t.jsxs(gt,{children:["This will permanently remove"," ",t.jsx("span",{className:"font-medium text-foreground",children:f?.title}),". This action cannot be undone."]})]}),t.jsxs(jt,{children:[t.jsx(vt,{children:"Cancel"}),t.jsx(bt,{onClick:()=>f&&D(f),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]})}),t.jsx(Nt,{open:p!==null,onOpenChange:m=>{m||a(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(_t,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Ct,{className:"text-base",children:p?.title??s.title}),t.jsx(St,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Je,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(kt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:h.control,name:"title",render:({field:m})=>t.jsxs(U,{children:[t.jsx(F,{children:"Name"}),t.jsx(E,{children:t.jsx(G,{...m})}),t.jsx(B,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:m})=>t.jsxs(U,{children:[t.jsx(F,{children:"Description"}),t.jsx(E,{children:t.jsx(G,{...m,value:m.value||""})}),t.jsx(B,{})]})})]}),t.jsx(vs,{form:h,connection:p??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:V,onRemoveOAuth:X}),t.jsx(Qe,{connection:p??s,form:h,hasMcpBinding:A,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:V,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(H,{onClick:M,disabled:!I||r,className:"flex-1",children:r?"Saving…":"Save changes"}),I&&t.jsx(H,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(H,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=p??s;a(null),g(m)},children:[t.jsx(de,{size:15}),"Delete"]})]})]},p?.id??s.id)]})}),t.jsx(Tt,{breadcrumb:J,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(js,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:c,onConfigure:m=>a(m),onAuthenticate:m=>S(m.id),onDelete:m=>g(m),isAdding:b,onAdd:async()=>{v(!0);try{const m=c[0]??s,z=m.title.replace(/\s*\(\d+\)\s*$/,""),P=c.length+1,K=`${z} (${P})`,Y=He("conn");await x.create.mutateAsync({id:Y,title:K,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const Q=new URL(`/mcp/${Y}`,window.location.origin),ee=await Ue({url:Q.href,token:null});ee.supportsOAuth&&!ee.isAuthenticated&&await S(Y)}finally{v(!1)}}}),t.jsx(ms,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ps,{tools:i,prompts:o,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=$.c(30);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$appSlug"},s[0]=e):e=s[0];const n=re(e);let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/$project/mcps/$appSlug"},s[1]=r):r=s[1];const{appSlug:i,org:o}=ze(r),{org:l}=oe(),c=Ye(),u=ke();let d;s[2]!==i?(d=S=>S.connection_type!=="VIRTUAL"&&me(S)===i,s[2]=i,s[3]=d):d=s[3];const x=c.filter(d),p=x[0]??null,a=p?.id??"",f=ce({connectionId:a||null,orgId:l.id});let g;s[4]!==f?(g={client:f},s[4]=f,s[5]=g):g=s[5];const{data:b}=et(g),v=b?b.tools.map(Ps):(p?.tools??[]).map($s);let j;e:{if(x.length<=1){j=v;break e}const S=new Set,V=[],X=Is;for(const D of x){const J=D.id===a?v:X(D.tools);for(const m of J)S.has(m.name)||(S.add(m.name),V.push(m))}j=V.length>0?V:v}const _=j;let w;s[6]!==f?(w={client:f},s[6]=f,s[7]=w):w=s[7];const{data:C}=st(w);let N;s[8]!==f?(N={client:f},s[8]=f,s[9]=N):N=s[9];const{data:k}=tt(N);let y;s[10]!==C?.prompts?(y=C?.prompts??[],s[10]=C?.prompts,s[11]=y):y=s[11];let T;s[12]!==y?(T=y.map(As),s[12]=y,s[13]=T):T=s[13];const A=T;let h;s[14]!==k?.resources?(h=k?.resources??[],s[14]=k?.resources,s[15]=h):h=s[15];let I;s[16]!==h?(I=h.map(Ts),s[16]=h,s[17]=I):I=s[17];const M=I;if(!p){let S;return s[18]!==n||s[19]!==o?(S=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:o,project:q}}),children:"Back to connections"})})}),s[18]=n,s[19]=o,s[20]=S):S=s[20],S}let O;return s[21]!==u.update.isPending||s[22]!==_||s[23]!==p||s[24]!==a||s[25]!==o||s[26]!==A||s[27]!==M||s[28]!==x?(O=t.jsx(ws,{org:o,connection:p,connectionId:a,isUpdating:u.update.isPending,tools:_,prompts:A,resources:M,siblings:x}),s[21]=u.update.isPending,s[22]=_,s[23]=p,s[24]=a,s[25]=o,s[26]=A,s[27]=M,s[28]=x,s[29]=O):O=s[29],O}function Ts(s){return{name:s.name,description:s.description,uri:s.uri}}function As(s){return{name:s.name,description:s.description}}function Is(s){return(s??[]).map(Ds)}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function io(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{io as default};
|