@decocms/mesh 1.0.0-alpha.41 → 1.0.0-alpha.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/client/assets/{AlertCircle-D6ztaobt.js → AlertCircle-D8keEzKG.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CjVyVt-H.js → ArrowLeft-ALWG7VDf.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DgunLZQR.js → CheckCircle-D36cNDna.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BbXb_40w.js → ChevronDown-Cm9t42v8.js} +1 -1
  5. package/dist/client/assets/{Clock-YTJnTBDI.js → Clock-CmEgvKtS.js} +1 -1
  6. package/dist/client/assets/{Copy01-CCevdGb6.js → Copy01-ByJnMw1O.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-CTGBZdsr.js → CpuChip02-CON88pJ9.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-DWgbGhdO.js → DotsVertical-Bl5bEEk5.js} +1 -1
  9. package/dist/client/assets/{File06-CRfao4L4.js → File06-aktnYzlw.js} +1 -1
  10. package/dist/client/assets/{Grid01-S3S2kEug.js → Grid01-CMcq9qMK.js} +1 -1
  11. package/dist/client/assets/{Inbox01-CdZg2SI6.js → Inbox01-CDP4Xvq8.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-CEqhPApg.js → InfoCircle-Dj48FaPG.js} +1 -1
  13. package/dist/client/assets/{Key01-7zjlT7bl.js → Key01-DUuXuIEi.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-Zdv63NPa.js → LinkExternal01-DD1V7jlt.js} +1 -1
  15. package/dist/client/assets/{Loading01-CNHBx4kI.js → Loading01-CHuzyTrw.js} +1 -1
  16. package/dist/client/assets/{Plus-DfnNWvZl.js → Plus-DsLFvXGg.js} +1 -1
  17. package/dist/client/assets/{SearchMd-DBUkNw9d.js → SearchMd-AkbTxzGe.js} +1 -1
  18. package/dist/client/assets/{Trash01-CC4RWtjd.js → Trash01-Dy-SjaGQ.js} +1 -1
  19. package/dist/client/assets/{Upload01-ZzW7ToAX.js → Upload01-D6dc6enb.js} +1 -1
  20. package/dist/client/assets/{X-CmV6VETi.js → X-C4DsqTZD.js} +1 -1
  21. package/dist/client/assets/{XClose-C_Ro2jwa.js → XClose-RibbcNd2.js} +1 -1
  22. package/dist/client/assets/{alert-dialog-DKN25P9n.js → alert-dialog-Di6ShLn9.js} +3 -3
  23. package/dist/client/assets/{auth-y34g-zyR.js → auth-D5CL68LS.js} +1 -1
  24. package/dist/client/assets/{auth-catchall-wEPMHcQu.js → auth-catchall-D9jFZcp2.js} +1 -1
  25. package/dist/client/assets/{avatar-D6wdL-4h.js → avatar-DCq0OD4f.js} +1 -1
  26. package/dist/client/assets/{badge-D5IC8-XQ.js → badge-Cxx1Sxkf.js} +1 -1
  27. package/dist/client/assets/{button-n-dnBUcs.js → button-DyxbcOso.js} +1 -1
  28. package/dist/client/assets/{card--RtELIXA.js → card-E0A-GI_K.js} +1 -1
  29. package/dist/client/assets/{checkbox-ByvFrlEw.js → checkbox-D_hM8b8h.js} +1 -1
  30. package/dist/client/assets/collection-detail-BUkQA_DU.js +1 -0
  31. package/dist/client/assets/{collection-display-button-BziK2H4v.js → collection-display-button-BweLYsfq.js} +1 -1
  32. package/dist/client/assets/{collection-header-AOGSaKJV.js → collection-header-Bameh_eh.js} +1 -1
  33. package/dist/client/assets/{collection-page-Dx7W84ZY.js → collection-page-BHSRRg3H.js} +1 -1
  34. package/dist/client/assets/{collection-search-D33egpeg.js → collection-search-gavQJPP4.js} +1 -1
  35. package/dist/client/assets/{collection-table-wrapper-BWoWsFFZ.js → collection-table-wrapper-BpS-68hf.js} +1 -1
  36. package/dist/client/assets/{connection-card-BPbF-94Z.js → connection-card-BVk7kFmW.js} +1 -1
  37. package/dist/client/assets/{connection-detail-CwV1WRCA.js → connection-detail-DddBMHPf.js} +1 -1
  38. package/dist/client/assets/connections-B1rZil2n.js +1 -0
  39. package/dist/client/assets/{core-BhcYClLI.js → core-ByNFtKK6.js} +1 -1
  40. package/dist/client/assets/{create-organization-dialog-CJOAZXZ4.js → create-organization-dialog-2urgxKJd.js} +1 -1
  41. package/dist/client/assets/{deco-chat-skeleton-DgwTbso-.js → deco-chat-skeleton-DPM9016H.js} +39 -39
  42. package/dist/client/assets/{dialog-Dn--K_0P.js → dialog-fscHVB6N.js} +1 -1
  43. package/dist/client/assets/{dropdown-menu-DSDzjgEf.js → dropdown-menu-PdTp4dEf.js} +1 -1
  44. package/dist/client/assets/{error-boundary-kZqJcvYt.js → error-boundary-B2cVFy_k.js} +1 -1
  45. package/dist/client/assets/{extract-connection-data-PMNMoMwh.js → extract-connection-data-DYfXaCx-.js} +1 -1
  46. package/dist/client/assets/{form-BSFKQpec.js → form-DzRrgnqZ.js} +1 -1
  47. package/dist/client/assets/{formatDistanceToNow-Mwdq3o1w.js → formatDistanceToNow-BUS4qZ3y.js} +1 -1
  48. package/dist/client/assets/{gateway-detail-DOneoUn2.js → gateway-detail-CNtXr5hn.js} +1 -1
  49. package/dist/client/assets/{gateways-CjpiwVjc.js → gateways-B0oJ21bg.js} +1 -1
  50. package/dist/client/assets/{home-M1jCNsQa.js → home-CbM5g6hK.js} +1 -1
  51. package/dist/client/assets/{index-Bg7J5oIq.js → index-BfBFtyJG.js} +1 -1
  52. package/dist/client/assets/{index-DDrssUsd.js → index-BoajXOR2.js} +2 -2
  53. package/dist/client/assets/{index-CXP-3IgR.js → index-CLk7USHu.js} +1 -1
  54. package/dist/client/assets/{index-C_LVkq3-.js → index-Dw2USDt7.js} +1 -1
  55. package/dist/client/assets/index-MyldRbGR.css +1 -0
  56. package/dist/client/assets/{input-8OLj0EZ_.js → input-ZwYzWYsd.js} +1 -1
  57. package/dist/client/assets/json-shDxh9VI.js +1 -0
  58. package/dist/client/assets/{json-syntax-highlighter-DefdwgI_.js → json-syntax-highlighter-CBCsDrbN.js} +2 -2
  59. package/dist/client/assets/{layout-BlymenNb.js → layout-qWjUAxmx.js} +1 -1
  60. package/dist/client/assets/{lazy-highlighter-DB5NDxPR.js → lazy-highlighter-CeR79qlP.js} +1 -1
  61. package/dist/client/assets/{localstorage-keys-CKN9Xi55.js → localstorage-keys-Cc5ak95E.js} +1 -1
  62. package/dist/client/assets/{login-sBeHDiTP.js → login-Dzk1B1b-.js} +1 -1
  63. package/dist/client/assets/{mcp-oauth-2aNbgRyW.js → mcp-oauth-AZGWVH9g.js} +1 -1
  64. package/dist/client/assets/{members-6chwwhsu.js → members-CCwAaAHQ.js} +1 -1
  65. package/dist/client/assets/{monitoring-Cb6EoA-b.js → monitoring-D3prTzA_.js} +1 -1
  66. package/dist/client/assets/{oauth-callback-DAWi3xsa.js → oauth-callback-C7HHguix.js} +1 -1
  67. package/dist/client/assets/{page-BZMAJRR4.js → page-R6pHknz0.js} +1 -1
  68. package/dist/client/assets/{popover-CgBSUikh.js → popover-C2ZTLfkD.js} +1 -1
  69. package/dist/client/assets/prism-light-C5gubXs2.js +1 -0
  70. package/dist/client/assets/{resource-tabs-DfS272DC.js → resource-tabs-C4ib9Qer.js} +1 -1
  71. package/dist/client/assets/{schema-CcHURukQ.js → schema-DBCaYNfa.js} +1 -1
  72. package/dist/client/assets/{select-D032IwwR.js → select-Drv0jNpx.js} +1 -1
  73. package/dist/client/assets/{settings-CdDiUrft.js → settings-48kN1cjt.js} +1 -1
  74. package/dist/client/assets/shell-layout-Cltos3LX.js +17 -0
  75. package/dist/client/assets/{spinner-CnnM_4YL.js → spinner-pWVeZvIu.js} +1 -1
  76. package/dist/client/assets/{store-PUlSXJGE.js → store-CUS-2is6.js} +1 -1
  77. package/dist/client/assets/{store-app-detail-C7BmJzlu.js → store-app-detail-BJWFOzEW.js} +1 -1
  78. package/dist/client/assets/{switch-y8R7z10u.js → switch-BhPZG_BR.js} +1 -1
  79. package/dist/client/assets/{textarea-BFoLEajE.js → textarea-CBwsqq0a.js} +1 -1
  80. package/dist/client/assets/{tools-list-DoiOjPde.js → tools-list-BMljmspA.js} +1 -1
  81. package/dist/client/assets/{tooltip-CScUy2XK.js → tooltip-CTZbNNnK.js} +1 -1
  82. package/dist/client/assets/{types-xAaKjcGO.js → types-B0kyZijl.js} +1 -1
  83. package/dist/client/assets/{use-binding-Csa06z5J.js → use-binding-DsbURj3b.js} +1 -1
  84. package/dist/client/assets/{use-connection-DrLts5Bh.js → use-connection-BaSQ_kK7.js} +1 -1
  85. package/dist/client/assets/{use-gateway-D8DNYcSu.js → use-gateway-BFmqlcff.js} +1 -1
  86. package/dist/client/assets/{use-list-state-XxCjYHe0.js → use-list-state-DOX95Ml_.js} +1 -1
  87. package/dist/client/assets/{use-mcp-8IvMYP4j.js → use-mcp-BI87vr5V.js} +1 -1
  88. package/dist/client/assets/{use-members-BpQaxhYw.js → use-members-D8yePFg4.js} +1 -1
  89. package/dist/client/assets/{use-mobile-D-4KOtW8.js → use-mobile-BKS-qB3Y.js} +1 -1
  90. package/dist/client/assets/{use-organization-settings-DFt-PXFE.js → use-organization-settings-CfuafopH.js} +1 -1
  91. package/dist/client/assets/use-tool-call-CoSkJnqm.js +1 -0
  92. package/dist/client/assets/useQuery-SxQZJ5cp.js +1 -0
  93. package/dist/client/assets/utils-Dvu_Dkg0.js +1 -0
  94. package/dist/client/assets/{well-known-mcp-DyxrC_Rx.js → well-known-mcp-D7YKD5ci.js} +1 -1
  95. package/dist/client/index.html +2 -2
  96. package/dist/server/cli.js +1 -1
  97. package/dist/server/migrate.js +1 -1
  98. package/dist/server/server.js +1 -1
  99. package/package.json +1 -1
  100. package/dist/client/assets/collection-detail-CBSvkQ-g.js +0 -1
  101. package/dist/client/assets/connections-D2Osqpr9.js +0 -1
  102. package/dist/client/assets/index-DPE8fUfl.css +0 -1
  103. package/dist/client/assets/json-_ojk50i2.js +0 -1
  104. package/dist/client/assets/prism-light-B2_4LIBk.js +0 -1
  105. package/dist/client/assets/shell-layout-BrTksREn.js +0 -17
  106. package/dist/client/assets/use-tool-call-Ega50w5M.js +0 -1
  107. package/dist/client/assets/useQuery-iHOeESxa.js +0 -1
  108. package/dist/client/assets/utils-BNxGaTF3.js +0 -1
@@ -1 +1 @@
1
- import{r as q,c as _,j as s,g as ve,d as ke,b as Se,a as Ie,t as he}from"./index-DDrssUsd.js";import{i as _e}from"./AlertCircle-D6ztaobt.js";import{i as je}from"./Loading01-CNHBx4kI.js";import{B as ie}from"./button-n-dnBUcs.js";import{i as Le}from"./ArrowLeft-CjVyVt-H.js";import{I as ye,a as Ae,u as De,b as Ee,c as Me}from"./use-connection-DrLts5Bh.js";import{i as Ue}from"./CheckCircle-DgunLZQR.js";import{t as Ve}from"./ChevronDown-BbXb_40w.js";import{s as ge}from"./Plus-DfnNWvZl.js";import{b as $e,D as Re,a as Pe,c as ze}from"./dropdown-menu-DSDzjgEf.js";import{n as be}from"./LinkExternal01-Zdv63NPa.js";import{E as Be}from"./SearchMd-DBUkNw9d.js";import{T as Ge,R as Fe}from"./tools-list-DoiOjPde.js";import{R as Oe}from"./resource-tabs-DfS272DC.js";import{a as He}from"./use-binding-Csa06z5J.js";import{u as We}from"./use-tool-call-Ega50w5M.js";import{u as Ke}from"./use-mcp-8IvMYP4j.js";import{u as Ne}from"./tooltip-CScUy2XK.js";import{e as Ze}from"./extract-connection-data-PMNMoMwh.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{f as Je,e as Qe,b as Xe,c as Ye,g as et}from"./registry-utils-ulDDT0d8.js";import{e as tt}from"./app-name-gTETL9So.js";import{i as st}from"./InfoCircle-CEqhPApg.js";import"./utils-BNxGaTF3.js";import"./Grid01-S3S2kEug.js";import"./useQuery-iHOeESxa.js";import"./File06-CRfao4L4.js";import"./collection-display-button-BziK2H4v.js";import"./collection-search-D33egpeg.js";import"./input-8OLj0EZ_.js";import"./collection-table-wrapper-BWoWsFFZ.js";import"./card--RtELIXA.js";import"./layout-BlymenNb.js";import"./badge-D5IC8-XQ.js";import"./auth-y34g-zyR.js";import"./generate-id-Dyweu44Y.js";const we=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));we.displayName="SearchLg";function ot(t){const e=_.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(je,{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 rt(t){const e=_.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(_e,{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 nt(t){const e=_.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{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 it(t){const e=_.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Le,{}),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 lt(t){const e=_.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]=q.useState(0);let x;e[0]!==r?(x=S=>{p(S),r(S)},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(ye,{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(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs($e,{children:[s.jsx(Re,{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(Ve,{size:20})})}),s.jsx(Pe,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((S,C)=>{const I=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(ze,{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",S.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(Ue,{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(ge,{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 k;return e[22]!==h||e[23]!==w?(k=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]=k):k=e[24],k}function at(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 ct(t){const e=_.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(ye,{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(be,{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(be,{size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let k;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(k=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]=k):k=e[34];let S;e[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=S):S=e[35];let C;e[36]!==r.updated_at?(C=at(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let I;e[38]!==C?(I=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[S,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=I):I=e[39];let u;return e[40]!==i||e[41]!==k||e[42]!==I||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,k,I]}),e[40]=i,e[41]=k,e[42]=I,e[43]=h,e[44]=u):u=e[44],u}function dt(t){const e=_.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(mt),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(Oe,{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(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Be,{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(Fe,{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 mt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ft(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 ut(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 pt(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=Xe(r.remotes?.[0]?.type),d=Ye(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=et(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:tt(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 xt extends q.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(rt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ht(){const t=_.c(70),{org:e}=Ne(),o=ve();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=ke(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}=Se(i),[l,m]=q.useState("readme"),p=Ae(),x=De(),{data:f}=Ie.useSession(),h=He(x),g=d||h[0]?.id||"",b=Ee(g),y=Je(b?.tools),N=b?.tools&&b.tools.find(yt)?.name||"",w=b?.tools&&b.tools.find(jt)?.name||"",k=Me(g),S=!!a;let C,I;S?(C=N||w,I={name:a}):(C=y,I={});const{data:u}=We({toolCaller:k,toolName:C,toolInputParams:I,scope:g});let E=[],L=[],pe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(pe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",M=c.server,U=c._meta;let D;t[2]!==c.title||t[3]!==T||t[4]!==M||t[5]!==U?(D=[{id:T,title:c.title,server:M,_meta:U}],t[2]=c.title,t[3]=T,t[4]=M,t[5]=U,t[6]=D):D=t[6],E=D}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 X;t[7]!==r?(X=c=>{const T=c.name||c.title||c.server.title||"";return qe(T)===r},t[7]=r,t[8]=X):X=t[8];let j=E.find(X);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?pt(j):null,le=(v?.tools?.length||0)>0,ae=j?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ke({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(vt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const xe=ee,V=le?v?.tools||[]:xe,Ce=ft(x,v?.publisher),ce=v?ut(E,v.publisher,Ce,b??null,pe):{count:0},Te=v?.repository?Qe(v.repository):null,de=!!v?.repository&&!!Te;let $;t[14]!==de?($={id:"readme",label:"README",visible:de},t[14]=de,t[15]=$):$=t[15];const me=le||xe.length>0||Y&&!!ae;let R;t[16]!==V.length||t[17]!==me?(R={id:"tools",label:"Tools",count:V.length,visible:me},t[16]=V.length,t[17]=me,t[18]=R):R=t[18];let te;t[19]!==$||t[20]!==R?(te=[$,R].filter(bt),t[19]=$,t[20]=R,t[21]=te):te=t[21];const A=te;let se;t[22]!==l||t[23]!==A?(se=A.find(c=>c.id===l)?l:A.find(gt)?.id||A[0]?.id||"overview",t[22]=l,t[23]=A,t[24]=se):se=t[24];const fe=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 M=Ze(T,e.id,f.user.id);if(!M.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:U}=await p.create.mutateAsync(M);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:U}})}catch(U){const D=U;he.error(`Failed to connect MCP Server: ${D instanceof Error?D.message:String(D)}`)}},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 ue=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 P=re;if(!j){let c;return t[35]!==P?(c=s.jsx(nt,{onBack:P}),t[35]=P,t[36]=c):c=t[36],c}if(!v)return null;const z=(j?.server?.remotes?.length??0)>0;let B;t[37]!==P?(B=s.jsx(it,{onBack:P}),t[37]=P,t[38]=B):B=t[38];let G;t[39]!==z?(G=!z&&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(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=z,t[40]=G):G=t[40];let F;t[41]!==L||t[42]!==j?(F=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=F):F=t[43];let O;t[44]!==p.create.isPending||t[45]!==z||t[46]!==v||t[47]!==ue||t[48]!==F?(O=s.jsx(lt,{data:v,itemVersions:F,onInstall:ue,canInstall:z,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=z,t[46]=v,t[47]=ue,t[48]=F,t[49]=O):O=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==j?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:j}),t[50]=v,t[51]=ce,t[52]=j,t[53]=H):H=t[53];let W;t[54]!==A||t[55]!==v||t[56]!==fe||t[57]!==V||t[58]!==Y?(W=s.jsx(dt,{data:v,availableTabs:A,effectiveActiveTabId:fe,effectiveTools:V,isLoadingTools:Y,onTabChange:m}),t[54]=A,t[55]=v,t[56]=fe,t[57]=V,t[58]=Y,t[59]=W):W=t[59];let K;t[60]!==H||t[61]!==W?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,W]}),t[60]=H,t[61]=W,t[62]=K):K=t[62];let Z;t[63]!==G||t[64]!==O||t[65]!==K?(Z=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:[G,O,K]})})}),t[63]=G,t[64]=O,t[65]=K,t[66]=Z):Z=t[66];let ne;return t[67]!==B||t[68]!==Z?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[B,Z]}),t[67]=B,t[68]=Z,t[69]=ne):ne=t[69],ne}function gt(t){return t.id==="readme"}function bt(t){return t.visible}function vt(t){return{name:t.name,description:t.description}}function jt(t){return t.name.endsWith("_GET")}function yt(t){return t.name.endsWith("_VERSIONS")}function rs(){const t=_.c(6),{org:e}=Ne(),o=ve();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(q.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(ht,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(xt,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{rs as default};
1
+ import{r as q,c as _,j as s,f as ve,d as ke,b as Se,a as Ie,t as he}from"./index-BoajXOR2.js";import{i as _e}from"./AlertCircle-D8keEzKG.js";import{i as je}from"./Loading01-CHuzyTrw.js";import{B as ie}from"./button-DyxbcOso.js";import{i as Le}from"./ArrowLeft-ALWG7VDf.js";import{I as ye,a as Ae,u as De,b as Ee,c as Me}from"./use-connection-BaSQ_kK7.js";import{i as Ue}from"./CheckCircle-D36cNDna.js";import{t as Ve}from"./ChevronDown-Cm9t42v8.js";import{s as ge}from"./Plus-DsLFvXGg.js";import{b as $e,D as Re,a as Pe,c as ze}from"./dropdown-menu-PdTp4dEf.js";import{n as be}from"./LinkExternal01-DD1V7jlt.js";import{E as Be}from"./SearchMd-AkbTxzGe.js";import{T as Ge,R as Fe}from"./tools-list-BMljmspA.js";import{R as Oe}from"./resource-tabs-C4ib9Qer.js";import{a as He}from"./use-binding-DsbURj3b.js";import{u as We}from"./use-tool-call-CoSkJnqm.js";import{u as Ke}from"./use-mcp-BI87vr5V.js";import{u as Ne}from"./tooltip-CTZbNNnK.js";import{e as Ze}from"./extract-connection-data-DYfXaCx-.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{f as Je,e as Qe,b as Xe,c as Ye,g as et}from"./registry-utils-ulDDT0d8.js";import{e as tt}from"./app-name-gTETL9So.js";import{i as st}from"./InfoCircle-Dj48FaPG.js";import"./utils-Dvu_Dkg0.js";import"./Grid01-CMcq9qMK.js";import"./useQuery-SxQZJ5cp.js";import"./File06-aktnYzlw.js";import"./collection-display-button-BweLYsfq.js";import"./collection-search-gavQJPP4.js";import"./input-ZwYzWYsd.js";import"./collection-table-wrapper-BpS-68hf.js";import"./card-E0A-GI_K.js";import"./layout-qWjUAxmx.js";import"./badge-Cxx1Sxkf.js";import"./auth-D5CL68LS.js";import"./generate-id-Dyweu44Y.js";const we=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));we.displayName="SearchLg";function ot(t){const e=_.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(je,{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 rt(t){const e=_.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(_e,{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 nt(t){const e=_.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{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 it(t){const e=_.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Le,{}),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 lt(t){const e=_.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]=q.useState(0);let x;e[0]!==r?(x=S=>{p(S),r(S)},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(ye,{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(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs($e,{children:[s.jsx(Re,{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(Ve,{size:20})})}),s.jsx(Pe,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((S,C)=>{const I=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(ze,{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",S.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(Ue,{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(ge,{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 k;return e[22]!==h||e[23]!==w?(k=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]=k):k=e[24],k}function at(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 ct(t){const e=_.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(ye,{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(be,{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(be,{size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let k;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(k=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]=k):k=e[34];let S;e[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=S):S=e[35];let C;e[36]!==r.updated_at?(C=at(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let I;e[38]!==C?(I=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[S,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=I):I=e[39];let u;return e[40]!==i||e[41]!==k||e[42]!==I||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,k,I]}),e[40]=i,e[41]=k,e[42]=I,e[43]=h,e[44]=u):u=e[44],u}function dt(t){const e=_.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(mt),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(Oe,{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(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Be,{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(Fe,{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 mt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ft(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 ut(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 pt(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=Xe(r.remotes?.[0]?.type),d=Ye(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=et(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:tt(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 xt extends q.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(rt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ht(){const t=_.c(70),{org:e}=Ne(),o=ve();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=ke(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}=Se(i),[l,m]=q.useState("readme"),p=Ae(),x=De(),{data:f}=Ie.useSession(),h=He(x),g=d||h[0]?.id||"",b=Ee(g),y=Je(b?.tools),N=b?.tools&&b.tools.find(yt)?.name||"",w=b?.tools&&b.tools.find(jt)?.name||"",k=Me(g),S=!!a;let C,I;S?(C=N||w,I={name:a}):(C=y,I={});const{data:u}=We({toolCaller:k,toolName:C,toolInputParams:I,scope:g});let E=[],L=[],pe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(pe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",M=c.server,U=c._meta;let D;t[2]!==c.title||t[3]!==T||t[4]!==M||t[5]!==U?(D=[{id:T,title:c.title,server:M,_meta:U}],t[2]=c.title,t[3]=T,t[4]=M,t[5]=U,t[6]=D):D=t[6],E=D}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 X;t[7]!==r?(X=c=>{const T=c.name||c.title||c.server.title||"";return qe(T)===r},t[7]=r,t[8]=X):X=t[8];let j=E.find(X);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?pt(j):null,le=(v?.tools?.length||0)>0,ae=j?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ke({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(vt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const xe=ee,V=le?v?.tools||[]:xe,Ce=ft(x,v?.publisher),ce=v?ut(E,v.publisher,Ce,b??null,pe):{count:0},Te=v?.repository?Qe(v.repository):null,de=!!v?.repository&&!!Te;let $;t[14]!==de?($={id:"readme",label:"README",visible:de},t[14]=de,t[15]=$):$=t[15];const me=le||xe.length>0||Y&&!!ae;let R;t[16]!==V.length||t[17]!==me?(R={id:"tools",label:"Tools",count:V.length,visible:me},t[16]=V.length,t[17]=me,t[18]=R):R=t[18];let te;t[19]!==$||t[20]!==R?(te=[$,R].filter(bt),t[19]=$,t[20]=R,t[21]=te):te=t[21];const A=te;let se;t[22]!==l||t[23]!==A?(se=A.find(c=>c.id===l)?l:A.find(gt)?.id||A[0]?.id||"overview",t[22]=l,t[23]=A,t[24]=se):se=t[24];const fe=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 M=Ze(T,e.id,f.user.id);if(!M.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:U}=await p.create.mutateAsync(M);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:U}})}catch(U){const D=U;he.error(`Failed to connect MCP Server: ${D instanceof Error?D.message:String(D)}`)}},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 ue=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 P=re;if(!j){let c;return t[35]!==P?(c=s.jsx(nt,{onBack:P}),t[35]=P,t[36]=c):c=t[36],c}if(!v)return null;const z=(j?.server?.remotes?.length??0)>0;let B;t[37]!==P?(B=s.jsx(it,{onBack:P}),t[37]=P,t[38]=B):B=t[38];let G;t[39]!==z?(G=!z&&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(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=z,t[40]=G):G=t[40];let F;t[41]!==L||t[42]!==j?(F=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=F):F=t[43];let O;t[44]!==p.create.isPending||t[45]!==z||t[46]!==v||t[47]!==ue||t[48]!==F?(O=s.jsx(lt,{data:v,itemVersions:F,onInstall:ue,canInstall:z,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=z,t[46]=v,t[47]=ue,t[48]=F,t[49]=O):O=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==j?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:j}),t[50]=v,t[51]=ce,t[52]=j,t[53]=H):H=t[53];let W;t[54]!==A||t[55]!==v||t[56]!==fe||t[57]!==V||t[58]!==Y?(W=s.jsx(dt,{data:v,availableTabs:A,effectiveActiveTabId:fe,effectiveTools:V,isLoadingTools:Y,onTabChange:m}),t[54]=A,t[55]=v,t[56]=fe,t[57]=V,t[58]=Y,t[59]=W):W=t[59];let K;t[60]!==H||t[61]!==W?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,W]}),t[60]=H,t[61]=W,t[62]=K):K=t[62];let Z;t[63]!==G||t[64]!==O||t[65]!==K?(Z=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:[G,O,K]})})}),t[63]=G,t[64]=O,t[65]=K,t[66]=Z):Z=t[66];let ne;return t[67]!==B||t[68]!==Z?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[B,Z]}),t[67]=B,t[68]=Z,t[69]=ne):ne=t[69],ne}function gt(t){return t.id==="readme"}function bt(t){return t.visible}function vt(t){return{name:t.name,description:t.description}}function jt(t){return t.name.endsWith("_GET")}function yt(t){return t.name.endsWith("_VERSIONS")}function rs(){const t=_.c(6),{org:e}=Ne(),o=ve();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(q.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(ht,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(xt,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{rs as default};
@@ -1 +1 @@
1
- import{r as j,c as M,j as t,H as X,B as I,a2 as z,z as _,E as G,bj as J,bk as K}from"./index-DDrssUsd.js";import{I as $,u as Y}from"./use-connection-DrLts5Bh.js";import{C as F}from"./checkbox-ByvFrlEw.js";import{B as Z}from"./button-n-dnBUcs.js";import{i as ee}from"./ArrowLeft-CjVyVt-H.js";import{c as S}from"./utils-BNxGaTF3.js";import{C as te}from"./collection-search-D33egpeg.js";const se=j.memo(function(o){const e=M.c(21),{connection:n,isSelected:r,hasToolsEnabled:c,activeToolsCount:i,totalToolsCount:x,onSelect:b,onToggle:g}=o,d=r?"bg-accent/50":"hover:bg-muted/50";let u;e[0]!==d?(u=S("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=u):u=e[1];let m;e[2]!==n.icon||e[3]!==n.title?(m=t.jsx($,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=m):m=e[4];let p;e[5]!==n.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=p):p=e[6];let a;e[7]!==b||e[8]!==m||e[9]!==p?(a=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:b,children:[m,p]}),e[7]=b,e[8]=m,e[9]=p,e[10]=a):a=e[10];let f;e[11]!==i||e[12]!==n.tools||e[13]!==c||e[14]!==g||e[15]!==x?(f=n.tools&&n.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[i,"/",x]}),t.jsx(F,{checked:c,onCheckedChange:g,onClick:ne})]}),e[11]=i,e[12]=n.tools,e[13]=c,e[14]=g,e[15]=x,e[16]=f):f=e[16];let C;return e[17]!==u||e[18]!==a||e[19]!==f?(C=t.jsxs("div",{className:u,children:[a,f]}),e[17]=u,e[18]=a,e[19]=f,e[20]=C):C=e[20],C}),oe=j.memo(function(o){const e=M.c(18),{connectionId:n,tool:r,isSelected:c,onToggle:i}=o,x=`tool-${n}-${r.name}`,b=c?"text-foreground":"text-muted-foreground";let g;e[0]!==b?(g=S("text-sm font-medium",b),e[0]=b,e[1]=g):g=e[1];let d;e[2]!==g||e[3]!==r.name?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:g,children:r.name})}),e[2]=g,e[3]=r.name,e[4]=d):d=e[4];let u;e[5]!==r.description?(u=r.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=u):u=e[6];let m;e[7]!==d||e[8]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[7]=d,e[8]=u,e[9]=m):m=e[9];const p=`tool-${n}-${r.name}`;let a;e[10]!==c||e[11]!==i||e[12]!==p?(a=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(F,{id:p,checked:c,onCheckedChange:i,onClick:re})}),e[10]=c,e[11]=i,e[12]=p,e[13]=a):a=e[13];let f;return e[14]!==x||e[15]!==m||e[16]!==a?(f=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:x,children:[m,a]}),e[14]=x,e[15]=m,e[16]=a,e[17]=f):f=e[17],f});function ve({toolSet:l,onToolSetChange:o}){const[e,n]=j.useState(""),r=j.useDeferredValue(e),[c,i]=j.useState("all"),[x,b]=j.useState(!1),g=j.useRef(new Set(Object.keys(l))),d=Y({searchTerm:r.trim()||void 0}),u=g.current,m=[...u.values()].map(s=>d.find(h=>h.id===s)).filter(s=>s!==void 0),p=d.filter(s=>!u.has(s.id)),a=[...m,...p],f=s=>{const h=l[s];return h!==void 0&&h.length>0},C=a.filter(s=>{if(c==="all")return!0;const h=f(s.id);return c==="selected"?h:c==="unselected"?!h:!0}),[k,E]=j.useState(a[0]?.id??null),v=k?a.find(s=>s.id===k)??null:null,P=v?.tools??[],Q=(s,h)=>l[s]?.includes(h)??!1,q=(s,h)=>{const w=l[s]??[],R=w.includes(h),T={...l};if(R){const y=w.filter(N=>N!==h);y.length===0?delete T[s]:T[s]=y}else T[s]=[...w,h];o(T)},L=s=>{const h=a.find(N=>N.id===s);if(!h?.tools)return;const w=l[s]??[],R=h.tools.map(N=>N.name),T=w.length>0&&R.every(N=>w.includes(N)),y={...l};T?delete y[s]:(y[s]=R,E(s)),o(y)},V=s=>{E(s),b(!0)},W=()=>{b(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:S("w-full md:w-80 border-r border-border flex flex-col",x&&"hidden md:flex"),children:[t.jsx(te,{value:e,onChange:n,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>i("all"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>i("selected"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>i("unselected"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:C.map(s=>{const h=s.tools?.length??0,w=l[s.id]?.length??0;return t.jsx(se,{connection:s,isSelected:k===s.id,hasToolsEnabled:f(s.id),activeToolsCount:w,totalToolsCount:h,onSelect:()=>V(s.id),onToggle:()=>L(s.id)},s.id)})})})]}),t.jsx("div",{className:S("flex-1 flex-col",x?"flex":"hidden md:flex"),children:v?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(Z,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ee,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx($,{icon:v.icon,name:v.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:v.title}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:v.description})]})]})]}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.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:P.map(s=>t.jsx(oe,{connectionId:v.id,tool:s,isSelected:Q(v.id,s.name),onToggle:()=>q(v.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 ne(l){return l.stopPropagation()}function re(l){return l.stopPropagation()}var B="Switch",[le]=X(B),[ce,ie]=le(B),H=j.forwardRef((l,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:c,required:i,disabled:x,value:b="on",onCheckedChange:g,form:d,...u}=l,[m,p]=j.useState(null),a=z(o,v=>p(v)),f=j.useRef(!1),C=m?d||!!m.closest("form"):!0,[k,E]=_({prop:r,defaultProp:c??!1,onChange:g,caller:B});return t.jsxs(ce,{scope:e,checked:k,disabled:x,children:[t.jsx(I.button,{type:"button",role:"switch","aria-checked":k,"aria-required":i,"data-state":U(k),"data-disabled":x?"":void 0,disabled:x,value:b,...u,ref:a,onClick:G(l.onClick,v=>{E(P=>!P),C&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})}),C&&t.jsx(D,{control:m,bubbles:!f.current,name:n,value:b,checked:k,required:i,disabled:x,form:d,style:{transform:"translateX(-100%)"}})]})});H.displayName=B;var O="SwitchThumb",A=j.forwardRef((l,o)=>{const{__scopeSwitch:e,...n}=l,r=ie(O,e);return t.jsx(I.span,{"data-state":U(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});A.displayName=O;var ae="SwitchBubbleInput",D=j.forwardRef(({__scopeSwitch:l,control:o,checked:e,bubbles:n=!0,...r},c)=>{const i=j.useRef(null),x=z(i,c),b=J(e),g=K(o);return j.useEffect(()=>{const d=i.current;if(!d)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(b!==e&&p){const a=new Event("click",{bubbles:n});p.call(d,e),d.dispatchEvent(a)}},[b,e,n]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:x,style:{...r.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D.displayName=ae;function U(l){return l?"checked":"unchecked"}var de=H,ue=A;function je(l){const o=M.c(9);let e,n;o[0]!==l?({className:e,...n}=l,o[0]=l,o[1]=e,o[2]=n):(e=o[1],n=o[2]);let r;o[3]!==e?(r=S("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",e),o[3]=e,o[4]=r):r=o[4];let c;o[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ue,{"data-slot":"switch-thumb",className:S("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")}),o[5]=c):c=o[5];let i;return o[6]!==n||o[7]!==r?(i=t.jsx(de,{"data-slot":"switch",className:r,...n,children:c}),o[6]=n,o[7]=r,o[8]=i):i=o[8],i}export{je as S,ve as T};
1
+ import{r as j,c as M,j as t,H as X,B as I,a2 as z,z as _,E as G,bj as J,bk as K}from"./index-BoajXOR2.js";import{I as $,u as Y}from"./use-connection-BaSQ_kK7.js";import{C as F}from"./checkbox-D_hM8b8h.js";import{B as Z}from"./button-DyxbcOso.js";import{i as ee}from"./ArrowLeft-ALWG7VDf.js";import{c as S}from"./utils-Dvu_Dkg0.js";import{C as te}from"./collection-search-gavQJPP4.js";const se=j.memo(function(o){const e=M.c(21),{connection:n,isSelected:r,hasToolsEnabled:c,activeToolsCount:i,totalToolsCount:x,onSelect:b,onToggle:g}=o,d=r?"bg-accent/50":"hover:bg-muted/50";let u;e[0]!==d?(u=S("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=u):u=e[1];let m;e[2]!==n.icon||e[3]!==n.title?(m=t.jsx($,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=m):m=e[4];let p;e[5]!==n.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=p):p=e[6];let a;e[7]!==b||e[8]!==m||e[9]!==p?(a=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:b,children:[m,p]}),e[7]=b,e[8]=m,e[9]=p,e[10]=a):a=e[10];let f;e[11]!==i||e[12]!==n.tools||e[13]!==c||e[14]!==g||e[15]!==x?(f=n.tools&&n.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[i,"/",x]}),t.jsx(F,{checked:c,onCheckedChange:g,onClick:ne})]}),e[11]=i,e[12]=n.tools,e[13]=c,e[14]=g,e[15]=x,e[16]=f):f=e[16];let C;return e[17]!==u||e[18]!==a||e[19]!==f?(C=t.jsxs("div",{className:u,children:[a,f]}),e[17]=u,e[18]=a,e[19]=f,e[20]=C):C=e[20],C}),oe=j.memo(function(o){const e=M.c(18),{connectionId:n,tool:r,isSelected:c,onToggle:i}=o,x=`tool-${n}-${r.name}`,b=c?"text-foreground":"text-muted-foreground";let g;e[0]!==b?(g=S("text-sm font-medium",b),e[0]=b,e[1]=g):g=e[1];let d;e[2]!==g||e[3]!==r.name?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:g,children:r.name})}),e[2]=g,e[3]=r.name,e[4]=d):d=e[4];let u;e[5]!==r.description?(u=r.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=u):u=e[6];let m;e[7]!==d||e[8]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[7]=d,e[8]=u,e[9]=m):m=e[9];const p=`tool-${n}-${r.name}`;let a;e[10]!==c||e[11]!==i||e[12]!==p?(a=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(F,{id:p,checked:c,onCheckedChange:i,onClick:re})}),e[10]=c,e[11]=i,e[12]=p,e[13]=a):a=e[13];let f;return e[14]!==x||e[15]!==m||e[16]!==a?(f=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:x,children:[m,a]}),e[14]=x,e[15]=m,e[16]=a,e[17]=f):f=e[17],f});function ve({toolSet:l,onToolSetChange:o}){const[e,n]=j.useState(""),r=j.useDeferredValue(e),[c,i]=j.useState("all"),[x,b]=j.useState(!1),g=j.useRef(new Set(Object.keys(l))),d=Y({searchTerm:r.trim()||void 0}),u=g.current,m=[...u.values()].map(s=>d.find(h=>h.id===s)).filter(s=>s!==void 0),p=d.filter(s=>!u.has(s.id)),a=[...m,...p],f=s=>{const h=l[s];return h!==void 0&&h.length>0},C=a.filter(s=>{if(c==="all")return!0;const h=f(s.id);return c==="selected"?h:c==="unselected"?!h:!0}),[k,E]=j.useState(a[0]?.id??null),v=k?a.find(s=>s.id===k)??null:null,P=v?.tools??[],Q=(s,h)=>l[s]?.includes(h)??!1,q=(s,h)=>{const w=l[s]??[],R=w.includes(h),T={...l};if(R){const y=w.filter(N=>N!==h);y.length===0?delete T[s]:T[s]=y}else T[s]=[...w,h];o(T)},L=s=>{const h=a.find(N=>N.id===s);if(!h?.tools)return;const w=l[s]??[],R=h.tools.map(N=>N.name),T=w.length>0&&R.every(N=>w.includes(N)),y={...l};T?delete y[s]:(y[s]=R,E(s)),o(y)},V=s=>{E(s),b(!0)},W=()=>{b(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:S("w-full md:w-80 border-r border-border flex flex-col",x&&"hidden md:flex"),children:[t.jsx(te,{value:e,onChange:n,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>i("all"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>i("selected"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>i("unselected"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:C.map(s=>{const h=s.tools?.length??0,w=l[s.id]?.length??0;return t.jsx(se,{connection:s,isSelected:k===s.id,hasToolsEnabled:f(s.id),activeToolsCount:w,totalToolsCount:h,onSelect:()=>V(s.id),onToggle:()=>L(s.id)},s.id)})})})]}),t.jsx("div",{className:S("flex-1 flex-col",x?"flex":"hidden md:flex"),children:v?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(Z,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ee,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx($,{icon:v.icon,name:v.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:v.title}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:v.description})]})]})]}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.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:P.map(s=>t.jsx(oe,{connectionId:v.id,tool:s,isSelected:Q(v.id,s.name),onToggle:()=>q(v.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 ne(l){return l.stopPropagation()}function re(l){return l.stopPropagation()}var B="Switch",[le]=X(B),[ce,ie]=le(B),H=j.forwardRef((l,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:c,required:i,disabled:x,value:b="on",onCheckedChange:g,form:d,...u}=l,[m,p]=j.useState(null),a=z(o,v=>p(v)),f=j.useRef(!1),C=m?d||!!m.closest("form"):!0,[k,E]=_({prop:r,defaultProp:c??!1,onChange:g,caller:B});return t.jsxs(ce,{scope:e,checked:k,disabled:x,children:[t.jsx(I.button,{type:"button",role:"switch","aria-checked":k,"aria-required":i,"data-state":U(k),"data-disabled":x?"":void 0,disabled:x,value:b,...u,ref:a,onClick:G(l.onClick,v=>{E(P=>!P),C&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})}),C&&t.jsx(D,{control:m,bubbles:!f.current,name:n,value:b,checked:k,required:i,disabled:x,form:d,style:{transform:"translateX(-100%)"}})]})});H.displayName=B;var O="SwitchThumb",A=j.forwardRef((l,o)=>{const{__scopeSwitch:e,...n}=l,r=ie(O,e);return t.jsx(I.span,{"data-state":U(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});A.displayName=O;var ae="SwitchBubbleInput",D=j.forwardRef(({__scopeSwitch:l,control:o,checked:e,bubbles:n=!0,...r},c)=>{const i=j.useRef(null),x=z(i,c),b=J(e),g=K(o);return j.useEffect(()=>{const d=i.current;if(!d)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(b!==e&&p){const a=new Event("click",{bubbles:n});p.call(d,e),d.dispatchEvent(a)}},[b,e,n]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:x,style:{...r.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D.displayName=ae;function U(l){return l?"checked":"unchecked"}var de=H,ue=A;function je(l){const o=M.c(9);let e,n;o[0]!==l?({className:e,...n}=l,o[0]=l,o[1]=e,o[2]=n):(e=o[1],n=o[2]);let r;o[3]!==e?(r=S("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",e),o[3]=e,o[4]=r):r=o[4];let c;o[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ue,{"data-slot":"switch-thumb",className:S("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")}),o[5]=c):c=o[5];let i;return o[6]!==n||o[7]!==r?(i=t.jsx(de,{"data-slot":"switch",className:r,...n,children:c}),o[6]=n,o[7]=r,o[8]=i):i=o[8],i}export{je as S,ve as T};
@@ -1 +1 @@
1
- import{c as o,j as n}from"./index-DDrssUsd.js";import{c as l}from"./utils-BNxGaTF3.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
+ import{c as o,j as n}from"./index-BoajXOR2.js";import{c as l}from"./utils-Dvu_Dkg0.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{K as B,j as t,c as O,g as Q,r as k}from"./index-DDrssUsd.js";import{u as U}from"./useQuery-iHOeESxa.js";import{i as W}from"./File06-CRfao4L4.js";import{i as Y}from"./Loading01-CNHBx4kI.js";import{e as J}from"./registry-utils-ulDDT0d8.js";import{C as P}from"./collection-display-button-BziK2H4v.js";import{C as X}from"./collection-search-D33egpeg.js";import{C as Z}from"./collection-table-wrapper-BWoWsFFZ.js";import{E as z}from"./SearchMd-DBUkNw9d.js";import{I as ee}from"./use-connection-DrLts5Bh.js";import{C as te}from"./card--RtELIXA.js";import{V as se}from"./layout-BlymenNb.js";function oe(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function re(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,i)=>i.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${i} target="_blank" rel="noopener noreferrer">`)}function ne(s){let e=oe(s);return e=re(e),e}function ve({repository:s}){const e=s?J(s):null,{data:i,isLoading:c}=U({queryKey:B.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const l=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!l.ok){if(l.status===404)return null;throw new Error(`Failed to fetch README: ${l.statusText}`)}const m=await l.text();return ne(m)}catch(l){return console.error("Error fetching README:",l),null}},enabled:!!e&&!!s,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}):i?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:i}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(W,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function Ce(s){const e=O.c(39),{tools:i,connectionId:c,org:l,onToolClick:m,showToolbar:L,emptyMessage:M}=s,D=L===void 0?!0:L,j=M===void 0?"This connection doesn't have any tools yet.":M,I=Q(),[n,$]=k.useState(""),[d,H]=k.useState("table"),[r,A]=k.useState("name"),[a,_]=k.useState("asc");let y;e[0]!==a||e[1]!==r?(y=o=>{r===o?(_(me),a==="desc"&&A(void 0)):(A(o),_("asc"))},e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y;let N;e[3]!==c||e[4]!==I||e[5]!==m||e[6]!==l?(N=o=>{m?m(o):c&&l&&I({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=c,e[4]=I,e[5]=m,e[6]=l,e[7]=N):N=e[7];const w=N;let v;if(e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==i){const o=!i||i.length===0?[]:n.trim()?(()=>{const R=n.toLowerCase();return i.filter(b=>b.name.toLowerCase().includes(R)||b.description&&b.description.toLowerCase().includes(R))})():i;v=!r||!a?o:[...o].sort((R,b)=>{const q=R[r]||"",G=b[r]||"",K=String(q).localeCompare(String(G));return a==="asc"?K:-K}),e[8]=n,e[9]=a,e[10]=r,e[11]=i,e[12]=v}else v=e[12];const g=v;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=[{id:"name",header:"Name",render:ce,sortable:!0},{id:"description",header:"Description",render:le,cellClassName:"flex-1",sortable:!0}],e[13]=C):C=e[13];const V=C;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=V.filter(ie).map(ae),e[14]=S):S=e[14];const F=S;let f;e[15]!==u||e[16]!==D||e[17]!==a||e[18]!==r||e[19]!==d?(f=D&&t.jsx(se,{children:t.jsx(P,{viewMode:d,onViewModeChange:H,sortKey:r,sortDirection:a,onSort:u,sortOptions:F})}),e[15]=u,e[16]=D,e[17]=a,e[18]=r,e[19]=d,e[20]=f):f=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=o=>{o.key==="Escape"&&($(""),o.target.blur())},e[21]=E):E=e[21];let p;e[22]!==n?(p=t.jsx(X,{value:n,onChange:$,placeholder:"Search tools...",onKeyDown:E}),e[22]=n,e[23]=p):p=e[23];let h;e[24]!==j||e[25]!==u||e[26]!==w||e[27]!==n||e[28]!==a||e[29]!==r||e[30]!==g||e[31]!==d?(h=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:g.length===0?t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:g.map(o=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>w(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(Z,{columns:V,data:g,isLoading:!1,sortKey:r,sortDirection:a,onSort:u,onRowClick:o=>w(o),emptyState:t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j})}),e[24]=j,e[25]=u,e[26]=w,e[27]=n,e[28]=a,e[29]=r,e[30]=g,e[31]=d,e[32]=h):h=e[32];let x;e[33]!==p||e[34]!==h?(x=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p,h]}),e[33]=p,e[34]=h,e[35]=x):x=e[35];let T;return e[36]!==x||e[37]!==f?(T=t.jsxs(t.Fragment,{children:[f,x]}),e[36]=x,e[37]=f,e[38]=T):T=e[38],T}function ae(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ie(s){return s.sortable}function le(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ce(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function me(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{ve as R,Ce as T};
1
+ import{K as B,j as t,c as O,f as Q,r as k}from"./index-BoajXOR2.js";import{u as U}from"./useQuery-SxQZJ5cp.js";import{i as W}from"./File06-aktnYzlw.js";import{i as Y}from"./Loading01-CHuzyTrw.js";import{e as J}from"./registry-utils-ulDDT0d8.js";import{C as P}from"./collection-display-button-BweLYsfq.js";import{C as X}from"./collection-search-gavQJPP4.js";import{C as Z}from"./collection-table-wrapper-BpS-68hf.js";import{E as z}from"./SearchMd-AkbTxzGe.js";import{I as ee}from"./use-connection-BaSQ_kK7.js";import{C as te}from"./card-E0A-GI_K.js";import{V as se}from"./layout-qWjUAxmx.js";function oe(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function re(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,i)=>i.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${i} target="_blank" rel="noopener noreferrer">`)}function ne(s){let e=oe(s);return e=re(e),e}function ve({repository:s}){const e=s?J(s):null,{data:i,isLoading:c}=U({queryKey:B.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const l=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!l.ok){if(l.status===404)return null;throw new Error(`Failed to fetch README: ${l.statusText}`)}const m=await l.text();return ne(m)}catch(l){return console.error("Error fetching README:",l),null}},enabled:!!e&&!!s,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}):i?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:i}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(W,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function Ce(s){const e=O.c(39),{tools:i,connectionId:c,org:l,onToolClick:m,showToolbar:L,emptyMessage:M}=s,D=L===void 0?!0:L,j=M===void 0?"This connection doesn't have any tools yet.":M,I=Q(),[n,$]=k.useState(""),[d,H]=k.useState("table"),[r,A]=k.useState("name"),[a,_]=k.useState("asc");let y;e[0]!==a||e[1]!==r?(y=o=>{r===o?(_(me),a==="desc"&&A(void 0)):(A(o),_("asc"))},e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y;let N;e[3]!==c||e[4]!==I||e[5]!==m||e[6]!==l?(N=o=>{m?m(o):c&&l&&I({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=c,e[4]=I,e[5]=m,e[6]=l,e[7]=N):N=e[7];const w=N;let v;if(e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==i){const o=!i||i.length===0?[]:n.trim()?(()=>{const R=n.toLowerCase();return i.filter(b=>b.name.toLowerCase().includes(R)||b.description&&b.description.toLowerCase().includes(R))})():i;v=!r||!a?o:[...o].sort((R,b)=>{const q=R[r]||"",G=b[r]||"",K=String(q).localeCompare(String(G));return a==="asc"?K:-K}),e[8]=n,e[9]=a,e[10]=r,e[11]=i,e[12]=v}else v=e[12];const g=v;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=[{id:"name",header:"Name",render:ce,sortable:!0},{id:"description",header:"Description",render:le,cellClassName:"flex-1",sortable:!0}],e[13]=C):C=e[13];const V=C;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=V.filter(ie).map(ae),e[14]=S):S=e[14];const F=S;let f;e[15]!==u||e[16]!==D||e[17]!==a||e[18]!==r||e[19]!==d?(f=D&&t.jsx(se,{children:t.jsx(P,{viewMode:d,onViewModeChange:H,sortKey:r,sortDirection:a,onSort:u,sortOptions:F})}),e[15]=u,e[16]=D,e[17]=a,e[18]=r,e[19]=d,e[20]=f):f=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=o=>{o.key==="Escape"&&($(""),o.target.blur())},e[21]=E):E=e[21];let p;e[22]!==n?(p=t.jsx(X,{value:n,onChange:$,placeholder:"Search tools...",onKeyDown:E}),e[22]=n,e[23]=p):p=e[23];let h;e[24]!==j||e[25]!==u||e[26]!==w||e[27]!==n||e[28]!==a||e[29]!==r||e[30]!==g||e[31]!==d?(h=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:g.length===0?t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:g.map(o=>t.jsx(te,{className:"cursor-pointer transition-colors",onClick:()=>w(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(ee,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(Z,{columns:V,data:g,isLoading:!1,sortKey:r,sortDirection:a,onSort:u,onRowClick:o=>w(o),emptyState:t.jsx(z,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j})}),e[24]=j,e[25]=u,e[26]=w,e[27]=n,e[28]=a,e[29]=r,e[30]=g,e[31]=d,e[32]=h):h=e[32];let x;e[33]!==p||e[34]!==h?(x=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p,h]}),e[33]=p,e[34]=h,e[35]=x):x=e[35];let T;return e[36]!==x||e[37]!==f?(T=t.jsxs(t.Fragment,{children:[f,x]}),e[36]=x,e[37]=f,e[38]=T):T=e[38],T}function ae(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ie(s){return s.sortable}function le(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function ce(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function me(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{ve as R,Ce as T};
@@ -1 +1 @@
1
- import{r as a,j as d,B as H,c as j,H as Z,a6 as $,a2 as G,a9 as ee,E as C,a3 as z,aa as te,ag as oe,ah as re,bF as ne,a8 as se,z as ae,a7 as ie,ai as le}from"./index-DDrssUsd.js";import{c as ce}from"./utils-BNxGaTF3.js";var ue=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"}),de="VisuallyHidden",F=a.forwardRef((o,e)=>d.jsx(H.span,{...o,ref:e,style:{...ue,...o.style}}));F.displayName=de;var pe=F;const fe=({size:o=24,color:e="currentColor",...t})=>a.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},a.createElement("path",{d:"M20 6 9 17l-5-5"}));fe.displayName="Check";const S="org-admin",ve={from({org:o,project:e}){if(o.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${o}/${e}`},parse(o){o.startsWith("/")&&(o=o.slice(1));const[e,t]=o.split("/");if(!e||!t)throw new Error("Invalid locator");return{org:e,project:t}},isOrgAdminProject(o){return o.split("/")[1]===S},adminProject(o){return`${o}/${S}`}},V=a.createContext(void 0),$e=()=>{const o=a.useContext(V);if(!o)throw new Error("useProjectContext must be used within a ProjectContextProvider");return o},Ge=o=>{const e=j.c(10),{children:t,org:r,project:n}=o;let s;e[0]!==r.slug||e[1]!==n.slug?(s=ve.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]!==t||e[8]!==i?(u=d.jsx(V.Provider,{value:i,children:t}),e[7]=t,e[8]=i,e[9]=u):u=e[9],u};var[O]=Z("Tooltip",[$]),L=$(),B="TooltipProvider",he=700,D="tooltip.open",[xe,A]=O(B),U=o=>{const{__scopeTooltip:e,delayDuration:t=he,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,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(xe,{scope:e,isOpenDelayedRef:l,delayDuration:t,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})};U.displayName=B;var R="Tooltip",[ge,_]=O(R),Y=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=o,i=A(R,o.__scopeTooltip),u=L(e),[p,v]=a.useState(null),h=se(),f=a.useRef(0),x=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[y,T]=ae({prop:r,defaultProp:n??!1,onChange:M=>{M?(i.onOpen(),document.dispatchEvent(new CustomEvent(D))):i.onClose(),s?.(M)},caller:R}),b=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,T(!0)},[T]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,T(!0),f.current=0},m)},[m,T]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ie,{...u,children:d.jsx(ge,{scope:e,contentId:h,open:y,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{x?E():(window.clearTimeout(f.current),f.current=0)},[E,x]),onOpen:P,onClose:E,disableHoverableContent:x,children:t})})};Y.displayName=R;var k="TooltipTrigger",W=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(k,t),s=A(k,t),l=L(t),c=a.useRef(null),i=G(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(ee,{asChild:!0,...l,children:d.jsx(H.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,h=>{h.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{u.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});W.displayName=k;var N="TooltipPortal",[me,Te]=O(N,{forceMount:void 0}),q=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return d.jsx(me,{scope:e,forceMount:t,children:d.jsx(z,{present:t||s.open,children:d.jsx(te,{asChild:!0,container:n,children:r})})})};q.displayName=N;var w="TooltipContent",X=a.forwardRef((o,e)=>{const t=Te(w,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(w,o.__scopeTooltip);return d.jsx(z,{present:r||l.open,children:l.disableHoverableContent?d.jsx(J,{side:n,...s,ref:e}):d.jsx(ye,{side:n,...s,ref:e})})}),ye=a.forwardRef((o,e)=>{const t=_(w,o.__scopeTooltip),r=A(w,o.__scopeTooltip),n=a.useRef(null),s=G(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=t,p=n.current,{onPointerInTransitChange:v}=r,h=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((x,m)=>{const g=x.currentTarget,y={x:x.clientX,y:x.clientY},T=Pe(y,g.getBoundingClientRect()),b=Ee(y,T),P=Re(m.getBoundingClientRect()),E=_e([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(i&&p){const x=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",x),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",x),p.removeEventListener("pointerleave",m)}}},[i,p,f,h]),a.useEffect(()=>{if(l){const x=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},T=i?.contains(g)||p?.contains(g),b=!je(y,l);T?h():b&&(h(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[i,p,l,u,h]),d.jsx(J,{...o,ref:s})}),[Ce,we]=O(R,{isInside:!1}),be=ne("TooltipContent"),J=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=o,i=_(w,t),u=L(t),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(D,p),()=>document.removeEventListener(D,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=h=>{h.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(re,{"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(be,{children:r}),d.jsx(Ce,{scope:t,isInside:!0,children:d.jsx(pe,{id:i.contentId,role:"tooltip",children:n||r})})]})})});X.displayName=w;var K="TooltipArrow",Q=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=L(t);return we(K,t).isInside?null:d.jsx(le,{...n,...r,ref:e})});Q.displayName=K;function Pe(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ee(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function Re(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function je(o,e){const{x:t,y:r}=o;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,h=i.y;p>r!=h>r&&t<(v-u)*(r-p)/(h-p)+u&&(n=!n)}return n}function _e(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Oe(e)}function Oe(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[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 t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Le=U,De=Y,ke=W,Ae=q,Ne=X,Ie=Q;function Me(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=d.jsx(Le,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function ze(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=d.jsx(Me,{children:d.jsx(De,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Fe(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=d.jsx(ke,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Ve(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=ce("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(Ie,{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]!==t||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(Ae,{children:d.jsxs(Ne,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}export{ve as L,S as O,Ge as P,Ve as T,ue as V,Me as a,Fe as b,ze as c,fe as i,$e as u};
1
+ import{r as a,j as d,B as H,c as j,H as Z,a6 as $,a2 as G,a9 as ee,E as C,a3 as z,aa as te,ag as oe,ah as re,bF as ne,a8 as se,z as ae,a7 as ie,ai as le}from"./index-BoajXOR2.js";import{c as ce}from"./utils-Dvu_Dkg0.js";var ue=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"}),de="VisuallyHidden",F=a.forwardRef((o,e)=>d.jsx(H.span,{...o,ref:e,style:{...ue,...o.style}}));F.displayName=de;var pe=F;const fe=({size:o=24,color:e="currentColor",...t})=>a.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},a.createElement("path",{d:"M20 6 9 17l-5-5"}));fe.displayName="Check";const S="org-admin",ve={from({org:o,project:e}){if(o.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${o}/${e}`},parse(o){o.startsWith("/")&&(o=o.slice(1));const[e,t]=o.split("/");if(!e||!t)throw new Error("Invalid locator");return{org:e,project:t}},isOrgAdminProject(o){return o.split("/")[1]===S},adminProject(o){return`${o}/${S}`}},V=a.createContext(void 0),$e=()=>{const o=a.useContext(V);if(!o)throw new Error("useProjectContext must be used within a ProjectContextProvider");return o},Ge=o=>{const e=j.c(10),{children:t,org:r,project:n}=o;let s;e[0]!==r.slug||e[1]!==n.slug?(s=ve.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]!==t||e[8]!==i?(u=d.jsx(V.Provider,{value:i,children:t}),e[7]=t,e[8]=i,e[9]=u):u=e[9],u};var[O]=Z("Tooltip",[$]),L=$(),B="TooltipProvider",he=700,D="tooltip.open",[xe,A]=O(B),U=o=>{const{__scopeTooltip:e,delayDuration:t=he,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,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(xe,{scope:e,isOpenDelayedRef:l,delayDuration:t,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})};U.displayName=B;var R="Tooltip",[ge,_]=O(R),Y=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=o,i=A(R,o.__scopeTooltip),u=L(e),[p,v]=a.useState(null),h=se(),f=a.useRef(0),x=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[y,T]=ae({prop:r,defaultProp:n??!1,onChange:M=>{M?(i.onOpen(),document.dispatchEvent(new CustomEvent(D))):i.onClose(),s?.(M)},caller:R}),b=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,T(!0)},[T]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,T(!1)},[T]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,T(!0),f.current=0},m)},[m,T]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ie,{...u,children:d.jsx(ge,{scope:e,contentId:h,open:y,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{x?E():(window.clearTimeout(f.current),f.current=0)},[E,x]),onOpen:P,onClose:E,disableHoverableContent:x,children:t})})};Y.displayName=R;var k="TooltipTrigger",W=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(k,t),s=A(k,t),l=L(t),c=a.useRef(null),i=G(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(ee,{asChild:!0,...l,children:d.jsx(H.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,h=>{h.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{u.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});W.displayName=k;var N="TooltipPortal",[me,Te]=O(N,{forceMount:void 0}),q=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return d.jsx(me,{scope:e,forceMount:t,children:d.jsx(z,{present:t||s.open,children:d.jsx(te,{asChild:!0,container:n,children:r})})})};q.displayName=N;var w="TooltipContent",X=a.forwardRef((o,e)=>{const t=Te(w,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(w,o.__scopeTooltip);return d.jsx(z,{present:r||l.open,children:l.disableHoverableContent?d.jsx(J,{side:n,...s,ref:e}):d.jsx(ye,{side:n,...s,ref:e})})}),ye=a.forwardRef((o,e)=>{const t=_(w,o.__scopeTooltip),r=A(w,o.__scopeTooltip),n=a.useRef(null),s=G(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=t,p=n.current,{onPointerInTransitChange:v}=r,h=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((x,m)=>{const g=x.currentTarget,y={x:x.clientX,y:x.clientY},T=Pe(y,g.getBoundingClientRect()),b=Ee(y,T),P=Re(m.getBoundingClientRect()),E=_e([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(i&&p){const x=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",x),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",x),p.removeEventListener("pointerleave",m)}}},[i,p,f,h]),a.useEffect(()=>{if(l){const x=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},T=i?.contains(g)||p?.contains(g),b=!je(y,l);T?h():b&&(h(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[i,p,l,u,h]),d.jsx(J,{...o,ref:s})}),[Ce,we]=O(R,{isInside:!1}),be=ne("TooltipContent"),J=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=o,i=_(w,t),u=L(t),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(D,p),()=>document.removeEventListener(D,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=h=>{h.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(re,{"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(be,{children:r}),d.jsx(Ce,{scope:t,isInside:!0,children:d.jsx(pe,{id:i.contentId,role:"tooltip",children:n||r})})]})})});X.displayName=w;var K="TooltipArrow",Q=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=L(t);return we(K,t).isInside?null:d.jsx(le,{...n,...r,ref:e})});Q.displayName=K;function Pe(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ee(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function Re(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function je(o,e){const{x:t,y:r}=o;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,h=i.y;p>r!=h>r&&t<(v-u)*(r-p)/(h-p)+u&&(n=!n)}return n}function _e(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Oe(e)}function Oe(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[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 t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Le=U,De=Y,ke=W,Ae=q,Ne=X,Ie=Q;function Me(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=d.jsx(Le,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function ze(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=d.jsx(Me,{children:d.jsx(De,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Fe(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=d.jsx(ke,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Ve(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=ce("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(Ie,{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]!==t||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(Ae,{children:d.jsxs(Ne,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}export{ve as L,S as O,Ge as P,Ve as T,ue as V,Me as a,Fe as b,ze as c,fe as i,$e as u};