@decocms/mesh 1.0.0-alpha.27 → 1.0.0-alpha.28
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/{alert-dialog-B5P__fSo.js → alert-dialog-C2AXRAdI.js} +1 -1
- package/dist/client/assets/{auth-Cf-BfTK3.js → auth-BjEJS-ti.js} +1 -1
- package/dist/client/assets/{auth-catchall-CAFc22YR.js → auth-catchall-BRoDHrkX.js} +1 -1
- package/dist/client/assets/{avatar-DPg_RyEl.js → avatar-CCRBpJ2S.js} +1 -1
- package/dist/client/assets/{badge-BWSVXk6u.js → badge-DVddOuDf.js} +1 -1
- package/dist/client/assets/{button-7f3mJDt9.js → button-BKI-GQNs.js} +1 -1
- package/dist/client/assets/{card-C-FxKc9h.js → card-CQxotwMu.js} +1 -1
- package/dist/client/assets/{checkbox-Cgzsx5iu.js → checkbox-DXOKpcZ0.js} +1 -1
- package/dist/client/assets/{circle-alert-DU3UcGxR.js → circle-alert-CI4aNANz.js} +1 -1
- package/dist/client/assets/{collection-detail-CFgy96Yw.js → collection-detail-CHNCFwGn.js} +1 -1
- package/dist/client/assets/{collection-display-button-yCMREeFw.js → collection-display-button-DiJzMYDw.js} +1 -1
- package/dist/client/assets/{collection-header-BRT8x6Bu.js → collection-header-B74HL_BQ.js} +1 -1
- package/dist/client/assets/{collection-page-DutPWx_J.js → collection-page-Gju8NROn.js} +1 -1
- package/dist/client/assets/{collection-search-Blu2oI67.js → collection-search-5_31uFQu.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D77XIcPK.js → collection-table-wrapper-Cexc-Pdz.js} +1 -1
- package/dist/client/assets/{connection-card-VvLWKVZB.js → connection-card-FqjC5vzz.js} +1 -1
- package/dist/client/assets/{connection-detail-CIXniRq_.js → connection-detail-DlM4urTK.js} +1 -1
- package/dist/client/assets/{connections-B0k_3lJ6.js → connections-Bfcj96aB.js} +1 -1
- package/dist/client/assets/{core-DSrr1gFw.js → core-DK4y5D2y.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-QRhVV4NP.js → create-organization-dialog-CtVmaemS.js} +1 -1
- package/dist/client/assets/{dialog-DxoCnO7f.js → dialog-CcAczAty.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Dsh1FAHq.js → dropdown-menu-CtyYPfMS.js} +1 -1
- package/dist/client/assets/{empty-state-CLlWeA8F.js → empty-state-BdQaURkL.js} +1 -1
- package/dist/client/assets/{error-boundary-BpbgV8Mt.js → error-boundary-BqkazxGZ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bubi-83r.js → extract-connection-data-BmRyJSV5.js} +1 -1
- package/dist/client/assets/{form-CEChYO-W.js → form-BCzESr64.js} +1 -1
- package/dist/client/assets/{gateway-detail-ht9jY5Da.js → gateway-detail-rUxOHblZ.js} +1 -1
- package/dist/client/assets/{gateways-BG4qNJPZ.js → gateways-BYaK85gs.js} +1 -1
- package/dist/client/assets/{home-CkLLsx37.js → home-BwRicK_C.js} +1 -1
- package/dist/client/assets/{icon-Dk3IUZlY.js → icon-BH0uQy8Q.js} +1 -1
- package/dist/client/assets/{index-Pk85Lo4X.js → index-BZMMgVHQ.js} +1 -1
- package/dist/client/assets/{index-tTqkKQJp.js → index-B__VUTR3.js} +3 -3
- package/dist/client/assets/{index-B3Svv0HD.js → index-DDv8XLKp.js} +1 -1
- package/dist/client/assets/{index-CRXnV96L.js → index-mSyA_igj.js} +1 -1
- package/dist/client/assets/{input-DsJLZuBe.js → input-DQSvL_aO.js} +1 -1
- package/dist/client/assets/json-Br4edP4H.js +1 -0
- package/dist/client/assets/{layout-7tvwsBuE.js → layout-tP8VoWYn.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-BXMzyI4V.js → lazy-highlighter-D1A1Guv4.js} +1 -1
- package/dist/client/assets/{localstorage-keys-2gInE9f9.js → localstorage-keys-DCgXaWMK.js} +1 -1
- package/dist/client/assets/{login-BNugdJth.js → login-DBR5FdH6.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BOA4hd1a.js → mcp-oauth-v_MhlTn1.js} +1 -1
- package/dist/client/assets/{members-z4wBZKYX.js → members-Bhg2_ZSs.js} +1 -1
- package/dist/client/assets/{monitoring-BoRkHos-.js → monitoring-DAnTyFbi.js} +1 -1
- package/dist/client/assets/{oauth-callback-z3iCI-Fn.js → oauth-callback-K0vVKfJt.js} +1 -1
- package/dist/client/assets/{page-DkuwHgHg.js → page-D0nieAd7.js} +1 -1
- package/dist/client/assets/{popover-CUCZevqJ.js → popover-tnkyq1hU.js} +1 -1
- package/dist/client/assets/prism-light-gejq_KnN.js +1 -0
- package/dist/client/assets/{resource-tabs-Dr8QbV0u.js → resource-tabs-C38lAnf7.js} +1 -1
- package/dist/client/assets/{schema-ggfLBohE.js → schema-C7-hKK0j.js} +1 -1
- package/dist/client/assets/{select-GwKsoZTV.js → select-8hQIWu_F.js} +1 -1
- package/dist/client/assets/{settings-Cp1KZJA2.js → settings-BENyycRE.js} +1 -1
- package/dist/client/assets/{shell-layout-BAThlowD.js → shell-layout-DwQEFltw.js} +3 -3
- package/dist/client/assets/{spinner-DZz5BuLl.js → spinner-B_7PKdEi.js} +1 -1
- package/dist/client/assets/{store-CSHMTNbU.js → store-CdN9wtZc.js} +1 -1
- package/dist/client/assets/{store-app-detail-DrtrpMu_.js → store-app-detail-AyYeHK1f.js} +1 -1
- package/dist/client/assets/{switch-BWlL3QAV.js → switch-C9-Lpl_K.js} +1 -1
- package/dist/client/assets/{textarea-DkvsoReo.js → textarea-CRdkZ0U2.js} +1 -1
- package/dist/client/assets/{tool-set-selector-BKqxCVz9.js → tool-set-selector-CFgzaLQt.js} +1 -1
- package/dist/client/assets/{tooltip-DG1xYIL4.js → tooltip-B5bMdg-c.js} +1 -1
- package/dist/client/assets/{types-Cp78eAtq.js → types-kRP4yG2G.js} +3 -3
- package/dist/client/assets/{upload-Bmv_uBao.js → upload-DyNO--Od.js} +1 -1
- package/dist/client/assets/{use-binding-C_9S-BsF.js → use-binding-n0fop-6Q.js} +1 -1
- package/dist/client/assets/{use-connection-CJdd9H8R.js → use-connection-DFfxu6G-.js} +1 -1
- package/dist/client/assets/{use-gateway-DeuD2XcZ.js → use-gateway-BbEXVBzn.js} +1 -1
- package/dist/client/assets/{use-list-state-D4EpKod3.js → use-list-state-ByAtqeJl.js} +1 -1
- package/dist/client/assets/{use-mcp-qYkX8fe3.js → use-mcp-DfzSXo3r.js} +1 -1
- package/dist/client/assets/{use-members-DcGjLl6z.js → use-members-B2rKjk7L.js} +1 -1
- package/dist/client/assets/{use-mobile-CR4-zNel.js → use-mobile-DvP3RV8-.js} +1 -1
- package/dist/client/assets/{use-organization-settings-14jcjh3V.js → use-organization-settings-CX0knSqQ.js} +1 -1
- package/dist/client/assets/{use-tool-call-CXd8t6dd.js → use-tool-call-Ck95V-cD.js} +1 -1
- package/dist/client/assets/useQuery-DSEkiaNM.js +1 -0
- package/dist/client/assets/utils-wGs-tBy0.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/json-CPcRzrP7.js +0 -1
- package/dist/client/assets/prism-light-yh0IS_ur.js +0 -1
- package/dist/client/assets/useQuery-DcphYrFi.js +0 -1
- package/dist/client/assets/utils-D4LuHWBB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b5 as W,b6 as z,b7 as Q,b8 as U,b9 as H,ba as G,c as L,j as s,r as _,a5 as Y,a2 as q,a as J,bb as Z,ao as X}from"./index-tTqkKQJp.js";import{g as ee,a as te}from"./well-known-mcp-Dg77mwx9.js";import{C as se}from"./collection-header-BRT8x6Bu.js";import{I as ie,a as ne,c as re,d as V,b as le}from"./use-connection-CJdd9H8R.js";import{a as oe,T as ae,b as ce,u as D}from"./tooltip-DG1xYIL4.js";import{s as de}from"./slugify-CEUa2lfQ.js";import{I as M}from"./icon-Dk3IUZlY.js";import{C as me}from"./collection-search-Blu2oI67.js";import{C as fe}from"./card-C-FxKc9h.js";import{g as ue,f as he,a as xe}from"./registry-utils-ulDDT0d8.js";import{e as ge}from"./app-name-gTETL9So.js";import{d as pe,a as ve,S as je,b as Ne,c as ye}from"./select-GwKsoZTV.js";import{C as Ce}from"./connection-card-VvLWKVZB.js";import{B as be}from"./button-7f3mJDt9.js";import{E as we}from"./empty-state-CLlWeA8F.js";import{a as Se}from"./use-binding-C_9S-BsF.js";import{L as Pe,u as Re}from"./localstorage-keys-2gInE9f9.js";import"./collection-display-button-yCMREeFw.js";import"./dropdown-menu-Dsh1FAHq.js";import"./utils-D4LuHWBB.js";import"./input-DsJLZuBe.js";import"./auth-Cf-BfTK3.js";import"./useQuery-DcphYrFi.js";var Ie=class extends W{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:z()})}getOptimisticResult(t){return t.behavior=z(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:n}=t,m=super.createResult(t,e),{isFetching:l,isRefetching:h,isError:d,isRefetchError:a}=m,c=n.fetchMeta?.fetchMore?.direction,i=d&&c==="forward",r=l&&c==="forward",o=d&&c==="backward",f=l&&c==="backward";return{...m,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:U(e,n.data),hasPreviousPage:Q(e,n.data),isFetchNextPageError:i,isFetchingNextPage:r,isFetchPreviousPageError:o,isFetchingPreviousPage:f,isRefetchError:a&&!i&&!o,isRefetching:h&&!r&&!f}}};function Ee(t,e){return H({...t,enabled:!0,suspense:!0,throwOnError:G},Ie,e)}function ke(t){const e=t.title||t.server.title||t.id||"Unnamed Item",n=t.server.description||null,m=t.server.icons?.[0]?.src||ue(t.server.repository)||null,l=t._meta?.["mcp.mesh"]?.verified??!1,h=t.server.version,a=(t.server.remotes?.length??0)>0;let c=e,i=null;if(e.includes("/")){const r=e.split("/");r.length>=2&&(i=r[0]||null,c=ge(e))}if(!i){const r=t._meta?.["mcp.mesh"]?.scopeName,o=t._meta?.["mcp.mesh"]?.appName;r&&o?i=`${r}/${o}`:r&&(i=r)}return{icon:m,scopeName:i,displayName:c,description:n,version:h||null,isVerified:l,canInstall:a}}function Te(t){const e=L.c(39),{icon:n,scopeName:m,displayName:l,description:h,isVerified:d,canInstall:a,onClick:c}=t;let i;e[0]!==l||e[1]!==n?(i=s.jsx(ie,{icon:n,name:l,size:"md",className:"shadow-sm"}),e[0]=l,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==l?(r=s.jsx("span",{className:"truncate",children:l}),e[3]=l,e[4]=r):r=e[4];let o;e[5]!==d?(o=d&&s.jsx(M,{name:"verified",size:16,className:"text-success shrink-0"}),e[5]=d,e[6]=o):o=e[6];let f;e[7]!==a?(f=!a&&s.jsx(M,{name:"lock",size:16,className:"text-muted-foreground shrink-0",title:"This MCP Server cannot be connected"}),e[7]=a,e[8]=f):f=e[8];let g;e[9]!==r||e[10]!==o||e[11]!==f?(g=s.jsx(oe,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-medium min-w-0",children:[r,o,f]})}),e[9]=r,e[10]=o,e[11]=f,e[12]=g):g=e[12];let u;e[13]!==l?(u=s.jsx("p",{children:l}),e[13]=l,e[14]=u):u=e[14];let p;e[15]!==a?(p=!a&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=a,e[16]=p):p=e[16];let v;e[17]!==u||e[18]!==p?(v=s.jsxs(ae,{children:[u,p]}),e[17]=u,e[18]=p,e[19]=v):v=e[19];let y;e[20]!==g||e[21]!==v?(y=s.jsxs(ce,{children:[g,v]}),e[20]=g,e[21]=v,e[22]=y):y=e[22];let C;e[23]!==m?(C=m&&s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:m}),e[23]=m,e[24]=C):C=e[24];let S;e[25]!==C||e[26]!==y?(S=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[y,C]})}),e[25]=C,e[26]=y,e[27]=S):S=e[27];let b;e[28]!==i||e[29]!==S?(b=s.jsxs("div",{className:"flex gap-3",children:[i,S]}),e[28]=i,e[29]=S,e[30]=b):b=e[30];const P=h||"No description available";let j;e[31]!==P?(j=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:P})}),e[31]=P,e[32]=j):j=e[32];let x;e[33]!==b||e[34]!==j?(x=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[b,j]}),e[33]=b,e[34]=j,e[35]=x):x=e[35];let w;return e[36]!==c||e[37]!==x?(w=s.jsx(fe,{className:"p-6 cursor-pointer hover:bg-muted/50 transition-colors",onClick:c,children:x}),e[36]=c,e[37]=x,e[38]=w):w=e[38],w}function B(t){const e=L.c(12),{items:n,title:m,onItemClick:l}=t;if(n.length===0)return null;let h;e[0]!==m?(h=m&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:m})}),e[0]=m,e[1]=h):h=e[1];let d;if(e[2]!==n||e[3]!==l){let i;e[5]!==l?(i=r=>{const o=ke(r);return s.jsx(Te,{...o,onClick:()=>l(r)},r.id)},e[5]=l,e[6]=i):i=e[6],d=n.map(i),e[2]=n,e[3]=l,e[4]=d}else d=e[4];let a;e[7]!==d?(a=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:d}),e[7]=d,e[8]=a):a=e[8];let c;return e[9]!==h||e[10]!==a?(c=s.jsxs("div",{className:"flex flex-col gap-4",children:[h,a]}),e[9]=h,e[10]=a,e[11]=c):c=e[11],c}function Me(t,e){if(!e)return t;const n=e.toLowerCase();return t.filter(m=>(m.name||m.title||"").toLowerCase().includes(n)||(m.description||m.server.description||"").toLowerCase().includes(n))}function Le(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function $e(t){const e=L.c(32),{items:n,isLoadingMore:m,registryId:l,hasMore:h,onLoadMore:d}=t,a=m===void 0?!1:m,c=h===void 0?!1:h,[i,r]=_.useState(""),o=Y(),{org:f}=D(),g=_.useRef(null);let u,p,v;e[0]!==n||e[1]!==i?(u=Me(n,i),v=u.filter(Le),p=u.filter(R=>!v.find(I=>I.id===R.id)),e[0]=n,e[1]=i,e[2]=u,e[3]=p,e[4]=v):(u=e[2],p=e[3],v=e[4]);const y=p;let C;e[5]!==o||e[6]!==f.slug||e[7]!==l?(C=R=>{const I=de(R.name||R.title||R.server.title||""),T=R.server.name;o({to:"/$org/store/$appName",params:{org:f.slug,appName:I},search:{registryId:l,serverName:T}})},e[5]=o,e[6]=f.slug,e[7]=l,e[8]=C):C=e[8];const S=C;let b;e[9]!==c||e[10]!==a||e[11]!==d||e[12]!==i?(b=R=>{if(!c||!d||i||a)return;const I=R.currentTarget;I.scrollHeight-I.scrollTop-I.clientHeight<200&&d()},e[9]=c,e[10]=a,e[11]=d,e[12]=i,e[13]=b):b=e[13];const P=b;let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=R=>{R.key==="Enter"&&r(R.currentTarget.value)},e[14]=j):j=e[14];let x;e[15]!==i?(x=s.jsx(me,{value:i,onChange:r,placeholder:"Search for an MCP Server...",onKeyDown:j}),e[15]=i,e[16]=x):x=e[16];let w;e[17]!==y||e[18]!==u||e[19]!==S||e[20]!==c||e[21]!==a||e[22]!==n.length||e[23]!==i||e[24]!==v?(w=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:n.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(M,{name:"inbox",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."})]}):i&&u.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(M,{name:"search",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:[v.length>0&&s.jsx(B,{items:v,title:"Verified",onItemClick:S}),y.length>0&&s.jsx(B,{items:y,title:v.length>0?"All":"",onItemClick:S}),c&&!i&&a&&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(M,{name:"progress_activity",size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=y,e[18]=u,e[19]=S,e[20]=c,e[21]=a,e[22]=n.length,e[23]=i,e[24]=v,e[25]=w):w=e[25];let E;e[26]!==P||e[27]!==w?(E=s.jsx("div",{ref:g,className:"flex-1 overflow-y-auto",onScroll:P,children:w}),e[26]=P,e[27]=w,e[28]=E):E=e[28];let k;return e[29]!==x||e[30]!==E?(k=s.jsxs("div",{className:"flex flex-col h-full",children:[x,E]}),e[29]=x,e[30]=E,e[31]=k):k=e[31],k}const F=24;function Ke(t){const e=L.c(27),{registryId:n}=t,m=ne(n);let l,h,d,a;if(e[0]!==m?.tools||e[1]!==n){if(l=he(m?.tools),!l)throw new Error("This registry does not support listing store items.");let x;e[6]!==n?(x=re(n),e[6]=n,e[7]=x):x=e[7],a=x,d=Ee,h=q.toolCall(n,l,JSON.stringify({limit:F})),e[0]=m?.tools,e[1]=n,e[2]=l,e[3]=h,e[4]=d,e[5]=a}else l=e[2],h=e[3],d=e[4],a=e[5];let c;e[8]!==l||e[9]!==a?(c=async x=>{const{pageParam:w}=x;return await a(l,w?{cursor:w,limit:F}:{limit:F})},e[8]=l,e[9]=a,e[10]=c):c=e[10];let i;e[11]!==h||e[12]!==c?(i={queryKey:h,queryFn:c,initialPageParam:void 0,getNextPageParam:Oe,staleTime:36e5},e[11]=h,e[12]=c,e[13]=i):i=e[13];const{data:r,fetchNextPage:o,hasNextPage:f,isFetchingNextPage:g}=d(i);let u;e:{if(!r?.pages||r.pages.length===0){u=null;break e}const x=r.pages[0];if(typeof x=="object"&&x!==null&&"totalCount"in x&&typeof x.totalCount=="number"){u=x.totalCount;break e}u=null}const p=u,v=r?.pages;let y;e[14]!==v?(y=xe(v),e[14]=v,e[15]=y):y=e[15];const C=y;let S;e[16]!==o||e[17]!==f||e[18]!==g?(S=()=>{f&&!g&&o()},e[16]=o,e[17]=f,e[18]=g,e[19]=S):S=e[19];const b=S,P=f??!1;let j;return e[20]!==C||e[21]!==b||e[22]!==g||e[23]!==n||e[24]!==P||e[25]!==p?(j=s.jsx($e,{items:C,isLoadingMore:g,registryId:n,hasMore:P,onLoadMore:b,totalCount:p}),e[20]=C,e[21]=b,e[22]=g,e[23]=n,e[24]=P,e[25]=p,e[26]=j):j=e[26],j}function Oe(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Ae(t){const e=L.c(15),{registries:n,value:m,onValueChange:l,onAddWellKnown:h,wellKnownRegistries:d,placeholder:a}=t,c=a===void 0?"Select a registry...":a;let i;e[0]!==c?(i=s.jsx(ve,{className:"w-[200px] h-8!",children:s.jsx(je,{placeholder:c})}),e[0]=c,e[1]=i):i=e[1];let r;e[2]!==n?(r=n.map(Fe),e[2]=n,e[3]=r):r=e[3];let o;e[4]!==h||e[5]!==d?(o=d.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"}),d.map(u=>s.jsxs("button",{onClick:p=>{p.preventDefault(),p.stopPropagation(),h(u)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-xl 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:[u.icon?s.jsx("img",{src:u.icon,alt:u.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:u.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:u.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(M,{name:"add",size:16})})]},u.id??u.title))]}),e[4]=h,e[5]=d,e[6]=o):o=e[6];let f;e[7]!==r||e[8]!==o?(f=s.jsxs(Ne,{children:[r,o]}),e[7]=r,e[8]=o,e[9]=f):f=e[9];let g;return e[10]!==l||e[11]!==i||e[12]!==f||e[13]!==m?(g=s.jsxs(ye,{value:m,onValueChange:l,children:[i,f]}),e[10]=l,e[11]=i,e[12]=f,e[13]=m,e[14]=g):g=e[14],g}function Fe(t){return s.jsx(pe,{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 _e(t){const e=L.c(13),{registries:n,onConnected:m}=t,l=n.length===1;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:423,height:279,className:"max-w-full h-auto"}),e[0]=h):h=e[0];const d=l?"Connect to registry":"Connect to a store",a=l?"Connect to discover and use MCP Servers from the community.":"Choose a registry to discover and connect MCP Servers from the community.",c=`grid gap-4 w-full ${l?"grid-cols-1 justify-items-center":"grid-cols-1 md:grid-cols-2"}`;let i;if(e[1]!==m||e[2]!==n){let f;e[4]!==m?(f=(g,u)=>{const p=g.id??`registry-${u}`;return s.jsx(De,{registry:{...g,id:p},onConnected:m},p)},e[4]=m,e[5]=f):f=e[5],i=n.map(f),e[1]=m,e[2]=n,e[3]=i}else i=e[3];let r;e[6]!==c||e[7]!==i?(r=s.jsx("div",{className:c,children:i}),e[6]=c,e[7]=i,e[8]=r):r=e[8];let o;return e[9]!==d||e[10]!==a||e[11]!==r?(o=s.jsx(we,{image:h,title:d,description:a,descriptionClassName:"max-w-[500px]",actionsClassName:"w-full max-w-2xl",actions:r}),e[9]=d,e[10]=a,e[11]=r,e[12]=o):o=e[12],o}function De(t){const e=L.c(15),{registry:n,onConnected:m}=t,l=V(),{org:h}=D(),{data:d}=J.useSession(),a=!!h&&!!d?.user?.id;let c;e[0]!==l.create||e[1]!==a||e[2]!==m||e[3]!==n?(c=async()=>{if(!a)return;const u=await l.create.mutateAsync(n);m?.(u.id)},e[0]=l.create,e[1]=a,e[2]=m,e[3]=n,e[4]=c):c=e[4];const i=c,r=!a||l.create.isPending;let o;e[5]!==l.create.isPending?(o=l.create.isPending?s.jsxs(s.Fragment,{children:[s.jsx(M,{name:"progress_activity",className:"animate-spin"}),"Connecting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(M,{name:"add"}),"Connect"]}),e[5]=l.create.isPending,e[6]=o):o=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==o?(f=s.jsx(be,{variant:"outline",className:"w-full",disabled:r,onClick:i,children:o}),e[7]=i,e[8]=r,e[9]=o,e[10]=f):f=e[10];let g;return e[11]!==i||e[12]!==n||e[13]!==f?(g=s.jsx(Ce,{connection:n,onClick:i,footer:f,className:"transition-all hover:border-primary/50 hover:shadow-md"}),e[11]=i,e[12]=n,e[13]=f,e[14]=g):g=e[14],g}function ut(){const t=L.c(41),{org:e}=D(),n=le(),m=V(),l=Z(),h=l.location.pathname.includes("/store/")&&l.location.pathname.split("/").length>3,d=Se(n);let a;t[0]!==d?(a=d.map(Ve),t[0]=d,t[1]=a):a=t[1];const c=a;let i;t[2]!==e.slug?(i=Pe.selectedRegistry(e.slug),t[2]=e.slug,t[3]=i):i=t[3];const[r,o]=Re(i,Be);let f;if(t[4]!==d||t[5]!==r){let N;t[7]!==r?(N=A=>A.id===r,t[7]=r,t[8]=N):N=t[8],f=d.find(N),t[4]=d,t[5]=r,t[6]=f}else f=t[6];const u=f?.id||d[0]?.id||"";let p;t[9]!==e.id?(p=ee(e.id),t[9]=e.id,t[10]=p):p=t[10];let v;t[11]!==p?(v=[p],t[11]=p,t[12]=v):v=t[12];const y=v;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[te()],t[13]=C):C=t[13];const S=C;let b;t[14]!==m.create||t[15]!==o?(b=async N=>{const A=await m.create.mutateAsync(N);o(A.id)},t[14]=m.create,t[15]=o,t[16]=b):b=t[16];const P=b;let j;t[17]!==d?(j=new Set(d.map(ze)),t[17]=d,t[18]=j):j=t[18];const x=j;let w;t[19]!==x||t[20]!==y?(w=y.filter(N=>N.id&&!x.has(N.id)),t[19]=x,t[20]=y,t[21]=w):w=t[21];const E=w;let k;t[22]!==x?(k=S.filter(N=>N.id&&!x.has(N.id)),t[22]=x,t[23]=k):k=t[23];const R=k;if(h){let N;return t[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(X,{}),t[24]=N):N=t[24],N}let I;t[25]!==P?(I=async N=>P(N),t[25]=P,t[26]=I):I=t[26];let T;t[27]!==E||t[28]!==u||t[29]!==c||t[30]!==o||t[31]!==I?(T=s.jsx(se,{title:"Store",ctaButton:s.jsx(Ae,{wellKnownRegistries:E,registries:c,value:u,onValueChange:o,onAddWellKnown:I,placeholder:"Select store..."})}),t[27]=E,t[28]=u,t[29]=c,t[30]=o,t[31]=I,t[32]=T):T=t[32];let K;t[33]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=K):K=t[33];let $;t[34]!==R||t[35]!==u||t[36]!==o?($=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(_.Suspense,{fallback:K,children:u?s.jsx(Ke,{registryId:u}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(_e,{registries:R,onConnected:N=>{o(N)}})})})}),t[34]=R,t[35]=u,t[36]=o,t[37]=$):$=t[37];let O;return t[38]!==T||t[39]!==$?(O=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[T,$]}),t[38]=T,t[39]=$,t[40]=O):O=t[40],O}function ze(t){return t.id}function Be(){return""}function Ve(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{ut as default};
|
|
1
|
+
import{b5 as W,b6 as z,b7 as Q,b8 as U,b9 as H,ba as G,c as L,j as s,r as _,a5 as Y,a2 as q,a as J,bb as Z,ao as X}from"./index-B__VUTR3.js";import{g as ee,a as te}from"./well-known-mcp-Dg77mwx9.js";import{C as se}from"./collection-header-B74HL_BQ.js";import{I as ie,a as ne,c as re,d as V,b as le}from"./use-connection-DFfxu6G-.js";import{a as oe,T as ae,b as ce,u as D}from"./tooltip-B5bMdg-c.js";import{s as de}from"./slugify-CEUa2lfQ.js";import{I as M}from"./icon-BH0uQy8Q.js";import{C as me}from"./collection-search-5_31uFQu.js";import{C as fe}from"./card-CQxotwMu.js";import{g as ue,f as he,a as xe}from"./registry-utils-ulDDT0d8.js";import{e as ge}from"./app-name-gTETL9So.js";import{d as pe,a as ve,S as je,b as Ne,c as ye}from"./select-8hQIWu_F.js";import{C as Ce}from"./connection-card-FqjC5vzz.js";import{B as be}from"./button-BKI-GQNs.js";import{E as we}from"./empty-state-BdQaURkL.js";import{a as Se}from"./use-binding-n0fop-6Q.js";import{L as Pe,u as Re}from"./localstorage-keys-DCgXaWMK.js";import"./collection-display-button-DiJzMYDw.js";import"./dropdown-menu-CtyYPfMS.js";import"./utils-wGs-tBy0.js";import"./input-DQSvL_aO.js";import"./auth-BjEJS-ti.js";import"./useQuery-DSEkiaNM.js";var Ie=class extends W{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:z()})}getOptimisticResult(t){return t.behavior=z(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:n}=t,m=super.createResult(t,e),{isFetching:l,isRefetching:h,isError:d,isRefetchError:a}=m,c=n.fetchMeta?.fetchMore?.direction,i=d&&c==="forward",r=l&&c==="forward",o=d&&c==="backward",f=l&&c==="backward";return{...m,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:U(e,n.data),hasPreviousPage:Q(e,n.data),isFetchNextPageError:i,isFetchingNextPage:r,isFetchPreviousPageError:o,isFetchingPreviousPage:f,isRefetchError:a&&!i&&!o,isRefetching:h&&!r&&!f}}};function Ee(t,e){return H({...t,enabled:!0,suspense:!0,throwOnError:G},Ie,e)}function ke(t){const e=t.title||t.server.title||t.id||"Unnamed Item",n=t.server.description||null,m=t.server.icons?.[0]?.src||ue(t.server.repository)||null,l=t._meta?.["mcp.mesh"]?.verified??!1,h=t.server.version,a=(t.server.remotes?.length??0)>0;let c=e,i=null;if(e.includes("/")){const r=e.split("/");r.length>=2&&(i=r[0]||null,c=ge(e))}if(!i){const r=t._meta?.["mcp.mesh"]?.scopeName,o=t._meta?.["mcp.mesh"]?.appName;r&&o?i=`${r}/${o}`:r&&(i=r)}return{icon:m,scopeName:i,displayName:c,description:n,version:h||null,isVerified:l,canInstall:a}}function Te(t){const e=L.c(39),{icon:n,scopeName:m,displayName:l,description:h,isVerified:d,canInstall:a,onClick:c}=t;let i;e[0]!==l||e[1]!==n?(i=s.jsx(ie,{icon:n,name:l,size:"md",className:"shadow-sm"}),e[0]=l,e[1]=n,e[2]=i):i=e[2];let r;e[3]!==l?(r=s.jsx("span",{className:"truncate",children:l}),e[3]=l,e[4]=r):r=e[4];let o;e[5]!==d?(o=d&&s.jsx(M,{name:"verified",size:16,className:"text-success shrink-0"}),e[5]=d,e[6]=o):o=e[6];let f;e[7]!==a?(f=!a&&s.jsx(M,{name:"lock",size:16,className:"text-muted-foreground shrink-0",title:"This MCP Server cannot be connected"}),e[7]=a,e[8]=f):f=e[8];let g;e[9]!==r||e[10]!==o||e[11]!==f?(g=s.jsx(oe,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-medium min-w-0",children:[r,o,f]})}),e[9]=r,e[10]=o,e[11]=f,e[12]=g):g=e[12];let u;e[13]!==l?(u=s.jsx("p",{children:l}),e[13]=l,e[14]=u):u=e[14];let p;e[15]!==a?(p=!a&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=a,e[16]=p):p=e[16];let v;e[17]!==u||e[18]!==p?(v=s.jsxs(ae,{children:[u,p]}),e[17]=u,e[18]=p,e[19]=v):v=e[19];let y;e[20]!==g||e[21]!==v?(y=s.jsxs(ce,{children:[g,v]}),e[20]=g,e[21]=v,e[22]=y):y=e[22];let C;e[23]!==m?(C=m&&s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:m}),e[23]=m,e[24]=C):C=e[24];let S;e[25]!==C||e[26]!==y?(S=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[y,C]})}),e[25]=C,e[26]=y,e[27]=S):S=e[27];let b;e[28]!==i||e[29]!==S?(b=s.jsxs("div",{className:"flex gap-3",children:[i,S]}),e[28]=i,e[29]=S,e[30]=b):b=e[30];const P=h||"No description available";let j;e[31]!==P?(j=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:P})}),e[31]=P,e[32]=j):j=e[32];let x;e[33]!==b||e[34]!==j?(x=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[b,j]}),e[33]=b,e[34]=j,e[35]=x):x=e[35];let w;return e[36]!==c||e[37]!==x?(w=s.jsx(fe,{className:"p-6 cursor-pointer hover:bg-muted/50 transition-colors",onClick:c,children:x}),e[36]=c,e[37]=x,e[38]=w):w=e[38],w}function B(t){const e=L.c(12),{items:n,title:m,onItemClick:l}=t;if(n.length===0)return null;let h;e[0]!==m?(h=m&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:m})}),e[0]=m,e[1]=h):h=e[1];let d;if(e[2]!==n||e[3]!==l){let i;e[5]!==l?(i=r=>{const o=ke(r);return s.jsx(Te,{...o,onClick:()=>l(r)},r.id)},e[5]=l,e[6]=i):i=e[6],d=n.map(i),e[2]=n,e[3]=l,e[4]=d}else d=e[4];let a;e[7]!==d?(a=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:d}),e[7]=d,e[8]=a):a=e[8];let c;return e[9]!==h||e[10]!==a?(c=s.jsxs("div",{className:"flex flex-col gap-4",children:[h,a]}),e[9]=h,e[10]=a,e[11]=c):c=e[11],c}function Me(t,e){if(!e)return t;const n=e.toLowerCase();return t.filter(m=>(m.name||m.title||"").toLowerCase().includes(n)||(m.description||m.server.description||"").toLowerCase().includes(n))}function Le(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function $e(t){const e=L.c(32),{items:n,isLoadingMore:m,registryId:l,hasMore:h,onLoadMore:d}=t,a=m===void 0?!1:m,c=h===void 0?!1:h,[i,r]=_.useState(""),o=Y(),{org:f}=D(),g=_.useRef(null);let u,p,v;e[0]!==n||e[1]!==i?(u=Me(n,i),v=u.filter(Le),p=u.filter(R=>!v.find(I=>I.id===R.id)),e[0]=n,e[1]=i,e[2]=u,e[3]=p,e[4]=v):(u=e[2],p=e[3],v=e[4]);const y=p;let C;e[5]!==o||e[6]!==f.slug||e[7]!==l?(C=R=>{const I=de(R.name||R.title||R.server.title||""),T=R.server.name;o({to:"/$org/store/$appName",params:{org:f.slug,appName:I},search:{registryId:l,serverName:T}})},e[5]=o,e[6]=f.slug,e[7]=l,e[8]=C):C=e[8];const S=C;let b;e[9]!==c||e[10]!==a||e[11]!==d||e[12]!==i?(b=R=>{if(!c||!d||i||a)return;const I=R.currentTarget;I.scrollHeight-I.scrollTop-I.clientHeight<200&&d()},e[9]=c,e[10]=a,e[11]=d,e[12]=i,e[13]=b):b=e[13];const P=b;let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=R=>{R.key==="Enter"&&r(R.currentTarget.value)},e[14]=j):j=e[14];let x;e[15]!==i?(x=s.jsx(me,{value:i,onChange:r,placeholder:"Search for an MCP Server...",onKeyDown:j}),e[15]=i,e[16]=x):x=e[16];let w;e[17]!==y||e[18]!==u||e[19]!==S||e[20]!==c||e[21]!==a||e[22]!==n.length||e[23]!==i||e[24]!==v?(w=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:n.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(M,{name:"inbox",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."})]}):i&&u.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(M,{name:"search",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:[v.length>0&&s.jsx(B,{items:v,title:"Verified",onItemClick:S}),y.length>0&&s.jsx(B,{items:y,title:v.length>0?"All":"",onItemClick:S}),c&&!i&&a&&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(M,{name:"progress_activity",size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=y,e[18]=u,e[19]=S,e[20]=c,e[21]=a,e[22]=n.length,e[23]=i,e[24]=v,e[25]=w):w=e[25];let E;e[26]!==P||e[27]!==w?(E=s.jsx("div",{ref:g,className:"flex-1 overflow-y-auto",onScroll:P,children:w}),e[26]=P,e[27]=w,e[28]=E):E=e[28];let k;return e[29]!==x||e[30]!==E?(k=s.jsxs("div",{className:"flex flex-col h-full",children:[x,E]}),e[29]=x,e[30]=E,e[31]=k):k=e[31],k}const F=24;function Ke(t){const e=L.c(27),{registryId:n}=t,m=ne(n);let l,h,d,a;if(e[0]!==m?.tools||e[1]!==n){if(l=he(m?.tools),!l)throw new Error("This registry does not support listing store items.");let x;e[6]!==n?(x=re(n),e[6]=n,e[7]=x):x=e[7],a=x,d=Ee,h=q.toolCall(n,l,JSON.stringify({limit:F})),e[0]=m?.tools,e[1]=n,e[2]=l,e[3]=h,e[4]=d,e[5]=a}else l=e[2],h=e[3],d=e[4],a=e[5];let c;e[8]!==l||e[9]!==a?(c=async x=>{const{pageParam:w}=x;return await a(l,w?{cursor:w,limit:F}:{limit:F})},e[8]=l,e[9]=a,e[10]=c):c=e[10];let i;e[11]!==h||e[12]!==c?(i={queryKey:h,queryFn:c,initialPageParam:void 0,getNextPageParam:Oe,staleTime:36e5},e[11]=h,e[12]=c,e[13]=i):i=e[13];const{data:r,fetchNextPage:o,hasNextPage:f,isFetchingNextPage:g}=d(i);let u;e:{if(!r?.pages||r.pages.length===0){u=null;break e}const x=r.pages[0];if(typeof x=="object"&&x!==null&&"totalCount"in x&&typeof x.totalCount=="number"){u=x.totalCount;break e}u=null}const p=u,v=r?.pages;let y;e[14]!==v?(y=xe(v),e[14]=v,e[15]=y):y=e[15];const C=y;let S;e[16]!==o||e[17]!==f||e[18]!==g?(S=()=>{f&&!g&&o()},e[16]=o,e[17]=f,e[18]=g,e[19]=S):S=e[19];const b=S,P=f??!1;let j;return e[20]!==C||e[21]!==b||e[22]!==g||e[23]!==n||e[24]!==P||e[25]!==p?(j=s.jsx($e,{items:C,isLoadingMore:g,registryId:n,hasMore:P,onLoadMore:b,totalCount:p}),e[20]=C,e[21]=b,e[22]=g,e[23]=n,e[24]=P,e[25]=p,e[26]=j):j=e[26],j}function Oe(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Ae(t){const e=L.c(15),{registries:n,value:m,onValueChange:l,onAddWellKnown:h,wellKnownRegistries:d,placeholder:a}=t,c=a===void 0?"Select a registry...":a;let i;e[0]!==c?(i=s.jsx(ve,{className:"w-[200px] h-8!",children:s.jsx(je,{placeholder:c})}),e[0]=c,e[1]=i):i=e[1];let r;e[2]!==n?(r=n.map(Fe),e[2]=n,e[3]=r):r=e[3];let o;e[4]!==h||e[5]!==d?(o=d.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"}),d.map(u=>s.jsxs("button",{onClick:p=>{p.preventDefault(),p.stopPropagation(),h(u)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-xl 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:[u.icon?s.jsx("img",{src:u.icon,alt:u.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:u.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:u.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(M,{name:"add",size:16})})]},u.id??u.title))]}),e[4]=h,e[5]=d,e[6]=o):o=e[6];let f;e[7]!==r||e[8]!==o?(f=s.jsxs(Ne,{children:[r,o]}),e[7]=r,e[8]=o,e[9]=f):f=e[9];let g;return e[10]!==l||e[11]!==i||e[12]!==f||e[13]!==m?(g=s.jsxs(ye,{value:m,onValueChange:l,children:[i,f]}),e[10]=l,e[11]=i,e[12]=f,e[13]=m,e[14]=g):g=e[14],g}function Fe(t){return s.jsx(pe,{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 _e(t){const e=L.c(13),{registries:n,onConnected:m}=t,l=n.length===1;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:423,height:279,className:"max-w-full h-auto"}),e[0]=h):h=e[0];const d=l?"Connect to registry":"Connect to a store",a=l?"Connect to discover and use MCP Servers from the community.":"Choose a registry to discover and connect MCP Servers from the community.",c=`grid gap-4 w-full ${l?"grid-cols-1 justify-items-center":"grid-cols-1 md:grid-cols-2"}`;let i;if(e[1]!==m||e[2]!==n){let f;e[4]!==m?(f=(g,u)=>{const p=g.id??`registry-${u}`;return s.jsx(De,{registry:{...g,id:p},onConnected:m},p)},e[4]=m,e[5]=f):f=e[5],i=n.map(f),e[1]=m,e[2]=n,e[3]=i}else i=e[3];let r;e[6]!==c||e[7]!==i?(r=s.jsx("div",{className:c,children:i}),e[6]=c,e[7]=i,e[8]=r):r=e[8];let o;return e[9]!==d||e[10]!==a||e[11]!==r?(o=s.jsx(we,{image:h,title:d,description:a,descriptionClassName:"max-w-[500px]",actionsClassName:"w-full max-w-2xl",actions:r}),e[9]=d,e[10]=a,e[11]=r,e[12]=o):o=e[12],o}function De(t){const e=L.c(15),{registry:n,onConnected:m}=t,l=V(),{org:h}=D(),{data:d}=J.useSession(),a=!!h&&!!d?.user?.id;let c;e[0]!==l.create||e[1]!==a||e[2]!==m||e[3]!==n?(c=async()=>{if(!a)return;const u=await l.create.mutateAsync(n);m?.(u.id)},e[0]=l.create,e[1]=a,e[2]=m,e[3]=n,e[4]=c):c=e[4];const i=c,r=!a||l.create.isPending;let o;e[5]!==l.create.isPending?(o=l.create.isPending?s.jsxs(s.Fragment,{children:[s.jsx(M,{name:"progress_activity",className:"animate-spin"}),"Connecting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(M,{name:"add"}),"Connect"]}),e[5]=l.create.isPending,e[6]=o):o=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==o?(f=s.jsx(be,{variant:"outline",className:"w-full",disabled:r,onClick:i,children:o}),e[7]=i,e[8]=r,e[9]=o,e[10]=f):f=e[10];let g;return e[11]!==i||e[12]!==n||e[13]!==f?(g=s.jsx(Ce,{connection:n,onClick:i,footer:f,className:"transition-all hover:border-primary/50 hover:shadow-md"}),e[11]=i,e[12]=n,e[13]=f,e[14]=g):g=e[14],g}function ut(){const t=L.c(41),{org:e}=D(),n=le(),m=V(),l=Z(),h=l.location.pathname.includes("/store/")&&l.location.pathname.split("/").length>3,d=Se(n);let a;t[0]!==d?(a=d.map(Ve),t[0]=d,t[1]=a):a=t[1];const c=a;let i;t[2]!==e.slug?(i=Pe.selectedRegistry(e.slug),t[2]=e.slug,t[3]=i):i=t[3];const[r,o]=Re(i,Be);let f;if(t[4]!==d||t[5]!==r){let N;t[7]!==r?(N=A=>A.id===r,t[7]=r,t[8]=N):N=t[8],f=d.find(N),t[4]=d,t[5]=r,t[6]=f}else f=t[6];const u=f?.id||d[0]?.id||"";let p;t[9]!==e.id?(p=ee(e.id),t[9]=e.id,t[10]=p):p=t[10];let v;t[11]!==p?(v=[p],t[11]=p,t[12]=v):v=t[12];const y=v;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[te()],t[13]=C):C=t[13];const S=C;let b;t[14]!==m.create||t[15]!==o?(b=async N=>{const A=await m.create.mutateAsync(N);o(A.id)},t[14]=m.create,t[15]=o,t[16]=b):b=t[16];const P=b;let j;t[17]!==d?(j=new Set(d.map(ze)),t[17]=d,t[18]=j):j=t[18];const x=j;let w;t[19]!==x||t[20]!==y?(w=y.filter(N=>N.id&&!x.has(N.id)),t[19]=x,t[20]=y,t[21]=w):w=t[21];const E=w;let k;t[22]!==x?(k=S.filter(N=>N.id&&!x.has(N.id)),t[22]=x,t[23]=k):k=t[23];const R=k;if(h){let N;return t[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(X,{}),t[24]=N):N=t[24],N}let I;t[25]!==P?(I=async N=>P(N),t[25]=P,t[26]=I):I=t[26];let T;t[27]!==E||t[28]!==u||t[29]!==c||t[30]!==o||t[31]!==I?(T=s.jsx(se,{title:"Store",ctaButton:s.jsx(Ae,{wellKnownRegistries:E,registries:c,value:u,onValueChange:o,onAddWellKnown:I,placeholder:"Select store..."})}),t[27]=E,t[28]=u,t[29]=c,t[30]=o,t[31]=I,t[32]=T):T=t[32];let K;t[33]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(M,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=K):K=t[33];let $;t[34]!==R||t[35]!==u||t[36]!==o?($=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(_.Suspense,{fallback:K,children:u?s.jsx(Ke,{registryId:u}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(_e,{registries:R,onConnected:N=>{o(N)}})})})}),t[34]=R,t[35]=u,t[36]=o,t[37]=$):$=t[37];let O;return t[38]!==T||t[39]!==$?(O=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[T,$]}),t[38]=T,t[39]=$,t[40]=O):O=t[40],O}function ze(t){return t.id}function Be(){return""}function Ve(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{ut as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,j as s,bc as we,r as le,a5 as be,d as Ce,b as Te,a as _e,a6 as ge}from"./index-tTqkKQJp.js";import{I}from"./icon-Dk3IUZlY.js";import{B as ie}from"./button-7f3mJDt9.js";import{I as ve,d as ke,b as Se,a as Ie,c as Ae}from"./use-connection-CJdd9H8R.js";import{b as Le,D as De,a as Me,c as Ee}from"./dropdown-menu-Dsh1FAHq.js";import{E as Ue}from"./empty-state-CLlWeA8F.js";import{R as Ve,T as Pe,a as Re}from"./resource-tabs-Dr8QbV0u.js";import{a as $e}from"./use-binding-C_9S-BsF.js";import{u as ze}from"./use-tool-call-CXd8t6dd.js";import{u as Be}from"./use-mcp-qYkX8fe3.js";import{u as je}from"./tooltip-DG1xYIL4.js";import{e as Ge}from"./extract-connection-data-Bubi-83r.js";import{s as Fe}from"./slugify-CEUa2lfQ.js";import{f as Oe,e as He,b as We,c as Ke,g as qe}from"./registry-utils-ulDDT0d8.js";import{e as Je}from"./app-name-gTETL9So.js";import"./utils-D4LuHWBB.js";import"./useQuery-DcphYrFi.js";import"./collection-display-button-yCMREeFw.js";import"./collection-search-Blu2oI67.js";import"./input-DsJLZuBe.js";import"./collection-table-wrapper-D77XIcPK.js";import"./card-C-FxKc9h.js";import"./layout-7tvwsBuE.js";import"./badge-BWSVXk6u.js";import"./auth-Cf-BfTK3.js";import"./generate-id-Dyweu44Y.js";function Qe(t){const e=A.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(I,{name:"progress_activity",size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function Xe(t){const e=A.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(I,{name:"error",size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function Ye(t){const e=A.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(I,{name:"search_off",size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=d):d=e[4],d}function Ze(t){const e=A.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function et(t){const e=A.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=le.useState(0);let x;e[0]!==r?(x=k=>{p(k),r(k)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ve,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(I,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs(Le,{children:[s.jsx(De,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(I,{name:"expand_more",size:20})})}),s.jsx(Me,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((k,C)=>{const S=k._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Ee,{onClick:()=>f(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",k.server?.version||"unknown"]}),S?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(I,{name:"check_circle",size:16,className:"text-muted-foreground shrink-0"})]})},C)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(I,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let w;e[19]!==y||e[20]!==N?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=w):w=e[21];let _;return e[22]!==h||e[23]!==w?(_=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,w]}),e[22]=h,e[23]=w,e[24]=_):_=e[24],_}function tt(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function st(t){const e=A.c(45),{data:o,publisherInfo:n,selectedItem:r}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ve,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(I,{name:"open_in_new",size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let w;e[27]!==o.repository?(w=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(I,{name:"open_in_new",size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let _;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(_=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,w]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=w,e[34]=_):_=e[34];let k;e[35]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=k):k=e[35];let C;e[36]!==r.updated_at?(C=tt(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let S;e[38]!==C?(S=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[k,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=S):S=e[39];let u;return e[40]!==i||e[41]!==_||e[42]!==S||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,_,S]}),e[40]=i,e[41]=_,e[42]=S,e[43]=h,e[44]=u):u=e[44],u}function ot(t){const e=A.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(rt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Ve,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(I,{name:"progress_activity",size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Pe,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Ue,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Re,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function rt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function nt(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function it(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function lt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=We(r.remotes?.[0]?.type),d=Ke(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=qe(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:Je(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class at extends le.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(Xe,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ct(){const t=A.c(70),{org:e}=je(),o=be();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=Ce(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Te(i),[l,m]=le.useState("readme"),p=ke(),x=Se(),{data:f}=_e.useSession(),h=$e(x),g=d||h[0]?.id||"",b=Ie(g),y=Oe(b?.tools),N=b?.tools&&b.tools.find(pt)?.name||"",w=b?.tools&&b.tools.find(ut)?.name||"",_=Ae(g),k=!!a;let C,S;k?(C=N||w,S={name:a}):(C=y,S={});const{data:u}=ze({toolCaller:_,toolName:C,toolInputParams:S,scope:g});let E=[],L=[],xe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(xe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",U=c.server,V=c._meta;let M;t[2]!==c.title||t[3]!==T||t[4]!==U||t[5]!==V?(M=[{id:T,title:c.title,server:U,_meta:V}],t[2]=c.title,t[3]=T,t[4]=U,t[5]=V,t[6]=M):M=t[6],E=M}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(T=>Array.isArray(u[T])),c&&(E=u[c],(c==="versions"||C?.includes("VERSIONS"))&&(L=E))}}let Y;t[7]!==r?(Y=c=>{const T=c.name||c.title||c.server.title||"";return Fe(T)===r},t[7]=r,t[8]=Y):Y=t[8];let j=E.find(Y);if(!j&&a){let c;t[9]!==a?(c=T=>T.server.name===a||T.name===a||T.title===a,t[9]=a,t[10]=c):c=t[10],j=E.find(c)}const v=j?lt(j):null,ae=(v?.tools?.length||0)>0,ce=j?.server?.remotes?.[0]?.url||null,Q=!ae&&!!ce,X=Be({url:Q?ce:""}),Z=Q&&X.state==="connecting";let ee;t[11]!==X||t[12]!==Q?(ee=Q&&X.state==="ready"?(X.tools||[]).map(ft):[],t[11]=X,t[12]=Q,t[13]=ee):ee=t[13];const he=ee,P=ae?v?.tools||[]:he,ye=nt(x,v?.publisher),de=v?it(E,v.publisher,ye,b??null,xe):{count:0},Ne=v?.repository?He(v.repository):null,me=!!v?.repository&&!!Ne;let R;t[14]!==me?(R={id:"readme",label:"README",visible:me},t[14]=me,t[15]=R):R=t[15];const fe=ae||he.length>0||Z&&!!ce;let $;t[16]!==P.length||t[17]!==fe?($={id:"tools",label:"Tools",count:P.length,visible:fe},t[16]=P.length,t[17]=fe,t[18]=$):$=t[18];let te;t[19]!==R||t[20]!==$?(te=[R,$].filter(mt),t[19]=R,t[20]=$,t[21]=te):te=t[21];const D=te;let se;t[22]!==l||t[23]!==D?(se=D.find(c=>c.id===l)?l:D.find(dt)?.id||D[0]?.id||"overview",t[22]=l,t[23]=D,t[24]=se):se=t[24];const ue=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const T=L[c??0]||j;if(!T||!e||!f?.user?.id)return;const U=Ge(T,e.id,f.user.id);if(!U.connection_url){ge.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await p.create.mutateAsync(U);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const M=V;ge.error(`Failed to connect MCP Server: ${M instanceof Error?M.message:String(M)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const pe=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const z=re;if(!j){let c;return t[35]!==z?(c=s.jsx(Ye,{onBack:z}),t[35]=z,t[36]=c):c=t[36],c}if(!v)return null;const B=(j?.server?.remotes?.length??0)>0;let G;t[37]!==z?(G=s.jsx(Ze,{onBack:z}),t[37]=z,t[38]=G):G=t[38];let F;t[39]!==B?(F=!B&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(I,{name:"info",size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=B,t[40]=F):F=t[40];let O;t[41]!==L||t[42]!==j?(O=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=O):O=t[43];let H;t[44]!==p.create.isPending||t[45]!==B||t[46]!==v||t[47]!==pe||t[48]!==O?(H=s.jsx(et,{data:v,itemVersions:O,onInstall:pe,canInstall:B,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=B,t[46]=v,t[47]=pe,t[48]=O,t[49]=H):H=t[49];let W;t[50]!==v||t[51]!==de||t[52]!==j?(W=s.jsx(st,{data:v,publisherInfo:de,selectedItem:j}),t[50]=v,t[51]=de,t[52]=j,t[53]=W):W=t[53];let K;t[54]!==D||t[55]!==v||t[56]!==ue||t[57]!==P||t[58]!==Z?(K=s.jsx(ot,{data:v,availableTabs:D,effectiveActiveTabId:ue,effectiveTools:P,isLoadingTools:Z,onTabChange:m}),t[54]=D,t[55]=v,t[56]=ue,t[57]=P,t[58]=Z,t[59]=K):K=t[59];let q;t[60]!==W||t[61]!==K?(q=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[W,K]}),t[60]=W,t[61]=K,t[62]=q):q=t[62];let J;t[63]!==F||t[64]!==H||t[65]!==q?(J=s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[F,H,q]})})}),t[63]=F,t[64]=H,t[65]=q,t[66]=J):J=t[66];let ne;return t[67]!==G||t[68]!==J?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,J]}),t[67]=G,t[68]=J,t[69]=ne):ne=t[69],ne}function dt(t){return t.id==="readme"}function mt(t){return t.visible}function ft(t){return{name:t.name,description:t.description}}function ut(t){return t.name.endsWith("_GET")}function pt(t){return t.name.endsWith("_VERSIONS")}function Bt(){const t=A.c(6),{org:e}=je(),o=be();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(le.Suspense,{fallback:s.jsx(Qe,{}),children:s.jsx(ct,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(at,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{Bt as default};
|
|
1
|
+
import{c as A,j as s,bc as we,r as le,a5 as be,d as Ce,b as Te,a as _e,a6 as ge}from"./index-B__VUTR3.js";import{I}from"./icon-BH0uQy8Q.js";import{B as ie}from"./button-BKI-GQNs.js";import{I as ve,d as ke,b as Se,a as Ie,c as Ae}from"./use-connection-DFfxu6G-.js";import{b as Le,D as De,a as Me,c as Ee}from"./dropdown-menu-CtyYPfMS.js";import{E as Ue}from"./empty-state-BdQaURkL.js";import{R as Ve,T as Pe,a as Re}from"./resource-tabs-C38lAnf7.js";import{a as $e}from"./use-binding-n0fop-6Q.js";import{u as ze}from"./use-tool-call-Ck95V-cD.js";import{u as Be}from"./use-mcp-DfzSXo3r.js";import{u as je}from"./tooltip-B5bMdg-c.js";import{e as Ge}from"./extract-connection-data-BmRyJSV5.js";import{s as Fe}from"./slugify-CEUa2lfQ.js";import{f as Oe,e as He,b as We,c as Ke,g as qe}from"./registry-utils-ulDDT0d8.js";import{e as Je}from"./app-name-gTETL9So.js";import"./utils-wGs-tBy0.js";import"./useQuery-DSEkiaNM.js";import"./collection-display-button-DiJzMYDw.js";import"./collection-search-5_31uFQu.js";import"./input-DQSvL_aO.js";import"./collection-table-wrapper-Cexc-Pdz.js";import"./card-CQxotwMu.js";import"./layout-tP8VoWYn.js";import"./badge-DVddOuDf.js";import"./auth-BjEJS-ti.js";import"./generate-id-Dyweu44Y.js";function Qe(t){const e=A.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(I,{name:"progress_activity",size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function Xe(t){const e=A.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(I,{name:"error",size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function Ye(t){const e=A.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(I,{name:"search_off",size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=d):d=e[4],d}function Ze(t){const e=A.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function et(t){const e=A.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=le.useState(0);let x;e[0]!==r?(x=k=>{p(k),r(k)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ve,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(I,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs(Le,{children:[s.jsx(De,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(I,{name:"expand_more",size:20})})}),s.jsx(Me,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((k,C)=>{const S=k._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Ee,{onClick:()=>f(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",k.server?.version||"unknown"]}),S?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(I,{name:"check_circle",size:16,className:"text-muted-foreground shrink-0"})]})},C)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(I,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let w;e[19]!==y||e[20]!==N?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=w):w=e[21];let _;return e[22]!==h||e[23]!==w?(_=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,w]}),e[22]=h,e[23]=w,e[24]=_):_=e[24],_}function tt(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function st(t){const e=A.c(45),{data:o,publisherInfo:n,selectedItem:r}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ve,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(I,{name:"open_in_new",size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let w;e[27]!==o.repository?(w=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(I,{name:"open_in_new",size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let _;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(_=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,w]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=w,e[34]=_):_=e[34];let k;e[35]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=k):k=e[35];let C;e[36]!==r.updated_at?(C=tt(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let S;e[38]!==C?(S=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[k,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=S):S=e[39];let u;return e[40]!==i||e[41]!==_||e[42]!==S||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,_,S]}),e[40]=i,e[41]=_,e[42]=S,e[43]=h,e[44]=u):u=e[44],u}function ot(t){const e=A.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(rt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Ve,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(I,{name:"progress_activity",size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Pe,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Ue,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Re,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function rt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function nt(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function it(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function lt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=We(r.remotes?.[0]?.type),d=Ke(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=qe(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:Je(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class at extends le.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(Xe,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ct(){const t=A.c(70),{org:e}=je(),o=be();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=Ce(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Te(i),[l,m]=le.useState("readme"),p=ke(),x=Se(),{data:f}=_e.useSession(),h=$e(x),g=d||h[0]?.id||"",b=Ie(g),y=Oe(b?.tools),N=b?.tools&&b.tools.find(pt)?.name||"",w=b?.tools&&b.tools.find(ut)?.name||"",_=Ae(g),k=!!a;let C,S;k?(C=N||w,S={name:a}):(C=y,S={});const{data:u}=ze({toolCaller:_,toolName:C,toolInputParams:S,scope:g});let E=[],L=[],xe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(xe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",U=c.server,V=c._meta;let M;t[2]!==c.title||t[3]!==T||t[4]!==U||t[5]!==V?(M=[{id:T,title:c.title,server:U,_meta:V}],t[2]=c.title,t[3]=T,t[4]=U,t[5]=V,t[6]=M):M=t[6],E=M}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(T=>Array.isArray(u[T])),c&&(E=u[c],(c==="versions"||C?.includes("VERSIONS"))&&(L=E))}}let Y;t[7]!==r?(Y=c=>{const T=c.name||c.title||c.server.title||"";return Fe(T)===r},t[7]=r,t[8]=Y):Y=t[8];let j=E.find(Y);if(!j&&a){let c;t[9]!==a?(c=T=>T.server.name===a||T.name===a||T.title===a,t[9]=a,t[10]=c):c=t[10],j=E.find(c)}const v=j?lt(j):null,ae=(v?.tools?.length||0)>0,ce=j?.server?.remotes?.[0]?.url||null,Q=!ae&&!!ce,X=Be({url:Q?ce:""}),Z=Q&&X.state==="connecting";let ee;t[11]!==X||t[12]!==Q?(ee=Q&&X.state==="ready"?(X.tools||[]).map(ft):[],t[11]=X,t[12]=Q,t[13]=ee):ee=t[13];const he=ee,P=ae?v?.tools||[]:he,ye=nt(x,v?.publisher),de=v?it(E,v.publisher,ye,b??null,xe):{count:0},Ne=v?.repository?He(v.repository):null,me=!!v?.repository&&!!Ne;let R;t[14]!==me?(R={id:"readme",label:"README",visible:me},t[14]=me,t[15]=R):R=t[15];const fe=ae||he.length>0||Z&&!!ce;let $;t[16]!==P.length||t[17]!==fe?($={id:"tools",label:"Tools",count:P.length,visible:fe},t[16]=P.length,t[17]=fe,t[18]=$):$=t[18];let te;t[19]!==R||t[20]!==$?(te=[R,$].filter(mt),t[19]=R,t[20]=$,t[21]=te):te=t[21];const D=te;let se;t[22]!==l||t[23]!==D?(se=D.find(c=>c.id===l)?l:D.find(dt)?.id||D[0]?.id||"overview",t[22]=l,t[23]=D,t[24]=se):se=t[24];const ue=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const T=L[c??0]||j;if(!T||!e||!f?.user?.id)return;const U=Ge(T,e.id,f.user.id);if(!U.connection_url){ge.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await p.create.mutateAsync(U);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const M=V;ge.error(`Failed to connect MCP Server: ${M instanceof Error?M.message:String(M)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const pe=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const z=re;if(!j){let c;return t[35]!==z?(c=s.jsx(Ye,{onBack:z}),t[35]=z,t[36]=c):c=t[36],c}if(!v)return null;const B=(j?.server?.remotes?.length??0)>0;let G;t[37]!==z?(G=s.jsx(Ze,{onBack:z}),t[37]=z,t[38]=G):G=t[38];let F;t[39]!==B?(F=!B&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(I,{name:"info",size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=B,t[40]=F):F=t[40];let O;t[41]!==L||t[42]!==j?(O=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=O):O=t[43];let H;t[44]!==p.create.isPending||t[45]!==B||t[46]!==v||t[47]!==pe||t[48]!==O?(H=s.jsx(et,{data:v,itemVersions:O,onInstall:pe,canInstall:B,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=B,t[46]=v,t[47]=pe,t[48]=O,t[49]=H):H=t[49];let W;t[50]!==v||t[51]!==de||t[52]!==j?(W=s.jsx(st,{data:v,publisherInfo:de,selectedItem:j}),t[50]=v,t[51]=de,t[52]=j,t[53]=W):W=t[53];let K;t[54]!==D||t[55]!==v||t[56]!==ue||t[57]!==P||t[58]!==Z?(K=s.jsx(ot,{data:v,availableTabs:D,effectiveActiveTabId:ue,effectiveTools:P,isLoadingTools:Z,onTabChange:m}),t[54]=D,t[55]=v,t[56]=ue,t[57]=P,t[58]=Z,t[59]=K):K=t[59];let q;t[60]!==W||t[61]!==K?(q=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[W,K]}),t[60]=W,t[61]=K,t[62]=q):q=t[62];let J;t[63]!==F||t[64]!==H||t[65]!==q?(J=s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[F,H,q]})})}),t[63]=F,t[64]=H,t[65]=q,t[66]=J):J=t[66];let ne;return t[67]!==G||t[68]!==J?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,J]}),t[67]=G,t[68]=J,t[69]=ne):ne=t[69],ne}function dt(t){return t.id==="readme"}function mt(t){return t.visible}function ft(t){return{name:t.name,description:t.description}}function ut(t){return t.name.endsWith("_GET")}function pt(t){return t.name.endsWith("_VERSIONS")}function Bt(){const t=A.c(6),{org:e}=je(),o=be();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(le.Suspense,{fallback:s.jsx(Qe,{}),children:s.jsx(ct,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(at,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{Bt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,ax as T,j as i,au as C,aM as y,at as I,av as M,by as z,bz as H,c as A}from"./index-
|
|
1
|
+
import{r as c,ax as T,j as i,au as C,aM as y,at as I,av as M,by as z,bz as H,c as A}from"./index-B__VUTR3.js";import{c as g}from"./utils-wGs-tBy0.js";var m="Switch",[U]=T(m),[q,L]=U(m),E=c.forwardRef((s,e)=>{const{__scopeSwitch:t,name:r,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=s,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=I({prop:a,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:M(s.onClick,b=>{N(B=>!B),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((s,e)=>{const{__scopeSwitch:t,...r}=s,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:s,control:e,checked:t,bubbles:r=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=z(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(s){return s?"checked":"unchecked"}var $=E,D=R;function X(s){const e=A.c(9);let t,r;e[0]!==s?({className:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...r,children:n}),e[6]=r,e[7]=a,e[8]=o):o=e[8],o}export{X as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,j as n}from"./index-
|
|
1
|
+
import{c as o,j as n}from"./index-B__VUTR3.js";import{c as l}from"./utils-wGs-tBy0.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,c as E,j as t}from"./index-
|
|
1
|
+
import{r as v,c as E,j as t}from"./index-B__VUTR3.js";import{I as z,b as R}from"./use-connection-DFfxu6G-.js";import{C as F}from"./checkbox-DXOKpcZ0.js";import{B as A}from"./button-BKI-GQNs.js";import{I as U}from"./icon-BH0uQy8Q.js";import{c as T}from"./utils-wGs-tBy0.js";import{C as V}from"./collection-search-5_31uFQu.js";const q=v.memo(function(S){const e=E.c(21),{connection:o,isSelected:m,hasToolsEnabled:r,activeToolsCount:h,totalToolsCount:p,onSelect:g,onToggle:u}=S,x=m?"bg-accent/50":"hover:bg-muted/50";let i;e[0]!==x?(i=T("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",x),e[0]=x,e[1]=i):i=e[1];let c;e[2]!==o.icon||e[3]!==o.title?(c=t.jsx(z,{icon:o.icon,name:o.title,size:"xs"}),e[2]=o.icon,e[3]=o.title,e[4]=c):c=e[4];let f;e[5]!==o.title?(f=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),e[5]=o.title,e[6]=f):f=e[6];let n;e[7]!==g||e[8]!==c||e[9]!==f?(n=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[c,f]}),e[7]=g,e[8]=c,e[9]=f,e[10]=n):n=e[10];let a;e[11]!==h||e[12]!==o.tools||e[13]!==r||e[14]!==u||e[15]!==p?(a=o.tools&&o.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[h,"/",p]}),t.jsx(F,{checked:r,onCheckedChange:u,onClick:H})]}),e[11]=h,e[12]=o.tools,e[13]=r,e[14]=u,e[15]=p,e[16]=a):a=e[16];let N;return e[17]!==i||e[18]!==n||e[19]!==a?(N=t.jsxs("div",{className:i,children:[n,a]}),e[17]=i,e[18]=n,e[19]=a,e[20]=N):N=e[20],N}),G=v.memo(function(S){const e=E.c(18),{connectionId:o,tool:m,isSelected:r,onToggle:h}=S,p=`tool-${o}-${m.name}`,g=r?"text-foreground":"text-muted-foreground";let u;e[0]!==g?(u=T("text-sm font-medium",g),e[0]=g,e[1]=u):u=e[1];let x;e[2]!==u||e[3]!==m.name?(x=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:u,children:m.name})}),e[2]=u,e[3]=m.name,e[4]=x):x=e[4];let i;e[5]!==m.description?(i=m.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:m.description}),e[5]=m.description,e[6]=i):i=e[6];let c;e[7]!==x||e[8]!==i?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[x,i]}),e[7]=x,e[8]=i,e[9]=c):c=e[9];const f=`tool-${o}-${m.name}`;let n;e[10]!==r||e[11]!==h||e[12]!==f?(n=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(F,{id:f,checked:r,onCheckedChange:h,onClick:J})}),e[10]=r,e[11]=h,e[12]=f,e[13]=n):n=e[13];let a;return e[14]!==p||e[15]!==c||e[16]!==n?(a=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:p,children:[c,n]}),e[14]=p,e[15]=c,e[16]=n,e[17]=a):a=e[17],a});function ee({toolSet:d,onToolSetChange:S}){const[e,o]=v.useState(""),m=v.useDeferredValue(e),[r,h]=v.useState("all"),[p,g]=v.useState(!1),u=v.useRef(new Set(Object.keys(d))),x=R({searchTerm:m.trim()||void 0}),i=u.current,c=[...i.values()].map(s=>x.find(l=>l.id===s)).filter(s=>s!==void 0),f=x.filter(s=>!i.has(s.id)),n=[...c,...f],a=s=>{const l=d[s];return l!==void 0&&l.length>0},N=n.filter(s=>{if(r==="all")return!0;const l=a(s.id);return r==="selected"?l:r==="unselected"?!l:!0}),[I,M]=v.useState(n[0]?.id??null),b=I?n.find(s=>s.id===I)??null:null,$=b?.tools??[],B=(s,l)=>d[s]?.includes(l)??!1,D=(s,l)=>{const j=d[s]??[],y=j.includes(l),w={...d};if(y){const k=j.filter(C=>C!==l);k.length===0?delete w[s]:w[s]=k}else w[s]=[...j,l];S(w)},O=s=>{const l=n.find(C=>C.id===s);if(!l?.tools)return;const j=d[s]??[],y=l.tools.map(C=>C.name),w=j.length>0&&y.every(C=>j.includes(C)),k={...d};w?delete k[s]:(k[s]=y,M(s)),S(k)},P=s=>{M(s),g(!0)},Q=()=>{g(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:T("w-full md:w-80 border-r border-border flex flex-col",p&&"hidden md:flex"),children:[t.jsx(V,{value:e,onChange:o,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>h("all"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>h("selected"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>h("unselected"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:N.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:N.map(s=>{const l=s.tools?.length??0,j=d[s.id]?.length??0;return t.jsx(q,{connection:s,isSelected:I===s.id,hasToolsEnabled:a(s.id),activeToolsCount:j,totalToolsCount:l,onSelect:()=>P(s.id),onToggle:()=>O(s.id)},s.id)})})})]}),t.jsx("div",{className:T("flex-1 flex-col",p?"flex":"hidden md:flex"),children:b?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(A,{variant:"ghost",size:"sm",onClick:Q,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(U,{name:"arrow_back",size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(z,{icon:b.icon,name:b.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.title}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:b.description})]})]})]}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:$.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):t.jsx("div",{className:"space-y-2",children:$.map(s=>t.jsx(G,{connectionId:b.id,tool:s,isSelected:B(b.id,s.name),onToggle:()=>D(b.id,s.name)},s.name))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function H(d){return d.stopPropagation()}function J(d){return d.stopPropagation()}export{ee as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as d,au as $,c as j,ax as te,aN as G,aT as oe,aP as U,aZ as re,a_ as ne,bS as se,aM as V,aS as ae,av as y,aR as ie,at as le,aQ as ce,a$ as ue}from"./index-tTqkKQJp.js";import{c as de}from"./utils-D4LuHWBB.js";var pe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fe="VisuallyHidden",B=a.forwardRef((t,e)=>d.jsx($.span,{...t,ref:e,style:{...pe,...t.style}}));B.displayName=fe;var ve=B;const M="org-admin",xe={from({org:t,project:e}){if(t.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${t}/${e}`},parse(t){t.startsWith("/")&&(t=t.slice(1));const[e,o]=t.split("/");if(!e||!o)throw new Error("Invalid locator");return{org:e,project:o}},isOrgAdminProject(t){return t.split("/")[1]===M},adminProject(t){return`${t}/${M}`}},F=a.createContext(void 0),Fe=()=>{const t=a.useContext(F);if(!t)throw new Error("useProjectContext must be used within a ProjectContextProvider");return t},ze=t=>{const e=j.c(10),{children:o,org:r,project:n}=t;let s;e[0]!==r.slug||e[1]!==n.slug?(s=xe.from({org:r.slug,project:n.slug}),e[0]=r.slug,e[1]=n.slug,e[2]=s):s=e[2];const l=s;let c;e[3]!==l||e[4]!==r||e[5]!==n?(c={org:r,project:n,locator:l},e[3]=l,e[4]=r,e[5]=n,e[6]=c):c=e[6];const i=c;let u;return e[7]!==o||e[8]!==i?(u=d.jsx(F.Provider,{value:i,children:o}),e[7]=o,e[8]=i,e[9]=u):u=e[9],u};const he=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ge=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),H=t=>{const e=ge(t);return e.charAt(0).toUpperCase()+e.slice(1)},z=(...t)=>t.filter((e,o,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===o).join(" ").trim();var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ce=a.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:n="",children:s,iconNode:l,...c},i)=>a.createElement("svg",{ref:i,...me,width:e,height:e,stroke:t,strokeWidth:r?Number(o)*24/Number(e):o,className:z("lucide",n),...c},[...l.map(([u,p])=>a.createElement(u,p)),...Array.isArray(s)?s:[s]]));const Ye=(t,e)=>{const o=a.forwardRef(({className:r,...n},s)=>a.createElement(Ce,{ref:s,iconNode:e,className:z(`lucide-${he(H(t))}`,`lucide-${t}`,r),...n}));return o.displayName=H(t),o};var[O]=te("Tooltip",[U]),L=U(),Y="TooltipProvider",Te=700,A="tooltip.open",[ye,k]=O(Y),W=t=>{const{__scopeTooltip:e,delayDuration:o=Te,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=t,l=a.useRef(!0),c=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const u=i.current;return()=>window.clearTimeout(u)},[]),d.jsx(ye,{scope:e,isOpenDelayedRef:l,delayDuration:o,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(u=>{c.current=u},[]),disableHoverableContent:n,children:s})};W.displayName=Y;var R="Tooltip",[we,_]=O(R),Z=t=>{const{__scopeTooltip:e,children:o,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,i=k(R,t.__scopeTooltip),u=L(e),[p,v]=a.useState(null),x=ie(),f=a.useRef(0),h=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[T,C]=le({prop:r,defaultProp:n??!1,onChange:S=>{S?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(S)},caller:R}),b=a.useMemo(()=>T?g.current?"delayed-open":"instant-open":"closed",[T]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,C(!0)},[C]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,C(!1)},[C]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,C(!0),f.current=0},m)},[m,C]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ce,{...u,children:d.jsx(we,{scope:e,contentId:x,open:T,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{h?E():(window.clearTimeout(f.current),f.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:o})})};Z.displayName=R;var D="TooltipTrigger",q=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=_(D,o),s=k(D,o),l=L(o),c=a.useRef(null),i=V(e,c,n.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),v=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(ae,{asChild:!0,...l,children:d.jsx($.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:y(t.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:y(t.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:y(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:y(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:y(t.onBlur,n.onClose),onClick:y(t.onClick,n.onClose)})})});q.displayName=D;var N="TooltipPortal",[be,Pe]=O(N,{forceMount:void 0}),K=t=>{const{__scopeTooltip:e,forceMount:o,children:r,container:n}=t,s=_(N,e);return d.jsx(be,{scope:e,forceMount:o,children:d.jsx(G,{present:o||s.open,children:d.jsx(oe,{asChild:!0,container:n,children:r})})})};K.displayName=N;var w="TooltipContent",X=a.forwardRef((t,e)=>{const o=Pe(w,t.__scopeTooltip),{forceMount:r=o.forceMount,side:n="top",...s}=t,l=_(w,t.__scopeTooltip);return d.jsx(G,{present:r||l.open,children:l.disableHoverableContent?d.jsx(J,{side:n,...s,ref:e}):d.jsx(Ee,{side:n,...s,ref:e})})}),Ee=a.forwardRef((t,e)=>{const o=_(w,t.__scopeTooltip),r=k(w,t.__scopeTooltip),n=a.useRef(null),s=V(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=o,p=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((h,m)=>{const g=h.currentTarget,T={x:h.clientX,y:h.clientY},C=Oe(T,g.getBoundingClientRect()),b=Le(T,C),P=Ae(m.getBoundingClientRect()),E=ke([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&p){const h=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[i,p,f,x]),a.useEffect(()=>{if(l){const h=m=>{const g=m.target,T={x:m.clientX,y:m.clientY},C=i?.contains(g)||p?.contains(g),b=!De(T,l);C?x():b&&(x(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,p,l,u,x]),d.jsx(J,{...t,ref:s})}),[Re,je]=O(R,{isInside:!1}),_e=se("TooltipContent"),J=a.forwardRef((t,e)=>{const{__scopeTooltip:o,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,i=_(w,o),u=L(o),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(A,p),()=>document.removeEventListener(A,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(ne,{"data-state":i.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(_e,{children:r}),d.jsx(Re,{scope:o,isInside:!0,children:d.jsx(ve,{id:i.contentId,role:"tooltip",children:n||r})})]})})});X.displayName=w;var Q="TooltipArrow",ee=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=L(o);return je(Q,o).isInside?null:d.jsx(ue,{...n,...r,ref:e})});ee.displayName=Q;function Oe(t,e){const o=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(o,r,n,s)){case s:return"left";case n:return"right";case o:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Le(t,e,o=5){const r=[];switch(e){case"top":r.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":r.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":r.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":r.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return r}function Ae(t){const{top:e,right:o,bottom:r,left:n}=t;return[{x:n,y:e},{x:o,y:e},{x:o,y:r},{x:n,y:r}]}function De(t,e){const{x:o,y:r}=t;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],i=e[l],u=c.x,p=c.y,v=i.x,x=i.y;p>r!=x>r&&o<(v-u)*(r-p)/(x-p)+u&&(n=!n)}return n}function ke(t){const e=t.slice();return e.sort((o,r)=>o.x<r.x?-1:o.x>r.x?1:o.y<r.y?-1:o.y>r.y?1:0),Ne(e)}function Ne(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const n=t[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const o=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;o.length>=2;){const s=o[o.length-1],l=o[o.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))o.pop();else break}o.push(n)}return o.pop(),e.length===1&&o.length===1&&e[0].x===o[0].x&&e[0].y===o[0].y?e:e.concat(o)}var Ie=W,Se=Z,Me=q,He=K,$e=X,Ge=ee;function Ue(t){const e=j.c(6);let o,r;e[0]!==t?({delayDuration:r,...o}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==o?(s=d.jsx(Ie,{"data-slot":"tooltip-provider",delayDuration:n,...o}),e[3]=n,e[4]=o,e[5]=s):s=e[5],s}function We(t){const e=j.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=d.jsx(Ue,{children:d.jsx(Se,{"data-slot":"tooltip",...o})}),e[2]=o,e[3]=r):r=e[3],r}function Ze(t){const e=j.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=d.jsx(Me,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function qe(t){const e=j.c(13);let o,r,n,s;e[0]!==t?({className:r,sideOffset:s,children:o,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=de("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=c):c=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ge,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let u;return e[8]!==o||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(He,{children:d.jsxs($e,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[o,i]})}),e[8]=o,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}export{xe as L,M as O,ze as P,qe as T,pe as V,Ze as a,We as b,Ye as c,Ue as d,Fe as u};
|
|
1
|
+
import{r as a,j as d,au as $,c as j,ax as te,aN as G,aT as oe,aP as U,aZ as re,a_ as ne,bS as se,aM as V,aS as ae,av as y,aR as ie,at as le,aQ as ce,a$ as ue}from"./index-B__VUTR3.js";import{c as de}from"./utils-wGs-tBy0.js";var pe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fe="VisuallyHidden",B=a.forwardRef((t,e)=>d.jsx($.span,{...t,ref:e,style:{...pe,...t.style}}));B.displayName=fe;var ve=B;const M="org-admin",xe={from({org:t,project:e}){if(t.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${t}/${e}`},parse(t){t.startsWith("/")&&(t=t.slice(1));const[e,o]=t.split("/");if(!e||!o)throw new Error("Invalid locator");return{org:e,project:o}},isOrgAdminProject(t){return t.split("/")[1]===M},adminProject(t){return`${t}/${M}`}},F=a.createContext(void 0),Fe=()=>{const t=a.useContext(F);if(!t)throw new Error("useProjectContext must be used within a ProjectContextProvider");return t},ze=t=>{const e=j.c(10),{children:o,org:r,project:n}=t;let s;e[0]!==r.slug||e[1]!==n.slug?(s=xe.from({org:r.slug,project:n.slug}),e[0]=r.slug,e[1]=n.slug,e[2]=s):s=e[2];const l=s;let c;e[3]!==l||e[4]!==r||e[5]!==n?(c={org:r,project:n,locator:l},e[3]=l,e[4]=r,e[5]=n,e[6]=c):c=e[6];const i=c;let u;return e[7]!==o||e[8]!==i?(u=d.jsx(F.Provider,{value:i,children:o}),e[7]=o,e[8]=i,e[9]=u):u=e[9],u};const he=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ge=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),H=t=>{const e=ge(t);return e.charAt(0).toUpperCase()+e.slice(1)},z=(...t)=>t.filter((e,o,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===o).join(" ").trim();var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ce=a.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:n="",children:s,iconNode:l,...c},i)=>a.createElement("svg",{ref:i,...me,width:e,height:e,stroke:t,strokeWidth:r?Number(o)*24/Number(e):o,className:z("lucide",n),...c},[...l.map(([u,p])=>a.createElement(u,p)),...Array.isArray(s)?s:[s]]));const Ye=(t,e)=>{const o=a.forwardRef(({className:r,...n},s)=>a.createElement(Ce,{ref:s,iconNode:e,className:z(`lucide-${he(H(t))}`,`lucide-${t}`,r),...n}));return o.displayName=H(t),o};var[O]=te("Tooltip",[U]),L=U(),Y="TooltipProvider",Te=700,A="tooltip.open",[ye,k]=O(Y),W=t=>{const{__scopeTooltip:e,delayDuration:o=Te,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=t,l=a.useRef(!0),c=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const u=i.current;return()=>window.clearTimeout(u)},[]),d.jsx(ye,{scope:e,isOpenDelayedRef:l,delayDuration:o,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(u=>{c.current=u},[]),disableHoverableContent:n,children:s})};W.displayName=Y;var R="Tooltip",[we,_]=O(R),Z=t=>{const{__scopeTooltip:e,children:o,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,i=k(R,t.__scopeTooltip),u=L(e),[p,v]=a.useState(null),x=ie(),f=a.useRef(0),h=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[T,C]=le({prop:r,defaultProp:n??!1,onChange:S=>{S?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(S)},caller:R}),b=a.useMemo(()=>T?g.current?"delayed-open":"instant-open":"closed",[T]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,C(!0)},[C]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,C(!1)},[C]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,C(!0),f.current=0},m)},[m,C]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ce,{...u,children:d.jsx(we,{scope:e,contentId:x,open:T,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{h?E():(window.clearTimeout(f.current),f.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:o})})};Z.displayName=R;var D="TooltipTrigger",q=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=_(D,o),s=k(D,o),l=L(o),c=a.useRef(null),i=V(e,c,n.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),v=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(ae,{asChild:!0,...l,children:d.jsx($.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:y(t.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:y(t.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:y(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:y(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:y(t.onBlur,n.onClose),onClick:y(t.onClick,n.onClose)})})});q.displayName=D;var N="TooltipPortal",[be,Pe]=O(N,{forceMount:void 0}),K=t=>{const{__scopeTooltip:e,forceMount:o,children:r,container:n}=t,s=_(N,e);return d.jsx(be,{scope:e,forceMount:o,children:d.jsx(G,{present:o||s.open,children:d.jsx(oe,{asChild:!0,container:n,children:r})})})};K.displayName=N;var w="TooltipContent",X=a.forwardRef((t,e)=>{const o=Pe(w,t.__scopeTooltip),{forceMount:r=o.forceMount,side:n="top",...s}=t,l=_(w,t.__scopeTooltip);return d.jsx(G,{present:r||l.open,children:l.disableHoverableContent?d.jsx(J,{side:n,...s,ref:e}):d.jsx(Ee,{side:n,...s,ref:e})})}),Ee=a.forwardRef((t,e)=>{const o=_(w,t.__scopeTooltip),r=k(w,t.__scopeTooltip),n=a.useRef(null),s=V(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=o,p=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((h,m)=>{const g=h.currentTarget,T={x:h.clientX,y:h.clientY},C=Oe(T,g.getBoundingClientRect()),b=Le(T,C),P=Ae(m.getBoundingClientRect()),E=ke([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&p){const h=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[i,p,f,x]),a.useEffect(()=>{if(l){const h=m=>{const g=m.target,T={x:m.clientX,y:m.clientY},C=i?.contains(g)||p?.contains(g),b=!De(T,l);C?x():b&&(x(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,p,l,u,x]),d.jsx(J,{...t,ref:s})}),[Re,je]=O(R,{isInside:!1}),_e=se("TooltipContent"),J=a.forwardRef((t,e)=>{const{__scopeTooltip:o,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,i=_(w,o),u=L(o),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(A,p),()=>document.removeEventListener(A,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(ne,{"data-state":i.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(_e,{children:r}),d.jsx(Re,{scope:o,isInside:!0,children:d.jsx(ve,{id:i.contentId,role:"tooltip",children:n||r})})]})})});X.displayName=w;var Q="TooltipArrow",ee=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=L(o);return je(Q,o).isInside?null:d.jsx(ue,{...n,...r,ref:e})});ee.displayName=Q;function Oe(t,e){const o=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(o,r,n,s)){case s:return"left";case n:return"right";case o:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Le(t,e,o=5){const r=[];switch(e){case"top":r.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":r.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":r.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":r.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return r}function Ae(t){const{top:e,right:o,bottom:r,left:n}=t;return[{x:n,y:e},{x:o,y:e},{x:o,y:r},{x:n,y:r}]}function De(t,e){const{x:o,y:r}=t;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],i=e[l],u=c.x,p=c.y,v=i.x,x=i.y;p>r!=x>r&&o<(v-u)*(r-p)/(x-p)+u&&(n=!n)}return n}function ke(t){const e=t.slice();return e.sort((o,r)=>o.x<r.x?-1:o.x>r.x?1:o.y<r.y?-1:o.y>r.y?1:0),Ne(e)}function Ne(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const n=t[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const o=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;o.length>=2;){const s=o[o.length-1],l=o[o.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))o.pop();else break}o.push(n)}return o.pop(),e.length===1&&o.length===1&&e[0].x===o[0].x&&e[0].y===o[0].y?e:e.concat(o)}var Ie=W,Se=Z,Me=q,He=K,$e=X,Ge=ee;function Ue(t){const e=j.c(6);let o,r;e[0]!==t?({delayDuration:r,...o}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==o?(s=d.jsx(Ie,{"data-slot":"tooltip-provider",delayDuration:n,...o}),e[3]=n,e[4]=o,e[5]=s):s=e[5],s}function We(t){const e=j.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=d.jsx(Ue,{children:d.jsx(Se,{"data-slot":"tooltip",...o})}),e[2]=o,e[3]=r):r=e[3],r}function Ze(t){const e=j.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=d.jsx(Me,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function qe(t){const e=j.c(13);let o,r,n,s;e[0]!==t?({className:r,sideOffset:s,children:o,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=de("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=c):c=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ge,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let u;return e[8]!==o||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(He,{children:d.jsxs($e,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[o,i]})}),e[8]=o,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}export{xe as L,M as O,ze as P,qe as T,pe as V,Ze as a,We as b,Ye as c,Ue as d,Fe as u};
|