@decocms/mesh 2.29.2 → 2.29.3

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 (134) hide show
  1. package/dist/client/assets/{AlertCircle-BjDAjYli.js → AlertCircle-CNlbeaNO.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-C3b0kZkv.js → ArrowLeft-H58XLYPH.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-UuyzMrp7.js → ArrowUp-C39Etgym.js} +1 -1
  4. package/dist/client/assets/{Check-BBlt8nj4.js → Check-qyrf_w7u.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-C2nnNiko.js → ChevronDown-D4EQGXFb.js} +1 -1
  6. package/dist/client/assets/{Code01-BkX8PbNA.js → Code01-B-sXoUAx.js} +1 -1
  7. package/dist/client/assets/{Copy01-eVnag3mk.js → Copy01-EV4WWtW9.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-D8Oa-FB4.js → DotsHorizontal-BLQeuj18.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-Cl1hRwhg.js → DotsVertical-BIgdSuWw.js} +1 -1
  10. package/dist/client/assets/{Download01-BW7f1rv9.js → Download01-CfIslxub.js} +1 -1
  11. package/dist/client/assets/{Edit01-C2f_e3xp.js → Edit01-YiEPkU0g.js} +1 -1
  12. package/dist/client/assets/{File06-D5XMLdKt.js → File06-BOUeu2_s.js} +1 -1
  13. package/dist/client/assets/{FilterLines-ZY2ZET-V.js → FilterLines-C9-FwG4M.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-BX_e7PV2.js → FlipBackward-CXUecZqc.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-BBkuZ0g6.js → GitBranch01-C7TElKX3.js} +1 -1
  16. package/dist/client/assets/{Grid01-uChhmLMS.js → Grid01-DS_Rpsaf.js} +1 -1
  17. package/dist/client/assets/{Home02-C3AGNyGt.js → Home02-kWTen2lJ.js} +1 -1
  18. package/dist/client/assets/{Image01-Ca9fCk1g.js → Image01-C1Gj64FS.js} +1 -1
  19. package/dist/client/assets/{Inbox01-7yaEdhih.js → Inbox01-BWl9K4GL.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-ZFVXEe-o.js → InfoCircle-fjnTRxT_.js} +1 -1
  21. package/dist/client/assets/{Key01-BVzZzDXG.js → Key01-BH9DhJ8d.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-DYbIdjWG.js → LinkExternal01-Cu4-40eG.js} +1 -1
  23. package/dist/client/assets/{List-DTNJ5e_Z.js → List-CMJ7wwXL.js} +1 -1
  24. package/dist/client/assets/{Loading01-CVbOjnPi.js → Loading01-DlgJ1_45.js} +1 -1
  25. package/dist/client/assets/{Lock01-Irv7dEl1.js → Lock01-Bc4skRDc.js} +1 -1
  26. package/dist/client/assets/{Play-el8E8avm.js → Play-By6elSLp.js} +1 -1
  27. package/dist/client/assets/{Plus-jsBXu2Jm.js → Plus-DtbgAjWY.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CDx95UHX.js → SearchMd--bzHJ7AO.js} +1 -1
  29. package/dist/client/assets/{Terminal-C4vz1dQ0.js → Terminal-BVYBaOBz.js} +1 -1
  30. package/dist/client/assets/{Trash01-hrLLpuYX.js → Trash01-DjLKhTdL.js} +1 -1
  31. package/dist/client/assets/{Upload01-CdFUIAAb.js → Upload01-Deo1Gmh-.js} +1 -1
  32. package/dist/client/assets/{X-Bp6jT_CT.js → X-C24Yv1HS.js} +1 -1
  33. package/dist/client/assets/{XClose-ChfIwjbU.js → XClose-CnH5yMqw.js} +1 -1
  34. package/dist/client/assets/{agent-detail-BvL0RN-C.js → agent-detail-RPUTUaLt.js} +1 -1
  35. package/dist/client/assets/{agents-CDU0paf2.js → agents-DLD7xSIr.js} +1 -1
  36. package/dist/client/assets/{alert-dialog-5F29h7ch.js → alert-dialog-D9F5tffK.js} +1 -1
  37. package/dist/client/assets/{auth-catchall-BnUTAkiU.js → auth-catchall-CN5idKvS.js} +1 -1
  38. package/dist/client/assets/{avatar-_fJCi1jf.js → avatar-BZZ8iTNu.js} +1 -1
  39. package/dist/client/assets/{badge-DIpSEo79.js → badge-Bv6QbUSE.js} +1 -1
  40. package/dist/client/assets/{binder-QE3BUq_4.js → binder-Co4G2PF6.js} +1 -1
  41. package/dist/client/assets/{button-BID2CMhP.js → button-Ta3HWdYR.js} +1 -1
  42. package/dist/client/assets/{card-6juGo41K.js → card-CRtF9cdr.js} +1 -1
  43. package/dist/client/assets/{checkbox-BR6ZWQcp.js → checkbox-PlWQwQ-Z.js} +1 -1
  44. package/dist/client/assets/{collection-detail-DdU0S4bC.js → collection-detail-D2KCEX1U.js} +1 -1
  45. package/dist/client/assets/{collection-display-button-CES97i9G.js → collection-display-button-CQf7wSjn.js} +1 -1
  46. package/dist/client/assets/{collection-header-C2jCnQ0V.js → collection-header-ebtrK-4-.js} +1 -1
  47. package/dist/client/assets/{collection-page-DQBRHwuf.js → collection-page-BhBrRtz8.js} +1 -1
  48. package/dist/client/assets/{collection-search-CYQ70Hoa.js → collection-search-BHs67_UI.js} +1 -1
  49. package/dist/client/assets/{collection-tab-5E9Q1B_9.js → collection-tab-B2mnSptX.js} +1 -1
  50. package/dist/client/assets/{collection-table-wrapper-CVkp-9hJ.js → collection-table-wrapper-3bPS8SS1.js} +1 -1
  51. package/dist/client/assets/{connection-CzagOXhI.js → connection-C0f0eQA8.js} +1 -1
  52. package/dist/client/assets/{connection-card-De1P7KUX.js → connection-card-CEKO3io8.js} +1 -1
  53. package/dist/client/assets/{connection-detail-C6yPmWnc.js → connection-detail-CdPOOjUE.js} +1 -1
  54. package/dist/client/assets/{connections-JU4CGCz5.js → connections-DiIaCwOD.js} +1 -1
  55. package/dist/client/assets/constants-7IT_izqz.js +1 -0
  56. package/dist/client/assets/{create-organization-dialog-DjIYezTr.js → create-organization-dialog-dWwHUnmz.js} +1 -1
  57. package/dist/client/assets/{dialog-N6lD2G23.js → dialog-DU-St4qJ.js} +1 -1
  58. package/dist/client/assets/{dropdown-menu-CZuHPcK3.js → dropdown-menu-BbIA2rWH.js} +1 -1
  59. package/dist/client/assets/{dynamic-plugin-layout-D2QU16mz.js → dynamic-plugin-layout-CvhGXoEg.js} +1 -1
  60. package/dist/client/assets/{empty-state-aph8hymo.js → empty-state-CSTjcp0X.js} +1 -1
  61. package/dist/client/assets/{empty-state-B2MmEXSc.js → empty-state-CUODA5WM.js} +1 -1
  62. package/dist/client/assets/{env-vars-editor-Bw5ArpUL.js → env-vars-editor-D9YuRsdO.js} +1 -1
  63. package/dist/client/assets/{error-boundary-BSc3aikh.js → error-boundary-DP1kX1Iw.js} +1 -1
  64. package/dist/client/assets/{extract-connection-data-DsBhcJbM.js → extract-connection-data-D7M4EXYt.js} +1 -1
  65. package/dist/client/assets/{file-browser-C7oCWAQD.js → file-browser-C9Hg6ohe.js} +2 -2
  66. package/dist/client/assets/{form-R15NVDAL.js → form-HErbLCwX.js} +1 -1
  67. package/dist/client/assets/{grid-view-CW_NhGu9.js → grid-view-DvYWkbyi.js} +1 -1
  68. package/dist/client/assets/{home-QfrULyzV.js → home-CszARX6v.js} +1 -1
  69. package/dist/client/assets/{index-C0cxXUhv.js → index-B9c3bNyk.js} +5 -5
  70. package/dist/client/assets/{index-kNWs-Kaj.js → index-D0C0gp7N.js} +1 -1
  71. package/dist/client/assets/{index-DJuj6s5W.js → index-DE0l5h4l.js} +1 -1
  72. package/dist/client/assets/{index-wl-vFw7b.js → index-DMxjLEp2.js} +1 -1
  73. package/dist/client/assets/{index-BfX1PMhV.js → index-SYlc-1Tl.js} +1 -1
  74. package/dist/client/assets/{infiniteQueryObserver-CzQcKMvF.js → infiniteQueryObserver-DTO2dBsV.js} +1 -1
  75. package/dist/client/assets/{input-DHdPZHvh.js → input-Dh7sDwu6.js} +1 -1
  76. package/dist/client/assets/{layout-DVqtFrGe.js → layout-CMBAL9_n.js} +1 -1
  77. package/dist/client/assets/{localstorage-keys-CySryjw_.js → localstorage-keys-DJR10CLV.js} +1 -1
  78. package/dist/client/assets/{login-DK-wLmSi.js → login-CgLLYYgm.js} +1 -1
  79. package/dist/client/assets/{mcp-oauth-C_uVzdje.js → mcp-oauth-Bb9RwQ7y.js} +1 -1
  80. package/dist/client/assets/{mcp-server-card-utdZ5S32.js → mcp-server-card-3RQV4Klx.js} +1 -1
  81. package/dist/client/assets/{mcp-server-detail-MhY6fdyG.js → mcp-server-detail-ERiwQuLO.js} +1 -1
  82. package/dist/client/assets/{members-BM4vbqXY.js → members-COVJZ-4S.js} +1 -1
  83. package/dist/client/assets/{monaco-editor-Bvv8L85C.js → monaco-editor-9ao1STYz.js} +1 -1
  84. package/dist/client/assets/{monitoring-CaEhdIcr.js → monitoring-BTGpm-FJ.js} +1 -1
  85. package/dist/client/assets/{oauth-callback-HFODG9C4.js → oauth-callback-DC00uX2L.js} +1 -1
  86. package/dist/client/assets/{page-BbtKYCEh.js → page-2qu28FYa.js} +1 -1
  87. package/dist/client/assets/{page-0IgoQPj0.js → page-CeLSKVJn.js} +1 -1
  88. package/dist/client/assets/{pin-to-sidebar-button-BTWnJIgz.js → pin-to-sidebar-button-B85FzaKS.js} +1 -1
  89. package/dist/client/assets/{plugin-empty-state-LAcvmaUO.js → plugin-empty-state-CLZp9CCB.js} +1 -1
  90. package/dist/client/assets/{plugin-header-CIa7SNC1.js → plugin-header-DlV51u69.js} +1 -1
  91. package/dist/client/assets/{plugins-Zgv-qqyu.js → plugins-BNlg-adG.js} +1 -1
  92. package/dist/client/assets/{popover-ffhxj7L9.js → popover-nSqfHOuL.js} +1 -1
  93. package/dist/client/assets/{project-context-provider-CG5Jt9jX.js → project-context-provider-DJGvA4-w.js} +1 -1
  94. package/dist/client/assets/{registry-utils-Cqqa8TSE.js → registry-utils-BKwhzouz.js} +1 -1
  95. package/dist/client/assets/{resizable-e7LRtN-0.js → resizable-CXrT3-gZ.js} +1 -1
  96. package/dist/client/assets/{resource-tabs-B6SPH4Q6.js → resource-tabs-B7x4zlfW.js} +1 -1
  97. package/dist/client/assets/{schema-BesiDnBO.js → schema-rISYOzpk.js} +1 -1
  98. package/dist/client/assets/{select-Cd19OBy8.js → select-DEFdCmMs.js} +1 -1
  99. package/dist/client/assets/{settings-DgjJ7rwy.js → settings-DwBDaBpc.js} +1 -1
  100. package/dist/client/assets/{shell-layout-C4m50Amb.js → shell-layout-BGLgMyjW.js} +1 -1
  101. package/dist/client/assets/{spinner-B3XPkxOB.js → spinner-CO1NH93o.js} +1 -1
  102. package/dist/client/assets/{switch-rXNPyRWr.js → switch-IXdsAtvF.js} +1 -1
  103. package/dist/client/assets/{textarea-B0dfI4Xu.js → textarea-BIhbkxfH.js} +1 -1
  104. package/dist/client/assets/{tool-set-selector-DCV0H2hh.js → tool-set-selector-Cu6h1Zi5.js} +1 -1
  105. package/dist/client/assets/{tools-list-DcCgeTm7.js → tools-list-DvTDsJWw.js} +1 -1
  106. package/dist/client/assets/{tooltip-BpIeWmG3.js → tooltip-Bb2oNaYJ.js} +1 -1
  107. package/dist/client/assets/{typewriter-title-vmu3HKS1.js → typewriter-title-Dm2sjP0K.js} +1 -1
  108. package/dist/client/assets/{use-binding-CmWOKG-X.js → use-binding-C-jiWM_O.js} +1 -1
  109. package/dist/client/assets/{use-collections-BRVu5nwP.js → use-collections-BnNAdJQg.js} +1 -1
  110. package/dist/client/assets/{use-connection-D__nfNf6.js → use-connection-Cpo9FQLA.js} +1 -1
  111. package/dist/client/assets/{use-connection-resources-CaArMBqO.js → use-connection-resources-Bf67v2HN.js} +1 -1
  112. package/dist/client/assets/{use-create-virtual-mcp-CULFY9tZ.js → use-create-virtual-mcp-B5oK5D73.js} +1 -1
  113. package/dist/client/assets/{use-list-state-D7wpG1Rh.js → use-list-state-Ck_kabtn.js} +1 -1
  114. package/dist/client/assets/{use-mcp-DsR0-4yM.js → use-mcp-C4SOdL_A.js} +1 -1
  115. package/dist/client/assets/{use-members-BTTcGaAb.js → use-members-DKVZHAEo.js} +1 -1
  116. package/dist/client/assets/{use-mobile-Bw0zGvKx.js → use-mobile-Bb5jBMYm.js} +1 -1
  117. package/dist/client/assets/{use-organization-settings-DYYG9Qqm.js → use-organization-settings-BksJ8-FR.js} +1 -1
  118. package/dist/client/assets/{use-tool-call-DdCnWg9K.js → use-tool-call-CDQ4ked9.js} +1 -1
  119. package/dist/client/assets/{use-virtual-mcp-aCxo16E3.js → use-virtual-mcp-CMArCljo.js} +1 -1
  120. package/dist/client/assets/{use-virtual-mcp-system-prompt-Be4EZZHh.js → use-virtual-mcp-system-prompt-CeE5LXb5.js} +1 -1
  121. package/dist/client/assets/useInfiniteQuery-CoW_DO_L.js +1 -0
  122. package/dist/client/assets/{useMutation-DujnxbMG.js → useMutation-BYfWAlPb.js} +1 -1
  123. package/dist/client/assets/useQuery-CqMcSUvK.js +1 -0
  124. package/dist/client/assets/{value-BpSoQ0Q3.js → value-CpF7GK8s.js} +1 -1
  125. package/dist/client/assets/{view-mode-toggle--WEYRZgf.js → view-mode-toggle-C6P0fGVR.js} +1 -1
  126. package/dist/client/assets/{workflow-DtxWy1GI.js → workflow-JTUHDWeK.js} +1 -1
  127. package/dist/client/index.html +1 -1
  128. package/dist/server/cli.js +137 -137
  129. package/dist/server/migrate.js +102 -102
  130. package/dist/server/server.js +111 -111
  131. package/package.json +1 -1
  132. package/dist/client/assets/constants-VQyKSexs.js +0 -1
  133. package/dist/client/assets/useInfiniteQuery-Dee7xpCM.js +0 -1
  134. package/dist/client/assets/useQuery-CENoGrPp.js +0 -1
@@ -1 +1 @@
1
- import{bf as K,bg as E,bh as V,bi as z,bj as _,x as W,bk as X,bl as Y,r as h,bm as J,bn as Z,bo as $,bp as ee,bq as k,br as P,bs as se,bt as te,a2 as re,a8 as oe,j as m,ab as ne,a3 as g,a1 as O,a9 as ae,a6 as w,aa as Q,a5 as ie,a4 as A,aC as ue,aB as ce}from"./index-C0cxXUhv.js";function I(o,r){const e=new Set(r);return o.filter(s=>!e.has(s))}function de(o,r,e){const s=o.slice(0);return s[r]=e,s}var le=class extends K{#r;#e;#o;#n;#s;#t;#a;#i;#u;#c=[];constructor(o,r,e){super(),this.#r=o,this.#n=e,this.#o=[],this.#s=[],this.#e=[],this.setQueries(r)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(o=>{o.subscribe(r=>{this.#p(o,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(o=>{o.destroy()})}setQueries(o,r){this.#o=o,this.#n=r,E.batch(()=>{const e=this.#s,s=this.#h(this.#o);s.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const t=s.map(i=>i.observer),n=t.map(i=>i.getCurrentResult()),a=e.length!==t.length,c=t.some((i,d)=>i!==e[d]),l=a||c,v=l?!0:n.some((i,d)=>{const b=this.#e[d];return!b||!V(i,b)});!l&&!v||(l&&(this.#c=s,this.#s=t),this.#e=n,this.hasListeners()&&(l&&(I(e,t).forEach(i=>{i.destroy()}),I(t,e).forEach(i=>{i.subscribe(d=>{this.#p(i,d)})})),this.#f()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(o=>o.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(o,r){const e=this.#h(o),s=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),t=e.map(n=>n.defaultedQueryOptions.queryHash);return[s,n=>this.#l(n??s,r,t),()=>this.#d(s,e)]}#d(o,r){return r.map((e,s)=>{const t=o[s];return e.defaultedQueryOptions.notifyOnChangeProps?t:e.observer.trackResult(t,n=>{r.forEach(a=>{a.observer.trackProp(n)})})})}#l(o,r,e){if(r){const s=this.#u,t=e!==void 0&&s!==void 0&&(s.length!==e.length||e.some((n,a)=>n!==s[a]));return(!this.#t||this.#e!==this.#i||t||r!==this.#a)&&(this.#a=r,this.#i=this.#e,e!==void 0&&(this.#u=e),this.#t=z(this.#t,r(o))),this.#t}return o}#h(o){const r=new Map;this.#s.forEach(s=>{const t=s.options.queryHash;if(!t)return;const n=r.get(t);n?n.push(s):r.set(t,[s])});const e=[];return o.forEach(s=>{const t=this.#r.defaultQueryOptions(s),a=r.get(t.queryHash)?.shift()??new _(this.#r,t);e.push({defaultedQueryOptions:t,observer:a})}),e}#p(o,r){const e=this.#s.indexOf(o);e!==-1&&(this.#e=de(this.#e,e,r),this.#f())}#f(){if(this.hasListeners()){const o=this.#t,r=this.#d(this.#e,this.#c),e=this.#l(r,this.#n?.combine);o!==e&&E.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}};function Ee({queries:o,...r},e){const s=W(e),t=X(),n=Y(),a=h.useMemo(()=>o.map(u=>{const p=s.defaultQueryOptions(u);return p._optimisticResults=t?"isRestoring":"optimistic",p}),[o,s,t]);a.forEach(u=>{J(u);const p=s.getQueryCache().get(u.queryHash);Z(u,n,p)}),$(n);const[c]=h.useState(()=>new le(s,a,r)),[l,v,i]=c.getOptimisticResult(a,r.combine),d=!t&&r.subscribed!==!1;h.useSyncExternalStore(h.useCallback(u=>d?c.subscribe(E.batchCalls(u)):ee,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),h.useEffect(()=>{c.setQueries(a,r)},[a,r,c]);const f=l.some((u,p)=>k(a[p],u))?l.flatMap((u,p)=>{const y=a[p];if(y){const x=new _(s,y);if(k(y,u))return P(y,x,n);se(u,t)&&P(y,x,n)}return[]}):[];if(f.length>0)throw Promise.all(f);const R=l.find((u,p)=>{const y=a[p];return y&&te({result:u,errorResetBoundary:n,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(R?.error)throw R.error;return v(i())}var S="Radio",[he,j]=A(S),[pe,fe]=he(S),G=h.forwardRef((o,r)=>{const{__scopeRadio:e,name:s,checked:t=!1,required:n,disabled:a,value:c="on",onCheck:l,form:v,...i}=o,[d,b]=h.useState(null),f=O(r,p=>b(p)),R=h.useRef(!1),u=d?v||!!d.closest("form"):!0;return m.jsxs(pe,{scope:e,checked:t,disabled:a,children:[m.jsx(g.button,{type:"button",role:"radio","aria-checked":t,"data-state":D(t),"data-disabled":a?"":void 0,disabled:a,value:c,...i,ref:f,onClick:w(o.onClick,p=>{t||l?.(),u&&(R.current=p.isPropagationStopped(),R.current||p.stopPropagation())})}),u&&m.jsx(q,{control:d,bubbles:!R.current,name:s,value:c,checked:t,required:n,disabled:a,form:v,style:{transform:"translateX(-100%)"}})]})});G.displayName=S;var M="RadioIndicator",N=h.forwardRef((o,r)=>{const{__scopeRadio:e,forceMount:s,...t}=o,n=fe(M,e);return m.jsx(ie,{present:s||n.checked,children:m.jsx(g.span,{"data-state":D(n.checked),"data-disabled":n.disabled?"":void 0,...t,ref:r})})});N.displayName=M;var Re="RadioBubbleInput",q=h.forwardRef(({__scopeRadio:o,control:r,checked:e,bubbles:s=!0,...t},n)=>{const a=h.useRef(null),c=O(a,n),l=ue(e),v=ce(r);return h.useEffect(()=>{const i=a.current;if(!i)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==e&&f){const R=new Event("click",{bubbles:s});f.call(i,e),i.dispatchEvent(R)}},[l,e,s]),m.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:e,...t,tabIndex:-1,ref:c,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});q.displayName=Re;function D(o){return o?"checked":"unchecked"}var ve=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],C="RadioGroup",[be]=A(C,[Q,j]),L=Q(),B=j(),[me,ye]=be(C),F=h.forwardRef((o,r)=>{const{__scopeRadioGroup:e,name:s,defaultValue:t,value:n,required:a=!1,disabled:c=!1,orientation:l,dir:v,loop:i=!0,onValueChange:d,...b}=o,f=L(e),R=re(v),[u,p]=oe({prop:n,defaultProp:t??null,onChange:d,caller:C});return m.jsx(me,{scope:e,name:s,required:a,disabled:c,value:u,onValueChange:p,children:m.jsx(ne,{asChild:!0,...f,orientation:l,dir:R,loop:i,children:m.jsx(g.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":c?"":void 0,dir:R,...b,ref:r})})})});F.displayName=C;var H="RadioGroupItem",T=h.forwardRef((o,r)=>{const{__scopeRadioGroup:e,disabled:s,...t}=o,n=ye(H,e),a=n.disabled||s,c=L(e),l=B(e),v=h.useRef(null),i=O(r,v),d=n.value===t.value,b=h.useRef(!1);return h.useEffect(()=>{const f=u=>{ve.includes(u.key)&&(b.current=!0)},R=()=>b.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",R),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",R)}},[]),m.jsx(ae,{asChild:!0,...c,focusable:!a,active:d,children:m.jsx(G,{disabled:a,required:n.required,checked:d,...l,...t,name:n.name,ref:i,onCheck:()=>n.onValueChange(t.value),onKeyDown:w(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:w(t.onFocus,()=>{b.current&&v.current?.click()})})})});T.displayName=H;var ge="RadioGroupIndicator",U=h.forwardRef((o,r)=>{const{__scopeRadioGroup:e,...s}=o,t=B(e);return m.jsx(N,{...t,...s,ref:r})});U.displayName=ge;var we=F,Oe=T,Se=U;export{Oe as I,we as R,Se as a,Ee as u};
1
+ import{bf as K,bg as E,bh as V,bi as z,bj as _,x as W,bk as X,bl as Y,r as h,bm as J,bn as Z,bo as $,bp as ee,bq as k,br as P,bs as se,bt as te,a2 as re,a8 as oe,j as m,ab as ne,a3 as g,a1 as O,a9 as ae,a6 as w,aa as Q,a5 as ie,a4 as A,aC as ue,aB as ce}from"./index-B9c3bNyk.js";function I(o,r){const e=new Set(r);return o.filter(s=>!e.has(s))}function de(o,r,e){const s=o.slice(0);return s[r]=e,s}var le=class extends K{#r;#e;#o;#n;#s;#t;#a;#i;#u;#c=[];constructor(o,r,e){super(),this.#r=o,this.#n=e,this.#o=[],this.#s=[],this.#e=[],this.setQueries(r)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(o=>{o.subscribe(r=>{this.#p(o,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(o=>{o.destroy()})}setQueries(o,r){this.#o=o,this.#n=r,E.batch(()=>{const e=this.#s,s=this.#h(this.#o);s.forEach(i=>i.observer.setOptions(i.defaultedQueryOptions));const t=s.map(i=>i.observer),n=t.map(i=>i.getCurrentResult()),a=e.length!==t.length,c=t.some((i,d)=>i!==e[d]),l=a||c,v=l?!0:n.some((i,d)=>{const b=this.#e[d];return!b||!V(i,b)});!l&&!v||(l&&(this.#c=s,this.#s=t),this.#e=n,this.hasListeners()&&(l&&(I(e,t).forEach(i=>{i.destroy()}),I(t,e).forEach(i=>{i.subscribe(d=>{this.#p(i,d)})})),this.#f()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(o=>o.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(o,r){const e=this.#h(o),s=e.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),t=e.map(n=>n.defaultedQueryOptions.queryHash);return[s,n=>this.#l(n??s,r,t),()=>this.#d(s,e)]}#d(o,r){return r.map((e,s)=>{const t=o[s];return e.defaultedQueryOptions.notifyOnChangeProps?t:e.observer.trackResult(t,n=>{r.forEach(a=>{a.observer.trackProp(n)})})})}#l(o,r,e){if(r){const s=this.#u,t=e!==void 0&&s!==void 0&&(s.length!==e.length||e.some((n,a)=>n!==s[a]));return(!this.#t||this.#e!==this.#i||t||r!==this.#a)&&(this.#a=r,this.#i=this.#e,e!==void 0&&(this.#u=e),this.#t=z(this.#t,r(o))),this.#t}return o}#h(o){const r=new Map;this.#s.forEach(s=>{const t=s.options.queryHash;if(!t)return;const n=r.get(t);n?n.push(s):r.set(t,[s])});const e=[];return o.forEach(s=>{const t=this.#r.defaultQueryOptions(s),a=r.get(t.queryHash)?.shift()??new _(this.#r,t);e.push({defaultedQueryOptions:t,observer:a})}),e}#p(o,r){const e=this.#s.indexOf(o);e!==-1&&(this.#e=de(this.#e,e,r),this.#f())}#f(){if(this.hasListeners()){const o=this.#t,r=this.#d(this.#e,this.#c),e=this.#l(r,this.#n?.combine);o!==e&&E.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}};function Ee({queries:o,...r},e){const s=W(e),t=X(),n=Y(),a=h.useMemo(()=>o.map(u=>{const p=s.defaultQueryOptions(u);return p._optimisticResults=t?"isRestoring":"optimistic",p}),[o,s,t]);a.forEach(u=>{J(u);const p=s.getQueryCache().get(u.queryHash);Z(u,n,p)}),$(n);const[c]=h.useState(()=>new le(s,a,r)),[l,v,i]=c.getOptimisticResult(a,r.combine),d=!t&&r.subscribed!==!1;h.useSyncExternalStore(h.useCallback(u=>d?c.subscribe(E.batchCalls(u)):ee,[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),h.useEffect(()=>{c.setQueries(a,r)},[a,r,c]);const f=l.some((u,p)=>k(a[p],u))?l.flatMap((u,p)=>{const y=a[p];if(y){const x=new _(s,y);if(k(y,u))return P(y,x,n);se(u,t)&&P(y,x,n)}return[]}):[];if(f.length>0)throw Promise.all(f);const R=l.find((u,p)=>{const y=a[p];return y&&te({result:u,errorResetBoundary:n,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(R?.error)throw R.error;return v(i())}var S="Radio",[he,j]=A(S),[pe,fe]=he(S),G=h.forwardRef((o,r)=>{const{__scopeRadio:e,name:s,checked:t=!1,required:n,disabled:a,value:c="on",onCheck:l,form:v,...i}=o,[d,b]=h.useState(null),f=O(r,p=>b(p)),R=h.useRef(!1),u=d?v||!!d.closest("form"):!0;return m.jsxs(pe,{scope:e,checked:t,disabled:a,children:[m.jsx(g.button,{type:"button",role:"radio","aria-checked":t,"data-state":D(t),"data-disabled":a?"":void 0,disabled:a,value:c,...i,ref:f,onClick:w(o.onClick,p=>{t||l?.(),u&&(R.current=p.isPropagationStopped(),R.current||p.stopPropagation())})}),u&&m.jsx(q,{control:d,bubbles:!R.current,name:s,value:c,checked:t,required:n,disabled:a,form:v,style:{transform:"translateX(-100%)"}})]})});G.displayName=S;var M="RadioIndicator",N=h.forwardRef((o,r)=>{const{__scopeRadio:e,forceMount:s,...t}=o,n=fe(M,e);return m.jsx(ie,{present:s||n.checked,children:m.jsx(g.span,{"data-state":D(n.checked),"data-disabled":n.disabled?"":void 0,...t,ref:r})})});N.displayName=M;var Re="RadioBubbleInput",q=h.forwardRef(({__scopeRadio:o,control:r,checked:e,bubbles:s=!0,...t},n)=>{const a=h.useRef(null),c=O(a,n),l=ue(e),v=ce(r);return h.useEffect(()=>{const i=a.current;if(!i)return;const d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==e&&f){const R=new Event("click",{bubbles:s});f.call(i,e),i.dispatchEvent(R)}},[l,e,s]),m.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:e,...t,tabIndex:-1,ref:c,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});q.displayName=Re;function D(o){return o?"checked":"unchecked"}var ve=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],C="RadioGroup",[be]=A(C,[Q,j]),L=Q(),B=j(),[me,ye]=be(C),F=h.forwardRef((o,r)=>{const{__scopeRadioGroup:e,name:s,defaultValue:t,value:n,required:a=!1,disabled:c=!1,orientation:l,dir:v,loop:i=!0,onValueChange:d,...b}=o,f=L(e),R=re(v),[u,p]=oe({prop:n,defaultProp:t??null,onChange:d,caller:C});return m.jsx(me,{scope:e,name:s,required:a,disabled:c,value:u,onValueChange:p,children:m.jsx(ne,{asChild:!0,...f,orientation:l,dir:R,loop:i,children:m.jsx(g.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":c?"":void 0,dir:R,...b,ref:r})})})});F.displayName=C;var H="RadioGroupItem",T=h.forwardRef((o,r)=>{const{__scopeRadioGroup:e,disabled:s,...t}=o,n=ye(H,e),a=n.disabled||s,c=L(e),l=B(e),v=h.useRef(null),i=O(r,v),d=n.value===t.value,b=h.useRef(!1);return h.useEffect(()=>{const f=u=>{ve.includes(u.key)&&(b.current=!0)},R=()=>b.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",R),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",R)}},[]),m.jsx(ae,{asChild:!0,...c,focusable:!a,active:d,children:m.jsx(G,{disabled:a,required:n.required,checked:d,...l,...t,name:n.name,ref:i,onCheck:()=>n.onValueChange(t.value),onKeyDown:w(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:w(t.onFocus,()=>{b.current&&v.current?.click()})})})});T.displayName=H;var ge="RadioGroupIndicator",U=h.forwardRef((o,r)=>{const{__scopeRadioGroup:e,...s}=o,t=B(e);return m.jsx(N,{...t,...s,ref:r})});U.displayName=ge;var we=F,Oe=T,Se=U;export{Oe as I,we as R,Se as a,Ee as u};
@@ -1,4 +1,4 @@
1
- import{r as M,c as te,j as S,aE as zO,aF as jO,aG as qO,aH as jt,z as ee,aI as ro,aJ as a_,aK as GO,aL as VO,aM as WO,L as Ot,J as Da,I as ns,y as De,aN as pe,aD as Zn,aO as YO,aP as ze,_ as KO,V as ll,v as Vg,K as Qr,d as s_,x as Wg,t as mn,a as o_,aQ as XO,aR as ZO,B as QO,E as JO,Y as l_,aS as u_,X as eL,H as Lt,aT as tL,aU as nL,Z as c_,aV as rL,aW as xn,aX as Zl,aY as iL,aZ as Ql,a_ as aL,a$ as sL,b0 as oL,b1 as lL,b2 as uL,b3 as cL,b4 as dL,b5 as pL,f as d_,U as io,a3 as Yg,a6 as fL,a5 as hL,a8 as mL,ao as gL,a1 as bL,a7 as EL,a4 as yL}from"./index-C0cxXUhv.js";import{c as me,B as gt}from"./button-BID2CMhP.js";import{i as TL}from"./X-Bp6jT_CT.js";import{U as SL,c as ul}from"./connection-CzagOXhI.js";import{b as AL}from"./use-collections-BRVu5nwP.js";import{u as p_,a as kL}from"./use-connection-D__nfNf6.js";import{b as vL}from"./use-binding-CmWOKG-X.js";import{u as xL,M as f_,s as $E}from"./monaco-editor-Bvv8L85C.js";import{u as Gn}from"./project-context-provider-CG5Jt9jX.js";import{u as _L}from"./use-virtual-mcp-system-prompt-Be4EZZHh.js";import{u as ha,L as ao}from"./localstorage-keys-CySryjw_.js";import{I as Kg}from"./input-DHdPZHvh.js";import{a as rs,b as is,P as as}from"./popover-ffhxj7L9.js";import{S as CL,a as NL,b as IL,c as wL,d as RL}from"./select-Cd19OBy8.js";import{i as OL}from"./File06-D5XMLdKt.js";import{c as LL,i as h_}from"./Grid01-uChhmLMS.js";import{a as DL}from"./Image01-Ca9fCk1g.js";import{i as cl}from"./SearchMd-CDx95UHX.js";import{I as Xg,E as ML}from"./empty-state-aph8hymo.js";import{T as Jr,b as ei,a as Zg,c as ti}from"./tooltip-BpIeWmG3.js";import{i as dl}from"./Check-BBlt8nj4.js";import{u as PL,i as Qg}from"./use-virtual-mcp-aCxo16E3.js";import{u as FL}from"./use-create-virtual-mcp-CULFY9tZ.js";import{S as pl}from"./spinner-B3XPkxOB.js";import{E as BL,i as UL}from"./error-boundary-BSc3aikh.js";import{D as HL,a as $L,f as zL,c as jL,d as qL}from"./dialog-N6lD2G23.js";import{a as GL,F as VL,b as WL,c as YL,d as KL,f as XL}from"./form-R15NVDAL.js";import{i as m_}from"./AlertCircle-BjDAjYli.js";import{i as ZL}from"./ArrowUp-UuyzMrp7.js";import{t as QL}from"./ChevronDown-C2nnNiko.js";import{i as JL}from"./Edit01-C2f_e3xp.js";import{a as Jg}from"./Copy01-eVnag3mk.js";import{i as e2}from"./Terminal-C4vz1dQ0.js";import{O as t2,b as n2,c as r2}from"./well-known-mcp-DOEdYmKO.js";import{g as i2}from"./generate-id-Dyweu44Y.js";import{s as a2}from"./Trash01-hrLLpuYX.js";import{s as s2}from"./Plus-jsBXu2Jm.js";var Ma;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Ma||(Ma={}));var zE;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(zE||(zE={}));Ma.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Ma.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class so extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(s))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof so))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ma.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}so.create=t=>new so(t);var jE;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(jE||(jE={}));var ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));const g_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));g_.displayName="Atom02";const b_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));b_.displayName="ChevronSelectorVertical";const E_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));E_.displayName="Coins01";const y_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));y_.displayName="CurrencyDollar";const T_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));T_.displayName="Lightbulb01";const S_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));S_.displayName="LogOut04";const fl=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));fl.displayName="Stars01";const A_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));A_.displayName="Stop";const k_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));k_.displayName="Target04";const v_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));v_.displayName="XCircle";function yt(t){const e=te.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=me("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=S.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function o2(){const t=te.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ao.developerMode(),t[0]=e):e=t[0],ha(e,!1)}var x_="vercel.ai.error",l2=Symbol.for(x_),qE,GE,Cn=class __ extends(GE=Error,qE=l2,GE){constructor({name:e,message:n,cause:r}){super(n),this[qE]=!0,this.name=e,this.cause=r}static isInstance(e){return __.hasMarker(e,x_)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function C_(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var N_="AI_InvalidArgumentError",I_=`vercel.ai.error.${N_}`,u2=Symbol.for(I_),VE,WE,c2=class extends(WE=Cn,VE=u2,WE){constructor({message:t,cause:e,argument:n}){super({name:N_,message:t,cause:e}),this[VE]=!0,this.argument=n}static isInstance(t){return Cn.hasMarker(t,I_)}},w_="AI_JSONParseError",R_=`vercel.ai.error.${w_}`,d2=Symbol.for(R_),YE,KE,XE=class extends(KE=Cn,YE=d2,KE){constructor({text:t,cause:e}){super({name:w_,message:`JSON parsing failed: Text: ${t}.
1
+ import{r as M,c as te,j as S,aE as zO,aF as jO,aG as qO,aH as jt,z as ee,aI as ro,aJ as a_,aK as GO,aL as VO,aM as WO,L as Ot,J as Da,I as ns,y as De,aN as pe,aD as Zn,aO as YO,aP as ze,_ as KO,V as ll,v as Vg,K as Qr,d as s_,x as Wg,t as mn,a as o_,aQ as XO,aR as ZO,B as QO,E as JO,Y as l_,aS as u_,X as eL,H as Lt,aT as tL,aU as nL,Z as c_,aV as rL,aW as xn,aX as Zl,aY as iL,aZ as Ql,a_ as aL,a$ as sL,b0 as oL,b1 as lL,b2 as uL,b3 as cL,b4 as dL,b5 as pL,f as d_,U as io,a3 as Yg,a6 as fL,a5 as hL,a8 as mL,ao as gL,a1 as bL,a7 as EL,a4 as yL}from"./index-B9c3bNyk.js";import{c as me,B as gt}from"./button-Ta3HWdYR.js";import{i as TL}from"./X-C24Yv1HS.js";import{U as SL,c as ul}from"./connection-C0f0eQA8.js";import{b as AL}from"./use-collections-BnNAdJQg.js";import{u as p_,a as kL}from"./use-connection-Cpo9FQLA.js";import{b as vL}from"./use-binding-C-jiWM_O.js";import{u as xL,M as f_,s as $E}from"./monaco-editor-9ao1STYz.js";import{u as Gn}from"./project-context-provider-DJGvA4-w.js";import{u as _L}from"./use-virtual-mcp-system-prompt-CeE5LXb5.js";import{u as ha,L as ao}from"./localstorage-keys-DJR10CLV.js";import{I as Kg}from"./input-Dh7sDwu6.js";import{a as rs,b as is,P as as}from"./popover-nSqfHOuL.js";import{S as CL,a as NL,b as IL,c as wL,d as RL}from"./select-DEFdCmMs.js";import{i as OL}from"./File06-BOUeu2_s.js";import{c as LL,i as h_}from"./Grid01-DS_Rpsaf.js";import{a as DL}from"./Image01-C1Gj64FS.js";import{i as cl}from"./SearchMd--bzHJ7AO.js";import{I as Xg,E as ML}from"./empty-state-CSTjcp0X.js";import{T as Jr,b as ei,a as Zg,c as ti}from"./tooltip-Bb2oNaYJ.js";import{i as dl}from"./Check-qyrf_w7u.js";import{u as PL,i as Qg}from"./use-virtual-mcp-CMArCljo.js";import{u as FL}from"./use-create-virtual-mcp-B5oK5D73.js";import{S as pl}from"./spinner-CO1NH93o.js";import{E as BL,i as UL}from"./error-boundary-DP1kX1Iw.js";import{D as HL,a as $L,f as zL,c as jL,d as qL}from"./dialog-DU-St4qJ.js";import{a as GL,F as VL,b as WL,c as YL,d as KL,f as XL}from"./form-HErbLCwX.js";import{i as m_}from"./AlertCircle-CNlbeaNO.js";import{i as ZL}from"./ArrowUp-C39Etgym.js";import{t as QL}from"./ChevronDown-D4EQGXFb.js";import{i as JL}from"./Edit01-YiEPkU0g.js";import{a as Jg}from"./Copy01-EV4WWtW9.js";import{i as e2}from"./Terminal-BVYBaOBz.js";import{O as t2,b as n2,c as r2}from"./well-known-mcp-DOEdYmKO.js";import{g as i2}from"./generate-id-Dyweu44Y.js";import{s as a2}from"./Trash01-DjLKhTdL.js";import{s as s2}from"./Plus-DtbgAjWY.js";var Ma;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Ma||(Ma={}));var zE;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(zE||(zE={}));Ma.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Ma.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class so extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(s))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return i(this),r}static assert(e){if(!(e instanceof so))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ma.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}so.create=t=>new so(t);var jE;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(jE||(jE={}));var ge;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ge||(ge={}));const g_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));g_.displayName="Atom02";const b_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));b_.displayName="ChevronSelectorVertical";const E_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));E_.displayName="Coins01";const y_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));y_.displayName="CurrencyDollar";const T_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));T_.displayName="Lightbulb01";const S_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));S_.displayName="LogOut04";const fl=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));fl.displayName="Stars01";const A_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));A_.displayName="Stop";const k_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));k_.displayName="Target04";const v_=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));v_.displayName="XCircle";function yt(t){const e=te.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=me("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==i?(a=S.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=a):a=e[7],a}function o2(){const t=te.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=ao.developerMode(),t[0]=e):e=t[0],ha(e,!1)}var x_="vercel.ai.error",l2=Symbol.for(x_),qE,GE,Cn=class __ extends(GE=Error,qE=l2,GE){constructor({name:e,message:n,cause:r}){super(n),this[qE]=!0,this.name=e,this.cause=r}static isInstance(e){return __.hasMarker(e,x_)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function C_(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var N_="AI_InvalidArgumentError",I_=`vercel.ai.error.${N_}`,u2=Symbol.for(I_),VE,WE,c2=class extends(WE=Cn,VE=u2,WE){constructor({message:t,cause:e,argument:n}){super({name:N_,message:t,cause:e}),this[VE]=!0,this.argument=n}static isInstance(t){return Cn.hasMarker(t,I_)}},w_="AI_JSONParseError",R_=`vercel.ai.error.${w_}`,d2=Symbol.for(R_),YE,KE,XE=class extends(KE=Cn,YE=d2,KE){constructor({text:t,cause:e}){super({name:w_,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${C_(e)}`,cause:e}),this[YE]=!0,this.text=t}static isInstance(t){return Cn.hasMarker(t,R_)}},O_="AI_TypeValidationError",L_=`vercel.ai.error.${O_}`,p2=Symbol.for(L_),ZE,QE,Ni=class Mm extends(QE=Cn,ZE=p2,QE){constructor({value:e,cause:n}){super({name:O_,message:`Type validation failed: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${C_(n)}`,cause:n}),this[ZE]=!0,this.value=e}static isInstance(e){return Cn.hasMarker(e,L_)}static wrap({value:e,cause:n}){return Mm.isInstance(n)&&n.value===e?n:new Mm({value:e,cause:n})}},ss=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const a=n.length,s=new Array(e);for(let o=0;o<e;o++)s[o]=n[Math.random()*a|0];return s.join("")};if(t==null)return i;if(n.includes(r))throw new c2({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},f2=ss();function JE(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function wr(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function e0(t,...e){const n=new Headers(wr(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var h2=/"__proto__"\s*:/,m2=/"constructor"\s*:/;function t0(t){const e=JSON.parse(t);return e===null||typeof e!="object"||h2.test(t)===!1&&m2.test(t)===!1?e:g2(e)}function g2(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const a=r[i];a&&typeof a=="object"&&e.push(a)}}}return t}function b2(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return t0(t)}try{return t0(t)}finally{Error.stackTraceLimit=e}}function eb(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=Cr(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(Cr):Cr(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(Cr)),t.allOf!=null&&(t.allOf=t.allOf.map(Cr)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(Cr));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=Cr(e[n]);return t}function Cr(t){return typeof t=="boolean"?t:eb(t)}var E2=Symbol("Let zodToJsonSchema decide on which parser to use"),n0={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},y2=t=>typeof t=="string"?{...n0,name:t}:{...n0,...t};function Jt(){return{}}function T2(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==ge.ZodAny&&(a.items=Pe(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(a.minItems=t.minLength.value),t.maxLength&&(a.maxItems=t.maxLength.value),t.exactLength&&(a.minItems=t.exactLength.value,a.maxItems=t.exactLength.value),a}function S2(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function A2(){return{type:"boolean"}}function D_(t,e){return Pe(t.type._def,e)}var k2=(t,e)=>Pe(t.innerType._def,e);function M_(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>M_(t,e,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return v2(t)}}var v2=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function x2(t,e){return{...Pe(t.innerType._def,e),default:t.defaultValue()}}function _2(t,e){return e.effectStrategy==="input"?Pe(t.schema._def,e):Jt()}function C2(t){return{type:"string",enum:Array.from(t.values)}}var N2=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function I2(t,e){const n=[Pe(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Pe(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(N2(i))r.push(...i.allOf);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...o}=i;a=o}r.push(a)}}),r.length?{allOf:r}:void 0}function w2(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var Jl=void 0,dn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Jl===void 0&&(Jl=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Jl),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function P_(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":pn(n,"email",r.message,e);break;case"format:idn-email":pn(n,"idn-email",r.message,e);break;case"pattern:zod":Rt(n,dn.email,r.message,e);break}break;case"url":pn(n,"uri",r.message,e);break;case"uuid":pn(n,"uuid",r.message,e);break;case"regex":Rt(n,r.regex,r.message,e);break;case"cuid":Rt(n,dn.cuid,r.message,e);break;case"cuid2":Rt(n,dn.cuid2,r.message,e);break;case"startsWith":Rt(n,RegExp(`^${eu(r.value,e)}`),r.message,e);break;case"endsWith":Rt(n,RegExp(`${eu(r.value,e)}$`),r.message,e);break;case"datetime":pn(n,"date-time",r.message,e);break;case"date":pn(n,"date",r.message,e);break;case"time":pn(n,"time",r.message,e);break;case"duration":pn(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{Rt(n,RegExp(eu(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&pn(n,"ipv4",r.message,e),r.version!=="v4"&&pn(n,"ipv6",r.message,e);break}case"base64url":Rt(n,dn.base64url,r.message,e);break;case"jwt":Rt(n,dn.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Rt(n,dn.ipv4Cidr,r.message,e),r.version!=="v4"&&Rt(n,dn.ipv6Cidr,r.message,e);break}case"emoji":Rt(n,dn.emoji(),r.message,e);break;case"ulid":{Rt(n,dn.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{pn(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Rt(n,dn.base64,r.message,e);break}}break}case"nanoid":Rt(n,dn.nanoid,r.message,e)}return n}function eu(t,e){return e.patternStrategy==="escape"?O2(t):t}var R2=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function O2(t){let e="";for(let n=0;n<t.length;n++)R2.has(t[n])||(e+="\\"),e+=t[n];return e}function pn(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(a=>a.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function Rt(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(a=>a.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:r0(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=r0(e,r)}function r0(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source;let a="",s=!1,o=!1,l=!1;for(let u=0;u<i.length;u++){if(s){a+=i[u],s=!1;continue}if(r.i){if(o){if(i[u].match(/[a-z]/)){l?(a+=i[u],a+=`${i[u-2]}-${i[u]}`.toUpperCase(),l=!1):i[u+1]==="-"&&((n=i[u+2])!=null&&n.match(/[a-z]/))?(a+=i[u],l=!0):a+=`${i[u]}${i[u].toUpperCase()}`;continue}}else if(i[u].match(/[a-z]/)){a+=`[${i[u]}${i[u].toUpperCase()}]`;continue}}if(r.m){if(i[u]==="^"){a+=`(^|(?<=[\r
4
4
  ]))`;continue}else if(i[u]==="$"){a+=`($|(?=[\r
@@ -1 +1 @@
1
- import{bj as d,c0 as f,c1 as v,c2 as b}from"./index-C0cxXUhv.js";var N=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{N as I};
1
+ import{bj as d,c0 as f,c1 as v,c2 as b}from"./index-B9c3bNyk.js";var N=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{N as I};
@@ -1 +1 @@
1
- import{c as s,j as a}from"./index-C0cxXUhv.js";import{c as d}from"./button-BID2CMhP.js";function p(l){const e=s.c(10);let i,r,t;e[0]!==l?({className:i,type:t,...r}=l,e[0]=l,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let n;e[4]!==i?(n=d("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] bg-background","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==n||e[8]!==t?(o=a.jsx("input",{type:t,"data-slot":"input",className:n,...r}),e[6]=r,e[7]=n,e[8]=t,e[9]=o):o=e[9],o}export{p as I};
1
+ import{c as s,j as a}from"./index-B9c3bNyk.js";import{c as d}from"./button-Ta3HWdYR.js";function p(l){const e=s.c(10);let i,r,t;e[0]!==l?({className:i,type:t,...r}=l,e[0]=l,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let n;e[4]!==i?(n=d("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] bg-background","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==n||e[8]!==t?(o=a.jsx("input",{type:t,"data-slot":"input",className:n,...r}),e[6]=r,e[7]=n,e[8]=t,e[9]=o):o=e[9],o}export{p as I};
@@ -1 +1 @@
1
- import{c as E,r as f,Y as v,j as l}from"./index-C0cxXUhv.js";import{B as w}from"./button-BID2CMhP.js";import{i as k}from"./ArrowLeft-C3b0kZkv.js";const j=f.createContext(null);function S(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.tabsEl)return null;let t;return e[0]!==r||e[1]!==s.tabsEl?(t=v.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=t):t=e[2],t}function _(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.actionsEl)return null;let t;return e[0]!==r||e[1]!==s.actionsEl?(t=v.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=t):t=e[2],t}function B(x){const e=E.c(20),{children:r,onBack:s,title:t}=x,[h,N]=f.useState(null),[p,g]=f.useState(null);let n;e[0]!==p||e[1]!==h?(n={tabsEl:h,actionsEl:p},e[0]=p,e[1]=h,e[2]=n):n=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(k,{}),e[3]=u):u=e[3];let i;e[4]!==s?(i=l.jsx("div",{className:"flex h-full px-2 border-r items-center",children:l.jsx(w,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:s,children:u})}),e[4]=s,e[5]=i):i=e[5];let c;e[6]!==t?(c=t&&l.jsx("div",{className:"flex items-center gap-2 px-2",children:l.jsx("p",{className:"text-sm font-medium",children:t})}),e[6]=t,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsxs("div",{className:"flex px-4 items-center gap-0 flex-1 min-w-0",children:[l.jsx("div",{ref:N,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),l.jsx("div",{ref:g,className:"flex items-center gap-2 ml-auto shrink-0 border-l border-border pl-4"})]}),e[8]=d):d=e[8];let o;e[9]!==i||e[10]!==c?(o=l.jsxs("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:[i,c,d]}),e[9]=i,e[10]=c,e[11]=o):o=e[11];let a;e[12]!==r?(a=l.jsx("div",{className:"flex-1 overflow-auto",children:r}),e[12]=r,e[13]=a):a=e[13];let m;e[14]!==o||e[15]!==a?(m=l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o,a]}),e[14]=o,e[15]=a,e[16]=m):m=e[16];let b;return e[17]!==n||e[18]!==m?(b=l.jsx(j,{value:n,children:m}),e[17]=n,e[18]=m,e[19]=b):b=e[19],b}export{_ as V,S as a,B as b};
1
+ import{c as E,r as f,Y as v,j as l}from"./index-B9c3bNyk.js";import{B as w}from"./button-Ta3HWdYR.js";import{i as k}from"./ArrowLeft-H58XLYPH.js";const j=f.createContext(null);function S(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.tabsEl)return null;let t;return e[0]!==r||e[1]!==s.tabsEl?(t=v.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=t):t=e[2],t}function _(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.actionsEl)return null;let t;return e[0]!==r||e[1]!==s.actionsEl?(t=v.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=t):t=e[2],t}function B(x){const e=E.c(20),{children:r,onBack:s,title:t}=x,[h,N]=f.useState(null),[p,g]=f.useState(null);let n;e[0]!==p||e[1]!==h?(n={tabsEl:h,actionsEl:p},e[0]=p,e[1]=h,e[2]=n):n=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(k,{}),e[3]=u):u=e[3];let i;e[4]!==s?(i=l.jsx("div",{className:"flex h-full px-2 border-r items-center",children:l.jsx(w,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:s,children:u})}),e[4]=s,e[5]=i):i=e[5];let c;e[6]!==t?(c=t&&l.jsx("div",{className:"flex items-center gap-2 px-2",children:l.jsx("p",{className:"text-sm font-medium",children:t})}),e[6]=t,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsxs("div",{className:"flex px-4 items-center gap-0 flex-1 min-w-0",children:[l.jsx("div",{ref:N,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),l.jsx("div",{ref:g,className:"flex items-center gap-2 ml-auto shrink-0 border-l border-border pl-4"})]}),e[8]=d):d=e[8];let o;e[9]!==i||e[10]!==c?(o=l.jsxs("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:[i,c,d]}),e[9]=i,e[10]=c,e[11]=o):o=e[11];let a;e[12]!==r?(a=l.jsx("div",{className:"flex-1 overflow-auto",children:r}),e[12]=r,e[13]=a):a=e[13];let m;e[14]!==o||e[15]!==a?(m=l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o,a]}),e[14]=o,e[15]=a,e[16]=m):m=e[16];let b;return e[17]!==n||e[18]!==m?(b=l.jsx(j,{value:n,children:m}),e[17]=n,e[18]=m,e[19]=b):b=e[19],b}export{_ as V,S as a,B as b};
@@ -1 +1 @@
1
- import{c as O,x}from"./index-C0cxXUhv.js";import{u as I}from"./useQuery-CENoGrPp.js";import{u as L}from"./useMutation-DujnxbMG.js";function M(e){try{return JSON.parse(e)}catch{return}}function $(e,s){const t=localStorage.getItem(e),o=t?M(t):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(e,a)}catch{}return n}function A(e,s){const t=O.c(25),o=x();let n;t[0]!==e?(n=["localStorage",e],t[0]=e,t[1]=n):n=t[1];const a=n;let r,i;t[2]!==s||t[3]!==e?(r=()=>$(e,s),i=()=>$(e,s),t[2]=s,t[3]=e,t[4]=r,t[5]=i):(r=t[4],i=t[5]);let u;t[6]!==a||t[7]!==r||t[8]!==i?(u={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=a,t[7]=r,t[8]=i,t[9]=u):u=t[9];const{data:v}=I(u);let l;t[10]!==e?(l=async c=>{const y=JSON.stringify(c);return localStorage.setItem(e,y),c},t[10]=e,t[11]=l):l=t[11];let m;t[12]!==o||t[13]!==a?(m=c=>{o.setQueryData(a,c)},t[12]=o,t[13]=a,t[14]=m):m=t[14];let h;t[15]!==l||t[16]!==m?(h={mutationFn:l,onSuccess:m},t[15]=l,t[16]=m,t[17]=h):h=t[17];const g=L(h);let d;t[18]!==g||t[19]!==o||t[20]!==a?(d=c=>{const y=o.getQueryData(a),C=typeof c=="function"?c(y):c;g.mutate(C)},t[18]=g,t[19]=o,t[20]=a,t[21]=d):d=t[21];const p=d,S=v;let f;return t[22]!==p||t[23]!==S?(f=[S,p],t[22]=p,t[23]=S,t[24]=f):f=t[24],f}const D={assistantChatThreads:e=>`mesh:assistant-chat:threads:${e}`,messages:(e,s)=>`mesh:messages:${e}:${s}`,decoChatOpen:()=>"mesh:decochat:open",chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:e=>`mesh:assistant-chat:active-thread:${e}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,virtualMcpSystemPrompts:e=>`mesh:virtual-mcp:system-prompts:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(e,s)=>`mesh:plugin:connection:${e}:${s}`};export{D as L,A as u};
1
+ import{c as O,x}from"./index-B9c3bNyk.js";import{u as I}from"./useQuery-CqMcSUvK.js";import{u as L}from"./useMutation-BYfWAlPb.js";function M(e){try{return JSON.parse(e)}catch{return}}function $(e,s){const t=localStorage.getItem(e),o=t?M(t):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(e,a)}catch{}return n}function A(e,s){const t=O.c(25),o=x();let n;t[0]!==e?(n=["localStorage",e],t[0]=e,t[1]=n):n=t[1];const a=n;let r,i;t[2]!==s||t[3]!==e?(r=()=>$(e,s),i=()=>$(e,s),t[2]=s,t[3]=e,t[4]=r,t[5]=i):(r=t[4],i=t[5]);let u;t[6]!==a||t[7]!==r||t[8]!==i?(u={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=a,t[7]=r,t[8]=i,t[9]=u):u=t[9];const{data:v}=I(u);let l;t[10]!==e?(l=async c=>{const y=JSON.stringify(c);return localStorage.setItem(e,y),c},t[10]=e,t[11]=l):l=t[11];let m;t[12]!==o||t[13]!==a?(m=c=>{o.setQueryData(a,c)},t[12]=o,t[13]=a,t[14]=m):m=t[14];let h;t[15]!==l||t[16]!==m?(h={mutationFn:l,onSuccess:m},t[15]=l,t[16]=m,t[17]=h):h=t[17];const g=L(h);let d;t[18]!==g||t[19]!==o||t[20]!==a?(d=c=>{const y=o.getQueryData(a),C=typeof c=="function"?c(y):c;g.mutate(C)},t[18]=g,t[19]=o,t[20]=a,t[21]=d):d=t[21];const p=d,S=v;let f;return t[22]!==p||t[23]!==S?(f=[S,p],t[22]=p,t[23]=S,t[24]=f):f=t[24],f}const D={assistantChatThreads:e=>`mesh:assistant-chat:threads:${e}`,messages:(e,s)=>`mesh:messages:${e}:${s}`,decoChatOpen:()=>"mesh:decochat:open",chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:e=>`mesh:assistant-chat:active-thread:${e}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,virtualMcpSystemPrompts:e=>`mesh:virtual-mcp:system-prompts:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(e,s)=>`mesh:plugin:connection:${e}:${s}`};export{D as L,A as u};
@@ -1 +1 @@
1
- import{u as k,r as p,a as j,j as e,b as z,S as L,N as R,c as U}from"./index-C0cxXUhv.js";import{u as T}from"./useMutation-DujnxbMG.js";import{c as b,B as P}from"./button-BID2CMhP.js";import{I as E}from"./input-DHdPZHvh.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function Y(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{Y as default};
1
+ import{u as k,r as p,a as j,j as e,b as z,S as L,N as R,c as U}from"./index-B9c3bNyk.js";import{u as T}from"./useMutation-BYfWAlPb.js";import{c as b,B as P}from"./button-Ta3HWdYR.js";import{I as E}from"./input-Dh7sDwu6.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function Y(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{Y as default};
@@ -1 +1 @@
1
- import{bV as M,bW as V,bX as $,bY as P}from"./index-C0cxXUhv.js";function y(n){let e=0;for(let t=0;t<n.length;t++){const o=n.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}const U=new Map,I="mcp:oauth:callback:";class L{serverUrl;_clientMetadata;_redirectUrl;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`;const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},U.set(y(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){const c=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${c},top=${s},popup=yes`)}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){U.delete(y(this.serverUrl))}}async function H(n){const e=new URL(`/mcp/${n.connectionId}`,window.location.origin),t=new L({serverUrl:e.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope});try{const o=new Promise((r,a)=>{const T=n.timeout||12e4;let w,d=!1;const O=t.state(),k=`${I}${O}`,l=()=>{window.removeEventListener("message",_),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(k)}catch{}},m=async i=>{if(d)return;if(d=!0,!i.success){l(),a(new Error(i.error||"OAuth authentication failed"));return}const{code:f,state:b}=i;if(!f){l(),a(new Error("Missing authorization code"));return}if(t.getStoredState()!==b){l(),a(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const A=(await M(e))?.authorization_servers?.[0]||e,v=await V(A),h=t.clientInformation();if(!h){l(),a(new Error("Client information not found"));return}const E=t.codeVerifier(),C=await $(A,{metadata:v,clientInformation:h,authorizationCode:f,codeVerifier:E,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:C,clientId:h.client_id??null,clientSecret:"client_secret"in h?h.client_secret:null,tokenEndpoint:v?.token_endpoint??null})}catch(S){l(),a(S)}},_=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await m(i.data)},g=async i=>{if(!(i.key!==k||!i.newValue))try{const f=JSON.parse(i.newValue);await m(f)}catch{}};window.addEventListener("message",_),window.addEventListener("storage",g),w=setTimeout(()=>{d||(d=!0,l(),a(new Error("OAuth authentication timeout")))},T)});if(await P(t,{serverUrl:e})==="REDIRECT"){const r=await o;return{token:r.tokens.access_token,tokenInfo:{accessToken:r.tokens.access_token,refreshToken:r.tokens.refresh_token??null,expiresIn:r.tokens.expires_in??null,scope:r.tokens.scope??null,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint},error:null}}const s=t.tokens(),u=t.clientInformation();return{token:s?.access_token||null,tokenInfo:s?{accessToken:s.access_token,refreshToken:s.refresh_token??null,expiresIn:s.expires_in??null,scope:s.scope??null,clientId:u?.client_id??null,clientSecret:u&&"client_secret"in u?u.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{t.cleanup()}}function p(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${I}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function W(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),c=n.get("error_description");let s=t;if(t)try{const r=atob(t),a=JSON.parse(r);a.clientState&&(s=a.clientState)}catch{}if(o){const r=c||o;return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}if(!e||!t){const r="Missing code or state parameter";return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}return t=s||t,p({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function R(n){try{return new URL(n).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function x(n){try{const e=await fetch(`/api/connections/${n}/oauth-token/status`,{credentials:"include"});return e.ok?{hasToken:(await e.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function j({url:n,token:e}){try{const t=new Headers;t.set("Content-Type","application/json"),t.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),c=R(n);if(o.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(c?await x(c):{hasToken:!1}).hasToken};let s;try{const a=await o.json();s=a.error||a.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:s||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:s||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:t.message}}}export{H as a,W as h,j as i};
1
+ import{bV as M,bW as V,bX as $,bY as P}from"./index-B9c3bNyk.js";function y(n){let e=0;for(let t=0;t<n.length;t++){const o=n.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}const U=new Map,I="mcp:oauth:callback:";class L{serverUrl;_clientMetadata;_redirectUrl;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`;const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},U.set(y(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){const c=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${c},top=${s},popup=yes`)}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){U.delete(y(this.serverUrl))}}async function H(n){const e=new URL(`/mcp/${n.connectionId}`,window.location.origin),t=new L({serverUrl:e.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope});try{const o=new Promise((r,a)=>{const T=n.timeout||12e4;let w,d=!1;const O=t.state(),k=`${I}${O}`,l=()=>{window.removeEventListener("message",_),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(k)}catch{}},m=async i=>{if(d)return;if(d=!0,!i.success){l(),a(new Error(i.error||"OAuth authentication failed"));return}const{code:f,state:b}=i;if(!f){l(),a(new Error("Missing authorization code"));return}if(t.getStoredState()!==b){l(),a(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const A=(await M(e))?.authorization_servers?.[0]||e,v=await V(A),h=t.clientInformation();if(!h){l(),a(new Error("Client information not found"));return}const E=t.codeVerifier(),C=await $(A,{metadata:v,clientInformation:h,authorizationCode:f,codeVerifier:E,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:C,clientId:h.client_id??null,clientSecret:"client_secret"in h?h.client_secret:null,tokenEndpoint:v?.token_endpoint??null})}catch(S){l(),a(S)}},_=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await m(i.data)},g=async i=>{if(!(i.key!==k||!i.newValue))try{const f=JSON.parse(i.newValue);await m(f)}catch{}};window.addEventListener("message",_),window.addEventListener("storage",g),w=setTimeout(()=>{d||(d=!0,l(),a(new Error("OAuth authentication timeout")))},T)});if(await P(t,{serverUrl:e})==="REDIRECT"){const r=await o;return{token:r.tokens.access_token,tokenInfo:{accessToken:r.tokens.access_token,refreshToken:r.tokens.refresh_token??null,expiresIn:r.tokens.expires_in??null,scope:r.tokens.scope??null,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint},error:null}}const s=t.tokens(),u=t.clientInformation();return{token:s?.access_token||null,tokenInfo:s?{accessToken:s.access_token,refreshToken:s.refresh_token??null,expiresIn:s.expires_in??null,scope:s.scope??null,clientId:u?.client_id??null,clientSecret:u&&"client_secret"in u?u.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{t.cleanup()}}function p(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${I}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function W(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),c=n.get("error_description");let s=t;if(t)try{const r=atob(t),a=JSON.parse(r);a.clientState&&(s=a.clientState)}catch{}if(o){const r=c||o;return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}if(!e||!t){const r="Missing code or state parameter";return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}return t=s||t,p({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function R(n){try{return new URL(n).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function x(n){try{const e=await fetch(`/api/connections/${n}/oauth-token/status`,{credentials:"include"});return e.ok?{hasToken:(await e.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function j({url:n,token:e}){try{const t=new Headers;t.set("Content-Type","application/json"),t.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),c=R(n);if(o.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(c?await x(c):{hasToken:!1}).hasToken};let s;try{const a=await o.json();s=a.error||a.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:s||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:s||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:t.message}}}export{H as a,W as h,j as i};
@@ -1 +1 @@
1
- import{r as B,c as V,j as a}from"./index-C0cxXUhv.js";import{b as O,T as q,c as J}from"./tooltip-BpIeWmG3.js";import{c as M,B as K}from"./button-BID2CMhP.js";import{s as Q}from"./registry-utils-Cqqa8TSE.js";import{i as X}from"./Lock01-Irv7dEl1.js";import{s as Y}from"./Plus-jsBXu2Jm.js";import{i as ee}from"./Terminal-C4vz1dQ0.js";import{C as te}from"./card-6juGo41K.js";import{I as se}from"./empty-state-aph8hymo.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(Q,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(ee,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(se,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(X,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(O,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(q,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(J,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(K,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(Y,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(te,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};
1
+ import{r as B,c as V,j as a}from"./index-B9c3bNyk.js";import{b as O,T as q,c as J}from"./tooltip-Bb2oNaYJ.js";import{c as M,B as K}from"./button-Ta3HWdYR.js";import{s as Q}from"./registry-utils-BKwhzouz.js";import{i as X}from"./Lock01-Bc4skRDc.js";import{s as Y}from"./Plus-DtbgAjWY.js";import{i as ee}from"./Terminal-BVYBaOBz.js";import{C as te}from"./card-CRtF9cdr.js";import{I as se}from"./empty-state-CSTjcp0X.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(Q,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(ee,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(se,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(X,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(O,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(q,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(J,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(K,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(Y,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(te,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};
@@ -1 +1 @@
1
- import{r as q,c as R,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-C0cxXUhv.js";import{i as Ze}from"./AlertCircle-BjDAjYli.js";import{i as De}from"./Loading01-CVbOjnPi.js";import{B as ae,c as Je}from"./button-BID2CMhP.js";import{i as et}from"./ArrowLeft-C3b0kZkv.js";import{I as Re,E as tt}from"./empty-state-aph8hymo.js";import{i as st,e as ot}from"./extract-connection-data-DsBhcJbM.js";import{t as rt}from"./ChevronDown-C2nnNiko.js";import{s as Pe}from"./Plus-jsBXu2Jm.js";import{D as nt,c as it,a as lt,b as at}from"./dropdown-menu-CZuHPcK3.js";import{n as Me}from"./LinkExternal01-DYbIdjWG.js";import{T as ct,R as dt}from"./tools-list-DcCgeTm7.js";import{R as mt}from"./resource-tabs-B6SPH4Q6.js";import{s as ft,f as ut,g as pt,c as xt}from"./registry-utils-Cqqa8TSE.js";import{a as ht,b as gt,e as vt}from"./mcp-server-card-utdZ5S32.js";import{i as bt}from"./Terminal-C4vz1dQ0.js";import{a as jt,u as yt,b as Nt}from"./use-connection-D__nfNf6.js";import{u as St}from"./use-binding-CmWOKG-X.js";import{u as Ct}from"./use-tool-call-DdCnWg9K.js";import{u as wt}from"./use-mcp-DsR0-4yM.js";import{u as _t,L as It}from"./localstorage-keys-CySryjw_.js";import{u as Ee}from"./project-context-provider-CG5Jt9jX.js";import{s as kt}from"./slugify-CEUa2lfQ.js";import{e as Tt,g as Lt}from"./github-icon-Dp3wHhYE.js";import{i as Pt}from"./InfoCircle-ZFVXEe-o.js";import{c as Mt}from"./connection-CzagOXhI.js";import"./constants-VQyKSexs.js";import"./generate-id-Dyweu44Y.js";import"./Grid01-uChhmLMS.js";import"./useQuery-CENoGrPp.js";import"./File06-D5XMLdKt.js";import"./collection-display-button-CES97i9G.js";import"./ArrowUp-UuyzMrp7.js";import"./Check-BBlt8nj4.js";import"./List-DTNJ5e_Z.js";import"./tooltip-BpIeWmG3.js";import"./view-mode-toggle--WEYRZgf.js";import"./collection-search-CYQ70Hoa.js";import"./SearchMd-CDx95UHX.js";import"./input-DHdPZHvh.js";import"./collection-table-wrapper-CVkp-9hJ.js";import"./card-6juGo41K.js";import"./layout-DVqtFrGe.js";import"./badge-DIpSEo79.js";import"./Lock01-Irv7dEl1.js";import"./use-collections-BRVu5nwP.js";import"./useMutation-DujnxbMG.js";import"./binder-QE3BUq_4.js";const Ae=({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"}));Ae.displayName="SearchLg";function Vt(t){const e=R.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function $t(t){const e=R.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ze,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,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]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function Dt(t){const e=R.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ae,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,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]=a):a=e[4],a}function Rt(t){const e=R.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(et,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=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(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=R.c(28),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,_=c===void 0?!1:c,p=o[r],y=_?"sm":"default",b=d==="brand"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let I;e[0]!==b?(I=Je("shrink-0 cursor-pointer",b),e[0]=b,e[1]=I):I=e[1];let m;e[2]!==p?.server?.version||e[3]!==_?(m=_&&s.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=_,e[4]=m):m=e[4];const N=_?14:20;let f;e[5]!==N?(f=s.jsx(rt,{size:N}),e[5]=N,e[6]=f):f=e[6];let v;e[7]!==l||e[8]!==y||e[9]!==I||e[10]!==m||e[11]!==f||e[12]!==d?(v=s.jsx(nt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:y,className:I,children:[m,f]})}),e[7]=l,e[8]=y,e[9]=I,e[10]=m,e[11]=f,e[12]=d,e[13]=v):v=e[13];let x;if(e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==o){let g;e[19]!==l||e[20]!==n||e[21]!==r?(g=(S,C)=>{const P=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(it,{onClick:()=>n(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"]}),P?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===r&&s.jsx(st,{size:16,className:"text-muted-foreground shrink-0"})]})},C)},e[19]=l,e[20]=n,e[21]=r,e[22]=g):g=e[22],x=o.map(g),e[14]=l,e[15]=n,e[16]=r,e[17]=o,e[18]=x}else x=e[18];let k;e[23]!==x?(k=s.jsx(lt,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:x}),e[23]=x,e[24]=k):k=e[24];let j;return e[25]!==v||e[26]!==k?(j=s.jsxs(at,{children:[v,k]}),e[25]=v,e[26]=k,e[27]=j):j=e[27],j}function Et(t){const e=R.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,_=i===void 0?!0:i,p=a===void 0?!1:a,y=c===void 0?!1:c,[b,I]=q.useState(0),m=l??b;let N;e[0]!==d?(N=U=>{I(U),d?.(U)},e[0]=d,e[1]=N):N=e[1];const f=N,v=r[m]||r[0];let x;e[2]!==v?.server?.remotes?(x=v?.server?.remotes??[],e[2]=v?.server?.remotes,e[3]=x):x=e[3];const k=x;let j;e[4]!==v?.server?.packages?(j=v?.server?.packages??[],e[4]=v?.server?.packages,e[5]=j):j=e[5];const S=j.length>0,C=k.length>0,P=k.findIndex(Ut),h=P>=0?P:0;let K;e[6]!==h||e[7]!==S||e[8]!==C||e[9]!==n||e[10]!==m?(K=()=>{C?n(m,h,void 0):S&&n(m,void 0,0)},e[6]=h,e[7]=S,e[8]=C,e[9]=n,e[10]=m,e[11]=K):K=e[11];const E=K;let G;e[12]!==r||e[13]!==n||e[14]!==f?(G=U=>{f(U);const J=r[U],W=J?.server?.remotes??[],Q=J?.server?.packages??[];if(W.length>0){const X=W.findIndex(At);n(U,X>=0?X:0,void 0)}else Q.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=f,e[15]=G):G=e[15];const L=G;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Re,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let M;e[19]!==o.name?(M=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=M):M=e[20];let z;e[21]!==o.verified?(z=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=z):z=e[22];let O;e[23]!==M||e[24]!==z?(O=s.jsxs("div",{className:"flex items-center gap-2",children:[M,z]}),e[23]=M,e[24]=z,e[25]=O):O=e[25];let H;e[26]!==o.shortDescription?(H=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=H):H=e[27];let $;e[28]!==O||e[29]!==H?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,H]}),e[28]=O,e[29]=H,e[30]=$):$=e[30];let A;e[31]!==_||e[32]!==E||e[33]!==L||e[34]!==y||e[35]!==p||e[36]!==r||e[37]!==m||e[38]!==f?(A=_&&!y?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:E,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),p?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:m,onSelect:L,isInstalling:p,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:E,disabled:r.length===0||p,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),p?"Connecting...":"Connect"]})}):y?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:m,onSelect:f,isInstalling:p,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=_,e[32]=E,e[33]=L,e[34]=y,e[35]=p,e[36]=r,e[37]=m,e[38]=f,e[39]=A):A=e[39];let w;e[40]!==$||e[41]!==A?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=w):w=e[42];let T;return e[43]!==w||e[44]!==V?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,w]}),e[43]=w,e[44]=V,e[45]=T):T=e[45],T}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Bt(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 zt(t){const e=R.c(47),{data:o,publisherInfo:r,selectedItem:n}=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 a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Re,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=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 d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let _;e[9]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=_):_=e[9];let p;e[10]!==d?(p=s.jsxs("div",{children:[d,_]}),e[10]=d,e[11]=p):p=e[11];let y;e[12]!==c||e[13]!==p?(y=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,p]})}),e[12]=c,e[13]=p,e[14]=y):y=e[14];let b;e[15]!==o.version?(b=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[15]=o.version,e[16]=b):b=e[16];let I;e[17]!==o.tags?(I=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ft)})]}),e[17]=o.tags,e[18]=I):I=e[18];let m;e[19]!==o.categories?(m=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(Ot)})]}),e[19]=o.categories,e[20]=m):m=e[20];let N;e[21]!==o.connectionType?(N=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]=N):N=e[22];let f;e[23]!==o.schemaVersion?(f=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]=f):f=e[24];let v;e[25]!==o.websiteUrl?(v=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(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=v):v=e[26];let x;e[27]!==o.repository?(x=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(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let k;e[29]!==I||e[30]!==m||e[31]!==N||e[32]!==f||e[33]!==v||e[34]!==x||e[35]!==b?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[b,I,m,N,f,v,x]}),e[29]=I,e[30]=m,e[31]=N,e[32]=f,e[33]=v,e[34]=x,e[35]=b,e[36]=k):k=e[36];let j;e[37]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=j):j=e[37];let g;e[38]!==n.updated_at?(g=Bt(n.updated_at),e[38]=n.updated_at,e[39]=g):g=e[39];let S;e[40]!==g?(S=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[j,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[40]=g,e[41]=S):S=e[41];let C;return e[42]!==i||e[43]!==k||e[44]!==S||e[45]!==y?(C=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,y,k,S]}),e[42]=i,e[43]=k,e[44]=S,e[45]=y,e[46]=C):C=e[46],C}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ft(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Gt=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Ht={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Wt(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function qt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function Kt(t){const e=Ht[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Qt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Xt(t){return t.map((e,o)=>{const r=Qt(e.type),n=Wt(e.url),i=qt(e.url),a=e.title||e.name||Kt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Yt(t){const e=R.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(ft,{className:r}),sse:s.jsx(gt,{className:r}),stdio:s.jsx(bt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Zt(t){const e=R.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Yt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Jt(t){const e=R.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,_=d?o:o.filter(os),p=Xt(_),y=p.length<13?"all":"http",[b,I]=q.useState(y);let m;e:{if(b==="all"){m="all";break e}let h;if(e[0]!==b?(h=E=>E.protocol===b,e[0]=b,e[1]=h):h=e[1],p.some(h)){m=b;break e}if(p.length<13){m="all";break e}m=p[0]?.protocol??"http"}const N=m,f=N==="all"?p:p.filter(h=>h.protocol===N),v=new Set(p.map(ss));let x=Gt.filter(h=>h.value==="all"||v.has(h.value));d||(x=x.filter(ts));const k=v.size<=1?x.filter(es):x,j="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let g;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(g=h=>s.jsx(ht,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=g):g=e[6];const S=f.map(g);let C;e[7]!==S?(C=s.jsx("div",{className:j,children:S}),e[7]=S,e[8]=C):C=e[8];let P;return e[9]!==f.length?(P=f.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=f.length,e[10]=P):P=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Zt,{options:k,selected:N,onSelect:I}),C,P]})}function es(t){return t.value!=="all"}function ts(t){return t.value!=="stdio"}function ss(t){return t.protocol}function os(t){return t.type?.toLowerCase()!=="stdio"}function rs(t){const e=R.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:_,mcpIcon:p,mcpName:y,showStdio:b}=t,I=a===void 0?!1:a;let m;e[0]!==l?(m=l===void 0?[]:l,e[0]=l,e[1]=m):m=e[1];const N=m,f=_===void 0?!1:_,v=b===void 0?!1:b;let x;e[2]!==i?(x=i.map(ns),e[2]=i,e[3]=x):x=e[3];const k=x;let j;e[4]!==r||e[5]!==n||e[6]!==c?(j=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(mt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=j):j=e[7];let g;e[8]!==n||e[9]!==f||e[10]!==p||e[11]!==y||e[12]!==d||e[13]!==N||e[14]!==v?(g=n==="servers"&&N.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Jt,{servers:N,onInstall:h=>d?.(h),isInstalling:f,icon:p,mcpName:y,showStdio:v})}),e[8]=n,e[9]=f,e[10]=p,e[11]=y,e[12]=d,e[13]=N,e[14]=v,e[15]=g):g=e[15];let S;e[16]!==n||e[17]!==i.length||e[18]!==I||e[19]!==k?(S=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:I?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(ct,{tools:k,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(tt,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=I,e[19]=k,e[20]=S):S=e[20];let C;e[21]!==o?.repository||e[22]!==n?(C=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(dt,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=C):C=e[23];let P;return e[24]!==C||e[25]!==j||e[26]!==g||e[27]!==S?(P=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[j,g,S,C]}),e[24]=C,e[25]=j,e[26]=g,e[27]=S,e[28]=P):P=e[28],P}function ns(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function is(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function ls(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=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||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function as(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=pt(r.remotes?.[0]?.type),i=xt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Lt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",_=vt(d),p=e?.friendly_name||_,y=e?.mesh_description||t.description||t.summary||r?.description||"",b=e?.short_description||null,I=e?.tags||[],m=e?.categories||[];return{name:p,description:y,shortDescription:b,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:I,categories:m,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 cs extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx($t,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ds(){const t=R.c(67),{org:e}=Ee(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=It.storeShowStdio(),t[2]=d):d=t[2];const[_,p]=_t(d,ys),y=l==="true"?!0:l==="false"?!1:_;l!==void 0&&l==="true"!==_&&p(l==="true");const[b,I]=q.useState(null),[m,N]=q.useState(null),f=jt(),v=yt(),{data:x}=Ye.useSession(),k=St(v),j=a||k[0]?.id||"",g=Nt(j),S=ut(g?.tools),C=g?.tools&&g.tools.find(js)?.name||"",P=g?.tools&&g.tools.find(bs)?.name||"",h=Mt(j),K=!!c;let E,G;K?(E=C||P,G={name:c}):(E=S,G={});const{data:L}=Ct({toolCaller:h,toolName:E,toolInputParams:G,scope:j});let V=[],M=[],z=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(z=L.totalCount),"item"in L&&L.item){const u=L.item,D=u.id||"",Z=u.server,le=u._meta;let B;t[3]!==u.title||t[4]!==D||t[5]!==Z||t[6]!==le?(B=[{id:D,title:u.title,server:Z,_meta:le}],t[3]=u.title,t[4]=D,t[5]=Z,t[6]=le,t[7]=B):B=t[7],V=B}else{let u;"versions"in L&&Array.isArray(L.versions)?u="versions":"servers"in L&&Array.isArray(L.servers)?u="servers":u=Object.keys(L).find(D=>Array.isArray(L[D])),u&&(V=L[u],(u==="versions"||E?.includes("VERSIONS"))&&(M=V))}}const O=M.findIndex(vs),H=O>=0?O:0,$=m??H;let A;t[8]!==n?(A=u=>{const D=u.name||u.title||u.server.title||"";return kt(D)===n},t[8]=n,t[9]=A):A=t[9];let w=V.find(A);if(!w&&c){let u;t[10]!==c?(u=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=u):u=t[11],w=V.find(u)}const T=w?as(w):null,U=(T?.tools?.length||0)>0,J=w?.server?.remotes?.[0]?.url||null,W=!U&&!!J,Q=wt({url:W?J:""}),ye=W&&Q.state==="connecting";let X;t[12]!==Q||t[13]!==W?(X=W&&Q.state==="ready"?(Q.tools||[]).map(gs):[],t[12]=Q,t[13]=W,t[14]=X):X=t[14];const Te=X,ce=U?T?.tools||[]:Te,Ue=is(v,T?.publisher),Ne=T?ls(V,T.publisher,Ue,g??null,z):{count:0},Be=T?.repository?Tt(T.repository):null,ze=w?.server?.remotes??[],Oe=w?.server?.packages??[],Se=[...ze.map(hs),...Oe.map(xs)],de=y?Se:Se.filter(ps),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!T?.repository&&!!Be;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(us),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const F=me;let fe;t[27]!==F?(fe=F.find(fs)?.id||F.find(ms)?.id||F[0]?.id||"overview",t[27]=F,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==b||t[30]!==F||t[31]!==_e?(ue=b&&F.find(u=>u.id===b)?b:_e,t[29]=b,t[30]=F,t[31]=_e,t[32]=ue):ue=t[32];const Fe=ue;let pe;t[33]!==f||t[34]!==M||t[35]!==o||t[36]!==e||t[37]!==w||t[38]!==x?(pe=async(u,D,Z)=>{const le=M[u??0]||w;if(!le||!e||!x?.user?.id)return;const B=ot(le,e.id,x.user.id,{remoteIndex:Z===void 0?D??0:void 0,packageIndex:Z}),We=B.connection_type==="STDIO",qe=!!B.connection_url,Ke=We&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!qe&&!Ke){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await f.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=f,t[34]=M,t[35]=o,t[36]=e,t[37]=w,t[38]=x,t[39]=pe):pe=t[39];const Y=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!w){let u;return t[43]!==re?(u=s.jsx(Dt,{onBack:re}),t[43]=re,t[44]=u):u=t[44],u}if(!T)return null;const Ge=(w?.server?.remotes?.length??0)>0,He=(w?.server?.packages?.length??0)>0,ne=Ge||He;let he;t[45]!==re?(he=s.jsx(Rt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&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(Pt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==M||t[50]!==w?(ie=M.length>0?M:[w],t[49]=M,t[50]=w,t[51]=ie):ie=t[51];let ve;t[52]!==f.create.isPending||t[53]!==ne||t[54]!==T||t[55]!==$||t[56]!==Y||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Et,{data:T,itemVersions:ie,onInstall:Y,canInstall:ne,isInstalling:f.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:N}),t[52]=f.create.isPending,t[53]=ne,t[54]=T,t[55]=$,t[56]=Y,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==T||t[61]!==Ne||t[62]!==w?(be=s.jsx(zt,{data:T,publisherInfo:Ne,selectedItem:w}),t[60]=T,t[61]=Ne,t[62]=w,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==Y?(je=u=>{u._type==="remote"?Y($,u._index,void 0):Y($,void 0,u._index)},t[64]=$,t[65]=Y,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,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:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(rs,{data:T,availableTabs:F,effectiveActiveTabId:Fe,effectiveTools:ce,isLoadingTools:ye,onTabChange:I,servers:Se,onInstallServer:je,isInstalling:f.create.isPending,mcpIcon:T.icon,mcpName:T.name,showStdio:y})]})]})})})]})}function ms(t){return t.id==="readme"}function fs(t){return t.id==="servers"}function us(t){return t.visible}function ps(t){return t.type?.toLowerCase()!=="stdio"}function xs(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function hs(t,e){return{...t,_type:"remote",_index:e}}function gs(t){return{name:t.name,description:t.description}}function vs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function bs(t){return t.name.endsWith("_GET")}function js(t){return t.name.endsWith("_VERSIONS")}function ys(){return!1}function go(){const t=R.c(6),{org:e}=Ee(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(Vt,{}),children:s.jsx(ds,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(cs,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{go as default};
1
+ import{r as q,c as R,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-B9c3bNyk.js";import{i as Ze}from"./AlertCircle-CNlbeaNO.js";import{i as De}from"./Loading01-DlgJ1_45.js";import{B as ae,c as Je}from"./button-Ta3HWdYR.js";import{i as et}from"./ArrowLeft-H58XLYPH.js";import{I as Re,E as tt}from"./empty-state-CSTjcp0X.js";import{i as st,e as ot}from"./extract-connection-data-D7M4EXYt.js";import{t as rt}from"./ChevronDown-D4EQGXFb.js";import{s as Pe}from"./Plus-DtbgAjWY.js";import{D as nt,c as it,a as lt,b as at}from"./dropdown-menu-BbIA2rWH.js";import{n as Me}from"./LinkExternal01-Cu4-40eG.js";import{T as ct,R as dt}from"./tools-list-DvTDsJWw.js";import{R as mt}from"./resource-tabs-B7x4zlfW.js";import{s as ft,f as ut,g as pt,c as xt}from"./registry-utils-BKwhzouz.js";import{a as ht,b as gt,e as vt}from"./mcp-server-card-3RQV4Klx.js";import{i as bt}from"./Terminal-BVYBaOBz.js";import{a as jt,u as yt,b as Nt}from"./use-connection-Cpo9FQLA.js";import{u as St}from"./use-binding-C-jiWM_O.js";import{u as Ct}from"./use-tool-call-CDQ4ked9.js";import{u as wt}from"./use-mcp-C4SOdL_A.js";import{u as _t,L as It}from"./localstorage-keys-DJR10CLV.js";import{u as Ee}from"./project-context-provider-DJGvA4-w.js";import{s as kt}from"./slugify-CEUa2lfQ.js";import{e as Tt,g as Lt}from"./github-icon-Dp3wHhYE.js";import{i as Pt}from"./InfoCircle-fjnTRxT_.js";import{c as Mt}from"./connection-C0f0eQA8.js";import"./constants-7IT_izqz.js";import"./generate-id-Dyweu44Y.js";import"./Grid01-DS_Rpsaf.js";import"./useQuery-CqMcSUvK.js";import"./File06-BOUeu2_s.js";import"./collection-display-button-CQf7wSjn.js";import"./ArrowUp-C39Etgym.js";import"./Check-qyrf_w7u.js";import"./List-CMJ7wwXL.js";import"./tooltip-Bb2oNaYJ.js";import"./view-mode-toggle-C6P0fGVR.js";import"./collection-search-BHs67_UI.js";import"./SearchMd--bzHJ7AO.js";import"./input-Dh7sDwu6.js";import"./collection-table-wrapper-3bPS8SS1.js";import"./card-CRtF9cdr.js";import"./layout-CMBAL9_n.js";import"./badge-Bv6QbUSE.js";import"./Lock01-Bc4skRDc.js";import"./use-collections-BnNAdJQg.js";import"./useMutation-BYfWAlPb.js";import"./binder-Co4G2PF6.js";const Ae=({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"}));Ae.displayName="SearchLg";function Vt(t){const e=R.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function $t(t){const e=R.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ze,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,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]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function Dt(t){const e=R.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ae,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,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]=a):a=e[4],a}function Rt(t){const e=R.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(et,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=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(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=R.c(28),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,_=c===void 0?!1:c,p=o[r],y=_?"sm":"default",b=d==="brand"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let I;e[0]!==b?(I=Je("shrink-0 cursor-pointer",b),e[0]=b,e[1]=I):I=e[1];let m;e[2]!==p?.server?.version||e[3]!==_?(m=_&&s.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=_,e[4]=m):m=e[4];const N=_?14:20;let f;e[5]!==N?(f=s.jsx(rt,{size:N}),e[5]=N,e[6]=f):f=e[6];let v;e[7]!==l||e[8]!==y||e[9]!==I||e[10]!==m||e[11]!==f||e[12]!==d?(v=s.jsx(nt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:y,className:I,children:[m,f]})}),e[7]=l,e[8]=y,e[9]=I,e[10]=m,e[11]=f,e[12]=d,e[13]=v):v=e[13];let x;if(e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==o){let g;e[19]!==l||e[20]!==n||e[21]!==r?(g=(S,C)=>{const P=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(it,{onClick:()=>n(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"]}),P?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===r&&s.jsx(st,{size:16,className:"text-muted-foreground shrink-0"})]})},C)},e[19]=l,e[20]=n,e[21]=r,e[22]=g):g=e[22],x=o.map(g),e[14]=l,e[15]=n,e[16]=r,e[17]=o,e[18]=x}else x=e[18];let k;e[23]!==x?(k=s.jsx(lt,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:x}),e[23]=x,e[24]=k):k=e[24];let j;return e[25]!==v||e[26]!==k?(j=s.jsxs(at,{children:[v,k]}),e[25]=v,e[26]=k,e[27]=j):j=e[27],j}function Et(t){const e=R.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,_=i===void 0?!0:i,p=a===void 0?!1:a,y=c===void 0?!1:c,[b,I]=q.useState(0),m=l??b;let N;e[0]!==d?(N=U=>{I(U),d?.(U)},e[0]=d,e[1]=N):N=e[1];const f=N,v=r[m]||r[0];let x;e[2]!==v?.server?.remotes?(x=v?.server?.remotes??[],e[2]=v?.server?.remotes,e[3]=x):x=e[3];const k=x;let j;e[4]!==v?.server?.packages?(j=v?.server?.packages??[],e[4]=v?.server?.packages,e[5]=j):j=e[5];const S=j.length>0,C=k.length>0,P=k.findIndex(Ut),h=P>=0?P:0;let K;e[6]!==h||e[7]!==S||e[8]!==C||e[9]!==n||e[10]!==m?(K=()=>{C?n(m,h,void 0):S&&n(m,void 0,0)},e[6]=h,e[7]=S,e[8]=C,e[9]=n,e[10]=m,e[11]=K):K=e[11];const E=K;let G;e[12]!==r||e[13]!==n||e[14]!==f?(G=U=>{f(U);const J=r[U],W=J?.server?.remotes??[],Q=J?.server?.packages??[];if(W.length>0){const X=W.findIndex(At);n(U,X>=0?X:0,void 0)}else Q.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=f,e[15]=G):G=e[15];const L=G;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Re,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let M;e[19]!==o.name?(M=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=M):M=e[20];let z;e[21]!==o.verified?(z=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=z):z=e[22];let O;e[23]!==M||e[24]!==z?(O=s.jsxs("div",{className:"flex items-center gap-2",children:[M,z]}),e[23]=M,e[24]=z,e[25]=O):O=e[25];let H;e[26]!==o.shortDescription?(H=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=H):H=e[27];let $;e[28]!==O||e[29]!==H?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,H]}),e[28]=O,e[29]=H,e[30]=$):$=e[30];let A;e[31]!==_||e[32]!==E||e[33]!==L||e[34]!==y||e[35]!==p||e[36]!==r||e[37]!==m||e[38]!==f?(A=_&&!y?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:E,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),p?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:m,onSelect:L,isInstalling:p,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:E,disabled:r.length===0||p,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),p?"Connecting...":"Connect"]})}):y?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:m,onSelect:f,isInstalling:p,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=_,e[32]=E,e[33]=L,e[34]=y,e[35]=p,e[36]=r,e[37]=m,e[38]=f,e[39]=A):A=e[39];let w;e[40]!==$||e[41]!==A?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=w):w=e[42];let T;return e[43]!==w||e[44]!==V?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,w]}),e[43]=w,e[44]=V,e[45]=T):T=e[45],T}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Bt(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 zt(t){const e=R.c(47),{data:o,publisherInfo:r,selectedItem:n}=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 a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Re,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=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 d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let _;e[9]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=_):_=e[9];let p;e[10]!==d?(p=s.jsxs("div",{children:[d,_]}),e[10]=d,e[11]=p):p=e[11];let y;e[12]!==c||e[13]!==p?(y=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,p]})}),e[12]=c,e[13]=p,e[14]=y):y=e[14];let b;e[15]!==o.version?(b=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[15]=o.version,e[16]=b):b=e[16];let I;e[17]!==o.tags?(I=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ft)})]}),e[17]=o.tags,e[18]=I):I=e[18];let m;e[19]!==o.categories?(m=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(Ot)})]}),e[19]=o.categories,e[20]=m):m=e[20];let N;e[21]!==o.connectionType?(N=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]=N):N=e[22];let f;e[23]!==o.schemaVersion?(f=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]=f):f=e[24];let v;e[25]!==o.websiteUrl?(v=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(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=v):v=e[26];let x;e[27]!==o.repository?(x=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(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let k;e[29]!==I||e[30]!==m||e[31]!==N||e[32]!==f||e[33]!==v||e[34]!==x||e[35]!==b?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[b,I,m,N,f,v,x]}),e[29]=I,e[30]=m,e[31]=N,e[32]=f,e[33]=v,e[34]=x,e[35]=b,e[36]=k):k=e[36];let j;e[37]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=j):j=e[37];let g;e[38]!==n.updated_at?(g=Bt(n.updated_at),e[38]=n.updated_at,e[39]=g):g=e[39];let S;e[40]!==g?(S=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[j,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[40]=g,e[41]=S):S=e[41];let C;return e[42]!==i||e[43]!==k||e[44]!==S||e[45]!==y?(C=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,y,k,S]}),e[42]=i,e[43]=k,e[44]=S,e[45]=y,e[46]=C):C=e[46],C}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ft(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Gt=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Ht={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Wt(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function qt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function Kt(t){const e=Ht[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Qt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Xt(t){return t.map((e,o)=>{const r=Qt(e.type),n=Wt(e.url),i=qt(e.url),a=e.title||e.name||Kt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Yt(t){const e=R.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(ft,{className:r}),sse:s.jsx(gt,{className:r}),stdio:s.jsx(bt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Zt(t){const e=R.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Yt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Jt(t){const e=R.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,_=d?o:o.filter(os),p=Xt(_),y=p.length<13?"all":"http",[b,I]=q.useState(y);let m;e:{if(b==="all"){m="all";break e}let h;if(e[0]!==b?(h=E=>E.protocol===b,e[0]=b,e[1]=h):h=e[1],p.some(h)){m=b;break e}if(p.length<13){m="all";break e}m=p[0]?.protocol??"http"}const N=m,f=N==="all"?p:p.filter(h=>h.protocol===N),v=new Set(p.map(ss));let x=Gt.filter(h=>h.value==="all"||v.has(h.value));d||(x=x.filter(ts));const k=v.size<=1?x.filter(es):x,j="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let g;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(g=h=>s.jsx(ht,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=g):g=e[6];const S=f.map(g);let C;e[7]!==S?(C=s.jsx("div",{className:j,children:S}),e[7]=S,e[8]=C):C=e[8];let P;return e[9]!==f.length?(P=f.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=f.length,e[10]=P):P=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Zt,{options:k,selected:N,onSelect:I}),C,P]})}function es(t){return t.value!=="all"}function ts(t){return t.value!=="stdio"}function ss(t){return t.protocol}function os(t){return t.type?.toLowerCase()!=="stdio"}function rs(t){const e=R.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:_,mcpIcon:p,mcpName:y,showStdio:b}=t,I=a===void 0?!1:a;let m;e[0]!==l?(m=l===void 0?[]:l,e[0]=l,e[1]=m):m=e[1];const N=m,f=_===void 0?!1:_,v=b===void 0?!1:b;let x;e[2]!==i?(x=i.map(ns),e[2]=i,e[3]=x):x=e[3];const k=x;let j;e[4]!==r||e[5]!==n||e[6]!==c?(j=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(mt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=j):j=e[7];let g;e[8]!==n||e[9]!==f||e[10]!==p||e[11]!==y||e[12]!==d||e[13]!==N||e[14]!==v?(g=n==="servers"&&N.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Jt,{servers:N,onInstall:h=>d?.(h),isInstalling:f,icon:p,mcpName:y,showStdio:v})}),e[8]=n,e[9]=f,e[10]=p,e[11]=y,e[12]=d,e[13]=N,e[14]=v,e[15]=g):g=e[15];let S;e[16]!==n||e[17]!==i.length||e[18]!==I||e[19]!==k?(S=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:I?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(ct,{tools:k,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(tt,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=I,e[19]=k,e[20]=S):S=e[20];let C;e[21]!==o?.repository||e[22]!==n?(C=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(dt,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=C):C=e[23];let P;return e[24]!==C||e[25]!==j||e[26]!==g||e[27]!==S?(P=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[j,g,S,C]}),e[24]=C,e[25]=j,e[26]=g,e[27]=S,e[28]=P):P=e[28],P}function ns(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function is(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function ls(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=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||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function as(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=pt(r.remotes?.[0]?.type),i=xt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Lt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",_=vt(d),p=e?.friendly_name||_,y=e?.mesh_description||t.description||t.summary||r?.description||"",b=e?.short_description||null,I=e?.tags||[],m=e?.categories||[];return{name:p,description:y,shortDescription:b,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:I,categories:m,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 cs extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx($t,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ds(){const t=R.c(67),{org:e}=Ee(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=It.storeShowStdio(),t[2]=d):d=t[2];const[_,p]=_t(d,ys),y=l==="true"?!0:l==="false"?!1:_;l!==void 0&&l==="true"!==_&&p(l==="true");const[b,I]=q.useState(null),[m,N]=q.useState(null),f=jt(),v=yt(),{data:x}=Ye.useSession(),k=St(v),j=a||k[0]?.id||"",g=Nt(j),S=ut(g?.tools),C=g?.tools&&g.tools.find(js)?.name||"",P=g?.tools&&g.tools.find(bs)?.name||"",h=Mt(j),K=!!c;let E,G;K?(E=C||P,G={name:c}):(E=S,G={});const{data:L}=Ct({toolCaller:h,toolName:E,toolInputParams:G,scope:j});let V=[],M=[],z=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(z=L.totalCount),"item"in L&&L.item){const u=L.item,D=u.id||"",Z=u.server,le=u._meta;let B;t[3]!==u.title||t[4]!==D||t[5]!==Z||t[6]!==le?(B=[{id:D,title:u.title,server:Z,_meta:le}],t[3]=u.title,t[4]=D,t[5]=Z,t[6]=le,t[7]=B):B=t[7],V=B}else{let u;"versions"in L&&Array.isArray(L.versions)?u="versions":"servers"in L&&Array.isArray(L.servers)?u="servers":u=Object.keys(L).find(D=>Array.isArray(L[D])),u&&(V=L[u],(u==="versions"||E?.includes("VERSIONS"))&&(M=V))}}const O=M.findIndex(vs),H=O>=0?O:0,$=m??H;let A;t[8]!==n?(A=u=>{const D=u.name||u.title||u.server.title||"";return kt(D)===n},t[8]=n,t[9]=A):A=t[9];let w=V.find(A);if(!w&&c){let u;t[10]!==c?(u=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=u):u=t[11],w=V.find(u)}const T=w?as(w):null,U=(T?.tools?.length||0)>0,J=w?.server?.remotes?.[0]?.url||null,W=!U&&!!J,Q=wt({url:W?J:""}),ye=W&&Q.state==="connecting";let X;t[12]!==Q||t[13]!==W?(X=W&&Q.state==="ready"?(Q.tools||[]).map(gs):[],t[12]=Q,t[13]=W,t[14]=X):X=t[14];const Te=X,ce=U?T?.tools||[]:Te,Ue=is(v,T?.publisher),Ne=T?ls(V,T.publisher,Ue,g??null,z):{count:0},Be=T?.repository?Tt(T.repository):null,ze=w?.server?.remotes??[],Oe=w?.server?.packages??[],Se=[...ze.map(hs),...Oe.map(xs)],de=y?Se:Se.filter(ps),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!T?.repository&&!!Be;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(us),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const F=me;let fe;t[27]!==F?(fe=F.find(fs)?.id||F.find(ms)?.id||F[0]?.id||"overview",t[27]=F,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==b||t[30]!==F||t[31]!==_e?(ue=b&&F.find(u=>u.id===b)?b:_e,t[29]=b,t[30]=F,t[31]=_e,t[32]=ue):ue=t[32];const Fe=ue;let pe;t[33]!==f||t[34]!==M||t[35]!==o||t[36]!==e||t[37]!==w||t[38]!==x?(pe=async(u,D,Z)=>{const le=M[u??0]||w;if(!le||!e||!x?.user?.id)return;const B=ot(le,e.id,x.user.id,{remoteIndex:Z===void 0?D??0:void 0,packageIndex:Z}),We=B.connection_type==="STDIO",qe=!!B.connection_url,Ke=We&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!qe&&!Ke){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await f.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=f,t[34]=M,t[35]=o,t[36]=e,t[37]=w,t[38]=x,t[39]=pe):pe=t[39];const Y=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!w){let u;return t[43]!==re?(u=s.jsx(Dt,{onBack:re}),t[43]=re,t[44]=u):u=t[44],u}if(!T)return null;const Ge=(w?.server?.remotes?.length??0)>0,He=(w?.server?.packages?.length??0)>0,ne=Ge||He;let he;t[45]!==re?(he=s.jsx(Rt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&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(Pt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==M||t[50]!==w?(ie=M.length>0?M:[w],t[49]=M,t[50]=w,t[51]=ie):ie=t[51];let ve;t[52]!==f.create.isPending||t[53]!==ne||t[54]!==T||t[55]!==$||t[56]!==Y||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Et,{data:T,itemVersions:ie,onInstall:Y,canInstall:ne,isInstalling:f.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:N}),t[52]=f.create.isPending,t[53]=ne,t[54]=T,t[55]=$,t[56]=Y,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==T||t[61]!==Ne||t[62]!==w?(be=s.jsx(zt,{data:T,publisherInfo:Ne,selectedItem:w}),t[60]=T,t[61]=Ne,t[62]=w,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==Y?(je=u=>{u._type==="remote"?Y($,u._index,void 0):Y($,void 0,u._index)},t[64]=$,t[65]=Y,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,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:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(rs,{data:T,availableTabs:F,effectiveActiveTabId:Fe,effectiveTools:ce,isLoadingTools:ye,onTabChange:I,servers:Se,onInstallServer:je,isInstalling:f.create.isPending,mcpIcon:T.icon,mcpName:T.name,showStdio:y})]})]})})})]})}function ms(t){return t.id==="readme"}function fs(t){return t.id==="servers"}function us(t){return t.visible}function ps(t){return t.type?.toLowerCase()!=="stdio"}function xs(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function hs(t,e){return{...t,_type:"remote",_index:e}}function gs(t){return{name:t.name,description:t.description}}function vs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function bs(t){return t.name.endsWith("_GET")}function js(t){return t.name.endsWith("_VERSIONS")}function ys(){return!1}function go(){const t=R.c(6),{org:e}=Ee(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(Vt,{}),children:s.jsx(ds,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(cs,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{go as default};