@decocms/mesh 2.77.0 → 2.78.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-oGnqqT1Z.js → AlertCircle-BppvLQSd.js} +1 -1
- package/dist/client/assets/{ArrowUp-DyvHGnwT.js → ArrowUp-D26ZQKRa.js} +1 -1
- package/dist/client/assets/{Calendar-DH27yGmZ.js → Calendar-DDieAsd2.js} +1 -1
- package/dist/client/assets/{Check-BlatIqwx.js → Check-bgVFNRDs.js} +1 -1
- package/dist/client/assets/{CheckCircle-A7jAb6dO.js → CheckCircle-D5tJhsvc.js} +1 -1
- package/dist/client/assets/{CheckDone01-6mjKztKu.js → CheckDone01-dY3WtOge.js} +1 -1
- package/dist/client/assets/{ChevronDown-CCp2JMaE.js → ChevronDown-DY4fpd0G.js} +1 -1
- package/dist/client/assets/{ChevronRight-BcCazbVH.js → ChevronRight-DMzFQQCc.js} +1 -1
- package/dist/client/assets/{Code01-D97OsfSf.js → Code01-7hV4ZDjZ.js} +1 -1
- package/dist/client/assets/{Copy01-DGJsTP15.js → Copy01-C35WeFYE.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-C2NdUnkY.js → DotsHorizontal-LbVwX-Tq.js} +1 -1
- package/dist/client/assets/{DotsVertical-BahQdspO.js → DotsVertical-BNqPYTki.js} +1 -1
- package/dist/client/assets/{Download01-NaPFxXbm.js → Download01-Cihql6Z7.js} +1 -1
- package/dist/client/assets/{Edit01-CSl-FU1V.js → Edit01-DDrpQJgk.js} +1 -1
- package/dist/client/assets/{File02-DCmcNtYa.js → File02-GEmd_G7y.js} +1 -1
- package/dist/client/assets/{File06-BmPjFHnz.js → File06-888BgyfZ.js} +1 -1
- package/dist/client/assets/{FilterLines-Bbx0mrEz.js → FilterLines-Bvkz4XO7.js} +1 -1
- package/dist/client/assets/{Globe02-B4QQLqTF.js → Globe02-DSX2gzp_.js} +1 -1
- package/dist/client/assets/{Grid01-CXhtcjgR.js → Grid01-CfSiTcO8.js} +1 -1
- package/dist/client/assets/{Home02-DTzcdbjE.js → Home02-PhQXF8P6.js} +1 -1
- package/dist/client/assets/{Image01-Cw_RHYUi.js → Image01-BUR65REQ.js} +1 -1
- package/dist/client/assets/{Inbox01-Cd7KCD-D.js → Inbox01-Bhe6QhSW.js} +1 -1
- package/dist/client/assets/{InfoCircle-D87-HsMo.js → InfoCircle-5NZyA5WD.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DAYrBD75.js → LinkExternal01-Cr89LzOE.js} +1 -1
- package/dist/client/assets/{List-BOdL1TDJ.js → List-BBkbo-oe.js} +1 -1
- package/dist/client/assets/{Loading01-DcUBqOzt.js → Loading01-C2vqzEw-.js} +1 -1
- package/dist/client/assets/{Lock01-CJlTX6d9.js → Lock01-ClMI2bMm.js} +1 -1
- package/dist/client/assets/{Pin01-Cetrd1z7.js → Pin01-uiXGtZsb.js} +1 -1
- package/dist/client/assets/{Play-76i3R5Mg.js → Play-Bm8SKfhZ.js} +1 -1
- package/dist/client/assets/{Plus-CBeTqgO0.js → Plus-BMOTPGqH.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-qWaidSs5.js → RefreshCcw01-B1tus5Lj.js} +1 -1
- package/dist/client/assets/{SearchMd-DlO0jVus.js → SearchMd-BqVXNd65.js} +1 -1
- package/dist/client/assets/{Settings01-Dyku2FbW.js → Settings01-CYRp4gjN.js} +1 -1
- package/dist/client/assets/{Settings02-CYlXe29M.js → Settings02-BiTxgSpC.js} +1 -1
- package/dist/client/assets/{Share07-5RJmIBaS.js → Share07-BZVoNuS6.js} +1 -1
- package/dist/client/assets/{Terminal-CwhCdVNd.js → Terminal-DRpoCIsG.js} +1 -1
- package/dist/client/assets/{Tool01-SB9NL9XB.js → Tool01-djk7g7Hv.js} +1 -1
- package/dist/client/assets/{Trash01-B5rQsNj_.js → Trash01-d4v7i3Ze.js} +1 -1
- package/dist/client/assets/{Upload01-up-2G0Zk.js → Upload01-Ci_jklEk.js} +1 -1
- package/dist/client/assets/{Users03-YVnet25Q.js → Users03-Bw7fWrTD.js} +1 -1
- package/dist/client/assets/{X-CDixI9Fp.js → X-CslJd5Ib.js} +1 -1
- package/dist/client/assets/{XClose-9HhuzPl1.js → XClose-CjpNuP8c.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-D_HsP759.js → agent-connections-preview-qFrRTce9.js} +1 -1
- package/dist/client/assets/{agent-detail-CNliY0im.js → agent-detail-BqrAf6oD.js} +1 -1
- package/dist/client/assets/{agents-DSOm54r8.js → agents-DUQt1GSW.js} +1 -1
- package/dist/client/assets/{alert-dialog-CezkcFZv.js → alert-dialog-DRso9X1m.js} +1 -1
- package/dist/client/assets/{auth-catchall-Ddtu2gr8.js → auth-catchall-CBFb2pC-.js} +1 -1
- package/dist/client/assets/{avatar-a-IdsKtd.js → avatar-kY9raA-l.js} +1 -1
- package/dist/client/assets/{badge-DyTP00ui.js → badge-DBw6AEaX.js} +1 -1
- package/dist/client/assets/{binder-D3g26T9_.js → binder-Jddq1y1v.js} +1 -1
- package/dist/client/assets/{breadcrumb-CrQKEc0V.js → breadcrumb-ChH6wfcA.js} +1 -1
- package/dist/client/assets/{button-IcLvDS7b.js → button-D_OpQIQm.js} +1 -1
- package/dist/client/assets/{card-DPhTtE1j.js → card-DAZxrY9k.js} +1 -1
- package/dist/client/assets/{checkbox-BMOSGAPg.js → checkbox-C1Sx9y02.js} +1 -1
- package/dist/client/assets/{circle-alert-CUdPHotP.js → circle-alert-DHI8xRUj.js} +1 -1
- package/dist/client/assets/collection-detail-mD5cqpxJ.js +26 -0
- package/dist/client/assets/{collection-search-C9obF9Ju.js → collection-search-Bkd4qN8a.js} +1 -1
- package/dist/client/assets/{collection-tab-B0D5Ge1w.js → collection-tab-Dw5b9EM9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B0DqLvbL.js → collection-table-wrapper-DFTdnQhc.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bh3_w0C-.js → collection-tabs-N53MF1Jz.js} +1 -1
- package/dist/client/assets/{command-xbgaBPKx.js → command-B5nNM5RC.js} +1 -1
- package/dist/client/assets/{connect-B1f578pl.js → connect--hPmG576.js} +1 -1
- package/dist/client/assets/{connection-card-DzzffrUK.js → connection-card-Ci3H_H7r.js} +1 -1
- package/dist/client/assets/{connection-detail-Dc9842ih.js → connection-detail-8nT6j66Y.js} +1 -1
- package/dist/client/assets/{connections-DMThZLY2.js → connections-ShazCLrP.js} +1 -1
- package/dist/client/assets/constants-1u4R2d-I.js +1 -0
- package/dist/client/assets/{constants-Bb6jn5pm.js → constants-DisdEZ3l.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Cv4z3yf1.js → create-organization-dialog-Ca5pwwfH.js} +1 -1
- package/dist/client/assets/{create-project-dialog-B-TMsdZD.js → create-project-dialog-BDfz4rOz.js} +1 -1
- package/dist/client/assets/{dialog-BP68A3-r.js → dialog-BPL7ZvPc.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C0weu07S.js → dropdown-menu-BxLN4KkF.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-C3YR0WSk.js → dynamic-plugin-layout-D9dQ0ajA.js} +1 -1
- package/dist/client/assets/{empty-state-BY2kT0YF.js → empty-state-CbIU_RrP.js} +1 -1
- package/dist/client/assets/{empty-state-CcIz0DtW.js → empty-state-DXJM9xrV.js} +1 -1
- package/dist/client/assets/{env-vars-editor-DJJKlTL9.js → env-vars-editor-BbjrljLQ.js} +1 -1
- package/dist/client/assets/{error-boundary-Dxa9vN4s.js → error-boundary-BMH0CjEH.js} +1 -1
- package/dist/client/assets/{estree-BOE5AzoZ.js → estree-CwOGYdhi.js} +2 -2
- package/dist/client/assets/{extract-connection-data-qxA4zC_1.js → extract-connection-data-wB5jtXsg.js} +1 -1
- package/dist/client/assets/{file-browser-C4JlHX7p.js → file-browser-DBOCTon5.js} +2 -2
- package/dist/client/assets/{form-CPbw8FiC.js → form-BpiblhO1.js} +1 -1
- package/dist/client/assets/{grid-view-Pi_wFmga.js → grid-view-Bty4YwjE.js} +1 -1
- package/dist/client/assets/{home-D9pqYJxL.js → home-BIvstm5O.js} +1 -1
- package/dist/client/assets/{index-DIqndGeg.js → index--vZ0X2xS.js} +1 -1
- package/dist/client/assets/{index-CV7G73w0.js → index-B9-4goiW.js} +1 -1
- package/dist/client/assets/{index-ChHDKIbN.js → index-BKpxPW_G.js} +6 -6
- package/dist/client/assets/{index-BQaDRMwA.js → index-BV_k_ZyP.js} +1 -1
- package/dist/client/assets/{index-DauKEk3R.js → index-B_142IPp.js} +2 -2
- package/dist/client/assets/{index-BE8lTkR-.js → index-CnNzyZrg.js} +1 -1
- package/dist/client/assets/{index-CIjJkh1w.js → index-D-_nr7La.js} +1 -1
- package/dist/client/assets/index-D0nVkmnC.js +25 -0
- package/dist/client/assets/{index-Bofa5A4c.js → index-fVGDVKMq.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BJxHLYt6.js → infiniteQueryObserver-B8M15Jhm.js} +1 -1
- package/dist/client/assets/{input-BiH6tKYM.js → input-lpAGMNlp.js} +1 -1
- package/dist/client/assets/{integration-icon-D8EX8kVH.js → integration-icon-DFSc5_D8.js} +1 -1
- package/dist/client/assets/{label-CL-z0zvN.js → label-h0it3r-G.js} +1 -1
- package/dist/client/assets/{layout-DS9ZU1FV.js → layout-DaBTH10o.js} +1 -1
- package/dist/client/assets/{localstorage-keys-CglJRhni.js → localstorage-keys-CrJngaoW.js} +1 -1
- package/dist/client/assets/{login-CQ4DI182.js → login-DX4NlTrd.js} +1 -1
- package/dist/client/assets/{mcp-oauth-pNbworXN.js → mcp-oauth-DQYLB8aB.js} +1 -1
- package/dist/client/assets/{mcp-server-card-CiBv2daD.js → mcp-server-card-fBAhOAUG.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-CWlOVXjE.js → mcp-server-detail-BZkrf0kt.js} +2 -2
- package/dist/client/assets/{members-DP31FB6R.js → members-BigA6ZKR.js} +1 -1
- package/dist/client/assets/{monaco-editor-B3-QQ48f.js → monaco-editor-DZSx9WV6.js} +2 -2
- package/dist/client/assets/{monitoring-CEJjhEzo.js → monitoring-cMb0Xapp.js} +3 -3
- package/dist/client/assets/{oauth-callback-DwNVkFW_.js → oauth-callback-CjSC6FG1.js} +1 -1
- package/dist/client/assets/{page-UBkAPmC5.js → page-BDwNfQ-N.js} +1 -1
- package/dist/client/assets/{page-BYKRtBSp.js → page-jq7pkske.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BpFO_GZ3.js → plugin-empty-state-CIjn_En1.js} +1 -1
- package/dist/client/assets/{plugin-header-COGg6PEu.js → plugin-header-DxKd-JRE.js} +1 -1
- package/dist/client/assets/{popover-JVz1MvYo.js → popover-ESVk6nXT.js} +1 -1
- package/dist/client/assets/{project-layout-D_GhuXhx.js → project-layout-DOGEQwDl.js} +1 -1
- package/dist/client/assets/{project-settings-YCZbbN-X.js → project-settings-DPjoRdOS.js} +1 -1
- package/dist/client/assets/{projects-list-DK4ua0bt.js → projects-list-BSPk4OqL.js} +1 -1
- package/dist/client/assets/{registry-utils-BAvR5D-B.js → registry-utils-yxVJe3X4.js} +1 -1
- package/dist/client/assets/{resizable-Z1lo2KUF.js → resizable-fcBWjaSA.js} +1 -1
- package/dist/client/assets/{select-DWWlFXcM.js → select-BbzYJ4VF.js} +1 -1
- package/dist/client/assets/{shell-layout-j0caJ6cv.js → shell-layout-DlF3XvPK.js} +1 -1
- package/dist/client/assets/{spinner-DDglcYN3.js → spinner-Lv2khbLw.js} +1 -1
- package/dist/client/assets/{store-invite-DE3oTPEQ.js → store-invite-Bg3OdZwq.js} +1 -1
- package/dist/client/assets/{switch-BU39MRXa.js → switch-sdaV-SJo.js} +1 -1
- package/dist/client/assets/{table-DkKXRH0o.js → table-BxUix49E.js} +1 -1
- package/dist/client/assets/{tasks-B5becd8b.js → tasks-Bl2i_lGW.js} +1 -1
- package/dist/client/assets/{textarea-B0H-V_2P.js → textarea-BRJpMcB0.js} +1 -1
- package/dist/client/assets/{tools-list-BPmcCiBX.js → tools-list-Cmzz8Wet.js} +1 -1
- package/dist/client/assets/{topbar-portal-COlO8Xo1.js → topbar-portal-bqTUj07t.js} +1 -1
- package/dist/client/assets/{typewriter-title-Bwf3Eryu.js → typewriter-title-BPMIdq0b.js} +1 -1
- package/dist/client/assets/{use-binding-BF44Dr3v.js → use-binding-DMsO_03X.js} +1 -1
- package/dist/client/assets/{use-connection-DMc1ed7A.js → use-connection-B0740Saa.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DFreYzbI.js → use-create-virtual-mcp-lh01_aoW.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-C_KGQyGq.js → use-deco-chat-open-B2KYtTue.js} +2 -2
- package/dist/client/assets/{use-install-from-registry--Nvk5mQH.js → use-install-from-registry-BjKzt3Pz.js} +1 -1
- package/dist/client/assets/{use-list-state-BHsqFECN.js → use-list-state-DNfSCsX5.js} +1 -1
- package/dist/client/assets/{use-llm-B0wA4ukF.js → use-llm-D28vq8-j.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DnDIhnz1.js → use-mcp-prompts-FoVTG9k7.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D7_YQODs.js → use-mcp-tools-DF65_5AL.js} +1 -1
- package/dist/client/assets/{use-mobile-DKBgr338.js → use-mobile-Cu9U-yCu.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DhaOb6f0.js → use-organization-settings-CPNBbiln.js} +1 -1
- package/dist/client/assets/{use-project-DuJfQ5Lc.js → use-project-CuNldV92.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Dx2SDNW7.js → use-virtual-mcp-BUCuQhrG.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CsMrU_k5.js +1 -0
- package/dist/client/assets/{useMutation-CR-ZbATX.js → useMutation-Bnsod7M-.js} +1 -1
- package/dist/client/assets/useQuery-Bo6lCSyK.js +1 -0
- package/dist/client/assets/utils-Ckp7rFN8.js +1 -0
- package/dist/client/assets/{view-mode-toggle-DL3lAsm5.js → view-mode-toggle-4jMhv4Z3.js} +1 -1
- package/dist/client/assets/{workflow-COg9B_We.js → workflow-BrBoF9SG.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +151 -148
- package/dist/server/server.js +126 -123
- package/package.json +1 -1
- package/dist/client/assets/collection-detail-CVwTrXbU.js +0 -26
- package/dist/client/assets/constants-D3p69qeS.js +0 -1
- package/dist/client/assets/index-Dw0obvD7.js +0 -25
- package/dist/client/assets/useInfiniteQuery-l-SVnEZQ.js +0 -1
- package/dist/client/assets/useQuery-t9jS7IDj.js +0 -1
- package/dist/client/assets/utils-B_eWxCLR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e}from"./index-
|
|
1
|
+
import{r as i,j as e}from"./index-BKpxPW_G.js";import{i as n}from"./Loading01-C2vqzEw-.js";import{h as l}from"./mcp-oauth-DQYLB8aB.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as G,r as D,u as X,y as ue,K as le,bp as xe,j as s,m as oe,O as ie,g as ge,bq as pe,l as he}from"./index-ChHDKIbN.js";import{P as U}from"./index-CV7G73w0.js";import{B as je,a as ve,b as ye,c as be}from"./breadcrumb-CrQKEc0V.js";import{i as ae}from"./FilterLines-Bbx0mrEz.js";import{n as Ne}from"./Inbox01-Cd7KCD-D.js";import{i as Z}from"./Loading01-DcUBqOzt.js";import{i as ce}from"./SearchMd-DlO0jVus.js";import{u as Ce}from"./useInfiniteQuery-l-SVnEZQ.js";import{a as Se,f as we,b as Te}from"./registry-utils-BAvR5D-B.js";import{u as Ie,h as Re,b as Pe}from"./constants-Bb6jn5pm.js";import{f as $e,g as me,h as ke}from"./use-connection-DMc1ed7A.js";import{s as Le}from"./slugify-CEUa2lfQ.js";import{C as ze}from"./collection-search-C9obF9Ju.js";import{M as re}from"./mcp-server-card-CiBv2daD.js";import{B as J}from"./button-IcLvDS7b.js";import{I as Fe}from"./input-BiH6tKYM.js";import{c as de}from"./utils-B_eWxCLR.js";import{b as Ke,P as Ae,a as Ee}from"./popover-JVz1MvYo.js";import{i as Be}from"./Check-BlatIqwx.js";import{t as De}from"./ChevronDown-CCp2JMaE.js";import{s as Y}from"./XClose-9HhuzPl1.js";import{d as Me,a as Oe,b as Ve,c as _e,S as We}from"./select-DWWlFXcM.js";import{s as qe}from"./Plus-CBeTqgO0.js";import{E as Ge}from"./empty-state-CcIz0DtW.js";import{u as He}from"./use-binding-BF44Dr3v.js";import{L as Ue,u as Je}from"./localstorage-keys-CglJRhni.js";import"./ChevronRight-BcCazbVH.js";import"./infiniteQueryObserver-BJxHLYt6.js";import"./useMutation-CR-ZbATX.js";import"./integration-icon-D8EX8kVH.js";import"./index-Bofa5A4c.js";import"./Globe02-B4QQLqTF.js";import"./Lock01-CJlTX6d9.js";import"./Terminal-CwhCdVNd.js";import"./card-DPhTtE1j.js";import"./github-icon-Dp3wHhYE.js";import"./binder-D3g26T9_.js";import"./useQuery-t9jS7IDj.js";function Qe(t,e){const l=G.c(4),[n,c]=D.useState(t),r=D.useRef(null),a=D.useRef(!0);let i,m;return l[0]!==e||l[1]!==t?(i=()=>{if(a.current){a.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},m=[t,e],l[0]=e,l[1]=t,l[2]=i,l[3]=m):(i=l[2],m=l[3]),D.useEffect(i,m),n}function Ye(t){const e=G.c(14),l=D.useRef(null),n=`scroll-position:${t}`,c=D.useRef(null);let r;e[0]!==n?(r=()=>{l.current&&sessionStorage.setItem(n,String(l.current.scrollTop))},e[0]=n,e[1]=r):r=e[1];const a=r;let i;e[2]!==n?(i=()=>{if(c.current===n)return;const d=sessionStorage.getItem(n);if(d&&l.current){const j=Number.parseInt(d,10);l.current.scrollTop=j}c.current=n},e[2]=n,e[3]=i):i=e[3];const m=i;let y;e[4]!==m||e[5]!==n?(y=()=>{c.current!==n&&m()},e[4]=m,e[5]=n,e[6]=y):y=e[6];const p=y;let o;e[7]!==m||e[8]!==n?(o=d=>{l.current=d,d&&c.current!==n&&requestAnimationFrame(()=>{m()})},e[7]=m,e[8]=n,e[9]=o):o=e[9];const b=o;let u;return e[10]!==p||e[11]!==a||e[12]!==b?(u={scrollRef:b,saveScrollPosition:a,handleScroll:p},e[10]=p,e[11]=a,e[12]=b,e[13]=u):u=e[13],u}const Ze=24;function Xe(t){const e=G.c(53),{registryId:l,listToolName:n,filtersToolName:c,search:r}=t,{org:a}=X();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[m,y]=D.useState(i);let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[1]=p):p=e[1];const[o,b]=D.useState(p),u=l||null;let d;e[2]!==a.id||e[3]!==u?(d={connectionId:u,orgId:a.id},e[2]=a.id,e[3]=u,e[4]=d):d=e[4];const j=Ie(d),I=!!c;let N;e[5]!==c||e[6]!==l?(N=le.toolCall(l,c||"no-filters","{}"),e[5]=c,e[6]=l,e[7]=N):N=e[7];let C;e[8]!==j||e[9]!==c?(C=async()=>{if(!c)return{tags:[],categories:[]};const B=await j.callTool({name:c,arguments:{}});return B.structuredContent??B},e[8]=j,e[9]=c,e[10]=C):C=e[10];let L;e[11]!==N||e[12]!==C?(L={queryKey:N,queryFn:C,staleTime:36e5},e[11]=N,e[12]=C,e[13]=L):L=e[13];const{data:$}=ue(L);let v,S,w;if(e[14]!==n||e[15]!==l||e[16]!==r||e[17]!==o||e[18]!==m){const B=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;v={limit:Ze,...m.length>0&&{tags:m},...o.length>0&&{categories:o},...B&&{where:B}},w=Ce,S=le.toolCall(l,n,JSON.stringify(v)),e[14]=n,e[15]=l,e[16]=r,e[17]=o,e[18]=m,e[19]=v,e[20]=S,e[21]=w}else v=e[19],S=e[20],w=e[21];let T;e[22]!==j||e[23]!==v||e[24]!==n?(T=async B=>{const{pageParam:te}=B,fe=te?{...v,cursor:te}:v,se=await j.callTool({name:n,arguments:fe});return se.structuredContent??se},e[22]=j,e[23]=v,e[24]=n,e[25]=T):T=e[25];let z;e[26]!==T||e[27]!==S?(z={queryKey:S,queryFn:T,initialPageParam:void 0,getNextPageParam:et,staleTime:36e5,placeholderData:xe},e[26]=T,e[27]=S,e[28]=z):z=e[28];const{data:A,fetchNextPage:k,hasNextPage:f,isFetchingNextPage:x,isFetching:g,isLoading:R}=w(z);let P;e:{if(!A?.pages||A.pages.length===0){P=null;break e}const B=A.pages[0];if(typeof B=="object"&&B!==null&&"totalCount"in B&&typeof B.totalCount=="number"){P=B.totalCount;break e}P=null}const K=P,h=A?.pages;let F;e[29]!==h?(F=Se(h),e[29]=h,e[30]=F):F=e[30];const E=F;let O;e[31]!==r||e[32]!==o.length||e[33]!==m.length?(O=m.length>0||o.length>0||!!r?.trim(),e[31]=r,e[32]=o.length,e[33]=m.length,e[34]=O):O=e[34];const V=O,W=g&&!x&&!R&&V;let q;e[35]!==k||e[36]!==f||e[37]!==x?(q=()=>{f&&!x&&k()},e[35]=k,e[36]=f,e[37]=x,e[38]=q):q=e[38];const M=q,_=f??!1,H=I?$?.tags:void 0,ee=I?$?.categories:void 0;let Q;return e[39]!==V||e[40]!==g||e[41]!==x||e[42]!==W||e[43]!==R||e[44]!==E||e[45]!==M||e[46]!==o||e[47]!==m||e[48]!==_||e[49]!==H||e[50]!==ee||e[51]!==K?(Q={items:E,totalCount:K,hasMore:_,isLoadingMore:x,isFiltering:W,isInitialLoading:R,isFetching:g,loadMore:M,availableTags:H,availableCategories:ee,selectedTags:m,selectedCategories:o,setSelectedTags:y,setSelectedCategories:b,hasActiveFilters:V},e[39]=V,e[40]=g,e[41]=x,e[42]=W,e[43]=R,e[44]=E,e[45]=M,e[46]=o,e[47]=m,e[48]=_,e[49]=H,e[50]=ee,e[51]=K,e[52]=Q):Q=e[52],Q}function et(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function tt(t,e){return[...t].sort((l,n)=>n.count-l.count).slice(0,e)}function ne(t){const e=G.c(52),{label:l,items:n,selectedItems:c,onToggle:r,onClear:a}=t,[i,m]=D.useState(""),[y,p]=D.useState(!1);let o,b,u,d,j,I,N,C,L,$,v;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==y||e[4]!==i||e[5]!==c){const k=[...i?n.filter(F=>F.value.toLowerCase().includes(i.toLowerCase())):n].sort(st);u=c.length,b=Ke,L=y,$=p;let f;e[17]!==l?(f=s.jsx("span",{children:l}),e[17]=l,e[18]=f):f=e[18];let x;e[19]!==u?(x=u>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:u}),e[19]=u,e[20]=x):x=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(De,{size:14,className:"opacity-50"}),e[21]=g):g=e[21],e[22]!==x||e[23]!==f?(v=s.jsx(Ae,{asChild:!0,children:s.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[f,x,g]})}),e[22]=x,e[23]=f,e[24]=v):v=e[24],o=Ee,I="w-64 p-0",N="start";let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ce,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=R):R=e[25];let P;e[26]!==l?(P=l.toLowerCase(),e[26]=l,e[27]=P):P=e[27];const K=`Search ${P}...`;let h;e[28]===Symbol.for("react.memo_cache_sentinel")?(h=F=>m(F.target.value),e[28]=h):h=e[28],e[29]!==i||e[30]!==K?(C=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[R,s.jsx(Fe,{type:"text",placeholder:K,value:i,onChange:h,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]=i,e[30]=K,e[31]=C):C=e[31],d="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",j=k.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):k.map(F=>{const E=c.includes(F.value);return s.jsxs("button",{onClick:()=>r(F.value),className:de("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx(Be,{size:16,className:"text-muted-foreground shrink-0"}),F.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:F.count})]},F.value)}),e[0]=n,e[1]=l,e[2]=r,e[3]=y,e[4]=i,e[5]=c,e[6]=o,e[7]=b,e[8]=u,e[9]=d,e[10]=j,e[11]=I,e[12]=N,e[13]=C,e[14]=L,e[15]=$,e[16]=v}else o=e[6],b=e[7],u=e[8],d=e[9],j=e[10],I=e[11],N=e[12],C=e[13],L=e[14],$=e[15],v=e[16];let S;e[32]!==d||e[33]!==j?(S=s.jsx("div",{className:d,children:j}),e[32]=d,e[33]=j,e[34]=S):S=e[34];let w;e[35]!==l||e[36]!==a||e[37]!==u?(w=u>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(J,{variant:"ghost",size:"sm",onClick:a,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=a,e[37]=u,e[38]=w):w=e[38];let T;e[39]!==o||e[40]!==w||e[41]!==I||e[42]!==N||e[43]!==C||e[44]!==S?(T=s.jsxs(o,{className:I,align:N,children:[C,S,w]}),e[39]=o,e[40]=w,e[41]=I,e[42]=N,e[43]=C,e[44]=S,e[45]=T):T=e[45];let z;return e[46]!==b||e[47]!==T||e[48]!==L||e[49]!==$||e[50]!==v?(z=s.jsxs(b,{open:L,onOpenChange:$,children:[v,T]}),e[46]=b,e[47]=T,e[48]=L,e[49]=$,e[50]=v,e[51]=z):z=e[51],z}function st(t,e){return e.count-t.count}function lt(t){const e=G.c(67),{availableTags:l,availableCategories:n,selectedTags:c,selectedCategories:r,onTagChange:a,onCategoryChange:i}=t,m=l&&l.length>0||n&&n.length>0,y=c.length>0||r.length>0;if(!m)return null;let p;e[0]!==a||e[1]!==c?(p=f=>{c.includes(f)?a(c.filter(x=>x!==f)):a([...c,f])},e[0]=a,e[1]=c,e[2]=p):p=e[2];const o=p;let b;e[3]!==i||e[4]!==r?(b=f=>{r.includes(f)?i(r.filter(x=>x!==f)):i([...r,f])},e[3]=i,e[4]=r,e[5]=b):b=e[5];const u=b;let d;e[6]!==i||e[7]!==a?(d=()=>{a([]),i([])},e[6]=i,e[7]=a,e[8]=d):d=e[8];const j=d;let I,N,C,L,$,v,S;if(e[9]!==n||e[10]!==l||e[11]!==i||e[12]!==a||e[13]!==r||e[14]!==c||e[15]!==u||e[16]!==o){const f=n?tt(n,6):[];I=r,N=c,S=new Set(f.map(rt)),$="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(ae,{size:16})}),e[24]=x):x=e[24];let g;e[25]!==n||e[26]!==i||e[27]!==r||e[28]!==u?(g=n&&n.length>0&&s.jsx(ne,{label:"Categories",items:n,selectedItems:r,onToggle:u,onClear:()=>i([])}),e[25]=n,e[26]=i,e[27]=r,e[28]=u,e[29]=g):g=e[29];let R;e[30]!==l||e[31]!==a||e[32]!==c||e[33]!==o?(R=l&&l.length>0&&s.jsx(ne,{label:"Tags",items:l,selectedItems:c,onToggle:o,onClear:()=>a([])}),e[30]=l,e[31]=a,e[32]=c,e[33]=o,e[34]=R):R=e[34],e[35]!==R||e[36]!==g?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,g,R]}),e[35]=R,e[36]=g,e[37]=v):v=e[37],C="flex items-center gap-3 flex-wrap px-5 py-3";let P;e[38]!==r||e[39]!==u?(P=K=>{const h=r.includes(K.value);return s.jsxs("div",{onClick:()=>u(K.value),className:de("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",h?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:K.value}),h&&s.jsx("span",{onClick:F=>{F.stopPropagation(),u(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},K.value)},e[38]=r,e[39]=u,e[40]=P):P=e[40],L=f.map(P),e[9]=n,e[10]=l,e[11]=i,e[12]=a,e[13]=r,e[14]=c,e[15]=u,e[16]=o,e[17]=I,e[18]=N,e[19]=C,e[20]=L,e[21]=$,e[22]=v,e[23]=S}else I=e[17],N=e[18],C=e[19],L=e[20],$=e[21],v=e[22],S=e[23];let w;if(e[41]!==I||e[42]!==u||e[43]!==S){let f;e[45]!==S?(f=g=>!S.has(g),e[45]=S,e[46]=f):f=e[46];let x;e[47]!==u?(x=g=>s.jsxs("div",{onClick:()=>u(g),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:[s.jsx("span",{children:g}),s.jsx("span",{onClick:R=>{R.stopPropagation(),u(g)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`cat-${g}`),e[47]=u,e[48]=x):x=e[48],w=I.filter(f).map(x),e[41]=I,e[42]=u,e[43]=S,e[44]=w}else w=e[44];let T;if(e[49]!==N||e[50]!==o){let f;e[52]!==o?(f=x=>s.jsxs("div",{onClick:()=>o(x),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:[s.jsx("span",{children:x}),s.jsx("span",{onClick:g=>{g.stopPropagation(),o(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`tag-${x}`),e[52]=o,e[53]=f):f=e[53],T=N.map(f),e[49]=N,e[50]=o,e[51]=T}else T=e[51];let z;e[54]!==j||e[55]!==y?(z=y&&s.jsxs(J,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(Y,{size:14}),"Clear all"]}),e[54]=j,e[55]=y,e[56]=z):z=e[56];let A;e[57]!==z||e[58]!==C||e[59]!==L||e[60]!==w||e[61]!==T?(A=s.jsxs("div",{className:C,children:[L,w,T,z]}),e[57]=z,e[58]=C,e[59]=L,e[60]=w,e[61]=T,e[62]=A):A=e[62];let k;return e[63]!==A||e[64]!==$||e[65]!==v?(k=s.jsxs("div",{className:$,children:[v,A]}),e[63]=A,e[64]=$,e[65]=v,e[66]=k):k=e[66],k}function rt(t){return t.value}function nt(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(n=>(n.name||n.title||"").toLowerCase().includes(l)||(n.description||n.server.description||"").toLowerCase().includes(l))}function ot(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function it(t){const e=G.c(54),{registryId:l,listToolName:n,filtersToolName:c}=t,[r,a]=D.useState(""),i=Qe(r,300),m=oe(),{org:y}=X(),{scrollRef:p,saveScrollPosition:o,handleScroll:b}=Ye(`store-discovery:${l}`);let u;e[0]!==i||e[1]!==c||e[2]!==n||e[3]!==l?(u={registryId:l,listToolName:n,filtersToolName:c,search:i},e[0]=i,e[1]=c,e[2]=n,e[3]=l,e[4]=u):u=e[4];const{items:d,hasMore:j,isLoadingMore:I,isInitialLoading:N,isFetching:C,loadMore:L,availableTags:$,availableCategories:v,selectedTags:S,selectedCategories:w,setSelectedTags:T,setSelectedCategories:z,hasActiveFilters:A}=Xe(u);let k,f,x,g;e[5]!==i||e[6]!==C||e[7]!==N||e[8]!==d||e[9]!==r?(k=r?nt(d,r):d,f=(r!==i||C)&&!N&&!!r,g=k.filter(ot),x=k.filter(M=>!g.find(_=>_.id===M.id)),e[5]=i,e[6]=C,e[7]=N,e[8]=d,e[9]=r,e[10]=k,e[11]=f,e[12]=x,e[13]=g):(k=e[10],f=e[11],x=e[12],g=e[13]);const R=x;let P;e[14]!==m||e[15]!==y.slug||e[16]!==l||e[17]!==o?(P=M=>{o();const _=Le(M.name||M.title||M.server.title||""),H=M.server.name;m({to:"/$org/$project/store/$appName",params:{org:y.slug,project:ie,appName:_},search:{registryId:l,serverName:H}})},e[14]=m,e[15]=y.slug,e[16]=l,e[17]=o,e[18]=P):P=e[18];const K=P;let h;e[19]!==b||e[20]!==j||e[21]!==I||e[22]!==L?(h=M=>{if(b(),!j||I)return;const _=M.currentTarget;_.scrollHeight-_.scrollTop-_.clientHeight<200&&L()},e[19]=b,e[20]=j,e[21]=I,e[22]=L,e[23]=h):h=e[23];const F=h;let E;e[24]!==f||e[25]!==r?(E=s.jsx(ze,{value:r,onChange:a,placeholder:"Search for an MCP Server...",isSearching:f}),e[24]=f,e[25]=r,e[26]=E):E=e[26];let O;e[27]!==v||e[28]!==$||e[29]!==w||e[30]!==S||e[31]!==z||e[32]!==T?(O=s.jsx(lt,{availableTags:$,availableCategories:v,selectedTags:S,selectedCategories:w,onTagChange:T,onCategoryChange:z}),e[27]=v,e[28]=$,e[29]=w,e[30]=S,e[31]=z,e[32]=T,e[33]=O):O=e[33];let V;e[34]!==R||e[35]!==k||e[36]!==K||e[37]!==A||e[38]!==j||e[39]!==N||e[40]!==I||e[41]!==f||e[42]!==d||e[43]!==r||e[44]!==g?(V=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:N?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):d.length===0&&!A?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Ne,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):d.length===0&&A&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ae,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&k.length===0&&!f?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ce,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[f&&k.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),g.length>0&&s.jsx(re,{items:g,title:"Verified",onItemClick:K}),R.length>0&&s.jsx(re,{items:R,title:g.length>0?"All":"",onItemClick:K}),j&&I&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Z,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=R,e[35]=k,e[36]=K,e[37]=A,e[38]=j,e[39]=N,e[40]=I,e[41]=f,e[42]=d,e[43]=r,e[44]=g,e[45]=V):V=e[45];let W;e[46]!==F||e[47]!==p||e[48]!==V?(W=s.jsx("div",{ref:p,className:"flex-1 overflow-y-auto",onScroll:F,children:V}),e[46]=F,e[47]=p,e[48]=V,e[49]=W):W=e[49];let q;return e[50]!==E||e[51]!==O||e[52]!==W?(q=s.jsxs("div",{className:"flex flex-col h-full",children:[E,O,W]}),e[50]=E,e[51]=O,e[52]=W,e[53]=q):q=e[53],q}function at(t){const e=G.c(8),{registryId:l}=t,n=$e(l),c=n?.tools;let r;e[0]!==c?(r=we(c),e[0]=c,e[1]=r):r=e[1];const a=r;if(!a)throw new Error("This registry does not support listing store items.");const i=n?.tools;let m;e[2]!==i?(m=Te(i),e[2]=i,e[3]=m):m=e[3];const p=m||void 0;let o;return e[4]!==a||e[5]!==l||e[6]!==p?(o=s.jsx(it,{registryId:l,listToolName:a,filtersToolName:p}),e[4]=a,e[5]=l,e[6]=p,e[7]=o):o=e[7],o}function ct(t){const e=G.c(15),{registries:l,value:n,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:a,placeholder:i}=t,m=i===void 0?"Select a registry...":i;let y;e[0]!==m?(y=s.jsx(Oe,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ve,{placeholder:m})}),e[0]=m,e[1]=y):y=e[1];let p;e[2]!==l?(p=l.map(mt),e[2]=l,e[3]=p):p=e[3];let o;e[4]!==r||e[5]!==a?(o=a.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),a.map(d=>s.jsxs("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),r(d)},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:[s.jsxs("div",{className:"flex items-center gap-2",children:[d.icon?s.jsx("img",{src:d.icon,alt:d.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:d.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:d.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(qe,{size:16})})]},d.id??d.title))]}),e[4]=r,e[5]=a,e[6]=o):o=e[6];let b;e[7]!==p||e[8]!==o?(b=s.jsxs(_e,{children:[p,o]}),e[7]=p,e[8]=o,e[9]=b):b=e[9];let u;return e[10]!==c||e[11]!==y||e[12]!==b||e[13]!==n?(u=s.jsxs(We,{value:n,onValueChange:c,children:[y,b]}),e[10]=c,e[11]=y,e[12]=b,e[13]=n,e[14]=u):u=e[14],u}function mt(t){return s.jsx(Me,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function dt({registries:t,onConnected:e}){const l=me(),{org:{slug:n}}=X(),{data:c}=ge.useSession(),r=oe(),[a,i]=D.useState(!1),m=t[0],y=async()=>{if(!(!m||!c?.user?.id)){i(!0);try{const o=await l.create.mutateAsync(m);e?.(o.id)}finally{i(!1)}}},p=()=>{r({to:"/$org/$project/mcps",params:{org:n,project:ie},search:{action:"create"}})};return s.jsx(Ge,{image:s.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:s.jsxs(s.Fragment,{children:[s.jsxs(J,{variant:"outline",onClick:y,disabled:a||!m,children:[m?.icon&&s.jsx("img",{src:m.icon,alt:"",className:"size-4"}),a?"Installing...":"Install Registry"]}),s.jsx(J,{variant:"outline",onClick:p,children:"Custom Connection"})]})})}function Xt(){const t=G.c(42),{org:e}=X(),l=ke(),n=me(),c=pe(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,a=He(l);let i;t[0]!==a?(i=a.map(xt),t[0]=a,t[1]=i):i=t[1];const m=i;let y;t[2]!==e.slug?(y=Ue.selectedRegistry(e.slug),t[2]=e.slug,t[3]=y):y=t[3];const[p,o]=Je(y,ut);let b;if(t[4]!==a||t[5]!==p){let h;t[7]!==p?(h=F=>F.id===p,t[7]=p,t[8]=h):h=t[8],b=a.find(h),t[4]=a,t[5]=p,t[6]=b}else b=t[6];const d=b?.id||a[0]?.id||"";let j;t[9]!==e.id?(j=Re(e.id),t[9]=e.id,t[10]=j):j=t[10];let I;t[11]!==j?(I=[j],t[11]=j,t[12]=I):I=t[12];const N=I;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[Pe()],t[13]=C):C=t[13];const L=C;let $;t[14]!==n.create||t[15]!==o?($=async h=>{const F=await n.create.mutateAsync(h);o(F.id)},t[14]=n.create,t[15]=o,t[16]=$):$=t[16];const v=$;let S;t[17]!==a?(S=new Set(a.map(ft)),t[17]=a,t[18]=S):S=t[18];const w=S;let T;t[19]!==w||t[20]!==N?(T=N.filter(h=>h.id&&!w.has(h.id)),t[19]=w,t[20]=N,t[21]=T):T=t[21];const z=T;let A;t[22]!==w?(A=L.filter(h=>h.id&&!w.has(h.id)),t[22]=w,t[23]=A):A=t[23];const k=A;if(r){let h;return t[24]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(he,{}),t[24]=h):h=t[24],h}let f;t[25]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(U.Header.Left,{children:s.jsx(je,{children:s.jsx(ve,{children:s.jsx(ye,{children:s.jsx(be,{children:"Store"})})})})}),t[25]=f):f=t[25];let x;t[26]!==v?(x=async h=>v(h),t[26]=v,t[27]=x):x=t[27];let g;t[28]!==z||t[29]!==d||t[30]!==m||t[31]!==o||t[32]!==x?(g=s.jsxs(U.Header,{children:[f,s.jsx(U.Header.Right,{children:s.jsx(ct,{wellKnownRegistries:z,registries:m,value:d,onValueChange:o,onAddWellKnown:x,placeholder:"Select store..."})})]}),t[28]=z,t[29]=d,t[30]=m,t[31]=o,t[32]=x,t[33]=g):g=t[33];let R;t[34]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[34]=R):R=t[34];let P;t[35]!==k||t[36]!==d||t[37]!==o?(P=s.jsx(U.Content,{children:s.jsx(D.Suspense,{fallback:R,children:d?s.jsx(at,{registryId:d}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(dt,{registries:k,onConnected:h=>{o(h)}})})})}),t[35]=k,t[36]=d,t[37]=o,t[38]=P):P=t[38];let K;return t[39]!==g||t[40]!==P?(K=s.jsxs(U,{children:[g,P]}),t[39]=g,t[40]=P,t[41]=K):K=t[41],K}function ft(t){return t.id}function ut(t){return t??""}function xt(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Xt as default};
|
|
1
|
+
import{c as G,r as D,u as X,y as ue,K as le,bq as xe,j as s,m as oe,O as ie,g as ge,br as pe,l as he}from"./index-BKpxPW_G.js";import{P as U}from"./index-B9-4goiW.js";import{B as je,a as ve,b as ye,c as be}from"./breadcrumb-ChH6wfcA.js";import{i as ae}from"./FilterLines-Bvkz4XO7.js";import{n as Ne}from"./Inbox01-Bhe6QhSW.js";import{i as Z}from"./Loading01-C2vqzEw-.js";import{i as ce}from"./SearchMd-BqVXNd65.js";import{u as Ce}from"./useInfiniteQuery-CsMrU_k5.js";import{a as Se,f as we,b as Te}from"./registry-utils-yxVJe3X4.js";import{u as Ie,h as Re,b as Pe}from"./constants-DisdEZ3l.js";import{f as $e,g as me,h as ke}from"./use-connection-B0740Saa.js";import{s as Le}from"./slugify-CEUa2lfQ.js";import{C as ze}from"./collection-search-Bkd4qN8a.js";import{M as re}from"./mcp-server-card-fBAhOAUG.js";import{B as J}from"./button-D_OpQIQm.js";import{I as Fe}from"./input-lpAGMNlp.js";import{c as de}from"./utils-Ckp7rFN8.js";import{b as Ke,P as Ae,a as Ee}from"./popover-ESVk6nXT.js";import{i as Be}from"./Check-bgVFNRDs.js";import{t as De}from"./ChevronDown-DY4fpd0G.js";import{s as Y}from"./XClose-CjpNuP8c.js";import{d as Me,a as Oe,b as Ve,c as _e,S as We}from"./select-BbzYJ4VF.js";import{s as qe}from"./Plus-BMOTPGqH.js";import{E as Ge}from"./empty-state-DXJM9xrV.js";import{u as He}from"./use-binding-DMsO_03X.js";import{L as Ue,u as Je}from"./localstorage-keys-CrJngaoW.js";import"./ChevronRight-DMzFQQCc.js";import"./infiniteQueryObserver-B8M15Jhm.js";import"./useMutation-Bnsod7M-.js";import"./integration-icon-DFSc5_D8.js";import"./index-fVGDVKMq.js";import"./Globe02-DSX2gzp_.js";import"./Lock01-ClMI2bMm.js";import"./Terminal-DRpoCIsG.js";import"./card-DAZxrY9k.js";import"./github-icon-Dp3wHhYE.js";import"./binder-Jddq1y1v.js";import"./useQuery-Bo6lCSyK.js";function Qe(t,e){const l=G.c(4),[n,c]=D.useState(t),r=D.useRef(null),a=D.useRef(!0);let i,m;return l[0]!==e||l[1]!==t?(i=()=>{if(a.current){a.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},m=[t,e],l[0]=e,l[1]=t,l[2]=i,l[3]=m):(i=l[2],m=l[3]),D.useEffect(i,m),n}function Ye(t){const e=G.c(14),l=D.useRef(null),n=`scroll-position:${t}`,c=D.useRef(null);let r;e[0]!==n?(r=()=>{l.current&&sessionStorage.setItem(n,String(l.current.scrollTop))},e[0]=n,e[1]=r):r=e[1];const a=r;let i;e[2]!==n?(i=()=>{if(c.current===n)return;const d=sessionStorage.getItem(n);if(d&&l.current){const j=Number.parseInt(d,10);l.current.scrollTop=j}c.current=n},e[2]=n,e[3]=i):i=e[3];const m=i;let y;e[4]!==m||e[5]!==n?(y=()=>{c.current!==n&&m()},e[4]=m,e[5]=n,e[6]=y):y=e[6];const p=y;let o;e[7]!==m||e[8]!==n?(o=d=>{l.current=d,d&&c.current!==n&&requestAnimationFrame(()=>{m()})},e[7]=m,e[8]=n,e[9]=o):o=e[9];const b=o;let u;return e[10]!==p||e[11]!==a||e[12]!==b?(u={scrollRef:b,saveScrollPosition:a,handleScroll:p},e[10]=p,e[11]=a,e[12]=b,e[13]=u):u=e[13],u}const Ze=24;function Xe(t){const e=G.c(53),{registryId:l,listToolName:n,filtersToolName:c,search:r}=t,{org:a}=X();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[m,y]=D.useState(i);let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=[],e[1]=p):p=e[1];const[o,b]=D.useState(p),u=l||null;let d;e[2]!==a.id||e[3]!==u?(d={connectionId:u,orgId:a.id},e[2]=a.id,e[3]=u,e[4]=d):d=e[4];const j=Ie(d),I=!!c;let N;e[5]!==c||e[6]!==l?(N=le.toolCall(l,c||"no-filters","{}"),e[5]=c,e[6]=l,e[7]=N):N=e[7];let C;e[8]!==j||e[9]!==c?(C=async()=>{if(!c)return{tags:[],categories:[]};const B=await j.callTool({name:c,arguments:{}});return B.structuredContent??B},e[8]=j,e[9]=c,e[10]=C):C=e[10];let L;e[11]!==N||e[12]!==C?(L={queryKey:N,queryFn:C,staleTime:36e5},e[11]=N,e[12]=C,e[13]=L):L=e[13];const{data:$}=ue(L);let v,S,w;if(e[14]!==n||e[15]!==l||e[16]!==r||e[17]!==o||e[18]!==m){const B=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;v={limit:Ze,...m.length>0&&{tags:m},...o.length>0&&{categories:o},...B&&{where:B}},w=Ce,S=le.toolCall(l,n,JSON.stringify(v)),e[14]=n,e[15]=l,e[16]=r,e[17]=o,e[18]=m,e[19]=v,e[20]=S,e[21]=w}else v=e[19],S=e[20],w=e[21];let T;e[22]!==j||e[23]!==v||e[24]!==n?(T=async B=>{const{pageParam:te}=B,fe=te?{...v,cursor:te}:v,se=await j.callTool({name:n,arguments:fe});return se.structuredContent??se},e[22]=j,e[23]=v,e[24]=n,e[25]=T):T=e[25];let z;e[26]!==T||e[27]!==S?(z={queryKey:S,queryFn:T,initialPageParam:void 0,getNextPageParam:et,staleTime:36e5,placeholderData:xe},e[26]=T,e[27]=S,e[28]=z):z=e[28];const{data:A,fetchNextPage:k,hasNextPage:f,isFetchingNextPage:x,isFetching:g,isLoading:R}=w(z);let P;e:{if(!A?.pages||A.pages.length===0){P=null;break e}const B=A.pages[0];if(typeof B=="object"&&B!==null&&"totalCount"in B&&typeof B.totalCount=="number"){P=B.totalCount;break e}P=null}const K=P,h=A?.pages;let F;e[29]!==h?(F=Se(h),e[29]=h,e[30]=F):F=e[30];const E=F;let O;e[31]!==r||e[32]!==o.length||e[33]!==m.length?(O=m.length>0||o.length>0||!!r?.trim(),e[31]=r,e[32]=o.length,e[33]=m.length,e[34]=O):O=e[34];const V=O,W=g&&!x&&!R&&V;let q;e[35]!==k||e[36]!==f||e[37]!==x?(q=()=>{f&&!x&&k()},e[35]=k,e[36]=f,e[37]=x,e[38]=q):q=e[38];const M=q,_=f??!1,H=I?$?.tags:void 0,ee=I?$?.categories:void 0;let Q;return e[39]!==V||e[40]!==g||e[41]!==x||e[42]!==W||e[43]!==R||e[44]!==E||e[45]!==M||e[46]!==o||e[47]!==m||e[48]!==_||e[49]!==H||e[50]!==ee||e[51]!==K?(Q={items:E,totalCount:K,hasMore:_,isLoadingMore:x,isFiltering:W,isInitialLoading:R,isFetching:g,loadMore:M,availableTags:H,availableCategories:ee,selectedTags:m,selectedCategories:o,setSelectedTags:y,setSelectedCategories:b,hasActiveFilters:V},e[39]=V,e[40]=g,e[41]=x,e[42]=W,e[43]=R,e[44]=E,e[45]=M,e[46]=o,e[47]=m,e[48]=_,e[49]=H,e[50]=ee,e[51]=K,e[52]=Q):Q=e[52],Q}function et(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function tt(t,e){return[...t].sort((l,n)=>n.count-l.count).slice(0,e)}function ne(t){const e=G.c(52),{label:l,items:n,selectedItems:c,onToggle:r,onClear:a}=t,[i,m]=D.useState(""),[y,p]=D.useState(!1);let o,b,u,d,j,I,N,C,L,$,v;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==y||e[4]!==i||e[5]!==c){const k=[...i?n.filter(F=>F.value.toLowerCase().includes(i.toLowerCase())):n].sort(st);u=c.length,b=Ke,L=y,$=p;let f;e[17]!==l?(f=s.jsx("span",{children:l}),e[17]=l,e[18]=f):f=e[18];let x;e[19]!==u?(x=u>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:u}),e[19]=u,e[20]=x):x=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(De,{size:14,className:"opacity-50"}),e[21]=g):g=e[21],e[22]!==x||e[23]!==f?(v=s.jsx(Ae,{asChild:!0,children:s.jsxs(J,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[f,x,g]})}),e[22]=x,e[23]=f,e[24]=v):v=e[24],o=Ee,I="w-64 p-0",N="start";let R;e[25]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ce,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=R):R=e[25];let P;e[26]!==l?(P=l.toLowerCase(),e[26]=l,e[27]=P):P=e[27];const K=`Search ${P}...`;let h;e[28]===Symbol.for("react.memo_cache_sentinel")?(h=F=>m(F.target.value),e[28]=h):h=e[28],e[29]!==i||e[30]!==K?(C=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[R,s.jsx(Fe,{type:"text",placeholder:K,value:i,onChange:h,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]=i,e[30]=K,e[31]=C):C=e[31],d="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",j=k.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):k.map(F=>{const E=c.includes(F.value);return s.jsxs("button",{onClick:()=>r(F.value),className:de("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx(Be,{size:16,className:"text-muted-foreground shrink-0"}),F.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:F.count})]},F.value)}),e[0]=n,e[1]=l,e[2]=r,e[3]=y,e[4]=i,e[5]=c,e[6]=o,e[7]=b,e[8]=u,e[9]=d,e[10]=j,e[11]=I,e[12]=N,e[13]=C,e[14]=L,e[15]=$,e[16]=v}else o=e[6],b=e[7],u=e[8],d=e[9],j=e[10],I=e[11],N=e[12],C=e[13],L=e[14],$=e[15],v=e[16];let S;e[32]!==d||e[33]!==j?(S=s.jsx("div",{className:d,children:j}),e[32]=d,e[33]=j,e[34]=S):S=e[34];let w;e[35]!==l||e[36]!==a||e[37]!==u?(w=u>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(J,{variant:"ghost",size:"sm",onClick:a,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=a,e[37]=u,e[38]=w):w=e[38];let T;e[39]!==o||e[40]!==w||e[41]!==I||e[42]!==N||e[43]!==C||e[44]!==S?(T=s.jsxs(o,{className:I,align:N,children:[C,S,w]}),e[39]=o,e[40]=w,e[41]=I,e[42]=N,e[43]=C,e[44]=S,e[45]=T):T=e[45];let z;return e[46]!==b||e[47]!==T||e[48]!==L||e[49]!==$||e[50]!==v?(z=s.jsxs(b,{open:L,onOpenChange:$,children:[v,T]}),e[46]=b,e[47]=T,e[48]=L,e[49]=$,e[50]=v,e[51]=z):z=e[51],z}function st(t,e){return e.count-t.count}function lt(t){const e=G.c(67),{availableTags:l,availableCategories:n,selectedTags:c,selectedCategories:r,onTagChange:a,onCategoryChange:i}=t,m=l&&l.length>0||n&&n.length>0,y=c.length>0||r.length>0;if(!m)return null;let p;e[0]!==a||e[1]!==c?(p=f=>{c.includes(f)?a(c.filter(x=>x!==f)):a([...c,f])},e[0]=a,e[1]=c,e[2]=p):p=e[2];const o=p;let b;e[3]!==i||e[4]!==r?(b=f=>{r.includes(f)?i(r.filter(x=>x!==f)):i([...r,f])},e[3]=i,e[4]=r,e[5]=b):b=e[5];const u=b;let d;e[6]!==i||e[7]!==a?(d=()=>{a([]),i([])},e[6]=i,e[7]=a,e[8]=d):d=e[8];const j=d;let I,N,C,L,$,v,S;if(e[9]!==n||e[10]!==l||e[11]!==i||e[12]!==a||e[13]!==r||e[14]!==c||e[15]!==u||e[16]!==o){const f=n?tt(n,6):[];I=r,N=c,S=new Set(f.map(rt)),$="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(ae,{size:16})}),e[24]=x):x=e[24];let g;e[25]!==n||e[26]!==i||e[27]!==r||e[28]!==u?(g=n&&n.length>0&&s.jsx(ne,{label:"Categories",items:n,selectedItems:r,onToggle:u,onClear:()=>i([])}),e[25]=n,e[26]=i,e[27]=r,e[28]=u,e[29]=g):g=e[29];let R;e[30]!==l||e[31]!==a||e[32]!==c||e[33]!==o?(R=l&&l.length>0&&s.jsx(ne,{label:"Tags",items:l,selectedItems:c,onToggle:o,onClear:()=>a([])}),e[30]=l,e[31]=a,e[32]=c,e[33]=o,e[34]=R):R=e[34],e[35]!==R||e[36]!==g?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,g,R]}),e[35]=R,e[36]=g,e[37]=v):v=e[37],C="flex items-center gap-3 flex-wrap px-5 py-3";let P;e[38]!==r||e[39]!==u?(P=K=>{const h=r.includes(K.value);return s.jsxs("div",{onClick:()=>u(K.value),className:de("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",h?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:K.value}),h&&s.jsx("span",{onClick:F=>{F.stopPropagation(),u(K.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},K.value)},e[38]=r,e[39]=u,e[40]=P):P=e[40],L=f.map(P),e[9]=n,e[10]=l,e[11]=i,e[12]=a,e[13]=r,e[14]=c,e[15]=u,e[16]=o,e[17]=I,e[18]=N,e[19]=C,e[20]=L,e[21]=$,e[22]=v,e[23]=S}else I=e[17],N=e[18],C=e[19],L=e[20],$=e[21],v=e[22],S=e[23];let w;if(e[41]!==I||e[42]!==u||e[43]!==S){let f;e[45]!==S?(f=g=>!S.has(g),e[45]=S,e[46]=f):f=e[46];let x;e[47]!==u?(x=g=>s.jsxs("div",{onClick:()=>u(g),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:[s.jsx("span",{children:g}),s.jsx("span",{onClick:R=>{R.stopPropagation(),u(g)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`cat-${g}`),e[47]=u,e[48]=x):x=e[48],w=I.filter(f).map(x),e[41]=I,e[42]=u,e[43]=S,e[44]=w}else w=e[44];let T;if(e[49]!==N||e[50]!==o){let f;e[52]!==o?(f=x=>s.jsxs("div",{onClick:()=>o(x),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:[s.jsx("span",{children:x}),s.jsx("span",{onClick:g=>{g.stopPropagation(),o(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`tag-${x}`),e[52]=o,e[53]=f):f=e[53],T=N.map(f),e[49]=N,e[50]=o,e[51]=T}else T=e[51];let z;e[54]!==j||e[55]!==y?(z=y&&s.jsxs(J,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(Y,{size:14}),"Clear all"]}),e[54]=j,e[55]=y,e[56]=z):z=e[56];let A;e[57]!==z||e[58]!==C||e[59]!==L||e[60]!==w||e[61]!==T?(A=s.jsxs("div",{className:C,children:[L,w,T,z]}),e[57]=z,e[58]=C,e[59]=L,e[60]=w,e[61]=T,e[62]=A):A=e[62];let k;return e[63]!==A||e[64]!==$||e[65]!==v?(k=s.jsxs("div",{className:$,children:[v,A]}),e[63]=A,e[64]=$,e[65]=v,e[66]=k):k=e[66],k}function rt(t){return t.value}function nt(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(n=>(n.name||n.title||"").toLowerCase().includes(l)||(n.description||n.server.description||"").toLowerCase().includes(l))}function ot(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function it(t){const e=G.c(54),{registryId:l,listToolName:n,filtersToolName:c}=t,[r,a]=D.useState(""),i=Qe(r,300),m=oe(),{org:y}=X(),{scrollRef:p,saveScrollPosition:o,handleScroll:b}=Ye(`store-discovery:${l}`);let u;e[0]!==i||e[1]!==c||e[2]!==n||e[3]!==l?(u={registryId:l,listToolName:n,filtersToolName:c,search:i},e[0]=i,e[1]=c,e[2]=n,e[3]=l,e[4]=u):u=e[4];const{items:d,hasMore:j,isLoadingMore:I,isInitialLoading:N,isFetching:C,loadMore:L,availableTags:$,availableCategories:v,selectedTags:S,selectedCategories:w,setSelectedTags:T,setSelectedCategories:z,hasActiveFilters:A}=Xe(u);let k,f,x,g;e[5]!==i||e[6]!==C||e[7]!==N||e[8]!==d||e[9]!==r?(k=r?nt(d,r):d,f=(r!==i||C)&&!N&&!!r,g=k.filter(ot),x=k.filter(M=>!g.find(_=>_.id===M.id)),e[5]=i,e[6]=C,e[7]=N,e[8]=d,e[9]=r,e[10]=k,e[11]=f,e[12]=x,e[13]=g):(k=e[10],f=e[11],x=e[12],g=e[13]);const R=x;let P;e[14]!==m||e[15]!==y.slug||e[16]!==l||e[17]!==o?(P=M=>{o();const _=Le(M.name||M.title||M.server.title||""),H=M.server.name;m({to:"/$org/$project/store/$appName",params:{org:y.slug,project:ie,appName:_},search:{registryId:l,serverName:H}})},e[14]=m,e[15]=y.slug,e[16]=l,e[17]=o,e[18]=P):P=e[18];const K=P;let h;e[19]!==b||e[20]!==j||e[21]!==I||e[22]!==L?(h=M=>{if(b(),!j||I)return;const _=M.currentTarget;_.scrollHeight-_.scrollTop-_.clientHeight<200&&L()},e[19]=b,e[20]=j,e[21]=I,e[22]=L,e[23]=h):h=e[23];const F=h;let E;e[24]!==f||e[25]!==r?(E=s.jsx(ze,{value:r,onChange:a,placeholder:"Search for an MCP Server...",isSearching:f}),e[24]=f,e[25]=r,e[26]=E):E=e[26];let O;e[27]!==v||e[28]!==$||e[29]!==w||e[30]!==S||e[31]!==z||e[32]!==T?(O=s.jsx(lt,{availableTags:$,availableCategories:v,selectedTags:S,selectedCategories:w,onTagChange:T,onCategoryChange:z}),e[27]=v,e[28]=$,e[29]=w,e[30]=S,e[31]=z,e[32]=T,e[33]=O):O=e[33];let V;e[34]!==R||e[35]!==k||e[36]!==K||e[37]!==A||e[38]!==j||e[39]!==N||e[40]!==I||e[41]!==f||e[42]!==d||e[43]!==r||e[44]!==g?(V=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:N?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):d.length===0&&!A?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Ne,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):d.length===0&&A&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ae,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&k.length===0&&!f?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ce,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[f&&k.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),g.length>0&&s.jsx(re,{items:g,title:"Verified",onItemClick:K}),R.length>0&&s.jsx(re,{items:R,title:g.length>0?"All":"",onItemClick:K}),j&&I&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(Z,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=R,e[35]=k,e[36]=K,e[37]=A,e[38]=j,e[39]=N,e[40]=I,e[41]=f,e[42]=d,e[43]=r,e[44]=g,e[45]=V):V=e[45];let W;e[46]!==F||e[47]!==p||e[48]!==V?(W=s.jsx("div",{ref:p,className:"flex-1 overflow-y-auto",onScroll:F,children:V}),e[46]=F,e[47]=p,e[48]=V,e[49]=W):W=e[49];let q;return e[50]!==E||e[51]!==O||e[52]!==W?(q=s.jsxs("div",{className:"flex flex-col h-full",children:[E,O,W]}),e[50]=E,e[51]=O,e[52]=W,e[53]=q):q=e[53],q}function at(t){const e=G.c(8),{registryId:l}=t,n=$e(l),c=n?.tools;let r;e[0]!==c?(r=we(c),e[0]=c,e[1]=r):r=e[1];const a=r;if(!a)throw new Error("This registry does not support listing store items.");const i=n?.tools;let m;e[2]!==i?(m=Te(i),e[2]=i,e[3]=m):m=e[3];const p=m||void 0;let o;return e[4]!==a||e[5]!==l||e[6]!==p?(o=s.jsx(it,{registryId:l,listToolName:a,filtersToolName:p}),e[4]=a,e[5]=l,e[6]=p,e[7]=o):o=e[7],o}function ct(t){const e=G.c(15),{registries:l,value:n,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:a,placeholder:i}=t,m=i===void 0?"Select a registry...":i;let y;e[0]!==m?(y=s.jsx(Oe,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ve,{placeholder:m})}),e[0]=m,e[1]=y):y=e[1];let p;e[2]!==l?(p=l.map(mt),e[2]=l,e[3]=p):p=e[3];let o;e[4]!==r||e[5]!==a?(o=a.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),a.map(d=>s.jsxs("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),r(d)},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:[s.jsxs("div",{className:"flex items-center gap-2",children:[d.icon?s.jsx("img",{src:d.icon,alt:d.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:d.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:d.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(qe,{size:16})})]},d.id??d.title))]}),e[4]=r,e[5]=a,e[6]=o):o=e[6];let b;e[7]!==p||e[8]!==o?(b=s.jsxs(_e,{children:[p,o]}),e[7]=p,e[8]=o,e[9]=b):b=e[9];let u;return e[10]!==c||e[11]!==y||e[12]!==b||e[13]!==n?(u=s.jsxs(We,{value:n,onValueChange:c,children:[y,b]}),e[10]=c,e[11]=y,e[12]=b,e[13]=n,e[14]=u):u=e[14],u}function mt(t){return s.jsx(Me,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function dt({registries:t,onConnected:e}){const l=me(),{org:{slug:n}}=X(),{data:c}=ge.useSession(),r=oe(),[a,i]=D.useState(!1),m=t[0],y=async()=>{if(!(!m||!c?.user?.id)){i(!0);try{const o=await l.create.mutateAsync(m);e?.(o.id)}finally{i(!1)}}},p=()=>{r({to:"/$org/$project/mcps",params:{org:n,project:ie},search:{action:"create"}})};return s.jsx(Ge,{image:s.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:s.jsxs(s.Fragment,{children:[s.jsxs(J,{variant:"outline",onClick:y,disabled:a||!m,children:[m?.icon&&s.jsx("img",{src:m.icon,alt:"",className:"size-4"}),a?"Installing...":"Install Registry"]}),s.jsx(J,{variant:"outline",onClick:p,children:"Custom Connection"})]})})}function Xt(){const t=G.c(42),{org:e}=X(),l=ke(),n=me(),c=pe(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,a=He(l);let i;t[0]!==a?(i=a.map(xt),t[0]=a,t[1]=i):i=t[1];const m=i;let y;t[2]!==e.slug?(y=Ue.selectedRegistry(e.slug),t[2]=e.slug,t[3]=y):y=t[3];const[p,o]=Je(y,ut);let b;if(t[4]!==a||t[5]!==p){let h;t[7]!==p?(h=F=>F.id===p,t[7]=p,t[8]=h):h=t[8],b=a.find(h),t[4]=a,t[5]=p,t[6]=b}else b=t[6];const d=b?.id||a[0]?.id||"";let j;t[9]!==e.id?(j=Re(e.id),t[9]=e.id,t[10]=j):j=t[10];let I;t[11]!==j?(I=[j],t[11]=j,t[12]=I):I=t[12];const N=I;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[Pe()],t[13]=C):C=t[13];const L=C;let $;t[14]!==n.create||t[15]!==o?($=async h=>{const F=await n.create.mutateAsync(h);o(F.id)},t[14]=n.create,t[15]=o,t[16]=$):$=t[16];const v=$;let S;t[17]!==a?(S=new Set(a.map(ft)),t[17]=a,t[18]=S):S=t[18];const w=S;let T;t[19]!==w||t[20]!==N?(T=N.filter(h=>h.id&&!w.has(h.id)),t[19]=w,t[20]=N,t[21]=T):T=t[21];const z=T;let A;t[22]!==w?(A=L.filter(h=>h.id&&!w.has(h.id)),t[22]=w,t[23]=A):A=t[23];const k=A;if(r){let h;return t[24]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(he,{}),t[24]=h):h=t[24],h}let f;t[25]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(U.Header.Left,{children:s.jsx(je,{children:s.jsx(ve,{children:s.jsx(ye,{children:s.jsx(be,{children:"Store"})})})})}),t[25]=f):f=t[25];let x;t[26]!==v?(x=async h=>v(h),t[26]=v,t[27]=x):x=t[27];let g;t[28]!==z||t[29]!==d||t[30]!==m||t[31]!==o||t[32]!==x?(g=s.jsxs(U.Header,{children:[f,s.jsx(U.Header.Right,{children:s.jsx(ct,{wellKnownRegistries:z,registries:m,value:d,onValueChange:o,onAddWellKnown:x,placeholder:"Select store..."})})]}),t[28]=z,t[29]=d,t[30]=m,t[31]=o,t[32]=x,t[33]=g):g=t[33];let R;t[34]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(Z,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[34]=R):R=t[34];let P;t[35]!==k||t[36]!==d||t[37]!==o?(P=s.jsx(U.Content,{children:s.jsx(D.Suspense,{fallback:R,children:d?s.jsx(at,{registryId:d}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(dt,{registries:k,onConnected:h=>{o(h)}})})})}),t[35]=k,t[36]=d,t[37]=o,t[38]=P):P=t[38];let K;return t[39]!==g||t[40]!==P?(K=s.jsxs(U,{children:[g,P]}),t[39]=g,t[40]=P,t[41]=K):K=t[41],K}function ft(t){return t.id}function ut(t){return t??""}function xt(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Xt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as b,j as s,r as A,u as ne,g as oe,t as ee}from"./index-ChHDKIbN.js";import{V as ae,C as g}from"./index-DauKEk3R.js";import{T as ce,i as me,a as de,t as fe}from"./typewriter-title-Bwf3Eryu.js";import{E as ue}from"./error-boundary-Dxa9vN4s.js";import{u as Z,S as Y}from"./use-deco-chat-open-C_KGQyGq.js";import{I as te,T as J,a as Q,b as X}from"./integration-icon-D8EX8kVH.js";import{P as pe,a as he,b as xe}from"./popover-JVz1MvYo.js";import{c as se}from"./utils-B_eWxCLR.js";import{i as ge,d as je}from"./constants-Bb6jn5pm.js";import{b as be}from"./use-virtual-mcp-Dx2SDNW7.js";import{i as ye}from"./ChevronRight-BcCazbVH.js";import{t as le}from"./Users03-YVnet25Q.js";import{P as E}from"./index-CV7G73w0.js";import{B as H}from"./button-IcLvDS7b.js";import{c as Ne}from"./Pin01-Cetrd1z7.js";import{s as _e}from"./Plus-CBeTqgO0.js";import{i as Se}from"./Share07-5RJmIBaS.js";import"./X-CDixI9Fp.js";import"./spinner-DDglcYN3.js";import"./use-mcp-prompts-DnDIhnz1.js";import"./useQuery-t9jS7IDj.js";import"./dialog-BP68A3-r.js";import"./form-CPbw8FiC.js";import"./label-CL-z0zvN.js";import"./input-BiH6tKYM.js";import"./AlertCircle-oGnqqT1Z.js";import"./ArrowUp-DyvHGnwT.js";import"./ChevronDown-CCp2JMaE.js";import"./Edit01-CSl-FU1V.js";import"./Check-BlatIqwx.js";import"./Copy01-DGJsTP15.js";import"./Terminal-CwhCdVNd.js";import"./monaco-editor-B3-QQ48f.js";import"./localstorage-keys-CglJRhni.js";import"./useMutation-CR-ZbATX.js";import"./empty-state-CcIz0DtW.js";import"./use-connection-DMc1ed7A.js";import"./generate-id-Dyweu44Y.js";import"./SearchMd-DlO0jVus.js";import"./Trash01-B5rQsNj_.js";import"./badge-DyTP00ui.js";import"./Code01-D97OsfSf.js";import"./infiniteQueryObserver-BJxHLYt6.js";import"./use-create-virtual-mcp-DFreYzbI.js";import"./use-llm-B0wA4ukF.js";import"./use-binding-BF44Dr3v.js";import"./binder-D3g26T9_.js";import"./select-DWWlFXcM.js";import"./index-Bofa5A4c.js";import"./File06-BmPjFHnz.js";import"./Grid01-CXhtcjgR.js";import"./Image01-Cw_RHYUi.js";import"./RefreshCcw01-qWaidSs5.js";function ve(e){const t=b.c(15),{agent:l}=e,{setVirtualMcpId:p}=Z();let r;t[0]!==l.id||t[1]!==p?(r=()=>{p(l.id)},t[0]=l.id,t[1]=p,t[2]=r):r=t[2];const i=r;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 ${l.title}`;let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(le,{size:20}),t[4]=n):n=t[4];let c;t[5]!==l.icon||t[6]!==l.title?(c=s.jsx(te,{icon:l.icon,name:l.title,fallbackIcon:n}),t[5]=l.icon,t[6]=l.title,t[7]=c):c=t[7];let o;t[8]!==l.title?(o=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:l.title}),t[8]=l.title,t[9]=o):o=t[9];let a;return t[10]!==i||t[11]!==d||t[12]!==c||t[13]!==o?(a=s.jsxs("button",{type:"button",onClick:i,className:m,"aria-label":d,children:[c,o]}),t[10]=i,t[11]=d,t[12]=c,t[13]=o,t[14]=a):a=t[14],a}function Ce(e){const t=b.c(14),{virtualMcps:l,selectedVirtualMcpId:p,onVirtualMcpChange:r}=e,[i,m]=A.useState(!1),d=A.useRef(null);let n,c;t[0]!==i?(n=()=>{i&&setTimeout(()=>{d.current?.focus()},0)},c=[i],t[0]=i,t[1]=n,t[2]=c):(n=t[1],c=t[2]),A.useEffect(n,c);let o;t[3]!==r?(o=y=>{r(y),m(!1)},t[3]=r,t[4]=o):o=t[4];const a=o;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 u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(pe,{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(ye,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=u):u=t[6];let h;t[7]!==a||t[8]!==p||t[9]!==l?(h=s.jsx(he,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ae,{virtualMcps:l,selectedVirtualMcpId:p,onVirtualMcpChange:a,searchInputRef:d})}),t[7]=a,t[8]=p,t[9]=l,t[10]=h):h=t[10];let j;return t[11]!==i||t[12]!==h?(j=s.jsxs(xe,{open:i,onOpenChange:m,children:[u,h]}),t[11]=i,t[12]=h,t[13]=j):j=t[13],j}function we(){const e=b.c(20),t=be(),{selectedVirtualMcp:l,setVirtualMcpId:p}=Z();let r,i,m,d,n,c;if(e[0]!==t){n=Symbol.for("react.early_return_sentinel");e:{const h=t.filter(ze).slice(0,6);if(h.length===0){n=null;break e}c=t.map(Te),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],r="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",i=h.map(ke)}e[0]=t,e[1]=r,e[2]=i,e[3]=m,e[4]=d,e[5]=n,e[6]=c}else r=e[1],i=e[2],m=e[3],d=e[4],n=e[5],c=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;const o=l?.id??null;let a;e[8]!==p||e[9]!==o||e[10]!==c?(a=s.jsx(Ce,{virtualMcps:c,selectedVirtualMcpId:o,onVirtualMcpChange:p}),e[8]=p,e[9]=o,e[10]=c,e[11]=a):a=e[11];let f;e[12]!==r||e[13]!==i||e[14]!==a?(f=s.jsxs("div",{className:r,children:[i,a]}),e[12]=r,e[13]=i,e[14]=a,e[15]=f):f=e[15];let u;return e[16]!==m||e[17]!==d||e[18]!==f?(u=s.jsxs("div",{className:m,children:[d,f]}),e[16]=m,e[17]=d,e[18]=f,e[19]=u):u=e[19],u}function ke(e){return s.jsx(ve,{agent:e},e.id??"default")}function Te(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function ze(e){return e.id!==null&&!ge(e.id)}function Me(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Y,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[1],l}function Ie(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(Y,{className:"size-6 rounded-md shrink-0"}),s.jsx(Y,{className:"h-4 w-full"})]},t)}function Pe(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(A.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 Ve(){const e=b.c(61),{org:t}=ne(),{data:l}=oe.useSession(),{modelsConnections:p,isChatEmpty:r,activeThreadId:i,createThread:m,switchToThread:d,threads:n,selectedVirtualMcp:c}=Z();let o;if(e[0]!==i||e[1]!==n){let x;e[3]!==i?(x=re=>re.id===i,e[3]=i,e[4]=x):x=e[4],o=n.find(x),e[0]=i,e[1]=n,e[2]=o}else o=e[2];const a=o,[f,u]=A.useState(!1);let h;e[5]!==l?.user?.name?(h=l?.user?.name?.split(" ")[0]||"there",e[5]=l?.user?.name,e[6]=h):h=e[6];const j=h;let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=$e(),e[7]=y):y=e[7];const ie=y;let R;e[8]!==t.id?(R=je(t.id),e[8]=t.id,e[9]=R):R=e[9];const B=c??R;if(p.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(g.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=x):x=e[11],x}let N;e[12]!==a?(N=a?.title&&s.jsx(ce,{text:a.title,className:"text-sm font-medium text-foreground"}),e[12]=a,e[13]=N):N=e[13];let _;e[14]!==N?(_=s.jsx(E.Header.Left,{className:"gap-2",children:N}),e[14]=N,e[15]=_):_=e[15];let S;e[16]!==m?(S=()=>m(),e[16]=m,e[17]=S):S=e[17];let L;e[18]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(_e,{size:16}),e[18]=L):L=e[18];let v;e[19]!==r||e[20]!==S?(v=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:S,disabled:r,"aria-label":"New chat",children:L})}),e[19]=r,e[20]=S,e[21]=v):v=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Q,{children:"New chat"}),e[22]=O):O=e[22];let C;e[23]!==v?(C=s.jsxs(X,{children:[v,O]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=()=>u(!0),e[25]=D):D=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs(X,{children:[s.jsx(J,{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(me,{size:16})})}),s.jsx(Q,{children:"Chat history"})]}),e[26]=F):F=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ne,{size:16}),e[27]=W):W=e[27];let w;e[28]!==r?(w=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ee,disabled:r,"aria-label":"Pin chat",children:W})}),e[28]=r,e[29]=w):w=e[29];let q;e[30]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Q,{children:"Pin chat"}),e[30]=q):q=e[30];let k;e[31]!==w?(k=s.jsxs(X,{children:[w,q]}),e[31]=w,e[32]=k):k=e[32];let G;e[33]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Se,{size:16}),e[33]=G):G=e[33];let T;e[34]!==r?(T=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ae,disabled:r,"aria-label":"Share chat",children:G})}),e[34]=r,e[35]=T):T=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Q,{children:"Share chat"}),e[36]=K):K=e[36];let z;e[37]!==T?(z=s.jsxs(X,{children:[T,K]}),e[37]=T,e[38]=z):z=e[38];let M;e[39]!==C||e[40]!==k||e[41]!==z?(M=s.jsxs(E.Header.Right,{className:"gap-1",children:[C,F,k,z]}),e[39]=C,e[40]=k,e[41]=z,e[42]=M):M=e[42];let I;e[43]!==M||e[44]!==_?(I=s.jsxs(E.Header,{className:"flex-none z-10 bg-background",children:[_,M]}),e[43]=M,e[44]=_,e[45]=I):I=e[45];let P;e[46]!==B||e[47]!==r||e[48]!==j?(P=r?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:B.icon,name:B.title,size:"md",fallbackIcon:s.jsx(le,{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:[ie," ",j,","]}),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(g.Input,{})}),s.jsx(g.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(g.Main,{children:s.jsx(g.Messages,{})}),s.jsx(g.Footer,{children:s.jsx(g.Input,{})})]}),e[46]=B,e[47]=r,e[48]=j,e[49]=P):P=e[49];let $;e[50]!==d?($=async x=>{await d(x),u(!1)},e[50]=d,e[51]=$):$=e[51];let V;e[52]!==i||e[53]!==f||e[54]!==$||e[55]!==n?(V=s.jsx(de,{open:f,onOpenChange:u,threads:n,activeThreadId:i,onThreadSelect:$}),e[52]=i,e[53]=f,e[54]=$,e[55]=n,e[56]=V):V=e[56];let U;return e[57]!==I||e[58]!==P||e[59]!==V?(U=s.jsxs(g,{className:"bg-background",children:[I,P,V]}),e[57]=I,e[58]=P,e[59]=V,e[60]=U):U=e[60],U}function Ae(){ee.info("Share feature coming soon")}function Ee(){ee.info("Pin feature coming soon")}function He(e){const t=b.c(14),{error:l,onRetry:p}=e,r=l?.message?.includes("401")||l?.message?.toLowerCase().includes("unauthorized");let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(E.Header,{className:"flex-none",children:[s.jsx(E.Header.Left,{className:"gap-2"}),s.jsx(E.Header.Right,{className:"gap-1"})]}),t[0]=i):i=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(fe,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const d=r?"Unable to load models":"Something went wrong";let n;t[2]!==d?(n=s.jsx("h3",{className:"text-lg font-medium",children:d}),t[2]=d,t[3]=n):n=t[3];const c=r?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":l?.message||"An unexpected error occurred";let o;t[4]!==c?(o=s.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=o):o=t[5];let a;t[6]!==n||t[7]!==o?(a=s.jsxs("div",{className:"space-y-2",children:[n,o]}),t[6]=n,t[7]=o,t[8]=a):a=t[8];let f;t[9]!==p?(f=s.jsx(H,{variant:"outline",onClick:p,children:"Try again"}),t[9]=p,t[10]=f):f=t[10];let u;return t[11]!==a||t[12]!==f?(u=s.jsxs(g,{className:"bg-background",children:[i,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]=u):u=t[13],u}function Bt(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ue,{fallback:Re,children:s.jsx(A.Suspense,{fallback:s.jsx(g.Skeleton,{className:"bg-background"}),children:s.jsx(Ve,{})})}),e[0]=t):t=e[0],t}function Re(e){const{error:t,resetError:l}=e;return s.jsx(He,{error:t,onRetry:l})}export{Bt as default};
|
|
1
|
+
import{c as b,j as s,r as A,u as ne,g as oe,t as ee}from"./index-BKpxPW_G.js";import{V as ae,C as g}from"./index-B_142IPp.js";import{T as ce,i as me,a as de,t as fe}from"./typewriter-title-BPMIdq0b.js";import{E as ue}from"./error-boundary-BMH0CjEH.js";import{u as Z,S as Y}from"./use-deco-chat-open-B2KYtTue.js";import{I as te,T as J,a as Q,b as X}from"./integration-icon-DFSc5_D8.js";import{P as pe,a as he,b as xe}from"./popover-ESVk6nXT.js";import{c as se}from"./utils-Ckp7rFN8.js";import{i as ge,d as je}from"./constants-DisdEZ3l.js";import{b as be}from"./use-virtual-mcp-BUCuQhrG.js";import{i as ye}from"./ChevronRight-DMzFQQCc.js";import{t as le}from"./Users03-Bw7fWrTD.js";import{P as E}from"./index-B9-4goiW.js";import{B as H}from"./button-D_OpQIQm.js";import{c as Ne}from"./Pin01-uiXGtZsb.js";import{s as _e}from"./Plus-BMOTPGqH.js";import{i as Se}from"./Share07-BZVoNuS6.js";import"./X-CslJd5Ib.js";import"./spinner-Lv2khbLw.js";import"./use-mcp-prompts-FoVTG9k7.js";import"./useQuery-Bo6lCSyK.js";import"./dialog-BPL7ZvPc.js";import"./form-BpiblhO1.js";import"./label-h0it3r-G.js";import"./input-lpAGMNlp.js";import"./AlertCircle-BppvLQSd.js";import"./ArrowUp-D26ZQKRa.js";import"./ChevronDown-DY4fpd0G.js";import"./Edit01-DDrpQJgk.js";import"./Check-bgVFNRDs.js";import"./Copy01-C35WeFYE.js";import"./Terminal-DRpoCIsG.js";import"./monaco-editor-DZSx9WV6.js";import"./localstorage-keys-CrJngaoW.js";import"./useMutation-Bnsod7M-.js";import"./empty-state-DXJM9xrV.js";import"./use-connection-B0740Saa.js";import"./generate-id-Dyweu44Y.js";import"./SearchMd-BqVXNd65.js";import"./Trash01-d4v7i3Ze.js";import"./badge-DBw6AEaX.js";import"./Code01-7hV4ZDjZ.js";import"./infiniteQueryObserver-B8M15Jhm.js";import"./use-create-virtual-mcp-lh01_aoW.js";import"./use-llm-D28vq8-j.js";import"./use-binding-DMsO_03X.js";import"./binder-Jddq1y1v.js";import"./select-BbzYJ4VF.js";import"./index-fVGDVKMq.js";import"./File06-888BgyfZ.js";import"./Grid01-CfSiTcO8.js";import"./Image01-BUR65REQ.js";import"./RefreshCcw01-B1tus5Lj.js";function ve(e){const t=b.c(15),{agent:l}=e,{setVirtualMcpId:p}=Z();let r;t[0]!==l.id||t[1]!==p?(r=()=>{p(l.id)},t[0]=l.id,t[1]=p,t[2]=r):r=t[2];const i=r;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 ${l.title}`;let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(le,{size:20}),t[4]=n):n=t[4];let c;t[5]!==l.icon||t[6]!==l.title?(c=s.jsx(te,{icon:l.icon,name:l.title,fallbackIcon:n}),t[5]=l.icon,t[6]=l.title,t[7]=c):c=t[7];let o;t[8]!==l.title?(o=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:l.title}),t[8]=l.title,t[9]=o):o=t[9];let a;return t[10]!==i||t[11]!==d||t[12]!==c||t[13]!==o?(a=s.jsxs("button",{type:"button",onClick:i,className:m,"aria-label":d,children:[c,o]}),t[10]=i,t[11]=d,t[12]=c,t[13]=o,t[14]=a):a=t[14],a}function Ce(e){const t=b.c(14),{virtualMcps:l,selectedVirtualMcpId:p,onVirtualMcpChange:r}=e,[i,m]=A.useState(!1),d=A.useRef(null);let n,c;t[0]!==i?(n=()=>{i&&setTimeout(()=>{d.current?.focus()},0)},c=[i],t[0]=i,t[1]=n,t[2]=c):(n=t[1],c=t[2]),A.useEffect(n,c);let o;t[3]!==r?(o=y=>{r(y),m(!1)},t[3]=r,t[4]=o):o=t[4];const a=o;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 u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(pe,{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(ye,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=u):u=t[6];let h;t[7]!==a||t[8]!==p||t[9]!==l?(h=s.jsx(he,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ae,{virtualMcps:l,selectedVirtualMcpId:p,onVirtualMcpChange:a,searchInputRef:d})}),t[7]=a,t[8]=p,t[9]=l,t[10]=h):h=t[10];let j;return t[11]!==i||t[12]!==h?(j=s.jsxs(xe,{open:i,onOpenChange:m,children:[u,h]}),t[11]=i,t[12]=h,t[13]=j):j=t[13],j}function we(){const e=b.c(20),t=be(),{selectedVirtualMcp:l,setVirtualMcpId:p}=Z();let r,i,m,d,n,c;if(e[0]!==t){n=Symbol.for("react.early_return_sentinel");e:{const h=t.filter(ze).slice(0,6);if(h.length===0){n=null;break e}c=t.map(Te),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],r="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",i=h.map(ke)}e[0]=t,e[1]=r,e[2]=i,e[3]=m,e[4]=d,e[5]=n,e[6]=c}else r=e[1],i=e[2],m=e[3],d=e[4],n=e[5],c=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;const o=l?.id??null;let a;e[8]!==p||e[9]!==o||e[10]!==c?(a=s.jsx(Ce,{virtualMcps:c,selectedVirtualMcpId:o,onVirtualMcpChange:p}),e[8]=p,e[9]=o,e[10]=c,e[11]=a):a=e[11];let f;e[12]!==r||e[13]!==i||e[14]!==a?(f=s.jsxs("div",{className:r,children:[i,a]}),e[12]=r,e[13]=i,e[14]=a,e[15]=f):f=e[15];let u;return e[16]!==m||e[17]!==d||e[18]!==f?(u=s.jsxs("div",{className:m,children:[d,f]}),e[16]=m,e[17]=d,e[18]=f,e[19]=u):u=e[19],u}function ke(e){return s.jsx(ve,{agent:e},e.id??"default")}function Te(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function ze(e){return e.id!==null&&!ge(e.id)}function Me(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Y,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[1],l}function Ie(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(Y,{className:"size-6 rounded-md shrink-0"}),s.jsx(Y,{className:"h-4 w-full"})]},t)}function Pe(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(A.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 Ve(){const e=b.c(61),{org:t}=ne(),{data:l}=oe.useSession(),{modelsConnections:p,isChatEmpty:r,activeThreadId:i,createThread:m,switchToThread:d,threads:n,selectedVirtualMcp:c}=Z();let o;if(e[0]!==i||e[1]!==n){let x;e[3]!==i?(x=re=>re.id===i,e[3]=i,e[4]=x):x=e[4],o=n.find(x),e[0]=i,e[1]=n,e[2]=o}else o=e[2];const a=o,[f,u]=A.useState(!1);let h;e[5]!==l?.user?.name?(h=l?.user?.name?.split(" ")[0]||"there",e[5]=l?.user?.name,e[6]=h):h=e[6];const j=h;let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=$e(),e[7]=y):y=e[7];const ie=y;let R;e[8]!==t.id?(R=je(t.id),e[8]=t.id,e[9]=R):R=e[9];const B=c??R;if(p.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(g.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=x):x=e[11],x}let N;e[12]!==a?(N=a?.title&&s.jsx(ce,{text:a.title,className:"text-sm font-medium text-foreground"}),e[12]=a,e[13]=N):N=e[13];let _;e[14]!==N?(_=s.jsx(E.Header.Left,{className:"gap-2",children:N}),e[14]=N,e[15]=_):_=e[15];let S;e[16]!==m?(S=()=>m(),e[16]=m,e[17]=S):S=e[17];let L;e[18]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(_e,{size:16}),e[18]=L):L=e[18];let v;e[19]!==r||e[20]!==S?(v=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:S,disabled:r,"aria-label":"New chat",children:L})}),e[19]=r,e[20]=S,e[21]=v):v=e[21];let O;e[22]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Q,{children:"New chat"}),e[22]=O):O=e[22];let C;e[23]!==v?(C=s.jsxs(X,{children:[v,O]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=()=>u(!0),e[25]=D):D=e[25];let F;e[26]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs(X,{children:[s.jsx(J,{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(me,{size:16})})}),s.jsx(Q,{children:"Chat history"})]}),e[26]=F):F=e[26];let W;e[27]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ne,{size:16}),e[27]=W):W=e[27];let w;e[28]!==r?(w=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ee,disabled:r,"aria-label":"Pin chat",children:W})}),e[28]=r,e[29]=w):w=e[29];let q;e[30]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Q,{children:"Pin chat"}),e[30]=q):q=e[30];let k;e[31]!==w?(k=s.jsxs(X,{children:[w,q]}),e[31]=w,e[32]=k):k=e[32];let G;e[33]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx(Se,{size:16}),e[33]=G):G=e[33];let T;e[34]!==r?(T=s.jsx(J,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ae,disabled:r,"aria-label":"Share chat",children:G})}),e[34]=r,e[35]=T):T=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Q,{children:"Share chat"}),e[36]=K):K=e[36];let z;e[37]!==T?(z=s.jsxs(X,{children:[T,K]}),e[37]=T,e[38]=z):z=e[38];let M;e[39]!==C||e[40]!==k||e[41]!==z?(M=s.jsxs(E.Header.Right,{className:"gap-1",children:[C,F,k,z]}),e[39]=C,e[40]=k,e[41]=z,e[42]=M):M=e[42];let I;e[43]!==M||e[44]!==_?(I=s.jsxs(E.Header,{className:"flex-none z-10 bg-background",children:[_,M]}),e[43]=M,e[44]=_,e[45]=I):I=e[45];let P;e[46]!==B||e[47]!==r||e[48]!==j?(P=r?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:B.icon,name:B.title,size:"md",fallbackIcon:s.jsx(le,{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:[ie," ",j,","]}),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(g.Input,{})}),s.jsx(g.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(g.Main,{children:s.jsx(g.Messages,{})}),s.jsx(g.Footer,{children:s.jsx(g.Input,{})})]}),e[46]=B,e[47]=r,e[48]=j,e[49]=P):P=e[49];let $;e[50]!==d?($=async x=>{await d(x),u(!1)},e[50]=d,e[51]=$):$=e[51];let V;e[52]!==i||e[53]!==f||e[54]!==$||e[55]!==n?(V=s.jsx(de,{open:f,onOpenChange:u,threads:n,activeThreadId:i,onThreadSelect:$}),e[52]=i,e[53]=f,e[54]=$,e[55]=n,e[56]=V):V=e[56];let U;return e[57]!==I||e[58]!==P||e[59]!==V?(U=s.jsxs(g,{className:"bg-background",children:[I,P,V]}),e[57]=I,e[58]=P,e[59]=V,e[60]=U):U=e[60],U}function Ae(){ee.info("Share feature coming soon")}function Ee(){ee.info("Pin feature coming soon")}function He(e){const t=b.c(14),{error:l,onRetry:p}=e,r=l?.message?.includes("401")||l?.message?.toLowerCase().includes("unauthorized");let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(E.Header,{className:"flex-none",children:[s.jsx(E.Header.Left,{className:"gap-2"}),s.jsx(E.Header.Right,{className:"gap-1"})]}),t[0]=i):i=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(fe,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const d=r?"Unable to load models":"Something went wrong";let n;t[2]!==d?(n=s.jsx("h3",{className:"text-lg font-medium",children:d}),t[2]=d,t[3]=n):n=t[3];const c=r?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":l?.message||"An unexpected error occurred";let o;t[4]!==c?(o=s.jsx("p",{className:"text-sm text-muted-foreground",children:c}),t[4]=c,t[5]=o):o=t[5];let a;t[6]!==n||t[7]!==o?(a=s.jsxs("div",{className:"space-y-2",children:[n,o]}),t[6]=n,t[7]=o,t[8]=a):a=t[8];let f;t[9]!==p?(f=s.jsx(H,{variant:"outline",onClick:p,children:"Try again"}),t[9]=p,t[10]=f):f=t[10];let u;return t[11]!==a||t[12]!==f?(u=s.jsxs(g,{className:"bg-background",children:[i,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]=u):u=t[13],u}function Bt(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(ue,{fallback:Re,children:s.jsx(A.Suspense,{fallback:s.jsx(g.Skeleton,{className:"bg-background"}),children:s.jsx(Ve,{})})}),e[0]=t):t=e[0],t}function Re(e){const{error:t,resetError:l}=e;return s.jsx(He,{error:t,onRetry:l})}export{Bt as default};
|
package/dist/client/assets/{plugin-empty-state-BpFO_GZ3.js → plugin-empty-state-CIjn_En1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,j as t,a4 as n}from"./index-
|
|
1
|
+
import{c as a,j as t,a4 as n}from"./index-BKpxPW_G.js";function c(){const s=a.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(n,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"No storage connected"}),t.jsx("p",{className:"text-muted-foreground text-center max-w-md",children:"Connect an S3-compatible storage service to browse and manage files."})]}),s[0]=e):e=s[0],e}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as w,j as s,r as S,a4 as y}from"./index-
|
|
1
|
+
import{c as w,j as s,r as S,a4 as y}from"./index-BKpxPW_G.js";import{i as _}from"./Check-bgVFNRDs.js";import{t as k}from"./ChevronDown-DY4fpd0G.js";function E(x){const e=w.c(32),{connections:l,selectedConnectionId:n,onConnectionChange:N}=x,[r,z]=S.useState(!1),C=S.useRef(null);let p;if(e[0]!==l||e[1]!==n){let t;e[3]!==n?(t=u=>u.id===n,e[3]=n,e[4]=t):t=e[4],p=l.find(t),e[0]=l,e[1]=n,e[2]=p}else p=e[2];const i=p;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t=>{C.current?.contains(t.relatedTarget)||z(!1)},e[5]=j):j=e[5];const R=j;if(l.length===1){let t;e[6]!==i?(t=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[6]=i,e[7]=t):t=e[7];const u=i?.title||"Storage";let f;e[8]!==u?(f=s.jsx("span",{children:u}),e[8]=u,e[9]=f):f=e[9];let h;return e[10]!==t||e[11]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[t,f]}),e[10]=t,e[11]=f,e[12]=h):h=e[12],h}let o;e[13]!==r?(o=()=>z(!r),e[13]=r,e[14]=o):o=e[14];let a;e[15]!==i?(a=i?.icon?s.jsx("img",{src:i.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),e[15]=i,e[16]=a):a=e[16];const v=i?.title||"Select storage";let c;e[17]!==v?(c=s.jsx("span",{children:v}),e[17]=v,e[18]=c):c=e[18];let b;e[19]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(k,{size:14}),e[19]=b):b=e[19];let d;e[20]!==o||e[21]!==a||e[22]!==c?(d=s.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md border border-border bg-background hover:bg-accent transition-colors",children:[a,c,b]}),e[20]=o,e[21]=a,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==l||e[25]!==r||e[26]!==N||e[27]!==n?(m=r&&s.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-48 rounded-md border border-border bg-popover p-1 shadow-md",children:l.map(t=>s.jsxs("button",{type:"button",onClick:()=>{N(t.id),z(!1)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded-sm hover:bg-accent transition-colors",children:[t.icon?s.jsx("img",{src:t.icon,alt:"",className:"size-4 rounded"}):s.jsx(y,{size:16}),s.jsx("span",{className:"flex-1 text-left",children:t.title}),t.id===n&&s.jsx(_,{size:14,className:"text-primary"})]},t.id))}),e[24]=l,e[25]=r,e[26]=N,e[27]=n,e[28]=m):m=e[28];let g;return e[29]!==d||e[30]!==m?(g=s.jsxs("div",{className:"relative",ref:C,onBlur:R,children:[d,m]}),e[29]=d,e[30]=m,e[31]=g):g=e[31],g}function O(x){const e=w.c(2);let l;return e[0]!==x?(l=s.jsx(E,{...x}),e[0]=x,e[1]=l):l=e[1],l}export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,am as $,j as c,as as z,at as L,al as O,a3 as _,an as g,au as w,av as E,aw as G,ax as j,ay as H,az as K,aq as q,aA as B,aB as U,aC as V,aD as W,aE as Z,aF as J,c as R}from"./index-
|
|
1
|
+
import{r as i,am as $,j as c,as as z,at as L,al as O,a3 as _,an as g,au as w,av as E,aw as G,ax as j,ay as H,az as K,aq as q,aA as B,aB as U,aC as V,aD as W,aE as Z,aF as J,c as R}from"./index-BKpxPW_G.js";import{c as Q}from"./utils-Ckp7rFN8.js";var m="Popover",[b]=q(m,[j]),P=j(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:a,modal:s=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:a,caller:m});return c.jsx(z,{...p,children:c.jsx(X,{scope:e,contentId:L(),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=P(o),{onCustomAnchorAdd:s,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(s(),()=>p()),[s,p]),c.jsx(w,{...a,...r,ref:e})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(y,o),a=P(o),s=O(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:s,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...a,children:p})});S.displayName=y;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,a=d(A,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(E,{present:o||a.open,children:c.jsx(G,{asChild:!0,container:n,children:r})})})};D.displayName=A;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,a=d(v,t.__scopePopover);return c.jsx(E,{present:r||a.open,children:a.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=B("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=O(e,r),a=i.useRef(!1);return i.useEffect(()=>{const s=r.current;if(s)return H(s)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,s=>{s.preventDefault(),a.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(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:g(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(T,{...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()}})}),T=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=P(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":I(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)"}})})})}),k="PopoverClose",ae=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(k,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});ae.displayName=k;var se="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=se;function I(t){return t?"open":"closed"}var ie=N,pe=S,le=D,ue=M;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 ge(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 Pe(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=Q("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{ge as P,Pe as a,ve as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,j as s,r as S,S as x,a as b,u as y,O as h,l as N,P as v,m as P}from"./index-
|
|
1
|
+
import{c as j,j as s,r as S,S as x,a as b,u as y,O as h,l as N,P as v,m as P}from"./index-BKpxPW_G.js";import{u as $}from"./use-project-CuNldV92.js";import{B as _}from"./button-D_OpQIQm.js";import"./useQuery-Bo6lCSyK.js";import"./constants-DisdEZ3l.js";import"./utils-Ckp7rFN8.js";function z(e){const t=j.c(12),{projectSlug:m,orgSlug:c,error:i}=e,r=P();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 l;t[1]!==m?(l=s.jsxs("p",{className:"text-muted-foreground text-center",children:['There was an error loading the project "',m,'".']}),t[1]=m,t[2]=l):l=t[2];let n;t[3]!==i.message?(n=s.jsx("p",{className:"text-sm text-muted-foreground",children:i.message}),t[3]=i.message,t[4]=n):n=t[4];let u;t[5]!==r||t[6]!==c?(u=s.jsx(_,{variant:"link",onClick:()=>r({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[5]=r,t[6]=c,t[7]=u):u=t[7];let d;return t[8]!==l||t[9]!==n||t[10]!==u?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[o,l,n,u]}),t[8]=l,t[9]=n,t[10]=u,t[11]=d):d=t[11],d}function k(e){const t=j.c(9),{projectSlug:m,orgSlug:c}=e,i=P();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("h1",{className:"text-xl font-semibold",children:"Project not found"}),t[0]=r):r=t[0];let o;t[1]!==m?(o=s.jsxs("p",{className:"text-muted-foreground text-center",children:['The project "',m,'" does not exist in this organization.']}),t[1]=m,t[2]=o):o=t[2];let l;t[3]!==i||t[4]!==c?(l=s.jsx(_,{variant:"link",onClick:()=>i({to:"/$org/$project",params:{org:c,project:h}}),children:"Go to organization home"}),t[3]=i,t[4]=c,t[5]=l):l=t[5];let n;return t[6]!==o||t[7]!==l?(n=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4 p-8",children:[r,o,l]}),t[6]=o,t[7]=l,t[8]=n):n=t[8],n}function C(){const e=j.c(22);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const m=b(t),{org:c}=y(),i=m.org,r=m.project,{data:o,isLoading:l,error:n}=$(c.id,r);if(l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(x,{}),e[1]=a):a=e[1],a}if(n){let a;return e[2]!==n||e[3]!==i||e[4]!==r?(a=s.jsx(z,{projectSlug:r,orgSlug:i,error:n}),e[2]=n,e[3]=i,e[4]=r,e[5]=a):a=e[5],a}if(!o){let a;return e[6]!==i||e[7]!==r?(a=s.jsx(k,{projectSlug:r,orgSlug:i}),e[6]=i,e[7]=r,e[8]=a):a=e[8],a}const u=o.slug===h;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]!==u?(d={id:o.id,organizationId:o.organizationId,slug:o.slug,name:o.name,description:o.description,enabledPlugins:o.enabledPlugins,ui:o.ui,isOrgAdmin:u},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]=u,e[17]=d):d=e[17];const p=d;let f;e[18]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(S.Suspense,{fallback:s.jsx(x,{}),children:s.jsx(N,{})}),e[18]=f):f=e[18];let g;return e[19]!==p||e[20]!==c?(g=s.jsx(v,{org:c,project:p,children:f}),e[19]=p,e[20]=c,e[21]=g):g=e[21],g}function T(){const e=j.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(S.Suspense,{fallback:s.jsx(x,{}),children:s.jsx(C,{})}),e[0]=t):t=e[0],t}export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as H,u as W,z as X,O as Y,h as oe,k as ae,j as s,o as ce,s as G,K as U,t as R,r as q,aN as te,bm as ue,m as de,g as ge}from"./index-ChHDKIbN.js";import{P as Z}from"./index-CV7G73w0.js";import{B as fe,a as pe,b as he,c as xe}from"./breadcrumb-CrQKEc0V.js";import{u as ee}from"./useMutation-CR-ZbATX.js";import{a as ie,u as re}from"./constants-Bb6jn5pm.js";import{B as L}from"./button-IcLvDS7b.js";import{I as V}from"./input-BiH6tKYM.js";import{T as je}from"./textarea-B0H-V_2P.js";import{F as Q,d as M,a as me,b as $,c as K,e as se,f as J}from"./form-CPbw8FiC.js";import{u as be}from"./useQuery-t9jS7IDj.js";import{S as ye}from"./switch-BU39MRXa.js";import{L as ve}from"./label-CL-z0zvN.js";import{h as Ne}from"./use-connection-DMc1ed7A.js";import{a as Ce,c as Se}from"./use-binding-BF44Dr3v.js";import{u as Pe}from"./use-install-from-registry--Nvk5mQH.js";import{i as we}from"./Loading01-DcUBqOzt.js";import{s as Ie}from"./Plus-CBeTqgO0.js";import{S as Ee,a as Fe,b as De,c as _e,d as le}from"./select-DWWlFXcM.js";import{c as Oe}from"./utils-B_eWxCLR.js";import{i as Te}from"./Upload01-up-2G0Zk.js";import{i as Ae}from"./X-CDixI9Fp.js";import{c as ze,h as Be,d as ke,b as Re,A as Le,e as Ue,g as qe,a as Me,f as $e}from"./alert-dialog-CezkcFZv.js";import"./ChevronRight-BcCazbVH.js";import"./binder-D3g26T9_.js";import"./extract-connection-data-qxA4zC_1.js";import"./constants-D3p69qeS.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BAvR5D-B.js";import"./generate-id-Dyweu44Y.js";import"./index-Bofa5A4c.js";import"./Check-BlatIqwx.js";import"./ChevronDown-CCp2JMaE.js";const Ke=ce({name:G().min(1,"Name is required").max(200,"Name is too long"),description:G().max(1e3,"Description is too long").nullable()});function Ge(){const e=H.c(58),{org:t,project:i}=W(),o=X(),d=i.slug===Y;let g;e[0]!==t.id?(g={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=g):g=e[1];const u=re(g);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=oe(Ke),e[2]=x):x=e[2];const j=i.name??"",b=i.description??"";let a;e[3]!==j||e[4]!==b?(a={resolver:x,values:{name:j,description:b}},e[3]=j,e[4]=b,e[5]=a):a=e[5];const c=ae(a);let f;e[6]!==u||e[7]!==i.id?(f=async B=>{const _=await u.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,name:B.name,description:B.description||null}});return _.structuredContent??_},e[6]=u,e[7]=i.id,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==t.id||e[11]!==i.slug||e[12]!==o?(p=()=>{o.invalidateQueries({queryKey:U.project(t.id,i.slug)}),o.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project updated successfully"),c.reset(c.getValues())},e[9]=c,e[10]=t.id,e[11]=i.slug,e[12]=o,e[13]=p):p=e[13];let w;e[14]!==f||e[15]!==p?(w={mutationFn:f,onSuccess:p,onError:Qe},e[14]=f,e[15]=p,e[16]=w):w=e[16];const m=ee(w);let y;e[17]!==m?(y=async B=>{await m.mutateAsync(B)},e[17]=m,e[18]=y):y=e[18];const P=y,C=c.formState.isDirty;let I;e[19]!==c||e[20]!==P?(I=c.handleSubmit(P),e[19]=c,e[20]=P,e[21]=I):I=e[21];let S;e[22]!==d||e[23]!==m.isPending?(S=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Project Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Project",..._,disabled:d||m.isPending})}),d&&s.jsx(se,{children:"The organization admin project name cannot be changed."}),s.jsx(J,{})]})},e[22]=d,e[23]=m.isPending,e[24]=S):S=e[24];let n;e[25]!==c.control||e[26]!==S?(n=s.jsx(Q,{control:c.control,name:"name",render:S}),e[25]=c.control,e[26]=S,e[27]=n):n=e[27];let r;e[28]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:"Slug"}),e[28]=r):r=e[28];let l;e[29]!==i.slug?(l=s.jsx(M,{children:s.jsx(V,{value:i.slug,disabled:!0,className:"bg-muted"})}),e[29]=i.slug,e[30]=l):l=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(se,{children:"The project slug cannot be changed after creation."}),e[31]=h):h=e[31];let v;e[32]!==l?(v=s.jsxs($,{children:[r,l,h]}),e[32]=l,e[33]=v):v=e[33];let N;e[34]!==m.isPending?(N=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Description"}),s.jsx(M,{children:s.jsx(je,{placeholder:"Optional project description...",rows:3,..._,value:_.value??"",disabled:m.isPending})}),s.jsx(J,{})]})},e[34]=m.isPending,e[35]=N):N=e[35];let F;e[36]!==c.control||e[37]!==N?(F=s.jsx(Q,{control:c.control,name:"description",render:N}),e[36]=c.control,e[37]=N,e[38]=F):F=e[38];const O=!C||m.isPending,T=m.isPending?"Saving...":"Save Changes";let D;e[39]!==O||e[40]!==T?(D=s.jsx(L,{type:"submit",disabled:O,className:"min-w-24",children:T}),e[39]=O,e[40]=T,e[41]=D):D=e[41];let A;e[42]!==c||e[43]!==C||e[44]!==m.isPending?(A=C&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>c.reset(),disabled:m.isPending,children:"Cancel"}),e[42]=c,e[43]=C,e[44]=m.isPending,e[45]=A):A=e[45];let z;e[46]!==D||e[47]!==A?(z=s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[D,A]}),e[46]=D,e[47]=A,e[48]=z):z=e[48];let E;e[49]!==n||e[50]!==v||e[51]!==F||e[52]!==z||e[53]!==I?(E=s.jsxs("form",{onSubmit:I,className:"space-y-6",children:[n,v,F,z]}),e[49]=n,e[50]=v,e[51]=F,e[52]=z,e[53]=I,e[54]=E):E=e[54];let k;return e[55]!==c||e[56]!==E?(k=s.jsx(me,{...c,children:E}),e[55]=c,e[56]=E,e[57]=k):k=e[57],k}function Qe(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Je({value:e,onValueChange:t,placeholder:i="Select a connection...",binding:o,bindingType:d,onAddNew:g,className:u,disabled:x=!1}){const[j,b]=q.useState(!1),{installByBinding:a,isInstalling:c}=Pe(),f=j||c,p=Ne(),w=Ce({connections:p,binding:typeof o=="string"?o:void 0}),m=!o||!p?p??[]:typeof o=="string"?w:Array.isArray(o)&&o.length>0?p.filter(n=>Se(n,o)):p,y=(()=>{if(!d?.startsWith("@"))return null;const[n,r]=d.replace("@","").split("/");return n&&r?{scope:n,appName:r}:null})(),P=(()=>{let n=m;const r=Array.isArray(o)&&o.length>0;if(y&&!r&&(n=n.filter(l=>{const h=l.app_name,v=l.metadata?.scopeName;return h===y.appName&&v===y.scope})),e&&!n.some(l=>l.id===e)){const l=p?.find(h=>h.id===e);if(l)return[l,...n]}return n})(),C=d?.startsWith("@"),I=async()=>{if(C&&d){b(!0);try{const n=await a(d);n&&t(n.id)}finally{b(!1)}return}g?.()},S=P.find(n=>n.id===e);return s.jsxs(Ee,{value:e??"none",onValueChange:n=>t(n==="none"?null:n),disabled:x,children:[s.jsx(Fe,{size:"sm",className:Oe("w-[200px]",u),children:s.jsx(De,{placeholder:i,children:S?s.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?s.jsx("img",{src:S.icon,alt:S.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:S.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:S.title})]}):i})}),s.jsxs(_e,{children:[s.jsx(le,{value:"none",children:"No connection"}),P.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(n=>s.jsx(le,{value:n.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[n.icon?s.jsx("img",{src:n.icon,alt:n.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:n.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:n.title})]})},n.id)),(g||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(L,{onPointerDown:n=>n.stopPropagation(),onClick:n=>{n.preventDefault(),n.stopPropagation(),I()},disabled:f||x,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:f?s.jsxs(s.Fragment,{children:[s.jsx(we,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ie,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ve=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")},ne=e=>{const t=e.structuredContent??e,i=t&&typeof t=="object"?t:null,o=i?.content?.[0]?.text&&typeof i.content[0].text=="string"?i.content[0].text:null;if(i?.isError)throw new Error(o??"Tool call failed");if(Ve(t))throw new Error(t.text);return t};function He(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function We(e){const t=H.c(48),{plugin:i,isEnabled:o,isSaving:d,pendingBinding:g,description:u,label:x,icon:j,projectId:b,client:a,onBindingChange:c,onToggle:f}=e;let p;t[0]!==i?(p=He(i),t[0]=i,t[1]=p):p=t[1];const w=p;let m;t[2]!==i.id||t[3]!==b?(m=U.projectPluginConfig(b??"",i.id),t[2]=i.id,t[3]=b,t[4]=m):m=t[4];let y;t[5]!==a||t[6]!==i.id||t[7]!==b?(y=async()=>{if(!b)throw new Error("Project ID is required to load plugin config.");const E=await a.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:b,pluginId:i.id}});return ne(E)},t[5]=a,t[6]=i.id,t[7]=b,t[8]=y):y=t[8];const P=!!b&&w;let C;t[9]!==m||t[10]!==y||t[11]!==P?(C={queryKey:m,queryFn:y,enabled:P},t[9]=m,t[10]=y,t[11]=P,t[12]=C):C=t[12];const{data:I,isLoading:S}=be(C),n=I?.config?.connectionId??null,r=g!==void 0?g:n;let l;t[13]!==j?(l=j&&s.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:j}),t[13]=j,t[14]=l):l=t[14];let h;t[15]!==x?(h=s.jsx("div",{className:"text-sm font-medium text-foreground",children:x}),t[15]=x,t[16]=h):h=t[16];let v;t[17]!==u?(v=u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=v):v=t[18];let N;t[19]!==h||t[20]!==v?(N=s.jsxs("div",{className:"min-w-0",children:[h,v]}),t[19]=h,t[20]=v,t[21]=N):N=t[21];let F;t[22]!==l||t[23]!==N?(F=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l,N]}),t[22]=l,t[23]=N,t[24]=F):F=t[24];let O;t[25]!==f||t[26]!==i.id?(O=E=>f(i.id,E),t[25]=f,t[26]=i.id,t[27]=O):O=t[27];let T;t[28]!==o||t[29]!==d||t[30]!==O?(T=s.jsx(ye,{checked:o,onCheckedChange:O,disabled:d}),t[28]=o,t[29]=d,t[30]=O,t[31]=T):T=t[31];let D;t[32]!==F||t[33]!==T?(D=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[F,T]}),t[32]=F,t[33]=T,t[34]=D):D=t[34];let A;t[35]!==S||t[36]!==o||t[37]!==d||t[38]!==w||t[39]!==c||t[40]!==i.binding||t[41]!==i.id||t[42]!==r||t[43]!==n?(A=o&&w&&s.jsxs("div",{className:"mt-3 pl-7 flex items-center gap-3",children:[s.jsx(ve,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Je,{value:r??null,onValueChange:E=>c(i.id,E,n),binding:i.binding,placeholder:"Select connection...",className:"w-56",disabled:d||S})]}),t[35]=S,t[36]=o,t[37]=d,t[38]=w,t[39]=c,t[40]=i.binding,t[41]=i.id,t[42]=r,t[43]=n,t[44]=A):A=t[44];let z;return t[45]!==D||t[46]!==A?(z=s.jsxs("div",{className:"py-3",children:[D,A]}),t[45]=D,t[46]=A,t[47]=z):z=t[47],z}function Ze(){const{org:e,project:t}=W(),i=X(),o=re({connectionId:ie,orgId:e.id}),[d,g]=q.useState({}),[u,x]=q.useState({}),[j,b]=q.useState(!1),a=t.enabledPlugins??[],c=n=>{const r=d[n];return r!==void 0?r:a.includes(n)},f=()=>{const n=new Set(a);for(const[r,l]of Object.entries(d))l?n.add(r):n.delete(r);return Array.from(n)},p=Object.keys(d).length>0||Object.keys(u).length>0,w=(n,r)=>{const l=a.includes(n);g(r===l?h=>{const{[n]:v,...N}=h;return N}:h=>({...h,[n]:r}))},m=(n,r,l)=>{if(r===l){x(h=>{const{[n]:v,...N}=h;return N});return}x(h=>({...h,[n]:r}))},y=ee({mutationFn:async n=>{const r=[];if(n.updatePlugins){const l=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:n.enabledPlugins}});r.push(ne(l))}if(n.bindingUpdates.length>0){const l=await Promise.all(n.bindingUpdates.map(async({pluginId:h,connectionId:v})=>{const N=await o.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:h,connectionId:v}});return ne(N)}));r.push(...l)}return r},onSuccess:(n,r)=>{r.updatePlugins&&(i.invalidateQueries({queryKey:U.project(e.id,t.slug)}),i.invalidateQueries({queryKey:U.projects(e.id)})),r.bindingUpdates.forEach(({pluginId:l})=>{i.invalidateQueries({queryKey:U.projectPluginConfig(t.id??"",l)})}),g({}),x({}),R.success("Plugins updated successfully")},onError:n=>{R.error("Failed to update plugins: "+(n instanceof Error?n.message:"Unknown error"))},onSettled:()=>{b(!1)}}),P=()=>{b(!0),y.mutate({enabledPlugins:f(),updatePlugins:Object.keys(d).length>0,bindingUpdates:Object.entries(u).map(([n,r])=>({pluginId:n,connectionId:r}))})},C=()=>{g({}),x({})},I=n=>ue.find(r=>r.pluginId===n),S=n=>te.find(l=>l.id===n)?.description??null;return te.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("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for this project. Enabled plugins will appear in the sidebar."}),s.jsx("div",{className:"divide-y divide-border border-y border-border",children:te.map(n=>{const r=I(n.id),l=S(n.id),h=c(n.id);return s.jsx(We,{plugin:n,isEnabled:h,isSaving:j,pendingBinding:u[n.id],description:l,label:r?.label??n.id,icon:r?.icon,projectId:t.id,client:o,onBindingChange:m,onToggle:w},n.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{variant:"outline",onClick:C,disabled:!p||j,children:"Cancel"}),s.jsx(L,{onClick:P,disabled:!p||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}const Ye=ce({name:G().min(1,"Name is required").max(255,"Name is too long"),slug:G().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:G().optional()});function Xe(e){const t=H.c(24),{value:i,onChange:o,name:d}=e,g=q.useRef(null);let u;t[0]!==o?(u=S=>{const n=S.target.files?.[0];if(n){if(n.size>2097152){R.error("Image must be smaller than 2MB");return}const r=new FileReader;r.onerror=()=>{const l=r.error;console.error("FileReader error:",l),R.error(l?.message||"Failed to read image file. Please try again."),g.current&&(g.current.value="")},r.onloadend=()=>{if(r.readyState===FileReader.DONE&&r.result){const l=r.result;o(l)}},r.readAsDataURL(n)}},t[0]=o,t[1]=u):u=t[1];const x=u;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{g.current?.click()},t[2]=j):j=t[2];const b=j;let a;t[3]!==o?(a=S=>{S.stopPropagation(),o("")},t[3]=o,t[4]=a):a=t[4];const c=a;let f;t[5]!==x?(f=s.jsx("input",{type:"file",ref:g,className:"hidden",accept:"image/*",onChange:x}),t[5]=x,t[6]=f):f=t[6];let p;t[7]!==c||t[8]!==d||t[9]!==i?(p=i?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:i,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:c,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(Ae,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:b,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(Te,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=c,t[8]=d,t[9]=i,t[10]=p):p=t[10];const w=i?"Change Logo":"Upload Logo";let m;t[11]!==w?(m=s.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:b,className:"mb-2",children:w}),t[11]=w,t[12]=m):m=t[12];let y;t[13]!==c||t[14]!==i?(y=i&&s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:c,className:"ml-2",children:"Remove"}),t[13]=c,t[14]=i,t[15]=y):y=t[15];let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=P):P=t[16];let C;t[17]!==m||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[m,y,P]}),t[17]=m,t[18]=y,t[19]=C):C=t[19];let I;return t[20]!==C||t[21]!==f||t[22]!==p?(I=s.jsxs("div",{className:"flex items-start gap-4",children:[f,p,C]}),t[20]=C,t[21]=f,t[22]=p,t[23]=I):I=t[23],I}function et(){const e=de(),{org:t,project:i}=W(),o=X(),[d,g]=q.useState(!1),u=ae({resolver:oe(Ye),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),x=ee({mutationFn:async a=>{const c={name:a.name,slug:a.slug};a.logo&&(c.logo=a.logo);const f=await ge.organization.update({organizationId:t.id,data:c});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:a=>{o.invalidateQueries({queryKey:U.organizations()}),o.invalidateQueries({queryKey:U.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:a.data.slug,project:i.slug}})},onError:a=>{R.error(a instanceof Error?a.message:"Failed to update organization")},onSettled:()=>{g(!1)}}),j=a=>{g(!0),x.mutate(a)},b=u.formState.isDirty;return s.jsx(me,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(j),className:"space-y-6",children:[s.jsx(Q,{control:u.control,name:"name",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Organization",...a,disabled:d})}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"slug",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Slug"}),s.jsx(M,{children:s.jsx(V,{placeholder:"my-organization",...a,disabled:d,onChange:c=>{const f=c.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.onChange(f)}})}),s.jsx(se,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"logo",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Logo"}),s.jsx(M,{children:s.jsx(Xe,{value:a.value,onChange:a.onChange,name:u.watch("name")})}),s.jsx(J,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{type:"submit",disabled:!b||d,className:"min-w-24",children:d?"Saving...":"Save Changes"}),b&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>u.reset(),disabled:d,children:"Cancel"})]})]})})}function tt(){const e=H.c(44),{org:t,project:i}=W(),o=de(),d=X(),[g,u]=q.useState(""),[x,j]=q.useState(!1),b=i.slug===Y;let a;e[0]!==t.id?(a={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=a):a=e[1];const c=re(a);let f;e[2]!==c||e[3]!==i.id?(f=async()=>{const _=await c.callTool({name:"PROJECT_DELETE",arguments:{projectId:i.id}});return _.structuredContent??_},e[2]=c,e[3]=i.id,e[4]=f):f=e[4];let p;e[5]!==o||e[6]!==t.id||e[7]!==t.slug||e[8]!==d?(p=_=>{_.success?(d.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project deleted"),o({to:"/$org/$project",params:{org:t.slug,project:Y}})):R.error(_.message??"Failed to delete project")},e[5]=o,e[6]=t.id,e[7]=t.slug,e[8]=d,e[9]=p):p=e[9];let w;e[10]!==f||e[11]!==p?(w={mutationFn:f,onSuccess:p,onError:st},e[10]=f,e[11]=p,e[12]=w):w=e[12];const m=ee(w);if(b)return null;const y=g===i.name;let P;e[13]!==m?(P=()=>{m.mutate()},e[13]=m,e[14]=P):P=e[14];const C=P;let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{j(_),_||u("")},e[15]=I):I=e[15];const S=I;let n;e[16]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),e[16]=n):n=e[16];let r;e[17]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{asChild:!0,children:s.jsx(L,{variant:"destructive",children:"Delete Project"})}),e[17]=r):r=e[17];let l;e[18]!==i.name?(l=s.jsxs(ze,{children:['Delete "',i.name,'"?']}),e[18]=i.name,e[19]=l):l=e[19];let h;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ke,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[20]=h):h=e[20];let v;e[21]!==l?(v=s.jsxs(Re,{children:[l,h]}),e[21]=l,e[22]=v):v=e[22];let N;e[23]!==i.name?(N=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:i.name})," to confirm:"]}),e[23]=i.name,e[24]=N):N=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=_=>u(_.target.value),e[25]=F):F=e[25];let O;e[26]!==g||e[27]!==i.name?(O=s.jsx(V,{value:g,onChange:F,placeholder:i.name}),e[26]=g,e[27]=i.name,e[28]=O):O=e[28];let T;e[29]!==N||e[30]!==O?(T=s.jsxs("div",{className:"py-4",children:[N,O]}),e[29]=N,e[30]=O,e[31]=T):T=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Le,{children:"Cancel"}),e[32]=D):D=e[32];const A=!y||m.isPending,z=m.isPending?"Deleting...":"Delete Project";let E;e[33]!==C||e[34]!==A||e[35]!==z?(E=s.jsxs(Ue,{children:[D,s.jsx(qe,{onClick:C,disabled:A,className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",children:z})]}),e[33]=C,e[34]=A,e[35]=z,e[36]=E):E=e[36];let k;e[37]!==v||e[38]!==T||e[39]!==E?(k=s.jsxs(Me,{children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=k):k=e[40];let B;return e[41]!==x||e[42]!==k?(B=s.jsxs("div",{className:"border border-destructive/50 rounded-lg p-4 space-y-4",children:[n,s.jsxs($e,{open:x,onOpenChange:S,children:[r,k]})]}),e[41]=x,e[42]=k,e[43]=B):B=e[43],B}function st(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function zt(){const e=H.c(10),{project:t}=W(),i=t.slug===Y;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Z.Header,{children:s.jsx(Z.Header.Left,{children:s.jsx(fe,{children:s.jsx(pe,{children:s.jsx(he,{children:s.jsx(xe,{children:"Settings"})})})})})}),e[0]=o):o=e[0];let d;e[1]!==i?(d=i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(et,{})]}),e[1]=i,e[2]=d):d=e[2];let g;e[3]!==i?(g=!i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"General"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Basic project information."})]}),s.jsx(Ge,{})]}),e[3]=i,e[4]=g):g=e[4];let u,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage which plugins are enabled and configure them."})]}),s.jsx(Ze,{})]}),x=s.jsx(tt,{}),e[5]=u,e[6]=x):(u=e[5],x=e[6]);let j;return e[7]!==d||e[8]!==g?(j=s.jsxs(Z,{children:[o,s.jsx(Z.Content,{children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-8",children:[d,g,u,x]})})})})})]}),e[7]=d,e[8]=g,e[9]=j):j=e[9],j}export{zt as default};
|
|
1
|
+
import{c as H,u as W,z as X,O as Y,h as oe,k as ae,j as s,o as ce,s as G,K as U,t as R,r as q,aN as te,bn as ue,m as de,g as ge}from"./index-BKpxPW_G.js";import{P as Z}from"./index-B9-4goiW.js";import{B as fe,a as pe,b as he,c as xe}from"./breadcrumb-ChH6wfcA.js";import{u as ee}from"./useMutation-Bnsod7M-.js";import{a as ie,u as re}from"./constants-DisdEZ3l.js";import{B as L}from"./button-D_OpQIQm.js";import{I as V}from"./input-lpAGMNlp.js";import{T as je}from"./textarea-BRJpMcB0.js";import{F as Q,d as M,a as me,b as $,c as K,e as se,f as J}from"./form-BpiblhO1.js";import{u as be}from"./useQuery-Bo6lCSyK.js";import{S as ye}from"./switch-sdaV-SJo.js";import{L as ve}from"./label-h0it3r-G.js";import{h as Ne}from"./use-connection-B0740Saa.js";import{a as Ce,c as Se}from"./use-binding-DMsO_03X.js";import{u as Pe}from"./use-install-from-registry-BjKzt3Pz.js";import{i as we}from"./Loading01-C2vqzEw-.js";import{s as Ie}from"./Plus-BMOTPGqH.js";import{S as Ee,a as Fe,b as De,c as _e,d as le}from"./select-BbzYJ4VF.js";import{c as Oe}from"./utils-Ckp7rFN8.js";import{i as Te}from"./Upload01-Ci_jklEk.js";import{i as Ae}from"./X-CslJd5Ib.js";import{c as ze,h as Be,d as ke,b as Re,A as Le,e as Ue,g as qe,a as Me,f as $e}from"./alert-dialog-DRso9X1m.js";import"./ChevronRight-DMzFQQCc.js";import"./binder-Jddq1y1v.js";import"./extract-connection-data-wB5jtXsg.js";import"./constants-1u4R2d-I.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-yxVJe3X4.js";import"./generate-id-Dyweu44Y.js";import"./index-fVGDVKMq.js";import"./Check-bgVFNRDs.js";import"./ChevronDown-DY4fpd0G.js";const Ke=ce({name:G().min(1,"Name is required").max(200,"Name is too long"),description:G().max(1e3,"Description is too long").nullable()});function Ge(){const e=H.c(58),{org:t,project:i}=W(),o=X(),d=i.slug===Y;let g;e[0]!==t.id?(g={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=g):g=e[1];const u=re(g);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=oe(Ke),e[2]=x):x=e[2];const j=i.name??"",b=i.description??"";let a;e[3]!==j||e[4]!==b?(a={resolver:x,values:{name:j,description:b}},e[3]=j,e[4]=b,e[5]=a):a=e[5];const c=ae(a);let f;e[6]!==u||e[7]!==i.id?(f=async B=>{const _=await u.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,name:B.name,description:B.description||null}});return _.structuredContent??_},e[6]=u,e[7]=i.id,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==t.id||e[11]!==i.slug||e[12]!==o?(p=()=>{o.invalidateQueries({queryKey:U.project(t.id,i.slug)}),o.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project updated successfully"),c.reset(c.getValues())},e[9]=c,e[10]=t.id,e[11]=i.slug,e[12]=o,e[13]=p):p=e[13];let w;e[14]!==f||e[15]!==p?(w={mutationFn:f,onSuccess:p,onError:Qe},e[14]=f,e[15]=p,e[16]=w):w=e[16];const m=ee(w);let y;e[17]!==m?(y=async B=>{await m.mutateAsync(B)},e[17]=m,e[18]=y):y=e[18];const P=y,C=c.formState.isDirty;let I;e[19]!==c||e[20]!==P?(I=c.handleSubmit(P),e[19]=c,e[20]=P,e[21]=I):I=e[21];let S;e[22]!==d||e[23]!==m.isPending?(S=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Project Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Project",..._,disabled:d||m.isPending})}),d&&s.jsx(se,{children:"The organization admin project name cannot be changed."}),s.jsx(J,{})]})},e[22]=d,e[23]=m.isPending,e[24]=S):S=e[24];let n;e[25]!==c.control||e[26]!==S?(n=s.jsx(Q,{control:c.control,name:"name",render:S}),e[25]=c.control,e[26]=S,e[27]=n):n=e[27];let r;e[28]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:"Slug"}),e[28]=r):r=e[28];let l;e[29]!==i.slug?(l=s.jsx(M,{children:s.jsx(V,{value:i.slug,disabled:!0,className:"bg-muted"})}),e[29]=i.slug,e[30]=l):l=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(se,{children:"The project slug cannot be changed after creation."}),e[31]=h):h=e[31];let v;e[32]!==l?(v=s.jsxs($,{children:[r,l,h]}),e[32]=l,e[33]=v):v=e[33];let N;e[34]!==m.isPending?(N=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Description"}),s.jsx(M,{children:s.jsx(je,{placeholder:"Optional project description...",rows:3,..._,value:_.value??"",disabled:m.isPending})}),s.jsx(J,{})]})},e[34]=m.isPending,e[35]=N):N=e[35];let F;e[36]!==c.control||e[37]!==N?(F=s.jsx(Q,{control:c.control,name:"description",render:N}),e[36]=c.control,e[37]=N,e[38]=F):F=e[38];const O=!C||m.isPending,T=m.isPending?"Saving...":"Save Changes";let D;e[39]!==O||e[40]!==T?(D=s.jsx(L,{type:"submit",disabled:O,className:"min-w-24",children:T}),e[39]=O,e[40]=T,e[41]=D):D=e[41];let A;e[42]!==c||e[43]!==C||e[44]!==m.isPending?(A=C&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>c.reset(),disabled:m.isPending,children:"Cancel"}),e[42]=c,e[43]=C,e[44]=m.isPending,e[45]=A):A=e[45];let z;e[46]!==D||e[47]!==A?(z=s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[D,A]}),e[46]=D,e[47]=A,e[48]=z):z=e[48];let E;e[49]!==n||e[50]!==v||e[51]!==F||e[52]!==z||e[53]!==I?(E=s.jsxs("form",{onSubmit:I,className:"space-y-6",children:[n,v,F,z]}),e[49]=n,e[50]=v,e[51]=F,e[52]=z,e[53]=I,e[54]=E):E=e[54];let k;return e[55]!==c||e[56]!==E?(k=s.jsx(me,{...c,children:E}),e[55]=c,e[56]=E,e[57]=k):k=e[57],k}function Qe(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Je({value:e,onValueChange:t,placeholder:i="Select a connection...",binding:o,bindingType:d,onAddNew:g,className:u,disabled:x=!1}){const[j,b]=q.useState(!1),{installByBinding:a,isInstalling:c}=Pe(),f=j||c,p=Ne(),w=Ce({connections:p,binding:typeof o=="string"?o:void 0}),m=!o||!p?p??[]:typeof o=="string"?w:Array.isArray(o)&&o.length>0?p.filter(n=>Se(n,o)):p,y=(()=>{if(!d?.startsWith("@"))return null;const[n,r]=d.replace("@","").split("/");return n&&r?{scope:n,appName:r}:null})(),P=(()=>{let n=m;const r=Array.isArray(o)&&o.length>0;if(y&&!r&&(n=n.filter(l=>{const h=l.app_name,v=l.metadata?.scopeName;return h===y.appName&&v===y.scope})),e&&!n.some(l=>l.id===e)){const l=p?.find(h=>h.id===e);if(l)return[l,...n]}return n})(),C=d?.startsWith("@"),I=async()=>{if(C&&d){b(!0);try{const n=await a(d);n&&t(n.id)}finally{b(!1)}return}g?.()},S=P.find(n=>n.id===e);return s.jsxs(Ee,{value:e??"none",onValueChange:n=>t(n==="none"?null:n),disabled:x,children:[s.jsx(Fe,{size:"sm",className:Oe("w-[200px]",u),children:s.jsx(De,{placeholder:i,children:S?s.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?s.jsx("img",{src:S.icon,alt:S.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:S.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:S.title})]}):i})}),s.jsxs(_e,{children:[s.jsx(le,{value:"none",children:"No connection"}),P.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(n=>s.jsx(le,{value:n.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[n.icon?s.jsx("img",{src:n.icon,alt:n.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:n.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:n.title})]})},n.id)),(g||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(L,{onPointerDown:n=>n.stopPropagation(),onClick:n=>{n.preventDefault(),n.stopPropagation(),I()},disabled:f||x,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:f?s.jsxs(s.Fragment,{children:[s.jsx(we,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ie,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ve=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")},ne=e=>{const t=e.structuredContent??e,i=t&&typeof t=="object"?t:null,o=i?.content?.[0]?.text&&typeof i.content[0].text=="string"?i.content[0].text:null;if(i?.isError)throw new Error(o??"Tool call failed");if(Ve(t))throw new Error(t.text);return t};function He(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function We(e){const t=H.c(48),{plugin:i,isEnabled:o,isSaving:d,pendingBinding:g,description:u,label:x,icon:j,projectId:b,client:a,onBindingChange:c,onToggle:f}=e;let p;t[0]!==i?(p=He(i),t[0]=i,t[1]=p):p=t[1];const w=p;let m;t[2]!==i.id||t[3]!==b?(m=U.projectPluginConfig(b??"",i.id),t[2]=i.id,t[3]=b,t[4]=m):m=t[4];let y;t[5]!==a||t[6]!==i.id||t[7]!==b?(y=async()=>{if(!b)throw new Error("Project ID is required to load plugin config.");const E=await a.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:b,pluginId:i.id}});return ne(E)},t[5]=a,t[6]=i.id,t[7]=b,t[8]=y):y=t[8];const P=!!b&&w;let C;t[9]!==m||t[10]!==y||t[11]!==P?(C={queryKey:m,queryFn:y,enabled:P},t[9]=m,t[10]=y,t[11]=P,t[12]=C):C=t[12];const{data:I,isLoading:S}=be(C),n=I?.config?.connectionId??null,r=g!==void 0?g:n;let l;t[13]!==j?(l=j&&s.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:j}),t[13]=j,t[14]=l):l=t[14];let h;t[15]!==x?(h=s.jsx("div",{className:"text-sm font-medium text-foreground",children:x}),t[15]=x,t[16]=h):h=t[16];let v;t[17]!==u?(v=u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=v):v=t[18];let N;t[19]!==h||t[20]!==v?(N=s.jsxs("div",{className:"min-w-0",children:[h,v]}),t[19]=h,t[20]=v,t[21]=N):N=t[21];let F;t[22]!==l||t[23]!==N?(F=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l,N]}),t[22]=l,t[23]=N,t[24]=F):F=t[24];let O;t[25]!==f||t[26]!==i.id?(O=E=>f(i.id,E),t[25]=f,t[26]=i.id,t[27]=O):O=t[27];let T;t[28]!==o||t[29]!==d||t[30]!==O?(T=s.jsx(ye,{checked:o,onCheckedChange:O,disabled:d}),t[28]=o,t[29]=d,t[30]=O,t[31]=T):T=t[31];let D;t[32]!==F||t[33]!==T?(D=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[F,T]}),t[32]=F,t[33]=T,t[34]=D):D=t[34];let A;t[35]!==S||t[36]!==o||t[37]!==d||t[38]!==w||t[39]!==c||t[40]!==i.binding||t[41]!==i.id||t[42]!==r||t[43]!==n?(A=o&&w&&s.jsxs("div",{className:"mt-3 pl-7 flex items-center gap-3",children:[s.jsx(ve,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Je,{value:r??null,onValueChange:E=>c(i.id,E,n),binding:i.binding,placeholder:"Select connection...",className:"w-56",disabled:d||S})]}),t[35]=S,t[36]=o,t[37]=d,t[38]=w,t[39]=c,t[40]=i.binding,t[41]=i.id,t[42]=r,t[43]=n,t[44]=A):A=t[44];let z;return t[45]!==D||t[46]!==A?(z=s.jsxs("div",{className:"py-3",children:[D,A]}),t[45]=D,t[46]=A,t[47]=z):z=t[47],z}function Ze(){const{org:e,project:t}=W(),i=X(),o=re({connectionId:ie,orgId:e.id}),[d,g]=q.useState({}),[u,x]=q.useState({}),[j,b]=q.useState(!1),a=t.enabledPlugins??[],c=n=>{const r=d[n];return r!==void 0?r:a.includes(n)},f=()=>{const n=new Set(a);for(const[r,l]of Object.entries(d))l?n.add(r):n.delete(r);return Array.from(n)},p=Object.keys(d).length>0||Object.keys(u).length>0,w=(n,r)=>{const l=a.includes(n);g(r===l?h=>{const{[n]:v,...N}=h;return N}:h=>({...h,[n]:r}))},m=(n,r,l)=>{if(r===l){x(h=>{const{[n]:v,...N}=h;return N});return}x(h=>({...h,[n]:r}))},y=ee({mutationFn:async n=>{const r=[];if(n.updatePlugins){const l=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:n.enabledPlugins}});r.push(ne(l))}if(n.bindingUpdates.length>0){const l=await Promise.all(n.bindingUpdates.map(async({pluginId:h,connectionId:v})=>{const N=await o.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:h,connectionId:v}});return ne(N)}));r.push(...l)}return r},onSuccess:(n,r)=>{r.updatePlugins&&(i.invalidateQueries({queryKey:U.project(e.id,t.slug)}),i.invalidateQueries({queryKey:U.projects(e.id)})),r.bindingUpdates.forEach(({pluginId:l})=>{i.invalidateQueries({queryKey:U.projectPluginConfig(t.id??"",l)})}),g({}),x({}),R.success("Plugins updated successfully")},onError:n=>{R.error("Failed to update plugins: "+(n instanceof Error?n.message:"Unknown error"))},onSettled:()=>{b(!1)}}),P=()=>{b(!0),y.mutate({enabledPlugins:f(),updatePlugins:Object.keys(d).length>0,bindingUpdates:Object.entries(u).map(([n,r])=>({pluginId:n,connectionId:r}))})},C=()=>{g({}),x({})},I=n=>ue.find(r=>r.pluginId===n),S=n=>te.find(l=>l.id===n)?.description??null;return te.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("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for this project. Enabled plugins will appear in the sidebar."}),s.jsx("div",{className:"divide-y divide-border border-y border-border",children:te.map(n=>{const r=I(n.id),l=S(n.id),h=c(n.id);return s.jsx(We,{plugin:n,isEnabled:h,isSaving:j,pendingBinding:u[n.id],description:l,label:r?.label??n.id,icon:r?.icon,projectId:t.id,client:o,onBindingChange:m,onToggle:w},n.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{variant:"outline",onClick:C,disabled:!p||j,children:"Cancel"}),s.jsx(L,{onClick:P,disabled:!p||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}const Ye=ce({name:G().min(1,"Name is required").max(255,"Name is too long"),slug:G().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:G().optional()});function Xe(e){const t=H.c(24),{value:i,onChange:o,name:d}=e,g=q.useRef(null);let u;t[0]!==o?(u=S=>{const n=S.target.files?.[0];if(n){if(n.size>2097152){R.error("Image must be smaller than 2MB");return}const r=new FileReader;r.onerror=()=>{const l=r.error;console.error("FileReader error:",l),R.error(l?.message||"Failed to read image file. Please try again."),g.current&&(g.current.value="")},r.onloadend=()=>{if(r.readyState===FileReader.DONE&&r.result){const l=r.result;o(l)}},r.readAsDataURL(n)}},t[0]=o,t[1]=u):u=t[1];const x=u;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{g.current?.click()},t[2]=j):j=t[2];const b=j;let a;t[3]!==o?(a=S=>{S.stopPropagation(),o("")},t[3]=o,t[4]=a):a=t[4];const c=a;let f;t[5]!==x?(f=s.jsx("input",{type:"file",ref:g,className:"hidden",accept:"image/*",onChange:x}),t[5]=x,t[6]=f):f=t[6];let p;t[7]!==c||t[8]!==d||t[9]!==i?(p=i?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:i,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:c,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(Ae,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:b,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(Te,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=c,t[8]=d,t[9]=i,t[10]=p):p=t[10];const w=i?"Change Logo":"Upload Logo";let m;t[11]!==w?(m=s.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:b,className:"mb-2",children:w}),t[11]=w,t[12]=m):m=t[12];let y;t[13]!==c||t[14]!==i?(y=i&&s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:c,className:"ml-2",children:"Remove"}),t[13]=c,t[14]=i,t[15]=y):y=t[15];let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=P):P=t[16];let C;t[17]!==m||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[m,y,P]}),t[17]=m,t[18]=y,t[19]=C):C=t[19];let I;return t[20]!==C||t[21]!==f||t[22]!==p?(I=s.jsxs("div",{className:"flex items-start gap-4",children:[f,p,C]}),t[20]=C,t[21]=f,t[22]=p,t[23]=I):I=t[23],I}function et(){const e=de(),{org:t,project:i}=W(),o=X(),[d,g]=q.useState(!1),u=ae({resolver:oe(Ye),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),x=ee({mutationFn:async a=>{const c={name:a.name,slug:a.slug};a.logo&&(c.logo=a.logo);const f=await ge.organization.update({organizationId:t.id,data:c});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:a=>{o.invalidateQueries({queryKey:U.organizations()}),o.invalidateQueries({queryKey:U.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:a.data.slug,project:i.slug}})},onError:a=>{R.error(a instanceof Error?a.message:"Failed to update organization")},onSettled:()=>{g(!1)}}),j=a=>{g(!0),x.mutate(a)},b=u.formState.isDirty;return s.jsx(me,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(j),className:"space-y-6",children:[s.jsx(Q,{control:u.control,name:"name",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Organization",...a,disabled:d})}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"slug",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Slug"}),s.jsx(M,{children:s.jsx(V,{placeholder:"my-organization",...a,disabled:d,onChange:c=>{const f=c.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.onChange(f)}})}),s.jsx(se,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"logo",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Logo"}),s.jsx(M,{children:s.jsx(Xe,{value:a.value,onChange:a.onChange,name:u.watch("name")})}),s.jsx(J,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{type:"submit",disabled:!b||d,className:"min-w-24",children:d?"Saving...":"Save Changes"}),b&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>u.reset(),disabled:d,children:"Cancel"})]})]})})}function tt(){const e=H.c(44),{org:t,project:i}=W(),o=de(),d=X(),[g,u]=q.useState(""),[x,j]=q.useState(!1),b=i.slug===Y;let a;e[0]!==t.id?(a={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=a):a=e[1];const c=re(a);let f;e[2]!==c||e[3]!==i.id?(f=async()=>{const _=await c.callTool({name:"PROJECT_DELETE",arguments:{projectId:i.id}});return _.structuredContent??_},e[2]=c,e[3]=i.id,e[4]=f):f=e[4];let p;e[5]!==o||e[6]!==t.id||e[7]!==t.slug||e[8]!==d?(p=_=>{_.success?(d.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project deleted"),o({to:"/$org/$project",params:{org:t.slug,project:Y}})):R.error(_.message??"Failed to delete project")},e[5]=o,e[6]=t.id,e[7]=t.slug,e[8]=d,e[9]=p):p=e[9];let w;e[10]!==f||e[11]!==p?(w={mutationFn:f,onSuccess:p,onError:st},e[10]=f,e[11]=p,e[12]=w):w=e[12];const m=ee(w);if(b)return null;const y=g===i.name;let P;e[13]!==m?(P=()=>{m.mutate()},e[13]=m,e[14]=P):P=e[14];const C=P;let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{j(_),_||u("")},e[15]=I):I=e[15];const S=I;let n;e[16]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),e[16]=n):n=e[16];let r;e[17]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{asChild:!0,children:s.jsx(L,{variant:"destructive",children:"Delete Project"})}),e[17]=r):r=e[17];let l;e[18]!==i.name?(l=s.jsxs(ze,{children:['Delete "',i.name,'"?']}),e[18]=i.name,e[19]=l):l=e[19];let h;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ke,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[20]=h):h=e[20];let v;e[21]!==l?(v=s.jsxs(Re,{children:[l,h]}),e[21]=l,e[22]=v):v=e[22];let N;e[23]!==i.name?(N=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:i.name})," to confirm:"]}),e[23]=i.name,e[24]=N):N=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=_=>u(_.target.value),e[25]=F):F=e[25];let O;e[26]!==g||e[27]!==i.name?(O=s.jsx(V,{value:g,onChange:F,placeholder:i.name}),e[26]=g,e[27]=i.name,e[28]=O):O=e[28];let T;e[29]!==N||e[30]!==O?(T=s.jsxs("div",{className:"py-4",children:[N,O]}),e[29]=N,e[30]=O,e[31]=T):T=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Le,{children:"Cancel"}),e[32]=D):D=e[32];const A=!y||m.isPending,z=m.isPending?"Deleting...":"Delete Project";let E;e[33]!==C||e[34]!==A||e[35]!==z?(E=s.jsxs(Ue,{children:[D,s.jsx(qe,{onClick:C,disabled:A,className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",children:z})]}),e[33]=C,e[34]=A,e[35]=z,e[36]=E):E=e[36];let k;e[37]!==v||e[38]!==T||e[39]!==E?(k=s.jsxs(Me,{children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=k):k=e[40];let B;return e[41]!==x||e[42]!==k?(B=s.jsxs("div",{className:"border border-destructive/50 rounded-lg p-4 space-y-4",children:[n,s.jsxs($e,{open:x,onOpenChange:S,children:[r,k]})]}),e[41]=x,e[42]=k,e[43]=B):B=e[43],B}function st(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function zt(){const e=H.c(10),{project:t}=W(),i=t.slug===Y;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Z.Header,{children:s.jsx(Z.Header.Left,{children:s.jsx(fe,{children:s.jsx(pe,{children:s.jsx(he,{children:s.jsx(xe,{children:"Settings"})})})})})}),e[0]=o):o=e[0];let d;e[1]!==i?(d=i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(et,{})]}),e[1]=i,e[2]=d):d=e[2];let g;e[3]!==i?(g=!i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"General"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Basic project information."})]}),s.jsx(Ge,{})]}),e[3]=i,e[4]=g):g=e[4];let u,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage which plugins are enabled and configure them."})]}),s.jsx(Ze,{})]}),x=s.jsx(tt,{}),e[5]=u,e[6]=x):(u=e[5],x=e[6]);let j;return e[7]!==d||e[8]!==g?(j=s.jsxs(Z,{children:[o,s.jsx(Z.Content,{children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-8",children:[d,g,u,x]})})})})})]}),e[7]=d,e[8]=g,e[9]=j):j=e[9],j}export{zt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aV as M,c as O,u as H,j as s,aM as U,r as I,m as V,O as G}from"./index-
|
|
1
|
+
import{aV as M,c as O,u as H,j as s,aM as U,r as I,m as V,O as G}from"./index-BKpxPW_G.js";import{a as q}from"./use-project-CuNldV92.js";import{P as D}from"./index-B9-4goiW.js";import{C as F}from"./collection-search-Bkd4qN8a.js";import{A as J}from"./avatar-kY9raA-l.js";import{c as K}from"./utils-Ckp7rFN8.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as R}from"./empty-state-DXJM9xrV.js";import{C as W}from"./create-project-dialog-BDfz4rOz.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-ChH6wfcA.js";import{B as T}from"./button-D_OpQIQm.js";import"./useQuery-Bo6lCSyK.js";import"./constants-DisdEZ3l.js";import"./Loading01-C2vqzEw-.js";import"./SearchMd-BqVXNd65.js";import"./input-lpAGMNlp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-Bnsod7M-.js";import"./dialog-BPL7ZvPc.js";import"./X-CslJd5Ib.js";import"./form-BpiblhO1.js";import"./label-h0it3r-G.js";import"./textarea-BRJpMcB0.js";import"./Check-bgVFNRDs.js";import"./ChevronRight-DMzFQQCc.js";const te=M("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let E;return e[55]!==A||e[56]!==u?(E=s.jsx(U,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function Ae(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=V();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(T,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(T,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==G}export{Ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-BKpxPW_G.js";import{c as o}from"./constants-DisdEZ3l.js";function f(t){return t?t.find(n=>n.name.endsWith("_LIST"))?.name??"":""}function u(t){return t?t.find(n=>n.name.endsWith("_FILTERS"))?.name??"":""}function m(t){if(!t)return[];const e=[];for(const n of t){let r=[];if(Array.isArray(n))r=n;else if(typeof n=="object"&&n!==null){const i=Object.keys(n).find(a=>Array.isArray(n[a]));i&&(r=n[i])}e.push(...r)}return e}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function y(t){return t?c[t]??t.toUpperCase():null}function T(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function d(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function h(t,e,n,r){const i=await o({connectionId:t,orgId:e});try{const a=await i.callTool({name:n,arguments:r});return a.structuredContent??a}finally{await i.close().catch(console.error)}}export{m as a,u as b,h as c,T as d,d as e,f,y as g};
|