@decocms/mesh 2.4.2 → 2.4.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 (105) hide show
  1. package/dist/client/assets/{AlertCircle-CZPV4eTQ.js → AlertCircle-DS3woffv.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DQOG1GuJ.js → ArrowLeft-D2fGgQyc.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-Cdy__m-8.js → ChevronDown-D3DcMPHu.js} +1 -1
  4. package/dist/client/assets/{ChevronRight-SzPzGSNO.js → ChevronRight-BODSq5G5.js} +1 -1
  5. package/dist/client/assets/{Copy01-DS49wIzW.js → Copy01-B96wF_qg.js} +1 -1
  6. package/dist/client/assets/{DotsHorizontal-BSoB0mo2.js → DotsHorizontal-M253MPy-.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-eZBspOrA.js → DotsVertical-CBAKO30_.js} +1 -1
  8. package/dist/client/assets/{File06-CUqAuIUq.js → File06-l3h9AVPx.js} +1 -1
  9. package/dist/client/assets/{FilterLines-BTBF9JAn.js → FilterLines-8SByZGzN.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-BRcPqCms.js → FlipBackward-BT85q6tr.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-DovnqKJf.js → GitBranch01-C4NzhJdd.js} +1 -1
  12. package/dist/client/assets/{Grid01-R-k411L-.js → Grid01-BFWxtLBX.js} +1 -1
  13. package/dist/client/assets/{Inbox01-bvdCozgs.js → Inbox01-Ci4ucd41.js} +1 -1
  14. package/dist/client/assets/{InfoCircle-r2yyYHHv.js → InfoCircle-C37WJXSN.js} +1 -1
  15. package/dist/client/assets/{Key01-BWe_1dg2.js → Key01-CL3PceML.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BklnopGx.js → LinkExternal01-DaWdwcWA.js} +1 -1
  17. package/dist/client/assets/{Loading01-C0_l8AxO.js → Loading01-_oFW2JNJ.js} +1 -1
  18. package/dist/client/assets/{Lock01-C7_8eECJ.js → Lock01-B3oAmGqm.js} +1 -1
  19. package/dist/client/assets/{Play-CWJY4nY_.js → Play-DJOCAMI5.js} +1 -1
  20. package/dist/client/assets/{Plus-KTlOMNSY.js → Plus-FlxbOuMX.js} +1 -1
  21. package/dist/client/assets/{Terminal-DDfP4x2i.js → Terminal-CLum5--_.js} +1 -1
  22. package/dist/client/assets/{Trash01-BMJLKtdF.js → Trash01-WW5sibLz.js} +1 -1
  23. package/dist/client/assets/{X-BFdZnqth.js → X-BZJtnnGU.js} +1 -1
  24. package/dist/client/assets/{XClose-DTyQuBBY.js → XClose-C9M6lt1R.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-Dz8Vs8_m.js → alert-dialog-BcpPYYpI.js} +1 -1
  26. package/dist/client/assets/{auth-CJNQiaii.js → auth-B5ky5TwC.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-qU76xBKm.js → auth-catchall-Yc-olrlU.js} +1 -1
  28. package/dist/client/assets/{avatar-D4SXwEgs.js → avatar-mUjH8S2o.js} +1 -1
  29. package/dist/client/assets/{badge-99kEJDtp.js → badge-Cd9ypVQ7.js} +1 -1
  30. package/dist/client/assets/{card-DZuxbKf1.js → card-DoMPrO_z.js} +1 -1
  31. package/dist/client/assets/{checkbox-Bp9oZUjM.js → checkbox-Ce2c6Q0F.js} +1 -1
  32. package/dist/client/assets/{collection-detail-BB7cjHq1.js → collection-detail-BCCi1HOu.js} +1 -1
  33. package/dist/client/assets/{collection-display-button-CqzsQ6A1.js → collection-display-button-DPE08pwq.js} +1 -1
  34. package/dist/client/assets/{collection-header-BQqQNO9q.js → collection-header-ClZ3_QoL.js} +1 -1
  35. package/dist/client/assets/{collection-page-DlOERJnr.js → collection-page-CNDl2O18.js} +1 -1
  36. package/dist/client/assets/{collection-search-CIs95Rnw.js → collection-search-C3TCN4Mb.js} +1 -1
  37. package/dist/client/assets/{collection-tab-BPPicFWO.js → collection-tab-DjZWXwnt.js} +1 -1
  38. package/dist/client/assets/{collection-table-wrapper-D1OlmFUL.js → collection-table-wrapper-W9a8ZvDr.js} +1 -1
  39. package/dist/client/assets/{connection-card-Dm43-Wul.js → connection-card-WM_Vw-m7.js} +1 -1
  40. package/dist/client/assets/{connection-detail-DXNZMYLL.js → connection-detail-RVIT3UFi.js} +1 -1
  41. package/dist/client/assets/{connections-BB4IEP_5.js → connections-CKJZNUiK.js} +1 -1
  42. package/dist/client/assets/constants-B1MsiORH.js +1 -0
  43. package/dist/client/assets/{create-organization-dialog-miyo8zQR.js → create-organization-dialog-BfxOKUe8.js} +1 -1
  44. package/dist/client/assets/{dialog-DK6VaggX.js → dialog-DrPTLHGi.js} +1 -1
  45. package/dist/client/assets/{dropdown-menu-DTGJCwi0.js → dropdown-menu-BVwO0hZx.js} +1 -1
  46. package/dist/client/assets/{empty-state-DVGQ1BWZ.js → empty-state-CiWt0JeA.js} +1 -1
  47. package/dist/client/assets/{env-vars-editor-BG99RDNZ.js → env-vars-editor-Czs7y3Aa.js} +1 -1
  48. package/dist/client/assets/{error-boundary-9rVpFVah.js → error-boundary-DPQKA3ls.js} +1 -1
  49. package/dist/client/assets/{extract-connection-data-E0zDRO9-.js → extract-connection-data-BI7D_yAD.js} +1 -1
  50. package/dist/client/assets/{form-BGufVhpJ.js → form-DYBkwks3.js} +1 -1
  51. package/dist/client/assets/{gateway-detail-IUdVxLB4.js → gateway-detail-vGOSate4.js} +1 -1
  52. package/dist/client/assets/{gateway-selector-CuwGVcxw.js → gateway-selector-CpwrRP5L.js} +1 -1
  53. package/dist/client/assets/{gateways-BA7lpBES.js → gateways-DDhGrUfh.js} +1 -1
  54. package/dist/client/assets/{home-B5o9i0BD.js → home-Cywix_jq.js} +1 -1
  55. package/dist/client/assets/{index-Rcp5vvtf.js → index-BIxXvhQZ.js} +1 -1
  56. package/dist/client/assets/{index-DHr9tFb0.js → index-C42QK8hz.js} +31 -31
  57. package/dist/client/assets/{index-CaBiIG-r.js → index-DPFV2snR.js} +1 -1
  58. package/dist/client/assets/{input-C4WvdKkR.js → input-DxnDBmuJ.js} +1 -1
  59. package/dist/client/assets/{layout-9R3rtCy3.js → layout-DXdXITg6.js} +1 -1
  60. package/dist/client/assets/{lazy-highlighter-rNRrmjMV.js → lazy-highlighter-Da5CMBG0.js} +1 -1
  61. package/dist/client/assets/{localstorage-keys-DrIZl-Oa.js → localstorage-keys-Ddx17ibV.js} +1 -1
  62. package/dist/client/assets/{login-CaUUYoaL.js → login-o1Tj7sX_.js} +1 -1
  63. package/dist/client/assets/{mcp-oauth-BPterAhB.js → mcp-oauth-B9Ov-xsR.js} +1 -1
  64. package/dist/client/assets/{mcp-server-detail-BmtUegeN.js → mcp-server-detail-BoRotZPL.js} +1 -1
  65. package/dist/client/assets/{members-Dha-TTi3.js → members-DVjTxGu7.js} +1 -1
  66. package/dist/client/assets/{monaco-editor-fWj67pSD.js → monaco-editor-Bm6Oe5sG.js} +1 -1
  67. package/dist/client/assets/{monitoring-BHqKCRpc.js → monitoring-C2RnSJ3o.js} +1 -1
  68. package/dist/client/assets/{oauth-callback-C8SrcUYM.js → oauth-callback-DMHRNVai.js} +1 -1
  69. package/dist/client/assets/{page-CB2Kbqif.js → page-CFlN9WXe.js} +1 -1
  70. package/dist/client/assets/{page-D_pWRusE.js → page-DDFD8VO6.js} +1 -1
  71. package/dist/client/assets/{pin-to-sidebar-button-Bau5uIKK.js → pin-to-sidebar-button-CLveGjFp.js} +1 -1
  72. package/dist/client/assets/{popover-B1hj_ypq.js → popover-DxCOgWPI.js} +1 -1
  73. package/dist/client/assets/{project-context-provider-SYQQWwHt.js → project-context-provider-D9nZUGnc.js} +1 -1
  74. package/dist/client/assets/{resizable-oOXY1Kb2.js → resizable-57JmaYTe.js} +1 -1
  75. package/dist/client/assets/{resource-tabs-DXcOsIua.js → resource-tabs-BEIxRUtB.js} +1 -1
  76. package/dist/client/assets/{select-58kzPmSH.js → select-Cz5FKfAF.js} +1 -1
  77. package/dist/client/assets/{settings-C8uZUL9P.js → settings-B4usvQoK.js} +1 -1
  78. package/dist/client/assets/{shell-layout-BXan9A9l.js → shell-layout-BHXYIaoX.js} +1 -1
  79. package/dist/client/assets/{spinner-BmiYLJkt.js → spinner-Dh2iZtLK.js} +1 -1
  80. package/dist/client/assets/{switch-D3qS-cJT.js → switch-DImiMRQV.js} +1 -1
  81. package/dist/client/assets/{textarea-KpHZNzGY.js → textarea-Coh9WaVd.js} +1 -1
  82. package/dist/client/assets/{thread-history-popover-DrZ24omE.js → thread-history-popover-BdhASe2w.js} +3 -3
  83. package/dist/client/assets/{tools-list-BQ6I_zS0.js → tools-list-Bgq8z3Q2.js} +1 -1
  84. package/dist/client/assets/{use-binding-DxCldqD_.js → use-binding-CpFrN3sc.js} +1 -1
  85. package/dist/client/assets/{use-connection-gZqQ1FAI.js → use-connection-CD7OAk7L.js} +1 -1
  86. package/dist/client/assets/{use-connection-resources-CBnleHDw.js → use-connection-resources-4i_WQ9lu.js} +1 -1
  87. package/dist/client/assets/{use-gateway-BAeublLm.js → use-gateway-BoEwJYby.js} +1 -1
  88. package/dist/client/assets/{use-gateway-system-prompt-DcPNvMKK.js → use-gateway-system-prompt-BzqlsYn1.js} +1 -1
  89. package/dist/client/assets/{use-list-state-_DXZxdCV.js → use-list-state-BFO-aJCX.js} +1 -1
  90. package/dist/client/assets/{use-mcp-DVQixgJB.js → use-mcp-B4Ldjn0r.js} +1 -1
  91. package/dist/client/assets/{use-members-Ba-WS8jO.js → use-members-FRhqDkLq.js} +1 -1
  92. package/dist/client/assets/{use-mobile-CXfyAVoY.js → use-mobile-DiJcsLPG.js} +1 -1
  93. package/dist/client/assets/{use-organization-settings-g1OUF8Uc.js → use-organization-settings-CcG3A1Ve.js} +1 -1
  94. package/dist/client/assets/{use-tool-call-DYbV_cs9.js → use-tool-call-3UqP0ScZ.js} +1 -1
  95. package/dist/client/assets/{useQueries-DAJGlQiv.js → useQueries-D8IoiJsJ.js} +1 -1
  96. package/dist/client/assets/useQuery-CaL9aChr.js +1 -0
  97. package/dist/client/assets/{value-DqDh9HyF.js → value-CFA-sNzA.js} +1 -1
  98. package/dist/client/assets/{view-mode-toggle-DAKbBF5Z.js → view-mode-toggle-B13uQDqD.js} +1 -1
  99. package/dist/client/assets/{workflow-BO9cHs1L.js → workflow-CBTdFU5D.js} +1 -1
  100. package/dist/client/index.html +1 -1
  101. package/dist/server/cli.js +89 -89
  102. package/dist/server/server.js +88 -88
  103. package/package.json +1 -1
  104. package/dist/client/assets/constants-BSLIcG1u.js +0 -1
  105. package/dist/client/assets/useQuery--jXLy0yb.js +0 -1
@@ -1 +1 @@
1
- import{a1 as Ie,r as u,av as K,aX as F,R as Re,P as Ce,O as $e,C as Me,aY as z}from"./index-DHr9tFb0.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case a:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=a,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===a},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===a||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var Pe=Fe();const lt=Ie(Pe);var ve=1,De=.9,qe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,Oe=/[\\\/_+.#"@\[\(\{&]/g,ze=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,a,c,d){if(c===l.length)return a===t.length?ve:Ke;var v=`${a},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,a),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===a?b*=ve:Ve.test(t.charAt(i-1))?(b*=qe,x=t.slice(a,i-1).match(Oe),x&&a>0&&(b*=Math.pow(ee,x.length))):ze.test(t.charAt(i-1))?(b*=De,$=t.slice(a,i-1).match(be),$&&a>0&&(b*=Math.pow(ee,$.length))):(b*=je,a>0&&(b*=Math.pow(ee,i-a))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var O='[cmdk-group=""]',te='[cmdk-group-items=""]',_e='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",Te=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),a=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,U=K(),ue=K(),H=K(),P=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,oe)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var o,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")Y(),W(),w(1,X);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(H);I?I.focus():(o=document.getElementById(U))==null||o.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=q())==null?void 0:I.id,R.emit()}),m||w(5,oe),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=u.useMemo(()=>({value:(e,s,m)=>{var o;s!==((o=c.current.get(e))==null?void 0:o.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,ae(s,m)),w(2,()=>{W(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(a.current.has(s)?a.current.get(s).add(e):a.current.set(s,new Set([e]))),w(3,()=>{Y(),W(),r.current.value||X(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=q();w(4,()=>{Y(),m?.getAttribute("id")===e&&X(),R.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{c.current.delete(e),a.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ue,listInnerRef:P}),[]);function ae(e,s){var m,o;let g=(o=(m=v.current)==null?void 0:m.filter)!=null?o:Te;return e?g(e,r.current.search,s):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(o=>{let g=a.current.get(o),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([o,S])});let m=P.current;V().sort((o,g)=>{var S,C;let I=o.getAttribute("id"),_=g.getAttribute("id");return((S=e.get(_))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(o=>{let g=o.closest(te);g?g.appendChild(o.parentElement===g?o:o.closest(`${te} > *`)):m.appendChild(o.parentElement===m?o:o.closest(`${te} > *`))}),s.sort((o,g)=>g[1]-o[1]).forEach(o=>{var g;let S=(g=P.current)==null?void 0:g.querySelector(`${O}[${j}="${encodeURIComponent(o[0])}"]`);S?.parentElement.appendChild(S)})}function X(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function Y(){var e,s,m,o;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(o=(m=c.current.get(S))==null?void 0:m.keywords)!=null?o:[],_=ae(C,I);r.current.filtered.items.set(S,_),_>0&&g++}for(let[S,C]of a.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function oe(){var e,s,m;let o=q();o&&(((e=o.parentElement)==null?void 0:e.firstChild)===o&&((m=(s=o.closest(O))==null?void 0:s.querySelector(_e))==null||m.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function q(){var e;return(e=P.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=P.current)==null?void 0:e.querySelectorAll(he))||[])}function G(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function J(e){var s;let m=q(),o=V(),g=o.findIndex(C=>C===m),S=o[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?o[o.length-1]:g+e===o.length?o[0]:o[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=q(),m=s?.closest(O),o;for(;m&&!o;)m=e>0?Qe(m,O):Ze(m,O),o=m?.querySelector(he);o?R.setState("value",o.getAttribute(j)):J(e)}let ce=()=>G(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):J(1)},de=e=>{e.preventDefault(),e.metaKey?G(0):e.altKey?ie(-1):J(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),G(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let o=q();if(o){let g=new Event(ne);o.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:rt},y),T(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:N},e))))}),Ue=u.forwardRef((t,l)=>{var r,f;let a=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(a,d?.id)},[i]);let p=ke(a,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(a)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:U,forceMount:ue,keywords:H,...P}=t;return u.createElement(F.div,{ref:z(c,l),...P,id:a,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),He=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:a,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>a||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:a}),[a]);return u.createElement(F.div,{ref:z(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),T(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Ne=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,a=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:z(a,l),...f,"cmdk-separator":"",role:"separator"})}),We=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,a=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:a?t.value:d,onChange:i=>{a||c.setState("search",i.target.value),r?.(i.target.value)}})}),Xe=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...a}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:z(c,l),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},T(t,i=>u.createElement("div",{ref:z(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Ye=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:a,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:a}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Ge=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Je=u.forwardRef((t,l)=>{let{progress:r,children:f,label:a="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},T(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Xe,Item:Ue,Input:We,Group:He,Separator:Ne,Dialog:Ye,Empty:Ge,Loading:Je});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let a=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():a.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),a.current=v}),a}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,a)=>{r.current.set(f,a),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function T({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,Pe as r};
1
+ import{a1 as Ie,r as u,av as K,aX as F,R as Re,P as Ce,O as $e,C as Me,aY as z}from"./index-C42QK8hz.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case a:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=a,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===a},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===a||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var Pe=Fe();const lt=Ie(Pe);var ve=1,De=.9,qe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,Oe=/[\\\/_+.#"@\[\(\{&]/g,ze=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,a,c,d){if(c===l.length)return a===t.length?ve:Ke;var v=`${a},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,a),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===a?b*=ve:Ve.test(t.charAt(i-1))?(b*=qe,x=t.slice(a,i-1).match(Oe),x&&a>0&&(b*=Math.pow(ee,x.length))):ze.test(t.charAt(i-1))?(b*=De,$=t.slice(a,i-1).match(be),$&&a>0&&(b*=Math.pow(ee,$.length))):(b*=je,a>0&&(b*=Math.pow(ee,i-a))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var O='[cmdk-group=""]',te='[cmdk-group-items=""]',_e='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",Te=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),a=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,U=K(),ue=K(),H=K(),P=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,oe)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var o,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")Y(),W(),w(1,X);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(H);I?I.focus():(o=document.getElementById(U))==null||o.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=q())==null?void 0:I.id,R.emit()}),m||w(5,oe),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=u.useMemo(()=>({value:(e,s,m)=>{var o;s!==((o=c.current.get(e))==null?void 0:o.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,ae(s,m)),w(2,()=>{W(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(a.current.has(s)?a.current.get(s).add(e):a.current.set(s,new Set([e]))),w(3,()=>{Y(),W(),r.current.value||X(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=q();w(4,()=>{Y(),m?.getAttribute("id")===e&&X(),R.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{c.current.delete(e),a.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ue,listInnerRef:P}),[]);function ae(e,s){var m,o;let g=(o=(m=v.current)==null?void 0:m.filter)!=null?o:Te;return e?g(e,r.current.search,s):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(o=>{let g=a.current.get(o),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([o,S])});let m=P.current;V().sort((o,g)=>{var S,C;let I=o.getAttribute("id"),_=g.getAttribute("id");return((S=e.get(_))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(o=>{let g=o.closest(te);g?g.appendChild(o.parentElement===g?o:o.closest(`${te} > *`)):m.appendChild(o.parentElement===m?o:o.closest(`${te} > *`))}),s.sort((o,g)=>g[1]-o[1]).forEach(o=>{var g;let S=(g=P.current)==null?void 0:g.querySelector(`${O}[${j}="${encodeURIComponent(o[0])}"]`);S?.parentElement.appendChild(S)})}function X(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function Y(){var e,s,m,o;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(o=(m=c.current.get(S))==null?void 0:m.keywords)!=null?o:[],_=ae(C,I);r.current.filtered.items.set(S,_),_>0&&g++}for(let[S,C]of a.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function oe(){var e,s,m;let o=q();o&&(((e=o.parentElement)==null?void 0:e.firstChild)===o&&((m=(s=o.closest(O))==null?void 0:s.querySelector(_e))==null||m.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function q(){var e;return(e=P.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=P.current)==null?void 0:e.querySelectorAll(he))||[])}function G(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function J(e){var s;let m=q(),o=V(),g=o.findIndex(C=>C===m),S=o[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?o[o.length-1]:g+e===o.length?o[0]:o[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=q(),m=s?.closest(O),o;for(;m&&!o;)m=e>0?Qe(m,O):Ze(m,O),o=m?.querySelector(he);o?R.setState("value",o.getAttribute(j)):J(e)}let ce=()=>G(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):J(1)},de=e=>{e.preventDefault(),e.metaKey?G(0):e.altKey?ie(-1):J(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),G(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let o=q();if(o){let g=new Event(ne);o.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:rt},y),T(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:N},e))))}),Ue=u.forwardRef((t,l)=>{var r,f;let a=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(a,d?.id)},[i]);let p=ke(a,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(a)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:U,forceMount:ue,keywords:H,...P}=t;return u.createElement(F.div,{ref:z(c,l),...P,id:a,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),He=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:a,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>a||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:a}),[a]);return u.createElement(F.div,{ref:z(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),T(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Ne=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,a=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:z(a,l),...f,"cmdk-separator":"",role:"separator"})}),We=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,a=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:a?t.value:d,onChange:i=>{a||c.setState("search",i.target.value),r?.(i.target.value)}})}),Xe=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...a}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:z(c,l),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},T(t,i=>u.createElement("div",{ref:z(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Ye=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:a,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:a}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Ge=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Je=u.forwardRef((t,l)=>{let{progress:r,children:f,label:a="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},T(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Xe,Item:Ue,Input:We,Group:He,Separator:Ne,Dialog:Ye,Empty:Ge,Loading:Je});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let a=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():a.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),a.current=v}),a}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,a)=>{r.current.set(f,a),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function T({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,Pe as r};
@@ -1 +1 @@
1
- import{a_ as f,b0 as m,bI as h,bJ as x,a$ as b,B as y,r as u,b7 as k,bK as O,aR as C,a6 as w,c as g,f as M,j as p,g as E}from"./index-DHr9tFb0.js";var j=class extends f{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),m(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&h(t.mutationKey)!==h(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#n(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#n()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??x();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#n(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,r=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(e.data,null,t,r,s)}catch(i){Promise.reject(i)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(void 0,e.error,t,r,s)}catch(i){Promise.reject(i)}}}this.listeners.forEach(t=>{t(this.#i)})})}};function K(e,t){const r=y(t),[s]=u.useState(()=>new j(r,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const i=u.useSyncExternalStore(u.useCallback(n=>s.subscribe(b.batchCalls(n)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=u.useCallback((n,c)=>{s.mutate(n,c).catch(k)},[s]);if(i.error&&O(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function v(...e){return C(w(e))}const S=M("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-7 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=g.c(14);let r,s,i,o,n;t[0]!==e?({className:r,variant:n,size:i,asChild:o,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=i,t[4]=o,t[5]=n):(r=t[1],s=t[2],i=t[3],o=t[4],n=t[5]);const d=(o===void 0?!1:o)?E:"button";let a;t[6]!==r||t[7]!==i||t[8]!==n?(a=v(S({variant:n,size:i,className:r})),t[6]=r,t[7]=i,t[8]=n,t[9]=a):a=t[9];let l;return t[10]!==d||t[11]!==s||t[12]!==a?(l=p.jsx(d,{"data-slot":"button",className:a,...s}),t[10]=d,t[11]=s,t[12]=a,t[13]=l):l=t[13],l}function P(e){const t=g.c(10);let r,s,i;t[0]!==e?({className:r,type:i,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=i):(r=t[1],s=t[2],i=t[3]);let o;t[4]!==r?(o=v("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",r),t[4]=r,t[5]=o):o=t[5];let n;return t[6]!==s||t[7]!==o||t[8]!==i?(n=p.jsx("input",{type:i,"data-slot":"input",className:o,...s}),t[6]=s,t[7]=o,t[8]=i,t[9]=n):n=t[9],n}export{z as B,P as I,S as b,v as c,K as u};
1
+ import{a_ as f,b0 as m,bI as h,bJ as x,a$ as b,B as y,r as u,b7 as k,bK as O,aR as C,a6 as w,c as g,f as M,j as p,g as E}from"./index-C42QK8hz.js";var j=class extends f{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),m(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&h(t.mutationKey)!==h(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#n(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#n()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??x();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#n(e){b.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,r=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(e.data,null,t,r,s)}catch(i){Promise.reject(i)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(void 0,e.error,t,r,s)}catch(i){Promise.reject(i)}}}this.listeners.forEach(t=>{t(this.#i)})})}};function K(e,t){const r=y(t),[s]=u.useState(()=>new j(r,e));u.useEffect(()=>{s.setOptions(e)},[s,e]);const i=u.useSyncExternalStore(u.useCallback(n=>s.subscribe(b.batchCalls(n)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=u.useCallback((n,c)=>{s.mutate(n,c).catch(k)},[s]);if(i.error&&O(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function v(...e){return C(w(e))}const S=M("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border text-foreground bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-foreground/80 hover:text-foreground",brand:"bg-brand-green-light text-brand-green-dark hover:bg-brand-green-light/90"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-7 gap-1.5 px-3 has-[>svg]:px-2.5",xs:"h-6 gap-1 px-2 text-xs has-[>svg]:px-1.5",lg:"h-10 px-6 has-[>svg]:px-4",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function z(e){const t=g.c(14);let r,s,i,o,n;t[0]!==e?({className:r,variant:n,size:i,asChild:o,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=i,t[4]=o,t[5]=n):(r=t[1],s=t[2],i=t[3],o=t[4],n=t[5]);const d=(o===void 0?!1:o)?E:"button";let a;t[6]!==r||t[7]!==i||t[8]!==n?(a=v(S({variant:n,size:i,className:r})),t[6]=r,t[7]=i,t[8]=n,t[9]=a):a=t[9];let l;return t[10]!==d||t[11]!==s||t[12]!==a?(l=p.jsx(d,{"data-slot":"button",className:a,...s}),t[10]=d,t[11]=s,t[12]=a,t[13]=l):l=t[13],l}function P(e){const t=g.c(10);let r,s,i;t[0]!==e?({className:r,type:i,...s}=e,t[0]=e,t[1]=r,t[2]=s,t[3]=i):(r=t[1],s=t[2],i=t[3]);let o;t[4]!==r?(o=v("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",r),t[4]=r,t[5]=o):o=t[5];let n;return t[6]!==s||t[7]!==o||t[8]!==i?(n=p.jsx("input",{type:i,"data-slot":"input",className:o,...s}),t[6]=s,t[7]=o,t[8]=i,t[9]=n):n=t[9],n}export{z as B,P as I,S as b,v as c,K as u};
@@ -1 +1 @@
1
- import{c as E,r as f,a8 as v,j as l}from"./index-DHr9tFb0.js";import{B as w}from"./input-C4WvdKkR.js";import{i as k}from"./ArrowLeft-DQOG1GuJ.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,a8 as v,j as l}from"./index-C42QK8hz.js";import{B as w}from"./input-DxnDBmuJ.js";import{i as k}from"./ArrowLeft-D2fGgQyc.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,4 +1,4 @@
1
- import{z as ae,a5 as Ie,a1 as Xp,c as Zp,j as Qp}from"./index-DHr9tFb0.js";function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},To.apply(null,arguments)}function Jp(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function eg(e,t){if(e==null)return{};var r,a,n=Jp(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ao(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function tg(e){if(Array.isArray(e))return Ao(e)}function rg(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ag(e,t){if(e){if(typeof e=="string")return Ao(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ao(e,t):void 0}}function ng(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{z as ae,a5 as Ie,a1 as Xp,c as Zp,j as Qp}from"./index-C42QK8hz.js";function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},To.apply(null,arguments)}function Jp(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function eg(e,t){if(e==null)return{};var r,a,n=Jp(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ao(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function tg(e){if(Array.isArray(e))return Ao(e)}function rg(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ag(e,t){if(e){if(typeof e=="string")return Ao(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ao(e,t):void 0}}function ng(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ro(e){return tg(e)||rg(e)||ag(e)||ng()}function Se(e){"@babel/helpers - typeof";return Se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(e)}function ig(e,t){if(Se(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Se(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function og(e){var t=ig(e,"string");return Se(t)=="symbol"?t:t+""}function kp(e,t,r){return(t=og(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Go(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Go(Object(r),!0).forEach(function(a){kp(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Go(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function sg(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ue={};function lg(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return Ue[t]||(Ue[t]=sg(e)),Ue[t]}function ug(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,a=e.filter(function(i){return i!=="token"}),n=lg(a);return n.reduce(function(i,o){return me(me({},i),r[o])},t)}function $o(e){return e.join(" ")}function cg(e,t){var r=0;return function(a){return r+=1,a.map(function(n,i){return Cp({node:n,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(r,"-").concat(i)})})}}function Cp(e){var t=e.node,r=e.stylesheet,a=e.style,n=a===void 0?{}:a,i=e.useInlineStyles,o=e.key,s=t.properties,l=t.type,c=t.tagName,u=t.value;if(l==="text")return u;if(c){var p=cg(r,i),m;if(!i)m=me(me({},s),{},{className:$o(s.className)});else{var f=Object.keys(r).reduce(function(R,b){return b.split(".").forEach(function(g){R.includes(g)||R.push(g)}),R},[]),T=s.className&&s.className.includes("token")?["token"]:[],E=s.className&&T.concat(s.className.filter(function(R){return!f.includes(R)}));m=me(me({},s),{},{className:$o(E)||void 0,style:ug(s.className,Object.assign({},s.style,n),r)})}var A=p(t.children);return ae.createElement(c,To({key:o},m),A)}}const dg=(function(e,t){var r=e.listLanguages();return r.indexOf(t)!==-1});var pg=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ho(Object(r),!0).forEach(function(a){kp(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ho(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var gg=/\n/g;function bg(e){return e.match(gg)}function mg(e){var t=e.lines,r=e.startingLineNumber,a=e.style;return t.map(function(n,i){var o=i+r;return ae.createElement("span",{key:"line-".concat(i),className:"react-syntax-highlighter-line-number",style:typeof a=="function"?a(o):a},"".concat(o,`
3
3
  `))})}function fg(e){var t=e.codeString,r=e.codeStyle,a=e.containerStyle,n=a===void 0?{float:"left",paddingRight:"10px"}:a,i=e.numberStyle,o=i===void 0?{}:i,s=e.startingLineNumber;return ae.createElement("code",{style:Object.assign({},r,n)},mg({lines:t.replace(/\n$/,"").split(`
4
4
  `),style:o,startingLineNumber:s}))}function hg(e){return"".concat(e.toString().length,".25em")}function Op(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Lp(e,t,r){var a={display:"inline-block",minWidth:hg(r),paddingRight:"1em",textAlign:"right",userSelect:"none"},n=typeof e=="function"?e(t):e,i=ne(ne({},a),n);return i}function _e(e){var t=e.children,r=e.lineNumber,a=e.lineNumberStyle,n=e.largestLineNumber,i=e.showInlineLineNumbers,o=e.lineProps,s=o===void 0?{}:o,l=e.className,c=l===void 0?[]:l,u=e.showLineNumbers,p=e.wrapLongLines,m=e.wrapLines,f=m===void 0?!1:m,T=f?ne({},typeof s=="function"?s(r):s):{};if(T.className=T.className?[].concat(Ro(T.className.trim().split(/\s+/)),Ro(c)):c,r&&i){var E=Lp(a,r,n);t.unshift(Op(r,E))}return p&u&&(T.style=ne({display:"flex"},T.style)),{type:"element",tagName:"span",properties:T,children:t}}function Dp(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=0;a<e.length;a++){var n=e[a];if(n.type==="text")r.push(_e({children:[n],className:Ro(new Set(t))}));else if(n.children){var i=t.concat(n.properties.className);Dp(n.children,i).forEach(function(o){return r.push(o)})}}return r}function Eg(e,t,r,a,n,i,o,s,l){var c,u=Dp(e.value),p=[],m=-1,f=0;function T(S,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return _e({children:S,lineNumber:d,lineNumberStyle:s,largestLineNumber:o,showInlineLineNumbers:n,lineProps:r,className:y,showLineNumbers:a,wrapLongLines:l,wrapLines:t})}function E(S,d){if(a&&d&&n){var y=Lp(s,d,o);S.unshift(Op(d,y))}return S}function A(S,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||y.length>0?T(S,d,y):E(S,d)}for(var R=function(){var d=u[f],y=d.children[0].value,_=bg(y);if(_){var v=y.split(`
@@ -1 +1 @@
1
- import{c as O,B as I}from"./index-DHr9tFb0.js";import{u as x}from"./useQuery--jXLy0yb.js";import{u as L}from"./input-C4WvdKkR.js";function Q(e){try{return JSON.parse(e)}catch{return}}function $(e,s){const t=localStorage.getItem(e),a=t?Q(t):void 0,n=typeof s=="function"?s(a):a??s;if(a===void 0||n!==a)try{const o=JSON.stringify(n);localStorage.setItem(e,o)}catch{}return n}function A(e,s){const t=O.c(25),a=I();let n;t[0]!==e?(n=["localStorage",e],t[0]=e,t[1]=n):n=t[1];const o=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]!==o||t[7]!==r||t[8]!==i?(u={queryKey:o,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=o,t[7]=r,t[8]=i,t[9]=u):u=t[9];const{data:v}=x(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]!==a||t[13]!==o?(m=c=>{a.setQueryData(o,c)},t[12]=a,t[13]=o,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 d=L(h);let f;t[18]!==d||t[19]!==a||t[20]!==o?(f=c=>{const y=a.getQueryData(o),C=typeof c=="function"?c(y):c;d.mutate(C)},t[18]=d,t[19]=a,t[20]=o,t[21]=f):f=t[21];const S=f,p=v;let g;return t[22]!==S||t[23]!==p?(g=[p,S],t[22]=S,t[23]=p,t[24]=g):g=t[24],g}const M={decoChatOpen:()=>"mesh:decochat:open",threadManagerState:e=>`mesh:thread-manager-state:${e}`,chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:(e,s)=>`mesh:assistant-chat:active-thread:${e}:${s}`,gatewayChatActiveThread:(e,s)=>`mesh:gateway-chat:active-thread:${e}:${s}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,gatewaySystemPrompts:e=>`mesh:gateway:system-prompts:${e}`};export{M as L,A as u};
1
+ import{c as O,B as I}from"./index-C42QK8hz.js";import{u as x}from"./useQuery-CaL9aChr.js";import{u as L}from"./input-DxnDBmuJ.js";function Q(e){try{return JSON.parse(e)}catch{return}}function $(e,s){const t=localStorage.getItem(e),a=t?Q(t):void 0,n=typeof s=="function"?s(a):a??s;if(a===void 0||n!==a)try{const o=JSON.stringify(n);localStorage.setItem(e,o)}catch{}return n}function A(e,s){const t=O.c(25),a=I();let n;t[0]!==e?(n=["localStorage",e],t[0]=e,t[1]=n):n=t[1];const o=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]!==o||t[7]!==r||t[8]!==i?(u={queryKey:o,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=o,t[7]=r,t[8]=i,t[9]=u):u=t[9];const{data:v}=x(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]!==a||t[13]!==o?(m=c=>{a.setQueryData(o,c)},t[12]=a,t[13]=o,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 d=L(h);let f;t[18]!==d||t[19]!==a||t[20]!==o?(f=c=>{const y=a.getQueryData(o),C=typeof c=="function"?c(y):c;d.mutate(C)},t[18]=d,t[19]=a,t[20]=o,t[21]=f):f=t[21];const S=f,p=v;let g;return t[22]!==S||t[23]!==p?(g=[p,S],t[22]=S,t[23]=p,t[24]=g):g=t[24],g}const M={decoChatOpen:()=>"mesh:decochat:open",threadManagerState:e=>`mesh:thread-manager-state:${e}`,chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:(e,s)=>`mesh:assistant-chat:active-thread:${e}:${s}`,gatewayChatActiveThread:(e,s)=>`mesh:gateway-chat:active-thread:${e}:${s}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,gatewaySystemPrompts:e=>`mesh:gateway:system-prompts:${e}`};export{M as L,A as u};
@@ -1 +1 @@
1
- import{u as k,r as p,j as e,a as j,b as z,S as L,N as R,c as U}from"./index-DHr9tFb0.js";import{u as T,c as b,I as E,B as P}from"./input-C4WvdKkR.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 F(){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{F as default};
1
+ import{u as k,r as p,j as e,a as j,b as z,S as L,N as R,c as U}from"./index-C42QK8hz.js";import{u as T,c as b,I as E,B as P}from"./input-DxnDBmuJ.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 F(){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{F as default};
@@ -1 +1 @@
1
- import{O as T,Q as V,V as P,H as $}from"./auth-CJNQiaii.js";function A(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(A(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 a=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${a},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(A(this.serverUrl))}}async function x(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,c)=>{const E=n.timeout||12e4;let w,f=!1;const O=t.state(),_=`${I}${O}`,l=()=>{if(!f){f=!0,window.removeEventListener("message",m),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(_)}catch{}}},k=async i=>{if(f)return;if(!i.success){l(),c(new Error(i.error||"OAuth authentication failed"));return}const{code:h,state:b}=i;if(!h){l(),c(new Error("Missing authorization code"));return}if(t.getStoredState()!==b){l(),c(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const S=(await T(e))?.authorization_servers?.[0]||e,y=await V(S),d=t.clientInformation();if(!d){l(),c(new Error("Client information not found"));return}const C=t.codeVerifier(),M=await P(S,{metadata:y,clientInformation:d,authorizationCode:h,codeVerifier:C,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:M,clientId:d.client_id??null,clientSecret:"client_secret"in d?d.client_secret:null,tokenEndpoint:y?.token_endpoint??null})}catch(v){l(),c(v)}},m=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await k(i.data)},g=async i=>{if(!(i.key!==_||!i.newValue))try{const h=JSON.parse(i.newValue);await k(h)}catch{}};window.addEventListener("message",m),window.addEventListener("storage",g),w=setTimeout(()=>{l(),c(new Error("OAuth authentication timeout"))},E)});if(await $(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 N(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),a=n.get("error_description");let s=t;if(t)try{const r=atob(t),c=JSON.parse(r);c.clientState&&(s=c.clientState)}catch{}if(o){const r=a||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"}}async function H({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"}}})});if(o.ok)return{isAuthenticated:!0,supportsOAuth:!0};let a;try{const r=await o.json();a=r.error||r.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,error:a||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),error:a||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,error:t.message}}}export{x as a,N as h,H as i};
1
+ import{O as T,Q as V,V as P,H as $}from"./auth-B5ky5TwC.js";function A(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(A(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 a=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${a},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(A(this.serverUrl))}}async function x(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,c)=>{const E=n.timeout||12e4;let w,f=!1;const O=t.state(),_=`${I}${O}`,l=()=>{if(!f){f=!0,window.removeEventListener("message",m),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(_)}catch{}}},k=async i=>{if(f)return;if(!i.success){l(),c(new Error(i.error||"OAuth authentication failed"));return}const{code:h,state:b}=i;if(!h){l(),c(new Error("Missing authorization code"));return}if(t.getStoredState()!==b){l(),c(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const S=(await T(e))?.authorization_servers?.[0]||e,y=await V(S),d=t.clientInformation();if(!d){l(),c(new Error("Client information not found"));return}const C=t.codeVerifier(),M=await P(S,{metadata:y,clientInformation:d,authorizationCode:h,codeVerifier:C,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:M,clientId:d.client_id??null,clientSecret:"client_secret"in d?d.client_secret:null,tokenEndpoint:y?.token_endpoint??null})}catch(v){l(),c(v)}},m=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await k(i.data)},g=async i=>{if(!(i.key!==_||!i.newValue))try{const h=JSON.parse(i.newValue);await k(h)}catch{}};window.addEventListener("message",m),window.addEventListener("storage",g),w=setTimeout(()=>{l(),c(new Error("OAuth authentication timeout"))},E)});if(await $(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 N(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),a=n.get("error_description");let s=t;if(t)try{const r=atob(t),c=JSON.parse(r);c.clientState&&(s=c.clientState)}catch{}if(o){const r=a||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"}}async function H({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"}}})});if(o.ok)return{isAuthenticated:!0,supportsOAuth:!0};let a;try{const r=await o.json();a=r.error||r.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,error:a||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),error:a||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,error:t.message}}}export{x as a,N as h,H as i};
@@ -1 +1 @@
1
- import{r as E,c as M,j as s,h as ve,d as Te,b as _e,a as Ie,t as he}from"./index-DHr9tFb0.js";import{i as Me}from"./AlertCircle-CZPV4eTQ.js";import{i as je}from"./Loading01-C0_l8AxO.js";import{B as ie}from"./input-C4WvdKkR.js";import{i as Pe}from"./ArrowLeft-DQOG1GuJ.js";import{I as ye,E as Le,b as De,u as Ee,d as $e,c as Ue}from"./use-connection-gZqQ1FAI.js";import{t as Ve}from"./ChevronDown-Cdy__m-8.js";import{s as ge}from"./Plus-KTlOMNSY.js";import{b as Re,D as ze,a as Ae,c as Be}from"./dropdown-menu-DTGJCwi0.js";import{n as be}from"./LinkExternal01-BklnopGx.js";import{T as Ge,R as Oe}from"./tools-list-BQ6I_zS0.js";import{R as We}from"./resource-tabs-DXcOsIua.js";import{a as Fe}from"./use-binding-DxCldqD_.js";import{u as He}from"./use-tool-call-DYbV_cs9.js";import{u as Ze}from"./use-mcp-DVQixgJB.js";import{u as Ne}from"./project-context-provider-SYQQWwHt.js";import{e as Ke}from"./extract-connection-data-E0zDRO9-.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{e as Je,g as Qe}from"./github-icon-Dp3wHhYE.js";import{f as Xe,g as Ye,c as et}from"./registry-utils-B7t_ZBUi.js";import{e as tt}from"./server-name-C3ttWdyD.js";import{i as st}from"./InfoCircle-r2yyYHHv.js";import"./ChevronRight-SzPzGSNO.js";import"./useQuery--jXLy0yb.js";import"./File06-CUqAuIUq.js";import"./collection-display-button-CqzsQ6A1.js";import"./Grid01-R-k411L-.js";import"./view-mode-toggle-DAKbBF5Z.js";import"./collection-search-CIs95Rnw.js";import"./collection-table-wrapper-D1OlmFUL.js";import"./card-DZuxbKf1.js";import"./layout-9R3rtCy3.js";import"./badge-99kEJDtp.js";import"./auth-CJNQiaii.js";import"./constants-BSLIcG1u.js";import"./generate-id-Dyweu44Y.js";const Ce=({size:t=24,color:e="currentColor",...r})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},E.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ce.displayName="CheckCircle";const we=({size:t=24,color:e="currentColor",...r})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},E.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));we.displayName="SearchLg";function rt(t){const e=M.c(3),{message:r}=t,o=r===void 0?"Loading MCP Server details...":r;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(je,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==o?(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:o})]}),e[1]=o,e[2]=i):i=e[2],i}function ot(t){const e=M.c(9),{error:r,onBack:o}=t,n=r instanceof Error?r.message:r;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Me,{size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==n?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=a):a=e[3];let l;e[4]!==o?(l=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"}),e[4]=o,e[5]=l):l=e[5];let f;return e[6]!==a||e[7]!==l?(f=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=f):f=e[8],f}function nt(t){const e=M.c(5),{onBack:r}=t;let o,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(we,{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]=o,e[1]=n,e[2]=i):(o=e[0],n=e[1],i=e[2]);let d;return e[3]!==r?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,n,i,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 to Store"})]}),e[3]=r,e[4]=d):d=e[4],d}function it(t){const e=M.c(3),{onBack:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Pe,{}),e[0]=o):o=e[0];let n;return e[1]!==r?(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(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:r,"aria-label":"Go back",children:o})})}),e[1]=r,e[2]=n):n=e[2],n}function lt(t){const e=M.c(30),{data:r,itemVersions:o,onInstall:n,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[f,b]=E.useState(0);let h;e[0]!==n?(h=j=>{b(j),n(j)},e[0]=n,e[1]=h):h=e[1];const u=h;let x;e[2]!==r.icon||e[3]!==r.name?(x=s.jsx(ye,{icon:r.icon,name:r.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=r.icon,e[3]=r.name,e[4]=x):x=e[4];let p;e[5]!==r.name?(p=s.jsx("h1",{className:"text-3xl font-medium",children:r.name}),e[5]=r.name,e[6]=p):p=e[6];let g;e[7]!==r.verified?(g=r.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=r.verified,e[8]=g):g=e[8];let N;e[9]!==p||e[10]!==g?(N=s.jsxs("div",{className:"flex items-center gap-2",children:[p,g]}),e[9]=p,e[10]=g,e[11]=N):N=e[11];let C;e[12]!==r.shortDescription?(C=r.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r.shortDescription}),e[12]=r.shortDescription,e[13]=C):C=e[13];let w;e[14]!==N||e[15]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[N,C]}),e[14]=N,e[15]=C,e[16]=w):w=e[16];let S;e[17]!==a||e[18]!==u||e[19]!==l||e[20]!==o||e[21]!==n||e[22]!==f?(S=a?s.jsx("div",{className:"shrink-0",children:o.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>u(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect Connection"]}),s.jsxs(Re,{children:[s.jsx(ze,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(Ve,{size:20})})}),s.jsx(Ae,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:o.map((j,m)=>{const _=j._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Be,{onClick:()=>u(m),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",j.server?.version||"unknown"]}),_?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),m===f&&s.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"})]})},m)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>n(),disabled:o.length===0||l,className:"shrink-0",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[17]=a,e[18]=u,e[19]=l,e[20]=o,e[21]=n,e[22]=f,e[23]=S):S=e[23];let k;e[24]!==S||e[25]!==w?(k=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[w,S]}),e[24]=S,e[25]=w,e[26]=k):k=e[26];let T;return e[27]!==k||e[28]!==x?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[x,k]}),e[27]=k,e[28]=x,e[29]=T):T=e[29],T}function at(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ct(t){const e=M.c(47),{data:r,publisherInfo:o,selectedItem:n}=t;let i;e[0]!==r.description?(i=r.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:r.description})]}),e[0]=r.description,e[1]=i):i=e[1];const d=r.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":r.publisher;let a;e[2]!==o.logo||e[3]!==d?(a=s.jsx(ye,{icon:o.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=o.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==r.publisher?(l=r.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":r.publisher.charAt(0).toUpperCase()+r.publisher.slice(1),e[5]=r.publisher,e[6]=l):l=e[6];let f;e[7]!==l?(f=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=f):f=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=b):b=e[9];let h;e[10]!==f?(h=s.jsxs("div",{children:[f,b]}),e[10]=f,e[11]=h):h=e[11];let u;e[12]!==a||e[13]!==h?(u=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,h]})}),e[12]=a,e[13]=h,e[14]=u):u=e[14];let x;e[15]!==r.version?(x=r.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",r.version]})]}),e[15]=r.version,e[16]=x):x=e[16];let p;e[17]!==r.tags?(p=r.tags&&r.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:r.tags.map(mt)})]}),e[17]=r.tags,e[18]=p):p=e[18];let g;e[19]!==r.categories?(g=r.categories&&r.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:r.categories.map(dt)})]}),e[19]=r.categories,e[20]=g):g=e[20];let N;e[21]!==r.connectionType?(N=r.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:r.connectionType})]}),e[21]=r.connectionType,e[22]=N):N=e[22];let C;e[23]!==r.schemaVersion?(C=r.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:r.schemaVersion})]}),e[23]=r.schemaVersion,e[24]=C):C=e[24];let w;e[25]!==r.websiteUrl?(w=r.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:r.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(be,{size:14})]})]}),e[25]=r.websiteUrl,e[26]=w):w=e[26];let S;e[27]!==r.repository?(S=r.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:r.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(be,{size:14})]})]}),e[27]=r.repository,e[28]=S):S=e[28];let k;e[29]!==p||e[30]!==g||e[31]!==N||e[32]!==C||e[33]!==w||e[34]!==S||e[35]!==x?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[x,p,g,N,C,w,S]}),e[29]=p,e[30]=g,e[31]=N,e[32]=C,e[33]=w,e[34]=S,e[35]=x,e[36]=k):k=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=T):T=e[37];let j;e[38]!==n.updated_at?(j=at(n.updated_at),e[38]=n.updated_at,e[39]=j):j=e[39];let m;e[40]!==j?(m=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[T,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[40]=j,e[41]=m):m=e[41];let _;return e[42]!==i||e[43]!==k||e[44]!==m||e[45]!==u?(_=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,u,k,m]}),e[42]=i,e[43]=k,e[44]=m,e[45]=u,e[46]=_):_=e[46],_}function dt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function mt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function ft(t){const e=M.c(18),{data:r,availableTabs:o,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let f;e[0]!==i?(f=i.map(ut),e[0]=i,e[1]=f):f=e[1];const b=f;let h;e[2]!==o||e[3]!==n||e[4]!==a?(h=o.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(We,{tabs:o,activeTab:n,onTabChange:a})}),e[2]=o,e[3]=n,e[4]=a,e[5]=h):h=e[5];let u;e[6]!==n||e[7]!==i.length||e[8]!==l||e[9]!==b?(u=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:b,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(Le,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[6]=n,e[7]=i.length,e[8]=l,e[9]=b,e[10]=u):u=e[10];let x;e[11]!==r?.repository||e[12]!==n?(x=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Oe,{repository:r?.repository})}),e[11]=r?.repository,e[12]=n,e[13]=x):x=e[13];let p;return e[14]!==h||e[15]!==u||e[16]!==x?(p=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[h,u,x]}),e[14]=h,e[15]=u,e[16]=x,e[17]=p):p=e[17],p}function ut(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function xt(t,e){if(!t||!e)return;const r=e.toLowerCase();return t.find(o=>o.app_name?.toLowerCase()===r||o.app_id?.toLowerCase()===r||o.title.toLowerCase()===r)||t.find(o=>o.title.toLowerCase().includes(r))}function pt(t,e,r,o,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:o?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:r?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function ht(t){const e=t._meta?.["mcp.mesh"],r=t._meta?.["io.modelcontextprotocol.registry/official"],o=t.server,n=Ye(o.remotes?.[0]?.type),i=et(o.$schema),d=r?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",a=Qe(o.repository),l=t.icon||t.image||t.logo||o.icons?.[0]?.src||a||null,f=t.name||t.title||t.server?.title||"Unnamed Item",b=tt(f),h=e?.friendly_name||b,u=e?.mesh_description||t.description||t.summary||o?.description||"",x=e?.short_description||null,p=e?.tags||[],g=e?.categories||[];return{name:h,description:u,shortDescription:x,icon:l,verified:t.verified||e?.verified,publisher:d,version:o.version||null,websiteUrl:o.websiteUrl||null,repository:o.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:p,categories:g,tools:t.tools||o.tools||e?.tools||[],models:t.models||o.models||e?.models||[],emails:t.emails||o.emails||e?.emails||[],analytics:t.analytics||o.analytics||e?.analytics,cdn:t.cdn||o.cdn||e?.cdn}}class gt extends E.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Store MCP server detail error:",e,r)}render(){return this.state.hasError?s.jsx(ot,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function bt(){const t=M.c(70),{org:e}=Ne(),r=ve();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const{appName:n}=Te(o);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=_e(i),[l,f]=E.useState("readme"),b=De(),h=Ee(),{data:u}=Ie.useSession(),x=Fe(h),p=d||x[0]?.id||"",g=$e(p),N=Xe(g?.tools),C=g?.tools&&g.tools.find(Ct)?.name||"",w=g?.tools&&g.tools.find(Nt)?.name||"",S=Ue(p),k=!!a;let T,j;k?(T=C||w,j={name:a}):(T=N,j={});const{data:m}=He({toolCaller:S,toolName:T,toolInputParams:j,scope:p});let _=[],P=[],xe=null;if(m){if(Array.isArray(m))_=m;else if(typeof m=="object"&&m!==null)if("totalCount"in m&&typeof m.totalCount=="number"&&(xe=m.totalCount),"item"in m&&m.item){const c=m.item,I=c.id||"",$=c.server,U=c._meta;let D;t[2]!==c.title||t[3]!==I||t[4]!==$||t[5]!==U?(D=[{id:I,title:c.title,server:$,_meta:U}],t[2]=c.title,t[3]=I,t[4]=$,t[5]=U,t[6]=D):D=t[6],_=D}else{let c;"versions"in m&&Array.isArray(m.versions)?c="versions":"servers"in m&&Array.isArray(m.servers)?c="servers":c=Object.keys(m).find(I=>Array.isArray(m[I])),c&&(_=m[c],(c==="versions"||T?.includes("VERSIONS"))&&(P=_))}}let X;t[7]!==n?(X=c=>{const I=c.name||c.title||c.server.title||"";return qe(I)===n},t[7]=n,t[8]=X):X=t[8];let y=_.find(X);if(!y&&a){let c;t[9]!==a?(c=I=>I.server.name===a||I.name===a||I.title===a,t[9]=a,t[10]=c):c=t[10],y=_.find(c)}const v=y?ht(y):null,le=(v?.tools?.length||0)>0,ae=y?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ze({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(yt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const pe=ee,V=le?v?.tools||[]:pe,Se=xt(h,v?.publisher),ce=v?pt(_,v.publisher,Se,g??null,xe):{count:0},ke=v?.repository?Je(v.repository):null,de=!!v?.repository&&!!ke;let R;t[14]!==de?(R={id:"readme",label:"README",visible:de},t[14]=de,t[15]=R):R=t[15];const me=le||pe.length>0||Y&&!!ae;let z;t[16]!==V.length||t[17]!==me?(z={id:"tools",label:"Tools",count:V.length,visible:me},t[16]=V.length,t[17]=me,t[18]=z):z=t[18];let te;t[19]!==R||t[20]!==z?(te=[R,z].filter(jt),t[19]=R,t[20]=z,t[21]=te):te=t[21];const L=te;let se;t[22]!==l||t[23]!==L?(se=L.find(c=>c.id===l)?l:L.find(vt)?.id||L[0]?.id||"overview",t[22]=l,t[23]=L,t[24]=se):se=t[24];const fe=se;let re;t[25]!==b||t[26]!==P||t[27]!==r||t[28]!==e||t[29]!==y||t[30]!==u?(re=async c=>{const I=P[c??0]||y;if(!I||!e||!u?.user?.id)return;const $=Ke(I,e.id,u.user.id);if(!$.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:U}=await b.create.mutateAsync($);r({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:U}})}catch(U){const D=U;he.error(`Failed to connect MCP Server: ${D instanceof Error?D.message:String(D)}`)}},t[25]=b,t[26]=P,t[27]=r,t[28]=e,t[29]=y,t[30]=u,t[31]=re):re=t[31];const ue=re;let oe;t[32]!==r||t[33]!==e.slug?(oe=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[32]=r,t[33]=e.slug,t[34]=oe):oe=t[34];const A=oe;if(!y){let c;return t[35]!==A?(c=s.jsx(nt,{onBack:A}),t[35]=A,t[36]=c):c=t[36],c}if(!v)return null;const B=(y?.server?.remotes?.length??0)>0;let G;t[37]!==A?(G=s.jsx(it,{onBack:A}),t[37]=A,t[38]=G):G=t[38];let O;t[39]!==B?(O=!B&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=B,t[40]=O):O=t[40];let W;t[41]!==P||t[42]!==y?(W=P.length>0?P:[y],t[41]=P,t[42]=y,t[43]=W):W=t[43];let F;t[44]!==b.create.isPending||t[45]!==B||t[46]!==v||t[47]!==ue||t[48]!==W?(F=s.jsx(lt,{data:v,itemVersions:W,onInstall:ue,canInstall:B,isInstalling:b.create.isPending}),t[44]=b.create.isPending,t[45]=B,t[46]=v,t[47]=ue,t[48]=W,t[49]=F):F=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==y?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:y}),t[50]=v,t[51]=ce,t[52]=y,t[53]=H):H=t[53];let Z;t[54]!==L||t[55]!==v||t[56]!==fe||t[57]!==V||t[58]!==Y?(Z=s.jsx(ft,{data:v,availableTabs:L,effectiveActiveTabId:fe,effectiveTools:V,isLoadingTools:Y,onTabChange:f}),t[54]=L,t[55]=v,t[56]=fe,t[57]=V,t[58]=Y,t[59]=Z):Z=t[59];let K;t[60]!==H||t[61]!==Z?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,Z]}),t[60]=H,t[61]=Z,t[62]=K):K=t[62];let q;t[63]!==O||t[64]!==F||t[65]!==K?(q=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:[O,F,K]})})}),t[63]=O,t[64]=F,t[65]=K,t[66]=q):q=t[66];let ne;return t[67]!==G||t[68]!==q?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,q]}),t[67]=G,t[68]=q,t[69]=ne):ne=t[69],ne}function vt(t){return t.id==="readme"}function jt(t){return t.visible}function yt(t){return{name:t.name,description:t.description}}function Nt(t){return t.name.endsWith("_GET")}function Ct(t){return t.name.endsWith("_VERSIONS")}function is(){const t=M.c(6),{org:e}=Ne(),r=ve();let o;t[0]!==r||t[1]!==e.slug?(o=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[0]=r,t[1]=e.slug,t[2]=o):o=t[2];const n=o;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(E.Suspense,{fallback:s.jsx(rt,{}),children:s.jsx(bt,{})}),t[3]=i):i=t[3];let d;return t[4]!==n?(d=s.jsx(gt,{onBack:n,children:i}),t[4]=n,t[5]=d):d=t[5],d}export{is as default};
1
+ import{r as E,c as M,j as s,h as ve,d as Te,b as _e,a as Ie,t as he}from"./index-C42QK8hz.js";import{i as Me}from"./AlertCircle-DS3woffv.js";import{i as je}from"./Loading01-_oFW2JNJ.js";import{B as ie}from"./input-DxnDBmuJ.js";import{i as Pe}from"./ArrowLeft-D2fGgQyc.js";import{I as ye,E as Le,b as De,u as Ee,d as $e,c as Ue}from"./use-connection-CD7OAk7L.js";import{t as Ve}from"./ChevronDown-D3DcMPHu.js";import{s as ge}from"./Plus-FlxbOuMX.js";import{b as Re,D as ze,a as Ae,c as Be}from"./dropdown-menu-BVwO0hZx.js";import{n as be}from"./LinkExternal01-DaWdwcWA.js";import{T as Ge,R as Oe}from"./tools-list-Bgq8z3Q2.js";import{R as We}from"./resource-tabs-BEIxRUtB.js";import{a as Fe}from"./use-binding-CpFrN3sc.js";import{u as He}from"./use-tool-call-3UqP0ScZ.js";import{u as Ze}from"./use-mcp-B4Ldjn0r.js";import{u as Ne}from"./project-context-provider-D9nZUGnc.js";import{e as Ke}from"./extract-connection-data-BI7D_yAD.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{e as Je,g as Qe}from"./github-icon-Dp3wHhYE.js";import{f as Xe,g as Ye,c as et}from"./registry-utils-B7t_ZBUi.js";import{e as tt}from"./server-name-C3ttWdyD.js";import{i as st}from"./InfoCircle-C37WJXSN.js";import"./ChevronRight-BODSq5G5.js";import"./useQuery-CaL9aChr.js";import"./File06-l3h9AVPx.js";import"./collection-display-button-DPE08pwq.js";import"./Grid01-BFWxtLBX.js";import"./view-mode-toggle-B13uQDqD.js";import"./collection-search-C3TCN4Mb.js";import"./collection-table-wrapper-W9a8ZvDr.js";import"./card-DoMPrO_z.js";import"./layout-DXdXITg6.js";import"./badge-Cd9ypVQ7.js";import"./auth-B5ky5TwC.js";import"./constants-B1MsiORH.js";import"./generate-id-Dyweu44Y.js";const Ce=({size:t=24,color:e="currentColor",...r})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},E.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ce.displayName="CheckCircle";const we=({size:t=24,color:e="currentColor",...r})=>E.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},E.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));we.displayName="SearchLg";function rt(t){const e=M.c(3),{message:r}=t,o=r===void 0?"Loading MCP Server details...":r;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(je,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==o?(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:o})]}),e[1]=o,e[2]=i):i=e[2],i}function ot(t){const e=M.c(9),{error:r,onBack:o}=t,n=r instanceof Error?r.message:r;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Me,{size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==n?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=a):a=e[3];let l;e[4]!==o?(l=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"}),e[4]=o,e[5]=l):l=e[5];let f;return e[6]!==a||e[7]!==l?(f=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=f):f=e[8],f}function nt(t){const e=M.c(5),{onBack:r}=t;let o,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(we,{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]=o,e[1]=n,e[2]=i):(o=e[0],n=e[1],i=e[2]);let d;return e[3]!==r?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[o,n,i,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 to Store"})]}),e[3]=r,e[4]=d):d=e[4],d}function it(t){const e=M.c(3),{onBack:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Pe,{}),e[0]=o):o=e[0];let n;return e[1]!==r?(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(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:r,"aria-label":"Go back",children:o})})}),e[1]=r,e[2]=n):n=e[2],n}function lt(t){const e=M.c(30),{data:r,itemVersions:o,onInstall:n,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[f,b]=E.useState(0);let h;e[0]!==n?(h=j=>{b(j),n(j)},e[0]=n,e[1]=h):h=e[1];const u=h;let x;e[2]!==r.icon||e[3]!==r.name?(x=s.jsx(ye,{icon:r.icon,name:r.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=r.icon,e[3]=r.name,e[4]=x):x=e[4];let p;e[5]!==r.name?(p=s.jsx("h1",{className:"text-3xl font-medium",children:r.name}),e[5]=r.name,e[6]=p):p=e[6];let g;e[7]!==r.verified?(g=r.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=r.verified,e[8]=g):g=e[8];let N;e[9]!==p||e[10]!==g?(N=s.jsxs("div",{className:"flex items-center gap-2",children:[p,g]}),e[9]=p,e[10]=g,e[11]=N):N=e[11];let C;e[12]!==r.shortDescription?(C=r.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r.shortDescription}),e[12]=r.shortDescription,e[13]=C):C=e[13];let w;e[14]!==N||e[15]!==C?(w=s.jsxs("div",{className:"flex-1 min-w-0",children:[N,C]}),e[14]=N,e[15]=C,e[16]=w):w=e[16];let S;e[17]!==a||e[18]!==u||e[19]!==l||e[20]!==o||e[21]!==n||e[22]!==f?(S=a?s.jsx("div",{className:"shrink-0",children:o.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>u(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect Connection"]}),s.jsxs(Re,{children:[s.jsx(ze,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(Ve,{size:20})})}),s.jsx(Ae,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:o.map((j,m)=>{const _=j._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Be,{onClick:()=>u(m),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",j.server?.version||"unknown"]}),_?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),m===f&&s.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"})]})},m)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>n(),disabled:o.length===0||l,className:"shrink-0",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[17]=a,e[18]=u,e[19]=l,e[20]=o,e[21]=n,e[22]=f,e[23]=S):S=e[23];let k;e[24]!==S||e[25]!==w?(k=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[w,S]}),e[24]=S,e[25]=w,e[26]=k):k=e[26];let T;return e[27]!==k||e[28]!==x?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[x,k]}),e[27]=k,e[28]=x,e[29]=T):T=e[29],T}function at(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ct(t){const e=M.c(47),{data:r,publisherInfo:o,selectedItem:n}=t;let i;e[0]!==r.description?(i=r.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:r.description})]}),e[0]=r.description,e[1]=i):i=e[1];const d=r.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":r.publisher;let a;e[2]!==o.logo||e[3]!==d?(a=s.jsx(ye,{icon:o.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=o.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==r.publisher?(l=r.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":r.publisher.charAt(0).toUpperCase()+r.publisher.slice(1),e[5]=r.publisher,e[6]=l):l=e[6];let f;e[7]!==l?(f=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=f):f=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=b):b=e[9];let h;e[10]!==f?(h=s.jsxs("div",{children:[f,b]}),e[10]=f,e[11]=h):h=e[11];let u;e[12]!==a||e[13]!==h?(u=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,h]})}),e[12]=a,e[13]=h,e[14]=u):u=e[14];let x;e[15]!==r.version?(x=r.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",r.version]})]}),e[15]=r.version,e[16]=x):x=e[16];let p;e[17]!==r.tags?(p=r.tags&&r.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:r.tags.map(mt)})]}),e[17]=r.tags,e[18]=p):p=e[18];let g;e[19]!==r.categories?(g=r.categories&&r.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:r.categories.map(dt)})]}),e[19]=r.categories,e[20]=g):g=e[20];let N;e[21]!==r.connectionType?(N=r.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:r.connectionType})]}),e[21]=r.connectionType,e[22]=N):N=e[22];let C;e[23]!==r.schemaVersion?(C=r.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:r.schemaVersion})]}),e[23]=r.schemaVersion,e[24]=C):C=e[24];let w;e[25]!==r.websiteUrl?(w=r.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:r.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(be,{size:14})]})]}),e[25]=r.websiteUrl,e[26]=w):w=e[26];let S;e[27]!==r.repository?(S=r.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:r.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(be,{size:14})]})]}),e[27]=r.repository,e[28]=S):S=e[28];let k;e[29]!==p||e[30]!==g||e[31]!==N||e[32]!==C||e[33]!==w||e[34]!==S||e[35]!==x?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[x,p,g,N,C,w,S]}),e[29]=p,e[30]=g,e[31]=N,e[32]=C,e[33]=w,e[34]=S,e[35]=x,e[36]=k):k=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=T):T=e[37];let j;e[38]!==n.updated_at?(j=at(n.updated_at),e[38]=n.updated_at,e[39]=j):j=e[39];let m;e[40]!==j?(m=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[T,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:j})]}),e[40]=j,e[41]=m):m=e[41];let _;return e[42]!==i||e[43]!==k||e[44]!==m||e[45]!==u?(_=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,u,k,m]}),e[42]=i,e[43]=k,e[44]=m,e[45]=u,e[46]=_):_=e[46],_}function dt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function mt(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function ft(t){const e=M.c(18),{data:r,availableTabs:o,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let f;e[0]!==i?(f=i.map(ut),e[0]=i,e[1]=f):f=e[1];const b=f;let h;e[2]!==o||e[3]!==n||e[4]!==a?(h=o.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(We,{tabs:o,activeTab:n,onTabChange:a})}),e[2]=o,e[3]=n,e[4]=a,e[5]=h):h=e[5];let u;e[6]!==n||e[7]!==i.length||e[8]!==l||e[9]!==b?(u=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:b,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(Le,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[6]=n,e[7]=i.length,e[8]=l,e[9]=b,e[10]=u):u=e[10];let x;e[11]!==r?.repository||e[12]!==n?(x=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Oe,{repository:r?.repository})}),e[11]=r?.repository,e[12]=n,e[13]=x):x=e[13];let p;return e[14]!==h||e[15]!==u||e[16]!==x?(p=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[h,u,x]}),e[14]=h,e[15]=u,e[16]=x,e[17]=p):p=e[17],p}function ut(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function xt(t,e){if(!t||!e)return;const r=e.toLowerCase();return t.find(o=>o.app_name?.toLowerCase()===r||o.app_id?.toLowerCase()===r||o.title.toLowerCase()===r)||t.find(o=>o.title.toLowerCase().includes(r))}function pt(t,e,r,o,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:o?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:r?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function ht(t){const e=t._meta?.["mcp.mesh"],r=t._meta?.["io.modelcontextprotocol.registry/official"],o=t.server,n=Ye(o.remotes?.[0]?.type),i=et(o.$schema),d=r?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",a=Qe(o.repository),l=t.icon||t.image||t.logo||o.icons?.[0]?.src||a||null,f=t.name||t.title||t.server?.title||"Unnamed Item",b=tt(f),h=e?.friendly_name||b,u=e?.mesh_description||t.description||t.summary||o?.description||"",x=e?.short_description||null,p=e?.tags||[],g=e?.categories||[];return{name:h,description:u,shortDescription:x,icon:l,verified:t.verified||e?.verified,publisher:d,version:o.version||null,websiteUrl:o.websiteUrl||null,repository:o.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:p,categories:g,tools:t.tools||o.tools||e?.tools||[],models:t.models||o.models||e?.models||[],emails:t.emails||o.emails||e?.emails||[],analytics:t.analytics||o.analytics||e?.analytics,cdn:t.cdn||o.cdn||e?.cdn}}class gt extends E.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Store MCP server detail error:",e,r)}render(){return this.state.hasError?s.jsx(ot,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function bt(){const t=M.c(70),{org:e}=Ne(),r=ve();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const{appName:n}=Te(o);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=_e(i),[l,f]=E.useState("readme"),b=De(),h=Ee(),{data:u}=Ie.useSession(),x=Fe(h),p=d||x[0]?.id||"",g=$e(p),N=Xe(g?.tools),C=g?.tools&&g.tools.find(Ct)?.name||"",w=g?.tools&&g.tools.find(Nt)?.name||"",S=Ue(p),k=!!a;let T,j;k?(T=C||w,j={name:a}):(T=N,j={});const{data:m}=He({toolCaller:S,toolName:T,toolInputParams:j,scope:p});let _=[],P=[],xe=null;if(m){if(Array.isArray(m))_=m;else if(typeof m=="object"&&m!==null)if("totalCount"in m&&typeof m.totalCount=="number"&&(xe=m.totalCount),"item"in m&&m.item){const c=m.item,I=c.id||"",$=c.server,U=c._meta;let D;t[2]!==c.title||t[3]!==I||t[4]!==$||t[5]!==U?(D=[{id:I,title:c.title,server:$,_meta:U}],t[2]=c.title,t[3]=I,t[4]=$,t[5]=U,t[6]=D):D=t[6],_=D}else{let c;"versions"in m&&Array.isArray(m.versions)?c="versions":"servers"in m&&Array.isArray(m.servers)?c="servers":c=Object.keys(m).find(I=>Array.isArray(m[I])),c&&(_=m[c],(c==="versions"||T?.includes("VERSIONS"))&&(P=_))}}let X;t[7]!==n?(X=c=>{const I=c.name||c.title||c.server.title||"";return qe(I)===n},t[7]=n,t[8]=X):X=t[8];let y=_.find(X);if(!y&&a){let c;t[9]!==a?(c=I=>I.server.name===a||I.name===a||I.title===a,t[9]=a,t[10]=c):c=t[10],y=_.find(c)}const v=y?ht(y):null,le=(v?.tools?.length||0)>0,ae=y?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ze({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(yt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const pe=ee,V=le?v?.tools||[]:pe,Se=xt(h,v?.publisher),ce=v?pt(_,v.publisher,Se,g??null,xe):{count:0},ke=v?.repository?Je(v.repository):null,de=!!v?.repository&&!!ke;let R;t[14]!==de?(R={id:"readme",label:"README",visible:de},t[14]=de,t[15]=R):R=t[15];const me=le||pe.length>0||Y&&!!ae;let z;t[16]!==V.length||t[17]!==me?(z={id:"tools",label:"Tools",count:V.length,visible:me},t[16]=V.length,t[17]=me,t[18]=z):z=t[18];let te;t[19]!==R||t[20]!==z?(te=[R,z].filter(jt),t[19]=R,t[20]=z,t[21]=te):te=t[21];const L=te;let se;t[22]!==l||t[23]!==L?(se=L.find(c=>c.id===l)?l:L.find(vt)?.id||L[0]?.id||"overview",t[22]=l,t[23]=L,t[24]=se):se=t[24];const fe=se;let re;t[25]!==b||t[26]!==P||t[27]!==r||t[28]!==e||t[29]!==y||t[30]!==u?(re=async c=>{const I=P[c??0]||y;if(!I||!e||!u?.user?.id)return;const $=Ke(I,e.id,u.user.id);if(!$.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:U}=await b.create.mutateAsync($);r({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:U}})}catch(U){const D=U;he.error(`Failed to connect MCP Server: ${D instanceof Error?D.message:String(D)}`)}},t[25]=b,t[26]=P,t[27]=r,t[28]=e,t[29]=y,t[30]=u,t[31]=re):re=t[31];const ue=re;let oe;t[32]!==r||t[33]!==e.slug?(oe=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[32]=r,t[33]=e.slug,t[34]=oe):oe=t[34];const A=oe;if(!y){let c;return t[35]!==A?(c=s.jsx(nt,{onBack:A}),t[35]=A,t[36]=c):c=t[36],c}if(!v)return null;const B=(y?.server?.remotes?.length??0)>0;let G;t[37]!==A?(G=s.jsx(it,{onBack:A}),t[37]=A,t[38]=G):G=t[38];let O;t[39]!==B?(O=!B&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=B,t[40]=O):O=t[40];let W;t[41]!==P||t[42]!==y?(W=P.length>0?P:[y],t[41]=P,t[42]=y,t[43]=W):W=t[43];let F;t[44]!==b.create.isPending||t[45]!==B||t[46]!==v||t[47]!==ue||t[48]!==W?(F=s.jsx(lt,{data:v,itemVersions:W,onInstall:ue,canInstall:B,isInstalling:b.create.isPending}),t[44]=b.create.isPending,t[45]=B,t[46]=v,t[47]=ue,t[48]=W,t[49]=F):F=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==y?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:y}),t[50]=v,t[51]=ce,t[52]=y,t[53]=H):H=t[53];let Z;t[54]!==L||t[55]!==v||t[56]!==fe||t[57]!==V||t[58]!==Y?(Z=s.jsx(ft,{data:v,availableTabs:L,effectiveActiveTabId:fe,effectiveTools:V,isLoadingTools:Y,onTabChange:f}),t[54]=L,t[55]=v,t[56]=fe,t[57]=V,t[58]=Y,t[59]=Z):Z=t[59];let K;t[60]!==H||t[61]!==Z?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,Z]}),t[60]=H,t[61]=Z,t[62]=K):K=t[62];let q;t[63]!==O||t[64]!==F||t[65]!==K?(q=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:[O,F,K]})})}),t[63]=O,t[64]=F,t[65]=K,t[66]=q):q=t[66];let ne;return t[67]!==G||t[68]!==q?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,q]}),t[67]=G,t[68]=q,t[69]=ne):ne=t[69],ne}function vt(t){return t.id==="readme"}function jt(t){return t.visible}function yt(t){return{name:t.name,description:t.description}}function Nt(t){return t.name.endsWith("_GET")}function Ct(t){return t.name.endsWith("_VERSIONS")}function is(){const t=M.c(6),{org:e}=Ne(),r=ve();let o;t[0]!==r||t[1]!==e.slug?(o=()=>{r({to:"/$org/store",params:{org:e.slug}})},t[0]=r,t[1]=e.slug,t[2]=o):o=t[2];const n=o;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(E.Suspense,{fallback:s.jsx(rt,{}),children:s.jsx(bt,{})}),t[3]=i):i=t[3];let d;return t[4]!==n?(d=s.jsx(gt,{onBack:n,children:i}),t[4]=n,t[5]=d):d=t[5],d}export{is as default};