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

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 (112) hide show
  1. package/dist/client/assets/{AlertCircle-DXrRWAdV.js → AlertCircle-D6ztaobt.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-B2kSl8Am.js → ArrowLeft-CjVyVt-H.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-BjfQSM1r.js → CheckCircle-DgunLZQR.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-LB39JZIr.js → ChevronDown-BbXb_40w.js} +1 -1
  5. package/dist/client/assets/{Clock-umdgxXOC.js → Clock-YTJnTBDI.js} +1 -1
  6. package/dist/client/assets/{Copy01-Bilz-YTB.js → Copy01-CCevdGb6.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-CHm038ee.js → CpuChip02-CTGBZdsr.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-Bpn8NPVg.js → DotsVertical-DWgbGhdO.js} +1 -1
  9. package/dist/client/assets/{File06-88jNCz1V.js → File06-CRfao4L4.js} +1 -1
  10. package/dist/client/assets/{Grid01-irgYf3_6.js → Grid01-S3S2kEug.js} +1 -1
  11. package/dist/client/assets/{Inbox01-CoVSGBs_.js → Inbox01-CdZg2SI6.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-D7V0pgdh.js → InfoCircle-CEqhPApg.js} +1 -1
  13. package/dist/client/assets/{Key01-CKDDrXuQ.js → Key01-7zjlT7bl.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-BWsuTDiz.js → LinkExternal01-Zdv63NPa.js} +1 -1
  15. package/dist/client/assets/{Loading01-BWm5a2UX.js → Loading01-CNHBx4kI.js} +1 -1
  16. package/dist/client/assets/{Plus-Slubr3Mn.js → Plus-DfnNWvZl.js} +1 -1
  17. package/dist/client/assets/{SearchMd-D-BfTFbd.js → SearchMd-DBUkNw9d.js} +1 -1
  18. package/dist/client/assets/{Trash01-QqFxB-ic.js → Trash01-CC4RWtjd.js} +1 -1
  19. package/dist/client/assets/{Upload01-BSDcq_ig.js → Upload01-ZzW7ToAX.js} +1 -1
  20. package/dist/client/assets/{X-qVvh8Z0J.js → X-CmV6VETi.js} +1 -1
  21. package/dist/client/assets/{XClose-Crvz7f11.js → XClose-C_Ro2jwa.js} +1 -1
  22. package/dist/client/assets/{alert-dialog-BKLc86P2.js → alert-dialog-DKN25P9n.js} +1 -1
  23. package/dist/client/assets/{auth-catchall-BAv_qdLN.js → auth-catchall-wEPMHcQu.js} +1 -1
  24. package/dist/client/assets/{auth-g7Ue41hR.js → auth-y34g-zyR.js} +1 -1
  25. package/dist/client/assets/{avatar-7mHRD9aF.js → avatar-D6wdL-4h.js} +1 -1
  26. package/dist/client/assets/{badge-CuERIkGI.js → badge-D5IC8-XQ.js} +1 -1
  27. package/dist/client/assets/{button-WiHHb1ae.js → button-n-dnBUcs.js} +1 -1
  28. package/dist/client/assets/{card-BCizSi8r.js → card--RtELIXA.js} +1 -1
  29. package/dist/client/assets/{checkbox-D_yjB9VU.js → checkbox-ByvFrlEw.js} +1 -1
  30. package/dist/client/assets/{collection-detail-CgNwKBY0.js → collection-detail-CBSvkQ-g.js} +1 -1
  31. package/dist/client/assets/{collection-display-button-C_wVSNLi.js → collection-display-button-BziK2H4v.js} +1 -1
  32. package/dist/client/assets/{collection-header-l34pbgNv.js → collection-header-AOGSaKJV.js} +1 -1
  33. package/dist/client/assets/{collection-page-BP2Cy5Z_.js → collection-page-Dx7W84ZY.js} +1 -1
  34. package/dist/client/assets/{collection-search-ByjFbpzN.js → collection-search-D33egpeg.js} +1 -1
  35. package/dist/client/assets/{collection-table-wrapper-PcMFmqtb.js → collection-table-wrapper-BWoWsFFZ.js} +1 -1
  36. package/dist/client/assets/{connection-card-DeV1geDy.js → connection-card-BPbF-94Z.js} +1 -1
  37. package/dist/client/assets/connection-detail-CwV1WRCA.js +1 -0
  38. package/dist/client/assets/{connections-FFVYK2AT.js → connections-D2Osqpr9.js} +1 -1
  39. package/dist/client/assets/{core-BdjBMvYV.js → core-BhcYClLI.js} +1 -1
  40. package/dist/client/assets/{create-organization-dialog-DVhMCLRC.js → create-organization-dialog-CJOAZXZ4.js} +1 -1
  41. package/dist/client/assets/{deco-chat-skeleton-DyT_mbhr.js → deco-chat-skeleton-DgwTbso-.js} +3 -3
  42. package/dist/client/assets/{dialog-CbMK5n2S.js → dialog-Dn--K_0P.js} +1 -1
  43. package/dist/client/assets/{dropdown-menu-24ciec9y.js → dropdown-menu-DSDzjgEf.js} +1 -1
  44. package/dist/client/assets/{error-boundary-Bstevc3G.js → error-boundary-kZqJcvYt.js} +1 -1
  45. package/dist/client/assets/{extract-connection-data-BDRFIBL1.js → extract-connection-data-PMNMoMwh.js} +1 -1
  46. package/dist/client/assets/{form-BrDOMpvk.js → form-BSFKQpec.js} +1 -1
  47. package/dist/client/assets/formatDistanceToNow-Mwdq3o1w.js +1 -0
  48. package/dist/client/assets/gateway-detail-DOneoUn2.js +1 -0
  49. package/dist/client/assets/{gateways-DSDcO81b.js → gateways-CjpiwVjc.js} +1 -1
  50. package/dist/client/assets/{home-jplK_fO7.js → home-M1jCNsQa.js} +1 -1
  51. package/dist/client/assets/{index-RVsrtNt7.js → index-Bg7J5oIq.js} +1 -1
  52. package/dist/client/assets/{index-C3HgpkDC.js → index-CXP-3IgR.js} +1 -1
  53. package/dist/client/assets/index-C_LVkq3-.js +32 -0
  54. package/dist/client/assets/{index-BXYAUeFB.js → index-DDrssUsd.js} +14 -14
  55. package/dist/client/assets/{index-CyW1ja-u.css → index-DPE8fUfl.css} +1 -1
  56. package/dist/client/assets/{input-BElOouK2.js → input-8OLj0EZ_.js} +1 -1
  57. package/dist/client/assets/json-_ojk50i2.js +1 -0
  58. package/dist/client/assets/{json-syntax-highlighter-D6mKVwSQ.js → json-syntax-highlighter-DefdwgI_.js} +2 -2
  59. package/dist/client/assets/{layout-BDLGK1gR.js → layout-BlymenNb.js} +1 -1
  60. package/dist/client/assets/{lazy-highlighter-nw4fsvsj.js → lazy-highlighter-DB5NDxPR.js} +1 -1
  61. package/dist/client/assets/{localstorage-keys-BbAFEk_U.js → localstorage-keys-CKN9Xi55.js} +1 -1
  62. package/dist/client/assets/{login-DlVoXdaF.js → login-sBeHDiTP.js} +1 -1
  63. package/dist/client/assets/{mcp-oauth-O6gPUgdn.js → mcp-oauth-2aNbgRyW.js} +1 -1
  64. package/dist/client/assets/{members-DnI1WLbh.js → members-6chwwhsu.js} +1 -1
  65. package/dist/client/assets/{monitoring-WJqycdC6.js → monitoring-Cb6EoA-b.js} +1 -1
  66. package/dist/client/assets/{oauth-callback-C-msM3ED.js → oauth-callback-DAWi3xsa.js} +1 -1
  67. package/dist/client/assets/{page-CKHPoEps.js → page-BZMAJRR4.js} +1 -1
  68. package/dist/client/assets/{popover--gsKamR2.js → popover-CgBSUikh.js} +1 -1
  69. package/dist/client/assets/prism-light-B2_4LIBk.js +1 -0
  70. package/dist/client/assets/resource-tabs-DfS272DC.js +1 -0
  71. package/dist/client/assets/{schema-DxhaF6b0.js → schema-CcHURukQ.js} +1 -1
  72. package/dist/client/assets/{select-DuRyb06m.js → select-D032IwwR.js} +1 -1
  73. package/dist/client/assets/{settings-Cf2w5DBP.js → settings-CdDiUrft.js} +1 -1
  74. package/dist/client/assets/shell-layout-BrTksREn.js +17 -0
  75. package/dist/client/assets/{spinner-CkZFBFUf.js → spinner-CnnM_4YL.js} +1 -1
  76. package/dist/client/assets/{store-BCi6vudl.js → store-PUlSXJGE.js} +1 -1
  77. package/dist/client/assets/store-app-detail-C7BmJzlu.js +1 -0
  78. package/dist/client/assets/{switch-D3JJPNlW.js → switch-y8R7z10u.js} +1 -1
  79. package/dist/client/assets/{textarea-4CYb655q.js → textarea-BFoLEajE.js} +1 -1
  80. package/dist/client/assets/tools-list-DoiOjPde.js +1 -0
  81. package/dist/client/assets/{tooltip-Dgdin-_i.js → tooltip-CScUy2XK.js} +1 -1
  82. package/dist/client/assets/{types-DaSChKd_.js → types-xAaKjcGO.js} +1 -1
  83. package/dist/client/assets/{use-binding-BgnJVxG_.js → use-binding-Csa06z5J.js} +2 -2
  84. package/dist/client/assets/{use-connection-DcTy916p.js → use-connection-DrLts5Bh.js} +1 -1
  85. package/dist/client/assets/{use-gateway-I6Ko0Jgt.js → use-gateway-D8DNYcSu.js} +1 -1
  86. package/dist/client/assets/{use-list-state-SFgQOu4M.js → use-list-state-XxCjYHe0.js} +1 -1
  87. package/dist/client/assets/{use-mcp-CiOCImLK.js → use-mcp-8IvMYP4j.js} +1 -1
  88. package/dist/client/assets/{use-members-DZwzW0q9.js → use-members-BpQaxhYw.js} +1 -1
  89. package/dist/client/assets/{use-mobile-_Q7J0JGT.js → use-mobile-D-4KOtW8.js} +1 -1
  90. package/dist/client/assets/{use-organization-settings-CWarZMrC.js → use-organization-settings-DFt-PXFE.js} +1 -1
  91. package/dist/client/assets/use-tool-call-Ega50w5M.js +1 -0
  92. package/dist/client/assets/useQuery-iHOeESxa.js +1 -0
  93. package/dist/client/assets/utils-BNxGaTF3.js +1 -0
  94. package/dist/client/assets/{well-known-mcp-6m7w8EhN.js → well-known-mcp-DyxrC_Rx.js} +1 -1
  95. package/dist/client/index.html +2 -2
  96. package/dist/server/cli.js +164 -164
  97. package/dist/server/migrate.js +124 -124
  98. package/dist/server/server.js +123 -123
  99. package/package.json +1 -1
  100. package/dist/client/assets/connection-detail-z_aMgOoM.js +0 -1
  101. package/dist/client/assets/formatDistanceToNow-Ctx6mZEP.js +0 -1
  102. package/dist/client/assets/gateway-detail-DT2HrSfW.js +0 -1
  103. package/dist/client/assets/index-1pyJ2pUa.js +0 -32
  104. package/dist/client/assets/json-CtipqR6C.js +0 -1
  105. package/dist/client/assets/prism-light-DntDK3V1.js +0 -1
  106. package/dist/client/assets/resource-tabs-BwUWNlYE.js +0 -1
  107. package/dist/client/assets/shell-layout-Ca0-di6U.js +0 -17
  108. package/dist/client/assets/store-app-detail-CjU1HPaK.js +0 -1
  109. package/dist/client/assets/use-tool-call-BWqj0h3N.js +0 -1
  110. package/dist/client/assets/useQuery-C_tbj2zS.js +0 -1
  111. package/dist/client/assets/utils-D2m6QoGq.js +0 -1
  112. /package/dist/client/assets/{resource-tabs-CSRUKxnt.css → tools-list-CSRUKxnt.css} +0 -0
@@ -1 +0,0 @@
1
- import{ak as o}from"./index-BXYAUeFB.js";import{r}from"./json-BESjz4hO.js";var s=r();const e=o(s);export{e as default};
@@ -1 +0,0 @@
1
- import{r as o,h as i}from"./core-BdjBMvYV.js";import{ak as s}from"./index-BXYAUeFB.js";var g=o();const t=s(g);var e=i(t,{});e.registerLanguage=function(a,r){return t.register(r)};e.alias=function(a,r){return t.alias(a,r)};export{e as default};
@@ -1 +0,0 @@
1
- import{K as Q,j as t,c as H,f as U,r as L}from"./index-BXYAUeFB.js";import{u as W}from"./useQuery-C_tbj2zS.js";import{i as Y}from"./File06-88jNCz1V.js";import{i as J}from"./Loading01-BWm5a2UX.js";import{e as P}from"./registry-utils-ulDDT0d8.js";import{C as X}from"./collection-display-button-C_wVSNLi.js";import{C as Z}from"./collection-search-ByjFbpzN.js";import{C as ee}from"./collection-table-wrapper-PcMFmqtb.js";import{E as B}from"./SearchMd-D-BfTFbd.js";import{I as te}from"./use-connection-DcTy916p.js";import{C as oe}from"./card-BCizSi8r.js";import{V as re}from"./layout-BDLGK1gR.js";import{c as M}from"./utils-D2m6QoGq.js";import{B as se}from"./badge-CuERIkGI.js";import{B as ne}from"./button-WiHHb1ae.js";function ae(o){return o.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function ie(o){return o.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,a)=>a.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${a} target="_blank" rel="noopener noreferrer">`)}function le(o){let e=ae(o);return e=ie(e),e}function ke({repository:o}){const e=o?P(o):null,{data:a,isLoading:c}=W({queryKey:Q.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const s=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!s.ok){if(s.status===404)return null;throw new Error(`Failed to fetch README: ${s.statusText}`)}const m=await s.text();return le(m)}catch(s){return console.error("Error fetching README:",s),null}},enabled:!!e&&!!o,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(J,{size:32,className:"animate-spin text-muted-foreground"})}):a?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:a}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(Y,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function $e(o){const e=H.c(39),{tools:a,connectionId:c,org:s,onToolClick:m,showToolbar:u,emptyMessage:f}=o,h=u===void 0?!0:u,p=f===void 0?"This connection doesn't have any tools yet.":f,d=U(),[n,A]=L.useState(""),[x,F]=L.useState("table"),[i,_]=L.useState("name"),[l,V]=L.useState("asc");let C;e[0]!==l||e[1]!==i?(C=r=>{i===r?(V(fe),l==="desc"&&_(void 0)):(_(r),V("asc"))},e[0]=l,e[1]=i,e[2]=C):C=e[2];const g=C;let S;e[3]!==c||e[4]!==d||e[5]!==m||e[6]!==s?(S=r=>{m?m(r):c&&s&&d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:s,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(r.name)}})},e[3]=c,e[4]=d,e[5]=m,e[6]=s,e[7]=S):S=e[7];const T=S;let E;if(e[8]!==n||e[9]!==l||e[10]!==i||e[11]!==a){const r=!a||a.length===0?[]:n.trim()?(()=>{const I=n.toLowerCase();return a.filter(w=>w.name.toLowerCase().includes(I)||w.description&&w.description.toLowerCase().includes(I))})():a;E=!i||!l?r:[...r].sort((I,w)=>{const G=I[i]||"",O=w[i]||"",z=String(G).localeCompare(String(O));return l==="asc"?z:-z}),e[8]=n,e[9]=l,e[10]=i,e[11]=a,e[12]=E}else E=e[12];const v=E;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:ue,sortable:!0},{id:"description",header:"Description",render:de,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const K=R;let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=K.filter(me).map(ce),e[14]=k):k=e[14];const q=k;let b;e[15]!==g||e[16]!==h||e[17]!==l||e[18]!==i||e[19]!==x?(b=h&&t.jsx(re,{children:t.jsx(X,{viewMode:x,onViewModeChange:F,sortKey:i,sortDirection:l,onSort:g,sortOptions:q})}),e[15]=g,e[16]=h,e[17]=l,e[18]=i,e[19]=x,e[20]=b):b=e[20];let $;e[21]===Symbol.for("react.memo_cache_sentinel")?($=r=>{r.key==="Escape"&&(A(""),r.target.blur())},e[21]=$):$=e[21];let j;e[22]!==n?(j=t.jsx(Z,{value:n,onChange:A,placeholder:"Search tools...",onKeyDown:$}),e[22]=n,e[23]=j):j=e[23];let N;e[24]!==p||e[25]!==g||e[26]!==T||e[27]!==n||e[28]!==l||e[29]!==i||e[30]!==v||e[31]!==x?(N=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:v.length===0?t.jsx(B,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":p}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:v.map(r=>t.jsx(oe,{className:"cursor-pointer transition-colors",onClick:()=>T(r),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(te,{icon:null,name:r.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:r.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:r.description||"No description"})]})]})},r.name))})}):t.jsx(ee,{columns:K,data:v,isLoading:!1,sortKey:i,sortDirection:l,onSort:g,onRowClick:r=>T(r),emptyState:t.jsx(B,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":p})}),e[24]=p,e[25]=g,e[26]=T,e[27]=n,e[28]=l,e[29]=i,e[30]=v,e[31]=x,e[32]=N):N=e[32];let y;e[33]!==j||e[34]!==N?(y=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[j,N]}),e[33]=j,e[34]=N,e[35]=y):y=e[35];let D;return e[36]!==y||e[37]!==b?(D=t.jsxs(t.Fragment,{children:[b,y]}),e[36]=y,e[37]=b,e[38]=D):D=e[38],D}function ce(o){return{id:o.id,label:typeof o.header=="string"?o.header:o.id}}function me(o){return o.sortable}function de(o){return t.jsx("span",{className:"text-sm text-foreground",children:o.description||"—"})}function ue(o){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:o.name})}function fe(o){return o==="asc"?"desc":o==="desc"?null:"asc"}function De(o){const e=H.c(12),{tabs:a,activeTab:c,onTabChange:s,className:m}=o;let u;e[0]!==m?(u=M("flex items-center gap-2 overflow-x-auto no-scrollbar",m),e[0]=m,e[1]=u):u=e[1];let f;if(e[2]!==c||e[3]!==s||e[4]!==a){let p;e[6]!==c||e[7]!==s?(p=d=>{const n=c===d.id;return t.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>s(d.id),className:M("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",n&&"bg-muted border-input text-foreground font-medium",!n&&"text-muted-foreground font-normal"),children:[d.label,d.count!==void 0&&t.jsx(se,{variant:"secondary",className:M("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",n?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:d.count})]},d.id)},e[6]=c,e[7]=s,e[8]=p):p=e[8],f=a.map(p),e[2]=c,e[3]=s,e[4]=a,e[5]=f}else f=e[5];let h;return e[9]!==u||e[10]!==f?(h=t.jsx("div",{className:u,children:f}),e[9]=u,e[10]=f,e[11]=h):h=e[11],h}export{De as R,$e as T,ke as a};
@@ -1,17 +0,0 @@
1
- import{r as x,c as N,j as r,e as Jn,f as lt,a as Ke,t as Qn,R as es,T as ts,D as ns,C as ss,P as os,g as as,O as rs,h as ls,i as is,k as cs,d as Ft,l as ds,G as us,U as fs,m as ms,S as Kt,n as ps,o as hs,N as xs,p as gs,q as bs,K as vs,s as Zt}from"./index-BXYAUeFB.js";import{i as ys,E as Ss}from"./SearchMd-D-BfTFbd.js";import{u as ws,I as Mt,n as js}from"./use-connection-DcTy916p.js";import{u as Be,L as Ze}from"./localstorage-keys-BbAFEk_U.js";import{u as qe,T as Cs,a as Ns,b as zs,c as _s,L as Et,i as Is,P as ks,O as Ps}from"./tooltip-Dgdin-_i.js";import{B as Ce}from"./button-WiHHb1ae.js";import{c as H}from"./utils-D2m6QoGq.js";import{i as jt}from"./CpuChip02-CHm038ee.js";import{s as $s}from"./Plus-Slubr3Mn.js";import{i as ot}from"./X-qVvh8Z0J.js";import{u as Ms,a as Es,b as Rs,c as As,d as Ds,C as se,D as Ts,e as Ls,f as Os,g as Hs,h as Bs,i as Us,j as Gs}from"./deco-chat-skeleton-DyT_mbhr.js";import{P as qt,a as Yt,b as Xt}from"./popover--gsKamR2.js";import{s as Ws}from"./Clock-umdgxXOC.js";import{s as Vs}from"./Trash01-QqFxB-ic.js";import{u as Fs}from"./use-binding-BgnJVxG_.js";import{E as Jt}from"./error-boundary-Bstevc3G.js";import{i as Ks}from"./File06-88jNCz1V.js";import{u as Ye}from"./use-mobile-_Q7J0JGT.js";import{u as Qt,a as Zs}from"./use-organization-settings-CWarZMrC.js";import{C as qs}from"./create-organization-dialog-DVhMCLRC.js";import{I as Ys}from"./input-BElOouK2.js";import{A as Ue}from"./avatar-7mHRD9aF.js";import{c as Xs}from"./Grid01-irgYf3_6.js";import{D as Js,a as Qs,b as eo,c as to,d as Rt}from"./dropdown-menu-24ciec9y.js";import{a as no}from"./Copy01-Bilz-YTB.js";import{n as At}from"./LinkExternal01-BWsuTDiz.js";import{D as en,a as tn,b as nn,c as sn,d as on}from"./dialog-CbMK5n2S.js";import"./useQuery-C_tbj2zS.js";import"./textarea-4CYb655q.js";import"./select-DuRyb06m.js";import"./ChevronDown-LB39JZIr.js";import"./use-gateway-I6Ko0Jgt.js";import"./AlertCircle-DXrRWAdV.js";import"./connection-card-DeV1geDy.js";import"./card-BCizSi8r.js";import"./spinner-CkZFBFUf.js";import"./InfoCircle-D7V0pgdh.js";import"./auth-g7Ue41hR.js";import"./alert-dialog-BKLc86P2.js";import"./form-BrDOMpvk.js";const an=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));an.displayName="BarChart10";const rn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));rn.displayName="Building02";const ln=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));ln.displayName="ChevronSelectorVertical";const cn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));cn.displayName="DotsGrid";const dn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));dn.displayName="Globe01";const un=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M9 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));un.displayName="Home02";const fn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));fn.displayName="LayoutRight";const mn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));mn.displayName="LogOut01";const pn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));pn.displayName="Mail01";const hn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),x.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));hn.displayName="Settings01";const xn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));xn.displayName="UserCircle";const gn=({size:t=24,color:e="currentColor",...n})=>x.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},x.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));gn.displayName="Users01";function zt(){const t=N.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Ze.decoChatOpen(),t[0]=e):e=t[0];const[n,s]=Be(e,so);let o;return t[1]!==n||t[2]!==s?(o=[n,s],t[1]=n,t[2]=s,t[3]=o):o=t[3],o}function so(t){return!!(t??!1)}function oo(t){const e=N.c(14),{title:n,description:s,avatar:o,avatarNode:a,className:l}=t,i=n===void 0?"Start a conversation":n;let c;e[0]!==l?(c=H("flex flex-col items-center justify-center gap-4 p-8 text-center",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==o||e[3]!==a?(d=a||o&&r.jsx("img",{src:o,alt:"Chat avatar",className:"size-[60px] rounded-[18px] border-[1.875px] border-border/10"}),e[2]=o,e[3]=a,e[4]=d):d=e[4];let m;e[5]!==i?(m=i&&r.jsx("h3",{className:"text-xl font-medium text-foreground",children:i}),e[5]=i,e[6]=m):m=e[6];let f;e[7]!==s?(f=s&&r.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s}),e[7]=s,e[8]=f):f=e[8];let u;return e[9]!==c||e[10]!==d||e[11]!==m||e[12]!==f?(u=r.jsxs("div",{className:c,children:[d,m,f]}),e[9]=c,e[10]=d,e[11]=m,e[12]=f,e[13]=u):u=e[13],u}const bn=()=>crypto.randomUUID(),vn=x.createContext(null);function ao(t){const e=N.c(15),{children:n}=t,{locator:s}=qe(),o=Ms(),[a,l]=Be(Ze.threadManagerState(s)+":active-id",ro);let i;e[0]!==l||e[1]!==o?(i=p=>{const v=p?.id||crypto.randomUUID(),b=new Date().toISOString(),g={id:v,title:p?.title||"",created_at:p?.created_at||b,updated_at:p?.updated_at||b,hidden:p?.hidden??!1};return o.insert.mutate(g),l(v),g},e[0]=l,e[1]=o,e[2]=i):i=e[2];const c=i;let d;e[3]!==a||e[4]!==l||e[5]!==o?(d=p=>{o.update.mutate({id:p,updates:{hidden:!0,updated_at:new Date().toISOString()}}),a===p&&l(bn())},e[3]=a,e[4]=l,e[5]=o,e[6]=d):d=e[6];const m=d;let f;e[7]!==a||e[8]!==c||e[9]!==m||e[10]!==l?(f={activeThreadId:a,createThread:c,setActiveThreadId:l,hideThread:m},e[7]=a,e[8]=c,e[9]=m,e[10]=l,e[11]=f):f=e[11];const u=f;let h;return e[12]!==n||e[13]!==u?(h=r.jsx(vn.Provider,{value:u,children:n}),e[12]=n,e[13]=u,e[14]=h):h=e[14],h}function ro(t){return t||bn()}function lo(){const t=x.useContext(vn);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}function io(t){const e=new Date(t),s=new Date().getTime()-e.getTime(),o=Math.floor(s/6e4),a=Math.floor(s/36e5);return o<1?"now":o<60?`${o}m`:`${a}h`}function co(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),s=new Date(n.getTime()-864e5),o=new Date(n.getTime()-7*864e5),a=new Date(n.getTime()-30*864e5),l=[],i=[],c=[],d=[],m=[];for(const u of t){const h=new Date(u.updated_at);h>=n?l.push(u):h>=s?i.push(u):h>=o?c.push(u):h>=a?d.push(u):m.push(u)}const f=[];return l.length>0&&f.push({label:"Today",threads:l,showRelativeTime:!0}),i.length>0&&f.push({label:"Yesterday",threads:i,showRelativeTime:!1}),c.length>0&&f.push({label:"7 days ago",threads:c,showRelativeTime:!1}),d.length>0&&f.push({label:"30 days ago",threads:d,showRelativeTime:!1}),m.length>0&&f.push({label:"Older",threads:m,showRelativeTime:!1}),f}function uo(t){const e=N.c(36),{threads:n,activeThreadId:s,onSelectThread:o,onRemoveThread:a,onOpen:l}=t,[i,c]=x.useState("");let d,m,f,u,h,p,v,b,g;if(e[0]!==s||e[1]!==l||e[2]!==a||e[3]!==o||e[4]!==i||e[5]!==n){const _=i.trim()?n.filter($=>($.title||"New chat").toLowerCase().includes(i.toLowerCase())):n,C=co(_);let w;e[15]!==l?(w=$=>{$?l?.():c("")},e[15]=l,e[16]=w):w=e[16];const O=w;m=qt,b=O,e[17]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(Yt,{asChild:!0,children:r.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:r.jsx(Ws,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})}),e[17]=g):g=e[17],d=Xt,h="end",p="w-80 p-0";let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=r.jsx(ys,{size:16,className:"text-muted-foreground shrink-0"}),e[18]=M):M=e[18];let R;e[19]===Symbol.for("react.memo_cache_sentinel")?(R=$=>c($.target.value),e[19]=R):R=e[19],e[20]!==i?(v=r.jsx("div",{className:"border-b",children:r.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[M,r.jsx("input",{type:"text",placeholder:"Search chats...",value:i,onChange:R,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[20]=i,e[21]=v):v=e[21],f="max-h-[300px] overflow-y-auto",u=_.length===0?r.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:i.trim()?"No chats found":"No chats yet"}):C.map(($,D)=>r.jsxs("div",{children:[D>0&&r.jsx("div",{className:"border-t mx-3"}),r.jsx("div",{className:"px-3 py-1",children:r.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:$.label})}),$.threads.map(L=>{const Z=L.id===s;return r.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${Z?"bg-accent/50":""}`,onClick:()=>o(L.id),children:[r.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[r.jsx("span",{className:"text-sm truncate",children:L.title||"New chat"}),r.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:Z?"current":$.showRelativeTime?io(L.updated_at):null})]}),r.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),a(L.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:r.jsx(Vs,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},L.id)})]},$.label)),e[0]=s,e[1]=l,e[2]=a,e[3]=o,e[4]=i,e[5]=n,e[6]=d,e[7]=m,e[8]=f,e[9]=u,e[10]=h,e[11]=p,e[12]=v,e[13]=b,e[14]=g}else d=e[6],m=e[7],f=e[8],u=e[9],h=e[10],p=e[11],v=e[12],b=e[13],g=e[14];let y;e[22]!==f||e[23]!==u?(y=r.jsx("div",{className:f,children:u}),e[22]=f,e[23]=u,e[24]=y):y=e[24];let j;e[25]!==d||e[26]!==h||e[27]!==p||e[28]!==v||e[29]!==y?(j=r.jsxs(d,{align:h,className:p,children:[v,y]}),e[25]=d,e[26]=h,e[27]=p,e[28]=v,e[29]=y,e[30]=j):j=e[30];let z;return e[31]!==m||e[32]!==b||e[33]!==g||e[34]!==j?(z=r.jsxs(m,{onOpenChange:b,children:[g,j]}),e[31]=m,e[32]=b,e[33]=g,e[34]=j,e[35]=z):z=e[35],z}function fo(t){const e=/\/[^/]+\/mcps\/([^/]+)\/([^/]+)\/([^/]+)/,n=t.match(e);return n&&n[1]&&n[2]&&n[3]?{connectionId:decodeURIComponent(n[1]),collectionName:decodeURIComponent(n[2]),itemId:decodeURIComponent(n[3])}:{connectionId:null,collectionName:null,itemId:null}}function mo(){const t=N.c(2),e=Jn();let n;t[0]!==e.location.pathname?(n=fo(e.location.pathname),t[0]=e.location.pathname,t[1]=n):n=t[1];const{connectionId:s,collectionName:o,itemId:a}=n;return`You are an AI assistant running in an MCP Mesh environment.
2
-
3
- ## About MCP Mesh
4
- The Model Context Protocol (MCP) Mesh allows users to connect external MCP servers and expose their capabilities through gateways. Each gateway provides access to a curated set of tools from connected MCP servers.
5
-
6
- ## Important Notes
7
- - All tool calls are logged and audited for security and compliance
8
- - You have access to the tools exposed through the selected gateway
9
- - MCPs may expose resources that users can browse and edit
10
-
11
- ## Current Editing Context
12
- ${s?`- Connection ID: ${s}`:""}
13
- ${o?`- Collection Name: ${o}`:""}
14
- ${a?`- Item ID: ${a}`:""}
15
-
16
- Help the user understand and work with this resource.
17
- `}const po="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function ho(){const t=N.c(115),{org:e,locator:n}=qe(),{slug:s}=e,[,o]=zt(),a=lt(),{data:l}=Ke.useSession(),i=l?.user,{createThread:c,activeThreadId:d,setActiveThreadId:m,hideThread:f}=lo(),{threads:u,refetch:h}=Es(),p=Rs(),v=As(),b=ws();let g;t[0]!==b?(g={connections:b,binding:"LLMS"},t[0]=b,t[1]=g):g=t[1];const[y]=Fs(g),j=!!y,z=p.length>0,_=j&&z;let C;t[2]!==n?(C=Ze.chatSelectedModel(n),t[2]=n,t[3]=C):C=t[3];const[w,O]=Be(C,go),[M,R]=Be(`${n}:selected-gateway`,xo),$=v[0];let D;t[4]!==$||t[5]!==w?(D=w??($?{id:$.id,connectionId:$.connectionId}:null),t[4]=$,t[5]=w,t[6]=D):D=t[6];const L=D,Z=p[0]?.id,B=M?.gatewayId??Z;let F;if(t[7]!==B||t[8]!==p){let V;t[10]!==B?(V=le=>le.id===B,t[10]=B,t[11]=V):V=t[11],F=p.find(V),t[7]=B,t[8]=p,t[9]=F}else F=t[9];const W=F;let te;if(t[12]!==L?.connectionId||t[13]!==L?.id||t[14]!==v){let V;t[16]!==L?.connectionId||t[17]!==L?.id?(V=le=>le.id===L?.id&&le.connectionId===L?.connectionId,t[16]=L?.connectionId,t[17]=L?.id,t[18]=V):V=t[18],te=v.find(V),t[12]=L?.connectionId,t[13]=L?.id,t[14]=v,t[15]=te}else te=t[15];const J=te,re=mo();let q;t[19]!==c?(q=V=>c({id:V.id,title:V.title}),t[19]=c,t[20]=q):q=t[20];let Q;t[21]!==d||t[22]!==re||t[23]!==q?(Q={threadId:d,systemPrompt:re,onCreateThread:q},t[21]=d,t[22]=re,t[23]=q,t[24]=Q):Q=t[24];const S=Ds(Q);let P;t[25]!==d||t[26]!==S||t[27]!==W||t[28]!==J||t[29]!==i?.image||t[30]!==i?.name?(P=async V=>{if(!J){Qn.error("No model configured");return}const le={created_at:new Date().toISOString(),thread_id:d,model:{id:J.id,connectionId:J.connectionId,provider:J.provider??void 0},gateway:W?{id:W.id}:void 0,user:{avatar:i?.image??void 0,name:i?.name??"you"}};await S.sendMessage(V,le)},t[25]=d,t[26]=S,t[27]=W,t[28]=J,t[29]=i?.image,t[30]=i?.name,t[31]=P):P=t[31];const A=P;let k;t[32]!==O?(k=V=>{O({id:V.id,connectionId:V.connectionId})},t[32]=O,t[33]=k):k=t[33];const I=k;if(!_){let V,le;!j&&!z?(V="Connect your providers",le="Connect an LLM provider and create a gateway to unlock AI-powered features."):j?(V="No gateways configured",le="Create a gateway to expose your MCP tools to the chat."):(V="No model provider connected",le="Connect to a model provider to unlock AI-powered features.");let Je;t[34]===Symbol.for("react.memo_cache_sentinel")?(Je=r.jsxs(se.Header.Left,{children:[r.jsx("img",{src:po,alt:"deco chat",className:"size-5 rounded"}),r.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),t[34]=Je):Je=t[34];let Me;t[35]!==o?(Me=()=>o(!1),t[35]=o,t[36]=Me):Me=t[36];let Qe;t[37]===Symbol.for("react.memo_cache_sentinel")?(Qe=r.jsx(ot,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[37]=Qe):Qe=t[37];let Ee;t[38]!==Me?(Ee=r.jsxs(se.Header,{children:[Je,r.jsx(se.Header.Right,{children:r.jsx("button",{type:"button",onClick:Me,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:Qe})})]}),t[38]=Me,t[39]=Ee):Ee=t[39];let Re;t[40]!==j||t[41]!==a||t[42]!==s?(Re=()=>a({to:j?"/$org/gateways":"/$org/mcps",params:{org:s},search:j?void 0:{action:"create"}}),t[40]=j,t[41]=a,t[42]=s,t[43]=Re):Re=t[43];const gt=j?"Create gateway":"Add connection";let Ae;t[44]!==Re||t[45]!==gt?(Ae=r.jsx(Ce,{variant:"outline",onClick:Re,children:gt}),t[44]=Re,t[45]=gt,t[46]=Ae):Ae=t[46];let De;t[47]!==le||t[48]!==Ae||t[49]!==V?(De=r.jsx(se.Main,{className:"flex flex-col items-center",innerClassName:"max-w-2xl mx-auto w-full min-w-0",children:r.jsx(se.EmptyState,{children:r.jsx(Ss,{title:V,description:le,actions:Ae})})}),t[47]=le,t[48]=Ae,t[49]=V,t[50]=De):De=t[50];let et;return t[51]!==Ee||t[52]!==De?(et=r.jsxs(se,{children:[Ee,De]}),t[51]=Ee,t[52]=De,t[53]=et):et=t[53],et}const E=W?.icon,U=W?.title||"deco chat";let K;t[54]===Symbol.for("react.memo_cache_sentinel")?(K=r.jsx(jt,{size:12}),t[54]=K):K=t[54];let ne;t[55]!==E||t[56]!==U?(ne=r.jsx(Mt,{icon:E,name:U,size:"xs",fallbackIcon:K}),t[55]=E,t[56]=U,t[57]=ne):ne=t[57];const oe=W?.title||"deco chat";let G;t[58]!==oe?(G=r.jsx("span",{className:"text-sm font-medium",children:oe}),t[58]=oe,t[59]=G):G=t[59];let ee;t[60]!==ne||t[61]!==G?(ee=r.jsxs(se.Header.Left,{children:[ne,G]}),t[60]=ne,t[61]=G,t[62]=ee):ee=t[62];let ce;t[63]!==c?(ce=()=>c(),t[63]=c,t[64]=ce):ce=t[64];let me;t[65]===Symbol.for("react.memo_cache_sentinel")?(me=r.jsx($s,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[65]=me):me=t[65];let ue;t[66]!==ce?(ue=r.jsx("button",{type:"button",onClick:ce,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:me}),t[66]=ce,t[67]=ue):ue=t[67];let X;t[68]!==h?(X=()=>h(),t[68]=h,t[69]=X):X=t[69];let pe;t[70]!==d||t[71]!==f||t[72]!==m||t[73]!==X||t[74]!==u?(pe=r.jsx(uo,{threads:u,activeThreadId:d,onSelectThread:m,onRemoveThread:f,onOpen:X}),t[70]=d,t[71]=f,t[72]=m,t[73]=X,t[74]=u,t[75]=pe):pe=t[75];let ge;t[76]!==o?(ge=()=>o(!1),t[76]=o,t[77]=ge):ge=t[77];let fe;t[78]===Symbol.for("react.memo_cache_sentinel")?(fe=r.jsx(ot,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[78]=fe):fe=t[78];let he;t[79]!==ge?(he=r.jsx("button",{type:"button",onClick:ge,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:fe}),t[79]=ge,t[80]=he):he=t[80];let be;t[81]!==ue||t[82]!==pe||t[83]!==he?(be=r.jsxs(se.Header.Right,{children:[ue,pe,he]}),t[81]=ue,t[82]=pe,t[83]=he,t[84]=be):be=t[84];let ze;t[85]!==ee||t[86]!==be?(ze=r.jsxs(se.Header,{children:[ee,be]}),t[85]=ee,t[86]=be,t[87]=ze):ze=t[87];let _e;t[88]!==S.messages||t[89]!==S.status||t[90]!==W?.description||t[91]!==W?.icon||t[92]!==W?.title?(_e=r.jsx(se.Main,{innerClassName:"max-w-2xl mx-auto w-full min-w-0",children:S.messages.length===0?r.jsx(se.EmptyState,{children:r.jsx(oo,{title:W?.title||"Ask deco chat",description:W?.description??"Ask anything about configuring model providers or using MCP Mesh.",avatarNode:r.jsx(Mt,{icon:W?.icon,name:W?.title||"deco chat",size:"lg",fallbackIcon:r.jsx(jt,{size:32}),className:"size-[60px]! rounded-[18px]!"})})}):r.jsx(se.Messages,{messages:S.messages,status:S.status,minHeightOffset:240})}),t[88]=S.messages,t[89]=S.status,t[90]=W?.description,t[91]=W?.icon,t[92]=W?.title,t[93]=_e):_e=t[93];const mt=v.length===0||!L,pt=S.status==="submitted"||S.status==="streaming",ht=v.length===0?"Add an LLM binding connection to start chatting":"Ask anything or @ for context";let Ie;t[94]!==R?(Ie=V=>{V&&R({gatewayId:V})},t[94]=R,t[95]=Ie):Ie=t[95];let ke;t[96]!==B||t[97]!==Ie?(ke=r.jsx(se.Input.GatewaySelector,{disabled:!1,selectedGatewayId:B,onGatewayChange:Ie}),t[96]=B,t[97]=Ie,t[98]=ke):ke=t[98];const xt=L??void 0;let Pe;t[99]!==I||t[100]!==xt?(Pe=r.jsx(se.Input.ModelSelector,{disabled:!1,selectedModel:xt,onModelChange:I}),t[99]=I,t[100]=xt,t[101]=Pe):Pe=t[101];let $e;t[102]!==S.messages||t[103]!==S.stop||t[104]!==A||t[105]!==mt||t[106]!==pt||t[107]!==ht||t[108]!==ke||t[109]!==Pe?($e=r.jsx(se.Footer,{children:r.jsx("div",{children:r.jsxs(se.Input,{onSubmit:A,onStop:S.stop,disabled:mt,isStreaming:pt,placeholder:ht,usageMessages:S.messages,children:[ke,Pe]})})}),t[102]=S.messages,t[103]=S.stop,t[104]=A,t[105]=mt,t[106]=pt,t[107]=ht,t[108]=ke,t[109]=Pe,t[110]=$e):$e=t[110];let Xe;return t[111]!==ze||t[112]!==_e||t[113]!==$e?(Xe=r.jsxs(se,{children:[ze,_e,$e]}),t[111]=ze,t[112]=_e,t[113]=$e,t[114]=Xe):Xe=t[114],Xe}function xo(){return null}function go(t){return t??null}function bo(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=r.jsx(es,{"data-slot":"sheet",...n}),e[2]=n,e[3]=s):s=e[3],s}function vo(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=r.jsx(os,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=s):s=e[3],s}function yo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx(rs,{"data-slot":"sheet-overlay",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function So(t){const e=N.c(17);let n,s,o,a;e[0]!==t?({className:s,children:n,side:a,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a):(n=e[1],s=e[2],o=e[3],a=e[4]);const l=a===void 0?"right":a;let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(yo,{}),e[5]=i):i=e[5];const c=l==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",d=l==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",m=l==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",f=l==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let u;e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==f?(u=H("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",c,d,m,f,s),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=f,e[11]=u):u=e[11];let h;e[12]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsxs(as,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[r.jsx(ot,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=h):h=e[12];let p;return e[13]!==n||e[14]!==o||e[15]!==u?(p=r.jsxs(vo,{children:[i,r.jsxs(ss,{"data-slot":"sheet-content",className:u,...o,children:[n,h]})]}),e[13]=n,e[14]=o,e[15]=u,e[16]=p):p=e[16],p}function wo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("flex flex-col gap-1.5 p-4",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"sheet-header",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function jo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("text-foreground font-semibold",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx(ts,{"data-slot":"sheet-title",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Co(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("text-muted-foreground text-sm",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx(ns,{"data-slot":"sheet-description",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function yn(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"skeleton",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}const No="sidebar_state",zo=3600*24*7,_o="16rem",Io="18rem",ko="3rem",Po="b",Sn=x.createContext(null);function _t(){const t=x.useContext(Sn);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function $o(t){const e=N.c(21),{defaultOpen:n,open:s,onOpenChange:o,children:a}=t,l=n===void 0?!0:n,i=Ye(),[c,d]=x.useState(!1),[m,f]=x.useState(l),u=s??m;let h;e[0]!==u||e[1]!==o?(h=O=>{const M=typeof O=="function"?O(u):O;o?o(M):f(M),document.cookie=`${No}=${M}; path=/; max-age=${zo}`},e[0]=u,e[1]=o,e[2]=h):h=e[2];const p=h;let v;e[3]!==i||e[4]!==p?(v=()=>i?d(Eo):p(Mo),e[3]=i,e[4]=p,e[5]=v):v=e[5];const b=v;let g,y;e[6]!==b?(g=()=>{const O=M=>{if(M.key===Po&&(M.metaKey||M.ctrlKey)){const R=M.target;if(R.tagName==="INPUT"||R.tagName==="TEXTAREA"||R.isContentEditable)return;M.preventDefault(),b()}};return globalThis.addEventListener("keydown",O),()=>globalThis.removeEventListener("keydown",O)},y=[b],e[6]=b,e[7]=g,e[8]=y):(g=e[7],y=e[8]),x.useEffect(g,y);const j=u?"expanded":"collapsed";let z;e[9]!==i||e[10]!==u||e[11]!==c||e[12]!==p||e[13]!==j||e[14]!==b?(z={state:j,open:u,setOpen:p,isMobile:i,openMobile:c,setOpenMobile:d,toggleSidebar:b},e[9]=i,e[10]=u,e[11]=c,e[12]=p,e[13]=j,e[14]=b,e[15]=z):z=e[15];const _=z;let C;e[16]!==a?(C=r.jsx(Ns,{delayDuration:0,children:a}),e[16]=a,e[17]=C):C=e[17];let w;return e[18]!==_||e[19]!==C?(w=r.jsx(Sn.Provider,{value:_,children:C}),e[18]=_,e[19]=C,e[20]=w):w=e[20],w}function Mo(t){return!t}function Eo(t){return!t}function Ro(t){const e=N.c(14);let n,s,o,a;e[0]!==t?({className:s,style:a,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a):(n=e[1],s=e[2],o=e[3],a=e[4]);let l;e[5]!==a?(l={"--sidebar-width":_o,"--sidebar-width-icon":ko,...a},e[5]=a,e[6]=l):l=e[6];const i=l;let c;e[7]!==s?(c=H("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",s),e[7]=s,e[8]=c):c=e[8];let d;return e[9]!==n||e[10]!==o||e[11]!==i||e[12]!==c?(d=r.jsx("div",{"data-slot":"sidebar-wrapper",style:i,className:c,...o,children:n}),e[9]=n,e[10]=o,e[11]=i,e[12]=c,e[13]=d):d=e[13],d}function Ao(t){const e=N.c(46);let n,s,o,a,l,i;e[0]!==t?({side:a,variant:l,collapsible:i,className:s,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=l,e[6]=i):(n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],i=e[6]);const c=a===void 0?"left":a,d=l===void 0?"sidebar":l,m=i===void 0?"offcanvas":i,{isMobile:f,state:u,openMobile:h,setOpenMobile:p}=_t();if(m==="none"){let M;e[7]!==s?(M=H("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),e[7]=s,e[8]=M):M=e[8];let R;return e[9]!==n||e[10]!==o||e[11]!==M?(R=r.jsx("div",{"data-slot":"sidebar",className:M,...o,children:n}),e[9]=n,e[10]=o,e[11]=M,e[12]=R):R=e[12],R}if(f){let M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M={"--sidebar-width":Io},e[13]=M):M=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsxs(wo,{className:"sr-only",children:[r.jsx(jo,{children:"Sidebar"}),r.jsx(Co,{children:"Displays the mobile sidebar."})]}),e[14]=R):R=e[14];let $;e[15]!==n?($=r.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[15]=n,e[16]=$):$=e[16];let D;e[17]!==c||e[18]!==$?(D=r.jsxs(So,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:M,side:c,children:[R,$]}),e[17]=c,e[18]=$,e[19]=D):D=e[19];let L;return e[20]!==h||e[21]!==o||e[22]!==p||e[23]!==D?(L=r.jsx(bo,{open:h,onOpenChange:p,...o,children:D}),e[20]=h,e[21]=o,e[22]=p,e[23]=D,e[24]=L):L=e[24],L}const v=u==="collapsed"?m:"",b=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let g;e[25]!==b?(g=H("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),e[25]=b,e[26]=g):g=e[26];let y;e[27]!==g?(y=r.jsx("div",{"data-slot":"sidebar-gap",className:g}),e[27]=g,e[28]=y):y=e[28];const j=c==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",z=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let _;e[29]!==s||e[30]!==j||e[31]!==z?(_=H("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",j,z,s),e[29]=s,e[30]=j,e[31]=z,e[32]=_):_=e[32];let C;e[33]!==n?(C=r.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n}),e[33]=n,e[34]=C):C=e[34];let w;e[35]!==o||e[36]!==_||e[37]!==C?(w=r.jsx("div",{"data-slot":"sidebar-container",className:_,...o,children:C}),e[35]=o,e[36]=_,e[37]=C,e[38]=w):w=e[38];let O;return e[39]!==c||e[40]!==u||e[41]!==w||e[42]!==v||e[43]!==y||e[44]!==d?(O=r.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":u,"data-collapsible":v,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[y,w]}),e[39]=c,e[40]=u,e[41]=w,e[42]=v,e[43]=y,e[44]=d,e[45]=O):O=e[45],O}function Do(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("main",{"data-slot":"sidebar-inset",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function To(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("h-4 m-0! w-full",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-sidebar":"separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Lo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Oo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Ho(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("w-full text-sm",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Bo(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("flex w-full min-w-0 flex-col gap-1",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function it(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("group/menu-item relative",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}const Uo=ls("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function wn(t){const e=N.c(28);let n,s,o,a,l,i,c;e[0]!==t?({asChild:o,isActive:a,variant:l,size:i,tooltip:c,className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=l,e[6]=i,e[7]=c):(n=e[1],s=e[2],o=e[3],a=e[4],l=e[5],i=e[6],c=e[7]);const d=o===void 0?!1:o,m=a===void 0?!1:a,f=l===void 0?"default":l,u=i===void 0?"default":i,h=d?is:"button",{isMobile:p,state:v}=_t();let b;e[8]!==n||e[9]!==u||e[10]!==f?(b=H(Uo({variant:f,size:u}),n),e[8]=n,e[9]=u,e[10]=f,e[11]=b):b=e[11];let g;e[12]!==h||e[13]!==m||e[14]!==s||e[15]!==u||e[16]!==b?(g=r.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":u,"data-active":m,className:b,...s}),e[12]=h,e[13]=m,e[14]=s,e[15]=u,e[16]=b,e[17]=g):g=e[17];const y=g;if(!c)return y;if(typeof c=="string"){let w;e[18]!==c?(w={children:c},e[18]=c,e[19]=w):w=e[19],c=w}let j;e[20]!==y?(j=r.jsx(zs,{asChild:!0,children:y}),e[20]=y,e[21]=j):j=e[21];const z=v!=="collapsed"||p;let _;e[22]!==z||e[23]!==c?(_=r.jsx(Cs,{side:"right",align:"center",hidden:z,...c}),e[22]=z,e[23]=c,e[24]=_):_=e[24];let C;return e[25]!==j||e[26]!==_?(C=r.jsxs(_s,{children:[j,_]}),e[25]=j,e[26]=_,e[27]=C):C=e[27],C}function Go(t){const e=N.c(26),{item:n}=t,s=lt(),{org:o}=qe(),a=Qt(o.id),l=Zs(o.id);let i;e[0]!==l.update||e[1]!==n.url||e[2]!==a?.sidebar_items?(i=async()=>{const z=(a?.sidebar_items||[]).filter(_=>_.url!==n.url);await l.update.mutateAsync({sidebar_items:z})},e[0]=l.update,e[1]=n.url,e[2]=a?.sidebar_items,e[3]=i):i=e[3];const c=i;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==n.icon?(m=d.test(n.icon),e[5]=n.icon,e[6]=m):m=e[6];const f=m;let u;e[7]!==n.url||e[8]!==s?(u=()=>{s({to:n.url})},e[7]=n.url,e[8]=s,e[9]=u):u=e[9];const h=n.title;let p;e[10]!==f||e[11]!==n.icon||e[12]!==n.title?(p=r.jsx("div",{className:"flex items-center justify-center shrink-0",children:f?r.jsx("img",{src:n.icon,alt:n.title,className:"h-4 w-4 rounded object-cover"}):r.jsx(Ks,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=f,e[11]=n.icon,e[12]=n.title,e[13]=p):p=e[13];let v;e[14]!==n.title?(v=n.title.toLocaleLowerCase(),e[14]=n.title,e[15]=v):v=e[15];let b;e[16]!==v?(b=r.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:r.jsx("span",{className:"truncate text-sm w-full capitalize",children:v})}),e[16]=v,e[17]=b):b=e[17];let g;e[18]!==c?(g=r.jsx(ot,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:j=>{j.preventDefault(),j.stopPropagation(),c()}}),e[18]=c,e[19]=g):g=e[19];let y;return e[20]!==n.title||e[21]!==u||e[22]!==p||e[23]!==b||e[24]!==g?(y=r.jsx(it,{children:r.jsxs(wn,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:u,tooltip:h,children:[p,b,g]})}),e[20]=n.title,e[21]=u,e[22]=p,e[23]=b,e[24]=g,e[25]=y):y=e[25],y}function Wo(){const t=N.c(4),{org:e}=qe(),s=Qt(e.id)?.sidebar_items;if(!s?.length)return null;let o;t[0]!==s?(o=s.map(Vo),t[0]=s,t[1]=o):o=t[1];let a;return t[2]!==o?(a=r.jsx(jn,{children:o}),t[2]=o,t[3]=a):a=t[3],a}function Vo(t){return r.jsx(Go,{item:t},t.url)}function Dt(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(it,{children:r.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:r.jsx(yn,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function jn(t){const e=N.c(4),{children:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(To,{className:"my-2 -ml-1"}),e[0]=s):s=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(it,{children:r.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:r.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=o):o=e[1];let a;return e[2]!==n?(a=r.jsxs(r.Fragment,{children:[s,o,n]}),e[2]=n,e[3]=a):a=e[3],a}function Fo(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(x.Suspense,{fallback:r.jsxs(jn,{children:[r.jsx(Dt,{}),r.jsx(Dt,{})]}),children:r.jsx(Wo,{})}),t[0]=e):e=t[0],e}function Ko(){const t=N.c(43),{locator:e}=qe(),n=lt();let s;t[0]!==e?(s=Et.parse(e),t[0]=e,t[1]=s):s=t[1];const{org:o}=s;let a;t[2]!==e?(a=Et.isOrgAdminProject(e),t[2]=e,t[3]=a):a=t[3];const l=a;let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(un,{}),t[4]=i):i=t[4];let c;t[5]!==n||t[6]!==o?(c={key:"home",label:"Home",icon:i,onClick:()=>n({to:"/$org",params:{org:o}})},t[5]=n,t[6]=o,t[7]=c):c=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(rn,{}),t[8]=d):d=t[8];let m;t[9]!==n||t[10]!==o?(m={key:"store",label:"Store",icon:d,onClick:()=>n({to:"/$org/store",params:{org:o}})},t[9]=n,t[10]=o,t[11]=m):m=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(js,{}),t[12]=f):f=t[12];let u;t[13]!==n||t[14]!==o?(u={key:"mcps",label:"MCP Servers",icon:f,onClick:()=>n({to:"/$org/mcps",params:{org:o}})},t[13]=n,t[14]=o,t[15]=u):u=t[15];let h;t[16]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsx(jt,{}),t[16]=h):h=t[16];let p;t[17]!==n||t[18]!==o?(p={key:"gateways",label:"MCP Gateways",icon:h,onClick:()=>n({to:"/$org/gateways",params:{org:o}})},t[17]=n,t[18]=o,t[19]=p):p=t[19];let v;t[20]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(an,{}),t[20]=v):v=t[20];let b;t[21]!==n||t[22]!==o?(b={key:"monitoring",label:"Monitoring",icon:v,onClick:()=>n({to:"/$org/monitoring",params:{org:o}})},t[21]=n,t[22]=o,t[23]=b):b=t[23];let g;t[24]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(gn,{}),t[24]=g):g=t[24];let y;t[25]!==n||t[26]!==o?(y={key:"members",label:"Members",icon:g,onClick:()=>n({to:"/$org/members",params:{org:o}})},t[25]=n,t[26]=o,t[27]=y):y=t[27];let j;t[28]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(hn,{}),t[28]=j):j=t[28];let z;t[29]!==n||t[30]!==o?(z={key:"settings",label:"Settings",icon:j,onClick:()=>n({to:"/$org/settings",params:{org:o}})},t[29]=n,t[30]=o,t[31]=z):z=t[31];let _;t[32]!==b||t[33]!==y||t[34]!==z||t[35]!==c||t[36]!==m||t[37]!==u||t[38]!==p?(_=[c,m,u,p,b,y,z],t[32]=b,t[33]=y,t[34]=z,t[35]=c,t[36]=m,t[37]=u,t[38]=p,t[39]=_):_=t[39];const C=_;let w;return t[40]!==C||t[41]!==l?(w=l?C:[],t[40]=C,t[41]=l,t[42]=w):w=t[42],w}function Cn(t){const e=N.c(10),{navigationItems:n,footer:s,additionalContent:o,variant:a,collapsible:l}=t,i=a===void 0?"sidebar":a,c=l===void 0?"icon":l;let d;e[0]!==n?(d=n.map(Zo),e[0]=n,e[1]=d):d=e[1];let m;e[2]!==o||e[3]!==d?(m=r.jsx(Lo,{className:"flex-1 overflow-x-hidden",children:r.jsx(Oo,{className:"font-medium",children:r.jsx(Ho,{children:r.jsxs(Bo,{className:"gap-0.5",children:[d,o]})})})}),e[2]=o,e[3]=d,e[4]=m):m=e[4];let f;return e[5]!==c||e[6]!==s||e[7]!==m||e[8]!==i?(f=r.jsxs(Ao,{variant:i,collapsible:c,children:[m,s]}),e[5]=c,e[6]=s,e[7]=m,e[8]=i,e[9]=f):f=e[9],f}function Zo(t){return r.jsx(it,{children:r.jsxs(wn,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[r.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),r.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Cn.Skeleton=function(){return r.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>r.jsx("div",{className:"w-full h-8",children:r.jsx(yn,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function qo(){const t=N.c(3),e=Ko();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(r.Fragment,{children:r.jsx(Jt,{children:r.jsx(x.Suspense,{fallback:null,children:r.jsx(Fo,{})})})}),t[0]=n):n=t[0];let s;return t[1]!==e?(s=r.jsx(Cn,{navigationItems:e,additionalContent:n}),t[1]=e,t[2]=s):s=t[2],s}function Yo(t){const e=N.c(12);let n,s,o,a;e[0]!==t?({className:n,orientation:o,decorative:a,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a):(n=e[1],s=e[2],o=e[3],a=e[4]);const l=o===void 0?"horizontal":o,i=a===void 0?!0:a;let c;e[5]!==n?(c=H("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==i||e[8]!==l||e[9]!==s||e[10]!==c?(d=r.jsx(cs,{"data-slot":"separator-root",decorative:i,orientation:l,className:c,...s}),e[7]=i,e[8]=l,e[9]=s,e[10]=c,e[11]=d):d=e[11],d}const Nn=x.createContext(null);function Xo(){const t=x.useContext(Nn);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function Jo(t){const e=N.c(10),{children:n,onItemHover:s}=t,[o,a]=x.useState(null);let l;e[0]!==s?(l=f=>{a(f),s?.(f)},e[0]=s,e[1]=l):l=e[1];const i=l;let c;e[2]!==o||e[3]!==i?(c={hoveredItem:o,setHoveredItem:i},e[2]=o,e[3]=i,e[4]=c):c=e[4];let d;e[5]!==n?(d=r.jsx(qt,{children:n}),e[5]=n,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=r.jsx(Nn.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function Qo(t){const e=N.c(6),{children:n,onClick:s}=t;let o;e[0]!==n||e[1]!==s?(o=r.jsx(Ce,{variant:"link",className:"p-0.5 h-auto",onClick:s,type:"button",children:n}),e[0]=n,e[1]=s,e[2]=o):o=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx(Yt,{asChild:!0,children:r.jsx(Ce,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:r.jsx(ln,{size:16,className:"opacity-50"})})}),e[3]=a):a=e[3];let l;return e[4]!==o?(l=r.jsxs("div",{className:"flex items-center gap-1",children:[o,a]}),e[4]=o,e[5]=l):l=e[5],l}function ea(t){const e=N.c(8),{item:n,fallback:s}=t,o=s===void 0?"":s,a=n?.avatarUrl??"",l=n?.name??o;let i;e[0]!==a||e[1]!==l?(i=r.jsx(Ue,{url:a,fallback:l,size:"xs",objectFit:"contain"}),e[0]=a,e[1]=l,e[2]=i):i=e[2];const c=n?.name??o;let d;e[3]!==c?(d=r.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==i||e[6]!==d?(m=r.jsxs("div",{className:"flex items-center gap-2",children:[i,d]}),e[5]=i,e[6]=d,e[7]=m):m=e[7],m}function ta(t){const e=N.c(6),{children:n,align:s}=t,o=s===void 0?"start":s,l=x.Children.toArray(n).filter(na).length===1?"280px":"480px";let i;e[0]!==l?(i={width:l},e[0]=l,e[1]=i):i=e[1];let c;return e[2]!==o||e[3]!==n||e[4]!==i?(c=r.jsx(Xt,{align:o,className:"p-0 flex items-start",style:i,children:n}),e[2]=o,e[3]=n,e[4]=i,e[5]=c):c=e[5],c}function na(t){return x.isValidElement(t)&&(t.type===_n||t.type===zn)}function zn(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=H("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}const _n=zn;function sa(t){const e=N.c(6),{placeholder:n,value:s,onChange:o}=t,a=n===void 0?"Search...":n;let l;e[0]!==o?(l=c=>o(c.target.value),e[0]=o,e[1]=l):l=e[1];let i;return e[2]!==a||e[3]!==l||e[4]!==s?(i=r.jsx(Ys,{placeholder:a,value:s,onChange:l,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=a,e[3]=l,e[4]=s,e[5]=i):i=e[5],i}function oa(t){const e=N.c(6),{children:n,emptyMessage:s}=t,o=s===void 0?"No items found.":s,a=x.Children.count(n)>0;let l;e[0]!==o||e[1]!==a?(l=!a&&r.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:o}),e[0]=o,e[1]=a,e[2]=l):l=e[2];let i;return e[3]!==n||e[4]!==l?(i=r.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[l,n]}),e[3]=n,e[4]=l,e[5]=i):i=e[5],i}function aa(t){const e=N.c(15),{item:n,onClick:s,onHover:o,children:a}=t,l=Xo();let i;e[0]!==l||e[1]!==n||e[2]!==o?(i=()=>{l.setHoveredItem(n.slug),o?.(n)},e[0]=l,e[1]=n,e[2]=o,e[3]=i):i=e[3];const c=i;let d;e[4]!==n||e[5]!==s?(d=()=>s(n),e[4]=n,e[5]=s,e[6]=d):d=e[6];let m;e[7]!==a||e[8]!==n.avatarUrl||e[9]!==n.name?(m=a||r.jsxs(r.Fragment,{children:[r.jsx(Ue,{url:n.avatarUrl??"",fallback:n.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),r.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n.name})]}),e[7]=a,e[8]=n.avatarUrl,e[9]=n.name,e[10]=m):m=e[10];let f;return e[11]!==c||e[12]!==d||e[13]!==m?(f=r.jsx(Ce,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=f):f=e[14],f}function ra(t){const e=N.c(2),{children:n}=t;let s;return e[0]!==n?(s=r.jsx("div",{className:"px-1 pb-1 pt-0.5",children:n}),e[0]=n,e[1]=s):s=e[1],s}function la(t){const e=N.c(11),{onClick:n,icon:s,children:o,variant:a}=t,i=(a===void 0?"default":a)==="muted"&&"text-muted-foreground";let c;e[0]!==i?(c=H("w-full justify-start font-normal",i),e[0]=i,e[1]=c):c=e[1];let d;e[2]!==s?(d=s&&r.jsx("span",{className:"[&>svg]:size-4",children:s}),e[2]=s,e[3]=d):d=e[3];let m;e[4]!==o?(m=r.jsx("span",{children:o}),e[4]=o,e[5]=m):m=e[5];let f;return e[6]!==n||e[7]!==c||e[8]!==d||e[9]!==m?(f=r.jsxs(Ce,{variant:"ghost",size:"sm",className:c,onClick:n,children:[d,m]}),e[6]=n,e[7]=c,e[8]=d,e[9]=m,e[10]=f):f=e[10],f}function ia(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(Yo,{}),t[0]=e):e=t[0],e}function ca(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const ae=Object.assign(Jo,{Trigger:Qo,CurrentItem:ea,Content:ta,Panel:_n,Search:sa,Items:oa,Item:aa,Actions:ra,Action:la,Separator:ia,Skeleton:ca});function Ct(){const t=N.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=Ft(e),{data:s}=Ke.useListOrganizations(),o=lt();let a;t[1]!==n||t[2]!==s?(a=s?.find(Z=>Z.slug===n),t[1]=n,t[2]=s,t[3]=a):a=t[3];const l=a,[i,c]=x.useState(""),[d,m]=x.useState(!1);let f,u,h,p,v,b,g,y;if(t[4]!==l||t[5]!==o||t[6]!==n||t[7]!==i||t[8]!==s){const B=(s?(()=>{const q=s.filter(Q=>Q.name.toLowerCase().includes(i.toLowerCase()));if(n){const Q=q.findIndex(S=>S.slug===n);if(Q>0){const S=q[Q];S&&(q.splice(Q,1),q.unshift(S))}}return q})():[]).map(da);let F;t[17]!==l?(F=l?{slug:l.slug,name:l.name,avatarUrl:l.logo}:void 0,t[17]=l,t[18]=F):F=t[18];const W=F;p=ae;let te;t[19]!==o||t[20]!==n?(te=()=>o({to:"/$org",params:{org:n??""}}),t[19]=o,t[20]=n,t[21]=te):te=t[21];let J;t[22]!==W?(J=r.jsx(ae.CurrentItem,{item:W}),t[22]=W,t[23]=J):J=t[23],t[24]!==te||t[25]!==J?(y=r.jsx(ae.Trigger,{onClick:te,children:J}),t[24]=te,t[25]=J,t[26]=y):y=t[26],h=ae.Content,u=ae.Panel,t[27]!==i?(g=r.jsx(ae.Search,{placeholder:"Search organizations...",value:i,onChange:c}),t[27]=i,t[28]=g):g=t[28],f=ae.Items,v="No organizations found.";let re;t[29]!==o?(re=q=>r.jsx(ae.Item,{item:q,onClick:Q=>o({to:"/$org",params:{org:Q.slug}})},q.slug),t[29]=o,t[30]=re):re=t[30],b=B.map(re),t[4]=l,t[5]=o,t[6]=n,t[7]=i,t[8]=s,t[9]=f,t[10]=u,t[11]=h,t[12]=p,t[13]=v,t[14]=b,t[15]=g,t[16]=y}else f=t[9],u=t[10],h=t[11],p=t[12],v=t[13],b=t[14],g=t[15],y=t[16];let j;t[31]!==f||t[32]!==v||t[33]!==b?(j=r.jsx(f,{emptyMessage:v,children:b}),t[31]=f,t[32]=v,t[33]=b,t[34]=j):j=t[34];let z,_;t[35]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsx(ae.Actions,{children:r.jsx(ae.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),_=r.jsx(ae.Separator,{}),t[35]=z,t[36]=_):(z=t[35],_=t[36]);let C;t[37]!==o?(C=()=>o({to:"/"}),t[37]=o,t[38]=C):C=t[38];let w;t[39]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsx(Xs,{}),t[39]=w):w=t[39];let O;t[40]!==C?(O=r.jsx(ae.Actions,{children:r.jsx(ae.Action,{onClick:C,icon:w,children:"See all organizations"})}),t[40]=C,t[41]=O):O=t[41];let M;t[42]!==u||t[43]!==O||t[44]!==g||t[45]!==j?(M=r.jsxs(u,{children:[g,j,z,_,O]}),t[42]=u,t[43]=O,t[44]=g,t[45]=j,t[46]=M):M=t[46];let R;t[47]!==h||t[48]!==M?(R=r.jsx(h,{children:M}),t[47]=h,t[48]=M,t[49]=R):R=t[49];let $;t[50]!==p||t[51]!==R||t[52]!==y?($=r.jsxs(p,{children:[y,R]}),t[50]=p,t[51]=R,t[52]=y,t[53]=$):$=t[53];let D;t[54]!==d?(D=r.jsx(qs,{open:d,onOpenChange:m}),t[54]=d,t[55]=D):D=t[55];let L;return t[56]!==$||t[57]!==D?(L=r.jsxs(r.Fragment,{children:[$,D]}),t[56]=$,t[57]=D,t[58]=L):L=t[58],L}function da(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}Ct.Skeleton=ae.Skeleton;const In=x.createContext({setOpen:()=>{}}),ua=()=>x.useContext(In),fa=t=>{const e=N.c(25);let n,s,o,a,l;e[0]!==t?({children:n,defaultOpen:s,open:a,onOpenChange:o,...l}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=a,e[5]=l):(n=e[1],s=e[2],o=e[3],a=e[4],l=e[5]);const i=s??!1;let c;e[6]!==o||e[7]!==a||e[8]!==i?(c={prop:a,defaultProp:i,onChange:o},e[6]=o,e[7]=a,e[8]=i,e[9]=c):c=e[9];const[d,m]=Bs(c);let f;e[10]!==m?(f={setOpen:m},e[10]=m,e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==d||e[14]!==l||e[15]!==m?(u=r.jsx(Us,{open:d,onOpenChange:m,...l,children:n}),e[12]=n,e[13]=d,e[14]=l,e[15]=m,e[16]=u):u=e[16];let h;e[17]!==d||e[18]!==l||e[19]!==m||e[20]!==u?(h=r.jsx(eo,{open:d,onOpenChange:m,...l,children:u}),e[17]=d,e[18]=l,e[19]=m,e[20]=u,e[21]=h):h=e[21];let p;return e[22]!==f||e[23]!==h?(p=r.jsx(In.Provider,{value:f,children:h}),e[22]=f,e[23]=h,e[24]=p):p=e[24],p},ma=t=>{const{children:e,title:n,...s}=t,o=Ye(),{className:a,...l}=s;return o?r.jsxs(Ls,{...l,children:[r.jsx(Os,{className:"hidden",children:r.jsx(Hs,{children:n})}),r.jsx("div",{className:H("flex flex-col gap-2 p-2 py-4",a),children:e})]}):r.jsx(Qs,{...s,children:e})},pa=t=>{const{children:e,...n}=t,{setOpen:s}=ua(),o=Ye(),{className:a,...l}=n;return o?r.jsx("div",{...l,onClick:i=>{s(!1);const{onClick:c}=l;c?.(i)},className:H("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a),children:e}):r.jsx(to,{...n,children:e})},ha=t=>{const e=N.c(7);let n,s;e[0]!==t?({children:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);const o=Ye();let a;return e[3]!==n||e[4]!==o||e[5]!==s?(a=o?r.jsx(Ts,{asChild:!0,children:n}):r.jsx(Js,{...s,children:n}),e[3]=n,e[4]=o,e[5]=s,e[6]=a):a=e[6],a},xa=t=>{const e=N.c(7);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);const o=Ye();let a;return e[3]!==n||e[4]!==o||e[5]!==s?(a=o?r.jsx(Rt,{className:H(n),...s}):r.jsx(Rt,{className:H(n),...s}),e[3]=n,e[4]=o,e[5]=s,e[6]=a):a=e[6],a};function ga(t){const e=N.c(11),{user:n,trigger:s,align:o,children:a}=t,l=o===void 0?"start":o;let i;e[0]!==s||e[1]!==n?(i=s(n),e[0]=s,e[1]=n,e[2]=i):i=e[2];let c;e[3]!==i?(c=r.jsx(ha,{asChild:!0,children:r.jsx("div",{children:i})}),e[3]=i,e[4]=c):c=e[4];let d;e[5]!==l||e[6]!==a?(d=r.jsx(ma,{side:"top",align:l,className:"md:w-[240px]",children:a}),e[5]=l,e[6]=a,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=r.jsxs(fa,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function ba(t){const e=N.c(8),{children:n,onClick:s,className:o,asChild:a}=t;let l;e[0]!==a||e[1]!==n||e[2]!==s?(l=a?n:r.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:s,children:n}),e[0]=a,e[1]=n,e[2]=s,e[3]=l):l=e[3];let i;return e[4]!==a||e[5]!==o||e[6]!==l?(i=r.jsx(pa,{asChild:a,className:o,children:l}),e[4]=a,e[5]=o,e[6]=l,e[7]=i):i=e[7],i}function va(t){const e=N.c(2),{className:n}=t;let s;return e[0]!==n?(s=r.jsx(xa,{className:n}),e[0]=n,e[1]=s):s=e[1],s}function ya(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const ve=Object.assign(ga,{Item:ba,Separator:va,Skeleton:ya});function Sa(t){const e=N.c(32),{open:n,onOpenChange:s,user:o,userImage:a}=t,[l,i]=x.useState(!1);let c;e[0]!==o.id?(c=()=>{navigator.clipboard.writeText(o.id),i(!0),setTimeout(()=>i(!1),2e3)},e[0]=o.id,e[1]=c):c=e[1];const d=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsxs(en,{children:[r.jsx(tn,{children:"Profile"}),r.jsx(nn,{children:"Your account information"})]}),e[2]=m):m=e[2];const f=o.name||o.email||"U";let u;e[3]!==f||e[4]!==a?(u=r.jsx(Ue,{url:a,fallback:f,shape:"circle",size:"2xl"}),e[3]=f,e[4]=a,e[5]=u):u=e[5];const h=o.name||o.email;let p;e[6]!==h?(p=r.jsx("div",{className:"text-lg font-semibold text-center",children:h}),e[6]=h,e[7]=p):p=e[7];let v;e[8]!==o.email?(v=r.jsx("div",{className:"text-sm text-muted-foreground text-center",children:o.email}),e[8]=o.email,e[9]=v):v=e[9];let b;e[10]!==p||e[11]!==v?(b=r.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[p,v]}),e[10]=p,e[11]=v,e[12]=b):b=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=g):g=e[13];let y;e[14]!==o.id?(y=r.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[g,r.jsx("span",{className:"text-sm font-mono truncate",children:o.id})]}),e[14]=o.id,e[15]=y):y=e[15];let j;e[16]!==l?(j=l?r.jsx(Is,{size:16,className:"text-green-600"}):r.jsx(no,{size:16,className:"text-muted-foreground"}),e[16]=l,e[17]=j):j=e[17];let z;e[18]!==d||e[19]!==j?(z=r.jsx("button",{type:"button",onClick:d,className:"flex-shrink-0 p-2 hover:bg-background rounded-md transition-colors","aria-label":"Copy user ID",children:j}),e[18]=d,e[19]=j,e[20]=z):z=e[20];let _;e[21]!==y||e[22]!==z?(_=r.jsxs("div",{className:"flex items-center justify-between gap-3 w-full px-4 py-3 rounded-lg bg-muted/50 border border-border",children:[y,z]}),e[21]=y,e[22]=z,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==u||e[26]!==b?(C=r.jsxs(sn,{className:"sm:max-w-md",children:[m,r.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[u,b,_]})]}),e[24]=_,e[25]=u,e[26]=b,e[27]=C):C=e[27];let w;return e[28]!==s||e[29]!==n||e[30]!==C?(w=r.jsx(on,{open:n,onOpenChange:s,children:C}),e[28]=s,e[29]=n,e[30]=C,e[31]=w):w=e[31],w}function wa(t){const e=N.c(5),{open:n,onOpenChange:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsxs(en,{children:[r.jsx(tn,{children:"Invitations"}),r.jsx(nn,{children:"Your pending organization invitations"})]}),e[0]=o):o=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsxs(sn,{className:"sm:max-w-lg",children:[o,r.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:r.jsx(fs,{})})]}),e[1]=a):a=e[1];let l;return e[2]!==s||e[3]!==n?(l=r.jsx(on,{open:n,onOpenChange:s,children:a}),e[2]=s,e[3]=n,e[4]=l):l=e[4],l}function ja(t){const e=N.c(31),{user:n,userImage:s,hasInvites:o,showInvitesItem:a}=t,[l,i]=x.useState(!1),[c,d]=x.useState(!1);let m;e[0]!==o||e[1]!==n.email||e[2]!==n.name||e[3]!==s?(m=()=>r.jsxs("div",{className:"relative",children:[r.jsx(Ue,{url:s,fallback:n.name||n.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),o&&r.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background"})]}),e[0]=o,e[1]=n.email,e[2]=n.name,e[3]=s,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsxs(ve.Item,{onClick:()=>i(!0),children:[r.jsx(xn,{className:"text-muted-foreground",size:18}),"Profile"]}),e[5]=f):f=e[5];let u;e[6]!==o||e[7]!==a?(u=a&&r.jsxs(ve.Item,{onClick:()=>d(!0),children:[r.jsx(pn,{className:"text-muted-foreground",size:18}),"Invitations",o&&r.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=o,e[7]=a,e[8]=u):u=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsx(ve.Separator,{}),e[9]=h):h=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx(us,{className:"w-4 h-4 text-muted-foreground"}),e[10]=p):p=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(ve.Item,{asChild:!0,children:r.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[p,"decocms/admin",r.jsx(At,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=v):v=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(dn,{className:"text-muted-foreground",size:18}),e[12]=b):b=e[12];let g,y;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(ve.Item,{asChild:!0,children:r.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[b,"Homepage",r.jsx(At,{size:18,className:"ml-auto text-muted-foreground"})]})}),y=r.jsx(ve.Separator,{}),e[13]=g,e[14]=y):(g=e[13],y=e[14]);let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsxs(ve.Item,{onClick:Ca,children:[r.jsx(mn,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=j):j=e[15];let z;e[16]!==m||e[17]!==u||e[18]!==n?(z=r.jsxs(ve,{user:n,trigger:m,align:"end",children:[f,u,h,v,g,y,j]}),e[16]=m,e[17]=u,e[18]=n,e[19]=z):z=e[19];let _;e[20]!==l||e[21]!==n||e[22]!==s?(_=l&&r.jsx(Sa,{open:l,onOpenChange:i,user:n,userImage:s}),e[20]=l,e[21]=n,e[22]=s,e[23]=_):_=e[23];let C;e[24]!==c||e[25]!==a?(C=a&&c&&r.jsx(wa,{open:c,onOpenChange:d}),e[24]=c,e[25]=a,e[26]=C):C=e[26];let w;return e[27]!==z||e[28]!==_||e[29]!==C?(w=r.jsxs(r.Fragment,{children:[z,_,C]}),e[27]=z,e[28]=_,e[29]=C,e[30]=w):w=e[30],w}function Ca(){return Ke.signOut()}function Na(){const{data:t}=Ke.useSession(),e=x.useContext(ds),{data:n}=e.hooks.useListUserInvitations(),o=(n??[]).length>0;if(!t?.user)return r.jsx(Ue,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const a=t.user,l={...a,name:a.name??void 0},i=a.image;return r.jsx(ja,{user:l,userImage:i,hasInvites:o,showInvitesItem:!0})}function za(t){const e=N.c(6),{children:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx(ms,{children:r.jsx(Kt,{})}),e[0]=s):s=e[0];let o;e[1]!==n?(o=r.jsx(ps,{children:n}),e[1]=n,e[2]=o):o=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx(hs,{children:r.jsx(xs,{to:"/login",replace:!0})}),e[3]=a):a=e[3];let l;return e[4]!==o?(l=r.jsxs(r.Fragment,{children:[s,o,a]}),e[4]=o,e[5]=l):l=e[5],l}function _a(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=H("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function Ia(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=H("flex items-center justify-center px-2 h-full border-r border-border",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function ka(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=H("flex items-center gap-2 px-2 h-full",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function Pa(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=H("flex items-center gap-2 px-2 h-full flex-1",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function $a(t){const e=N.c(5),{children:n,className:s}=t;let o;e[0]!==s?(o=H("flex items-center gap-2 px-2 h-full ml-auto",s),e[0]=s,e[1]=o):o=e[1];let a;return e[2]!==n||e[3]!==o?(a=r.jsx("div",{className:o,children:n}),e[2]=n,e[3]=o,e[4]=a):a=e[4],a}function Ma(){const t=N.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:r.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:r.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=n):n=t[1];let s;return t[2]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,n,r.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:r.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=s):s=t[2],s}const tt=Object.assign(_a,{Sidebar:Ia,Left:ka,Center:Pa,Right:$a,Skeleton:Ma}),ct=x.createContext(null);ct.displayName="PanelGroupContext";const Y={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},It=10,je=x.useLayoutEffect,Tt=gs.useId,Ea=typeof Tt=="function"?Tt:()=>null;let Ra=0;function kt(t=null){const e=Ea(),n=x.useRef(t||e||null);return n.current===null&&(n.current=""+Ra++),t??n.current}function kn({children:t,className:e="",collapsedSize:n,collapsible:s,defaultSize:o,forwardedRef:a,id:l,maxSize:i,minSize:c,onCollapse:d,onExpand:m,onResize:f,order:u,style:h,tagName:p="div",...v}){const b=x.useContext(ct);if(b===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:y,getPanelSize:j,getPanelStyle:z,groupId:_,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:O,resizePanel:M,unregisterPanel:R}=b,$=kt(l),D=x.useRef({callbacks:{onCollapse:d,onExpand:m,onResize:f},constraints:{collapsedSize:n,collapsible:s,defaultSize:o,maxSize:i,minSize:c},id:$,idIsFromProps:l!==void 0,order:u});x.useRef({didLogMissingDefaultSizeWarning:!1}),je(()=>{const{callbacks:Z,constraints:B}=D.current,F={...B};D.current.id=$,D.current.idIsFromProps=l!==void 0,D.current.order=u,Z.onCollapse=d,Z.onExpand=m,Z.onResize=f,B.collapsedSize=n,B.collapsible=s,B.defaultSize=o,B.maxSize=i,B.minSize=c,(F.collapsedSize!==B.collapsedSize||F.collapsible!==B.collapsible||F.maxSize!==B.maxSize||F.minSize!==B.minSize)&&w(D.current,F)}),je(()=>{const Z=D.current;return O(Z),()=>{R(Z)}},[u,$,O,R]),x.useImperativeHandle(a,()=>({collapse:()=>{g(D.current)},expand:Z=>{y(D.current,Z)},getId(){return $},getSize(){return j(D.current)},isCollapsed(){return C(D.current)},isExpanded(){return!C(D.current)},resize:Z=>{M(D.current,Z)}}),[g,y,j,C,$,M]);const L=z(D.current,o);return x.createElement(p,{...v,children:t,className:e,id:$,style:{...L,...h},[Y.groupId]:_,[Y.panel]:"",[Y.panelCollapsible]:s||void 0,[Y.panelId]:$,[Y.panelSize]:parseFloat(""+L.flexGrow).toFixed(1)})}const Pn=x.forwardRef((t,e)=>x.createElement(kn,{...t,forwardedRef:e}));kn.displayName="Panel";Pn.displayName="forwardRef(Panel)";let Nt=null,st=-1,ye=null;function Aa(t,e){if(e){const n=(e&An)!==0,s=(e&Dn)!==0,o=(e&Tn)!==0,a=(e&Ln)!==0;if(n)return o?"se-resize":a?"ne-resize":"e-resize";if(s)return o?"sw-resize":a?"nw-resize":"w-resize";if(o)return"s-resize";if(a)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Da(){ye!==null&&(document.head.removeChild(ye),Nt=null,ye=null,st=-1)}function bt(t,e){var n,s;const o=Aa(t,e);if(Nt!==o){if(Nt=o,ye===null&&(ye=document.createElement("style"),document.head.appendChild(ye)),st>=0){var a;(a=ye.sheet)===null||a===void 0||a.removeRule(st)}st=(n=(s=ye.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${o} !important;}`))!==null&&n!==void 0?n:-1}}function $n(t){return t.type==="keydown"}function Mn(t){return t.type.startsWith("pointer")}function En(t){return t.type.startsWith("mouse")}function dt(t){if(Mn(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(En(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function Ta(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function La(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Oa(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Ht(t),b:Ht(e)};let s;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),s=t;T(s,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Ot(Lt(n.a)),b:Ot(Lt(n.b))};if(o.a===o.b){const a=s.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let i=a.length;for(;i--;){const c=a[i];if(c===l.a)return 1;if(c===l.b)return-1}}return Math.sign(o.a-o.b)}const Ha=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Ba(t){var e;const n=getComputedStyle((e=Rn(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function Ua(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Ba(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Ha.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Lt(t){let e=t.length;for(;e--;){const n=t[e];if(T(n,"Missing node"),Ua(n))return n}return null}function Ot(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Ht(t){const e=[];for(;t;)e.push(t),t=Rn(t);return e}function Rn(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const An=1,Dn=2,Tn=4,Ln=8,Ga=Ta()==="coarse";let de=[],He=!1,we=new Map,ut=new Map;const Ve=new Set;function Wa(t,e,n,s,o){var a;const{ownerDocument:l}=e,i={direction:n,element:e,hitAreaMargins:s,setResizeHandlerState:o},c=(a=we.get(l))!==null&&a!==void 0?a:0;return we.set(l,c+1),Ve.add(i),at(),function(){var m;ut.delete(t),Ve.delete(i);const f=(m=we.get(l))!==null&&m!==void 0?m:1;if(we.set(l,f-1),at(),f===1&&we.delete(l),de.includes(i)){const u=de.indexOf(i);u>=0&&de.splice(u,1),$t(),o("up",!0,null)}}}function Va(t){const{target:e}=t,{x:n,y:s}=dt(t);He=!0,Pt({target:e,x:n,y:s}),at(),de.length>0&&(rt("down",t),t.preventDefault(),On(e)||t.stopImmediatePropagation())}function vt(t){const{x:e,y:n}=dt(t);if(He&&t.buttons===0&&(He=!1,rt("up",t)),!He){const{target:s}=t;Pt({target:s,x:e,y:n})}rt("move",t),$t(),de.length>0&&t.preventDefault()}function yt(t){const{target:e}=t,{x:n,y:s}=dt(t);ut.clear(),He=!1,de.length>0&&(t.preventDefault(),On(e)||t.stopImmediatePropagation()),rt("up",t),Pt({target:e,x:n,y:s}),$t(),at()}function On(t){let e=t;for(;e;){if(e.hasAttribute(Y.resizeHandle))return!0;e=e.parentElement}return!1}function Pt({target:t,x:e,y:n}){de.splice(0);let s=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(s=t),Ve.forEach(o=>{const{element:a,hitAreaMargins:l}=o,i=a.getBoundingClientRect(),{bottom:c,left:d,right:m,top:f}=i,u=Ga?l.coarse:l.fine;if(e>=d-u&&e<=m+u&&n>=f-u&&n<=c+u){if(s!==null&&document.contains(s)&&a!==s&&!a.contains(s)&&!s.contains(a)&&Oa(s,a)>0){let p=s,v=!1;for(;p&&!p.contains(a);){if(La(p.getBoundingClientRect(),i)){v=!0;break}p=p.parentElement}if(v)return}de.push(o)}})}function St(t,e){ut.set(t,e)}function $t(){let t=!1,e=!1;de.forEach(s=>{const{direction:o}=s;o==="horizontal"?t=!0:e=!0});let n=0;ut.forEach(s=>{n|=s}),t&&e?bt("intersection",n):t?bt("horizontal",n):e?bt("vertical",n):Da()}let wt=new AbortController;function at(){wt.abort(),wt=new AbortController;const t={capture:!0,signal:wt.signal};Ve.size&&(He?(de.length>0&&we.forEach((e,n)=>{const{body:s}=n;e>0&&(s.addEventListener("contextmenu",yt,t),s.addEventListener("pointerleave",vt,t),s.addEventListener("pointermove",vt,t))}),window.addEventListener("pointerup",yt,t),window.addEventListener("pointercancel",yt,t)):we.forEach((e,n)=>{const{body:s}=n;e>0&&(s.addEventListener("pointerdown",Va,t),s.addEventListener("pointermove",vt,t))}))}function rt(t,e){Ve.forEach(n=>{const{setResizeHandlerState:s}=n,o=de.includes(n);s(t,o,e)})}function Fa(){const[t,e]=x.useState(0);return x.useCallback(()=>e(n=>n+1),[])}function T(t,e){if(!t)throw console.error(e),Error(e)}function Ne(t,e,n=It){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function xe(t,e,n=It){return Ne(t,e,n)===0}function ie(t,e,n){return Ne(t,e,n)===0}function Ka(t,e,n){if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++){const o=t[s],a=e[s];if(!ie(o,a,n))return!1}return!0}function Oe({panelConstraints:t,panelIndex:e,size:n}){const s=t[e];T(s!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:o=0,collapsible:a,maxSize:l=100,minSize:i=0}=s;if(Ne(n,i)<0)if(a){const c=(o+i)/2;Ne(n,c)<0?n=o:n=i}else n=i;return n=Math.min(l,n),n=parseFloat(n.toFixed(It)),n}function Ge({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:s,prevLayout:o,trigger:a}){if(ie(t,0))return e;const l=[...e],[i,c]=s;T(i!=null,"Invalid first pivot index"),T(c!=null,"Invalid second pivot index");let d=0;if(a==="keyboard"){{const f=t<0?c:i,u=n[f];T(u,`Panel constraints not found for index ${f}`);const{collapsedSize:h=0,collapsible:p,minSize:v=0}=u;if(p){const b=e[f];if(T(b!=null,`Previous layout not found for panel index ${f}`),ie(b,h)){const g=v-b;Ne(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}{const f=t<0?i:c,u=n[f];T(u,`No panel constraints found for index ${f}`);const{collapsedSize:h=0,collapsible:p,minSize:v=0}=u;if(p){const b=e[f];if(T(b!=null,`Previous layout not found for panel index ${f}`),ie(b,v)){const g=b-h;Ne(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const f=t<0?1:-1;let u=t<0?c:i,h=0;for(;;){const v=e[u];T(v!=null,`Previous layout not found for panel index ${u}`);const g=Oe({panelConstraints:n,panelIndex:u,size:100})-v;if(h+=g,u+=f,u<0||u>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(h));t=t<0?0-p:p}{let u=t<0?i:c;for(;u>=0&&u<n.length;){const h=Math.abs(t)-Math.abs(d),p=e[u];T(p!=null,`Previous layout not found for panel index ${u}`);const v=p-h,b=Oe({panelConstraints:n,panelIndex:u,size:v});if(!ie(p,b)&&(d+=p-b,l[u]=b,d.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?u--:u++}}if(Ka(o,l))return o;{const f=t<0?c:i,u=e[f];T(u!=null,`Previous layout not found for panel index ${f}`);const h=u+d,p=Oe({panelConstraints:n,panelIndex:f,size:h});if(l[f]=p,!ie(p,h)){let v=h-p,g=t<0?c:i;for(;g>=0&&g<n.length;){const y=l[g];T(y!=null,`Previous layout not found for panel index ${g}`);const j=y+v,z=Oe({panelConstraints:n,panelIndex:g,size:j});if(ie(y,z)||(v-=z-y,l[g]=z),ie(v,0))break;t>0?g--:g++}}}const m=l.reduce((f,u)=>u+f,0);return ie(m,100)?l:o}function Za({layout:t,panelsArray:e,pivotIndices:n}){let s=0,o=100,a=0,l=0;const i=n[0];T(i!=null,"No pivot index found"),e.forEach((f,u)=>{const{constraints:h}=f,{maxSize:p=100,minSize:v=0}=h;u===i?(s=v,o=p):(a+=v,l+=p)});const c=Math.min(o,100-a),d=Math.max(s,100-l),m=t[i];return{valueMax:c,valueMin:d,valueNow:m}}function Fe(t,e=document){return Array.from(e.querySelectorAll(`[${Y.resizeHandleId}][data-panel-group-id="${t}"]`))}function Hn(t,e,n=document){const o=Fe(t,n).findIndex(a=>a.getAttribute(Y.resizeHandleId)===e);return o??null}function Bn(t,e,n){const s=Hn(t,e,n);return s!=null?[s,s+1]:[-1,-1]}function Un(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const s=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return s||null}function ft(t,e=document){const n=e.querySelector(`[${Y.resizeHandleId}="${t}"]`);return n||null}function qa(t,e,n,s=document){var o,a,l,i;const c=ft(e,s),d=Fe(t,s),m=c?d.indexOf(c):-1,f=(o=(a=n[m])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null,u=(l=(i=n[m+1])===null||i===void 0?void 0:i.id)!==null&&l!==void 0?l:null;return[f,u]}function Ya({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:s,panelDataArray:o,panelGroupElement:a,setLayout:l}){x.useRef({didWarnAboutMissingResizeHandle:!1}),je(()=>{if(!a)return;const i=Fe(n,a);for(let c=0;c<o.length-1;c++){const{valueMax:d,valueMin:m,valueNow:f}=Za({layout:s,panelsArray:o,pivotIndices:[c,c+1]}),u=i[c];if(u!=null){const h=o[c];T(h,`No panel data found for index "${c}"`),u.setAttribute("aria-controls",h.id),u.setAttribute("aria-valuemax",""+Math.round(d)),u.setAttribute("aria-valuemin",""+Math.round(m)),u.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{i.forEach((c,d)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,s,o,a]),x.useEffect(()=>{if(!a)return;const i=e.current;T(i,"Eager values not found");const{panelDataArray:c}=i,d=Un(n,a);T(d!=null,`No group found for id "${n}"`);const m=Fe(n,a);T(m,`No resize handles found for group id "${n}"`);const f=m.map(u=>{const h=u.getAttribute(Y.resizeHandleId);T(h,"Resize handle element has no handle id attribute");const[p,v]=qa(n,h,c,a);if(p==null||v==null)return()=>{};const b=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const y=c.findIndex(j=>j.id===p);if(y>=0){const j=c[y];T(j,`No panel data found for index ${y}`);const z=s[y],{collapsedSize:_=0,collapsible:C,minSize:w=0}=j.constraints;if(z!=null&&C){const O=Ge({delta:ie(z,_)?w-_:_-z,initialLayout:s,panelConstraints:c.map(M=>M.constraints),pivotIndices:Bn(n,h,a),prevLayout:s,trigger:"keyboard"});s!==O&&l(O)}}break}}};return u.addEventListener("keydown",b),()=>{u.removeEventListener("keydown",b)}});return()=>{f.forEach(u=>u())}},[a,t,e,n,s,o,l])}function Bt(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Gn(t,e){const n=t==="horizontal",{x:s,y:o}=dt(e);return n?s:o}function Xa(t,e,n,s,o){const a=n==="horizontal",l=ft(e,o);T(l,`No resize handle element found for id "${e}"`);const i=l.getAttribute(Y.groupId);T(i,"Resize handle element has no group id attribute");let{initialCursorPosition:c}=s;const d=Gn(n,t),m=Un(i,o);T(m,`No group element found for id "${i}"`);const f=m.getBoundingClientRect(),u=a?f.width:f.height;return(d-c)/u*100}function Ja(t,e,n,s,o,a){if($n(t)){const l=n==="horizontal";let i=0;t.shiftKey?i=100:o!=null?i=o:i=10;let c=0;switch(t.key){case"ArrowDown":c=l?0:i;break;case"ArrowLeft":c=l?-i:0;break;case"ArrowRight":c=l?i:0;break;case"ArrowUp":c=l?0:-i;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return s==null?0:Xa(t,e,n,s,a)}function Qa({panelDataArray:t}){const e=Array(t.length),n=t.map(a=>a.constraints);let s=0,o=100;for(let a=0;a<t.length;a++){const l=n[a];T(l,`Panel constraints not found for index ${a}`);const{defaultSize:i}=l;i!=null&&(s++,e[a]=i,o-=i)}for(let a=0;a<t.length;a++){const l=n[a];T(l,`Panel constraints not found for index ${a}`);const{defaultSize:i}=l;if(i!=null)continue;const c=t.length-s,d=o/c;s++,e[a]=d,o-=d}return e}function Te(t,e,n){e.forEach((s,o)=>{const a=t[o];T(a,`Panel data not found for index ${o}`);const{callbacks:l,constraints:i,id:c}=a,{collapsedSize:d=0,collapsible:m}=i,f=n[c];if(f==null||s!==f){n[c]=s;const{onCollapse:u,onExpand:h,onResize:p}=l;p&&p(s,f),m&&(u||h)&&(h&&(f==null||xe(f,d))&&!xe(s,d)&&h(),u&&(f==null||!xe(f,d))&&xe(s,d)&&u())}})}function nt(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function er({defaultSize:t,dragState:e,layout:n,panelData:s,panelIndex:o,precision:a=3}){const l=n[o];let i;return l==null?i=t!=null?t.toPrecision(a):"1":s.length===1?i="1":i=l.toPrecision(a),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function tr(t,e=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...o)},e)}}function Ut(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Wn(t){return`react-resizable-panels:${t}`}function Vn(t){return t.map(e=>{const{constraints:n,id:s,idIsFromProps:o,order:a}=e;return o?s:a?`${a}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Fn(t,e){try{const n=Wn(t),s=e.getItem(n);if(s){const o=JSON.parse(s);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function nr(t,e,n){var s,o;const a=(s=Fn(t,n))!==null&&s!==void 0?s:{},l=Vn(e);return(o=a[l])!==null&&o!==void 0?o:null}function sr(t,e,n,s,o){var a;const l=Wn(t),i=Vn(e),c=(a=Fn(t,o))!==null&&a!==void 0?a:{};c[i]={expandToSizes:Object.fromEntries(n.entries()),layout:s};try{o.setItem(l,JSON.stringify(c))}catch(d){console.error(d)}}function Gt({layout:t,panelConstraints:e}){const n=[...t],s=n.reduce((a,l)=>a+l,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(a=>`${a}%`).join(", ")}`);if(!ie(s,100)&&n.length>0)for(let a=0;a<e.length;a++){const l=n[a];T(l!=null,`No layout data found for index ${a}`);const i=100/s*l;n[a]=i}let o=0;for(let a=0;a<e.length;a++){const l=n[a];T(l!=null,`No layout data found for index ${a}`);const i=Oe({panelConstraints:e,panelIndex:a,size:l});l!=i&&(o+=l-i,n[a]=i)}if(!ie(o,0))for(let a=0;a<e.length;a++){const l=n[a];T(l!=null,`No layout data found for index ${a}`);const i=l+o,c=Oe({panelConstraints:e,panelIndex:a,size:i});if(l!==c&&(o-=c-l,n[a]=c,ie(o,0)))break}return n}const or=100,We={getItem:t=>(Ut(We),We.getItem(t)),setItem:(t,e)=>{Ut(We),We.setItem(t,e)}},Wt={};function Kn({autoSaveId:t=null,children:e,className:n="",direction:s,forwardedRef:o,id:a=null,onLayout:l=null,keyboardResizeBy:i=null,storage:c=We,style:d,tagName:m="div",...f}){const u=kt(a),h=x.useRef(null),[p,v]=x.useState(null),[b,g]=x.useState([]),y=Fa(),j=x.useRef({}),z=x.useRef(new Map),_=x.useRef(0),C=x.useRef({autoSaveId:t,direction:s,dragState:p,id:u,keyboardResizeBy:i,onLayout:l,storage:c}),w=x.useRef({layout:b,panelDataArray:[],panelDataArrayChanged:!1});x.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),x.useImperativeHandle(o,()=>({getId:()=>C.current.id,getLayout:()=>{const{layout:S}=w.current;return S},setLayout:S=>{const{onLayout:P}=C.current,{layout:A,panelDataArray:k}=w.current,I=Gt({layout:S,panelConstraints:k.map(E=>E.constraints)});Bt(A,I)||(g(I),w.current.layout=I,P&&P(I),Te(k,I,j.current))}}),[]),je(()=>{C.current.autoSaveId=t,C.current.direction=s,C.current.dragState=p,C.current.id=u,C.current.onLayout=l,C.current.storage=c}),Ya({committedValuesRef:C,eagerValuesRef:w,groupId:u,layout:b,panelDataArray:w.current.panelDataArray,setLayout:g,panelGroupElement:h.current}),x.useEffect(()=>{const{panelDataArray:S}=w.current;if(t){if(b.length===0||b.length!==S.length)return;let P=Wt[t];P==null&&(P=tr(sr,or),Wt[t]=P);const A=[...S],k=new Map(z.current);P(t,A,k,b,c)}},[t,b,c]),x.useEffect(()=>{});const O=x.useCallback(S=>{const{onLayout:P}=C.current,{layout:A,panelDataArray:k}=w.current;if(S.constraints.collapsible){const I=k.map(ne=>ne.constraints),{collapsedSize:E=0,panelSize:U,pivotIndices:K}=Se(k,S,A);if(T(U!=null,`Panel size not found for panel "${S.id}"`),!xe(U,E)){z.current.set(S.id,U);const oe=Le(k,S)===k.length-1?U-E:E-U,G=Ge({delta:oe,initialLayout:A,panelConstraints:I,pivotIndices:K,prevLayout:A,trigger:"imperative-api"});nt(A,G)||(g(G),w.current.layout=G,P&&P(G),Te(k,G,j.current))}}},[]),M=x.useCallback((S,P)=>{const{onLayout:A}=C.current,{layout:k,panelDataArray:I}=w.current;if(S.constraints.collapsible){const E=I.map(ee=>ee.constraints),{collapsedSize:U=0,panelSize:K=0,minSize:ne=0,pivotIndices:oe}=Se(I,S,k),G=P??ne;if(xe(K,U)){const ee=z.current.get(S.id),ce=ee!=null&&ee>=G?ee:G,ue=Le(I,S)===I.length-1?K-ce:ce-K,X=Ge({delta:ue,initialLayout:k,panelConstraints:E,pivotIndices:oe,prevLayout:k,trigger:"imperative-api"});nt(k,X)||(g(X),w.current.layout=X,A&&A(X),Te(I,X,j.current))}}},[]),R=x.useCallback(S=>{const{layout:P,panelDataArray:A}=w.current,{panelSize:k}=Se(A,S,P);return T(k!=null,`Panel size not found for panel "${S.id}"`),k},[]),$=x.useCallback((S,P)=>{const{panelDataArray:A}=w.current,k=Le(A,S);return er({defaultSize:P,dragState:p,layout:b,panelData:A,panelIndex:k})},[p,b]),D=x.useCallback(S=>{const{layout:P,panelDataArray:A}=w.current,{collapsedSize:k=0,collapsible:I,panelSize:E}=Se(A,S,P);return T(E!=null,`Panel size not found for panel "${S.id}"`),I===!0&&xe(E,k)},[]),L=x.useCallback(S=>{const{layout:P,panelDataArray:A}=w.current,{collapsedSize:k=0,collapsible:I,panelSize:E}=Se(A,S,P);return T(E!=null,`Panel size not found for panel "${S.id}"`),!I||Ne(E,k)>0},[]),Z=x.useCallback(S=>{const{panelDataArray:P}=w.current;P.push(S),P.sort((A,k)=>{const I=A.order,E=k.order;return I==null&&E==null?0:I==null?-1:E==null?1:I-E}),w.current.panelDataArrayChanged=!0,y()},[y]);je(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:P,storage:A}=C.current,{layout:k,panelDataArray:I}=w.current;let E=null;if(S){const K=nr(S,I,A);K&&(z.current=new Map(Object.entries(K.expandToSizes)),E=K.layout)}E==null&&(E=Qa({panelDataArray:I}));const U=Gt({layout:E,panelConstraints:I.map(K=>K.constraints)});Bt(k,U)||(g(U),w.current.layout=U,P&&P(U),Te(I,U,j.current))}}),je(()=>{const S=w.current;return()=>{S.layout=[]}},[]);const B=x.useCallback(S=>{let P=!1;const A=h.current;return A&&window.getComputedStyle(A,null).getPropertyValue("direction")==="rtl"&&(P=!0),function(I){I.preventDefault();const E=h.current;if(!E)return()=>null;const{direction:U,dragState:K,id:ne,keyboardResizeBy:oe,onLayout:G}=C.current,{layout:ee,panelDataArray:ce}=w.current,{initialLayout:me}=K??{},ue=Bn(ne,S,E);let X=Ja(I,S,U,K,oe,E);const pe=U==="horizontal";pe&&P&&(X=-X);const ge=ce.map(be=>be.constraints),fe=Ge({delta:X,initialLayout:me??ee,panelConstraints:ge,pivotIndices:ue,prevLayout:ee,trigger:$n(I)?"keyboard":"mouse-or-touch"}),he=!nt(ee,fe);(Mn(I)||En(I))&&_.current!=X&&(_.current=X,!he&&X!==0?pe?St(S,X<0?An:Dn):St(S,X<0?Tn:Ln):St(S,0)),he&&(g(fe),w.current.layout=fe,G&&G(fe),Te(ce,fe,j.current))}},[]),F=x.useCallback((S,P)=>{const{onLayout:A}=C.current,{layout:k,panelDataArray:I}=w.current,E=I.map(ee=>ee.constraints),{panelSize:U,pivotIndices:K}=Se(I,S,k);T(U!=null,`Panel size not found for panel "${S.id}"`);const oe=Le(I,S)===I.length-1?U-P:P-U,G=Ge({delta:oe,initialLayout:k,panelConstraints:E,pivotIndices:K,prevLayout:k,trigger:"imperative-api"});nt(k,G)||(g(G),w.current.layout=G,A&&A(G),Te(I,G,j.current))},[]),W=x.useCallback((S,P)=>{const{layout:A,panelDataArray:k}=w.current,{collapsedSize:I=0,collapsible:E}=P,{collapsedSize:U=0,collapsible:K,maxSize:ne=100,minSize:oe=0}=S.constraints,{panelSize:G}=Se(k,S,A);G!=null&&(E&&K&&xe(G,I)?xe(I,U)||F(S,U):G<oe?F(S,oe):G>ne&&F(S,ne))},[F]),te=x.useCallback((S,P)=>{const{direction:A}=C.current,{layout:k}=w.current;if(!h.current)return;const I=ft(S,h.current);T(I,`Drag handle element not found for id "${S}"`);const E=Gn(A,P);v({dragHandleId:S,dragHandleRect:I.getBoundingClientRect(),initialCursorPosition:E,initialLayout:k})},[]),J=x.useCallback(()=>{v(null)},[]),re=x.useCallback(S=>{const{panelDataArray:P}=w.current,A=Le(P,S);A>=0&&(P.splice(A,1),delete j.current[S.id],w.current.panelDataArrayChanged=!0,y())},[y]),q=x.useMemo(()=>({collapsePanel:O,direction:s,dragState:p,expandPanel:M,getPanelSize:R,getPanelStyle:$,groupId:u,isPanelCollapsed:D,isPanelExpanded:L,reevaluatePanelConstraints:W,registerPanel:Z,registerResizeHandle:B,resizePanel:F,startDragging:te,stopDragging:J,unregisterPanel:re,panelGroupElement:h.current}),[O,p,s,M,R,$,u,D,L,W,Z,B,F,te,J,re]),Q={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return x.createElement(ct.Provider,{value:q},x.createElement(m,{...f,children:e,className:n,id:a,ref:h,style:{...Q,...d},[Y.group]:"",[Y.groupDirection]:s,[Y.groupId]:u}))}const Zn=x.forwardRef((t,e)=>x.createElement(Kn,{...t,forwardedRef:e}));Kn.displayName="PanelGroup";Zn.displayName="forwardRef(PanelGroup)";function Le(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function Se(t,e,n){const s=Le(t,e),a=s===t.length-1?[s-1,s]:[s,s+1],l=n[s];return{...e.constraints,panelSize:l,pivotIndices:a}}function ar({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:s}){x.useEffect(()=>{if(t||n==null||s==null)return;const o=ft(e,s);if(o==null)return;const a=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),n(l);break}case"F6":{l.preventDefault();const i=o.getAttribute(Y.groupId);T(i,`No group element found for id "${i}"`);const c=Fe(i,s),d=Hn(i,e,s);T(d!==null,`No resize element found for id "${e}"`);const m=l.shiftKey?d>0?d-1:c.length-1:d+1<c.length?d+1:0;c[m].focus();break}}};return o.addEventListener("keydown",a),()=>{o.removeEventListener("keydown",a)}},[s,t,e,n])}function qn({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:s,id:o,onBlur:a,onClick:l,onDragging:i,onFocus:c,onPointerDown:d,onPointerUp:m,style:f={},tabIndex:u=0,tagName:h="div",...p}){var v,b;const g=x.useRef(null),y=x.useRef({onClick:l,onDragging:i,onPointerDown:d,onPointerUp:m});x.useEffect(()=>{y.current.onClick=l,y.current.onDragging=i,y.current.onPointerDown=d,y.current.onPointerUp=m});const j=x.useContext(ct);if(j===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:z,groupId:_,registerResizeHandle:C,startDragging:w,stopDragging:O,panelGroupElement:M}=j,R=kt(o),[$,D]=x.useState("inactive"),[L,Z]=x.useState(!1),[B,F]=x.useState(null),W=x.useRef({state:$});je(()=>{W.current.state=$}),x.useEffect(()=>{if(n)F(null);else{const q=C(R);F(()=>q)}},[n,R,C]);const te=(v=s?.coarse)!==null&&v!==void 0?v:15,J=(b=s?.fine)!==null&&b!==void 0?b:5;x.useEffect(()=>{if(n||B==null)return;const q=g.current;T(q,"Element ref not attached");let Q=!1;return Wa(R,q,z,{coarse:te,fine:J},(P,A,k)=>{if(!A){D("inactive");return}switch(P){case"down":{D("drag"),Q=!1,T(k,'Expected event to be defined for "down" action'),w(R,k);const{onDragging:I,onPointerDown:E}=y.current;I?.(!0),E?.();break}case"move":{const{state:I}=W.current;Q=!0,I!=="drag"&&D("hover"),T(k,'Expected event to be defined for "move" action'),B(k);break}case"up":{D("hover"),O();const{onClick:I,onDragging:E,onPointerUp:U}=y.current;E?.(!1),U?.(),Q||I?.();break}}})},[te,z,n,J,C,R,B,w,O]),ar({disabled:n,handleId:R,resizeHandler:B,panelGroupElement:M});const re={touchAction:"none",userSelect:"none"};return x.createElement(h,{...p,children:t,className:e,id:o,onBlur:()=>{Z(!1),a?.()},onFocus:()=>{Z(!0),c?.()},ref:g,role:"separator",style:{...re,...f},tabIndex:u,[Y.groupDirection]:z,[Y.groupId]:_,[Y.resizeHandle]:"",[Y.resizeHandleActive]:$==="drag"?"pointer":L?"keyboard":void 0,[Y.resizeHandleEnabled]:!n,[Y.resizeHandleId]:R,[Y.resizeHandleState]:$})}qn.displayName="PanelResizeHandle";function rr(t){const e=N.c(8);let n,s;e[0]!==t?({className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]);let o;e[3]!==n?(o=H("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==s||e[6]!==o?(a=r.jsx(Zn,{"data-slot":"resizable-panel-group",className:o,...s}),e[5]=s,e[6]=o,e[7]=a):a=e[7],a}function Yn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=r.jsx(Pn,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=s):s=e[3],s}function lr(t){const e=N.c(12);let n,s,o;e[0]!==t?({withHandle:o,className:n,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=o):(n=e[1],s=e[2],o=e[3]);let a;e[4]!==n?(a=H("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=a):a=e[5];let l;e[6]!==o?(l=o&&r.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:r.jsx(cn,{className:"size-2.5"})}),e[6]=o,e[7]=l):l=e[7];let i;return e[8]!==s||e[9]!==a||e[10]!==l?(i=r.jsx(qn,{"data-slot":"resizable-handle",className:a,...s,children:l}),e[8]=s,e[9]=a,e[10]=l,e[11]=i):i=e[11],i}function Xn(){const t=N.c(3),{toggleSidebar:e}=_t();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(fn,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:20}),t[0]=n):n=t[0];let s;return t[1]!==e?(s=r.jsx(r.Fragment,{children:r.jsx(Ce,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:n})}),t[1]=e,t[2]=s):s=t[2],s}Xn.Skeleton=function(){return r.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})};const ir="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function Vt(t){const e=N.c(18),{showSidebarToggle:n,showOrgSwitcher:s,showDecoChat:o}=t,a=n===void 0?!1:n,l=s===void 0?!1:s,i=o===void 0?!1:o,[,c]=zt();let d;e[0]!==c?(d=()=>c(cr),e[0]=c,e[1]=d):d=e[1];const m=d;let f;e[2]!==a?(f=a&&r.jsx(tt.Sidebar,{children:r.jsx(Xn,{})}),e[2]=a,e[3]=f):f=e[3];let u;e[4]!==l?(u=l&&r.jsx(x.Suspense,{fallback:r.jsx(Ct.Skeleton,{}),children:r.jsx(Ct,{})}),e[4]=l,e[5]=u):u=e[5];let h;e[6]!==u?(h=r.jsx(tt.Left,{children:u}),e[6]=u,e[7]=h):h=e[7];let p;e[8]!==i||e[9]!==m?(p=i&&r.jsxs(Ce,{size:"sm",variant:"default",onClick:m,children:[r.jsx(Ue,{url:ir,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[8]=i,e[9]=m,e[10]=p):p=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(Na,{}),e[11]=v):v=e[11];let b;e[12]!==p?(b=r.jsxs(tt.Right,{className:"gap-2",children:[p,v]}),e[12]=p,e[13]=b):b=e[13];let g;return e[14]!==b||e[15]!==f||e[16]!==h?(g=r.jsxs(tt,{children:[f,h,b]}),e[14]=b,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function cr(t){return!t}function dr(t){const e=N.c(10),{children:n,className:s}=t,[,o]=x.useTransition();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=Ze.decoChatPanelWidth(),e[0]=a):a=e[0];const[l,i]=Be(a,30);let c;e[1]!==i?(c=u=>o(()=>i(u)),e[1]=i,e[2]=c):c=e[2];const d=c;let m;e[3]!==s?(m=H("min-w-0",s),e[3]=s,e[4]=m):m=e[4];let f;return e[5]!==l||e[6]!==n||e[7]!==d||e[8]!==m?(f=r.jsx(Yn,{defaultSize:l,minSize:20,className:m,onResize:d,children:n}),e[5]=l,e[6]=n,e[7]=d,e[8]=m,e[9]=f):f=e[9],f}function ur(t){const e=N.c(5),{children:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Ze.sidebarOpen(),e[0]=s):s=e[0];const[o,a]=Be(s,!0);let l;return e[1]!==n||e[2]!==a||e[3]!==o?(l=r.jsx($o,{open:o,onOpenChange:a,children:n}),e[1]=n,e[2]=a,e[3]=o,e[4]=l):l=e[4],l}function fr(){const t=N.c(9),[e]=zt();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(Yn,{className:"bg-background",children:r.jsx(Zt,{})}),t[0]=n):n=t[0];let s;t[1]!==e?(s=r.jsx(lr,{withHandle:e}),t[1]=e,t[2]=s):s=t[2];const o=e?"max-w-none":"max-w-0";let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx(Jt,{children:r.jsx(x.Suspense,{fallback:r.jsx(Gs,{}),children:r.jsx(ho,{})})}),t[3]=a):a=t[3];let l;t[4]!==o?(l=r.jsx(dr,{className:o,children:a}),t[4]=o,t[5]=l):l=t[5];let i;return t[6]!==s||t[7]!==l?(i=r.jsxs(rr,{direction:"horizontal",children:[n,s,l]}),t[6]=s,t[7]=l,t[8]=i):i=t[8],i}function mr(){const t=N.c(19);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=Ft(e);let s;t[1]!==n?(s=vs.activeOrganization(n),t[1]=n,t[2]=s):s=t[2];let o;t[3]!==n?(o=async()=>{if(!n)return null;const{data:h}=await Ke.organization.setActive({organizationSlug:n});return{org:h,project:{slug:Ps}}},t[3]=n,t[4]=o):o=t[4];let a;t[5]!==s||t[6]!==o?(a={queryKey:s,queryFn:o,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=s,t[6]=o,t[7]=a):a=t[7];const{data:l}=bs(a);if(!l){let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h=r.jsx(Vt,{}),t[8]=h):h=t[8];let p;return t[9]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsxs("div",{className:"min-h-screen bg-background",children:[h,r.jsx("div",{className:"pt-12",children:r.jsx(Zt,{})})]}),t[9]=p):p=t[9],p}let i;t[10]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Vt,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=i):i=t[10];let c;t[11]===Symbol.for("react.memo_cache_sentinel")?(c={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=c):c=t[11];let d;t[12]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx(qo,{}),t[12]=d):d=t[12];let m;t[13]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(ur,{children:r.jsxs("div",{className:"flex flex-col h-screen",children:[i,r.jsxs(Ro,{className:"flex-1 bg-sidebar",style:c,children:[d,r.jsx(Do,{className:"pt-12",children:r.jsx(fr,{})})]})]})}),t[13]=m):m=t[13];let f;t[14]!==l.org.slug?(f=r.jsx(ao,{children:m},l.org.slug),t[14]=l.org.slug,t[15]=f):f=t[15];let u;return t[16]!==l||t[17]!==f?(u=r.jsx(ks,{...l,children:f}),t[16]=l,t[17]=f,t[18]=u):u=t[18],u}function el(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(za,{children:r.jsx(x.Suspense,{fallback:r.jsx(Kt,{}),children:r.jsx(mr,{})})}),t[0]=e):e=t[0],e}export{el as default};
@@ -1 +0,0 @@
1
- import{r as q,c as _,j as s,f as ve,d as ke,b as Se,a as Ie,t as he}from"./index-BXYAUeFB.js";import{i as _e}from"./AlertCircle-DXrRWAdV.js";import{i as je}from"./Loading01-BWm5a2UX.js";import{B as ie}from"./button-WiHHb1ae.js";import{i as Le}from"./ArrowLeft-B2kSl8Am.js";import{I as ye,a as Ae,u as De,b as Ee,c as Me}from"./use-connection-DcTy916p.js";import{i as Ue}from"./CheckCircle-BjfQSM1r.js";import{t as Ve}from"./ChevronDown-LB39JZIr.js";import{s as ge}from"./Plus-Slubr3Mn.js";import{b as $e,D as Pe,a as Re,c as ze}from"./dropdown-menu-24ciec9y.js";import{n as be}from"./LinkExternal01-BWsuTDiz.js";import{E as Be}from"./SearchMd-D-BfTFbd.js";import{R as Ge,T as Fe,a as Oe}from"./resource-tabs-BwUWNlYE.js";import{a as He}from"./use-binding-BgnJVxG_.js";import{u as We}from"./use-tool-call-BWqj0h3N.js";import{u as Ke}from"./use-mcp-CiOCImLK.js";import{u as Ne}from"./tooltip-Dgdin-_i.js";import{e as Ze}from"./extract-connection-data-BDRFIBL1.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{f as Je,e as Qe,b as Xe,c as Ye,g as et}from"./registry-utils-ulDDT0d8.js";import{e as tt}from"./app-name-gTETL9So.js";import{i as st}from"./InfoCircle-D7V0pgdh.js";import"./utils-D2m6QoGq.js";import"./Grid01-irgYf3_6.js";import"./useQuery-C_tbj2zS.js";import"./File06-88jNCz1V.js";import"./collection-display-button-C_wVSNLi.js";import"./collection-search-ByjFbpzN.js";import"./input-BElOouK2.js";import"./collection-table-wrapper-PcMFmqtb.js";import"./card-BCizSi8r.js";import"./layout-BDLGK1gR.js";import"./badge-CuERIkGI.js";import"./auth-g7Ue41hR.js";import"./generate-id-Dyweu44Y.js";const we=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));we.displayName="SearchLg";function ot(t){const e=_.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(je,{size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function rt(t){const e=_.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(_e,{size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function nt(t){const e=_.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=d):d=e[4],d}function it(t){const e=_.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Le,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function lt(t){const e=_.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=q.useState(0);let x;e[0]!==r?(x=S=>{p(S),r(S)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ye,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs($e,{children:[s.jsx(Pe,{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(Re,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((S,C)=>{const I=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(ze,{onClick:()=>f(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(Ue,{size:16,className:"text-muted-foreground shrink-0"})]})},C)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let w;e[19]!==y||e[20]!==N?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=w):w=e[21];let k;return e[22]!==h||e[23]!==w?(k=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,w]}),e[22]=h,e[23]=w,e[24]=k):k=e[24],k}function at(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function ct(t){const e=_.c(45),{data:o,publisherInfo:n,selectedItem:r}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ye,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(be,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let w;e[27]!==o.repository?(w=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(be,{size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let k;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,w]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=w,e[34]=k):k=e[34];let S;e[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=S):S=e[35];let C;e[36]!==r.updated_at?(C=at(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let I;e[38]!==C?(I=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[S,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=I):I=e[39];let u;return e[40]!==i||e[41]!==k||e[42]!==I||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,k,I]}),e[40]=i,e[41]=k,e[42]=I,e[43]=h,e[44]=u):u=e[44],u}function dt(t){const e=_.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(mt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Ge,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Fe,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Be,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Oe,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function mt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ft(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function ut(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function pt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=Xe(r.remotes?.[0]?.type),d=Ye(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=et(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:tt(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class xt extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(rt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ht(){const t=_.c(70),{org:e}=Ne(),o=ve();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=ke(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Se(i),[l,m]=q.useState("readme"),p=Ae(),x=De(),{data:f}=Ie.useSession(),h=He(x),g=d||h[0]?.id||"",b=Ee(g),y=Je(b?.tools),N=b?.tools&&b.tools.find(yt)?.name||"",w=b?.tools&&b.tools.find(jt)?.name||"",k=Me(g),S=!!a;let C,I;S?(C=N||w,I={name:a}):(C=y,I={});const{data:u}=We({toolCaller:k,toolName:C,toolInputParams:I,scope:g});let E=[],L=[],pe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(pe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",M=c.server,U=c._meta;let D;t[2]!==c.title||t[3]!==T||t[4]!==M||t[5]!==U?(D=[{id:T,title:c.title,server:M,_meta:U}],t[2]=c.title,t[3]=T,t[4]=M,t[5]=U,t[6]=D):D=t[6],E=D}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(T=>Array.isArray(u[T])),c&&(E=u[c],(c==="versions"||C?.includes("VERSIONS"))&&(L=E))}}let X;t[7]!==r?(X=c=>{const T=c.name||c.title||c.server.title||"";return qe(T)===r},t[7]=r,t[8]=X):X=t[8];let j=E.find(X);if(!j&&a){let c;t[9]!==a?(c=T=>T.server.name===a||T.name===a||T.title===a,t[9]=a,t[10]=c):c=t[10],j=E.find(c)}const v=j?pt(j):null,le=(v?.tools?.length||0)>0,ae=j?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ke({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(vt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const xe=ee,V=le?v?.tools||[]:xe,Ce=ft(x,v?.publisher),ce=v?ut(E,v.publisher,Ce,b??null,pe):{count:0},Te=v?.repository?Qe(v.repository):null,de=!!v?.repository&&!!Te;let $;t[14]!==de?($={id:"readme",label:"README",visible:de},t[14]=de,t[15]=$):$=t[15];const me=le||xe.length>0||Y&&!!ae;let P;t[16]!==V.length||t[17]!==me?(P={id:"tools",label:"Tools",count:V.length,visible:me},t[16]=V.length,t[17]=me,t[18]=P):P=t[18];let te;t[19]!==$||t[20]!==P?(te=[$,P].filter(bt),t[19]=$,t[20]=P,t[21]=te):te=t[21];const A=te;let se;t[22]!==l||t[23]!==A?(se=A.find(c=>c.id===l)?l:A.find(gt)?.id||A[0]?.id||"overview",t[22]=l,t[23]=A,t[24]=se):se=t[24];const fe=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const T=L[c??0]||j;if(!T||!e||!f?.user?.id)return;const M=Ze(T,e.id,f.user.id);if(!M.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:U}=await p.create.mutateAsync(M);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:U}})}catch(U){const D=U;he.error(`Failed to connect MCP Server: ${D instanceof Error?D.message:String(D)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const ue=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const R=re;if(!j){let c;return t[35]!==R?(c=s.jsx(nt,{onBack:R}),t[35]=R,t[36]=c):c=t[36],c}if(!v)return null;const z=(j?.server?.remotes?.length??0)>0;let B;t[37]!==R?(B=s.jsx(it,{onBack:R}),t[37]=R,t[38]=B):B=t[38];let G;t[39]!==z?(G=!z&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=z,t[40]=G):G=t[40];let F;t[41]!==L||t[42]!==j?(F=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=F):F=t[43];let O;t[44]!==p.create.isPending||t[45]!==z||t[46]!==v||t[47]!==ue||t[48]!==F?(O=s.jsx(lt,{data:v,itemVersions:F,onInstall:ue,canInstall:z,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=z,t[46]=v,t[47]=ue,t[48]=F,t[49]=O):O=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==j?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:j}),t[50]=v,t[51]=ce,t[52]=j,t[53]=H):H=t[53];let W;t[54]!==A||t[55]!==v||t[56]!==fe||t[57]!==V||t[58]!==Y?(W=s.jsx(dt,{data:v,availableTabs:A,effectiveActiveTabId:fe,effectiveTools:V,isLoadingTools:Y,onTabChange:m}),t[54]=A,t[55]=v,t[56]=fe,t[57]=V,t[58]=Y,t[59]=W):W=t[59];let K;t[60]!==H||t[61]!==W?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,W]}),t[60]=H,t[61]=W,t[62]=K):K=t[62];let Z;t[63]!==G||t[64]!==O||t[65]!==K?(Z=s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[G,O,K]})})}),t[63]=G,t[64]=O,t[65]=K,t[66]=Z):Z=t[66];let ne;return t[67]!==B||t[68]!==Z?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[B,Z]}),t[67]=B,t[68]=Z,t[69]=ne):ne=t[69],ne}function gt(t){return t.id==="readme"}function bt(t){return t.visible}function vt(t){return{name:t.name,description:t.description}}function jt(t){return t.name.endsWith("_GET")}function yt(t){return t.name.endsWith("_VERSIONS")}function os(){const t=_.c(6),{org:e}=Ne(),o=ve();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(ht,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(xt,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{os as default};
@@ -1 +0,0 @@
1
- import{c as f,q,K}from"./index-BXYAUeFB.js";function S(p){const e=f.c(23);let s,o,r,t,l;e[0]!==p?({toolCaller:r,toolName:l,toolInputParams:t,scope:o,...s}=p,e[0]=p,e[1]=s,e[2]=o,e[3]=r,e[4]=t,e[5]=l):(s=e[1],o=e[2],r=e[3],t=e[4],l=e[5]);let a,u,i,c;if(e[6]!==s||e[7]!==o||e[8]!==t||e[9]!==l){const y=JSON.stringify(t);c=q,a=s,u=s.staleTime??6e4,i=K.toolCall(o,l,y),e[6]=s,e[7]=o,e[8]=t,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=c}else a=e[10],u=e[11],i=e[12],c=e[13];let n;e[14]!==r||e[15]!==t||e[16]!==l?(n=async()=>await r(l,t),e[14]=r,e[15]=t,e[16]=l,e[17]=n):n=e[17];let m;return e[18]!==a||e[19]!==u||e[20]!==i||e[21]!==n?(m={...a,staleTime:u,queryKey:i,queryFn:n},e[18]=a,e[19]=u,e[20]=i,e[21]=n,e[22]=m):m=e[22],c(m)}export{S as u};
@@ -1 +0,0 @@
1
- import{at as u,ap as s}from"./index-BXYAUeFB.js";function t(e,r){return u(e,s,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{br as t,V as c}from"./index-BXYAUeFB.js";function n(...r){return t(c(r))}export{n as c};