@decocms/mesh 2.118.0 → 2.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-SfldKCWY.js → AlertCircle-Dcv7gp-I.js} +1 -1
- package/dist/client/assets/{AlertOctagon-BuqCOmUs.js → AlertOctagon-WUqMs46z.js} +1 -1
- package/dist/client/assets/{AlertTriangle-NTAnpffh.js → AlertTriangle-CoVws0Do.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BcKpcjgF.js → ArrowLeft-D34bf2DR.js} +1 -1
- package/dist/client/assets/{ArrowUp-DYbG-VRe.js → ArrowUp-D1Z3ZGMT.js} +1 -1
- package/dist/client/assets/{Check-BZR8Q9Pv.js → Check-B6v8UYhw.js} +1 -1
- package/dist/client/assets/{CheckCircle-CVd5u8bU.js → CheckCircle-HtLjegW2.js} +1 -1
- package/dist/client/assets/{CheckDone01-qdpwutcg.js → CheckDone01-Bd0reyKq.js} +1 -1
- package/dist/client/assets/{CheckVerified02-BJZjCOSF.js → CheckVerified02-Bk4SPa-V.js} +1 -1
- package/dist/client/assets/{ChevronDown-B8cLKcdN.js → ChevronDown-RHEfxY7t.js} +1 -1
- package/dist/client/assets/{ChevronRight-CJSnSo8F.js → ChevronRight-CtfDv6KV.js} +1 -1
- package/dist/client/assets/{Clock-B6KbV1-B.js → Clock-Dd09ek7S.js} +1 -1
- package/dist/client/assets/{Code01-YBrb3jgn.js → Code01-bk_rrtBU.js} +1 -1
- package/dist/client/assets/{Container-owj5RAIr.js → Container-CMzzA9YA.js} +1 -1
- package/dist/client/assets/{Copy01-CCUY_RvG.js → Copy01-Cm4pdmsu.js} +1 -1
- package/dist/client/assets/{Dataflow03-CJPowjQE.js → Dataflow03-LkUhMtQK.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-FRdRXVub.js → DotsHorizontal-CI9YTCjx.js} +1 -1
- package/dist/client/assets/{DotsVertical-BxQQau5P.js → DotsVertical-D_euv27G.js} +1 -1
- package/dist/client/assets/{Download01-DpLESrJL.js → Download01-BLCuTA3o.js} +1 -1
- package/dist/client/assets/{Edit01-uKNaELqT.js → Edit01-CWgM245j.js} +1 -1
- package/dist/client/assets/{Eye-B_GtpEGN.js → Eye-CE7mKBNe.js} +1 -1
- package/dist/client/assets/{File02-BTrrknFQ.js → File02-ICiMggom.js} +1 -1
- package/dist/client/assets/{File06-eLWDalt5.js → File06-w124s0Yj.js} +1 -1
- package/dist/client/assets/{FilterLines-BIs-2JsK.js → FilterLines-C_9_niv_.js} +1 -1
- package/dist/client/assets/{Globe01-U0i5HdsU.js → Globe01-A5I3f7rK.js} +1 -1
- package/dist/client/assets/{Globe02-B6RVPmqK.js → Globe02-RkDxZVVj.js} +1 -1
- package/dist/client/assets/{Grid01-z890yGfK.js → Grid01-C8mqRkg1.js} +1 -1
- package/dist/client/assets/{Hash02-D6VWK66P.js → Hash02-fxTBwD_m.js} +1 -1
- package/dist/client/assets/{Home02-D0oXuc6k.js → Home02-BXpHoQTc.js} +1 -1
- package/dist/client/assets/{Image01-nUynjYjD.js → Image01-DQLyBK8l.js} +1 -1
- package/dist/client/assets/{Inbox01-kajGfmdu.js → Inbox01-BSel3biT.js} +1 -1
- package/dist/client/assets/{InfoCircle-B7kPa-uK.js → InfoCircle-C_qDfuPt.js} +1 -1
- package/dist/client/assets/{Key01-0xecwuKO.js → Key01-C0E2RPRQ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C4nMNNfv.js → LinkExternal01-DOmS5L3U.js} +1 -1
- package/dist/client/assets/{List-ByZGjPSY.js → List-ChoGNa5p.js} +1 -1
- package/dist/client/assets/{Loading01--Y6ftcI7.js → Loading01-B5HJTtc0.js} +1 -1
- package/dist/client/assets/{Lock01-C7DAs7f3.js → Lock01-Y_aOvYlB.js} +1 -1
- package/dist/client/assets/{Pin01-ObsXtXi2.js → Pin01-fdYVvyiL.js} +1 -1
- package/dist/client/assets/{Play-LyvaXst4.js → Play-CceuauhQ.js} +1 -1
- package/dist/client/assets/{Plus-Ce4oU7HM.js → Plus-CRPlP_jA.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Cc08L92a.js → RefreshCcw01-BrLEfK43.js} +1 -1
- package/dist/client/assets/{RefreshCw01-DijkWVqd.js → RefreshCw01-DDRYQqjd.js} +1 -1
- package/dist/client/assets/{Rows03--Bm4gTvZ.js → Rows03-CvkNcOMJ.js} +1 -1
- package/dist/client/assets/{Save01-DoggmsXz.js → Save01-CuPUo8En.js} +1 -1
- package/dist/client/assets/{SearchMd-BnYzQAB0.js → SearchMd-DBdGvvkJ.js} +1 -1
- package/dist/client/assets/{Settings01-y_jeefTl.js → Settings01-BNTi5NiU.js} +1 -1
- package/dist/client/assets/{Shield01-BQ7ipScZ.js → Shield01-D2uet_XZ.js} +1 -1
- package/dist/client/assets/{Terminal-DZyEEobY.js → Terminal-XYm-55WZ.js} +1 -1
- package/dist/client/assets/{Tool01-CuXVktq5.js → Tool01-BNr1hCcu.js} +1 -1
- package/dist/client/assets/{Trash01-BwnNMUFV.js → Trash01-dBw88Tyb.js} +1 -1
- package/dist/client/assets/{Upload01-M05wSbl7.js → Upload01-BqShC51I.js} +1 -1
- package/dist/client/assets/{Users03-BDPWVua4.js → Users03-B_27GBWC.js} +1 -1
- package/dist/client/assets/{XCircle-JFesGOai.js → XCircle-DeSD2Nme.js} +1 -1
- package/dist/client/assets/{XClose-DV5l0lHB.js → XClose-Dm4uRTid.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-CPpxf9jy.js → agent-connections-preview-CFxXMoZI.js} +1 -1
- package/dist/client/assets/{agent-detail-DpaeQWF8.js → agent-detail-BGwIE9w0.js} +1 -1
- package/dist/client/assets/{agents-BlW5txqe.js → agents-DGXN72x8.js} +1 -1
- package/dist/client/assets/{alert-dialog-JQIs_CV4.js → alert-dialog-YO7F1UnW.js} +1 -1
- package/dist/client/assets/{auth-catchall-CXT7xW9a.js → auth-catchall-BFjwVkbi.js} +1 -1
- package/dist/client/assets/{avatar-DJffUECx.js → avatar-CXlAe-d0.js} +1 -1
- package/dist/client/assets/{badge-BIDbSYKn.js → badge-HG4Wd9Mh.js} +1 -1
- package/dist/client/assets/{binder-B_ndWiav.js → binder-gZKFqPm8.js} +1 -1
- package/dist/client/assets/{breadcrumb-BPLHB1oF.js → breadcrumb-CyS88-Ut.js} +1 -1
- package/dist/client/assets/{button-CNk0sRlZ.js → button-CVYD_l4f.js} +1 -1
- package/dist/client/assets/{card-DaYGqqz2.js → card-BESAH6x0.js} +1 -1
- package/dist/client/assets/{checkbox-KNR3ymK4.js → checkbox-CZ-w9z-K.js} +1 -1
- package/dist/client/assets/{circle-alert-C6Czw81H.js → circle-alert-DxKlPZa9.js} +1 -1
- package/dist/client/assets/{collection-detail-Dn6wgQhT.js → collection-detail-CQaDTYng.js} +1 -1
- package/dist/client/assets/{collection-tab-BczUkksO.js → collection-tab-C6CvbFAN.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-hOpFlxjN.js → collection-table-wrapper-DHsLzzwx.js} +1 -1
- package/dist/client/assets/{collection-tabs-BPTWuBSt.js → collection-tabs-D7dYSph2.js} +1 -1
- package/dist/client/assets/{command-C7VQ1Qye.js → command-rnfIyzV8.js} +1 -1
- package/dist/client/assets/{connect-CrNo-R6D.js → connect-CY43AJJb.js} +1 -1
- package/dist/client/assets/{connection-card-DGAckMqm.js → connection-card-BIBvjyy9.js} +1 -1
- package/dist/client/assets/{connection-detail-FYat_nJD.js → connection-detail-BSMfitiZ.js} +1 -1
- package/dist/client/assets/{connections-CLBr3EO4.js → connections-CFWhXoRb.js} +1 -1
- package/dist/client/assets/{constants-DYb82Fm9.js → constants-C7Ec6iJ9.js} +1 -1
- package/dist/client/assets/constants-D_v8WsQi.js +1 -0
- package/dist/client/assets/{create-organization-dialog-CT4Sgn20.js → create-organization-dialog-CgdOhXMu.js} +1 -1
- package/dist/client/assets/{create-project-dialog-PxtVIu0l.js → create-project-dialog-C81f_5Rj.js} +1 -1
- package/dist/client/assets/{dialog-80D7tuCu.js → dialog-VPGAGt8b.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CFF9_9Xu.js → dropdown-menu-CFgggJR1.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-d42IXtaT.js → dynamic-plugin-layout-ZnFuNGso.js} +1 -1
- package/dist/client/assets/{empty-state-Db4VSc2H.js → empty-state-B_yeI3-8.js} +1 -1
- package/dist/client/assets/{empty-state-e08Q0bv6.js → empty-state-J0iNaH6o.js} +1 -1
- package/dist/client/assets/{env-vars-editor-Bq8VU10b.js → env-vars-editor-BuXgYNmv.js} +1 -1
- package/dist/client/assets/{error-boundary-CjahcPRs.js → error-boundary-Cw9mogkc.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CyFhebHJ.js → extract-connection-data-E0weV85e.js} +1 -1
- package/dist/client/assets/{file-browser-CJCuCJea.js → file-browser-sCHL9A-l.js} +2 -2
- package/dist/client/assets/{form-BiaaECZX.js → form-BVo4Hzsi.js} +1 -1
- package/dist/client/assets/{grid-view-T22OL-uB.js → grid-view-guLzaDp8.js} +1 -1
- package/dist/client/assets/{home-C7HmSFiA.js → home-DOrtkQav.js} +1 -1
- package/dist/client/assets/{index-BxB6u65Y.js → index-C1U9FLFs.js} +1 -1
- package/dist/client/assets/{index-RH--xyas.js → index-CEFVWh1V.js} +1 -1
- package/dist/client/assets/{index-BFDFdsAY.js → index-CdvbUeMY.js} +1 -1
- package/dist/client/assets/{index-ChbtHbtz.js → index-Cgpi8OLK.js} +1 -1
- package/dist/client/assets/{index-BYe7EgF4.js → index-CsDBbm_y.js} +1 -1
- package/dist/client/assets/{index-BxjV86mJ.js → index-D3i0JpVn.js} +1 -1
- package/dist/client/assets/{index-C9r-SRQ_.js → index-D6jt3Kr_.js} +1 -1
- package/dist/client/assets/{index-oMshRPQh.js → index-DORq2iDV.js} +3 -3
- package/dist/client/assets/{infiniteQueryObserver-BJHzqHxf.js → infiniteQueryObserver-dJrk4KCF.js} +1 -1
- package/dist/client/assets/{input-B19ythGH.js → input-Bh5KX8XE.js} +1 -1
- package/dist/client/assets/{integration-icon-CS_XsfNm.js → integration-icon-BdGEh9QA.js} +1 -1
- package/dist/client/assets/{label-DH4CmEmu.js → label-DyOg7nzh.js} +1 -1
- package/dist/client/assets/{layout-DS129xlt.js → layout-BHHG3i-Y.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DUciQQyZ.js → localstorage-keys-CCux6fjT.js} +1 -1
- package/dist/client/assets/{login-Bj6DQGvF.js → login-CL6ai-T1.js} +1 -1
- package/dist/client/assets/{markdown-Npp5iKZK.js → markdown-CboA12Nd.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BJJuLzd_.js → mcp-oauth-BcBmIJkz.js} +1 -1
- package/dist/client/assets/{mcp-server-card-BrjMMeLp.js → mcp-server-card-oeessZZx.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-CaFbtG7s.js → mcp-server-detail-ilOg-k_t.js} +2 -2
- package/dist/client/assets/{members-D-KY0PIe.js → members-CxeJ0faa.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-edit-ChY-N1hh.js → monitoring-dashboard-edit-D3Zv5EnU.js} +1 -1
- package/dist/client/assets/{monitoring-dashboard-view-COGP4As8.js → monitoring-dashboard-view-i2EoV7O7.js} +1 -1
- package/dist/client/assets/{monitoring-CJOpVjFN.js → monitoring-pq6iP8IO.js} +1 -1
- package/dist/client/assets/{oauth-callback-CoQvJBNR.js → oauth-callback-mruvU8_Q.js} +1 -1
- package/dist/client/assets/{page-C-f_DUqs.js → page-MU3ZrOYG.js} +1 -1
- package/dist/client/assets/{page-D0_W1Uz0.js → page-SUnFSZe2.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BgLOnXwy.js → plugin-empty-state-BGVXlN99.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-DQk2d_nM.js → plugin-empty-state-FKGErfc3.js} +1 -1
- package/dist/client/assets/{plugin-header-ByU4DFgn.js → plugin-header-AzvPppMw.js} +1 -1
- package/dist/client/assets/{plugin-header-3ugld2cB.js → plugin-header-CYSQypax.js} +1 -1
- package/dist/client/assets/{popover-BG2J0TX6.js → popover-DbRkjXcJ.js} +1 -1
- package/dist/client/assets/{project-layout-Zl64olNh.js → project-layout-Xzi8hHvW.js} +1 -1
- package/dist/client/assets/{projects-list-CMiosPh6.js → projects-list-BSBHGQjq.js} +1 -1
- package/dist/client/assets/{ranking-layout-CLs03Urj.js → ranking-layout-BiV09gtO.js} +1 -1
- package/dist/client/assets/{readme-viewer-CdlX_qwK.js → readme-viewer-CIbkQahX.js} +1 -1
- package/dist/client/assets/{registry-layout-ppCaNZun.js → registry-layout-D1GPWf6h.js} +1 -1
- package/dist/client/assets/{registry-utils-qgDFHo7G.js → registry-utils-DbEnt6lf.js} +1 -1
- package/dist/client/assets/{reports-layout-D-0sIhsD.js → reports-layout-C4UCazNt.js} +1 -1
- package/dist/client/assets/{reset-password-ZIrbHxIp.js → reset-password-BW5fMj5D.js} +1 -1
- package/dist/client/assets/{resizable-CjkjPslU.js → resizable-CHiJMo1_.js} +1 -1
- package/dist/client/assets/{save-actions-DKCPI5dX.js → save-actions-Bkd7XN5j.js} +1 -1
- package/dist/client/assets/{scroll-area-CW_9MLgy.js → scroll-area-B27Z4ywl.js} +1 -1
- package/dist/client/assets/{select-DUdkFtXP.js → select-jAphy_-Y.js} +1 -1
- package/dist/client/assets/{shell-layout-GwOOM4Z2.js → shell-layout-BNjQGY2b.js} +1 -1
- package/dist/client/assets/{skeleton-B8qxiZB7.js → skeleton-B-gUpTJK.js} +1 -1
- package/dist/client/assets/{spinner-3jHh--rP.js → spinner-CTHwgDFW.js} +1 -1
- package/dist/client/assets/{store-invite-B7fjc3G-.js → store-invite-uV1ADm6S.js} +1 -1
- package/dist/client/assets/{switch-CZ_WPTQh.js → switch-Bz-UbNfe.js} +1 -1
- package/dist/client/assets/{table-DnWTjivw.js → table-oUu9PtOj.js} +1 -1
- package/dist/client/assets/{tasks-CMXsmzI_.js → tasks-BbgjSYKX.js} +1 -1
- package/dist/client/assets/{textarea-BAMKNzO6.js → textarea-B4df3c-A.js} +1 -1
- package/dist/client/assets/{time-range-picker-DTuVQlDF.js → time-range-picker-CYONyEzg.js} +1 -1
- package/dist/client/assets/{toggle-group-Dlha13jB.js → toggle-group-DKcaeoWn.js} +1 -1
- package/dist/client/assets/{tools-list-BES6NYei.js → tools-list-sjdDWTmZ.js} +1 -1
- package/dist/client/assets/{tooltip-Dx34_lZB.js → tooltip-4z3Dj1Ic.js} +1 -1
- package/dist/client/assets/{topbar-portal-DBsfplIq.js → topbar-portal-LoTA5AY0.js} +1 -1
- package/dist/client/assets/{typewriter-title-DRXcGEiw.js → typewriter-title-DKa5565h.js} +1 -1
- package/dist/client/assets/{use-binding-CXOZP40D.js → use-binding-JQRdy56n.js} +1 -1
- package/dist/client/assets/{use-connection-ByNXZCyC.js → use-connection-C7Ykn5We.js} +1 -1
- package/dist/client/assets/{use-copy-ByAoRwAa.js → use-copy-BUr9JgMZ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Cyzu3iBV.js → use-create-virtual-mcp-CfhM_SAz.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-CBH6GOt5.js → use-deco-chat-open-uiDqNCbm.js} +7 -7
- package/dist/client/assets/{use-install-from-registry-SYVtY8Vz.js → use-install-from-registry-CDxw1GCo.js} +1 -1
- package/dist/client/assets/{use-list-state-CpSf7RjB.js → use-list-state-D5uNQEJf.js} +1 -1
- package/dist/client/assets/{use-llm-DXpJZKel.js → use-llm-jw2BS-HP.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BXRKlqcL.js → use-mcp-prompts-BIWdwpGe.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Ds9wDxdw.js → use-mcp-tools-BPBUJeNd.js} +1 -1
- package/dist/client/assets/{use-mobile-CTdpzBBe.js → use-mobile-aOwHFgFs.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CoxLJeRz.js → use-organization-settings-DMr0awSz.js} +1 -1
- package/dist/client/assets/{use-project-BhSsBpip.js → use-project-DfYNa3t-.js} +1 -1
- package/dist/client/assets/{use-settings-modal-DgkcV04c.js → use-settings-modal-Cluj4Fcl.js} +1 -1
- package/dist/client/assets/{use-view-mode-B64Zq8Zo.js → use-view-mode-BKl_7npX.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BwaELg2X.js → use-virtual-mcp-ZHBbhgI3.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-ehcPTJqP.js +1 -0
- package/dist/client/assets/{useMutation-CbaEZADR.js → useMutation-DIYvmP8t.js} +1 -1
- package/dist/client/assets/useQuery-psr46-dB.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-FMCIrxas.js +1 -0
- package/dist/client/assets/{workflow-D886lDPe.js → workflow-D02l7cpr.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +61 -61
- package/dist/server/migrate.js +2 -2
- package/dist/server/server.js +59 -59
- package/package.json +1 -1
- package/dist/client/assets/constants-Dbm9w_Pk.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CZKf72tl.js +0 -1
- package/dist/client/assets/useQuery-Bv1aa00L.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-X4wnVmzI.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as b,c as y,j as s,u as ne,d as ae,t as ee}from"./index-oMshRPQh.js";import{V as ce,C as j}from"./index-RH--xyas.js";import{T as me,i as de,a as fe,t as pe}from"./typewriter-title-DRXcGEiw.js";import{E as ue}from"./error-boundary-CjahcPRs.js";import{u as Y}from"./use-deco-chat-open-CBH6GOt5.js";import{I as te}from"./integration-icon-CS_XsfNm.js";import{P as he,a as xe,b as je}from"./popover-BG2J0TX6.js";import{S as X}from"./skeleton-B8qxiZB7.js";import{c as se,B as H}from"./button-CNk0sRlZ.js";import{i as ge,d as be}from"./constants-DYb82Fm9.js";import{b as ye}from"./use-virtual-mcp-BwaELg2X.js";import{i as Ne}from"./ChevronRight-CJSnSo8F.js";import{t as ie}from"./Users03-BDPWVua4.js";import{P as A}from"./index-BFDFdsAY.js";import{a as U,b as J,T as Q}from"./tooltip-Dx34_lZB.js";import{c as _e}from"./Pin01-ObsXtXi2.js";import{s as Se}from"./Plus-Ce4oU7HM.js";import"./spinner-3jHh--rP.js";import"./use-mcp-prompts-BXRKlqcL.js";import"./useQuery-Bv1aa00L.js";import"./dialog-80D7tuCu.js";import"./form-BiaaECZX.js";import"./label-DH4CmEmu.js";import"./input-B19ythGH.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-DYbG-VRe.js";import"./ChevronDown-B8cLKcdN.js";import"./Edit01-uKNaELqT.js";import"./XCircle-JFesGOai.js";import"./AlertCircle-SfldKCWY.js";import"./AlertTriangle-NTAnpffh.js";import"./ArrowLeft-BcKpcjgF.js";import"./use-copy-ByAoRwAa.js";import"./badge-BIDbSYKn.js";import"./Check-BZR8Q9Pv.js";import"./Code01-YBrb3jgn.js";import"./SearchMd-BnYzQAB0.js";import"./use-create-virtual-mcp-Cyzu3iBV.js";import"./marked.esm-BaswSlok.js";import"./markdown-Npp5iKZK.js";import"./Copy01-CCUY_RvG.js";import"./tools-list-BES6NYei.js";import"./collection-table-wrapper-hOpFlxjN.js";import"./dropdown-menu-CFF9_9Xu.js";import"./Grid01-z890yGfK.js";import"./List-ByZGjPSY.js";import"./table-DnWTjivw.js";import"./empty-state-e08Q0bv6.js";import"./Loading01--Y6ftcI7.js";import"./card-DaYGqqz2.js";import"./Eye-B_GtpEGN.js";import"./Globe02-B6RVPmqK.js";import"./RefreshCw01-DijkWVqd.js";import"./layout-DS129xlt.js";import"./use-connection-ByNXZCyC.js";import"./useMutation-CbaEZADR.js";import"./generate-id-Dyweu44Y.js";import"./Clock-B6KbV1-B.js";import"./Trash01-BwnNMUFV.js";import"./use-llm-DXpJZKel.js";import"./use-binding-CXOZP40D.js";import"./binder-B_ndWiav.js";import"./localstorage-keys-DUciQQyZ.js";import"./select-DUdkFtXP.js";import"./File06-eLWDalt5.js";import"./Image01-nUynjYjD.js";import"./RefreshCcw01-Cc08L92a.js";import"./Settings01-y_jeefTl.js";import"./useSuspenseInfiniteQuery-X4wnVmzI.js";import"./infiniteQueryObserver-BJHzqHxf.js";import"./Container-owj5RAIr.js";import"./use-mobile-CTdpzBBe.js";const re=({size:e=24,color:t="currentColor",...i})=>b.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},b.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));re.displayName="Share07";function ve(e){const t=y.c(15),{agent:i}=e,{setVirtualMcpId:u}=Y();let l;t[0]!==i.id||t[1]!==u?(l=()=>{u(i.id)},t[0]=i.id,t[1]=u,t[2]=l):l=t[2];const r=l;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const d=`Select agent ${i.title}`;let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ie,{size:20}),t[4]=o):o=t[4];let c;t[5]!==i.icon||t[6]!==i.title?(c=s.jsx(te,{icon:i.icon,name:i.title,fallbackIcon:o}),t[5]=i.icon,t[6]=i.title,t[7]=c):c=t[7];let n;t[8]!==i.title?(n=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=n):n=t[9];let a;return t[10]!==r||t[11]!==d||t[12]!==c||t[13]!==n?(a=s.jsxs("button",{type:"button",onClick:r,className:m,"aria-label":d,children:[c,n]}),t[10]=r,t[11]=d,t[12]=c,t[13]=n,t[14]=a):a=t[14],a}function Ce(e){const t=y.c(14),{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:l}=e,[r,m]=b.useState(!1),d=b.useRef(null);let o,c;t[0]!==r?(o=()=>{r&&setTimeout(()=>{d.current?.focus()},0)},c=[r],t[0]=r,t[1]=o,t[2]=c):(o=t[1],c=t[2]),b.useEffect(o,c);let n;t[3]!==l?(n=N=>{l(N),m(!1)},t[3]=l,t[4]=n):n=t[4];const a=n;let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=f):f=t[5];let p;t[6]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(he,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(Ne,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=p):p=t[6];let h;t[7]!==a||t[8]!==u||t[9]!==i?(h=s.jsx(xe,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ce,{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:a,searchInputRef:d})}),t[7]=a,t[8]=u,t[9]=i,t[10]=h):h=t[10];let g;return t[11]!==r||t[12]!==h?(g=s.jsxs(je,{open:r,onOpenChange:m,children:[p,h]}),t[11]=r,t[12]=h,t[13]=g):g=t[13],g}function we(){const e=y.c(20),t=ye(),{selectedVirtualMcp:i,setVirtualMcpId:u}=Y();let l,r,m,d,o,c;if(e[0]!==t){o=Symbol.for("react.early_return_sentinel");e:{const h=t.filter(Te).slice(0,6);if(h.length===0){o=null;break e}c=t.map(ze),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=d):d=e[7],l="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",r=h.map(ke)}e[0]=t,e[1]=l,e[2]=r,e[3]=m,e[4]=d,e[5]=o,e[6]=c}else l=e[1],r=e[2],m=e[3],d=e[4],o=e[5],c=e[6];if(o!==Symbol.for("react.early_return_sentinel"))return o;const n=i?.id??null;let a;e[8]!==u||e[9]!==n||e[10]!==c?(a=s.jsx(Ce,{virtualMcps:c,selectedVirtualMcpId:n,onVirtualMcpChange:u}),e[8]=u,e[9]=n,e[10]=c,e[11]=a):a=e[11];let f;e[12]!==l||e[13]!==r||e[14]!==a?(f=s.jsxs("div",{className:l,children:[r,a]}),e[12]=l,e[13]=r,e[14]=a,e[15]=f):f=e[15];let p;return e[16]!==m||e[17]!==d||e[18]!==f?(p=s.jsxs("div",{className:m,children:[d,f]}),e[16]=m,e[17]=d,e[18]=f,e[19]=p):p=e[19],p}function ke(e){return s.jsx(ve,{agent:e},e.id??"default")}function ze(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function Te(e){return e.id!==null&&!ge(e.id)}function Me(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(X,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(Ie)})]}),e[1]=i):i=e[1],i}function Ie(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(X,{className:"size-6 rounded-md shrink-0"}),s.jsx(X,{className:"h-4 w-full"})]},t)}function Pe(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(b.Suspense,{fallback:s.jsx(Me,{}),children:s.jsx(we,{})}),e[0]=t):t=e[0],t}function $e(){const e=new Date().getHours();return e>=5&&e<12?"Morning":e>=12&&e<17?"Afternoon":e>=17&&e<22?"Evening":"Night"}function Ee(){const e=y.c(61),{org:t}=ne(),{data:i}=ae.useSession(),{modelsConnections:u,isChatEmpty:l,activeThreadId:r,createThread:m,switchToThread:d,threads:o,selectedVirtualMcp:c}=Y();let n;if(e[0]!==r||e[1]!==o){let x;e[3]!==r?(x=oe=>oe.id===r,e[3]=r,e[4]=x):x=e[4],n=o.find(x),e[0]=r,e[1]=o,e[2]=n}else n=e[2];const a=n,[f,p]=b.useState(!1);let h;e[5]!==i?.user?.name?(h=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=h):h=e[6];const g=h;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=$e(),e[7]=N):N=e[7];const le=N;let L;e[8]!==t.id?(L=be(t.id),e[8]=t.id,e[9]=L):L=e[9];const R=c??L;if(u.length===0){let x;return e[10]!==t?(x=s.jsx("div",{className:"flex flex-col size-full bg-background items-center justify-center",children:s.jsx(j.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=x):x=e[11],x}let _;e[12]!==a?(_=a?.title&&s.jsx(me,{text:a.title,className:"text-sm font-medium text-foreground"}),e[12]=a,e[13]=_):_=e[13];let S;e[14]!==_?(S=s.jsx(A.Header.Left,{className:"gap-2",children:_}),e[14]=_,e[15]=S):S=e[15];let v;e[16]!==m?(v=()=>m(),e[16]=m,e[17]=v):v=e[17];let B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Se,{size:16}),e[18]=B):B=e[18];let C;e[19]!==l||e[20]!==v?(C=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:v,disabled:l,"aria-label":"New chat",children:B})}),e[19]=l,e[20]=v,e[21]=C):C=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(J,{children:"New chat"}),e[22]=O):O=e[22];let w;e[23]!==C?(w=s.jsxs(Q,{children:[C,O]}),e[23]=C,e[24]=w):w=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=()=>p(!0),e[25]=D):D=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs(Q,{children:[s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:D,"aria-label":"Chat history",children:s.jsx(de,{size:16})})}),s.jsx(J,{children:"Chat history"})]}),e[26]=F):F=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(_e,{size:16}),e[27]=W):W=e[27];let k;e[28]!==l?(k=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ae,disabled:l,"aria-label":"Pin chat",children:W})}),e[28]=l,e[29]=k):k=e[29];let Z;e[30]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(J,{children:"Pin chat"}),e[30]=Z):Z=e[30];let z;e[31]!==k?(z=s.jsxs(Q,{children:[k,Z]}),e[31]=k,e[32]=z):z=e[32];let q;e[33]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(re,{size:16}),e[33]=q):q=e[33];let T;e[34]!==l?(T=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ve,disabled:l,"aria-label":"Share chat",children:q})}),e[34]=l,e[35]=T):T=e[35];let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(J,{children:"Share chat"}),e[36]=G):G=e[36];let M;e[37]!==T?(M=s.jsxs(Q,{children:[T,G]}),e[37]=T,e[38]=M):M=e[38];let I;e[39]!==w||e[40]!==z||e[41]!==M?(I=s.jsxs(A.Header.Right,{className:"gap-1",children:[w,F,z,M]}),e[39]=w,e[40]=z,e[41]=M,e[42]=I):I=e[42];let P;e[43]!==I||e[44]!==S?(P=s.jsxs(A.Header,{className:"flex-none z-10 bg-background",children:[S,I]}),e[43]=I,e[44]=S,e[45]=P):P=e[45];let $;e[46]!==R||e[47]!==l||e[48]!==g?($=l?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(te,{icon:R.icon,name:R.title,size:"md",fallbackIcon:s.jsx(ie,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-lg font-medium text-foreground",children:[le," ",g,","]}),s.jsx("p",{className:"text-base text-muted-foreground opacity-50 mb-0",children:"What are we building today?"})]}),s.jsx("div",{className:"w-full -mt-1",children:s.jsx(j.Input,{})}),s.jsx(j.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(Pe,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(j.Main,{children:s.jsx(j.Messages,{})}),s.jsx(j.Footer,{children:s.jsx(j.Input,{})})]}),e[46]=R,e[47]=l,e[48]=g,e[49]=$):$=e[49];let E;e[50]!==d?(E=async x=>{await d(x),p(!1)},e[50]=d,e[51]=E):E=e[51];let V;e[52]!==r||e[53]!==f||e[54]!==E||e[55]!==o?(V=s.jsx(fe,{open:f,onOpenChange:p,threads:o,activeThreadId:r,onThreadSelect:E}),e[52]=r,e[53]=f,e[54]=E,e[55]=o,e[56]=V):V=e[56];let K;return e[57]!==P||e[58]!==$||e[59]!==V?(K=s.jsxs(j,{children:[P,$,V]}),e[57]=P,e[58]=$,e[59]=V,e[60]=K):K=e[60],K}function Ve(){ee.info("Share feature coming soon")}function Ae(){ee.info("Pin feature coming soon")}function He(e){const t=y.c(14),{error:i,onRetry:u}=e,l=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(A.Header,{className:"flex-none",children:[s.jsx(A.Header.Left,{className:"gap-2"}),s.jsx(A.Header.Right,{className:"gap-1"})]}),t[0]=r):r=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(pe,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const d=l?"Unable to load models":"Something went wrong";let o;t[2]!==d?(o=s.jsx("h3",{className:"text-lg font-medium",children:d}),t[2]=d,t[3]=o):o=t[3];const c=l?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let n;t[4]!==c?(n=s.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=n):n=t[5];let a;t[6]!==o||t[7]!==n?(a=s.jsxs("div",{className:"space-y-2",children:[o,n]}),t[6]=o,t[7]=n,t[8]=a):a=t[8];let f;t[9]!==u?(f=s.jsx(H,{variant:"outline",onClick:u,children:"Try again"}),t[9]=u,t[10]=f):f=t[10];let p;return t[11]!==a||t[12]!==f?(p=s.jsxs(j,{children:[r,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,f]})})]}),t[11]=a,t[12]=f,t[13]=p):p=t[13],p}function rs(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ue,{fallback:Le,children:s.jsx(b.Suspense,{fallback:s.jsx(j.Skeleton,{}),children:s.jsx(Ee,{})})}),e[0]=t):t=e[0],t}function Le(e){const{error:t,resetError:i}=e;return s.jsx(He,{error:t,onRetry:i})}export{rs as default};
|
|
1
|
+
import{r as b,c as y,j as s,u as ne,d as ae,t as ee}from"./index-DORq2iDV.js";import{V as ce,C as j}from"./index-CEFVWh1V.js";import{T as me,i as de,a as fe,t as pe}from"./typewriter-title-DKa5565h.js";import{E as ue}from"./error-boundary-Cw9mogkc.js";import{u as Y}from"./use-deco-chat-open-uiDqNCbm.js";import{I as te}from"./integration-icon-BdGEh9QA.js";import{P as he,a as xe,b as je}from"./popover-DbRkjXcJ.js";import{S as X}from"./skeleton-B-gUpTJK.js";import{c as se,B as H}from"./button-CVYD_l4f.js";import{i as ge,d as be}from"./constants-C7Ec6iJ9.js";import{b as ye}from"./use-virtual-mcp-ZHBbhgI3.js";import{i as Ne}from"./ChevronRight-CtfDv6KV.js";import{t as ie}from"./Users03-B_27GBWC.js";import{P as A}from"./index-CdvbUeMY.js";import{a as U,b as J,T as Q}from"./tooltip-4z3Dj1Ic.js";import{c as _e}from"./Pin01-fdYVvyiL.js";import{s as Se}from"./Plus-CRPlP_jA.js";import"./spinner-CTHwgDFW.js";import"./use-mcp-prompts-BIWdwpGe.js";import"./useQuery-psr46-dB.js";import"./dialog-VPGAGt8b.js";import"./form-BVo4Hzsi.js";import"./label-DyOg7nzh.js";import"./input-Bh5KX8XE.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-D1Z3ZGMT.js";import"./ChevronDown-RHEfxY7t.js";import"./Edit01-CWgM245j.js";import"./XCircle-DeSD2Nme.js";import"./AlertCircle-Dcv7gp-I.js";import"./AlertTriangle-CoVws0Do.js";import"./ArrowLeft-D34bf2DR.js";import"./use-copy-BUr9JgMZ.js";import"./badge-HG4Wd9Mh.js";import"./Check-B6v8UYhw.js";import"./Code01-bk_rrtBU.js";import"./SearchMd-DBdGvvkJ.js";import"./use-create-virtual-mcp-CfhM_SAz.js";import"./marked.esm-BaswSlok.js";import"./markdown-CboA12Nd.js";import"./Copy01-Cm4pdmsu.js";import"./tools-list-sjdDWTmZ.js";import"./collection-table-wrapper-DHsLzzwx.js";import"./dropdown-menu-CFgggJR1.js";import"./Grid01-C8mqRkg1.js";import"./List-ChoGNa5p.js";import"./table-oUu9PtOj.js";import"./empty-state-J0iNaH6o.js";import"./Loading01-B5HJTtc0.js";import"./card-BESAH6x0.js";import"./Eye-CE7mKBNe.js";import"./Globe02-RkDxZVVj.js";import"./RefreshCw01-DDRYQqjd.js";import"./layout-BHHG3i-Y.js";import"./use-connection-C7Ykn5We.js";import"./useMutation-DIYvmP8t.js";import"./generate-id-Dyweu44Y.js";import"./Clock-Dd09ek7S.js";import"./Trash01-dBw88Tyb.js";import"./use-llm-jw2BS-HP.js";import"./use-binding-JQRdy56n.js";import"./binder-gZKFqPm8.js";import"./localstorage-keys-CCux6fjT.js";import"./select-jAphy_-Y.js";import"./File06-w124s0Yj.js";import"./Image01-DQLyBK8l.js";import"./RefreshCcw01-BrLEfK43.js";import"./Settings01-BNTi5NiU.js";import"./useSuspenseInfiniteQuery-FMCIrxas.js";import"./infiniteQueryObserver-dJrk4KCF.js";import"./Container-CMzzA9YA.js";import"./use-mobile-aOwHFgFs.js";const re=({size:e=24,color:t="currentColor",...i})=>b.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},b.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));re.displayName="Share07";function ve(e){const t=y.c(15),{agent:i}=e,{setVirtualMcpId:u}=Y();let l;t[0]!==i.id||t[1]!==u?(l=()=>{u(i.id)},t[0]=i.id,t[1]=u,t[2]=l):l=t[2];const r=l;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const d=`Select agent ${i.title}`;let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ie,{size:20}),t[4]=o):o=t[4];let c;t[5]!==i.icon||t[6]!==i.title?(c=s.jsx(te,{icon:i.icon,name:i.title,fallbackIcon:o}),t[5]=i.icon,t[6]=i.title,t[7]=c):c=t[7];let n;t[8]!==i.title?(n=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=n):n=t[9];let a;return t[10]!==r||t[11]!==d||t[12]!==c||t[13]!==n?(a=s.jsxs("button",{type:"button",onClick:r,className:m,"aria-label":d,children:[c,n]}),t[10]=r,t[11]=d,t[12]=c,t[13]=n,t[14]=a):a=t[14],a}function Ce(e){const t=y.c(14),{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:l}=e,[r,m]=b.useState(!1),d=b.useRef(null);let o,c;t[0]!==r?(o=()=>{r&&setTimeout(()=>{d.current?.focus()},0)},c=[r],t[0]=r,t[1]=o,t[2]=c):(o=t[1],c=t[2]),b.useEffect(o,c);let n;t[3]!==l?(n=N=>{l(N),m(!1)},t[3]=l,t[4]=n):n=t[4];const a=n;let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=se("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=f):f=t[5];let p;t[6]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(he,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(Ne,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=p):p=t[6];let h;t[7]!==a||t[8]!==u||t[9]!==i?(h=s.jsx(xe,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ce,{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:a,searchInputRef:d})}),t[7]=a,t[8]=u,t[9]=i,t[10]=h):h=t[10];let g;return t[11]!==r||t[12]!==h?(g=s.jsxs(je,{open:r,onOpenChange:m,children:[p,h]}),t[11]=r,t[12]=h,t[13]=g):g=t[13],g}function we(){const e=y.c(20),t=ye(),{selectedVirtualMcp:i,setVirtualMcpId:u}=Y();let l,r,m,d,o,c;if(e[0]!==t){o=Symbol.for("react.early_return_sentinel");e:{const h=t.filter(Te).slice(0,6);if(h.length===0){o=null;break e}c=t.map(ze),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=d):d=e[7],l="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",r=h.map(ke)}e[0]=t,e[1]=l,e[2]=r,e[3]=m,e[4]=d,e[5]=o,e[6]=c}else l=e[1],r=e[2],m=e[3],d=e[4],o=e[5],c=e[6];if(o!==Symbol.for("react.early_return_sentinel"))return o;const n=i?.id??null;let a;e[8]!==u||e[9]!==n||e[10]!==c?(a=s.jsx(Ce,{virtualMcps:c,selectedVirtualMcpId:n,onVirtualMcpChange:u}),e[8]=u,e[9]=n,e[10]=c,e[11]=a):a=e[11];let f;e[12]!==l||e[13]!==r||e[14]!==a?(f=s.jsxs("div",{className:l,children:[r,a]}),e[12]=l,e[13]=r,e[14]=a,e[15]=f):f=e[15];let p;return e[16]!==m||e[17]!==d||e[18]!==f?(p=s.jsxs("div",{className:m,children:[d,f]}),e[16]=m,e[17]=d,e[18]=f,e[19]=p):p=e[19],p}function ke(e){return s.jsx(ve,{agent:e},e.id??"default")}function ze(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function Te(e){return e.id!==null&&!ge(e.id)}function Me(){const e=y.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(X,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(Ie)})]}),e[1]=i):i=e[1],i}function Ie(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(X,{className:"size-6 rounded-md shrink-0"}),s.jsx(X,{className:"h-4 w-full"})]},t)}function Pe(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(b.Suspense,{fallback:s.jsx(Me,{}),children:s.jsx(we,{})}),e[0]=t):t=e[0],t}function $e(){const e=new Date().getHours();return e>=5&&e<12?"Morning":e>=12&&e<17?"Afternoon":e>=17&&e<22?"Evening":"Night"}function Ee(){const e=y.c(61),{org:t}=ne(),{data:i}=ae.useSession(),{modelsConnections:u,isChatEmpty:l,activeThreadId:r,createThread:m,switchToThread:d,threads:o,selectedVirtualMcp:c}=Y();let n;if(e[0]!==r||e[1]!==o){let x;e[3]!==r?(x=oe=>oe.id===r,e[3]=r,e[4]=x):x=e[4],n=o.find(x),e[0]=r,e[1]=o,e[2]=n}else n=e[2];const a=n,[f,p]=b.useState(!1);let h;e[5]!==i?.user?.name?(h=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=h):h=e[6];const g=h;let N;e[7]===Symbol.for("react.memo_cache_sentinel")?(N=$e(),e[7]=N):N=e[7];const le=N;let L;e[8]!==t.id?(L=be(t.id),e[8]=t.id,e[9]=L):L=e[9];const R=c??L;if(u.length===0){let x;return e[10]!==t?(x=s.jsx("div",{className:"flex flex-col size-full bg-background items-center justify-center",children:s.jsx(j.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=x):x=e[11],x}let _;e[12]!==a?(_=a?.title&&s.jsx(me,{text:a.title,className:"text-sm font-medium text-foreground"}),e[12]=a,e[13]=_):_=e[13];let S;e[14]!==_?(S=s.jsx(A.Header.Left,{className:"gap-2",children:_}),e[14]=_,e[15]=S):S=e[15];let v;e[16]!==m?(v=()=>m(),e[16]=m,e[17]=v):v=e[17];let B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Se,{size:16}),e[18]=B):B=e[18];let C;e[19]!==l||e[20]!==v?(C=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:v,disabled:l,"aria-label":"New chat",children:B})}),e[19]=l,e[20]=v,e[21]=C):C=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(J,{children:"New chat"}),e[22]=O):O=e[22];let w;e[23]!==C?(w=s.jsxs(Q,{children:[C,O]}),e[23]=C,e[24]=w):w=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=()=>p(!0),e[25]=D):D=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs(Q,{children:[s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:D,"aria-label":"Chat history",children:s.jsx(de,{size:16})})}),s.jsx(J,{children:"Chat history"})]}),e[26]=F):F=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(_e,{size:16}),e[27]=W):W=e[27];let k;e[28]!==l?(k=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ae,disabled:l,"aria-label":"Pin chat",children:W})}),e[28]=l,e[29]=k):k=e[29];let Z;e[30]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(J,{children:"Pin chat"}),e[30]=Z):Z=e[30];let z;e[31]!==k?(z=s.jsxs(Q,{children:[k,Z]}),e[31]=k,e[32]=z):z=e[32];let q;e[33]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(re,{size:16}),e[33]=q):q=e[33];let T;e[34]!==l?(T=s.jsx(U,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ve,disabled:l,"aria-label":"Share chat",children:q})}),e[34]=l,e[35]=T):T=e[35];let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(J,{children:"Share chat"}),e[36]=G):G=e[36];let M;e[37]!==T?(M=s.jsxs(Q,{children:[T,G]}),e[37]=T,e[38]=M):M=e[38];let I;e[39]!==w||e[40]!==z||e[41]!==M?(I=s.jsxs(A.Header.Right,{className:"gap-1",children:[w,F,z,M]}),e[39]=w,e[40]=z,e[41]=M,e[42]=I):I=e[42];let P;e[43]!==I||e[44]!==S?(P=s.jsxs(A.Header,{className:"flex-none z-10 bg-background",children:[S,I]}),e[43]=I,e[44]=S,e[45]=P):P=e[45];let $;e[46]!==R||e[47]!==l||e[48]!==g?($=l?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(te,{icon:R.icon,name:R.title,size:"md",fallbackIcon:s.jsx(ie,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-lg font-medium text-foreground",children:[le," ",g,","]}),s.jsx("p",{className:"text-base text-muted-foreground opacity-50 mb-0",children:"What are we building today?"})]}),s.jsx("div",{className:"w-full -mt-1",children:s.jsx(j.Input,{})}),s.jsx(j.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(Pe,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(j.Main,{children:s.jsx(j.Messages,{})}),s.jsx(j.Footer,{children:s.jsx(j.Input,{})})]}),e[46]=R,e[47]=l,e[48]=g,e[49]=$):$=e[49];let E;e[50]!==d?(E=async x=>{await d(x),p(!1)},e[50]=d,e[51]=E):E=e[51];let V;e[52]!==r||e[53]!==f||e[54]!==E||e[55]!==o?(V=s.jsx(fe,{open:f,onOpenChange:p,threads:o,activeThreadId:r,onThreadSelect:E}),e[52]=r,e[53]=f,e[54]=E,e[55]=o,e[56]=V):V=e[56];let K;return e[57]!==P||e[58]!==$||e[59]!==V?(K=s.jsxs(j,{children:[P,$,V]}),e[57]=P,e[58]=$,e[59]=V,e[60]=K):K=e[60],K}function Ve(){ee.info("Share feature coming soon")}function Ae(){ee.info("Pin feature coming soon")}function He(e){const t=y.c(14),{error:i,onRetry:u}=e,l=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(A.Header,{className:"flex-none",children:[s.jsx(A.Header.Left,{className:"gap-2"}),s.jsx(A.Header.Right,{className:"gap-1"})]}),t[0]=r):r=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(pe,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const d=l?"Unable to load models":"Something went wrong";let o;t[2]!==d?(o=s.jsx("h3",{className:"text-lg font-medium",children:d}),t[2]=d,t[3]=o):o=t[3];const c=l?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let n;t[4]!==c?(n=s.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=n):n=t[5];let a;t[6]!==o||t[7]!==n?(a=s.jsxs("div",{className:"space-y-2",children:[o,n]}),t[6]=o,t[7]=n,t[8]=a):a=t[8];let f;t[9]!==u?(f=s.jsx(H,{variant:"outline",onClick:u,children:"Try again"}),t[9]=u,t[10]=f):f=t[10];let p;return t[11]!==a||t[12]!==f?(p=s.jsxs(j,{children:[r,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,f]})})]}),t[11]=a,t[12]=f,t[13]=p):p=t[13],p}function rs(){const e=y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ue,{fallback:Le,children:s.jsx(b.Suspense,{fallback:s.jsx(j.Skeleton,{}),children:s.jsx(Ee,{})})}),e[0]=t):t=e[0],t}function Le(e){const{error:t,resetError:i}=e;return s.jsx(He,{error:t,onRetry:i})}export{rs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Q,r as U,u as re,K as oe,bx as we,j as t,b as me,O as de,d as Ie,by as Te,bz as ne,aD as Re}from"./index-oMshRPQh.js";import{P as X}from"./index-BFDFdsAY.js";import{B as Pe,a as ze,b as $e,c as ke}from"./breadcrumb-BPLHB1oF.js";import{i as ue}from"./AlertTriangle-NTAnpffh.js";import{i as fe}from"./FilterLines-BIs-2JsK.js";import{n as xe}from"./Inbox01-kajGfmdu.js";import{i as se}from"./Loading01--Y6ftcI7.js";import{s as ge}from"./RefreshCw01-DijkWVqd.js";import{i as pe}from"./SearchMd-BnYzQAB0.js";import{u as he}from"./useQuery-Bv1aa00L.js";import{u as Le}from"./useInfiniteQuery-CZKf72tl.js";import{a as Fe,f as Ee,b as Oe}from"./registry-utils-qgDFHo7G.js";import{u as je,W as Ke,a as _e,h as Ae,b as Me}from"./constants-DYb82Fm9.js";import{f as Be,g as ye,h as De}from"./use-connection-ByNXZCyC.js";import{s as Ge}from"./slugify-CEUa2lfQ.js";import{C as We,E as Ve}from"./empty-state-e08Q0bv6.js";import{M as ae}from"./mcp-server-card-BrjMMeLp.js";import{c as ie,B as Y}from"./button-CNk0sRlZ.js";import{I as qe}from"./input-B19ythGH.js";import{b as ve,P as be,a as Ne}from"./popover-BG2J0TX6.js";import{i as Ce}from"./Check-BZR8Q9Pv.js";import{t as Se}from"./ChevronDown-B8cLKcdN.js";import{s as te}from"./XClose-DV5l0lHB.js";import{s as Ue}from"./Plus-Ce4oU7HM.js";import{u as He}from"./use-binding-CXOZP40D.js";import{L as Je,u as Qe}from"./localstorage-keys-DUciQQyZ.js";import{E as Ye}from"./error-boundary-CjahcPRs.js";import"./use-mobile-CTdpzBBe.js";import"./tooltip-Dx34_lZB.js";import"./ChevronRight-CJSnSo8F.js";import"./infiniteQueryObserver-BJHzqHxf.js";import"./useMutation-CbaEZADR.js";import"./CheckVerified02-BJZjCOSF.js";import"./Globe02-B6RVPmqK.js";import"./Lock01-C7DAs7f3.js";import"./Terminal-DZyEEobY.js";import"./card-DaYGqqz2.js";import"./integration-icon-CS_XsfNm.js";import"./Container-owj5RAIr.js";import"./github-icon-Dp3wHhYE.js";import"./binder-B_ndWiav.js";function Ze(s,e){const r=Q.c(4),[l,m]=U.useState(s),n=U.useRef(null),o=U.useRef(!0);let c,a;return r[0]!==e||r[1]!==s?(c=()=>{if(o.current){o.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{m(s)},e),()=>{n.current&&clearTimeout(n.current)}},a=[s,e],r[0]=e,r[1]=s,r[2]=c,r[3]=a):(c=r[2],a=r[3]),U.useEffect(c,a),l}function Xe(s){const e=Q.c(14),r=U.useRef(null),l=`scroll-position:${s}`,m=U.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const o=n;let c;e[2]!==l?(c=()=>{if(m.current===l)return;const j=sessionStorage.getItem(l);if(j&&r.current){const S=Number.parseInt(j,10);r.current.scrollTop=S}m.current=l},e[2]=l,e[3]=c):c=e[3];const a=c;let g;e[4]!==a||e[5]!==l?(g=()=>{m.current!==l&&a()},e[4]=a,e[5]=l,e[6]=g):g=e[6];const I=g;let i;e[7]!==a||e[8]!==l?(i=j=>{r.current=j,j&&m.current!==l&&requestAnimationFrame(()=>{a()})},e[7]=a,e[8]=l,e[9]=i):i=e[9];const p=i;let d;return e[10]!==I||e[11]!==o||e[12]!==p?(d={scrollRef:p,saveScrollPosition:o,handleScroll:I},e[10]=I,e[11]=o,e[12]=p,e[13]=d):d=e[13],d}const et=24;function tt(s){const e=Q.c(54),{registryId:r,listToolName:l,filtersToolName:m,search:n}=s,{org:o}=re();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,g]=U.useState(c);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[1]=I):I=e[1];const[i,p]=U.useState(I),d=r||null;let j;e[2]!==o.id||e[3]!==d?(j={connectionId:d,orgId:o.id},e[2]=o.id,e[3]=d,e[4]=j):j=e[4];const S=je(j),R=!!m;let b;e[5]!==m||e[6]!==r?(b=oe.toolCall(r,m||"no-filters","{}"),e[5]=m,e[6]=r,e[7]=b):b=e[7];let N;e[8]!==S||e[9]!==m?(N=async()=>{if(!m)return{tags:[],categories:[]};const f=await S.callTool({name:m,arguments:{}});return f.structuredContent??f},e[8]=S,e[9]=m,e[10]=N):N=e[10];let P;e[11]!==b||e[12]!==N?(P={queryKey:b,queryFn:N,staleTime:36e5,retry:2},e[11]=b,e[12]=N,e[13]=P):P=e[13];const{data:z}=he(P);let h,C,$;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==i||e[18]!==a){const f=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:et,...a.length>0&&{tags:a},...i.length>0&&{categories:i},...f&&{where:f}},$=Le,C=oe.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=i,e[18]=a,e[19]=h,e[20]=C,e[21]=$}else h=e[19],C=e[20],$=e[21];let v;e[22]!==S||e[23]!==h||e[24]!==l?(v=async f=>{const{pageParam:Z}=f,le=Z?{...h,cursor:Z}:h,ee=await S.callTool({name:l,arguments:le});return ee.structuredContent??ee},e[22]=S,e[23]=h,e[24]=l,e[25]=v):v=e[25];let k;e[26]!==v||e[27]!==C?(k={queryKey:C,queryFn:v,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=v,e[27]=C,e[28]=k):k=e[28];const{data:w,fetchNextPage:x,hasNextPage:y,isFetchingNextPage:u,isFetching:T,isLoading:L,error:F}=$(k);let K;e:{if(!w?.pages||w.pages.length===0){K=null;break e}const f=w.pages[0];if(typeof f=="object"&&f!==null&&"totalCount"in f&&typeof f.totalCount=="number"){K=f.totalCount;break e}K=null}const _=K,E=w?.pages;let G;e[29]!==E?(G=Fe(E),e[29]=E,e[30]=G):G=e[30];const H=G;let W;e[31]!==n||e[32]!==i.length||e[33]!==a.length?(W=a.length>0||i.length>0||!!n?.trim(),e[31]=n,e[32]=i.length,e[33]=a.length,e[34]=W):W=e[34];const D=W,B=T&&!u&&!L&&D;let A;e[35]!==x||e[36]!==y||e[37]!==u?(A=()=>{y&&!u&&x()},e[35]=x,e[36]=y,e[37]=u,e[38]=A):A=e[38];const V=A,O=y??!1,M=R?z?.tags:void 0,q=R?z?.categories:void 0;let J;return e[39]!==D||e[40]!==T||e[41]!==u||e[42]!==B||e[43]!==L||e[44]!==H||e[45]!==F||e[46]!==V||e[47]!==i||e[48]!==a||e[49]!==O||e[50]!==M||e[51]!==q||e[52]!==_?(J={items:H,totalCount:_,hasMore:O,isLoadingMore:u,isFiltering:B,isInitialLoading:L,isFetching:T,error:F,loadMore:V,availableTags:M,availableCategories:q,selectedTags:a,selectedCategories:i,setSelectedTags:g,setSelectedCategories:p,hasActiveFilters:D},e[39]=D,e[40]=T,e[41]=u,e[42]=B,e[43]=L,e[44]=H,e[45]=F,e[46]=V,e[47]=i,e[48]=a,e[49]=O,e[50]=M,e[51]=q,e[52]=_,e[53]=J):J=e[53],J}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,l)=>l.count-r.count).slice(0,e)}function ce(s){const e=Q.c(52),{label:r,items:l,selectedItems:m,onToggle:n,onClear:o}=s,[c,a]=U.useState(""),[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N,P,z,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==g||e[4]!==c||e[5]!==m){const x=[...c?l.filter(E=>E.value.toLowerCase().includes(c.toLowerCase())):l].sort(lt);d=m.length,p=ve,P=g,z=I;let y;e[17]!==r?(y=t.jsx("span",{children:r}),e[17]=r,e[18]=y):y=e[18];let u;e[19]!==d?(u=d>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=u):u=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=T):T=e[21],e[22]!==u||e[23]!==y?(h=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[y,u,T]})}),e[22]=u,e[23]=y,e[24]=h):h=e[24],i=Ne,R="w-64 p-0",b="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let F;e[26]!==r?(F=r.toLowerCase(),e[26]=r,e[27]=F):F=e[27];const K=`Search ${F}...`;let _;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=E=>a(E.target.value),e[28]=_):_=e[28],e[29]!==c||e[30]!==K?(N=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,t.jsx(qe,{type:"text",placeholder:K,value:c,onChange:_,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=K,e[31]=N):N=e[31],j="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",S=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const G=m.includes(E.value);return t.jsxs("button",{onClick:()=>n(E.value),className:ie("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=g,e[4]=c,e[5]=m,e[6]=i,e[7]=p,e[8]=d,e[9]=j,e[10]=S,e[11]=R,e[12]=b,e[13]=N,e[14]=P,e[15]=z,e[16]=h}else i=e[6],p=e[7],d=e[8],j=e[9],S=e[10],R=e[11],b=e[12],N=e[13],P=e[14],z=e[15],h=e[16];let C;e[32]!==j||e[33]!==S?(C=t.jsx("div",{className:j,children:S}),e[32]=j,e[33]=S,e[34]=C):C=e[34];let $;e[35]!==r||e[36]!==o||e[37]!==d?($=d>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:o,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=o,e[37]=d,e[38]=$):$=e[38];let v;e[39]!==i||e[40]!==$||e[41]!==R||e[42]!==b||e[43]!==N||e[44]!==C?(v=t.jsxs(i,{className:R,align:b,children:[N,C,$]}),e[39]=i,e[40]=$,e[41]=R,e[42]=b,e[43]=N,e[44]=C,e[45]=v):v=e[45];let k;return e[46]!==p||e[47]!==v||e[48]!==P||e[49]!==z||e[50]!==h?(k=t.jsxs(p,{open:P,onOpenChange:z,children:[h,v]}),e[46]=p,e[47]=v,e[48]=P,e[49]=z,e[50]=h,e[51]=k):k=e[51],k}function lt(s,e){return e.count-s.count}function nt(s){const e=Q.c(67),{availableTags:r,availableCategories:l,selectedTags:m,selectedCategories:n,onTagChange:o,onCategoryChange:c}=s,a=r&&r.length>0||l&&l.length>0,g=m.length>0||n.length>0;if(!a)return null;let I;e[0]!==o||e[1]!==m?(I=y=>{m.includes(y)?o(m.filter(u=>u!==y)):o([...m,y])},e[0]=o,e[1]=m,e[2]=I):I=e[2];const i=I;let p;e[3]!==c||e[4]!==n?(p=y=>{n.includes(y)?c(n.filter(u=>u!==y)):c([...n,y])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const d=p;let j;e[6]!==c||e[7]!==o?(j=()=>{o([]),c([])},e[6]=c,e[7]=o,e[8]=j):j=e[8];const S=j;let R,b,N,P,z,h,C;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==o||e[13]!==n||e[14]!==m||e[15]!==d||e[16]!==i){const y=l?rt(l,6):[];R=n,b=m,C=new Set(y.map(ot)),z="flex items-center border-b border-border";let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(fe,{size:16})}),e[24]=u):u=e[24];let T;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==d?(T=l&&l.length>0&&t.jsx(ce,{label:"Categories",items:l,selectedItems:n,onToggle:d,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=d,e[29]=T):T=e[29];let L;e[30]!==r||e[31]!==o||e[32]!==m||e[33]!==i?(L=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:m,onToggle:i,onClear:()=>o([])}),e[30]=r,e[31]=o,e[32]=m,e[33]=i,e[34]=L):L=e[34],e[35]!==L||e[36]!==T?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[u,T,L]}),e[35]=L,e[36]=T,e[37]=h):h=e[37],N="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==n||e[39]!==d?(F=K=>{const _=n.includes(K.value);return t.jsxs("div",{onClick:()=>d(K.value),className:ie("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",_?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:K.value}),_&&t.jsx("span",{onClick:E=>{E.stopPropagation(),d(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},K.value)},e[38]=n,e[39]=d,e[40]=F):F=e[40],P=y.map(F),e[9]=l,e[10]=r,e[11]=c,e[12]=o,e[13]=n,e[14]=m,e[15]=d,e[16]=i,e[17]=R,e[18]=b,e[19]=N,e[20]=P,e[21]=z,e[22]=h,e[23]=C}else R=e[17],b=e[18],N=e[19],P=e[20],z=e[21],h=e[22],C=e[23];let $;if(e[41]!==R||e[42]!==d||e[43]!==C){let y;e[45]!==C?(y=T=>!C.has(T),e[45]=C,e[46]=y):y=e[46];let u;e[47]!==d?(u=T=>t.jsxs("div",{onClick:()=>d(T),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:T}),t.jsx("span",{onClick:L=>{L.stopPropagation(),d(T)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`cat-${T}`),e[47]=d,e[48]=u):u=e[48],$=R.filter(y).map(u),e[41]=R,e[42]=d,e[43]=C,e[44]=$}else $=e[44];let v;if(e[49]!==b||e[50]!==i){let y;e[52]!==i?(y=u=>t.jsxs("div",{onClick:()=>i(u),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:u}),t.jsx("span",{onClick:T=>{T.stopPropagation(),i(u)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`tag-${u}`),e[52]=i,e[53]=y):y=e[53],v=b.map(y),e[49]=b,e[50]=i,e[51]=v}else v=e[51];let k;e[54]!==S||e[55]!==g?(k=g&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:S,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(te,{size:14}),"Clear all"]}),e[54]=S,e[55]=g,e[56]=k):k=e[56];let w;e[57]!==k||e[58]!==N||e[59]!==P||e[60]!==$||e[61]!==v?(w=t.jsxs("div",{className:N,children:[P,$,v,k]}),e[57]=k,e[58]=N,e[59]=P,e[60]=$,e[61]=v,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==z||e[65]!==h?(x=t.jsxs("div",{className:z,children:[h,w]}),e[63]=w,e[64]=z,e[65]=h,e[66]=x):x=e[66],x}function ot(s){return s.value}function it(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=Q.c(55),{registryId:r,listToolName:l,filtersToolName:m,storePrivateOnly:n}=s,[o,c]=U.useState(""),a=Ze(o,300),g=me(),{org:I}=re(),{scrollRef:i,saveScrollPosition:p,handleScroll:d}=Xe(`store-discovery:${r}`);let j;e[0]!==a||e[1]!==m||e[2]!==l||e[3]!==r?(j={registryId:r,listToolName:l,filtersToolName:m,search:a},e[0]=a,e[1]=m,e[2]=l,e[3]=r,e[4]=j):j=e[4];const{items:S,hasMore:R,isLoadingMore:b,isInitialLoading:N,isFetching:P,error:z,loadMore:h,availableTags:C,availableCategories:$,selectedTags:v,selectedCategories:k,setSelectedTags:w,setSelectedCategories:x,hasActiveFilters:y}=tt(j);let u,T,L,F;if(e[5]!==a||e[6]!==P||e[7]!==N||e[8]!==S||e[9]!==o||e[10]!==n){const O=o?it(S,o):S;F=n?O.filter(dt):O,u=(o!==a||P)&&!N&&!!o,L=F.filter(at),T=F.filter(M=>!L.find(q=>q.id===M.id)),e[5]=a,e[6]=P,e[7]=N,e[8]=S,e[9]=o,e[10]=n,e[11]=u,e[12]=T,e[13]=L,e[14]=F}else u=e[11],T=e[12],L=e[13],F=e[14];const K=T;let _;e[15]!==g||e[16]!==I.slug||e[17]!==r||e[18]!==p?(_=O=>{p();const M=Ge(O.name||O.title||O.server?.title||""),q=typeof O.id=="string"&&O.id.includes("/"),J=typeof O.server?.name=="string"&&O.server.name.includes("/"),f=q&&!J?O.id:O.server?.name||O.id||"";g({to:"/$org/$project/store/$appName",params:{org:I.slug,project:de,appName:M},search:{registryId:r,serverName:f}})},e[15]=g,e[16]=I.slug,e[17]=r,e[18]=p,e[19]=_):_=e[19];const E=_;let G;e[20]!==d||e[21]!==R||e[22]!==b||e[23]!==h?(G=O=>{if(d(),!R||b)return;const M=O.currentTarget;M.scrollHeight-M.scrollTop-M.clientHeight<200&&h()},e[20]=d,e[21]=R,e[22]=b,e[23]=h,e[24]=G):G=e[24];const H=G;let W;e[25]!==u||e[26]!==o?(W=t.jsx(We,{value:o,onChange:c,placeholder:"Search for an MCP Server...",isSearching:u}),e[25]=u,e[26]=o,e[27]=W):W=e[27];let D;e[28]!==$||e[29]!==C||e[30]!==k||e[31]!==v||e[32]!==x||e[33]!==w?(D=t.jsx(nt,{availableTags:C,availableCategories:$,selectedTags:v,selectedCategories:k,onTagChange:w,onCategoryChange:x}),e[28]=$,e[29]=C,e[30]=k,e[31]=v,e[32]=x,e[33]=w,e[34]=D):D=e[34];let B;e[35]!==K||e[36]!==z||e[37]!==E||e[38]!==y||e[39]!==R||e[40]!==N||e[41]!==b||e[42]!==u||e[43]!==o||e[44]!==L||e[45]!==F?(B=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:z&&!N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),z.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:z.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:mt,children:[t.jsx(ge,{className:"size-4"}),"Try again"]})]}):N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):F.length===0&&!y?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):F.length===0&&y&&!o?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(fe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):o&&F.length===0&&!u?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[u&&F.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),L.length>0&&t.jsx(ae,{items:L,title:"Verified",onItemClick:E}),K.length>0&&t.jsx(ae,{items:K,title:L.length>0?"All":"",onItemClick:E}),R&&b&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(se,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[35]=K,e[36]=z,e[37]=E,e[38]=y,e[39]=R,e[40]=N,e[41]=b,e[42]=u,e[43]=o,e[44]=L,e[45]=F,e[46]=B):B=e[46];let A;e[47]!==H||e[48]!==i||e[49]!==B?(A=t.jsx("div",{ref:i,className:"flex-1 overflow-y-auto",onScroll:H,children:B}),e[47]=H,e[48]=i,e[49]=B,e[50]=A):A=e[50];let V;return e[51]!==W||e[52]!==D||e[53]!==A?(V=t.jsxs("div",{className:"flex flex-col h-full",children:[W,D,A]}),e[51]=W,e[52]=D,e[53]=A,e[54]=V):V=e[54],V}function mt(){return window.location.reload()}function dt(s){return s.is_public!==!0}function ut(s){const e=Q.c(11),{registryId:r,storePrivateOnly:l}=s,m=Be(r),n=m?.tools;let o;e[0]!==n?(o=Ee(n),e[0]=n,e[1]=o):o=e[1];const c=o;if(!c){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(xe,{className:"size-8 text-muted-foreground"})}),e[2]=d):d=e[2];let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[d,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=j):j=e[3],j}const a=m?.tools;let g;e[4]!==a?(g=Oe(a),e[4]=a,e[5]=g):g=e[5];const i=g||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==i?(p=t.jsx(ct,{registryId:r,listToolName:c,filtersToolName:i,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=i,e[10]=p):p=e[10],p}function ft(s){const e=Q.c(43),{registries:r,value:l,onValueChange:m,onAddWellKnown:n,wellKnownRegistries:o,placeholder:c}=s,a=c===void 0?"Select a registry...":c,[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N;if(e[0]!==g||e[1]!==a||e[2]!==r||e[3]!==l){let w;e[12]!==l?(w=y=>y.id===l,e[12]=l,e[13]=w):w=e[13];const x=r.find(w);p=ve,b=g,N=I,i=be,R=!0,d="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(j=ie("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=j):j=e[14],S=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:a}),e[0]=g,e[1]=a,e[2]=r,e[3]=l,e[4]=i,e[5]=p,e[6]=d,e[7]=j,e[8]=S,e[9]=R,e[10]=b,e[11]=N}else i=e[4],p=e[5],d=e[6],j=e[7],S=e[8],R=e[9],b=e[10],N=e[11];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=P):P=e[15];let z;e[16]!==d||e[17]!==j||e[18]!==S?(z=t.jsxs("button",{type:d,className:j,children:[S,P]}),e[16]=d,e[17]=j,e[18]=S,e[19]=z):z=e[19];let h;e[20]!==i||e[21]!==R||e[22]!==z?(h=t.jsx(i,{asChild:R,children:z}),e[20]=i,e[21]=R,e[22]=z,e[23]=h):h=e[23];let C;if(e[24]!==m||e[25]!==r||e[26]!==l){let w;e[28]!==m||e[29]!==l?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{m(x.id??x.name),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),l===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=m,e[29]=l,e[30]=w):w=e[30],C=r.map(w),e[24]=m,e[25]=r,e[26]=l,e[27]=C}else C=e[27];let $;e[31]!==n||e[32]!==o?($=o.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(w=>t.jsxs("button",{type:"button",onClick:()=>{n(w),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(Ue,{size:16})})]},w.id??w.title))]}),e[31]=n,e[32]=o,e[33]=$):$=e[33];let v;e[34]!==C||e[35]!==$?(v=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[C,$]}),e[34]=C,e[35]=$,e[36]=v):v=e[36];let k;return e[37]!==p||e[38]!==h||e[39]!==v||e[40]!==b||e[41]!==N?(k=t.jsxs(p,{open:b,onOpenChange:N,children:[h,v]}),e[37]=p,e[38]=h,e[39]=v,e[40]=b,e[41]=N,e[42]=k):k=e[42],k}function xt({registries:s,onConnected:e}){const r=ye(),{org:{slug:l}}=re(),{data:m}=Ie.useSession(),n=me(),[o,c]=U.useState(!1),a=s[0],g=async()=>{if(!(!a||!m?.user?.id)){c(!0);try{const i=await r.create.mutateAsync(a);e?.(i.id)}finally{c(!1)}}},I=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:de},search:{action:"create"}})};return t.jsx(Ve,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:g,disabled:o||!a,children:[a?.icon&&t.jsx("img",{src:a.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:I,children:"Custom Connection"})]})})}function gt(s){const e=Q.c(15),{error:r,onRetry:l,registryName:m}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=o):o=e[1];let c;e[2]!==m?(c=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:m})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=m,e[3]=c):c=e[3];let a;e[4]!==r?(a=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=a):a=e[5];let g;e[6]!==c||e[7]!==a?(g=t.jsxs("div",{className:"space-y-2",children:[o,c,a]}),e[6]=c,e[7]=a,e[8]=g):g=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ge,{className:"size-4"}),e[9]=I):I=e[9];let i;e[10]!==l?(i=t.jsxs(Y,{variant:"outline",size:"sm",onClick:l,children:[I,"Try again"]}),e[10]=l,e[11]=i):i=e[11];let p;return e[12]!==g||e[13]!==i?(p=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,g,i]}),e[12]=g,e[13]=i,e[14]=p):p=e[14],p}function ns(){const s=Q.c(49),{org:e,project:r}=re(),l=De(),m=ye(),n=Te(),o=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=He(l);let a;s[0]!==e.id?(a=Ke.SELF(e.id),s[0]=e.id,s[1]=a):a=s[1];const g=a,I=r.enabledPlugins,i=I==null||I.includes(ne),p=c.filter(f=>f.id!==g?!0:i);let d;s[2]!==g?(d=f=>f.id===g,s[2]=g,s[3]=d):d=s[3];const j=p.some(d);let S;s[4]!==e.id?(S={connectionId:_e,orgId:e.id},s[4]=e.id,s[5]=S):S=s[5];const R=je(S);let b;s[6]!==r.id||s[7]!==R?(b=async()=>{const f=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ne}});return f.structuredContent??f},s[6]=r.id,s[7]=R,s[8]=b):b=s[8];const{data:N}=he({queryKey:oe.projectPluginConfig(r.id??"",ne),queryFn:b,enabled:j&&!!r.id,staleTime:6e4}),P=N?.config?.settings;let z;s[9]!==P||s[10]!==g?(z=f=>f.id===g&&P?{id:f.id,name:P.registryName||f.title,icon:P.registryIcon||f.icon||void 0}:{id:f.id,name:f.title,icon:f.icon||void 0},s[9]=P,s[10]=g,s[11]=z):z=s[11];const h=p.map(z);let C;s[12]!==e.slug?(C=Je.selectedRegistry(e.slug),s[12]=e.slug,s[13]=C):C=s[13];const[$,v]=Qe(C,ht);let k;s[14]!==$?(k=f=>f.id===$,s[14]=$,s[15]=k):k=s[15];const x=p.find(k)?.id||p[0]?.id||"",y=x===g&&P?.storePrivateOnly===!0;let u;s[16]!==e.id?(u=Ae(e.id),s[16]=e.id,s[17]=u):u=s[17];let T;s[18]!==u?(T=[u],s[18]=u,s[19]=T):T=s[19];const L=T;let F;s[20]===Symbol.for("react.memo_cache_sentinel")?(F=[Me()],s[20]=F):F=s[20];const K=F;let _;s[21]!==m.create||s[22]!==v?(_=async f=>{const Z=await m.create.mutateAsync(f);v(Z.id)},s[21]=m.create,s[22]=v,s[23]=_):_=s[23];const E=_,G=new Set(p.map(pt)),H=L.filter(f=>f.id&&!G.has(f.id)),W=K.filter(f=>f.id&&!G.has(f.id));if(o){let f;return s[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Re,{}),s[24]=f):f=s[24],f}let D;s[25]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X.Header.Left,{children:t.jsx(Pe,{children:t.jsx(ze,{children:t.jsx($e,{children:t.jsx(ke,{children:"Store"})})})})}),s[25]=D):D=s[25];let B;s[26]!==E?(B=async f=>E(f),s[26]=E,s[27]=B):B=s[27];let A;s[28]!==H||s[29]!==x||s[30]!==h||s[31]!==v||s[32]!==B?(A=t.jsxs(X.Header,{children:[D,t.jsx(X.Header.Right,{children:t.jsx(ft,{wellKnownRegistries:H,registries:h,value:x,onValueChange:v,onAddWellKnown:B,placeholder:"Select store..."})})]}),s[28]=H,s[29]=x,s[30]=h,s[31]=v,s[32]=B,s[33]=A):A=s[33];let V;s[34]!==x||s[35]!==h?(V=f=>{const{error:Z,resetError:le}=f;return t.jsx(gt,{error:Z,onRetry:le,registryName:h.find(ee=>ee.id===x)?.name??"registry"})},s[34]=x,s[35]=h,s[36]=V):V=s[36];let O;s[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=O):O=s[37];let M;s[38]!==W||s[39]!==x||s[40]!==v||s[41]!==y?(M=t.jsx(U.Suspense,{fallback:O,children:x?t.jsx(ut,{registryId:x,storePrivateOnly:y}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(xt,{registries:W,onConnected:f=>{v(f)}})})}),s[38]=W,s[39]=x,s[40]=v,s[41]=y,s[42]=M):M=s[42];let q;s[43]!==V||s[44]!==M?(q=t.jsx(X.Content,{children:t.jsx(Ye,{fallback:V,children:M})}),s[43]=V,s[44]=M,s[45]=q):q=s[45];let J;return s[46]!==A||s[47]!==q?(J=t.jsxs(X,{children:[A,q]}),s[46]=A,s[47]=q,s[48]=J):J=s[48],J}function pt(s){return s.id}function ht(s){return s??""}export{ns as default};
|
|
1
|
+
import{c as Q,r as U,u as re,K as oe,bx as we,j as t,b as me,O as de,d as Ie,by as Te,bz as ne,aD as Re}from"./index-DORq2iDV.js";import{P as X}from"./index-CdvbUeMY.js";import{B as Pe,a as ze,b as $e,c as ke}from"./breadcrumb-CyS88-Ut.js";import{i as ue}from"./AlertTriangle-CoVws0Do.js";import{i as fe}from"./FilterLines-C_9_niv_.js";import{n as xe}from"./Inbox01-BSel3biT.js";import{i as se}from"./Loading01-B5HJTtc0.js";import{s as ge}from"./RefreshCw01-DDRYQqjd.js";import{i as pe}from"./SearchMd-DBdGvvkJ.js";import{u as he}from"./useQuery-psr46-dB.js";import{u as Le}from"./useInfiniteQuery-ehcPTJqP.js";import{a as Fe,f as Ee,b as Oe}from"./registry-utils-DbEnt6lf.js";import{u as je,W as Ke,a as _e,h as Ae,b as Me}from"./constants-C7Ec6iJ9.js";import{f as Be,g as ye,h as De}from"./use-connection-C7Ykn5We.js";import{s as Ge}from"./slugify-CEUa2lfQ.js";import{C as We,E as Ve}from"./empty-state-J0iNaH6o.js";import{M as ae}from"./mcp-server-card-oeessZZx.js";import{c as ie,B as Y}from"./button-CVYD_l4f.js";import{I as qe}from"./input-Bh5KX8XE.js";import{b as ve,P as be,a as Ne}from"./popover-DbRkjXcJ.js";import{i as Ce}from"./Check-B6v8UYhw.js";import{t as Se}from"./ChevronDown-RHEfxY7t.js";import{s as te}from"./XClose-Dm4uRTid.js";import{s as Ue}from"./Plus-CRPlP_jA.js";import{u as He}from"./use-binding-JQRdy56n.js";import{L as Je,u as Qe}from"./localstorage-keys-CCux6fjT.js";import{E as Ye}from"./error-boundary-Cw9mogkc.js";import"./use-mobile-aOwHFgFs.js";import"./tooltip-4z3Dj1Ic.js";import"./ChevronRight-CtfDv6KV.js";import"./infiniteQueryObserver-dJrk4KCF.js";import"./useMutation-DIYvmP8t.js";import"./CheckVerified02-Bk4SPa-V.js";import"./Globe02-RkDxZVVj.js";import"./Lock01-Y_aOvYlB.js";import"./Terminal-XYm-55WZ.js";import"./card-BESAH6x0.js";import"./integration-icon-BdGEh9QA.js";import"./Container-CMzzA9YA.js";import"./github-icon-Dp3wHhYE.js";import"./binder-gZKFqPm8.js";function Ze(s,e){const r=Q.c(4),[l,m]=U.useState(s),n=U.useRef(null),o=U.useRef(!0);let c,a;return r[0]!==e||r[1]!==s?(c=()=>{if(o.current){o.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{m(s)},e),()=>{n.current&&clearTimeout(n.current)}},a=[s,e],r[0]=e,r[1]=s,r[2]=c,r[3]=a):(c=r[2],a=r[3]),U.useEffect(c,a),l}function Xe(s){const e=Q.c(14),r=U.useRef(null),l=`scroll-position:${s}`,m=U.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const o=n;let c;e[2]!==l?(c=()=>{if(m.current===l)return;const j=sessionStorage.getItem(l);if(j&&r.current){const S=Number.parseInt(j,10);r.current.scrollTop=S}m.current=l},e[2]=l,e[3]=c):c=e[3];const a=c;let g;e[4]!==a||e[5]!==l?(g=()=>{m.current!==l&&a()},e[4]=a,e[5]=l,e[6]=g):g=e[6];const I=g;let i;e[7]!==a||e[8]!==l?(i=j=>{r.current=j,j&&m.current!==l&&requestAnimationFrame(()=>{a()})},e[7]=a,e[8]=l,e[9]=i):i=e[9];const p=i;let d;return e[10]!==I||e[11]!==o||e[12]!==p?(d={scrollRef:p,saveScrollPosition:o,handleScroll:I},e[10]=I,e[11]=o,e[12]=p,e[13]=d):d=e[13],d}const et=24;function tt(s){const e=Q.c(54),{registryId:r,listToolName:l,filtersToolName:m,search:n}=s,{org:o}=re();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[a,g]=U.useState(c);let I;e[1]===Symbol.for("react.memo_cache_sentinel")?(I=[],e[1]=I):I=e[1];const[i,p]=U.useState(I),d=r||null;let j;e[2]!==o.id||e[3]!==d?(j={connectionId:d,orgId:o.id},e[2]=o.id,e[3]=d,e[4]=j):j=e[4];const S=je(j),R=!!m;let b;e[5]!==m||e[6]!==r?(b=oe.toolCall(r,m||"no-filters","{}"),e[5]=m,e[6]=r,e[7]=b):b=e[7];let N;e[8]!==S||e[9]!==m?(N=async()=>{if(!m)return{tags:[],categories:[]};const f=await S.callTool({name:m,arguments:{}});return f.structuredContent??f},e[8]=S,e[9]=m,e[10]=N):N=e[10];let P;e[11]!==b||e[12]!==N?(P={queryKey:b,queryFn:N,staleTime:36e5,retry:2},e[11]=b,e[12]=N,e[13]=P):P=e[13];const{data:z}=he(P);let h,C,$;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==i||e[18]!==a){const f=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:et,...a.length>0&&{tags:a},...i.length>0&&{categories:i},...f&&{where:f}},$=Le,C=oe.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=i,e[18]=a,e[19]=h,e[20]=C,e[21]=$}else h=e[19],C=e[20],$=e[21];let v;e[22]!==S||e[23]!==h||e[24]!==l?(v=async f=>{const{pageParam:Z}=f,le=Z?{...h,cursor:Z}:h,ee=await S.callTool({name:l,arguments:le});return ee.structuredContent??ee},e[22]=S,e[23]=h,e[24]=l,e[25]=v):v=e[25];let k;e[26]!==v||e[27]!==C?(k={queryKey:C,queryFn:v,initialPageParam:void 0,getNextPageParam:st,staleTime:36e5,placeholderData:we,retry:2},e[26]=v,e[27]=C,e[28]=k):k=e[28];const{data:w,fetchNextPage:x,hasNextPage:y,isFetchingNextPage:u,isFetching:T,isLoading:L,error:F}=$(k);let K;e:{if(!w?.pages||w.pages.length===0){K=null;break e}const f=w.pages[0];if(typeof f=="object"&&f!==null&&"totalCount"in f&&typeof f.totalCount=="number"){K=f.totalCount;break e}K=null}const _=K,E=w?.pages;let G;e[29]!==E?(G=Fe(E),e[29]=E,e[30]=G):G=e[30];const H=G;let W;e[31]!==n||e[32]!==i.length||e[33]!==a.length?(W=a.length>0||i.length>0||!!n?.trim(),e[31]=n,e[32]=i.length,e[33]=a.length,e[34]=W):W=e[34];const D=W,B=T&&!u&&!L&&D;let A;e[35]!==x||e[36]!==y||e[37]!==u?(A=()=>{y&&!u&&x()},e[35]=x,e[36]=y,e[37]=u,e[38]=A):A=e[38];const V=A,O=y??!1,M=R?z?.tags:void 0,q=R?z?.categories:void 0;let J;return e[39]!==D||e[40]!==T||e[41]!==u||e[42]!==B||e[43]!==L||e[44]!==H||e[45]!==F||e[46]!==V||e[47]!==i||e[48]!==a||e[49]!==O||e[50]!==M||e[51]!==q||e[52]!==_?(J={items:H,totalCount:_,hasMore:O,isLoadingMore:u,isFiltering:B,isInitialLoading:L,isFetching:T,error:F,loadMore:V,availableTags:M,availableCategories:q,selectedTags:a,selectedCategories:i,setSelectedTags:g,setSelectedCategories:p,hasActiveFilters:D},e[39]=D,e[40]=T,e[41]=u,e[42]=B,e[43]=L,e[44]=H,e[45]=F,e[46]=V,e[47]=i,e[48]=a,e[49]=O,e[50]=M,e[51]=q,e[52]=_,e[53]=J):J=e[53],J}function st(s){if(typeof s=="object"&&s!==null){const e=s.nextCursor||s.cursor;if(e)return e}}function rt(s,e){return[...s].sort((r,l)=>l.count-r.count).slice(0,e)}function ce(s){const e=Q.c(52),{label:r,items:l,selectedItems:m,onToggle:n,onClear:o}=s,[c,a]=U.useState(""),[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N,P,z,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==g||e[4]!==c||e[5]!==m){const x=[...c?l.filter(E=>E.value.toLowerCase().includes(c.toLowerCase())):l].sort(lt);d=m.length,p=ve,P=g,z=I;let y;e[17]!==r?(y=t.jsx("span",{children:r}),e[17]=r,e[18]=y):y=e[18];let u;e[19]!==d?(u=d>0&&t.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:d}),e[19]=d,e[20]=u):u=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Se,{size:14,className:"opacity-50"}),e[21]=T):T=e[21],e[22]!==u||e[23]!==y?(h=t.jsx(be,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[y,u,T]})}),e[22]=u,e[23]=y,e[24]=h):h=e[24],i=Ne,R="w-64 p-0",b="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(pe,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let F;e[26]!==r?(F=r.toLowerCase(),e[26]=r,e[27]=F):F=e[27];const K=`Search ${F}...`;let _;e[28]===Symbol.for("react.memo_cache_sentinel")?(_=E=>a(E.target.value),e[28]=_):_=e[28],e[29]!==c||e[30]!==K?(N=t.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,t.jsx(qe,{type:"text",placeholder:K,value:c,onChange:_,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=K,e[31]=N):N=e[31],j="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",S=x.length===0?t.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):x.map(E=>{const G=m.includes(E.value);return t.jsxs("button",{onClick:()=>n(E.value),className:ie("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[t.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"}),E.value]}),t.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:E.count})]},E.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=g,e[4]=c,e[5]=m,e[6]=i,e[7]=p,e[8]=d,e[9]=j,e[10]=S,e[11]=R,e[12]=b,e[13]=N,e[14]=P,e[15]=z,e[16]=h}else i=e[6],p=e[7],d=e[8],j=e[9],S=e[10],R=e[11],b=e[12],N=e[13],P=e[14],z=e[15],h=e[16];let C;e[32]!==j||e[33]!==S?(C=t.jsx("div",{className:j,children:S}),e[32]=j,e[33]=S,e[34]=C):C=e[34];let $;e[35]!==r||e[36]!==o||e[37]!==d?($=d>0&&t.jsx("div",{className:"p-2 border-t border-border",children:t.jsxs(Y,{variant:"ghost",size:"sm",onClick:o,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=o,e[37]=d,e[38]=$):$=e[38];let v;e[39]!==i||e[40]!==$||e[41]!==R||e[42]!==b||e[43]!==N||e[44]!==C?(v=t.jsxs(i,{className:R,align:b,children:[N,C,$]}),e[39]=i,e[40]=$,e[41]=R,e[42]=b,e[43]=N,e[44]=C,e[45]=v):v=e[45];let k;return e[46]!==p||e[47]!==v||e[48]!==P||e[49]!==z||e[50]!==h?(k=t.jsxs(p,{open:P,onOpenChange:z,children:[h,v]}),e[46]=p,e[47]=v,e[48]=P,e[49]=z,e[50]=h,e[51]=k):k=e[51],k}function lt(s,e){return e.count-s.count}function nt(s){const e=Q.c(67),{availableTags:r,availableCategories:l,selectedTags:m,selectedCategories:n,onTagChange:o,onCategoryChange:c}=s,a=r&&r.length>0||l&&l.length>0,g=m.length>0||n.length>0;if(!a)return null;let I;e[0]!==o||e[1]!==m?(I=y=>{m.includes(y)?o(m.filter(u=>u!==y)):o([...m,y])},e[0]=o,e[1]=m,e[2]=I):I=e[2];const i=I;let p;e[3]!==c||e[4]!==n?(p=y=>{n.includes(y)?c(n.filter(u=>u!==y)):c([...n,y])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const d=p;let j;e[6]!==c||e[7]!==o?(j=()=>{o([]),c([])},e[6]=c,e[7]=o,e[8]=j):j=e[8];const S=j;let R,b,N,P,z,h,C;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==o||e[13]!==n||e[14]!==m||e[15]!==d||e[16]!==i){const y=l?rt(l,6):[];R=n,b=m,C=new Set(y.map(ot)),z="flex items-center border-b border-border";let u;e[24]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:t.jsx(fe,{size:16})}),e[24]=u):u=e[24];let T;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==d?(T=l&&l.length>0&&t.jsx(ce,{label:"Categories",items:l,selectedItems:n,onToggle:d,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=d,e[29]=T):T=e[29];let L;e[30]!==r||e[31]!==o||e[32]!==m||e[33]!==i?(L=r&&r.length>0&&t.jsx(ce,{label:"Tags",items:r,selectedItems:m,onToggle:i,onClear:()=>o([])}),e[30]=r,e[31]=o,e[32]=m,e[33]=i,e[34]=L):L=e[34],e[35]!==L||e[36]!==T?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[u,T,L]}),e[35]=L,e[36]=T,e[37]=h):h=e[37],N="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==n||e[39]!==d?(F=K=>{const _=n.includes(K.value);return t.jsxs("div",{onClick:()=>d(K.value),className:ie("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",_?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[t.jsx("span",{children:K.value}),_&&t.jsx("span",{onClick:E=>{E.stopPropagation(),d(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},K.value)},e[38]=n,e[39]=d,e[40]=F):F=e[40],P=y.map(F),e[9]=l,e[10]=r,e[11]=c,e[12]=o,e[13]=n,e[14]=m,e[15]=d,e[16]=i,e[17]=R,e[18]=b,e[19]=N,e[20]=P,e[21]=z,e[22]=h,e[23]=C}else R=e[17],b=e[18],N=e[19],P=e[20],z=e[21],h=e[22],C=e[23];let $;if(e[41]!==R||e[42]!==d||e[43]!==C){let y;e[45]!==C?(y=T=>!C.has(T),e[45]=C,e[46]=y):y=e[46];let u;e[47]!==d?(u=T=>t.jsxs("div",{onClick:()=>d(T),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:T}),t.jsx("span",{onClick:L=>{L.stopPropagation(),d(T)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`cat-${T}`),e[47]=d,e[48]=u):u=e[48],$=R.filter(y).map(u),e[41]=R,e[42]=d,e[43]=C,e[44]=$}else $=e[44];let v;if(e[49]!==b||e[50]!==i){let y;e[52]!==i?(y=u=>t.jsxs("div",{onClick:()=>i(u),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[t.jsx("span",{children:u}),t.jsx("span",{onClick:T=>{T.stopPropagation(),i(u)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:t.jsx(te,{size:12})})]},`tag-${u}`),e[52]=i,e[53]=y):y=e[53],v=b.map(y),e[49]=b,e[50]=i,e[51]=v}else v=e[51];let k;e[54]!==S||e[55]!==g?(k=g&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:S,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[t.jsx(te,{size:14}),"Clear all"]}),e[54]=S,e[55]=g,e[56]=k):k=e[56];let w;e[57]!==k||e[58]!==N||e[59]!==P||e[60]!==$||e[61]!==v?(w=t.jsxs("div",{className:N,children:[P,$,v,k]}),e[57]=k,e[58]=N,e[59]=P,e[60]=$,e[61]=v,e[62]=w):w=e[62];let x;return e[63]!==w||e[64]!==z||e[65]!==h?(x=t.jsxs("div",{className:z,children:[h,w]}),e[63]=w,e[64]=z,e[65]=h,e[66]=x):x=e[66],x}function ot(s){return s.value}function it(s,e){if(!e)return s;const r=e.toLowerCase();return s.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function at(s){return s.verified===!0||s._meta?.["mcp.mesh"]?.verified===!0}function ct(s){const e=Q.c(55),{registryId:r,listToolName:l,filtersToolName:m,storePrivateOnly:n}=s,[o,c]=U.useState(""),a=Ze(o,300),g=me(),{org:I}=re(),{scrollRef:i,saveScrollPosition:p,handleScroll:d}=Xe(`store-discovery:${r}`);let j;e[0]!==a||e[1]!==m||e[2]!==l||e[3]!==r?(j={registryId:r,listToolName:l,filtersToolName:m,search:a},e[0]=a,e[1]=m,e[2]=l,e[3]=r,e[4]=j):j=e[4];const{items:S,hasMore:R,isLoadingMore:b,isInitialLoading:N,isFetching:P,error:z,loadMore:h,availableTags:C,availableCategories:$,selectedTags:v,selectedCategories:k,setSelectedTags:w,setSelectedCategories:x,hasActiveFilters:y}=tt(j);let u,T,L,F;if(e[5]!==a||e[6]!==P||e[7]!==N||e[8]!==S||e[9]!==o||e[10]!==n){const O=o?it(S,o):S;F=n?O.filter(dt):O,u=(o!==a||P)&&!N&&!!o,L=F.filter(at),T=F.filter(M=>!L.find(q=>q.id===M.id)),e[5]=a,e[6]=P,e[7]=N,e[8]=S,e[9]=o,e[10]=n,e[11]=u,e[12]=T,e[13]=L,e[14]=F}else u=e[11],T=e[12],L=e[13],F=e[14];const K=T;let _;e[15]!==g||e[16]!==I.slug||e[17]!==r||e[18]!==p?(_=O=>{p();const M=Ge(O.name||O.title||O.server?.title||""),q=typeof O.id=="string"&&O.id.includes("/"),J=typeof O.server?.name=="string"&&O.server.name.includes("/"),f=q&&!J?O.id:O.server?.name||O.id||"";g({to:"/$org/$project/store/$appName",params:{org:I.slug,project:de,appName:M},search:{registryId:r,serverName:f}})},e[15]=g,e[16]=I.slug,e[17]=r,e[18]=p,e[19]=_):_=e[19];const E=_;let G;e[20]!==d||e[21]!==R||e[22]!==b||e[23]!==h?(G=O=>{if(d(),!R||b)return;const M=O.currentTarget;M.scrollHeight-M.scrollTop-M.clientHeight<200&&h()},e[20]=d,e[21]=R,e[22]=b,e[23]=h,e[24]=G):G=e[24];const H=G;let W;e[25]!==u||e[26]!==o?(W=t.jsx(We,{value:o,onChange:c,placeholder:"Search for an MCP Server...",isSearching:u}),e[25]=u,e[26]=o,e[27]=W):W=e[27];let D;e[28]!==$||e[29]!==C||e[30]!==k||e[31]!==v||e[32]!==x||e[33]!==w?(D=t.jsx(nt,{availableTags:C,availableCategories:$,selectedTags:v,selectedCategories:k,onTagChange:w,onCategoryChange:x}),e[28]=$,e[29]=C,e[30]=k,e[31]=v,e[32]=x,e[33]=w,e[34]=D):D=e[34];let B;e[35]!==K||e[36]!==z||e[37]!==E||e[38]!==y||e[39]!==R||e[40]!==N||e[41]!==b||e[42]!==u||e[43]!==o||e[44]!==L||e[45]!==F?(B=t.jsx("div",{className:"p-5",children:t.jsx("div",{children:z&&!N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"size-8 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),z.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:z.message})]}),t.jsxs(Y,{variant:"outline",size:"sm",onClick:mt,children:[t.jsx(ge,{className:"size-4"}),"Try again"]})]}):N?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):F.length===0&&!y?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(xe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),t.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):F.length===0&&y&&!o?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(fe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):o&&F.length===0&&!u?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(pe,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),t.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):t.jsxs("div",{className:"flex flex-col gap-8",children:[u&&F.length===0&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),L.length>0&&t.jsx(ae,{items:L,title:"Verified",onItemClick:E}),K.length>0&&t.jsx(ae,{items:K,title:L.length>0?"All":"",onItemClick:E}),R&&b&&t.jsx("div",{className:"flex justify-center py-8",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx(se,{size:20,className:"animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[35]=K,e[36]=z,e[37]=E,e[38]=y,e[39]=R,e[40]=N,e[41]=b,e[42]=u,e[43]=o,e[44]=L,e[45]=F,e[46]=B):B=e[46];let A;e[47]!==H||e[48]!==i||e[49]!==B?(A=t.jsx("div",{ref:i,className:"flex-1 overflow-y-auto",onScroll:H,children:B}),e[47]=H,e[48]=i,e[49]=B,e[50]=A):A=e[50];let V;return e[51]!==W||e[52]!==D||e[53]!==A?(V=t.jsxs("div",{className:"flex flex-col h-full",children:[W,D,A]}),e[51]=W,e[52]=D,e[53]=A,e[54]=V):V=e[54],V}function mt(){return window.location.reload()}function dt(s){return s.is_public!==!0}function ut(s){const e=Q.c(11),{registryId:r,storePrivateOnly:l}=s,m=Be(r),n=m?.tools;let o;e[0]!==n?(o=Ee(n),e[0]=n,e[1]=o):o=e[1];const c=o;if(!c){let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"bg-muted p-3 rounded-full",children:t.jsx(xe,{className:"size-8 text-muted-foreground"})}),e[2]=d):d=e[2];let j;return e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[d,t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=j):j=e[3],j}const a=m?.tools;let g;e[4]!==a?(g=Oe(a),e[4]=a,e[5]=g):g=e[5];const i=g||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==i?(p=t.jsx(ct,{registryId:r,listToolName:c,filtersToolName:i,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=i,e[10]=p):p=e[10],p}function ft(s){const e=Q.c(43),{registries:r,value:l,onValueChange:m,onAddWellKnown:n,wellKnownRegistries:o,placeholder:c}=s,a=c===void 0?"Select a registry...":c,[g,I]=U.useState(!1);let i,p,d,j,S,R,b,N;if(e[0]!==g||e[1]!==a||e[2]!==r||e[3]!==l){let w;e[12]!==l?(w=y=>y.id===l,e[12]=l,e[13]=w):w=e[13];const x=r.find(w);p=ve,b=g,N=I,i=be,R=!0,d="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(j=ie("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=j):j=e[14],S=x?t.jsxs("span",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}):t.jsx("span",{className:"text-muted-foreground",children:a}),e[0]=g,e[1]=a,e[2]=r,e[3]=l,e[4]=i,e[5]=p,e[6]=d,e[7]=j,e[8]=S,e[9]=R,e[10]=b,e[11]=N}else i=e[4],p=e[5],d=e[6],j=e[7],S=e[8],R=e[9],b=e[10],N=e[11];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Se,{className:"size-4 opacity-50"}),e[15]=P):P=e[15];let z;e[16]!==d||e[17]!==j||e[18]!==S?(z=t.jsxs("button",{type:d,className:j,children:[S,P]}),e[16]=d,e[17]=j,e[18]=S,e[19]=z):z=e[19];let h;e[20]!==i||e[21]!==R||e[22]!==z?(h=t.jsx(i,{asChild:R,children:z}),e[20]=i,e[21]=R,e[22]=z,e[23]=h):h=e[23];let C;if(e[24]!==m||e[25]!==r||e[26]!==l){let w;e[28]!==m||e[29]!==l?(w=x=>t.jsxs("button",{type:"button",onClick:()=>{m(x.id??x.name),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[x.icon?t.jsx("img",{src:x.icon,alt:x.name,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:x.name.slice(0,1).toUpperCase()}),t.jsx("span",{children:x.name})]}),l===(x.id??x.name)&&t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(Ce,{className:"size-4"})})]},x.id??x.name),e[28]=m,e[29]=l,e[30]=w):w=e[30],C=r.map(w),e[24]=m,e[25]=r,e[26]=l,e[27]=C}else C=e[27];let $;e[31]!==n||e[32]!==o?($=o.length>0&&t.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[t.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(w=>t.jsxs("button",{type:"button",onClick:()=>{n(w),I(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?t.jsx("img",{src:w.icon,alt:w.title,className:"w-4 h-4 rounded"}):t.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.title.slice(0,1).toUpperCase()}),t.jsx("span",{className:"flex-1",children:w.title})]}),t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:t.jsx(Ue,{size:16})})]},w.id??w.title))]}),e[31]=n,e[32]=o,e[33]=$):$=e[33];let v;e[34]!==C||e[35]!==$?(v=t.jsxs(Ne,{align:"end",className:"w-auto min-w-[200px] p-1",children:[C,$]}),e[34]=C,e[35]=$,e[36]=v):v=e[36];let k;return e[37]!==p||e[38]!==h||e[39]!==v||e[40]!==b||e[41]!==N?(k=t.jsxs(p,{open:b,onOpenChange:N,children:[h,v]}),e[37]=p,e[38]=h,e[39]=v,e[40]=b,e[41]=N,e[42]=k):k=e[42],k}function xt({registries:s,onConnected:e}){const r=ye(),{org:{slug:l}}=re(),{data:m}=Ie.useSession(),n=me(),[o,c]=U.useState(!1),a=s[0],g=async()=>{if(!(!a||!m?.user?.id)){c(!0);try{const i=await r.create.mutateAsync(a);e?.(i.id)}finally{c(!1)}}},I=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:de},search:{action:"create"}})};return t.jsx(Ve,{image:t.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:t.jsxs(t.Fragment,{children:[t.jsxs(Y,{variant:"outline",onClick:g,disabled:o||!a,children:[a?.icon&&t.jsx("img",{src:a.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),t.jsx(Y,{variant:"outline",onClick:I,children:"Custom Connection"})]})})}function gt(s){const e=Q.c(15),{error:r,onRetry:l,registryName:m}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(ue,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=o):o=e[1];let c;e[2]!==m?(c=t.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",t.jsx("strong",{children:m})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=m,e[3]=c):c=e[3];let a;e[4]!==r?(a=r?.message&&t.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=a):a=e[5];let g;e[6]!==c||e[7]!==a?(g=t.jsxs("div",{className:"space-y-2",children:[o,c,a]}),e[6]=c,e[7]=a,e[8]=g):g=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ge,{className:"size-4"}),e[9]=I):I=e[9];let i;e[10]!==l?(i=t.jsxs(Y,{variant:"outline",size:"sm",onClick:l,children:[I,"Try again"]}),e[10]=l,e[11]=i):i=e[11];let p;return e[12]!==g||e[13]!==i?(p=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,g,i]}),e[12]=g,e[13]=i,e[14]=p):p=e[14],p}function ns(){const s=Q.c(49),{org:e,project:r}=re(),l=De(),m=ye(),n=Te(),o=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=He(l);let a;s[0]!==e.id?(a=Ke.SELF(e.id),s[0]=e.id,s[1]=a):a=s[1];const g=a,I=r.enabledPlugins,i=I==null||I.includes(ne),p=c.filter(f=>f.id!==g?!0:i);let d;s[2]!==g?(d=f=>f.id===g,s[2]=g,s[3]=d):d=s[3];const j=p.some(d);let S;s[4]!==e.id?(S={connectionId:_e,orgId:e.id},s[4]=e.id,s[5]=S):S=s[5];const R=je(S);let b;s[6]!==r.id||s[7]!==R?(b=async()=>{const f=await R.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ne}});return f.structuredContent??f},s[6]=r.id,s[7]=R,s[8]=b):b=s[8];const{data:N}=he({queryKey:oe.projectPluginConfig(r.id??"",ne),queryFn:b,enabled:j&&!!r.id,staleTime:6e4}),P=N?.config?.settings;let z;s[9]!==P||s[10]!==g?(z=f=>f.id===g&&P?{id:f.id,name:P.registryName||f.title,icon:P.registryIcon||f.icon||void 0}:{id:f.id,name:f.title,icon:f.icon||void 0},s[9]=P,s[10]=g,s[11]=z):z=s[11];const h=p.map(z);let C;s[12]!==e.slug?(C=Je.selectedRegistry(e.slug),s[12]=e.slug,s[13]=C):C=s[13];const[$,v]=Qe(C,ht);let k;s[14]!==$?(k=f=>f.id===$,s[14]=$,s[15]=k):k=s[15];const x=p.find(k)?.id||p[0]?.id||"",y=x===g&&P?.storePrivateOnly===!0;let u;s[16]!==e.id?(u=Ae(e.id),s[16]=e.id,s[17]=u):u=s[17];let T;s[18]!==u?(T=[u],s[18]=u,s[19]=T):T=s[19];const L=T;let F;s[20]===Symbol.for("react.memo_cache_sentinel")?(F=[Me()],s[20]=F):F=s[20];const K=F;let _;s[21]!==m.create||s[22]!==v?(_=async f=>{const Z=await m.create.mutateAsync(f);v(Z.id)},s[21]=m.create,s[22]=v,s[23]=_):_=s[23];const E=_,G=new Set(p.map(pt)),H=L.filter(f=>f.id&&!G.has(f.id)),W=K.filter(f=>f.id&&!G.has(f.id));if(o){let f;return s[24]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Re,{}),s[24]=f):f=s[24],f}let D;s[25]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(X.Header.Left,{children:t.jsx(Pe,{children:t.jsx(ze,{children:t.jsx($e,{children:t.jsx(ke,{children:"Store"})})})})}),s[25]=D):D=s[25];let B;s[26]!==E?(B=async f=>E(f),s[26]=E,s[27]=B):B=s[27];let A;s[28]!==H||s[29]!==x||s[30]!==h||s[31]!==v||s[32]!==B?(A=t.jsxs(X.Header,{children:[D,t.jsx(X.Header.Right,{children:t.jsx(ft,{wellKnownRegistries:H,registries:h,value:x,onValueChange:v,onAddWellKnown:B,placeholder:"Select store..."})})]}),s[28]=H,s[29]=x,s[30]=h,s[31]=v,s[32]=B,s[33]=A):A=s[33];let V;s[34]!==x||s[35]!==h?(V=f=>{const{error:Z,resetError:le}=f;return t.jsx(gt,{error:Z,onRetry:le,registryName:h.find(ee=>ee.id===x)?.name??"registry"})},s[34]=x,s[35]=h,s[36]=V):V=s[36];let O;s[37]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsx(se,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),s[37]=O):O=s[37];let M;s[38]!==W||s[39]!==x||s[40]!==v||s[41]!==y?(M=t.jsx(U.Suspense,{fallback:O,children:x?t.jsx(ut,{registryId:x,storePrivateOnly:y}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(xt,{registries:W,onConnected:f=>{v(f)}})})}),s[38]=W,s[39]=x,s[40]=v,s[41]=y,s[42]=M):M=s[42];let q;s[43]!==V||s[44]!==M?(q=t.jsx(X.Content,{children:t.jsx(Ye,{fallback:V,children:M})}),s[43]=V,s[44]=M,s[45]=q):q=s[45];let J;return s[46]!==A||s[47]!==q?(J=t.jsxs(X,{children:[A,q]}),s[46]=A,s[47]=q,s[48]=J):J=s[48],J}function pt(s){return s.id}function ht(s){return s??""}export{ns as default};
|
package/dist/client/assets/{plugin-empty-state-BgLOnXwy.js → plugin-empty-state-BGVXlN99.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as t}from"./index-
|
|
1
|
+
import{c as s,j as t}from"./index-DORq2iDV.js";import{e as r}from"./Dataflow03-LkUhMtQK.js";function a(){const o=s.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(r,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No workflows connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect a workflow provider to create and manage automated workflows with multiple steps and integrations."})]}),o[0]=e):e=o[0],e}export{a as default};
|
package/dist/client/assets/{plugin-empty-state-DQk2d_nM.js → plugin-empty-state-FKGErfc3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as t,H as o}from"./index-
|
|
1
|
+
import{c as n,j as t,H as o}from"./index-DORq2iDV.js";function c(){const s=n.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(o,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as S,j as s,r as w}from"./index-
|
|
1
|
+
import{c as S,j as s,r as w}from"./index-DORq2iDV.js";import{i as R}from"./Check-B6v8UYhw.js";import{t as _}from"./ChevronDown-RHEfxY7t.js";import{e as y}from"./Dataflow03-LkUhMtQK.js";function E(x){const e=S.c(32),{connections:l,selectedConnectionId:r,onConnectionChange:N}=x,[n,z]=w.useState(!1),C=w.useRef(null);let p;if(e[0]!==l||e[1]!==r){let t;e[3]!==r?(t=u=>u.id===r,e[3]=r,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=r,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const k=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Workflows";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==n?(o=()=>z(!n),e[13]=n,e[14]=o):o=e[14];let c;e[15]!==i?(c=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=c):c=e[16];const v=i?.title||"Select provider";let a;e[17]!==v?(a=s.jsx("span",{children:v}),e[17]=v,e[18]=a):a=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(_,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==c||e[22]!==a?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[c,a,b]}),e[20]=o,e[21]=c,e[22]=a,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==n||e[26]!==N||e[27]!==r?(m=n&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===r&&s.jsx(R,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=n,e[26]=N,e[27]=r,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:k,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function H(x){const e=S.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,j as s,r as S,H as y}from"./index-
|
|
1
|
+
import{c as w,j as s,r as S,H as y}from"./index-DORq2iDV.js";import{i as _}from"./Check-B6v8UYhw.js";import{t as k}from"./ChevronDown-RHEfxY7t.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function I(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,ap as $,j as c,aG as L,al as G,as as A,ar as _,au as P,aH as w,aw as j,aI as H,aJ as E,aK as z,aL as K,ax as J,aM as Q,aN as U,aO as V,aP as W,aQ as Z,aR as q,c as R}from"./index-
|
|
1
|
+
import{r as i,ap as $,j as c,aG as L,al as G,as as A,ar as _,au as P,aH as w,aw as j,aI as H,aJ as E,aK as z,aL as K,ax as J,aM as Q,aN as U,aO as V,aP as W,aQ as Z,aR as q,c as R}from"./index-DORq2iDV.js";import{c as B}from"./button-CVYD_l4f.js";var m="Popover",[b]=J(m,[E]),g=E(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=g(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(L,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:s,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),a=g(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});Y.displayName=F;var S="PopoverTrigger",y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(S,o),a=g(o),s=A(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":k(n.open),...r,ref:s,onClick:P(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});y.displayName=S;var O="PopoverPortal",[ee,oe]=b(O,{forceMount:void 0}),M=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(O,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(j,{present:o||a.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};M.displayName=O;var v="PopoverContent",D=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(j,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});D.displayName=v;var te=Q("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=A(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return z(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(I,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(t.onPointerDownOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(I,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const s=a.target;o.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),I=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=g(o);return U(),c.jsx(V,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:a,children:c.jsx(W,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Z,{"data-state":k(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),T="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(T,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:P(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=T;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=g(o);return c.jsx(q,{...n,...r,ref:e})});ce.displayName=se;function k(t){return t?"open":"closed"}var ie=N,pe=y,le=M,ue=D;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(12);let o,r,n,a;e[0]!==t?({className:o,align:n,sideOffset:a,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=a):(o=e[1],r=e[2],n=e[3],a=e[4]);const s=n===void 0?"center":n,p=a===void 0?4:a;let l;e[5]!==o?(l=B("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==s||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:s,sideOffset:p,className:l,...r})}),e[7]=s,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{Pe as P,ge as a,ve as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as O,c as z,d as me,j as s,u as J,O as G,t as R,H as Le,o as ve,s as W,b as ne,y as le,l as Ne,k as Se,K as q,aF as re,bF as Be,P as Ce,S as ae,e as Re,aD as Me}from"./index-oMshRPQh.js";import{u as Ue,a as _e}from"./use-project-BhSsBpip.js";import{c as X,B as U}from"./button-CNk0sRlZ.js";import{a as qe,D as Ge}from"./dialog-80D7tuCu.js";import{a as Ke,b as Qe,c as Ve,T as Je,i as Pe}from"./tooltip-Dx34_lZB.js";import{u as ue,S as te}from"./skeleton-B8qxiZB7.js";import{p as ke,a as pe,t as We,u as Ze}from"./use-settings-modal-DgkcV04c.js";import{A as we}from"./avatar-DJffUECx.js";import{t as Ie}from"./Settings01-y_jeefTl.js";import{i as He}from"./Check-BZR8Q9Pv.js";import{a as Ye}from"./Copy01-CCUY_RvG.js";import{S as se}from"./switch-CZ_WPTQh.js";import{S as ze,a as Ee,d as Y,c as $e,b as Xe}from"./select-DUdkFtXP.js";import{i as et}from"./Code01-YBrb3jgn.js";import{i as tt}from"./Shield01-BQ7ipScZ.js";import{n as st}from"./CheckDone01-qdpwutcg.js";import{u as oe}from"./useMutation-CbaEZADR.js";import{a as De,F as Z,b as K,c as Q,d as V,f as H,e as ce}from"./form-BiaaECZX.js";import{I as ee}from"./input-B19ythGH.js";import{i as nt}from"./Upload01-M05wSbl7.js";import{a as fe,u as xe}from"./constants-DYb82Fm9.js";import{T as lt}from"./textarea-BAMKNzO6.js";import{c as ot,h as rt,d as it,b as at,A as ct,e as dt,g as mt,a as ut,f as ft}from"./alert-dialog-JQIs_CV4.js";import{u as xt}from"./useQuery-Bv1aa00L.js";import{L as gt}from"./label-DH4CmEmu.js";import{n as pt}from"./Container-owj5RAIr.js";import{h as ht}from"./use-connection-ByNXZCyC.js";import{a as jt,c as bt}from"./use-binding-CXOZP40D.js";import{u as yt}from"./use-install-from-registry-SYVtY8Vz.js";import{i as vt}from"./Loading01--Y6ftcI7.js";import{s as Nt}from"./Plus-Ce4oU7HM.js";import"./localstorage-keys-DUciQQyZ.js";import"./ChevronDown-B8cLKcdN.js";import"./binder-B_ndWiav.js";import"./extract-connection-data-CyFhebHJ.js";import"./constants-Dbm9w_Pk.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-qgDFHo7G.js";import"./generate-id-Dyweu44Y.js";const Oe=({size:e=24,color:t="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));Oe.displayName="Beaker01";const Te=({size:e=24,color:t="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Te.displayName="Bell01";const ge=({size:e=24,color:t="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));ge.displayName="Zap";const St=[{key:"general",label:"General",icon:s.jsx(Ie,{size:14})},{key:"plugins",label:"Plugins",icon:s.jsx(ge,{size:14})}];function Ct(e){const t=z.c(14),{activeSection:n,onNavigate:r}=e,{org:i}=J();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={suspense:!0},t[0]=l):l=t[0];const{data:o}=Ue(i.id,l);let m;t[1]!==n?(m=ke(n),t[1]=n,t[2]=m):m=t[2];const u=m;let f;if(t[3]!==u?.slug||t[4]!==n||t[5]!==r||t[6]!==o){let x;t[8]!==u?.slug||t[9]!==n||t[10]!==r?(x=a=>{const g=u?.slug===a.slug;return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("button",{type:"button",onClick:()=>r(pe(a.slug,"general")),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",g?"text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("div",{className:"size-4 shrink-0 rounded-[3px] flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:a.ui?.themeColor??"#60a5fa"},children:a.ui?.icon?s.jsx("img",{src:a.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"text-[8px] font-semibold text-white leading-none",children:(a.name??a.slug).charAt(0).toUpperCase()})}),s.jsx("span",{className:"truncate",children:a.name??a.slug})]}),g&&s.jsx("div",{className:"ml-3 flex flex-col gap-0.5 border-l border-border pl-2.5",children:St.map(j=>{const h=pe(a.slug,j.key);return s.jsxs("button",{type:"button",onClick:()=>r(h),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",n===h?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:j.icon}),s.jsx("span",{className:"truncate",children:j.label})]},j.key)})})]},a.slug)},t[8]=u?.slug,t[9]=n,t[10]=r,t[11]=x):x=t[11],f=(o??[]).filter(_t).map(x),t[3]=u?.slug,t[4]=n,t[5]=r,t[6]=o,t[7]=f}else f=t[7];let d;return t[12]!==f?(d=s.jsx(s.Fragment,{children:f}),t[12]=f,t[13]=d):d=t[13],d}function _t(e){return e.slug!==G}function Pt(e){const t=z.c(29),{activeSection:n,onNavigate:r}=e,{data:i}=me.useSession(),[l]=ue(),o=i?.user,m=o?.image,u=o?.name??"Profile",f=o?.name??"U";let d;t[0]!==f||t[1]!==m?(d=s.jsx(we,{url:m,fallback:f,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),t[0]=f,t[1]=m,t[2]=d):d=t[2];let x;t[3]!==u||t[4]!==d?(x={key:"account.profile",label:u,icon:d},t[3]=u,t[4]=d,t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a={key:"account.preferences",label:"Preferences",icon:s.jsx(Ie,{size:14})},t[6]=a):a=t[6];let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g={key:"account.experimental",label:"Experimental",icon:s.jsx(Oe,{size:14})},t[7]=g):g=t[7];let j;t[8]!==x?(j=[x,a,g],t[8]=x,t[9]=j):j=t[9];const h=j;let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"org.general",label:"General",icon:s.jsx(We,{size:14})},t[10]=y):y=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S=[y,{key:"org.plugins",label:"Plugins",icon:s.jsx(ge,{size:14})}],t[11]=S):S=t[11];const C=S;let _;t[12]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),t[12]=_):_=t[12];let v;t[13]!==h||t[14]!==n||t[15]!==r?(v=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[_,h.map(P=>s.jsxs("button",{type:"button",onClick:()=>r(P.key),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",n===P.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:P.icon}),s.jsx("span",{className:"truncate",children:P.label})]},P.key))]}),t[13]=h,t[14]=n,t[15]=r,t[16]=v):v=t[16];let c;t[17]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),t[17]=c):c=t[17];let p;t[18]!==n||t[19]!==r?(p=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[c,C.map(P=>s.jsxs("button",{type:"button",onClick:()=>r(P.key),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",n===P.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:P.icon}),s.jsx("span",{className:"truncate",children:P.label})]},P.key))]}),t[18]=n,t[19]=r,t[20]=p):p=t[20];let b;t[21]!==n||t[22]!==r||t[23]!==l.experimental_projects?(b=l.experimental_projects&&s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Projects"}),s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/50",children:"Loading…"}),children:s.jsx(Ct,{activeSection:n,onNavigate:r})})]}),t[21]=n,t[22]=r,t[23]=l.experimental_projects,t[24]=b):b=t[24];let N;return t[25]!==v||t[26]!==p||t[27]!==b?(N=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[v,p,b]}),t[25]=v,t[26]=p,t[27]=b,t[28]=N):N=t[28],N}function kt(){const e=z.c(32),{data:t}=me.useSession(),[n,r]=O.useState(!1),i=t?.user,l=i?.image;let o;e[0]!==i?(o=()=>{i?.id&&navigator.clipboard.writeText(i.id).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})},e[0]=i,e[1]=o):o=e[1];const m=o;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),e[2]=u):u=e[2];const f=i?.name??"U";let d;e[3]!==f||e[4]!==l?(d=s.jsx(we,{url:l,fallback:f,shape:"circle",size:"xl",className:"size-16 shrink-0"}),e[3]=f,e[4]=l,e[5]=d):d=e[5];const x=i?.name??"User";let a;e[6]!==x?(a=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:x}),e[6]=x,e[7]=a):a=e[7];const g=i?.email;let j;e[8]!==g?(j=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:g}),e[8]=g,e[9]=j):j=e[9];let h;e[10]!==a||e[11]!==j?(h=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[a,j]}),e[10]=a,e[11]=j,e[12]=h):h=e[12];let y;e[13]!==d||e[14]!==h?(y=s.jsxs("div",{className:"flex items-center gap-4",children:[d,h]}),e[13]=d,e[14]=h,e[15]=y):y=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),e[16]=S):S=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),e[17]=C):C=e[17];const _=i?.id;let v;e[18]!==_?(v=s.jsx("span",{className:"font-mono text-sm",children:_}),e[18]=_,e[19]=v):v=e[19];let c;e[20]!==n?(c=n?s.jsx(He,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Ye,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),e[20]=n,e[21]=c):c=e[21];let p;e[22]!==m||e[23]!==v||e[24]!==c?(p=s.jsx(Ke,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:m,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[v,c]})}),e[22]=m,e[23]=v,e[24]=c,e[25]=p):p=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Qe,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[26]=b):b=e[26];let N;e[27]!==p?(N=s.jsxs("div",{className:"flex flex-col",children:[S,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[C,s.jsx(Ve,{children:s.jsxs(Je,{children:[p,b]})})]})]}),e[27]=p,e[28]=N):N=e[28];let P;return e[29]!==N||e[30]!==y?(P=s.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,N]}),e[29]=N,e[30]=y,e[31]=P):P=e[31],P}function ie(e){const t=z.c(27),{icon:n,label:r,description:i,control:l,onClick:o,disabled:m}=e,u=m?void 0:o,f=o?"button":void 0,d=o&&!m?0:void 0;let x;t[0]!==m||t[1]!==o?(x=o&&!m?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())}:void 0,t[0]=m,t[1]=o,t[2]=x):x=t[2];const a=o&&!m?"pointer":void 0;let g;t[3]!==a?(g={cursor:a},t[3]=a,t[4]=g):g=t[4];let j;t[5]!==n?(j=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:n}),t[5]=n,t[6]=j):j=t[6];let h;t[7]!==r?(h=s.jsx("p",{className:"text-sm font-medium text-foreground",children:r}),t[7]=r,t[8]=h):h=t[8];let y;t[9]!==i?(y=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:i}),t[9]=i,t[10]=y):y=t[10];let S;t[11]!==h||t[12]!==y?(S=s.jsxs("div",{className:"min-w-0",children:[h,y]}),t[11]=h,t[12]=y,t[13]=S):S=t[13];let C;t[14]!==S||t[15]!==j?(C=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[j,S]}),t[14]=S,t[15]=j,t[16]=C):C=t[16];let _;t[17]!==l?(_=s.jsx("div",{onClick:wt,className:"shrink-0",children:l}),t[17]=l,t[18]=_):_=t[18];let v;return t[19]!==u||t[20]!==C||t[21]!==_||t[22]!==f||t[23]!==d||t[24]!==x||t[25]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:u,role:f,tabIndex:d,onKeyDown:x,style:g,children:[C,_]}),t[19]=u,t[20]=C,t[21]=_,t[22]=f,t[23]=d,t[24]=x,t[25]=g,t[26]=v):v=t[26],v}function wt(e){return e.stopPropagation()}function he(){const e=z.c(35),[t,n]=ue();let r;e[0]!==n?(r=async b=>{if(b&&await Notification.requestPermission()!=="granted"){R.error("Notifications denied. Please enable them in your browser settings."),n(zt);return}n(N=>({...N,enableNotifications:b}))},e[0]=n,e[1]=r):r=e[1];const i=r;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(et,{size:16}),e[3]=o):o=e[3];let m;e[4]!==n?(m=()=>n(It),e[4]=n,e[5]=m):m=e[5];let u;e[6]!==n?(u=b=>n(N=>({...N,devMode:b})),e[6]=n,e[7]=u):u=e[7];let f;e[8]!==t.devMode||e[9]!==u?(f=s.jsx(se,{checked:t.devMode,onCheckedChange:u}),e[8]=t.devMode,e[9]=u,e[10]=f):f=e[10];let d;e[11]!==m||e[12]!==f?(d=s.jsx(ie,{icon:o,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:m,control:f}),e[11]=m,e[12]=f,e[13]=d):d=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Te,{size:16}),e[14]=x):x=e[14];let a;e[15]!==i||e[16]!==t.enableNotifications?(a=s.jsx(ie,{icon:x,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>i(!t.enableNotifications),control:s.jsx(se,{disabled:typeof Notification>"u",checked:t.enableNotifications,onCheckedChange:i})}),e[15]=i,e[16]=t.enableNotifications,e[17]=a):a=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(tt,{size:16}),e[18]=g):g=e[18];let j;e[19]!==n?(j=b=>n(N=>({...N,toolApprovalLevel:b})),e[19]=n,e[20]=j):j=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h={none:"None",readonly:"Read-only",yolo:"YOLO"},e[21]=h):h=e[21];const y=h[t.toolApprovalLevel];let S;e[22]!==y?(S=s.jsx(Ee,{className:"w-36",children:s.jsx("span",{children:y})}),e[22]=y,e[23]=S):S=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Y,{value:"none",textValue:"None",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"None"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),e[24]=C):C=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Y,{value:"readonly",textValue:"Read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[25]=_):_=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs($e,{children:[C,_,s.jsx(Y,{value:"yolo",textValue:"YOLO",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"YOLO"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),e[26]=v):v=e[26];let c;e[27]!==t.toolApprovalLevel||e[28]!==j||e[29]!==S?(c=s.jsx(ie,{icon:g,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(ze,{value:t.toolApprovalLevel,onValueChange:j,children:[S,v]})}),e[27]=t.toolApprovalLevel,e[28]=j,e[29]=S,e[30]=c):c=e[30];let p;return e[31]!==c||e[32]!==d||e[33]!==a?(p=s.jsxs("div",{className:"flex flex-col gap-6",children:[l,s.jsxs("div",{className:"flex flex-col",children:[d,a,c]})]}),e[31]=c,e[32]=d,e[33]=a,e[34]=p):p=e[34],p}function It(e){return{...e,devMode:!e.devMode}}function zt(e){return{...e,enableNotifications:!1}}function je(e){const t=z.c(22),{icon:n,label:r,description:i,checked:l,onCheckedChange:o}=e;let m;t[0]!==l||t[1]!==o?(m=()=>o(!l),t[0]=l,t[1]=o,t[2]=m):m=t[2];let u;t[3]!==n?(u=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:n}),t[3]=n,t[4]=u):u=t[4];let f;t[5]!==r?(f=s.jsx("p",{className:"text-sm font-medium text-foreground",children:r}),t[5]=r,t[6]=f):f=t[6];let d;t[7]!==i?(d=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:i}),t[7]=i,t[8]=d):d=t[8];let x;t[9]!==f||t[10]!==d?(x=s.jsxs("div",{className:"min-w-0",children:[f,d]}),t[9]=f,t[10]=d,t[11]=x):x=t[11];let a;t[12]!==u||t[13]!==x?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[u,x]}),t[12]=u,t[13]=x,t[14]=a):a=t[14];let g;t[15]!==l||t[16]!==o?(g=s.jsx("div",{onClick:Et,className:"shrink-0",children:s.jsx(se,{checked:l,onCheckedChange:o})}),t[15]=l,t[16]=o,t[17]=g):g=t[17];let j;return t[18]!==m||t[19]!==a||t[20]!==g?(j=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:m,children:[a,g]}),t[18]=m,t[19]=a,t[20]=g,t[21]=j):j=t[21],j}function Et(e){return e.stopPropagation()}function $t(){const e=z.c(16),[t,n]=ue();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Le,{size:16}),e[1]=i):i=e[1];let l;e[2]!==n?(l=x=>n(a=>({...a,experimental_projects:x})),e[2]=n,e[3]=l):l=e[3];let o;e[4]!==t.experimental_projects||e[5]!==l?(o=s.jsx(je,{icon:i,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:t.experimental_projects,onCheckedChange:l}),e[4]=t.experimental_projects,e[5]=l,e[6]=o):o=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(st,{size:16}),e[7]=m):m=e[7];let u;e[8]!==n?(u=x=>n(a=>({...a,experimental_tasks:x})),e[8]=n,e[9]=u):u=e[9];let f;e[10]!==t.experimental_tasks||e[11]!==u?(f=s.jsx(je,{icon:m,label:"Tasks",description:"Enable the tasks feature in the sidebar.",checked:t.experimental_tasks,onCheckedChange:u}),e[10]=t.experimental_tasks,e[11]=u,e[12]=f):f=e[12];let d;return e[13]!==o||e[14]!==f?(d=s.jsxs("div",{className:"flex flex-col gap-6",children:[r,s.jsxs("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:[o,f]})]}),e[13]=o,e[14]=f,e[15]=d):d=e[15],d}const Dt=ve({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:W().optional()});function Ot(e){const t=z.c(24),{value:n,onChange:r,name:i}=e,l=O.useRef(null);let o;t[0]!==r?(o=v=>{const c=v.target.files?.[0];if(c){if(c.size>2097152){R.error("Image must be smaller than 2MB");return}const p=new FileReader;p.onerror=()=>{const b=p.error;console.error("FileReader error:",b),R.error(b?.message||"Failed to read image file. Please try again."),l.current&&(l.current.value="")},p.onloadend=()=>{if(p.readyState===FileReader.DONE&&p.result){const b=p.result;r(b)}},p.readAsDataURL(c)}},t[0]=r,t[1]=o):o=t[1];const m=o;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l.current?.click()},t[2]=u):u=t[2];const f=u;let d;t[3]!==r?(d=v=>{v.stopPropagation(),r("")},t[3]=r,t[4]=d):d=t[4];const x=d;let a;t[5]!==m?(a=s.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:m}),t[5]=m,t[6]=a):a=t[6];let g;t[7]!==x||t[8]!==i||t[9]!==n?(g=n?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:n,alt:i||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:x,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Pe,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:f,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(nt,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=x,t[8]=i,t[9]=n,t[10]=g):g=t[10];const j=n?"Change Logo":"Upload Logo";let h;t[11]!==j?(h=s.jsx(U,{type:"button",variant:"outline",size:"sm",onClick:f,className:"mb-2",children:j}),t[11]=j,t[12]=h):h=t[12];let y;t[13]!==x||t[14]!==n?(y=n&&s.jsx(U,{type:"button",variant:"ghost",size:"sm",onClick:x,className:"ml-2",children:"Remove"}),t[13]=x,t[14]=n,t[15]=y):y=t[15];let S;t[16]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=S):S=t[16];let C;t[17]!==h||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[h,y,S]}),t[17]=h,t[18]=y,t[19]=C):C=t[19];let _;return t[20]!==C||t[21]!==a||t[22]!==g?(_=s.jsxs("div",{className:"flex items-start gap-4",children:[a,g,C]}),t[20]=C,t[21]=a,t[22]=g,t[23]=_):_=t[23],_}function Tt(){const e=ne(),{org:t,project:n}=J(),r=le(),[i,l]=O.useState(!1),o=Ne({resolver:Se(Dt),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),m=oe({mutationFn:async d=>{const x={name:d.name,slug:d.slug};d.logo&&(x.logo=d.logo);const a=await me.organization.update({organizationId:t.id,data:x});if(a?.error)throw new Error(a.error.message||"Failed to update organization");return a},onSuccess:d=>{r.invalidateQueries({queryKey:q.organizations()}),r.invalidateQueries({queryKey:q.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),d?.data?.slug&&d.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:d.data.slug,project:n.slug}})},onError:d=>{R.error(d instanceof Error?d.message:"Failed to update organization")},onSettled:()=>{l(!1)}}),u=d=>{l(!0),m.mutate(d)},f=o.formState.isDirty;return s.jsx(De,{...o,children:s.jsxs("form",{onSubmit:o.handleSubmit(u),className:"space-y-6",children:[s.jsx(Z,{control:o.control,name:"name",render:({field:d})=>s.jsxs(K,{children:[s.jsx(Q,{children:"Organization Name"}),s.jsx(V,{children:s.jsx(ee,{placeholder:"My Organization",...d,disabled:i})}),s.jsx(H,{})]})}),s.jsx(Z,{control:o.control,name:"slug",render:({field:d})=>s.jsxs(K,{children:[s.jsx(Q,{children:"Organization Slug"}),s.jsx(V,{children:s.jsx(ee,{placeholder:"my-organization",...d,disabled:i,onChange:x=>{const a=x.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");d.onChange(a)}})}),s.jsx(ce,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(H,{})]})}),s.jsx(Z,{control:o.control,name:"logo",render:({field:d})=>s.jsxs(K,{children:[s.jsx(Q,{children:"Logo"}),s.jsx(V,{children:s.jsx(Ot,{value:d.value,onChange:d.onChange,name:o.watch("name")})}),s.jsx(H,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(U,{type:"submit",disabled:!f||i,className:"min-w-24",children:i?"Saving...":"Save Changes"}),f&&s.jsx(U,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:i,children:"Cancel"})]})]})})}function At(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(Tt,{})]}),e[0]=t):t=e[0],t}const Ft=ve({name:W().min(1,"Name is required").max(200,"Name is too long"),description:W().max(1e3,"Description is too long").nullable(),themeColor:W().nullable()});function Lt(){const e=z.c(63),{org:t,project:n}=J(),r=le(),i=n.slug===G;let l;e[0]!==t.id?(l={connectionId:fe,orgId:t.id},e[0]=t.id,e[1]=l):l=e[1];const o=xe(l);let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=Se(Ft),e[2]=m):m=e[2];const u=n.name??"",f=n.description??"",d=n.ui?.themeColor??"#60a5fa";let x;e[3]!==u||e[4]!==f||e[5]!==d?(x={resolver:m,values:{name:u,description:f,themeColor:d}},e[3]=u,e[4]=f,e[5]=d,e[6]=x):x=e[6];const a=Ne(x);let g;e[7]!==o||e[8]!==n.id||e[9]!==n.ui?.banner||e[10]!==n.ui?.bannerColor||e[11]!==n.ui?.icon?(g=async k=>{const w=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:n.id,name:k.name,description:k.description||null,ui:{themeColor:k.themeColor||null,banner:n.ui?.banner??null,bannerColor:n.ui?.bannerColor??null,icon:n.ui?.icon??null}}});return w.structuredContent??w},e[7]=o,e[8]=n.id,e[9]=n.ui?.banner,e[10]=n.ui?.bannerColor,e[11]=n.ui?.icon,e[12]=g):g=e[12];let j;e[13]!==a||e[14]!==t.id||e[15]!==n.slug||e[16]!==r?(j=()=>{r.invalidateQueries({queryKey:q.project(t.id,n.slug)}),r.invalidateQueries({queryKey:q.projects(t.id)}),a.reset(a.getValues())},e[13]=a,e[14]=t.id,e[15]=n.slug,e[16]=r,e[17]=j):j=e[17];let h;e[18]!==g||e[19]!==j?(h={mutationFn:g,onSuccess:j,onError:Bt},e[18]=g,e[19]=j,e[20]=h):h=e[20];const y=oe(h);let S;e[21]!==y?(S=async k=>{await y.mutateAsync(k)},e[21]=y,e[22]=S):S=e[22];const C=S;let _;e[23]!==a||e[24]!==C?(_=k=>{k(),a.handleSubmit(C)()},e[23]=a,e[24]=C,e[25]=_):_=e[25];const v=_;let c;e[26]!==a||e[27]!==C?(c=a.handleSubmit(C),e[26]=a,e[27]=C,e[28]=c):c=e[28];let p;e[29]!==i||e[30]!==y.isPending||e[31]!==v?(p=k=>{const{field:w}=k;return s.jsxs(K,{children:[s.jsx(Q,{children:"Project Name"}),s.jsx(V,{children:s.jsx(ee,{placeholder:"My Project",...w,onBlur:()=>v(w.onBlur),disabled:i||y.isPending})}),i&&s.jsx(ce,{children:"The organization admin project name cannot be changed."}),s.jsx(H,{})]})},e[29]=i,e[30]=y.isPending,e[31]=v,e[32]=p):p=e[32];let b;e[33]!==a.control||e[34]!==p?(b=s.jsx(Z,{control:a.control,name:"name",render:p}),e[33]=a.control,e[34]=p,e[35]=b):b=e[35];let N;e[36]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Q,{children:"Slug"}),e[36]=N):N=e[36];let P;e[37]!==n.slug?(P=s.jsx(V,{children:s.jsx(ee,{value:n.slug,disabled:!0,className:"bg-muted"})}),e[37]=n.slug,e[38]=P):P=e[38];let I;e[39]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ce,{children:"The project slug cannot be changed after creation."}),e[39]=I):I=e[39];let E;e[40]!==P?(E=s.jsxs(K,{children:[N,P,I]}),e[40]=P,e[41]=E):E=e[41];let T;e[42]!==y.isPending||e[43]!==v?(T=k=>{const{field:w}=k;return s.jsxs(K,{children:[s.jsx(Q,{children:"Description"}),s.jsx(V,{children:s.jsx(lt,{placeholder:"Optional project description...",rows:3,...w,value:w.value??"",onBlur:()=>v(w.onBlur),disabled:y.isPending})}),s.jsx(H,{})]})},e[42]=y.isPending,e[43]=v,e[44]=T):T=e[44];let $;e[45]!==a.control||e[46]!==T?($=s.jsx(Z,{control:a.control,name:"description",render:T}),e[45]=a.control,e[46]=T,e[47]=$):$=e[47];let D;e[48]!==y.isPending||e[49]!==v?(D=k=>{const{field:w}=k;return s.jsxs(K,{children:[s.jsx(Q,{children:"Color"}),s.jsx(V,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"size-9 rounded-md border border-input overflow-hidden cursor-pointer shrink-0",style:{backgroundColor:w.value??"#60a5fa"},children:s.jsx("input",{type:"color",value:w.value??"#60a5fa",onChange:B=>w.onChange(B.target.value),onBlur:()=>v(w.onBlur),disabled:y.isPending,className:"opacity-0 w-full h-full cursor-pointer"})}),s.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:w.value??"#60a5fa"})]})}),s.jsx(H,{})]})},e[48]=y.isPending,e[49]=v,e[50]=D):D=e[50];let A;e[51]!==a.control||e[52]!==D?(A=s.jsx(Z,{control:a.control,name:"themeColor",render:D}),e[51]=a.control,e[52]=D,e[53]=A):A=e[53];let F;e[54]!==c||e[55]!==b||e[56]!==E||e[57]!==$||e[58]!==A?(F=s.jsxs("form",{onSubmit:c,className:"space-y-6",children:[b,E,$,A]}),e[54]=c,e[55]=b,e[56]=E,e[57]=$,e[58]=A,e[59]=F):F=e[59];let L;return e[60]!==a||e[61]!==F?(L=s.jsx("div",{className:"flex flex-col",children:s.jsx(De,{...a,children:F})}),e[60]=a,e[61]=F,e[62]=L):L=e[62],L}function Bt(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Ae(){const e=z.c(45),{org:t,project:n}=J(),r=ne(),i=le(),[l,o]=O.useState(""),[m,u]=O.useState(!1),f=n.slug===G;let d;e[0]!==t.id?(d={connectionId:fe,orgId:t.id},e[0]=t.id,e[1]=d):d=e[1];const x=xe(d);let a;e[2]!==x||e[3]!==n.id?(a=async()=>{const M=await x.callTool({name:"PROJECT_DELETE",arguments:{projectId:n.id}});return M.structuredContent??M},e[2]=x,e[3]=n.id,e[4]=a):a=e[4];let g;e[5]!==r||e[6]!==t.id||e[7]!==t.slug||e[8]!==i?(g=M=>{M.success?(i.invalidateQueries({queryKey:q.projects(t.id)}),R.success("Project deleted"),r({to:"/$org/$project",params:{org:t.slug,project:G}})):R.error(M.message??"Failed to delete project")},e[5]=r,e[6]=t.id,e[7]=t.slug,e[8]=i,e[9]=g):g=e[9];let j;e[10]!==a||e[11]!==g?(j={mutationFn:a,onSuccess:g,onError:Rt},e[10]=a,e[11]=g,e[12]=j):j=e[12];const h=oe(j);if(f)return null;const y=l===n.name;let S;e[13]!==h?(S=()=>{h.mutate()},e[13]=h,e[14]=S):S=e[14];const C=S;let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=M=>{u(M),M||o("")},e[15]=_):_=e[15];const v=_;let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"Danger Zone"}),e[16]=c):c=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete Project"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Permanently delete this project and all its data. This action cannot be undone."})]}),e[17]=p):p=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(rt,{asChild:!0,children:s.jsx(U,{variant:"outline",className:"shrink-0 bg-destructive/10 text-destructive border-0 hover:bg-destructive/15 hover:text-destructive",children:"Delete Project"})}),e[18]=b):b=e[18];let N;e[19]!==n.name?(N=s.jsxs(ot,{children:['Delete "',n.name,'"?']}),e[19]=n.name,e[20]=N):N=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(it,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[21]=P):P=e[21];let I;e[22]!==N?(I=s.jsxs(at,{children:[N,P]}),e[22]=N,e[23]=I):I=e[23];let E;e[24]!==n.name?(E=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:n.name})," to confirm:"]}),e[24]=n.name,e[25]=E):E=e[25];let T;e[26]===Symbol.for("react.memo_cache_sentinel")?(T=M=>o(M.target.value),e[26]=T):T=e[26];let $;e[27]!==l||e[28]!==n.name?($=s.jsx(ee,{value:l,onChange:T,placeholder:n.name}),e[27]=l,e[28]=n.name,e[29]=$):$=e[29];let D;e[30]!==E||e[31]!==$?(D=s.jsxs("div",{className:"py-4",children:[E,$]}),e[30]=E,e[31]=$,e[32]=D):D=e[32];let A;e[33]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ct,{children:"Cancel"}),e[33]=A):A=e[33];const F=!y||h.isPending,L=h.isPending?"Deleting...":"Delete Project";let k;e[34]!==C||e[35]!==F||e[36]!==L?(k=s.jsxs(dt,{children:[A,s.jsx(mt,{onClick:C,disabled:F,className:"bg-destructive/10 text-destructive hover:bg-destructive/15 hover:text-destructive border-0",children:L})]}),e[34]=C,e[35]=F,e[36]=L,e[37]=k):k=e[37];let w;e[38]!==I||e[39]!==D||e[40]!==k?(w=s.jsxs(ut,{children:[I,D,k]}),e[38]=I,e[39]=D,e[40]=k,e[41]=w):w=e[41];let B;return e[42]!==m||e[43]!==w?(B=s.jsxs("div",{className:"flex flex-col",children:[c,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[p,s.jsxs(ft,{open:m,onOpenChange:v,children:[b,w]})]})]}),e[42]=m,e[43]=w,e[44]=B):B=e[44],B}function Rt(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function Mt(){const e=z.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"General"}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col",children:[t,s.jsxs("div",{className:"pt-6 flex flex-col gap-6",children:[s.jsx(Lt,{}),s.jsx(Ae,{})]})]}),e[1]=n):n=e[1],n}function Ut({value:e,onValueChange:t,placeholder:n="Select a connection...",binding:r,bindingType:i,onAddNew:l,className:o,disabled:m=!1}){const[u,f]=O.useState(!1),{installByBinding:d,isInstalling:x}=yt(),a=u||x,g=ht(),j=jt({connections:g,binding:typeof r=="string"?r:void 0}),h=!r||!g?g??[]:typeof r=="string"?j:Array.isArray(r)&&r.length>0?g.filter(c=>bt(c,r)):g,y=(()=>{if(!i?.startsWith("@"))return null;const[c,p]=i.replace("@","").split("/");return c&&p?{scope:c,appName:p}:null})(),S=(()=>{let c=h;const p=Array.isArray(r)&&r.length>0;if(y&&!p&&(c=c.filter(b=>{const N=b.app_name,P=b.metadata?.scopeName;return N===y.appName&&P===y.scope})),e&&!c.some(b=>b.id===e)){const b=g?.find(N=>N.id===e);if(b)return[b,...c]}return c})(),C=i?.startsWith("@"),_=async()=>{if(C&&i){f(!0);try{const c=await d(i);c&&t(c.id)}finally{f(!1)}return}l?.()},v=S.find(c=>c.id===e);return s.jsxs(ze,{value:e??"none",onValueChange:c=>t(c==="none"?null:c),disabled:m,children:[s.jsx(Ee,{size:"sm",className:X("w-[200px]",o),children:s.jsx(Xe,{placeholder:n,children:v?s.jsxs("div",{className:"flex items-center gap-2",children:[v.icon?s.jsx("img",{src:v.icon,alt:v.title,className:"w-4 h-4 rounded shrink-0"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:v.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:v.title})]}):n})}),s.jsxs($e,{children:[s.jsx(Y,{value:"none",children:"No connection"}),S.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):S.map(c=>s.jsx(Y,{value:c.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[c.icon?s.jsx("img",{src:c.icon,alt:c.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:c.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:c.title})]})},c.id)),(l||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(U,{onPointerDown:c=>c.stopPropagation(),onClick:c=>{c.preventDefault(),c.stopPropagation(),_()},disabled:a||m,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:a?s.jsxs(s.Fragment,{children:[s.jsx(vt,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const qt=e=>{if(!e||typeof e!="object")return!1;const t=e;return t.type==="text"&&typeof t.text=="string"&&t.text.trim().toLowerCase().startsWith("error")},de=e=>{const t=e.structuredContent??e,n=t&&typeof t=="object"?t:null,r=n?.content?.[0]?.text&&typeof n.content[0].text=="string"?n.content[0].text:null;if(n?.isError)throw new Error(r??"Tool call failed");if(qt(t))throw new Error(t.text);return t};function Gt(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function Kt(e){const t=z.c(57),{plugin:n,isEnabled:r,isSaving:i,pendingBinding:l,description:o,label:m,icon:u,projectId:f,client:d,onBindingChange:x,onToggle:a}=e;let g;t[0]!==n?(g=Gt(n),t[0]=n,t[1]=g):g=t[1];const j=g;let h;t[2]!==n.id||t[3]!==f?(h=q.projectPluginConfig(f??"",n.id),t[2]=n.id,t[3]=f,t[4]=h):h=t[4];let y;t[5]!==d||t[6]!==n.id||t[7]!==f?(y=async()=>{if(!f)throw new Error("Project ID is required to load plugin config.");const B=await d.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:f,pluginId:n.id}});return de(B)},t[5]=d,t[6]=n.id,t[7]=f,t[8]=y):y=t[8];const S=!!f&&j;let C;t[9]!==h||t[10]!==y||t[11]!==S?(C={queryKey:h,queryFn:y,enabled:S},t[9]=h,t[10]=y,t[11]=S,t[12]=C):C=t[12];const{data:_,isLoading:v}=xt(C),c=_?.config?.connectionId??null,p=l!==void 0?l:c;let b;t[13]!==r||t[14]!==i||t[15]!==a||t[16]!==n.id?(b=()=>!i&&a(n.id,!r),t[13]=r,t[14]=i,t[15]=a,t[16]=n.id,t[17]=b):b=t[17];const N=i?void 0:"pointer";let P;t[18]!==N?(P={cursor:N},t[18]=N,t[19]=P):P=t[19];let I;t[20]!==u?(I=u&&s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:u}),t[20]=u,t[21]=I):I=t[21];let E;t[22]!==m?(E=s.jsx("p",{className:"text-sm font-medium text-foreground",children:m}),t[22]=m,t[23]=E):E=t[23];let T;t[24]!==o?(T=o&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:o}),t[24]=o,t[25]=T):T=t[25];let $;t[26]!==E||t[27]!==T?($=s.jsxs("div",{className:"min-w-0",children:[E,T]}),t[26]=E,t[27]=T,t[28]=$):$=t[28];let D;t[29]!==$||t[30]!==I?(D=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[I,$]}),t[29]=$,t[30]=I,t[31]=D):D=t[31];let A;t[32]!==a||t[33]!==n.id?(A=B=>a(n.id,B),t[32]=a,t[33]=n.id,t[34]=A):A=t[34];let F;t[35]!==r||t[36]!==i||t[37]!==A?(F=s.jsx("div",{onClick:Vt,className:"shrink-0",children:s.jsx(se,{checked:r,onCheckedChange:A,disabled:i})}),t[35]=r,t[36]=i,t[37]=A,t[38]=F):F=t[38];let L;t[39]!==D||t[40]!==F?(L=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[D,F]}),t[39]=D,t[40]=F,t[41]=L):L=t[41];let k;t[42]!==v||t[43]!==r||t[44]!==i||t[45]!==j||t[46]!==x||t[47]!==n.binding||t[48]!==n.id||t[49]!==p||t[50]!==c?(k=r&&j&&s.jsxs("div",{onClick:Qt,className:"pb-4 pl-7 flex items-center gap-3",children:[s.jsx(gt,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Ut,{value:p??null,onValueChange:B=>x(n.id,B,c),binding:n.binding,placeholder:"Select connection...",className:"w-56",disabled:i||v})]}),t[42]=v,t[43]=r,t[44]=i,t[45]=j,t[46]=x,t[47]=n.binding,t[48]=n.id,t[49]=p,t[50]=c,t[51]=k):k=t[51];let w;return t[52]!==L||t[53]!==k||t[54]!==b||t[55]!==P?(w=s.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:b,style:P,children:[L,k]}),t[52]=L,t[53]=k,t[54]=b,t[55]=P,t[56]=w):w=t[56],w}function Qt(e){return e.stopPropagation()}function Vt(e){return e.stopPropagation()}function Jt(){const{org:e,project:t}=J(),n=le(),r=xe({connectionId:fe,orgId:e.id}),[i,l]=O.useState({}),[o,m]=O.useState({}),[u,f]=O.useState(!1),d=t.enabledPlugins??[],x=c=>{const p=i[c];return p!==void 0?p:d.includes(c)},a=()=>{const c=new Set(d);for(const[p,b]of Object.entries(i))b?c.add(p):c.delete(p);return Array.from(c)},g=Object.keys(i).length>0||Object.keys(o).length>0,j=(c,p)=>{const b=d.includes(c);l(p===b?N=>{const{[c]:P,...I}=N;return I}:N=>({...N,[c]:p}))},h=(c,p,b)=>{if(p===b){m(N=>{const{[c]:P,...I}=N;return I});return}m(N=>({...N,[c]:p}))},y=oe({mutationFn:async c=>{const p=[];if(c.updatePlugins){const b=await r.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:c.enabledPlugins}});p.push(de(b))}if(c.bindingUpdates.length>0){const b=await Promise.all(c.bindingUpdates.map(async({pluginId:N,connectionId:P})=>{const I=await r.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:N,connectionId:P}});return de(I)}));p.push(...b)}return p},onSuccess:(c,p)=>{p.updatePlugins&&(n.invalidateQueries({queryKey:q.project(e.id,t.slug)}),n.invalidateQueries({queryKey:q.projects(e.id)})),p.bindingUpdates.forEach(({pluginId:b})=>{n.invalidateQueries({queryKey:q.projectPluginConfig(t.id??"",b)})}),l({}),m({}),R.success("Plugins updated successfully")},onError:c=>{R.error("Failed to update plugins: "+(c instanceof Error?c.message:"Unknown error"))},onSettled:()=>{f(!1)}}),S=()=>{f(!0),y.mutate({enabledPlugins:a(),updatePlugins:Object.keys(i).length>0,bindingUpdates:Object.entries(o).map(([c,p])=>({pluginId:c,connectionId:p}))})},C=()=>{l({}),m({})},_=c=>{const p=Be.find(b=>b.pluginId===c);return p?{label:p.label,icon:p.items[0]?.icon}:null},v=c=>re.find(b=>b.id===c)?.description??null;return re.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex flex-col",children:re.map(c=>{const p=_(c.id),b=v(c.id),N=x(c.id);return s.jsx(Kt,{plugin:c,isEnabled:N,isSaving:u,pendingBinding:o[c.id],description:b,label:p?.label??c.id,icon:p?.icon??s.jsx(pt,{size:14}),projectId:t.id,client:r,onBindingChange:h,onToggle:j},c.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(U,{variant:"outline",onClick:C,disabled:!g||u,children:"Cancel"}),s.jsx(U,{onClick:S,disabled:!g||u,className:"min-w-24",children:u?"Saving...":"Save Changes"})]})]})}function be(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Plugins"})}),s.jsx(Jt,{})]}),e[0]=t):t=e[0],t}function Wt(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),s.jsx(Ae,{})]}),e[0]=t):t=e[0],t}function Fe(){const e=z.c(3);let t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te,{className:"h-6 w-48"}),n=s.jsx(te,{className:"h-4 w-80"}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[t,n,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(te,{className:"h-12 w-full"}),s.jsx(te,{className:"h-12 w-full"})]})]}),e[2]=r):r=e[2],r}function ye(e){const t=z.c(14),{projectSlug:n,children:r}=e,{org:i}=J(),{data:l,isLoading:o}=_e(i.id,n);if(o||!l){let x;return t[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Fe,{}),t[0]=x):x=t[0],x}const m=n===G;let u;t[1]!==l.description||t[2]!==l.enabledPlugins||t[3]!==l.id||t[4]!==l.name||t[5]!==l.organizationId||t[6]!==l.slug||t[7]!==l.ui||t[8]!==m?(u={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:m},t[1]=l.description,t[2]=l.enabledPlugins,t[3]=l.id,t[4]=l.name,t[5]=l.organizationId,t[6]=l.slug,t[7]=l.ui,t[8]=m,t[9]=u):u=t[9];const f=u;let d;return t[10]!==r||t[11]!==f||t[12]!==i?(d=s.jsx(Ce,{org:i,project:f,children:r}),t[10]=r,t[11]=f,t[12]=i,t[13]=d):d=t[13],d}function Zt(e){const t=z.c(19),{section:n}=e;let r;t[0]!==n?(r=ke(n),t[0]=n,t[1]=r):r=t[1];const i=r;if(i){let l;t[2]!==i.sub?(l=i.sub==="general"&&s.jsx(Mt,{}),t[2]=i.sub,t[3]=l):l=t[3];let o;t[4]!==i.sub?(o=i.sub==="plugins"&&s.jsx(be,{}),t[4]=i.sub,t[5]=o):o=t[5];let m;t[6]!==i.sub?(m=i.sub==="danger"&&s.jsx(Wt,{}),t[6]=i.sub,t[7]=m):m=t[7];let u;return t[8]!==i.slug||t[9]!==l||t[10]!==o||t[11]!==m?(u=s.jsxs(ye,{projectSlug:i.slug,children:[l,o,m]}),t[8]=i.slug,t[9]=l,t[10]=o,t[11]=m,t[12]=u):u=t[12],u}switch(n){case"account.profile":{let l;return t[13]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),t[13]=l):l=t[13],l}case"account.preferences":{let l;return t[14]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{}),t[14]=l):l=t[14],l}case"account.experimental":{let l;return t[15]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx($t,{}),t[15]=l):l=t[15],l}case"org.general":{let l;return t[16]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(At,{}),t[16]=l):l=t[16],l}case"org.plugins":{let l;return t[17]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ye,{projectSlug:G,children:s.jsx(be,{})}),t[17]=l):l=t[17],l}default:{let l;return t[18]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{}),t[18]=l):l=t[18],l}}}function Ht(){const e=z.c(23),{isOpen:t,activeSection:n,open:r,close:i}=Ze();let l;e[0]!==i?(l=y=>!y&&i(),e[0]=i,e[1]=l):l=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),e[2]=o):o=e[2];let m;e[3]!==n||e[4]!==r?(m=s.jsx(O.Suspense,{fallback:o,children:s.jsx(Pt,{activeSection:n,onNavigate:r})}),e[3]=n,e[4]=r,e[5]=m):m=e[5];let u,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Pe,{size:16}),f=s.jsx("span",{className:"sr-only",children:"Close"}),e[6]=u,e[7]=f):(u=e[6],f=e[7]);let d;e[8]!==i?(d=s.jsxs("button",{type:"button",onClick:i,className:"absolute top-4 right-4 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[u,f]}),e[8]=i,e[9]=d):d=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Fe,{}),e[10]=x):x=e[10];let a;e[11]!==n?(a=s.jsx(O.Suspense,{fallback:x,children:s.jsx(Zt,{section:n})}),e[11]=n,e[12]=a):a=e[12];let g;e[13]!==d||e[14]!==a?(g=s.jsxs("div",{className:"flex-1 overflow-y-auto p-8 min-w-0 relative",children:[d,a]}),e[13]=d,e[14]=a,e[15]=g):g=e[15];let j;e[16]!==m||e[17]!==g?(j=s.jsx(qe,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[m,g]})}),e[16]=m,e[17]=g,e[18]=j):j=e[18];let h;return e[19]!==t||e[20]!==l||e[21]!==j?(h=s.jsx(Ge,{open:t,onOpenChange:l,children:j}),e[19]=t,e[20]=l,e[21]=j,e[22]=h):h=e[22],h}function Yt(e){const t=z.c(12),{projectSlug:n,orgSlug:r,error:i}=e,l=ne();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),t[0]=o):o=t[0];let m;t[1]!==n?(m=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',n,'".']}),t[1]=n,t[2]=m):m=t[2];let u;t[3]!==i.message?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.message}),t[3]=i.message,t[4]=u):u=t[4];let f;t[5]!==l||t[6]!==r?(f=s.jsx(U,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:r,project:G}}),children:"Go to organization home"}),t[5]=l,t[6]=r,t[7]=f):f=t[7];let d;return t[8]!==m||t[9]!==u||t[10]!==f?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[o,m,u,f]}),t[8]=m,t[9]=u,t[10]=f,t[11]=d):d=t[11],d}function Xt(e){const t=z.c(9),{projectSlug:n,orgSlug:r}=e,i=ne();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),t[0]=l):l=t[0];let o;t[1]!==n?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',n,'" does not exist in this organization.']}),t[1]=n,t[2]=o):o=t[2];let m;t[3]!==i||t[4]!==r?(m=s.jsx(U,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:r,project:G}}),children:"Go to organization home"}),t[3]=i,t[4]=r,t[5]=m):m=t[5];let u;return t[6]!==o||t[7]!==m?(u=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,o,m]}),t[6]=o,t[7]=m,t[8]=u):u=t[8],u}function es(){const e=z.c(23);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=Re(t),{org:r}=J(),i=n.org,l=n.project,{data:o,isLoading:m,error:u}=_e(r.id,l);if(m){let h;return e[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ae,{}),e[1]=h):h=e[1],h}if(u){let h;return e[2]!==u||e[3]!==i||e[4]!==l?(h=s.jsx(Yt,{projectSlug:l,orgSlug:i,error:u}),e[2]=u,e[3]=i,e[4]=l,e[5]=h):h=e[5],h}if(!o){let h;return e[6]!==i||e[7]!==l?(h=s.jsx(Xt,{projectSlug:l,orgSlug:i}),e[6]=i,e[7]=l,e[8]=h):h=e[8],h}const f=o.slug===G;let d;e[9]!==o.description||e[10]!==o.enabledPlugins||e[11]!==o.id||e[12]!==o.name||e[13]!==o.organizationId||e[14]!==o.slug||e[15]!==o.ui||e[16]!==f?(d={id:o.id,organizationId:o.organizationId,slug:o.slug,name:o.name,description:o.description,enabledPlugins:o.enabledPlugins,ui:o.ui,isOrgAdmin:f},e[9]=o.description,e[10]=o.enabledPlugins,e[11]=o.id,e[12]=o.name,e[13]=o.organizationId,e[14]=o.slug,e[15]=o.ui,e[16]=f,e[17]=d):d=e[17];const x=d;let a,g;e[18]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(O.Suspense,{fallback:s.jsx(ae,{}),children:s.jsx(Me,{})}),g=s.jsx(Ht,{}),e[18]=a,e[19]=g):(a=e[18],g=e[19]);let j;return e[20]!==x||e[21]!==r?(j=s.jsxs(Ce,{org:r,project:x,children:[a,g]}),e[20]=x,e[21]=r,e[22]=j):j=e[22],j}function Rs(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(O.Suspense,{fallback:s.jsx(ae,{}),children:s.jsx(es,{})}),e[0]=t):t=e[0],t}export{Rs as default};
|
|
1
|
+
import{r as O,c as z,d as me,j as s,u as J,O as G,t as R,H as Le,o as ve,s as W,b as ne,y as le,l as Ne,k as Se,K as q,aF as re,bF as Be,P as Ce,S as ae,e as Re,aD as Me}from"./index-DORq2iDV.js";import{u as Ue,a as _e}from"./use-project-DfYNa3t-.js";import{c as X,B as U}from"./button-CVYD_l4f.js";import{a as qe,D as Ge}from"./dialog-VPGAGt8b.js";import{a as Ke,b as Qe,c as Ve,T as Je,i as Pe}from"./tooltip-4z3Dj1Ic.js";import{u as ue,S as te}from"./skeleton-B-gUpTJK.js";import{p as ke,a as pe,t as We,u as Ze}from"./use-settings-modal-Cluj4Fcl.js";import{A as we}from"./avatar-CXlAe-d0.js";import{t as Ie}from"./Settings01-BNTi5NiU.js";import{i as He}from"./Check-B6v8UYhw.js";import{a as Ye}from"./Copy01-Cm4pdmsu.js";import{S as se}from"./switch-Bz-UbNfe.js";import{S as ze,a as Ee,d as Y,c as $e,b as Xe}from"./select-jAphy_-Y.js";import{i as et}from"./Code01-bk_rrtBU.js";import{i as tt}from"./Shield01-D2uet_XZ.js";import{n as st}from"./CheckDone01-Bd0reyKq.js";import{u as oe}from"./useMutation-DIYvmP8t.js";import{a as De,F as Z,b as K,c as Q,d as V,f as H,e as ce}from"./form-BVo4Hzsi.js";import{I as ee}from"./input-Bh5KX8XE.js";import{i as nt}from"./Upload01-BqShC51I.js";import{a as fe,u as xe}from"./constants-C7Ec6iJ9.js";import{T as lt}from"./textarea-B4df3c-A.js";import{c as ot,h as rt,d as it,b as at,A as ct,e as dt,g as mt,a as ut,f as ft}from"./alert-dialog-YO7F1UnW.js";import{u as xt}from"./useQuery-psr46-dB.js";import{L as gt}from"./label-DyOg7nzh.js";import{n as pt}from"./Container-CMzzA9YA.js";import{h as ht}from"./use-connection-C7Ykn5We.js";import{a as jt,c as bt}from"./use-binding-JQRdy56n.js";import{u as yt}from"./use-install-from-registry-CDxw1GCo.js";import{i as vt}from"./Loading01-B5HJTtc0.js";import{s as Nt}from"./Plus-CRPlP_jA.js";import"./localstorage-keys-CCux6fjT.js";import"./ChevronDown-RHEfxY7t.js";import"./binder-gZKFqPm8.js";import"./extract-connection-data-E0weV85e.js";import"./constants-D_v8WsQi.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-DbEnt6lf.js";import"./generate-id-Dyweu44Y.js";const Oe=({size:e=24,color:t="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M10 2v4.66c0 .218 0 .326-.033.413a.47.47 0 0 1-.138.198c-.07.06-.183.102-.409.185a7.5 7.5 0 1 0 5.16 0c-.226-.083-.339-.125-.409-.185a.469.469 0 0 1-.138-.198C14 6.986 14 6.878 14 6.66V2M8.5 2h7"}));Oe.displayName="Beaker01";const Te=({size:e=24,color:t="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M9.354 21c.705.622 1.632 1 2.646 1s1.94-.378 2.646-1M18 8A6 6 0 1 0 6 8c0 3.09-.78 5.206-1.65 6.605-.735 1.18-1.102 1.771-1.089 1.936.015.182.054.252.2.36.133.099.732.099 1.928.099H18.61c1.196 0 1.795 0 1.927-.098.147-.11.186-.179.2-.361.014-.165-.353-.755-1.088-1.936C18.78 13.206 18 11.09 18 8Z"}));Te.displayName="Bell01";const ge=({size:e=24,color:t="currentColor",...n})=>O.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},O.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));ge.displayName="Zap";const St=[{key:"general",label:"General",icon:s.jsx(Ie,{size:14})},{key:"plugins",label:"Plugins",icon:s.jsx(ge,{size:14})}];function Ct(e){const t=z.c(14),{activeSection:n,onNavigate:r}=e,{org:i}=J();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={suspense:!0},t[0]=l):l=t[0];const{data:o}=Ue(i.id,l);let m;t[1]!==n?(m=ke(n),t[1]=n,t[2]=m):m=t[2];const u=m;let f;if(t[3]!==u?.slug||t[4]!==n||t[5]!==r||t[6]!==o){let x;t[8]!==u?.slug||t[9]!==n||t[10]!==r?(x=a=>{const g=u?.slug===a.slug;return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("button",{type:"button",onClick:()=>r(pe(a.slug,"general")),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",g?"text-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("div",{className:"size-4 shrink-0 rounded-[3px] flex items-center justify-center overflow-hidden border border-border/50",style:{backgroundColor:a.ui?.themeColor??"#60a5fa"},children:a.ui?.icon?s.jsx("img",{src:a.ui.icon,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"text-[8px] font-semibold text-white leading-none",children:(a.name??a.slug).charAt(0).toUpperCase()})}),s.jsx("span",{className:"truncate",children:a.name??a.slug})]}),g&&s.jsx("div",{className:"ml-3 flex flex-col gap-0.5 border-l border-border pl-2.5",children:St.map(j=>{const h=pe(a.slug,j.key);return s.jsxs("button",{type:"button",onClick:()=>r(h),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",n===h?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:j.icon}),s.jsx("span",{className:"truncate",children:j.label})]},j.key)})})]},a.slug)},t[8]=u?.slug,t[9]=n,t[10]=r,t[11]=x):x=t[11],f=(o??[]).filter(_t).map(x),t[3]=u?.slug,t[4]=n,t[5]=r,t[6]=o,t[7]=f}else f=t[7];let d;return t[12]!==f?(d=s.jsx(s.Fragment,{children:f}),t[12]=f,t[13]=d):d=t[13],d}function _t(e){return e.slug!==G}function Pt(e){const t=z.c(29),{activeSection:n,onNavigate:r}=e,{data:i}=me.useSession(),[l]=ue(),o=i?.user,m=o?.image,u=o?.name??"Profile",f=o?.name??"U";let d;t[0]!==f||t[1]!==m?(d=s.jsx(we,{url:m,fallback:f,shape:"circle",size:"2xs",className:"size-4 shrink-0"}),t[0]=f,t[1]=m,t[2]=d):d=t[2];let x;t[3]!==u||t[4]!==d?(x={key:"account.profile",label:u,icon:d},t[3]=u,t[4]=d,t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a={key:"account.preferences",label:"Preferences",icon:s.jsx(Ie,{size:14})},t[6]=a):a=t[6];let g;t[7]===Symbol.for("react.memo_cache_sentinel")?(g={key:"account.experimental",label:"Experimental",icon:s.jsx(Oe,{size:14})},t[7]=g):g=t[7];let j;t[8]!==x?(j=[x,a,g],t[8]=x,t[9]=j):j=t[9];const h=j;let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"org.general",label:"General",icon:s.jsx(We,{size:14})},t[10]=y):y=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S=[y,{key:"org.plugins",label:"Plugins",icon:s.jsx(ge,{size:14})}],t[11]=S):S=t[11];const C=S;let _;t[12]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Account"}),t[12]=_):_=t[12];let v;t[13]!==h||t[14]!==n||t[15]!==r?(v=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[_,h.map(P=>s.jsxs("button",{type:"button",onClick:()=>r(P.key),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",n===P.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:P.icon}),s.jsx("span",{className:"truncate",children:P.label})]},P.key))]}),t[13]=h,t[14]=n,t[15]=r,t[16]=v):v=t[16];let c;t[17]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Organization"}),t[17]=c):c=t[17];let p;t[18]!==n||t[19]!==r?(p=s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[c,C.map(P=>s.jsxs("button",{type:"button",onClick:()=>r(P.key),className:X("flex items-center gap-2.5 px-2 py-1.5 rounded-md text-sm text-left w-full transition-colors",n===P.key?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[s.jsx("span",{className:"shrink-0",children:P.icon}),s.jsx("span",{className:"truncate",children:P.label})]},P.key))]}),t[18]=n,t[19]=r,t[20]=p):p=t[20];let b;t[21]!==n||t[22]!==r||t[23]!==l.experimental_projects?(b=l.experimental_projects&&s.jsxs("div",{className:"flex flex-col gap-0.5 px-2",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground/60",children:"Projects"}),s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground/50",children:"Loading…"}),children:s.jsx(Ct,{activeSection:n,onNavigate:r})})]}),t[21]=n,t[22]=r,t[23]=l.experimental_projects,t[24]=b):b=t[24];let N;return t[25]!==v||t[26]!==p||t[27]!==b?(N=s.jsxs("div",{className:"w-52 shrink-0 border-r border-border bg-sidebar/50 overflow-y-auto py-3 flex flex-col gap-4",children:[v,p,b]}),t[25]=v,t[26]=p,t[27]=b,t[28]=N):N=t[28],N}function kt(){const e=z.c(32),{data:t}=me.useSession(),[n,r]=O.useState(!1),i=t?.user,l=i?.image;let o;e[0]!==i?(o=()=>{i?.id&&navigator.clipboard.writeText(i.id).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})},e[0]=i,e[1]=o):o=e[1];const m=o;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Profile"})}),e[2]=u):u=e[2];const f=i?.name??"U";let d;e[3]!==f||e[4]!==l?(d=s.jsx(we,{url:l,fallback:f,shape:"circle",size:"xl",className:"size-16 shrink-0"}),e[3]=f,e[4]=l,e[5]=d):d=e[5];const x=i?.name??"User";let a;e[6]!==x?(a=s.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:x}),e[6]=x,e[7]=a):a=e[7];const g=i?.email;let j;e[8]!==g?(j=s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:g}),e[8]=g,e[9]=j):j=e[9];let h;e[10]!==a||e[11]!==j?(h=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[a,j]}),e[10]=a,e[11]=j,e[12]=h):h=e[12];let y;e[13]!==d||e[14]!==h?(y=s.jsxs("div",{className:"flex items-center gap-4",children:[d,h]}),e[13]=d,e[14]=h,e[15]=y):y=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"User ID"}),e[16]=S):S=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("p",{className:"text-sm text-muted-foreground",children:"User ID"}),e[17]=C):C=e[17];const _=i?.id;let v;e[18]!==_?(v=s.jsx("span",{className:"font-mono text-sm",children:_}),e[18]=_,e[19]=v):v=e[19];let c;e[20]!==n?(c=n?s.jsx(He,{size:14,className:"text-green-600 shrink-0"}):s.jsx(Ye,{size:14,className:"shrink-0 opacity-70 group-hover:opacity-100 transition-opacity"}),e[20]=n,e[21]=c):c=e[21];let p;e[22]!==m||e[23]!==v||e[24]!==c?(p=s.jsx(Ke,{asChild:!0,children:s.jsxs("button",{type:"button",onClick:m,className:"group flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[v,c]})}),e[22]=m,e[23]=v,e[24]=c,e[25]=p):p=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(Qe,{side:"left",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[26]=b):b=e[26];let N;e[27]!==p?(N=s.jsxs("div",{className:"flex flex-col",children:[S,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[C,s.jsx(Ve,{children:s.jsxs(Je,{children:[p,b]})})]})]}),e[27]=p,e[28]=N):N=e[28];let P;return e[29]!==N||e[30]!==y?(P=s.jsxs("div",{className:"flex flex-col gap-8",children:[u,y,N]}),e[29]=N,e[30]=y,e[31]=P):P=e[31],P}function ie(e){const t=z.c(27),{icon:n,label:r,description:i,control:l,onClick:o,disabled:m}=e,u=m?void 0:o,f=o?"button":void 0,d=o&&!m?0:void 0;let x;t[0]!==m||t[1]!==o?(x=o&&!m?c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())}:void 0,t[0]=m,t[1]=o,t[2]=x):x=t[2];const a=o&&!m?"pointer":void 0;let g;t[3]!==a?(g={cursor:a},t[3]=a,t[4]=g):g=t[4];let j;t[5]!==n?(j=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:n}),t[5]=n,t[6]=j):j=t[6];let h;t[7]!==r?(h=s.jsx("p",{className:"text-sm font-medium text-foreground",children:r}),t[7]=r,t[8]=h):h=t[8];let y;t[9]!==i?(y=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:i}),t[9]=i,t[10]=y):y=t[10];let S;t[11]!==h||t[12]!==y?(S=s.jsxs("div",{className:"min-w-0",children:[h,y]}),t[11]=h,t[12]=y,t[13]=S):S=t[13];let C;t[14]!==S||t[15]!==j?(C=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[j,S]}),t[14]=S,t[15]=j,t[16]=C):C=t[16];let _;t[17]!==l?(_=s.jsx("div",{onClick:wt,className:"shrink-0",children:l}),t[17]=l,t[18]=_):_=t[18];let v;return t[19]!==u||t[20]!==C||t[21]!==_||t[22]!==f||t[23]!==d||t[24]!==x||t[25]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0",onClick:u,role:f,tabIndex:d,onKeyDown:x,style:g,children:[C,_]}),t[19]=u,t[20]=C,t[21]=_,t[22]=f,t[23]=d,t[24]=x,t[25]=g,t[26]=v):v=t[26],v}function wt(e){return e.stopPropagation()}function he(){const e=z.c(35),[t,n]=ue();let r;e[0]!==n?(r=async b=>{if(b&&await Notification.requestPermission()!=="granted"){R.error("Notifications denied. Please enable them in your browser settings."),n(zt);return}n(N=>({...N,enableNotifications:b}))},e[0]=n,e[1]=r):r=e[1];const i=r;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Preferences"})}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(et,{size:16}),e[3]=o):o=e[3];let m;e[4]!==n?(m=()=>n(It),e[4]=n,e[5]=m):m=e[5];let u;e[6]!==n?(u=b=>n(N=>({...N,devMode:b})),e[6]=n,e[7]=u):u=e[7];let f;e[8]!==t.devMode||e[9]!==u?(f=s.jsx(se,{checked:t.devMode,onCheckedChange:u}),e[8]=t.devMode,e[9]=u,e[10]=f):f=e[10];let d;e[11]!==m||e[12]!==f?(d=s.jsx(ie,{icon:o,label:"Developer Mode",description:"Show technical details like JSON input/output for tool calls.",onClick:m,control:f}),e[11]=m,e[12]=f,e[13]=d):d=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Te,{size:16}),e[14]=x):x=e[14];let a;e[15]!==i||e[16]!==t.enableNotifications?(a=s.jsx(ie,{icon:x,label:"Notifications",description:"Play a sound and show a notification when chat messages complete while the app is unfocused.",disabled:typeof Notification>"u",onClick:()=>i(!t.enableNotifications),control:s.jsx(se,{disabled:typeof Notification>"u",checked:t.enableNotifications,onCheckedChange:i})}),e[15]=i,e[16]=t.enableNotifications,e[17]=a):a=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(tt,{size:16}),e[18]=g):g=e[18];let j;e[19]!==n?(j=b=>n(N=>({...N,toolApprovalLevel:b})),e[19]=n,e[20]=j):j=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h={none:"None",readonly:"Read-only",yolo:"YOLO"},e[21]=h):h=e[21];const y=h[t.toolApprovalLevel];let S;e[22]!==y?(S=s.jsx(Ee,{className:"w-36",children:s.jsx("span",{children:y})}),e[22]=y,e[23]=S):S=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(Y,{value:"none",textValue:"None",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"None"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Require approval for all tool calls"})]})}),e[24]=C):C=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(Y,{value:"readonly",textValue:"Read-only",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"Read-only"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Auto-approve read-only tools"})]})}),e[25]=_):_=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsxs($e,{children:[C,_,s.jsx(Y,{value:"yolo",textValue:"YOLO",children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"font-medium",children:"YOLO"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"Execute all tools without approval"})]})})]}),e[26]=v):v=e[26];let c;e[27]!==t.toolApprovalLevel||e[28]!==j||e[29]!==S?(c=s.jsx(ie,{icon:g,label:"Tool Approval",description:"Choose when to require approval before tools execute.",control:s.jsxs(ze,{value:t.toolApprovalLevel,onValueChange:j,children:[S,v]})}),e[27]=t.toolApprovalLevel,e[28]=j,e[29]=S,e[30]=c):c=e[30];let p;return e[31]!==c||e[32]!==d||e[33]!==a?(p=s.jsxs("div",{className:"flex flex-col gap-6",children:[l,s.jsxs("div",{className:"flex flex-col",children:[d,a,c]})]}),e[31]=c,e[32]=d,e[33]=a,e[34]=p):p=e[34],p}function It(e){return{...e,devMode:!e.devMode}}function zt(e){return{...e,enableNotifications:!1}}function je(e){const t=z.c(22),{icon:n,label:r,description:i,checked:l,onCheckedChange:o}=e;let m;t[0]!==l||t[1]!==o?(m=()=>o(!l),t[0]=l,t[1]=o,t[2]=m):m=t[2];let u;t[3]!==n?(u=s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0",children:n}),t[3]=n,t[4]=u):u=t[4];let f;t[5]!==r?(f=s.jsx("p",{className:"text-sm font-medium text-foreground",children:r}),t[5]=r,t[6]=f):f=t[6];let d;t[7]!==i?(d=s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:i}),t[7]=i,t[8]=d):d=t[8];let x;t[9]!==f||t[10]!==d?(x=s.jsxs("div",{className:"min-w-0",children:[f,d]}),t[9]=f,t[10]=d,t[11]=x):x=t[11];let a;t[12]!==u||t[13]!==x?(a=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[u,x]}),t[12]=u,t[13]=x,t[14]=a):a=t[14];let g;t[15]!==l||t[16]!==o?(g=s.jsx("div",{onClick:Et,className:"shrink-0",children:s.jsx(se,{checked:l,onCheckedChange:o})}),t[15]=l,t[16]=o,t[17]=g):g=t[17];let j;return t[18]!==m||t[19]!==a||t[20]!==g?(j=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4 border-b border-border last:border-0 cursor-pointer",onClick:m,children:[a,g]}),t[18]=m,t[19]=a,t[20]=g,t[21]=j):j=t[21],j}function Et(e){return e.stopPropagation()}function $t(){const e=z.c(16),[t,n]=ue();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Experimental"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"These features are unstable and may change or stop working at any time."})]}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Le,{size:16}),e[1]=i):i=e[1];let l;e[2]!==n?(l=x=>n(a=>({...a,experimental_projects:x})),e[2]=n,e[3]=l):l=e[3];let o;e[4]!==t.experimental_projects||e[5]!==l?(o=s.jsx(je,{icon:i,label:"Projects",description:"Enable the projects feature in the sidebar.",checked:t.experimental_projects,onCheckedChange:l}),e[4]=t.experimental_projects,e[5]=l,e[6]=o):o=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(st,{size:16}),e[7]=m):m=e[7];let u;e[8]!==n?(u=x=>n(a=>({...a,experimental_tasks:x})),e[8]=n,e[9]=u):u=e[9];let f;e[10]!==t.experimental_tasks||e[11]!==u?(f=s.jsx(je,{icon:m,label:"Tasks",description:"Enable the tasks feature in the sidebar.",checked:t.experimental_tasks,onCheckedChange:u}),e[10]=t.experimental_tasks,e[11]=u,e[12]=f):f=e[12];let d;return e[13]!==o||e[14]!==f?(d=s.jsxs("div",{className:"flex flex-col gap-6",children:[r,s.jsxs("div",{className:"flex flex-col rounded-lg border border-border bg-muted/25 px-4",children:[o,f]})]}),e[13]=o,e[14]=f,e[15]=d):d=e[15],d}const Dt=ve({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:W().optional()});function Ot(e){const t=z.c(24),{value:n,onChange:r,name:i}=e,l=O.useRef(null);let o;t[0]!==r?(o=v=>{const c=v.target.files?.[0];if(c){if(c.size>2097152){R.error("Image must be smaller than 2MB");return}const p=new FileReader;p.onerror=()=>{const b=p.error;console.error("FileReader error:",b),R.error(b?.message||"Failed to read image file. Please try again."),l.current&&(l.current.value="")},p.onloadend=()=>{if(p.readyState===FileReader.DONE&&p.result){const b=p.result;r(b)}},p.readAsDataURL(c)}},t[0]=r,t[1]=o):o=t[1];const m=o;let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l.current?.click()},t[2]=u):u=t[2];const f=u;let d;t[3]!==r?(d=v=>{v.stopPropagation(),r("")},t[3]=r,t[4]=d):d=t[4];const x=d;let a;t[5]!==m?(a=s.jsx("input",{type:"file",ref:l,className:"hidden",accept:"image/*",onChange:m}),t[5]=m,t[6]=a):a=t[6];let g;t[7]!==x||t[8]!==i||t[9]!==n?(g=n?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:n,alt:i||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:x,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Pe,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:f,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(nt,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=x,t[8]=i,t[9]=n,t[10]=g):g=t[10];const j=n?"Change Logo":"Upload Logo";let h;t[11]!==j?(h=s.jsx(U,{type:"button",variant:"outline",size:"sm",onClick:f,className:"mb-2",children:j}),t[11]=j,t[12]=h):h=t[12];let y;t[13]!==x||t[14]!==n?(y=n&&s.jsx(U,{type:"button",variant:"ghost",size:"sm",onClick:x,className:"ml-2",children:"Remove"}),t[13]=x,t[14]=n,t[15]=y):y=t[15];let S;t[16]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=S):S=t[16];let C;t[17]!==h||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[h,y,S]}),t[17]=h,t[18]=y,t[19]=C):C=t[19];let _;return t[20]!==C||t[21]!==a||t[22]!==g?(_=s.jsxs("div",{className:"flex items-start gap-4",children:[a,g,C]}),t[20]=C,t[21]=a,t[22]=g,t[23]=_):_=t[23],_}function Tt(){const e=ne(),{org:t,project:n}=J(),r=le(),[i,l]=O.useState(!1),o=Ne({resolver:Se(Dt),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),m=oe({mutationFn:async d=>{const x={name:d.name,slug:d.slug};d.logo&&(x.logo=d.logo);const a=await me.organization.update({organizationId:t.id,data:x});if(a?.error)throw new Error(a.error.message||"Failed to update organization");return a},onSuccess:d=>{r.invalidateQueries({queryKey:q.organizations()}),r.invalidateQueries({queryKey:q.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),d?.data?.slug&&d.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:d.data.slug,project:n.slug}})},onError:d=>{R.error(d instanceof Error?d.message:"Failed to update organization")},onSettled:()=>{l(!1)}}),u=d=>{l(!0),m.mutate(d)},f=o.formState.isDirty;return s.jsx(De,{...o,children:s.jsxs("form",{onSubmit:o.handleSubmit(u),className:"space-y-6",children:[s.jsx(Z,{control:o.control,name:"name",render:({field:d})=>s.jsxs(K,{children:[s.jsx(Q,{children:"Organization Name"}),s.jsx(V,{children:s.jsx(ee,{placeholder:"My Organization",...d,disabled:i})}),s.jsx(H,{})]})}),s.jsx(Z,{control:o.control,name:"slug",render:({field:d})=>s.jsxs(K,{children:[s.jsx(Q,{children:"Organization Slug"}),s.jsx(V,{children:s.jsx(ee,{placeholder:"my-organization",...d,disabled:i,onChange:x=>{const a=x.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");d.onChange(a)}})}),s.jsx(ce,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(H,{})]})}),s.jsx(Z,{control:o.control,name:"logo",render:({field:d})=>s.jsxs(K,{children:[s.jsx(Q,{children:"Logo"}),s.jsx(V,{children:s.jsx(Ot,{value:d.value,onChange:d.onChange,name:o.watch("name")})}),s.jsx(H,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(U,{type:"submit",disabled:!f||i,className:"min-w-24",children:i?"Saving...":"Save Changes"}),f&&s.jsx(U,{type:"button",variant:"outline",onClick:()=>o.reset(),disabled:i,children:"Cancel"})]})]})})}function At(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Organization"})}),s.jsx(Tt,{})]}),e[0]=t):t=e[0],t}const Ft=ve({name:W().min(1,"Name is required").max(200,"Name is too long"),description:W().max(1e3,"Description is too long").nullable(),themeColor:W().nullable()});function Lt(){const e=z.c(63),{org:t,project:n}=J(),r=le(),i=n.slug===G;let l;e[0]!==t.id?(l={connectionId:fe,orgId:t.id},e[0]=t.id,e[1]=l):l=e[1];const o=xe(l);let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=Se(Ft),e[2]=m):m=e[2];const u=n.name??"",f=n.description??"",d=n.ui?.themeColor??"#60a5fa";let x;e[3]!==u||e[4]!==f||e[5]!==d?(x={resolver:m,values:{name:u,description:f,themeColor:d}},e[3]=u,e[4]=f,e[5]=d,e[6]=x):x=e[6];const a=Ne(x);let g;e[7]!==o||e[8]!==n.id||e[9]!==n.ui?.banner||e[10]!==n.ui?.bannerColor||e[11]!==n.ui?.icon?(g=async k=>{const w=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:n.id,name:k.name,description:k.description||null,ui:{themeColor:k.themeColor||null,banner:n.ui?.banner??null,bannerColor:n.ui?.bannerColor??null,icon:n.ui?.icon??null}}});return w.structuredContent??w},e[7]=o,e[8]=n.id,e[9]=n.ui?.banner,e[10]=n.ui?.bannerColor,e[11]=n.ui?.icon,e[12]=g):g=e[12];let j;e[13]!==a||e[14]!==t.id||e[15]!==n.slug||e[16]!==r?(j=()=>{r.invalidateQueries({queryKey:q.project(t.id,n.slug)}),r.invalidateQueries({queryKey:q.projects(t.id)}),a.reset(a.getValues())},e[13]=a,e[14]=t.id,e[15]=n.slug,e[16]=r,e[17]=j):j=e[17];let h;e[18]!==g||e[19]!==j?(h={mutationFn:g,onSuccess:j,onError:Bt},e[18]=g,e[19]=j,e[20]=h):h=e[20];const y=oe(h);let S;e[21]!==y?(S=async k=>{await y.mutateAsync(k)},e[21]=y,e[22]=S):S=e[22];const C=S;let _;e[23]!==a||e[24]!==C?(_=k=>{k(),a.handleSubmit(C)()},e[23]=a,e[24]=C,e[25]=_):_=e[25];const v=_;let c;e[26]!==a||e[27]!==C?(c=a.handleSubmit(C),e[26]=a,e[27]=C,e[28]=c):c=e[28];let p;e[29]!==i||e[30]!==y.isPending||e[31]!==v?(p=k=>{const{field:w}=k;return s.jsxs(K,{children:[s.jsx(Q,{children:"Project Name"}),s.jsx(V,{children:s.jsx(ee,{placeholder:"My Project",...w,onBlur:()=>v(w.onBlur),disabled:i||y.isPending})}),i&&s.jsx(ce,{children:"The organization admin project name cannot be changed."}),s.jsx(H,{})]})},e[29]=i,e[30]=y.isPending,e[31]=v,e[32]=p):p=e[32];let b;e[33]!==a.control||e[34]!==p?(b=s.jsx(Z,{control:a.control,name:"name",render:p}),e[33]=a.control,e[34]=p,e[35]=b):b=e[35];let N;e[36]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Q,{children:"Slug"}),e[36]=N):N=e[36];let P;e[37]!==n.slug?(P=s.jsx(V,{children:s.jsx(ee,{value:n.slug,disabled:!0,className:"bg-muted"})}),e[37]=n.slug,e[38]=P):P=e[38];let I;e[39]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(ce,{children:"The project slug cannot be changed after creation."}),e[39]=I):I=e[39];let E;e[40]!==P?(E=s.jsxs(K,{children:[N,P,I]}),e[40]=P,e[41]=E):E=e[41];let T;e[42]!==y.isPending||e[43]!==v?(T=k=>{const{field:w}=k;return s.jsxs(K,{children:[s.jsx(Q,{children:"Description"}),s.jsx(V,{children:s.jsx(lt,{placeholder:"Optional project description...",rows:3,...w,value:w.value??"",onBlur:()=>v(w.onBlur),disabled:y.isPending})}),s.jsx(H,{})]})},e[42]=y.isPending,e[43]=v,e[44]=T):T=e[44];let $;e[45]!==a.control||e[46]!==T?($=s.jsx(Z,{control:a.control,name:"description",render:T}),e[45]=a.control,e[46]=T,e[47]=$):$=e[47];let D;e[48]!==y.isPending||e[49]!==v?(D=k=>{const{field:w}=k;return s.jsxs(K,{children:[s.jsx(Q,{children:"Color"}),s.jsx(V,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"size-9 rounded-md border border-input overflow-hidden cursor-pointer shrink-0",style:{backgroundColor:w.value??"#60a5fa"},children:s.jsx("input",{type:"color",value:w.value??"#60a5fa",onChange:B=>w.onChange(B.target.value),onBlur:()=>v(w.onBlur),disabled:y.isPending,className:"opacity-0 w-full h-full cursor-pointer"})}),s.jsx("span",{className:"font-mono text-sm text-muted-foreground",children:w.value??"#60a5fa"})]})}),s.jsx(H,{})]})},e[48]=y.isPending,e[49]=v,e[50]=D):D=e[50];let A;e[51]!==a.control||e[52]!==D?(A=s.jsx(Z,{control:a.control,name:"themeColor",render:D}),e[51]=a.control,e[52]=D,e[53]=A):A=e[53];let F;e[54]!==c||e[55]!==b||e[56]!==E||e[57]!==$||e[58]!==A?(F=s.jsxs("form",{onSubmit:c,className:"space-y-6",children:[b,E,$,A]}),e[54]=c,e[55]=b,e[56]=E,e[57]=$,e[58]=A,e[59]=F):F=e[59];let L;return e[60]!==a||e[61]!==F?(L=s.jsx("div",{className:"flex flex-col",children:s.jsx(De,{...a,children:F})}),e[60]=a,e[61]=F,e[62]=L):L=e[62],L}function Bt(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Ae(){const e=z.c(45),{org:t,project:n}=J(),r=ne(),i=le(),[l,o]=O.useState(""),[m,u]=O.useState(!1),f=n.slug===G;let d;e[0]!==t.id?(d={connectionId:fe,orgId:t.id},e[0]=t.id,e[1]=d):d=e[1];const x=xe(d);let a;e[2]!==x||e[3]!==n.id?(a=async()=>{const M=await x.callTool({name:"PROJECT_DELETE",arguments:{projectId:n.id}});return M.structuredContent??M},e[2]=x,e[3]=n.id,e[4]=a):a=e[4];let g;e[5]!==r||e[6]!==t.id||e[7]!==t.slug||e[8]!==i?(g=M=>{M.success?(i.invalidateQueries({queryKey:q.projects(t.id)}),R.success("Project deleted"),r({to:"/$org/$project",params:{org:t.slug,project:G}})):R.error(M.message??"Failed to delete project")},e[5]=r,e[6]=t.id,e[7]=t.slug,e[8]=i,e[9]=g):g=e[9];let j;e[10]!==a||e[11]!==g?(j={mutationFn:a,onSuccess:g,onError:Rt},e[10]=a,e[11]=g,e[12]=j):j=e[12];const h=oe(j);if(f)return null;const y=l===n.name;let S;e[13]!==h?(S=()=>{h.mutate()},e[13]=h,e[14]=S):S=e[14];const C=S;let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=M=>{u(M),M||o("")},e[15]=_):_=e[15];const v=_;let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"Danger Zone"}),e[16]=c):c=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Delete Project"}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Permanently delete this project and all its data. This action cannot be undone."})]}),e[17]=p):p=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(rt,{asChild:!0,children:s.jsx(U,{variant:"outline",className:"shrink-0 bg-destructive/10 text-destructive border-0 hover:bg-destructive/15 hover:text-destructive",children:"Delete Project"})}),e[18]=b):b=e[18];let N;e[19]!==n.name?(N=s.jsxs(ot,{children:['Delete "',n.name,'"?']}),e[19]=n.name,e[20]=N):N=e[20];let P;e[21]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(it,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[21]=P):P=e[21];let I;e[22]!==N?(I=s.jsxs(at,{children:[N,P]}),e[22]=N,e[23]=I):I=e[23];let E;e[24]!==n.name?(E=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:n.name})," to confirm:"]}),e[24]=n.name,e[25]=E):E=e[25];let T;e[26]===Symbol.for("react.memo_cache_sentinel")?(T=M=>o(M.target.value),e[26]=T):T=e[26];let $;e[27]!==l||e[28]!==n.name?($=s.jsx(ee,{value:l,onChange:T,placeholder:n.name}),e[27]=l,e[28]=n.name,e[29]=$):$=e[29];let D;e[30]!==E||e[31]!==$?(D=s.jsxs("div",{className:"py-4",children:[E,$]}),e[30]=E,e[31]=$,e[32]=D):D=e[32];let A;e[33]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(ct,{children:"Cancel"}),e[33]=A):A=e[33];const F=!y||h.isPending,L=h.isPending?"Deleting...":"Delete Project";let k;e[34]!==C||e[35]!==F||e[36]!==L?(k=s.jsxs(dt,{children:[A,s.jsx(mt,{onClick:C,disabled:F,className:"bg-destructive/10 text-destructive hover:bg-destructive/15 hover:text-destructive border-0",children:L})]}),e[34]=C,e[35]=F,e[36]=L,e[37]=k):k=e[37];let w;e[38]!==I||e[39]!==D||e[40]!==k?(w=s.jsxs(ut,{children:[I,D,k]}),e[38]=I,e[39]=D,e[40]=k,e[41]=w):w=e[41];let B;return e[42]!==m||e[43]!==w?(B=s.jsxs("div",{className:"flex flex-col",children:[c,s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[p,s.jsxs(ft,{open:m,onOpenChange:v,children:[b,w]})]})]}),e[42]=m,e[43]=w,e[44]=B):B=e[44],B}function Rt(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function Mt(){const e=z.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("p",{className:"py-4 text-base font-semibold text-foreground border-b border-border",children:"General"}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col",children:[t,s.jsxs("div",{className:"pt-6 flex flex-col gap-6",children:[s.jsx(Lt,{}),s.jsx(Ae,{})]})]}),e[1]=n):n=e[1],n}function Ut({value:e,onValueChange:t,placeholder:n="Select a connection...",binding:r,bindingType:i,onAddNew:l,className:o,disabled:m=!1}){const[u,f]=O.useState(!1),{installByBinding:d,isInstalling:x}=yt(),a=u||x,g=ht(),j=jt({connections:g,binding:typeof r=="string"?r:void 0}),h=!r||!g?g??[]:typeof r=="string"?j:Array.isArray(r)&&r.length>0?g.filter(c=>bt(c,r)):g,y=(()=>{if(!i?.startsWith("@"))return null;const[c,p]=i.replace("@","").split("/");return c&&p?{scope:c,appName:p}:null})(),S=(()=>{let c=h;const p=Array.isArray(r)&&r.length>0;if(y&&!p&&(c=c.filter(b=>{const N=b.app_name,P=b.metadata?.scopeName;return N===y.appName&&P===y.scope})),e&&!c.some(b=>b.id===e)){const b=g?.find(N=>N.id===e);if(b)return[b,...c]}return c})(),C=i?.startsWith("@"),_=async()=>{if(C&&i){f(!0);try{const c=await d(i);c&&t(c.id)}finally{f(!1)}return}l?.()},v=S.find(c=>c.id===e);return s.jsxs(ze,{value:e??"none",onValueChange:c=>t(c==="none"?null:c),disabled:m,children:[s.jsx(Ee,{size:"sm",className:X("w-[200px]",o),children:s.jsx(Xe,{placeholder:n,children:v?s.jsxs("div",{className:"flex items-center gap-2",children:[v.icon?s.jsx("img",{src:v.icon,alt:v.title,className:"w-4 h-4 rounded shrink-0"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:v.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:v.title})]}):n})}),s.jsxs($e,{children:[s.jsx(Y,{value:"none",children:"No connection"}),S.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):S.map(c=>s.jsx(Y,{value:c.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[c.icon?s.jsx("img",{src:c.icon,alt:c.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:c.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:c.title})]})},c.id)),(l||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(U,{onPointerDown:c=>c.stopPropagation(),onClick:c=>{c.preventDefault(),c.stopPropagation(),_()},disabled:a||m,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:a?s.jsxs(s.Fragment,{children:[s.jsx(vt,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const qt=e=>{if(!e||typeof e!="object")return!1;const t=e;return t.type==="text"&&typeof t.text=="string"&&t.text.trim().toLowerCase().startsWith("error")},de=e=>{const t=e.structuredContent??e,n=t&&typeof t=="object"?t:null,r=n?.content?.[0]?.text&&typeof n.content[0].text=="string"?n.content[0].text:null;if(n?.isError)throw new Error(r??"Tool call failed");if(qt(t))throw new Error(t.text);return t};function Gt(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function Kt(e){const t=z.c(57),{plugin:n,isEnabled:r,isSaving:i,pendingBinding:l,description:o,label:m,icon:u,projectId:f,client:d,onBindingChange:x,onToggle:a}=e;let g;t[0]!==n?(g=Gt(n),t[0]=n,t[1]=g):g=t[1];const j=g;let h;t[2]!==n.id||t[3]!==f?(h=q.projectPluginConfig(f??"",n.id),t[2]=n.id,t[3]=f,t[4]=h):h=t[4];let y;t[5]!==d||t[6]!==n.id||t[7]!==f?(y=async()=>{if(!f)throw new Error("Project ID is required to load plugin config.");const B=await d.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:f,pluginId:n.id}});return de(B)},t[5]=d,t[6]=n.id,t[7]=f,t[8]=y):y=t[8];const S=!!f&&j;let C;t[9]!==h||t[10]!==y||t[11]!==S?(C={queryKey:h,queryFn:y,enabled:S},t[9]=h,t[10]=y,t[11]=S,t[12]=C):C=t[12];const{data:_,isLoading:v}=xt(C),c=_?.config?.connectionId??null,p=l!==void 0?l:c;let b;t[13]!==r||t[14]!==i||t[15]!==a||t[16]!==n.id?(b=()=>!i&&a(n.id,!r),t[13]=r,t[14]=i,t[15]=a,t[16]=n.id,t[17]=b):b=t[17];const N=i?void 0:"pointer";let P;t[18]!==N?(P={cursor:N},t[18]=N,t[19]=P):P=t[19];let I;t[20]!==u?(I=u&&s.jsx("span",{className:"text-muted-foreground mt-0.5 shrink-0 [&>svg]:size-4",children:u}),t[20]=u,t[21]=I):I=t[21];let E;t[22]!==m?(E=s.jsx("p",{className:"text-sm font-medium text-foreground",children:m}),t[22]=m,t[23]=E):E=t[23];let T;t[24]!==o?(T=o&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:o}),t[24]=o,t[25]=T):T=t[25];let $;t[26]!==E||t[27]!==T?($=s.jsxs("div",{className:"min-w-0",children:[E,T]}),t[26]=E,t[27]=T,t[28]=$):$=t[28];let D;t[29]!==$||t[30]!==I?(D=s.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[I,$]}),t[29]=$,t[30]=I,t[31]=D):D=t[31];let A;t[32]!==a||t[33]!==n.id?(A=B=>a(n.id,B),t[32]=a,t[33]=n.id,t[34]=A):A=t[34];let F;t[35]!==r||t[36]!==i||t[37]!==A?(F=s.jsx("div",{onClick:Vt,className:"shrink-0",children:s.jsx(se,{checked:r,onCheckedChange:A,disabled:i})}),t[35]=r,t[36]=i,t[37]=A,t[38]=F):F=t[38];let L;t[39]!==D||t[40]!==F?(L=s.jsxs("div",{className:"flex items-center justify-between gap-6 py-4",children:[D,F]}),t[39]=D,t[40]=F,t[41]=L):L=t[41];let k;t[42]!==v||t[43]!==r||t[44]!==i||t[45]!==j||t[46]!==x||t[47]!==n.binding||t[48]!==n.id||t[49]!==p||t[50]!==c?(k=r&&j&&s.jsxs("div",{onClick:Qt,className:"pb-4 pl-7 flex items-center gap-3",children:[s.jsx(gt,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Ut,{value:p??null,onValueChange:B=>x(n.id,B,c),binding:n.binding,placeholder:"Select connection...",className:"w-56",disabled:i||v})]}),t[42]=v,t[43]=r,t[44]=i,t[45]=j,t[46]=x,t[47]=n.binding,t[48]=n.id,t[49]=p,t[50]=c,t[51]=k):k=t[51];let w;return t[52]!==L||t[53]!==k||t[54]!==b||t[55]!==P?(w=s.jsxs("div",{className:"flex flex-col border-b border-border last:border-0",onClick:b,style:P,children:[L,k]}),t[52]=L,t[53]=k,t[54]=b,t[55]=P,t[56]=w):w=t[56],w}function Qt(e){return e.stopPropagation()}function Vt(e){return e.stopPropagation()}function Jt(){const{org:e,project:t}=J(),n=le(),r=xe({connectionId:fe,orgId:e.id}),[i,l]=O.useState({}),[o,m]=O.useState({}),[u,f]=O.useState(!1),d=t.enabledPlugins??[],x=c=>{const p=i[c];return p!==void 0?p:d.includes(c)},a=()=>{const c=new Set(d);for(const[p,b]of Object.entries(i))b?c.add(p):c.delete(p);return Array.from(c)},g=Object.keys(i).length>0||Object.keys(o).length>0,j=(c,p)=>{const b=d.includes(c);l(p===b?N=>{const{[c]:P,...I}=N;return I}:N=>({...N,[c]:p}))},h=(c,p,b)=>{if(p===b){m(N=>{const{[c]:P,...I}=N;return I});return}m(N=>({...N,[c]:p}))},y=oe({mutationFn:async c=>{const p=[];if(c.updatePlugins){const b=await r.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:c.enabledPlugins}});p.push(de(b))}if(c.bindingUpdates.length>0){const b=await Promise.all(c.bindingUpdates.map(async({pluginId:N,connectionId:P})=>{const I=await r.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:N,connectionId:P}});return de(I)}));p.push(...b)}return p},onSuccess:(c,p)=>{p.updatePlugins&&(n.invalidateQueries({queryKey:q.project(e.id,t.slug)}),n.invalidateQueries({queryKey:q.projects(e.id)})),p.bindingUpdates.forEach(({pluginId:b})=>{n.invalidateQueries({queryKey:q.projectPluginConfig(t.id??"",b)})}),l({}),m({}),R.success("Plugins updated successfully")},onError:c=>{R.error("Failed to update plugins: "+(c instanceof Error?c.message:"Unknown error"))},onSettled:()=>{f(!1)}}),S=()=>{f(!0),y.mutate({enabledPlugins:a(),updatePlugins:Object.keys(i).length>0,bindingUpdates:Object.entries(o).map(([c,p])=>({pluginId:c,connectionId:p}))})},C=()=>{l({}),m({})},_=c=>{const p=Be.find(b=>b.pluginId===c);return p?{label:p.label,icon:p.items[0]?.icon}:null},v=c=>re.find(b=>b.id===c)?.description??null;return re.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex flex-col",children:re.map(c=>{const p=_(c.id),b=v(c.id),N=x(c.id);return s.jsx(Kt,{plugin:c,isEnabled:N,isSaving:u,pendingBinding:o[c.id],description:b,label:p?.label??c.id,icon:p?.icon??s.jsx(pt,{size:14}),projectId:t.id,client:r,onBindingChange:h,onToggle:j},c.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(U,{variant:"outline",onClick:C,disabled:!g||u,children:"Cancel"}),s.jsx(U,{onClick:S,disabled:!g||u,className:"min-w-24",children:u?"Saving...":"Save Changes"})]})]})}function be(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx("div",{children:s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Plugins"})}),s.jsx(Jt,{})]}),e[0]=t):t=e[0],t}function Wt(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-base font-semibold text-foreground",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),s.jsx(Ae,{})]}),e[0]=t):t=e[0],t}function Fe(){const e=z.c(3);let t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te,{className:"h-6 w-48"}),n=s.jsx(te,{className:"h-4 w-80"}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col gap-4 pt-2",children:[t,n,s.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[s.jsx(te,{className:"h-12 w-full"}),s.jsx(te,{className:"h-12 w-full"})]})]}),e[2]=r):r=e[2],r}function ye(e){const t=z.c(14),{projectSlug:n,children:r}=e,{org:i}=J(),{data:l,isLoading:o}=_e(i.id,n);if(o||!l){let x;return t[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Fe,{}),t[0]=x):x=t[0],x}const m=n===G;let u;t[1]!==l.description||t[2]!==l.enabledPlugins||t[3]!==l.id||t[4]!==l.name||t[5]!==l.organizationId||t[6]!==l.slug||t[7]!==l.ui||t[8]!==m?(u={id:l.id,organizationId:l.organizationId,slug:l.slug,name:l.name,description:l.description,enabledPlugins:l.enabledPlugins,ui:l.ui,isOrgAdmin:m},t[1]=l.description,t[2]=l.enabledPlugins,t[3]=l.id,t[4]=l.name,t[5]=l.organizationId,t[6]=l.slug,t[7]=l.ui,t[8]=m,t[9]=u):u=t[9];const f=u;let d;return t[10]!==r||t[11]!==f||t[12]!==i?(d=s.jsx(Ce,{org:i,project:f,children:r}),t[10]=r,t[11]=f,t[12]=i,t[13]=d):d=t[13],d}function Zt(e){const t=z.c(19),{section:n}=e;let r;t[0]!==n?(r=ke(n),t[0]=n,t[1]=r):r=t[1];const i=r;if(i){let l;t[2]!==i.sub?(l=i.sub==="general"&&s.jsx(Mt,{}),t[2]=i.sub,t[3]=l):l=t[3];let o;t[4]!==i.sub?(o=i.sub==="plugins"&&s.jsx(be,{}),t[4]=i.sub,t[5]=o):o=t[5];let m;t[6]!==i.sub?(m=i.sub==="danger"&&s.jsx(Wt,{}),t[6]=i.sub,t[7]=m):m=t[7];let u;return t[8]!==i.slug||t[9]!==l||t[10]!==o||t[11]!==m?(u=s.jsxs(ye,{projectSlug:i.slug,children:[l,o,m]}),t[8]=i.slug,t[9]=l,t[10]=o,t[11]=m,t[12]=u):u=t[12],u}switch(n){case"account.profile":{let l;return t[13]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(kt,{}),t[13]=l):l=t[13],l}case"account.preferences":{let l;return t[14]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{}),t[14]=l):l=t[14],l}case"account.experimental":{let l;return t[15]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx($t,{}),t[15]=l):l=t[15],l}case"org.general":{let l;return t[16]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(At,{}),t[16]=l):l=t[16],l}case"org.plugins":{let l;return t[17]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ye,{projectSlug:G,children:s.jsx(be,{})}),t[17]=l):l=t[17],l}default:{let l;return t[18]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{}),t[18]=l):l=t[18],l}}}function Ht(){const e=z.c(23),{isOpen:t,activeSection:n,open:r,close:i}=Ze();let l;e[0]!==i?(l=y=>!y&&i(),e[0]=i,e[1]=l):l=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"w-52 shrink-0 border-r border-border"}),e[2]=o):o=e[2];let m;e[3]!==n||e[4]!==r?(m=s.jsx(O.Suspense,{fallback:o,children:s.jsx(Pt,{activeSection:n,onNavigate:r})}),e[3]=n,e[4]=r,e[5]=m):m=e[5];let u,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Pe,{size:16}),f=s.jsx("span",{className:"sr-only",children:"Close"}),e[6]=u,e[7]=f):(u=e[6],f=e[7]);let d;e[8]!==i?(d=s.jsxs("button",{type:"button",onClick:i,className:"absolute top-4 right-4 rounded-md p-1 opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-ring",children:[u,f]}),e[8]=i,e[9]=d):d=e[9];let x;e[10]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Fe,{}),e[10]=x):x=e[10];let a;e[11]!==n?(a=s.jsx(O.Suspense,{fallback:x,children:s.jsx(Zt,{section:n})}),e[11]=n,e[12]=a):a=e[12];let g;e[13]!==d||e[14]!==a?(g=s.jsxs("div",{className:"flex-1 overflow-y-auto p-8 min-w-0 relative",children:[d,a]}),e[13]=d,e[14]=a,e[15]=g):g=e[15];let j;e[16]!==m||e[17]!==g?(j=s.jsx(qe,{className:"sm:max-w-[1100px] h-[85vh] p-0 overflow-hidden flex flex-col gap-0",closeButtonClassName:"hidden",children:s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[m,g]})}),e[16]=m,e[17]=g,e[18]=j):j=e[18];let h;return e[19]!==t||e[20]!==l||e[21]!==j?(h=s.jsx(Ge,{open:t,onOpenChange:l,children:j}),e[19]=t,e[20]=l,e[21]=j,e[22]=h):h=e[22],h}function Yt(e){const t=z.c(12),{projectSlug:n,orgSlug:r,error:i}=e,l=ne();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("h1",{className:"text-xl font-semibold",children:"Failed to load project"}),t[0]=o):o=t[0];let m;t[1]!==n?(m=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',n,'".']}),t[1]=n,t[2]=m):m=t[2];let u;t[3]!==i.message?(u=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.message}),t[3]=i.message,t[4]=u):u=t[4];let f;t[5]!==l||t[6]!==r?(f=s.jsx(U,{variant:"link",onClick:()=>l({to:"/$org/$project",params:{org:r,project:G}}),children:"Go to organization home"}),t[5]=l,t[6]=r,t[7]=f):f=t[7];let d;return t[8]!==m||t[9]!==u||t[10]!==f?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[o,m,u,f]}),t[8]=m,t[9]=u,t[10]=f,t[11]=d):d=t[11],d}function Xt(e){const t=z.c(9),{projectSlug:n,orgSlug:r}=e,i=ne();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),t[0]=l):l=t[0];let o;t[1]!==n?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',n,'" does not exist in this organization.']}),t[1]=n,t[2]=o):o=t[2];let m;t[3]!==i||t[4]!==r?(m=s.jsx(U,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:r,project:G}}),children:"Go to organization home"}),t[3]=i,t[4]=r,t[5]=m):m=t[5];let u;return t[6]!==o||t[7]!==m?(u=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[l,o,m]}),t[6]=o,t[7]=m,t[8]=u):u=t[8],u}function es(){const e=z.c(23);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const n=Re(t),{org:r}=J(),i=n.org,l=n.project,{data:o,isLoading:m,error:u}=_e(r.id,l);if(m){let h;return e[1]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ae,{}),e[1]=h):h=e[1],h}if(u){let h;return e[2]!==u||e[3]!==i||e[4]!==l?(h=s.jsx(Yt,{projectSlug:l,orgSlug:i,error:u}),e[2]=u,e[3]=i,e[4]=l,e[5]=h):h=e[5],h}if(!o){let h;return e[6]!==i||e[7]!==l?(h=s.jsx(Xt,{projectSlug:l,orgSlug:i}),e[6]=i,e[7]=l,e[8]=h):h=e[8],h}const f=o.slug===G;let d;e[9]!==o.description||e[10]!==o.enabledPlugins||e[11]!==o.id||e[12]!==o.name||e[13]!==o.organizationId||e[14]!==o.slug||e[15]!==o.ui||e[16]!==f?(d={id:o.id,organizationId:o.organizationId,slug:o.slug,name:o.name,description:o.description,enabledPlugins:o.enabledPlugins,ui:o.ui,isOrgAdmin:f},e[9]=o.description,e[10]=o.enabledPlugins,e[11]=o.id,e[12]=o.name,e[13]=o.organizationId,e[14]=o.slug,e[15]=o.ui,e[16]=f,e[17]=d):d=e[17];const x=d;let a,g;e[18]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(O.Suspense,{fallback:s.jsx(ae,{}),children:s.jsx(Me,{})}),g=s.jsx(Ht,{}),e[18]=a,e[19]=g):(a=e[18],g=e[19]);let j;return e[20]!==x||e[21]!==r?(j=s.jsxs(Ce,{org:r,project:x,children:[a,g]}),e[20]=x,e[21]=r,e[22]=j):j=e[22],j}function Rs(){const e=z.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(O.Suspense,{fallback:s.jsx(ae,{}),children:s.jsx(es,{})}),e[0]=t):t=e[0],t}export{Rs as default};
|