@decocms/mesh 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/client/assets/{AlertCircle-D8Ig6VmI.js → AlertCircle-CDBVDe0k.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Dh26Pdy9.js → ArrowLeft-DFGZNglp.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-ePEWgGNp.js → ChevronDown-J5kG25Eb.js} +1 -1
  4. package/dist/client/assets/{Clock-D62M1TNS.js → Clock-DHu_WP-M.js} +1 -1
  5. package/dist/client/assets/{Code01-CEpWMfIN.js → Code01-DNE-ZRGg.js} +1 -1
  6. package/dist/client/assets/{Copy01-Do_2DOpc.js → Copy01-Uz7Y-mCe.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-MwRKuQCg.js → CpuChip02-BZhOPL9W.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-DEHJGPWq.js → DotsVertical-BrsQ60f-.js} +1 -1
  9. package/dist/client/assets/{File06-C6gmiM2R.js → File06-Ck3q99hQ.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-C_yTzrjj.js → FlipBackward-DRZcK_so.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-BytyqHyB.js → GitBranch01-Ckh6pQzg.js} +1 -1
  12. package/dist/client/assets/{Grid01-C9Qy-QMm.js → Grid01-tUtWO5Nq.js} +1 -1
  13. package/dist/client/assets/{Inbox01-D6ujw7pC.js → Inbox01-CDvT2NLz.js} +1 -1
  14. package/dist/client/assets/{Key01-DyKOY05D.js → Key01-BkJiKyNj.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-R8UsBwpd.js → LinkExternal01-gFlbmLX6.js} +1 -1
  16. package/dist/client/assets/{Loading01-CYe6KHQ_.js → Loading01-BLF74gg8.js} +1 -1
  17. package/dist/client/assets/{Lock01-V21nJrKX.js → Lock01-CGIiadcu.js} +1 -1
  18. package/dist/client/assets/{Play-BbVWnniF.js → Play-C0JCKXwR.js} +1 -1
  19. package/dist/client/assets/{Plus-B_341Z-m.js → Plus-gH2EjvYq.js} +1 -1
  20. package/dist/client/assets/{SearchMd-CTe41Otq.js → SearchMd-BCHUfnJ5.js} +1 -1
  21. package/dist/client/assets/{Terminal-D1uJm4u2.js → Terminal-B5YsmaiW.js} +1 -1
  22. package/dist/client/assets/{Trash01-nRDGqZAh.js → Trash01-C2xlW91R.js} +1 -1
  23. package/dist/client/assets/{X-SbhTNlq-.js → X-DfhX7U4l.js} +1 -1
  24. package/dist/client/assets/{XClose-UocnKXyW.js → XClose-CYrpEX3L.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-BU4z5vIU.js → alert-dialog-DC6YZ-if.js} +1 -1
  26. package/dist/client/assets/{auth-DrOI2Q5h.js → auth-Ct5zHF6G.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-hi9HLq14.js → auth-catchall-DGSZOhwE.js} +1 -1
  28. package/dist/client/assets/{avatar-DYifUjuR.js → avatar-C2QUw41P.js} +1 -1
  29. package/dist/client/assets/{badge-0sGir89N.js → badge-BPanR0Qr.js} +1 -1
  30. package/dist/client/assets/{button-DekBQWZX.js → button-DesSvxFG.js} +1 -1
  31. package/dist/client/assets/{card-CjPFi-mt.js → card-CKc-r-kb.js} +1 -1
  32. package/dist/client/assets/{checkbox-DWBjIr3c.js → checkbox-DfamRgjV.js} +1 -1
  33. package/dist/client/assets/{collection-detail-CFyCCxRq.js → collection-detail-Dfv17pDZ.js} +1 -1
  34. package/dist/client/assets/{collection-display-button-CcmMGuN1.js → collection-display-button-CscS9LT8.js} +1 -1
  35. package/dist/client/assets/{collection-header-BzcsMkVk.js → collection-header-DGeWxmcL.js} +1 -1
  36. package/dist/client/assets/{collection-page-JhE-nlZe.js → collection-page-XmmReL6Z.js} +1 -1
  37. package/dist/client/assets/{collection-search-D31FObj2.js → collection-search-CLDB986-.js} +1 -1
  38. package/dist/client/assets/{collection-tab-CislJm1o.js → collection-tab-CUwvKz8k.js} +1 -1
  39. package/dist/client/assets/{collection-table-wrapper-DttYG93Q.js → collection-table-wrapper-DEXRMixQ.js} +1 -1
  40. package/dist/client/assets/{connection-card-Po1O1myw.js → connection-card-PeOblHZK.js} +1 -1
  41. package/dist/client/assets/{connection-detail-CCe4qpmo.js → connection-detail-Bm9AbLXX.js} +1 -1
  42. package/dist/client/assets/{connections-CAn295jL.js → connections-B3R_ztXH.js} +1 -1
  43. package/dist/client/assets/constants-DB2tAnFa.js +1 -0
  44. package/dist/client/assets/{core-CQOpJFuu.js → core-DgwSzEjp.js} +1 -1
  45. package/dist/client/assets/create-organization-dialog-DHY_jhNg.js +1 -0
  46. package/dist/client/assets/{dialog-B48I0mf9.js → dialog-B_SDyKoG.js} +1 -1
  47. package/dist/client/assets/{dropdown-menu-DEOghZY2.js → dropdown-menu-BjkPhTxJ.js} +1 -1
  48. package/dist/client/assets/{empty-state-DPKHlkpV.js → empty-state-BZJRRGAZ.js} +1 -1
  49. package/dist/client/assets/{env-vars-editor-siosgJYU.js → env-vars-editor-DiG_mhOk.js} +1 -1
  50. package/dist/client/assets/{error-boundary-BU7ytqKh.js → error-boundary-eKHB9m_N.js} +1 -1
  51. package/dist/client/assets/{extract-connection-data-CNwfi3Bj.js → extract-connection-data-CfTRYlDo.js} +1 -1
  52. package/dist/client/assets/{form-idjG_l3J.js → form-DqF9jJxB.js} +1 -1
  53. package/dist/client/assets/{formatDistanceToNow-BvbEbggm.js → formatDistanceToNow-C_-z9n_P.js} +1 -1
  54. package/dist/client/assets/gateway-detail-DkIgdk5X.js +1 -0
  55. package/dist/client/assets/{gateways-BMARnVs9.js → gateways-P2IDmIpS.js} +1 -1
  56. package/dist/client/assets/{home-C44O4JPT.js → home-B4iTt93_.js} +1 -1
  57. package/dist/client/assets/{index-DRz67w4F.js → index-BwcL2gOd.js} +1 -1
  58. package/dist/client/assets/{index-Wt1f1puE.js → index-C-gV8ErA.js} +2 -2
  59. package/dist/client/assets/{index-IR-O--2-.js → index-CMmPiJga.js} +1 -1
  60. package/dist/client/assets/{index-DajdRBtQ.js → index-cfS08Oty.js} +1 -1
  61. package/dist/client/assets/{input-BKIlqldN.js → input-t-sIzYQ-.js} +1 -1
  62. package/dist/client/assets/json-Tk1HfYpB.js +1 -0
  63. package/dist/client/assets/{json-syntax-highlighter-iaFBJPMB.js → json-syntax-highlighter-o3bCpHQQ.js} +2 -2
  64. package/dist/client/assets/{layout-DZ2ngf-d.js → layout-C740ESgM.js} +1 -1
  65. package/dist/client/assets/{lazy-highlighter-DzPyG_7U.js → lazy-highlighter-Bp3eoyLz.js} +1 -1
  66. package/dist/client/assets/{localstorage-keys-DywUtnFx.js → localstorage-keys-C7qJ8rEC.js} +1 -1
  67. package/dist/client/assets/{login-DV7ZXMS3.js → login-1u7Niwbj.js} +1 -1
  68. package/dist/client/assets/{mcp-oauth-CoHdTRs8.js → mcp-oauth-BQdelTeI.js} +1 -1
  69. package/dist/client/assets/{members-BSXMpEiy.js → members-BpBTDEqI.js} +1 -1
  70. package/dist/client/assets/{monitoring-jd56r5aO.js → monitoring-BniHbswu.js} +1 -1
  71. package/dist/client/assets/{oauth-callback-DWPZPLpo.js → oauth-callback-BdJJVZpw.js} +1 -1
  72. package/dist/client/assets/{page-8jW60JQy.js → page-C3OoVTcz.js} +1 -1
  73. package/dist/client/assets/{pin-to-sidebar-button-kBAZ-5ye.js → pin-to-sidebar-button-CAIx34vr.js} +1 -1
  74. package/dist/client/assets/{popover-BOM-Ldjy.js → popover-BdF29fF0.js} +1 -1
  75. package/dist/client/assets/prism-light-BRrm9qbv.js +1 -0
  76. package/dist/client/assets/{resizable-CJZIf7G0.js → resizable-C9hC2n0z.js} +1 -1
  77. package/dist/client/assets/{resource-tabs-Ce7H16gk.js → resource-tabs-BXrX5gUy.js} +1 -1
  78. package/dist/client/assets/{responsive-select-BwKgIRfG.js → responsive-select-2C4cD9rC.js} +1 -1
  79. package/dist/client/assets/{select-BfMeJf3G.js → select-xSuN7FaU.js} +1 -1
  80. package/dist/client/assets/{settings-3-JCtPNJ.js → settings-CduS7I01.js} +1 -1
  81. package/dist/client/assets/shell-layout-CrxADs5L.js +19 -0
  82. package/dist/client/assets/{spinner-DRqaN8gi.js → spinner-rwnNPEbM.js} +1 -1
  83. package/dist/client/assets/{store-Do1Cu7xx.js → store-SnbBtX3K.js} +1 -1
  84. package/dist/client/assets/{store-app-detail-CTTgc-e9.js → store-app-detail-BQeYehDl.js} +1 -1
  85. package/dist/client/assets/{switch-Dw1RG-3y.js → switch-D298--QC.js} +1 -1
  86. package/dist/client/assets/{textarea-Bft7ABhA.js → textarea-BJtQOXsW.js} +1 -1
  87. package/dist/client/assets/{thread-history-popover-Bi9mj2yY.js → thread-history-popover-CI8FqvYZ.js} +33 -33
  88. package/dist/client/assets/{tools-list-Ce6AdOzS.js → tools-list-BtBolbdP.js} +1 -1
  89. package/dist/client/assets/{tooltip-TfGvrkSe.js → tooltip-DEGW0fKm.js} +1 -1
  90. package/dist/client/assets/{types-Cnps3aja.js → types-oZbVAIZ8.js} +1 -1
  91. package/dist/client/assets/{use-binding-C0D0SiIL.js → use-binding-DcFA_gzK.js} +1 -1
  92. package/dist/client/assets/{use-connection-Bw5VjMDS.js → use-connection-DovW4k_Y.js} +1 -1
  93. package/dist/client/assets/{use-connection-resources-G46B63hU.js → use-connection-resources-DWvHSjwL.js} +1 -1
  94. package/dist/client/assets/{use-gateway-Bcu8DfzG.js → use-gateway-CTez9e6K.js} +1 -1
  95. package/dist/client/assets/{use-list-state-BFqdzcLT.js → use-list-state-BcLe4rFM.js} +1 -1
  96. package/dist/client/assets/{use-mcp-BQdB6WDZ.js → use-mcp-CFh-2cVi.js} +1 -1
  97. package/dist/client/assets/{use-members-Du1Rfr_g.js → use-members-vkmBD6ZK.js} +1 -1
  98. package/dist/client/assets/{use-mobile-DxFWm-MR.js → use-mobile-BnGwMIZ5.js} +1 -1
  99. package/dist/client/assets/{use-organization-settings-DNW7rc_y.js → use-organization-settings-qRiC51eG.js} +1 -1
  100. package/dist/client/assets/{use-tool-call-D3fXWIz8.js → use-tool-call-MqNkj4y0.js} +1 -1
  101. package/dist/client/assets/useQuery-D2RIkfap.js +1 -0
  102. package/dist/client/assets/{useSuspenseInfiniteQuery-BUiIWXaf.js → useSuspenseInfiniteQuery-ZXEiZMOu.js} +1 -1
  103. package/dist/client/assets/{view-mode-toggle-CP1Lj0do.js → view-mode-toggle-DeTt5Ewf.js} +1 -1
  104. package/dist/client/assets/{well-known-mcp-D13f-8h2.js → well-known-mcp-VNRT0JrW.js} +1 -1
  105. package/dist/client/assets/workflow-BEZiVLLT.js +1 -0
  106. package/dist/client/index.html +1 -1
  107. package/package.json +1 -1
  108. package/dist/client/assets/constants-BP-f87DW.js +0 -1
  109. package/dist/client/assets/create-organization-dialog-BHcS-HWr.js +0 -1
  110. package/dist/client/assets/gateway-detail-CojPNuj0.js +0 -1
  111. package/dist/client/assets/json-DJFsnV6J.js +0 -1
  112. package/dist/client/assets/prism-light-uO9D9BzO.js +0 -1
  113. package/dist/client/assets/shell-layout-CdWK4rD-.js +0 -19
  114. package/dist/client/assets/useQuery-xVxOaLKm.js +0 -1
  115. package/dist/client/assets/workflow-IxqE_uwj.js +0 -1
@@ -1 +0,0 @@
1
- import{r as z,c as B,j as t,f as et,d as gt,b as jt,v as bt,_ as qe,w as Ze,g as vt,af as yt,x as St,y as Ct,a as wt,t as Je}from"./index-Wt1f1puE.js";import{E as Nt}from"./SearchMd-CTe41Otq.js";import{E as Ye}from"./error-boundary-BU7ytqKh.js";import{I as Re,u as tt}from"./use-connection-Bw5VjMDS.js";import{T as _t,S as It}from"./switch-Dw1RG-3y.js";import{C as st}from"./checkbox-DWBjIr3c.js";import{c as le,B as X}from"./button-DekBQWZX.js";import{i as Tt}from"./ArrowLeft-Dh26Pdy9.js";import{C as kt}from"./collection-search-D31FObj2.js";import{I as Ke}from"./input-BKIlqldN.js";import{s as nt}from"./Plus-B_341Z-m.js";import{i as $t}from"./X-SbhTNlq-.js";import{b as Pt,a as zt}from"./use-gateway-Bcu8DfzG.js";import{u as Mt,a as Rt}from"./use-connection-resources-G46B63hU.js";import{u as ot,a as ie,c as re,b as ae,T as ce,i as Xe}from"./tooltip-TfGvrkSe.js";import{a as Et}from"./Copy01-Do_2DOpc.js";import{i as Qe}from"./CpuChip02-MwRKuQCg.js";import{i as At}from"./FlipBackward-C_yTzrjj.js";import{i as lt}from"./LinkExternal01-R8UsBwpd.js";import{i as Oe}from"./Loading01-CYe6KHQ_.js";import{F as ze,a as Ft,b as Ee,d as Ae,f as Fe,c as it}from"./form-idjG_l3J.js";import{S as rt,a as at,b as ct,c as dt,d as Me}from"./select-BfMeJf3G.js";import{R as Dt}from"./resource-tabs-Ce7H16gk.js";import{s as Gt}from"./slugify-CEUa2lfQ.js";import{P as Vt}from"./pin-to-sidebar-button-kBAZ-5ye.js";import{a as Ot,V as Bt,b as Lt}from"./layout-DZ2ngf-d.js";import{a as Ut,e as mt,T as Ht,C as oe,b as Wt,c as qt,u as Jt,U as Yt,d as Kt,I as Qt,M as Zt}from"./thread-history-popover-Bi9mj2yY.js";import{u as ut,L as ft}from"./localstorage-keys-DywUtnFx.js";import{f as Xt}from"./formatDistanceToNow-BvbEbggm.js";import"./ChevronDown-ePEWgGNp.js";import"./badge-0sGir89N.js";import"./use-organization-settings-DNW7rc_y.js";import"./use-binding-C0D0SiIL.js";import"./auth-DrOI2Q5h.js";import"./AlertCircle-D8Ig6VmI.js";import"./Grid01-C9Qy-QMm.js";import"./responsive-select-BwKgIRfG.js";import"./use-mobile-DxFWm-MR.js";import"./textarea-Bft7ABhA.js";import"./Terminal-D1uJm4u2.js";import"./connection-card-Po1O1myw.js";import"./card-CjPFi-mt.js";import"./json-syntax-highlighter-iaFBJPMB.js";import"./alert-dialog-BU4z5vIU.js";import"./File06-C6gmiM2R.js";import"./popover-BOM-Ldjy.js";import"./Clock-D62M1TNS.js";import"./Trash01-nRDGqZAh.js";import"./useQuery-xVxOaLKm.js";const ht=({size:n=24,color:e="currentColor",...s})=>z.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},z.createElement("path",{d:"M12 20h9M3 20h1.675c.489 0 .733 0 .964-.055.204-.05.399-.13.578-.24.201-.123.374-.296.72-.642L19.5 6.5a2.121 2.121 0 0 0-3-3L3.937 16.063c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.578c-.055.23-.055.475-.055.965V20Z"}));ht.displayName="Edit03";const xt=({size:n=24,color:e="currentColor",...s})=>z.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},z.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 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 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));xt.displayName="Save01";const es=z.memo(function(e){const s=B.c(20),{connection:o,isSelected:i,hasItemsEnabled:r,activeItemsCount:m,totalItemsCount:x,onSelect:d,onToggle:a}=e,c=i?"bg-accent/50":"hover:bg-muted/50";let f;s[0]!==c?(f=le("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),s[0]=c,s[1]=f):f=s[1];let h;s[2]!==o.icon||s[3]!==o.title?(h=t.jsx(Re,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=h):h=s[4];let j;s[5]!==o.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),s[5]=o.title,s[6]=j):j=s[6];let p;s[7]!==d||s[8]!==h||s[9]!==j?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:d,children:[h,j]}),s[7]=d,s[8]=h,s[9]=j,s[10]=p):p=s[10];let l;s[11]!==m||s[12]!==r||s[13]!==a||s[14]!==x?(l=x>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[m,"/",x]}),t.jsx(st,{checked:r,onCheckedChange:a,onClick:ss})]}),s[11]=m,s[12]=r,s[13]=a,s[14]=x,s[15]=l):l=s[15];let b;return s[16]!==f||s[17]!==p||s[18]!==l?(b=t.jsxs("div",{className:f,children:[p,l]}),s[16]=f,s[17]=p,s[18]=l,s[19]=b):b=s[19],b}),ts=z.memo(function(e){const s=B.c(18),{connectionId:o,item:i,isSelected:r,onToggle:m}=e,x=`item-${o}-${i.id}`,d=r?"text-foreground":"text-muted-foreground";let a;s[0]!==d?(a=le("text-sm font-medium",d),s[0]=d,s[1]=a):a=s[1];let c;s[2]!==i.name||s[3]!==a?(c=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:a,children:i.name})}),s[2]=i.name,s[3]=a,s[4]=c):c=s[4];let f;s[5]!==i.description?(f=i.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.description}),s[5]=i.description,s[6]=f):f=s[6];let h;s[7]!==c||s[8]!==f?(h=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,f]}),s[7]=c,s[8]=f,s[9]=h):h=s[9];const j=`item-${o}-${i.id}`;let p;s[10]!==r||s[11]!==m||s[12]!==j?(p=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(st,{id:j,checked:r,onCheckedChange:m,onClick:ns})}),s[10]=r,s[11]=m,s[12]=j,s[13]=p):p=s[13];let l;return s[14]!==x||s[15]!==h||s[16]!==p?(l=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:x,children:[h,p]}),s[14]=x,s[15]=h,s[16]=p,s[17]=l):l=s[17],l});function pt({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:i,extraContent:r}){const[m,x]=z.useState(""),d=z.useDeferredValue(m),[a,c]=z.useState("all"),[f,h]=z.useState(!1),j=z.useRef(new Set(Object.keys(n))),p=tt({searchTerm:d.trim()||void 0}),l=j.current,b=[...l.values()].map(u=>p.find(w=>w.id===u)).filter(u=>u!==void 0),y=p.filter(u=>!l.has(u.id)),N=[...b,...y],g=u=>{const w=n[u];return w!==void 0&&w.length>0},S=N.filter(u=>{if(a==="all")return!0;const w=g(u.id);return a==="selected"?w:a==="unselected"?!w:!0}),[C,_]=z.useState(N[0]?.id??null),v=C?N.find(u=>u.id===C)??null:null,E=v?s(v):[],F=(u,w)=>n[u]?.includes(w)??!1,D=(u,w)=>{const k=n[u]??[],M=k.includes(w),I={...n};if(M){const A=k.filter($=>$!==w);A.length===0?delete I[u]:I[u]=A}else I[u]=[...k,w];e(I)},L=u=>{const w=N.find(P=>P.id===u);if(!w)return;const k=s(w);if(k.length===0)return;const M=n[u]??[],I=k.map(P=>P.id),A=M.length>0&&I.every(P=>M.includes(P)),$={...n};A?delete $[u]:($[u]=I,_(u)),e($)},U=u=>{_(u),h(!0)},T=()=>{h(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:le("w-full md:w-80 border-r border-border flex flex-col",f&&"hidden md:flex"),children:[t.jsx(kt,{value:m,onChange:x,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>c("all"),className:le("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>c("selected"),className:le("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>c("unselected"),className:le("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:S.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:m?"No connections found":a==="selected"?"No servers selected":a==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:S.map(u=>{const k=s(u).length,M=n[u.id]?.length??0;return t.jsx(es,{connection:u,isSelected:C===u.id,hasItemsEnabled:g(u.id),activeItemsCount:M,totalItemsCount:k,onSelect:()=>U(u.id),onToggle:()=>L(u.id)},u.id)})})})]}),t.jsx("div",{className:le("flex-1 flex-col",f?"flex":"hidden md:flex"),children:v?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(X,{variant:"ghost",size:"sm",onClick:T,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(Tt,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Re,{icon:v.icon,name:v.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:v.title}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:v.description})]})]})]}),r,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:E.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:E.map(u=>t.jsx(ts,{connectionId:v.id,item:u,isSelected:F(v.id,u.id),onToggle:()=>D(v.id,u.id)},u.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function ss(n){return n.stopPropagation()}function ns(n){return n.stopPropagation()}function os(n){const e=B.c(6),{promptSet:s,onPromptSetChange:o,connectionPrompts:i}=n;let r;e[0]!==i?(r=d=>(i.get(d.id)??[]).map(ls),e[0]=i,e[1]=r):r=e[1];const m=r;let x;return e[2]!==m||e[3]!==o||e[4]!==s?(x=t.jsx(pt,{itemSet:s,onItemSetChange:o,getItems:m,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=m,e[3]=o,e[4]=s,e[5]=x):x=e[5],x}function ls(n){return{id:n.name,name:n.name,description:n.description}}function is(n){return n.includes("*")}function rs(n){const e=B.c(27),{patterns:s,onAddPattern:o,onRemovePattern:i}=n,[r,m]=z.useState("");let x;e[0]!==r||e[1]!==o||e[2]!==s?(x=()=>{const h=r.trim();h&&!s.includes(h)&&(o(h),m(""))},e[0]=r,e[1]=o,e[2]=s,e[3]=x):x=e[3];const d=x;let a;e[4]!==d?(a=h=>{h.key==="Enter"&&(h.preventDefault(),d())},e[4]=d,e[5]=a):a=e[5];const c=a;let f;if(e[6]!==d||e[7]!==c||e[8]!==r||e[9]!==i||e[10]!==s){const h=s.filter(is);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",j," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=p):p=e[13];let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=_=>m(_.target.value),e[14]=l):l=e[14];let b;e[15]!==c||e[16]!==r?(b=t.jsx(Ke,{value:r,onChange:l,onKeyDown:c,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=c,e[16]=r,e[17]=b):b=e[17];let y;e[18]!==r?(y=r.trim(),e[18]=r,e[19]=y):y=e[19];const N=!y;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(nt,{size:16}),e[20]=g):g=e[20];let S;e[21]!==d||e[22]!==N?(S=t.jsx(X,{type:"button",variant:"outline",size:"sm",onClick:d,disabled:N,children:g}),e[21]=d,e[22]=N,e[23]=S):S=e[23];let C;e[24]!==S||e[25]!==b?(C=t.jsxs("div",{className:"flex gap-2",children:[b,S]}),e[24]=S,e[25]=b,e[26]=C):C=e[26],f=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[p,C,h.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:h.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>i(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx($t,{size:12})})]},_))})]}),e[6]=d,e[7]=c,e[8]=r,e[9]=i,e[10]=s,e[11]=f}else f=e[11];return f}function as(n){const e=B.c(23),{resourceSet:s,onResourceSetChange:o,connectionResources:i}=n,[r]=z.useState(null);let m;e[0]!==i?(m=g=>(i.get(g.id)??[]).map(cs),e[0]=i,e[1]=m):m=e[1];const x=m;let d;e[2]!==o||e[3]!==s?(d=(g,S)=>{const C=s[g]??[];C.includes(S)||o({...s,[g]:[...C,S]})},e[2]=o,e[3]=s,e[4]=d):d=e[4];const a=d;let c;e[5]!==o||e[6]!==s?(c=(g,S)=>{const _=(s[g]??[]).filter(v=>v!==S);if(_.length===0){const v={...s};delete v[g],o(v)}else o({...s,[g]:_})},e[5]=o,e[6]=s,e[7]=c):c=e[7];const f=c;let h;e[8]!==o?(h=g=>{o(g)},e[8]=o,e[9]=h):h=e[9];const j=h;let p;e[10]!==s||e[11]!==r?(p=r?s[r]??[]:[],e[10]=s,e[11]=r,e[12]=p):p=e[12];const l=p;let b;e[13]!==a||e[14]!==f||e[15]!==r||e[16]!==l?(b=r?t.jsx(rs,{patterns:l,onAddPattern:g=>a(r,g),onRemovePattern:g=>f(r,g)}):null,e[13]=a,e[14]=f,e[15]=r,e[16]=l,e[17]=b):b=e[17];const y=b;let N;return e[18]!==y||e[19]!==x||e[20]!==j||e[21]!==s?(N=t.jsx("div",{className:"h-full",children:t.jsx(pt,{itemSet:s,onItemSetChange:j,getItems:x,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:y})}),e[18]=y,e[19]=x,e[20]=j,e[21]=s,e[22]=N):N=e[22],N}function cs(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}const ds="You are a helpful assistant. Please try answering the user's questions using your available tools.";function ms(n){const e=B.c(3),{gatewayId:s,onSelect:o}=n,{data:i}=Kt(s);if(i.length===0)return null;let r;return e[0]!==o||e[1]!==i?(r=t.jsx(Qt,{prompts:i,onSelect:o,className:"mt-6"}),e[0]=o,e[1]=i,e[2]=r):r=e[2],r}function us(n,e){return n.find(e)??n[0]}function fs(n,e,s,o){const i=B.c(9),r=null,[m,x]=ut(n,r);let d;i[0]!==s||i[1]!==m?(d=h=>m?s(h,m):!1,i[0]=s,i[1]=m,i[2]=d):d=i[2];let a;i[3]!==e||i[4]!==d?(a=us(e,d),i[3]=e,i[4]=d,i[5]=a):a=i[5];const c=a;let f;return i[6]!==c||i[7]!==x?(f=[c,x],i[6]=c,i[7]=x,i[8]=f):f=i[8],f}function hs(n){const s=new TextEncoder().encode(n),o=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(o)}function xs(n){const e=B.c(52),{serverName:s,gatewayUrl:o}=n,[i,r]=z.useState(!1),[m,x]=z.useState(null),d=Gt(s);let a,c,f,h;if(e[0]!==o||e[1]!==d){const V={type:"http",url:o},J={[d]:V};a=JSON.stringify(J,null,2);const H=se=>JSON.stringify({...V,headers:{"x-mesh-client":se}},null,2),te=hs(H("Cursor"));c=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(d)}&config=${encodeURIComponent(te)}`;const Y=H("Claude Code");f=d;let K;e[6]===Symbol.for("react.memo_cache_sentinel")?(K=/'/g,e[6]=K):K=e[6],h=Y.replace(K,"'\\''"),e[0]=o,e[1]=d,e[2]=a,e[3]=c,e[4]=f,e[5]=h}else a=e[2],c=e[3],f=e[4],h=e[5];const j=`claude mcp add "${f}" --config '${h}'`;let p;e[7]!==a?(p=async()=>{await navigator.clipboard.writeText(a),r(!0),Je.success("Configuration copied to clipboard"),setTimeout(()=>r(!1),2e3)},e[7]=a,e[8]=p):p=e[8];const l=p;let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=async(V,J)=>{await navigator.clipboard.writeText(V),x(J),Je.success(`${J} command copied`),setTimeout(()=>x(null),2e3)},e[9]=b):b=e[9];const y=b,N=ps;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=g):g=e[10];let S;e[11]!==i?(S=i?t.jsx(Xe,{size:14}):t.jsx(Et,{size:14}),e[11]=i,e[12]=S):S=e[12];let C;e[13]!==l||e[14]!==S?(C=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:l,children:S})}),e[13]=l,e[14]=S,e[15]=C):C=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ce,{children:"Copy configuration"}),e[16]=_):_=e[16];let v;e[17]!==C?(v=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(ie,{children:t.jsxs(re,{children:[C,_]})})}),e[17]=C,e[18]=v):v=e[18];let E;e[19]!==a||e[20]!==l?(E=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:l,children:a}),e[19]=a,e[20]=l,e[21]=E):E=e[21];let F;e[22]!==E||e[23]!==v?(F=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[v,E]}),e[22]=E,e[23]=v,e[24]=F):F=e[24];let D;e[25]!==c?(D=()=>N(c),e[25]=c,e[26]=D):D=e[26];let L,U;e[27]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),U=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=L,e[28]=U):(L=e[27],U=e[28]);let T;e[29]!==D?(T=t.jsx(ae,{asChild:!0,children:t.jsxs(X,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:D,children:[L,U]})}),e[29]=D,e[30]=T):T=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ce,{children:"Add to Cursor"}),e[31]=u):u=e[31];let w;e[32]!==T?(w=t.jsx(ie,{children:t.jsxs(re,{children:[T,u]})}),e[32]=T,e[33]=w):w=e[33];let k;e[34]!==j?(k=()=>y(j,"Claude"),e[34]=j,e[35]=k):k=e[35];let M,I;e[36]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),I=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=M,e[37]=I):(M=e[36],I=e[37]);let A;e[38]!==m?(A=m==="Claude"&&t.jsx(Xe,{size:14,className:"ml-2 text-green-500"}),e[38]=m,e[39]=A):A=e[39];let $;e[40]!==k||e[41]!==A?($=t.jsx(ae,{asChild:!0,children:t.jsxs(X,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:k,children:[M,I,A]})}),e[40]=k,e[41]=A,e[42]=$):$=e[42];let P;e[43]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(ce,{children:"Add to Claude Code"}),e[43]=P):P=e[43];let q;e[44]!==$?(q=t.jsx(ie,{children:t.jsxs(re,{children:[$,P]})}),e[44]=$,e[45]=q):q=e[45];let Q;e[46]!==w||e[47]!==q?(Q=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[w,q]}),e[46]=w,e[47]=q,e[48]=Q):Q=e[48];let G;return e[49]!==F||e[50]!==Q?(G=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,F,Q]}),e[49]=F,e[50]=Q,e[51]=G):G=e[51],G}function ps(n){window.open(n,"_blank")}const gs=bt({title:Ze().min(1,"Name is required").max(255),description:Ze().nullable(),status:qe(["active","inactive"]),tool_selection_mode:qe(["inclusion","exclusion"]),tool_selection_strategy:qe(["passthrough","smart_tool_selection","code_execution"])});function js(n,e){const s={};for(const o of n.connections)if(o.selected_tools===null){const i=e.get(o.connection_id)??[];i.length>0&&(s[o.connection_id]=i)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function bs(n){const e={};for(const s of n.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function vs(n){const e={};for(const s of n.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function ys(n,e,s,o){const i=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(i).map(r=>{const m=n[r]??[],x=o.get(r)??[],d=x.length>0&&x.every(a=>m.includes(a));return{connection_id:r,selected_tools:m.length===0||d?null:m,selected_resources:e[r]??null,selected_prompts:s[r]??null}})}function Ss(n){const e=B.c(95),{gateway:s,activeThreadId:o,setActiveThreadId:i}=n,{data:r}=wt.useSession(),m=r?.user,x=Wt(),{locator:d}=ot();let a;e[0]!==d?(a=ft.chatSelectedModel(d),e[0]=d,e[1]=a):a=e[1];const[c,f]=fs(a,x,Cs),h=mt();let j;e[2]!==s.id||e[3]!==h?(j=W=>{const pe={id:W.id,title:W.title,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),hidden:!1,gatewayId:s.id};h.insert.mutate(pe)},e[2]=s.id,e[3]=h,e[4]=j):j=e[4];let p;e[5]!==o||e[6]!==j?(p={threadId:o,systemPrompt:ds,onCreateThread:j},e[5]=o,e[6]=j,e[7]=p):p=e[7];const l=qt(p),{inputValue:b,setInputValue:y,branchContext:N,clearBranch:g}=Jt(),{isEmpty:S}=l,C=!!c;let _;e[8]!==o||e[9]!==l||e[10]!==g||e[11]!==s.id||e[12]!==C||e[13]!==c||e[14]!==y||e[15]!==m?.image||e[16]!==m?.name?(_=async W=>{if(!C||!c){Je.error("No model configured");return}y(""),g();const pe={created_at:new Date().toISOString(),thread_id:o,model:{id:c.id,connectionId:c.connectionId,provider:c.provider??void 0,limits:c.limits??void 0},gateway:{id:s.id},user:{avatar:m?.image??void 0,name:m?.name??"you"}};await l.sendMessage(W,pe)},e[8]=o,e[9]=l,e[10]=g,e[11]=s.id,e[12]=C,e[13]=c,e[14]=y,e[15]=m?.image,e[16]=m?.name,e[17]=_):_=e[17];const v=_;let E;e[18]!==f?(E=W=>{f(W)},e[18]=f,e[19]=E):E=e[19];const F=E;let D;e[20]!==N||e[21]!==g||e[22]!==i||e[23]!==y?(D=()=>{N&&(i(N.originalThreadId),g(),y(""))},e[20]=N,e[21]=g,e[22]=i,e[23]=y,e[24]=D):D=e[24];const L=D,U=s.title||"Gateway";let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Qe,{size:32}),e[25]=T):T=e[25];let u;e[26]!==s.icon||e[27]!==U?(u=t.jsx(Re,{icon:s.icon,name:U,size:"lg",fallbackIcon:T,className:"size-[60px]! rounded-[18px]!"}),e[26]=s.icon,e[27]=U,e[28]=u):u=e[28];const w=s.title||"Gateway Chat";let k;e[29]!==w?(k=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:w}),e[29]=w,e[30]=k):k=e[30];let M;e[31]!==s.description?(M=s.description?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:s.description}):null,e[31]=s.description,e[32]=M):M=e[32];let I;e[33]!==k||e[34]!==M||e[35]!==u?(I=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[u,k,M]}),e[33]=k,e[34]=M,e[35]=u,e[36]=I):I=e[36];let A;e[37]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(Oe,{size:20,className:"animate-spin text-muted-foreground"})}),e[37]=A):A=e[37];let $;e[38]!==v?($=W=>{v(W.description??W.name)},e[38]=v,e[39]=$):$=e[39];let P;e[40]!==s.id||e[41]!==$?(P=t.jsx(Ye,{fallback:null,children:t.jsx(z.Suspense,{fallback:A,children:t.jsx(ms,{gatewayId:s.id,onSelect:$})})}),e[40]=s.id,e[41]=$,e[42]=P):P=e[42];let q;e[43]!==I||e[44]!==P?(q=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-4 text-center",children:[I,P]}),e[43]=I,e[44]=P,e[45]=q):q=e[45];const Q=q;let G;e[46]!==l.messages||e[47]!==l.status||e[48]!==Q||e[49]!==S?(G=t.jsx(oe.Main,{className:"h-full relative overflow-hidden",children:S?t.jsx(oe.EmptyState,{children:Q}):t.jsx(oe.Messages,{messages:l.messages,status:l.status,minHeightOffset:240})}),e[46]=l.messages,e[47]=l.status,e[48]=Q,e[49]=S,e[50]=G):G=e[50];let V;e[51]!==l.error||e[52]!==v?(V=()=>{l.error&&v(`I encountered this error: ${l.error.message}. Can you help me fix it?`)},e[51]=l.error,e[52]=v,e[53]=V):V=e[53];let J;e[54]!==l.clearError||e[55]!==l.error||e[56]!==V?(J=t.jsx(oe.ErrorBanner,{error:l.error,onFixInChat:V,onDismiss:l.clearError}),e[54]=l.clearError,e[55]=l.error,e[56]=V,e[57]=J):J=e[57];let H;e[58]!==v?(H=()=>{v("Please continue.")},e[58]=v,e[59]=H):H=e[59];let te;e[60]!==l.clearFinishReason||e[61]!==l.finishReason||e[62]!==H?(te=t.jsx(oe.FinishReasonWarning,{finishReason:l.finishReason,onContinue:H,onDismiss:l.clearFinishReason}),e[60]=l.clearFinishReason,e[61]=l.finishReason,e[62]=H,e[63]=te):te=e[63];let Y;e[64]!==N||e[65]!==g||e[66]!==L||e[67]!==y?(Y=t.jsx(oe.BranchPreview,{branchContext:N,clearBranchContext:g,onGoToOriginalMessage:L,setInputValue:y}),e[64]=N,e[65]=g,e[66]=L,e[67]=y,e[68]=Y):Y=e[68];let K;e[69]!==v||e[70]!==b?(K=async()=>{b.trim()&&await v(b.trim())},e[69]=v,e[70]=b,e[71]=K):K=e[71];const se=!C,fe=l.status==="submitted"||l.status==="streaming",he=c?"Ask anything or @ for context":"Select a model to start chatting",de=c??void 0;let O;e[72]!==F||e[73]!==de?(O=t.jsx(Zt,{selectedModel:de,onModelChange:F,placeholder:"Model",variant:"borderless"}),e[72]=F,e[73]=de,e[74]=O):O=e[74];let xe;e[75]!==l.messages?(xe=t.jsx(Yt,{messages:l.messages}),e[75]=l.messages,e[76]=xe):xe=e[76];let ne;e[77]!==l.stop||e[78]!==b||e[79]!==y||e[80]!==K||e[81]!==se||e[82]!==fe||e[83]!==he||e[84]!==O||e[85]!==xe?(ne=t.jsxs(oe.Input,{value:b,onChange:y,onSubmit:K,onStop:l.stop,disabled:se,isStreaming:fe,placeholder:he,children:[O,xe]}),e[77]=l.stop,e[78]=b,e[79]=y,e[80]=K,e[81]=se,e[82]=fe,e[83]=he,e[84]=O,e[85]=xe,e[86]=ne):ne=e[86];let ee;e[87]!==J||e[88]!==te||e[89]!==Y||e[90]!==ne?(ee=t.jsx(oe.Footer,{children:t.jsxs("div",{className:"max-w-2xl mx-auto w-full min-w-0 flex flex-col gap-2",children:[J,te,Y,ne]})}),e[87]=J,e[88]=te,e[89]=Y,e[90]=ne,e[91]=ee):ee=e[91];let me;return e[92]!==G||e[93]!==ee?(me=t.jsxs(oe,{children:[G,ee]}),e[92]=G,e[93]=ee,e[94]=me):me=e[94],me}function Cs(n,e){return n.id===e.id&&n.connectionId===e.connectionId}function ws(n){const e=B.c(2);let s;return e[0]!==n?(s=t.jsx(oe.Provider,{children:t.jsx(Ss,{...n})}),e[0]=n,e[1]=s):s=e[1],s}function Ns(n){const e=B.c(41),{form:s,gateway:o,icon:i}=n;let r;e[0]!==s?(r=s.watch("title")||"Gateway",e[0]=s,e[1]=r):r=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Qe,{}),e[2]=m):m=e[2];let x;e[3]!==i||e[4]!==r?(x=t.jsx(Re,{icon:i,name:r,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=i,e[4]=r,e[5]=x):x=e[5];let d;e[6]!==s.control?(d=t.jsx(ze,{control:s.control,name:"status",render:$s}),e[6]=s.control,e[7]=d):d=e[7];let a;e[8]!==x||e[9]!==d?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=a):a=e[10];let c;e[11]!==s.control?(c=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(ze,{control:s.control,name:"title",render:ks}),t.jsx(ze,{control:s.control,name:"description",render:Ts})]}),e[11]=s.control,e[12]=c):c=e[12];let f;e[13]!==a||e[14]!==c?(f=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[a,c]}),e[13]=a,e[14]=c,e[15]=f):f=e[15];let h;e[16]!==s.control?(h=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(ze,{control:s.control,name:"tool_selection_mode",render:Is}),t.jsx(ze,{control:s.control,name:"tool_selection_strategy",render:_s})]}),e[16]=s.control,e[17]=h):h=e[17];let j;e[18]!==f||e[19]!==h?(j=t.jsxs("div",{className:"flex flex-col",children:[f,h]}),e[18]=f,e[19]=h,e[20]=j):j=e[20];let p;e[21]!==s||e[22]!==j?(p=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(Ft,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=p):p=e[23];let l;e[24]!==o.id||e[25]!==o.title?(l=o.title||`gateway-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=l):l=e[26];const b=`${window.location.origin}/mcp/gateway/${o.id}`;let y;e[27]!==l||e[28]!==b?(y=t.jsx("div",{className:"p-5",children:t.jsx(xs,{serverName:l,gatewayUrl:b})}),e[27]=l,e[28]=b,e[29]=y):y=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=N):N=e[30];let g;e[31]!==o.updated_at?(g=o.updated_at?Xt(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=g):g=e[32];let S;e[33]!==g?(S=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[N,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=S):S=e[34];let C;e[35]!==y||e[36]!==S?(C=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[y,S]}),e[35]=y,e[36]=S,e[37]=C):C=e[37];let _;return e[38]!==p||e[39]!==C?(_=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[p,C]}),e[38]=p,e[39]=C,e[40]=_):_=e[40],_}function _s(n){const{field:e}=n;return t.jsxs(Ee,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(it,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ie,{children:t.jsxs(re,{children:[t.jsx(ae,{asChild:!0,children:t.jsx(X,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Gateway strategy help",children:t.jsx(lt,{size:14,className:"text-muted-foreground"})})}),t.jsx(ce,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(rt,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Ae,{children:t.jsx(at,{className:"w-[180px]",children:t.jsx(ct,{})})}),t.jsxs(dt,{children:[t.jsx(Me,{value:"passthrough",children:"Passthrough"}),t.jsx(Me,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(Me,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Fe,{})]})}function Is(n){const{field:e}=n;return t.jsxs(Ee,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(it,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ie,{children:t.jsxs(re,{children:[t.jsx(ae,{asChild:!0,children:t.jsx(X,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(lt,{size:14,className:"text-muted-foreground"})})}),t.jsx(ce,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(rt,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Ae,{children:t.jsx(at,{className:"w-[180px]",children:t.jsx(ct,{})})}),t.jsxs(dt,{children:[t.jsx(Me,{value:"inclusion",children:"Include Selected"}),t.jsx(Me,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Fe,{})]})}function Ts(n){const{field:e}=n;return t.jsxs(Ee,{className:"w-full space-y-0",children:[t.jsx(Ae,{children:t.jsx(Ke,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Fe,{})]})}function ks(n){const{field:e}=n;return t.jsxs(Ee,{className:"w-full space-y-0",children:[t.jsx(Ae,{children:t.jsx(Ke,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(Fe,{})]})}function $s(n){const{field:e}=n;return t.jsxs(Ee,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Ae,{children:t.jsx(It,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Fe,{})]})}function Ps(n){const e=B.c(104),{gateway:s,gatewayId:o,requestedTabId:i}=n,m=vt().location.href,x=yt();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={from:"/$org/gateways/$gatewayId"},e[0]=d):d=e[0];const a=et(d),c=zt(),{locator:f}=ot(),[h,j]=z.useState("chat");let p;e[1]!==o||e[2]!==f?(p=ft.gatewayChatActiveThread(f,o),e[1]=o,e[2]=f,e[3]=p):p=e[3];const[l,b]=ut(p,Rs);let y;e[4]!==o?(y={gatewayId:o},e[4]=o,e[5]=y):y=e[5];const{threads:N,refetch:g}=Ut(y),S=mt();let C;e[6]!==S.update?(C=async R=>{await S.update.mutateAsync({id:R,updates:{hidden:!0}})},e[6]=S.update,e[7]=C):C=e[7];const _=C;let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v={},e[8]=v):v=e[8];const E=tt(v);let F;e[9]!==E?(F=E.map(Ms),e[9]=E,e[10]=F):F=e[10];const D=F,{promptsMap:L}=Mt(D),{resourcesMap:U}=Rt(D);let T;if(e[11]!==E){T=new Map;for(const R of E)R.tools&&R.tools.length>0&&T.set(R.id,R.tools.map(zs));e[11]=E,e[12]=T}else T=e[12];let u;e[13]!==T||e[14]!==s?(u=()=>js(s,T),e[13]=T,e[14]=s,e[15]=u):u=e[15];const[w,k]=z.useState(u);let M;e[16]!==s?(M=()=>bs(s),e[16]=s,e[17]=M):M=e[17];const[I,A]=z.useState(M);let $;e[18]!==s?($=()=>vs(s),e[18]=s,e[19]=$):$=e[19];const[P,q]=z.useState($),[Q,G]=z.useState(!1);let V;e[20]===Symbol.for("react.memo_cache_sentinel")?(V=R=>{k(R),G(!0)},e[20]=V):V=e[20];const J=V;let H;e[21]===Symbol.for("react.memo_cache_sentinel")?(H=R=>{A(R),G(!0)},e[21]=H):H=e[21];const te=H;let Y;e[22]===Symbol.for("react.memo_cache_sentinel")?(Y=R=>{q(R),G(!0)},e[22]=Y):Y=e[22];const K=Y;let se;e[23]===Symbol.for("react.memo_cache_sentinel")?(se=St(gs),e[23]=se):se=e[23];const fe=s.tool_selection_mode??"inclusion",he=s.tool_selection_strategy??"passthrough";let de;e[24]!==s.description||e[25]!==s.status||e[26]!==s.title||e[27]!==fe||e[28]!==he?(de={resolver:se,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:fe,tool_selection_strategy:he}},e[24]=s.description,e[25]=s.status,e[26]=s.title,e[27]=fe,e[28]=he,e[29]=de):de=e[29];const O=Ct(de),ne=O.formState.isDirty||Q;let ee;e[30]!==c.update||e[31]!==T||e[32]!==O||e[33]!==o||e[34]!==P||e[35]!==I||e[36]!==w?(ee=async()=>{const R=O.getValues(),We=ys(w,I,P,T);await c.update.mutateAsync({id:o,data:{title:R.title,description:R.description,status:R.status,tool_selection_mode:R.tool_selection_mode,tool_selection_strategy:R.tool_selection_strategy,connections:We}}),O.reset(R),G(!1),j("chat")},e[30]=c.update,e[31]=T,e[32]=O,e[33]=o,e[34]=P,e[35]=I,e[36]=w,e[37]=ee):ee=e[37];const me=ee;let W;e[38]===Symbol.for("react.memo_cache_sentinel")?(W=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[38]=W):W=e[38];const pe=W,Z=pe.some(R=>R.id===i)?i:"settings";let De;e[39]!==a?(De=R=>{a({search:We=>({...We,tab:R}),replace:!0})},e[39]=a,e[40]=De):De=e[40];const Be=De,Pe=c.update.isPending,ue=h==="edit";let ge;e[41]!==x.history?(ge=()=>x.history.back(),e[41]=x.history,e[42]=ge):ge=e[42];let je;e[43]!==Z||e[44]!==s.description||e[45]!==s.icon||e[46]!==s.title||e[47]!==Be||e[48]!==ue?(je=t.jsx(Ot,{children:ue?t.jsx(Dt,{tabs:pe,activeTab:Z,onTabChange:Be}):t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(Re,{icon:s.icon,name:s.title||"Gateway",size:"xs",fallbackIcon:t.jsx(Qe,{size:12})}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.title}),s.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s.description})]}):null]})]})}),e[43]=Z,e[44]=s.description,e[45]=s.icon,e[46]=s.title,e[47]=Be,e[48]=ue,e[49]=je):je=e[49];const Le=s.icon??"cpu_chip";let be;e[50]!==s.title||e[51]!==Le||e[52]!==m?(be=t.jsx(Vt,{title:s.title,url:m,icon:Le}),e[50]=s.title,e[51]=Le,e[52]=m,e[53]=be):be=e[53];let ve;e[54]!==l||e[55]!==_||e[56]!==me||e[57]!==ne||e[58]!==ue||e[59]!==Pe||e[60]!==g||e[61]!==b||e[62]!==N?(ve=ue?t.jsxs(t.Fragment,{children:[t.jsx(ie,{children:t.jsxs(re,{delayDuration:0,children:[t.jsx(ae,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(X,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:Pe,onClick:()=>j("chat"),"aria-label":"Cancel",children:t.jsx(At,{size:14})})})}),t.jsx(ce,{side:"bottom",children:"Cancel"})]})}),ne&&t.jsx(ie,{children:t.jsxs(re,{delayDuration:0,children:[t.jsx(ae,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(X,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:Pe,onClick:me,"aria-label":"Save",children:Pe?t.jsx(Oe,{size:14,className:"animate-spin"}):t.jsx(xt,{size:14})})})}),t.jsx(ce,{side:"bottom",children:"Save"})]})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ie,{children:t.jsxs(re,{children:[t.jsx(ae,{asChild:!0,children:t.jsx(X,{type:"button",onClick:()=>b(crypto.randomUUID()),"aria-label":"New thread",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(nt,{size:16})})}),t.jsx(ce,{children:"New thread"})]})}),t.jsx(Ht,{threads:N,activeThreadId:l,onSelectThread:b,onRemoveThread:_,onOpen:()=>g(),variant:"outline"}),t.jsx(ie,{children:t.jsxs(re,{children:[t.jsx(ae,{asChild:!0,children:t.jsx(X,{type:"button",onClick:()=>j("edit"),"aria-label":"Edit",variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(ht,{size:16})})}),t.jsx(ce,{children:"Edit Settings"})]})})]}),e[54]=l,e[55]=_,e[56]=me,e[57]=ne,e[58]=ue,e[59]=Pe,e[60]=g,e[61]=b,e[62]=N,e[63]=ve):ve=e[63];let ye;e[64]!==be||e[65]!==ve?(ye=t.jsxs(Bt,{children:[be,ve]}),e[64]=be,e[65]=ve,e[66]=ye):ye=e[66];const Ue=ue?"opacity-0 pointer-events-none hidden":"opacity-100";let Se;e[67]!==Ue?(Se=le("h-full transition-opacity duration-200 ease-out",Ue),e[67]=Ue,e[68]=Se):Se=e[68];let Ce;e[69]!==l||e[70]!==s||e[71]!==b?(Ce=t.jsx(ws,{gateway:s,activeThreadId:l,setActiveThreadId:b}),e[69]=l,e[70]=s,e[71]=b,e[72]=Ce):Ce=e[72];let we;e[73]!==Se||e[74]!==Ce?(we=t.jsx("div",{className:Se,children:Ce}),e[73]=Se,e[74]=Ce,e[75]=we):we=e[75];const He=ue?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none hidden";let Ne;e[76]!==He?(Ne=le("h-full overflow-auto transition-opacity duration-200 ease-out",He),e[76]=He,e[77]=Ne):Ne=e[77];let Ge;e[78]===Symbol.for("react.memo_cache_sentinel")?(Ge=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[78]=Ge):Ge=e[78];let _e;e[79]!==Z||e[80]!==L||e[81]!==U||e[82]!==O||e[83]!==s||e[84]!==P||e[85]!==I||e[86]!==w?(_e=Z==="settings"?t.jsx(Ns,{form:O,gateway:s,icon:s.icon}):Z==="tools"?t.jsx(_t,{toolSet:w,onToolSetChange:J}):Z==="resources"?t.jsx(as,{resourceSet:I,onResourceSetChange:te,connectionResources:U}):Z==="prompts"?t.jsx(os,{promptSet:P,onPromptSetChange:K,connectionPrompts:L}):null,e[79]=Z,e[80]=L,e[81]=U,e[82]=O,e[83]=s,e[84]=P,e[85]=I,e[86]=w,e[87]=_e):_e=e[87];let Ie;e[88]!==_e?(Ie=t.jsx(z.Suspense,{fallback:Ge,children:_e}),e[88]=_e,e[89]=Ie):Ie=e[89];let Te;e[90]!==Z||e[91]!==Ie?(Te=t.jsx(Ye,{children:Ie},Z),e[90]=Z,e[91]=Ie,e[92]=Te):Te=e[92];let ke;e[93]!==Ne||e[94]!==Te?(ke=t.jsx("div",{className:Ne,children:Te}),e[93]=Ne,e[94]=Te,e[95]=ke):ke=e[95];let $e;e[96]!==we||e[97]!==ke?($e=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[we,ke]})}),e[96]=we,e[97]=ke,e[98]=$e):$e=e[98];let Ve;return e[99]!==ge||e[100]!==je||e[101]!==ye||e[102]!==$e?(Ve=t.jsxs(Lt,{onBack:ge,children:[je,ye,$e]}),e[99]=ge,e[100]=je,e[101]=ye,e[102]=$e,e[103]=Ve):Ve=e[103],Ve}function zs(n){return n.name}function Ms(n){return n.id}function Rs(n){return n||crypto.randomUUID()}function Es(){const n=B.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const s=et(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:i,org:r}=gt(o);let m;n[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/gateways/$gatewayId"},n[2]=m):m=n[2];const d=jt(m).tab||"settings",a=Pt(i);if(!a){let f;return n[3]!==s||n[4]!==r?(f=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Nt,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(X,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:r}}),children:"Back to gateways"})})}),n[3]=s,n[4]=r,n[5]=f):f=n[5],f}let c;return n[6]!==a||n[7]!==i||n[8]!==d?(c=t.jsx(Ps,{gateway:a,gatewayId:i,requestedTabId:d}),n[6]=a,n[7]=i,n[8]=d,n[9]=c):c=n[9],c}function As(){const n=B.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Es,{})})}),n[0]=e):e=n[0],e}function Mn(){const n=B.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(As,{}),n[0]=e):e=n[0],e}export{Mn as default};
@@ -1 +0,0 @@
1
- import{a3 as o}from"./index-Wt1f1puE.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-CQOpJFuu.js";import{a3 as s}from"./index-Wt1f1puE.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,19 +0,0 @@
1
- import{r as N,c as h,e as st,d as de,K as Se,t as q,j as a,f as ne,a as Q,g as nt,R as at,T as ot,D as lt,C as it,P as rt,h as ct,O as dt,i as mt,k as ut,l as ft,m as ht,G as pt,U as xt,n as gt,S as Ne,o as bt,p as jt,N as vt,q as wt,s as Ce}from"./index-Wt1f1puE.js";import{O as St,a as Nt,g as Ct}from"./well-known-mcp-D13f-8h2.js";import{g as yt}from"./generate-id-Dyweu44Y.js";import{E as _t}from"./SearchMd-CTe41Otq.js";import{u as kt,a as It,I as he,n as $t}from"./use-connection-Bw5VjMDS.js";import{u as ae,L as oe}from"./localstorage-keys-DywUtnFx.js";import{u as X,T as Mt,a as Ot,b as Tt,c as zt,L as pe,i as Et,P as Pt,O as At}from"./tooltip-TfGvrkSe.js";import{B as W,c as $}from"./button-DekBQWZX.js";import{i as re}from"./CpuChip02-MwRKuQCg.js";import{i as Rt}from"./Loading01-CYe6KHQ_.js";import{s as Dt}from"./Plus-B_341Z-m.js";import{i as se}from"./X-SbhTNlq-.js";import{u as Lt}from"./use-binding-C0D0SiIL.js";import{C as T,u as xe,a as Bt,b as Ut,c as Ht,T as Gt,M as Wt,U as Vt,d as Ft,I as Kt}from"./thread-history-popover-Bi9mj2yY.js";import{E as me}from"./error-boundary-BU7ytqKh.js";import{u as Zt,G as Yt,R as ye,a as qt,b as Qt}from"./resizable-CJZIf7G0.js";import{i as Xt}from"./File06-C6gmiM2R.js";import{u as J}from"./use-mobile-DxFWm-MR.js";import{u as _e,a as Jt}from"./use-organization-settings-DNW7rc_y.js";import{C as es}from"./create-organization-dialog-BHcS-HWr.js";import{I as ts}from"./input-BKIlqldN.js";import{P as ss,a as ns,b as as}from"./popover-BOM-Ldjy.js";import{A as Y}from"./avatar-DYifUjuR.js";import{c as os}from"./Grid01-C9Qy-QMm.js";import{D as ls,a as is,b as rs,c as cs,u as ds,d as ms}from"./responsive-select-BwKgIRfG.js";import{D as us,a as fs,b as hs,c as ps,d as ge}from"./dropdown-menu-DEOghZY2.js";import{a as xs}from"./Copy01-Do_2DOpc.js";import{n as be}from"./LinkExternal01-R8UsBwpd.js";import{D as ke,a as Ie,b as $e,c as Me,d as Oe}from"./dialog-B48I0mf9.js";import"./useQuery-xVxOaLKm.js";import"./auth-DrOI2Q5h.js";import"./AlertCircle-D8Ig6VmI.js";import"./textarea-Bft7ABhA.js";import"./Terminal-D1uJm4u2.js";import"./connection-card-Po1O1myw.js";import"./card-CjPFi-mt.js";import"./json-syntax-highlighter-iaFBJPMB.js";import"./alert-dialog-BU4z5vIU.js";import"./Clock-D62M1TNS.js";import"./Trash01-nRDGqZAh.js";import"./use-gateway-Bcu8DfzG.js";import"./form-idjG_l3J.js";import"./spinner-DRqaN8gi.js";import"./select-BfMeJf3G.js";import"./ChevronDown-ePEWgGNp.js";const Te=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));Te.displayName="BarChart10";const ze=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));ze.displayName="Building02";const Ee=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));Ee.displayName="ChevronSelectorVertical";const Pe=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));Pe.displayName="Globe01";const Ae=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));Ae.displayName="Home02";const Re=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));Re.displayName="LayoutRight";const De=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));De.displayName="LogOut01";const Le=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));Le.displayName="Mail01";const Be=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),N.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"}));Be.displayName="Settings01";const Ue=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));Ue.displayName="UserCircle";const He=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.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"}));He.displayName="Users01";const Ge=({size:t=24,color:e="currentColor",...s})=>N.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},N.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));Ge.displayName="Zap";function ue(){const t=h.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=oe.decoChatOpen(),t[0]=e):e=t[0];const[s,o]=ae(e,gs);let n;return t[1]!==s||t[2]!==o?(n=[s,o],t[1]=s,t[2]=o,t[3]=n):n=t[3],n}function gs(t){return!!(t??!1)}function bs(){const t=h.c(5),e=st(),{org:s}=X();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const n=de(o);let l;return t[1]!==s||t[2]!==n||t[3]!==e?(l=i=>{const c=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!c||!c[1])return;const d=c[1],m=n.connectionId;if(!m)return;e.invalidateQueries({queryKey:Se.collection(s.slug,m,d)});const u=d.toLowerCase().replace(/_/g," ");q.success(`${u} updated`)},t[1]=s,t[2]=n,t[3]=e,t[4]=l):l=t[4],l}const js="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function vs(t){const e=/\/[^/]+\/mcps\/([^/]+)\/([^/]+)\/([^/]+)/,s=t.match(e);return s&&s[1]&&s[2]&&s[3]?{connectionId:decodeURIComponent(s[1]),collectionName:decodeURIComponent(s[2]),itemId:decodeURIComponent(s[3])}:{connectionId:null,collectionName:null,itemId:null}}function ws(t,e){return t.find(e)??t[0]}function je(t,e,s,o){const n=h.c(9),l=null,[i,r]=ae(t,l);let c;n[0]!==s||n[1]!==i?(c=f=>i?s(f,i):!1,n[0]=s,n[1]=i,n[2]=c):c=n[2];let d;n[3]!==e||n[4]!==c?(d=ws(e,c),n[3]=e,n[4]=c,n[5]=d):d=n[5];const m=d;let u;return n[6]!==m||n[7]!==r?(u=[m,r],n[6]=m,n[7]=r,n[8]=u):u=n[8],u}function Ss(t){const e=h.c(2),s=nt();let o;e[0]!==s.location.pathname?(o=vs(s.location.pathname),e[0]=s.location.pathname,e[1]=o):o=e[1];const{connectionId:n,collectionName:l,itemId:i}=o;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
- - You have context to the current gateway and its tools, resources, and prompts
11
-
12
- ## Current Editing Context
13
- ${n?`- Connection ID: ${n}`:""}
14
- ${l?`- Collection Name: ${l}`:""}
15
- ${i?`- Item ID: ${i}`:""}
16
- ${t?`- Gateway ID: ${t}`:""}
17
-
18
- Help the user understand and work with this resource.
19
- `}function Ns(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),t[0]=e):e=t[0],e}function Cs(t){const e=h.c(3),{gatewayId:s,onSelect:o}=t,{data:n}=Ft(s);if(n.length===0)return null;let l;return e[0]!==o||e[1]!==n?(l=a.jsx(Kt,{prompts:n,onSelect:o,className:"mt-6"}),e[0]=o,e[1]=n,e[2]=l):l=e[2],l}function ys(){const{org:{slug:t,id:e},locator:s}=X(),[,o]=ue(),n=ne(),{data:l}=Q.useSession(),i=l?.user,{createThread:r,activeThreadId:c,setActiveThreadId:d,hideThread:m}=xe(),{threads:u,refetch:f}=Bt(),x=Zt(),p=Ut(),w=kt(),[g]=Lt({connections:w,binding:"LLMS"}),b=!!g,v=x.length>0,C=b&&v,[S,y]=je(oe.chatSelectedModel(s),p,(M,R)=>M.id===R.id&&M.connectionId===R.connectionId),[j,_]=je(`${s}:selected-gateway`,x,(M,R)=>M.id===R.gatewayId),O=Ss(j?.id),k=bs(),I=Ht({threadId:c,systemPrompt:O,onToolCall:k,onCreateThread:M=>r({id:M.id,title:M.title,gatewayId:j?.id})}),{inputValue:z,setInputValue:E,branchContext:A,clearBranch:F}=xe(),{isEmpty:ie}=I,K=()=>{A&&(d(A.originalThreadId),F(),E(""))},B=async M=>{if(!S){q.error("No model configured");return}if(!j?.id){q.error("No gateway configured");return}E(""),F();const R={created_at:new Date().toISOString(),thread_id:c,model:{id:S.id,connectionId:S.connectionId,provider:S.provider??void 0,limits:S.limits??void 0},gateway:{id:j.id},user:{avatar:i?.image??void 0,name:i?.name??"you"}};await I.sendMessage(M,R)},U=M=>{y(M)},H=M=>{_({gatewayId:M})},[V,D]=N.useState(!1),L=It(),Z=async()=>{if(!e||!i?.id){q.error("Not authenticated");return}D(!0);try{const M=w?.find(tt=>tt.connection_url===Nt);if(M){n({to:"/$org/mcps/$connectionId",params:{org:t,connectionId:M.id}});return}const R=Ct({id:yt("conn")}),et=await L.create.mutateAsync(R);n({to:"/$org/mcps/$connectionId",params:{org:t,connectionId:et.id}})}catch(M){q.error(`Failed to connect OpenRouter: ${M instanceof Error?M.message:String(M)}`)}finally{D(!1)}};if(!C){let M,R;return!b&&!v?(M="Connect your providers",R="Connect an LLM provider and create a gateway to unlock AI-powered features."):b?(M="No gateways configured",R="Create a gateway to expose your MCP tools to the chat."):(M="No model provider connected",R="Connect to a model provider to unlock AI-powered features."),a.jsxs(T,{children:[a.jsxs(T.Header,{children:[a.jsxs(T.Header.Left,{children:[a.jsx("img",{src:js,alt:"deco chat",className:"size-5 rounded"}),a.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),a.jsx(T.Header.Right,{children:a.jsx("button",{type:"button",onClick:()=>o(!1),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:a.jsx(se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})})]}),a.jsx(T.Main,{className:"flex flex-col items-center",children:a.jsx(T.EmptyState,{children:a.jsx(_t,{image:a.jsx(Ns,{}),title:M,description:R,actions:a.jsxs(a.Fragment,{children:[a.jsxs(W,{variant:"outline",onClick:Z,disabled:V,children:[a.jsx("img",{src:St,alt:"OpenRouter",className:"size-4"}),V?"Installing...":"Install OpenRouter"]}),a.jsx(W,{variant:"outline",onClick:()=>n({to:"/$org/mcps",params:{org:t},search:{action:"create"}}),children:"Install MCP Server"})]})})})})]})}return a.jsxs(T,{children:[a.jsxs(T.Header,{children:[a.jsxs(T.Header.Left,{children:[a.jsx(he,{icon:j?.icon,name:j?.title||"deco chat",size:"xs",fallbackIcon:a.jsx(re,{size:12})}),a.jsx("span",{className:"text-sm font-medium",children:j?.title||"deco chat"})]}),a.jsxs(T.Header.Right,{children:[a.jsx("button",{type:"button",onClick:()=>r(),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:a.jsx(Dt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),a.jsx(Gt,{threads:u,activeThreadId:c,onSelectThread:d,onRemoveThread:m,onOpen:()=>f()}),a.jsx("button",{type:"button",onClick:()=>o(!1),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:a.jsx(se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]})]}),a.jsx(T.Main,{children:ie?a.jsx(T.EmptyState,{children:a.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[a.jsx(he,{icon:j?.icon,name:j?.title||"deco chat",size:"lg",fallbackIcon:a.jsx(re,{size:32}),className:"size-[60px]! rounded-[18px]!"}),a.jsx("h3",{className:"text-xl font-medium text-foreground",children:j?.title||"Ask deco chat"}),a.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:j?.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),j?.id&&a.jsx(me,{fallback:null,children:a.jsx(N.Suspense,{fallback:a.jsx("div",{className:"flex justify-center",children:a.jsx(Rt,{size:20,className:"animate-spin text-muted-foreground"})}),children:a.jsx(Cs,{gatewayId:j.id,onSelect:M=>{B(M.description??M.name)}})})},j.id)]})}):a.jsx(T.Messages,{messages:I.messages,status:I.status,minHeightOffset:240})}),a.jsx(T.Footer,{children:a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx(T.ErrorBanner,{error:I.error,onFixInChat:()=>{I.error&&B(`I encountered this error: ${I.error.message}. Can you help me fix it?`)},onDismiss:I.clearError}),a.jsx(T.FinishReasonWarning,{finishReason:I.finishReason,onContinue:()=>{B("Please continue.")},onDismiss:I.clearFinishReason}),a.jsx(T.BranchPreview,{branchContext:A,clearBranchContext:F,onGoToOriginalMessage:K,setInputValue:E}),a.jsxs(T.Input,{value:z,onChange:E,onSubmit:async()=>{z.trim()&&await B(z.trim())},onStop:I.stop,disabled:!S||!j?.id,isStreaming:I.status==="submitted"||I.status==="streaming",placeholder:S?"Ask anything or @ for context":"Select a model to start chatting",children:[a.jsx(Yt,{selectedGatewayId:j?.id,onGatewayChange:H,placeholder:"Gateway",variant:"borderless"}),a.jsx(Wt,{selectedModel:S??void 0,onModelChange:U,placeholder:"Model",variant:"borderless"}),a.jsx(Vt,{messages:I.messages})]})]})})]})}function _s(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(T.Provider,{children:a.jsx(ys,{})}),t[0]=e):e=t[0],e}function ks(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=a.jsx(at,{"data-slot":"sheet",...s}),e[2]=s,e[3]=o):o=e[3],o}function Is(t){const e=h.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;return e[2]!==s?(o=a.jsx(rt,{"data-slot":"sheet-portal",...s}),e[2]=s,e[3]=o):o=e[3],o}function $s(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("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",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx(dt,{"data-slot":"sheet-overlay",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function Ms(t){const e=h.c(17);let s,o,n,l;e[0]!==t?({className:o,children:s,side:l,...n}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=l):(s=e[1],o=e[2],n=e[3],l=e[4]);const i=l===void 0?"right":l;let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx($s,{}),e[5]=r):r=e[5];const c=i==="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=i==="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=i==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",u=i==="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 f;e[6]!==o||e[7]!==c||e[8]!==d||e[9]!==m||e[10]!==u?(f=$("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,u,o),e[6]=o,e[7]=c,e[8]=d,e[9]=m,e[10]=u,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsxs(ct,{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:[a.jsx(se,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=x):x=e[12];let p;return e[13]!==s||e[14]!==n||e[15]!==f?(p=a.jsxs(Is,{children:[r,a.jsxs(it,{"data-slot":"sheet-content",className:f,...n,children:[s,x]})]}),e[13]=s,e[14]=n,e[15]=f,e[16]=p):p=e[16],p}function Os(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("flex flex-col gap-1.5 p-4",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("div",{"data-slot":"sheet-header",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function Ts(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("text-foreground font-semibold",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx(ot,{"data-slot":"sheet-title",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function zs(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("text-muted-foreground text-sm",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx(lt,{"data-slot":"sheet-description",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function We(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("div",{"data-slot":"skeleton",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}const Es="sidebar_state",Ps=3600*24*7,As="16rem",Rs="18rem",Ds="3rem",Ls="b",Ve=N.createContext(null);function fe(){const t=N.useContext(Ve);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Bs(t){const e=h.c(21),{defaultOpen:s,open:o,onOpenChange:n,children:l}=t,i=s===void 0?!0:s,r=J(),[c,d]=N.useState(!1),[m,u]=N.useState(i),f=o??m;let x;e[0]!==f||e[1]!==n?(x=O=>{const k=typeof O=="function"?O(f):O;n?n(k):u(k),document.cookie=`${Es}=${k}; path=/; max-age=${Ps}`},e[0]=f,e[1]=n,e[2]=x):x=e[2];const p=x;let w;e[3]!==r||e[4]!==p?(w=()=>r?d(Hs):p(Us),e[3]=r,e[4]=p,e[5]=w):w=e[5];const g=w;let b,v;e[6]!==g?(b=()=>{const O=k=>{if(k.key===Ls&&(k.metaKey||k.ctrlKey)){const I=k.target;if(I.tagName==="INPUT"||I.tagName==="TEXTAREA"||I.isContentEditable)return;k.preventDefault(),g()}};return globalThis.addEventListener("keydown",O),()=>globalThis.removeEventListener("keydown",O)},v=[g],e[6]=g,e[7]=b,e[8]=v):(b=e[7],v=e[8]),N.useEffect(b,v);const C=f?"expanded":"collapsed";let S;e[9]!==r||e[10]!==f||e[11]!==c||e[12]!==p||e[13]!==C||e[14]!==g?(S={state:C,open:f,setOpen:p,isMobile:r,openMobile:c,setOpenMobile:d,toggleSidebar:g},e[9]=r,e[10]=f,e[11]=c,e[12]=p,e[13]=C,e[14]=g,e[15]=S):S=e[15];const y=S;let j;e[16]!==l?(j=a.jsx(Ot,{delayDuration:0,children:l}),e[16]=l,e[17]=j):j=e[17];let _;return e[18]!==y||e[19]!==j?(_=a.jsx(Ve.Provider,{value:y,children:j}),e[18]=y,e[19]=j,e[20]=_):_=e[20],_}function Us(t){return!t}function Hs(t){return!t}function Gs(t){const e=h.c(14);let s,o,n,l;e[0]!==t?({className:o,style:l,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=l):(s=e[1],o=e[2],n=e[3],l=e[4]);let i;e[5]!==l?(i={"--sidebar-width":As,"--sidebar-width-icon":Ds,...l},e[5]=l,e[6]=i):i=e[6];const r=i;let c;e[7]!==o?(c=$("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",o),e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==s||e[10]!==n||e[11]!==r||e[12]!==c?(d=a.jsx("div",{"data-slot":"sidebar-wrapper",style:r,className:c,...n,children:s}),e[9]=s,e[10]=n,e[11]=r,e[12]=c,e[13]=d):d=e[13],d}function Ws(t){const e=h.c(46);let s,o,n,l,i,r;e[0]!==t?({side:l,variant:i,collapsible:r,className:o,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=l,e[5]=i,e[6]=r):(s=e[1],o=e[2],n=e[3],l=e[4],i=e[5],r=e[6]);const c=l===void 0?"left":l,d=i===void 0?"sidebar":i,m=r===void 0?"offcanvas":r,{isMobile:u,state:f,openMobile:x,setOpenMobile:p}=fe();if(m==="none"){let k;e[7]!==o?(k=$("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),e[7]=o,e[8]=k):k=e[8];let I;return e[9]!==s||e[10]!==n||e[11]!==k?(I=a.jsx("div",{"data-slot":"sidebar",className:k,...n,children:s}),e[9]=s,e[10]=n,e[11]=k,e[12]=I):I=e[12],I}if(u){let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k={"--sidebar-width":Rs},e[13]=k):k=e[13];let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=a.jsxs(Os,{className:"sr-only",children:[a.jsx(Ts,{children:"Sidebar"}),a.jsx(zs,{children:"Displays the mobile sidebar."})]}),e[14]=I):I=e[14];let z;e[15]!==s?(z=a.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=z):z=e[16];let E;e[17]!==c||e[18]!==z?(E=a.jsxs(Ms,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:k,side:c,children:[I,z]}),e[17]=c,e[18]=z,e[19]=E):E=e[19];let A;return e[20]!==x||e[21]!==n||e[22]!==p||e[23]!==E?(A=a.jsx(ks,{open:x,onOpenChange:p,...n,children:E}),e[20]=x,e[21]=n,e[22]=p,e[23]=E,e[24]=A):A=e[24],A}const w=f==="collapsed"?m:"",g=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 b;e[25]!==g?(b=$("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",g),e[25]=g,e[26]=b):b=e[26];let v;e[27]!==b?(v=a.jsx("div",{"data-slot":"sidebar-gap",className:b}),e[27]=b,e[28]=v):v=e[28];const C=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)]",S=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 y;e[29]!==o||e[30]!==C||e[31]!==S?(y=$("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",C,S,o),e[29]=o,e[30]=C,e[31]=S,e[32]=y):y=e[32];let j;e[33]!==s?(j=a.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:s}),e[33]=s,e[34]=j):j=e[34];let _;e[35]!==n||e[36]!==y||e[37]!==j?(_=a.jsx("div",{"data-slot":"sidebar-container",className:y,...n,children:j}),e[35]=n,e[36]=y,e[37]=j,e[38]=_):_=e[38];let O;return e[39]!==c||e[40]!==f||e[41]!==_||e[42]!==w||e[43]!==v||e[44]!==d?(O=a.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":f,"data-collapsible":w,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[v,_]}),e[39]=c,e[40]=f,e[41]=_,e[42]=w,e[43]=v,e[44]=d,e[45]=O):O=e[45],O}function Vs(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("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",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("main",{"data-slot":"sidebar-inset",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function Fs(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("h-4 m-0! w-full",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("div",{"data-sidebar":"separator",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function Ks(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function Zs(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function Ys(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("w-full text-sm",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function qs(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}function le(t){const e=h.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let n;e[3]!==s?(n=$("group/menu-item relative",s),e[3]=s,e[4]=n):n=e[4];let l;return e[5]!==o||e[6]!==n?(l=a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:n,...o}),e[5]=o,e[6]=n,e[7]=l):l=e[7],l}const Qs=mt("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 Fe(t){const e=h.c(28);let s,o,n,l,i,r,c;e[0]!==t?({asChild:n,isActive:l,variant:i,size:r,tooltip:c,className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=l,e[5]=i,e[6]=r,e[7]=c):(s=e[1],o=e[2],n=e[3],l=e[4],i=e[5],r=e[6],c=e[7]);const d=n===void 0?!1:n,m=l===void 0?!1:l,u=i===void 0?"default":i,f=r===void 0?"default":r,x=d?ut:"button",{isMobile:p,state:w}=fe();let g;e[8]!==s||e[9]!==f||e[10]!==u?(g=$(Qs({variant:u,size:f}),s),e[8]=s,e[9]=f,e[10]=u,e[11]=g):g=e[11];let b;e[12]!==x||e[13]!==m||e[14]!==o||e[15]!==f||e[16]!==g?(b=a.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":f,"data-active":m,className:g,...o}),e[12]=x,e[13]=m,e[14]=o,e[15]=f,e[16]=g,e[17]=b):b=e[17];const v=b;if(!c)return v;if(typeof c=="string"){let _;e[18]!==c?(_={children:c},e[18]=c,e[19]=_):_=e[19],c=_}let C;e[20]!==v?(C=a.jsx(Tt,{asChild:!0,children:v}),e[20]=v,e[21]=C):C=e[21];const S=w!=="collapsed"||p;let y;e[22]!==S||e[23]!==c?(y=a.jsx(Mt,{side:"right",align:"center",hidden:S,...c}),e[22]=S,e[23]=c,e[24]=y):y=e[24];let j;return e[25]!==C||e[26]!==y?(j=a.jsxs(zt,{children:[C,y]}),e[25]=C,e[26]=y,e[27]=j):j=e[27],j}function Xs(t){const e=h.c(26),{item:s}=t,o=ne(),{org:n}=X(),l=_e(n.id),i=Jt(n.id);let r;e[0]!==i.update||e[1]!==s.url||e[2]!==l?.sidebar_items?(r=async()=>{const S=(l?.sidebar_items||[]).filter(y=>y.url!==s.url);await i.update.mutateAsync({sidebar_items:S})},e[0]=i.update,e[1]=s.url,e[2]=l?.sidebar_items,e[3]=r):r=e[3];const c=r;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const u=m;let f;e[7]!==s.url||e[8]!==o?(f=()=>{o({to:s.url})},e[7]=s.url,e[8]=o,e[9]=f):f=e[9];const x=s.title;let p;e[10]!==u||e[11]!==s.icon||e[12]!==s.title?(p=a.jsx("div",{className:"flex items-center justify-center shrink-0",children:u?a.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):a.jsx(Xt,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=u,e[11]=s.icon,e[12]=s.title,e[13]=p):p=e[13];let w;e[14]!==s.title?(w=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=w):w=e[15];let g;e[16]!==w?(g=a.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:a.jsx("span",{className:"truncate text-sm w-full capitalize",children:w})}),e[16]=w,e[17]=g):g=e[17];let b;e[18]!==c?(b=a.jsx(se,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:C=>{C.preventDefault(),C.stopPropagation(),c()}}),e[18]=c,e[19]=b):b=e[19];let v;return e[20]!==s.title||e[21]!==f||e[22]!==p||e[23]!==g||e[24]!==b?(v=a.jsx(le,{children:a.jsxs(Fe,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:f,tooltip:x,children:[p,g,b]})}),e[20]=s.title,e[21]=f,e[22]=p,e[23]=g,e[24]=b,e[25]=v):v=e[25],v}function Js(){const t=h.c(4),{org:e}=X(),o=_e(e.id)?.sidebar_items;if(!o?.length)return null;let n;t[0]!==o?(n=o.map(en),t[0]=o,t[1]=n):n=t[1];let l;return t[2]!==n?(l=a.jsx(Ke,{children:n}),t[2]=n,t[3]=l):l=t[3],l}function en(t){return a.jsx(Xs,{item:t},t.url)}function ve(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(le,{children:a.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:a.jsx(We,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function Ke(t){const e=h.c(4),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(Fs,{className:"my-2 -ml-1"}),e[0]=o):o=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(le,{children:a.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:a.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=n):n=e[1];let l;return e[2]!==s?(l=a.jsxs(a.Fragment,{children:[o,n,s]}),e[2]=s,e[3]=l):l=e[3],l}function tn(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(N.Suspense,{fallback:a.jsxs(Ke,{children:[a.jsx(ve,{}),a.jsx(ve,{})]}),children:a.jsx(Js,{})}),t[0]=e):e=t[0],e}function sn(){const t=h.c(48),{locator:e}=X(),s=ne();let o;t[0]!==e?(o=pe.parse(e),t[0]=e,t[1]=o):o=t[1];const{org:n}=o;let l;t[2]!==e?(l=pe.isOrgAdminProject(e),t[2]=e,t[3]=l):l=t[3];const i=l;let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(Ae,{}),t[4]=r):r=t[4];let c;t[5]!==s||t[6]!==n?(c={key:"home",label:"Home",icon:r,onClick:()=>s({to:"/$org",params:{org:n}})},t[5]=s,t[6]=n,t[7]=c):c=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=a.jsx(ze,{}),t[8]=d):d=t[8];let m;t[9]!==s||t[10]!==n?(m={key:"store",label:"Store",icon:d,onClick:()=>s({to:"/$org/store",params:{org:n}})},t[9]=s,t[10]=n,t[11]=m):m=t[11];let u;t[12]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(Ge,{}),t[12]=u):u=t[12];let f;t[13]!==s||t[14]!==n?(f={key:"workflow",label:"Workflows",icon:u,onClick:()=>s({to:"/$org/workflow",params:{org:n}})},t[13]=s,t[14]=n,t[15]=f):f=t[15];let x;t[16]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx($t,{}),t[16]=x):x=t[16];let p;t[17]!==s||t[18]!==n?(p={key:"mcps",label:"MCP Servers",icon:x,onClick:()=>s({to:"/$org/mcps",params:{org:n}})},t[17]=s,t[18]=n,t[19]=p):p=t[19];let w;t[20]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(re,{}),t[20]=w):w=t[20];let g;t[21]!==s||t[22]!==n?(g={key:"gateways",label:"MCP Gateways",icon:w,onClick:()=>s({to:"/$org/gateways",params:{org:n}})},t[21]=s,t[22]=n,t[23]=g):g=t[23];let b;t[24]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(Te,{}),t[24]=b):b=t[24];let v;t[25]!==s||t[26]!==n?(v={key:"monitoring",label:"Monitoring",icon:b,onClick:()=>s({to:"/$org/monitoring",params:{org:n}})},t[25]=s,t[26]=n,t[27]=v):v=t[27];let C;t[28]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsx(He,{}),t[28]=C):C=t[28];let S;t[29]!==s||t[30]!==n?(S={key:"members",label:"Members",icon:C,onClick:()=>s({to:"/$org/members",params:{org:n}})},t[29]=s,t[30]=n,t[31]=S):S=t[31];let y;t[32]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Be,{}),t[32]=y):y=t[32];let j;t[33]!==s||t[34]!==n?(j={key:"settings",label:"Settings",icon:y,onClick:()=>s({to:"/$org/settings",params:{org:n}})},t[33]=s,t[34]=n,t[35]=j):j=t[35];let _;t[36]!==g||t[37]!==v||t[38]!==S||t[39]!==j||t[40]!==c||t[41]!==m||t[42]!==f||t[43]!==p?(_=[c,m,f,p,g,v,S,j],t[36]=g,t[37]=v,t[38]=S,t[39]=j,t[40]=c,t[41]=m,t[42]=f,t[43]=p,t[44]=_):_=t[44];const O=_;let k;return t[45]!==O||t[46]!==i?(k=i?O:[],t[45]=O,t[46]=i,t[47]=k):k=t[47],k}function Ze(t){const e=h.c(10),{navigationItems:s,footer:o,additionalContent:n,variant:l,collapsible:i}=t,r=l===void 0?"sidebar":l,c=i===void 0?"icon":i;let d;e[0]!==s?(d=s.map(nn),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==n||e[3]!==d?(m=a.jsx(Ks,{className:"flex-1 overflow-x-hidden",children:a.jsx(Zs,{className:"font-medium",children:a.jsx(Ys,{children:a.jsxs(qs,{className:"gap-0.5",children:[d,n]})})})}),e[2]=n,e[3]=d,e[4]=m):m=e[4];let u;return e[5]!==c||e[6]!==o||e[7]!==m||e[8]!==r?(u=a.jsxs(Ws,{variant:r,collapsible:c,children:[m,o]}),e[5]=c,e[6]=o,e[7]=m,e[8]=r,e[9]=u):u=e[9],u}function nn(t){return a.jsx(le,{children:a.jsxs(Fe,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[a.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),a.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Ze.Skeleton=function(){return a.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>a.jsx("div",{className:"w-full h-8",children:a.jsx(We,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function an(){const t=h.c(3),e=sn();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(a.Fragment,{children:a.jsx(me,{children:a.jsx(N.Suspense,{fallback:null,children:a.jsx(tn,{})})})}),t[0]=s):s=t[0];let o;return t[1]!==e?(o=a.jsx(Ze,{navigationItems:e,additionalContent:s}),t[1]=e,t[2]=o):o=t[2],o}function on(t){const e=h.c(12);let s,o,n,l;e[0]!==t?({className:s,orientation:n,decorative:l,...o}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=l):(s=e[1],o=e[2],n=e[3],l=e[4]);const i=n===void 0?"horizontal":n,r=l===void 0?!0:l;let c;e[5]!==s?(c=$("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==c?(d=a.jsx(ft,{"data-slot":"separator-root",decorative:r,orientation:i,className:c,...o}),e[7]=r,e[8]=i,e[9]=o,e[10]=c,e[11]=d):d=e[11],d}const Ye=N.createContext(null);function ln(){const t=N.useContext(Ye);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function rn(t){const e=h.c(10),{children:s,onItemHover:o}=t,[n,l]=N.useState(null);let i;e[0]!==o?(i=u=>{l(u),o?.(u)},e[0]=o,e[1]=i):i=e[1];const r=i;let c;e[2]!==n||e[3]!==r?(c={hoveredItem:n,setHoveredItem:r},e[2]=n,e[3]=r,e[4]=c):c=e[4];let d;e[5]!==s?(d=a.jsx(ss,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=a.jsx(Ye.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function cn(t){const e=h.c(6),{children:s,onClick:o}=t;let n;e[0]!==s||e[1]!==o?(n=a.jsx(W,{variant:"link",className:"p-0.5 h-auto",onClick:o,type:"button",children:s}),e[0]=s,e[1]=o,e[2]=n):n=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(ns,{asChild:!0,children:a.jsx(W,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:a.jsx(Ee,{size:16,className:"opacity-50"})})}),e[3]=l):l=e[3];let i;return e[4]!==n?(i=a.jsxs("div",{className:"flex items-center gap-1",children:[n,l]}),e[4]=n,e[5]=i):i=e[5],i}function dn(t){const e=h.c(8),{item:s,fallback:o}=t,n=o===void 0?"":o,l=s?.avatarUrl??"",i=s?.name??n;let r;e[0]!==l||e[1]!==i?(r=a.jsx(Y,{url:l,fallback:i,size:"xs",objectFit:"contain"}),e[0]=l,e[1]=i,e[2]=r):r=e[2];const c=s?.name??n;let d;e[3]!==c?(d=a.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==r||e[6]!==d?(m=a.jsxs("div",{className:"flex items-center gap-2",children:[r,d]}),e[5]=r,e[6]=d,e[7]=m):m=e[7],m}function mn(t){const e=h.c(6),{children:s,align:o}=t,n=o===void 0?"start":o,i=N.Children.toArray(s).filter(un).length===1?"280px":"480px";let r;e[0]!==i?(r={width:i},e[0]=i,e[1]=r):r=e[1];let c;return e[2]!==n||e[3]!==s||e[4]!==r?(c=a.jsx(as,{align:n,className:"p-0 flex items-start",style:r,children:s}),e[2]=n,e[3]=s,e[4]=r,e[5]=c):c=e[5],c}function un(t){return N.isValidElement(t)&&(t.type===Qe||t.type===qe)}function qe(t){const e=h.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=$("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==s||e[3]!==n?(l=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=l):l=e[4],l}const Qe=qe;function fn(t){const e=h.c(6),{placeholder:s,value:o,onChange:n}=t,l=s===void 0?"Search...":s;let i;e[0]!==n?(i=c=>n(c.target.value),e[0]=n,e[1]=i):i=e[1];let r;return e[2]!==l||e[3]!==i||e[4]!==o?(r=a.jsx(ts,{placeholder:l,value:o,onChange:i,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=l,e[3]=i,e[4]=o,e[5]=r):r=e[5],r}function hn(t){const e=h.c(6),{children:s,emptyMessage:o}=t,n=o===void 0?"No items found.":o,l=N.Children.count(s)>0;let i;e[0]!==n||e[1]!==l?(i=!l&&a.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:n}),e[0]=n,e[1]=l,e[2]=i):i=e[2];let r;return e[3]!==s||e[4]!==i?(r=a.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[i,s]}),e[3]=s,e[4]=i,e[5]=r):r=e[5],r}function pn(t){const e=h.c(15),{item:s,onClick:o,onHover:n,children:l}=t,i=ln();let r;e[0]!==i||e[1]!==s||e[2]!==n?(r=()=>{i.setHoveredItem(s.slug),n?.(s)},e[0]=i,e[1]=s,e[2]=n,e[3]=r):r=e[3];const c=r;let d;e[4]!==s||e[5]!==o?(d=()=>o(s),e[4]=s,e[5]=o,e[6]=d):d=e[6];let m;e[7]!==l||e[8]!==s.avatarUrl||e[9]!==s.name?(m=l||a.jsxs(a.Fragment,{children:[a.jsx(Y,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),a.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=l,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let u;return e[11]!==c||e[12]!==d||e[13]!==m?(u=a.jsx(W,{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]=u):u=e[14],u}function xn(t){const e=h.c(2),{children:s}=t;let o;return e[0]!==s?(o=a.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=o):o=e[1],o}function gn(t){const e=h.c(11),{onClick:s,icon:o,children:n,variant:l}=t,r=(l===void 0?"default":l)==="muted"&&"text-muted-foreground";let c;e[0]!==r?(c=$("w-full justify-start font-normal",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==o?(d=o&&a.jsx("span",{className:"[&>svg]:size-4",children:o}),e[2]=o,e[3]=d):d=e[3];let m;e[4]!==n?(m=a.jsx("span",{children:n}),e[4]=n,e[5]=m):m=e[5];let u;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(u=a.jsxs(W,{variant:"ghost",size:"sm",className:c,onClick:s,children:[d,m]}),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=u):u=e[10],u}function bn(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(on,{}),t[0]=e):e=t[0],e}function jn(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const P=Object.assign(rn,{Trigger:cn,CurrentItem:dn,Content:mn,Panel:Qe,Search:fn,Items:hn,Item:pn,Actions:xn,Action:gn,Separator:bn,Skeleton:jn});function ce(){const t=h.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=de(e),{data:o}=Q.useListOrganizations(),n=ne();let l;t[1]!==s||t[2]!==o?(l=o?.find(F=>F.slug===s),t[1]=s,t[2]=o,t[3]=l):l=t[3];const i=l,[r,c]=N.useState(""),[d,m]=N.useState(!1);let u,f,x,p,w,g,b,v;if(t[4]!==i||t[5]!==n||t[6]!==s||t[7]!==r||t[8]!==o){const ie=(o?(()=>{const D=o.filter(L=>L.name.toLowerCase().includes(r.toLowerCase()));if(s){const L=D.findIndex(Z=>Z.slug===s);if(L>0){const Z=D[L];Z&&(D.splice(L,1),D.unshift(Z))}}return D})():[]).map(vn);let K;t[17]!==i?(K=i?{slug:i.slug,name:i.name,avatarUrl:i.logo}:void 0,t[17]=i,t[18]=K):K=t[18];const B=K;p=P;let U;t[19]!==n||t[20]!==s?(U=()=>n({to:"/$org",params:{org:s??""}}),t[19]=n,t[20]=s,t[21]=U):U=t[21];let H;t[22]!==B?(H=a.jsx(P.CurrentItem,{item:B}),t[22]=B,t[23]=H):H=t[23],t[24]!==U||t[25]!==H?(v=a.jsx(P.Trigger,{onClick:U,children:H}),t[24]=U,t[25]=H,t[26]=v):v=t[26],x=P.Content,f=P.Panel,t[27]!==r?(b=a.jsx(P.Search,{placeholder:"Search organizations...",value:r,onChange:c}),t[27]=r,t[28]=b):b=t[28],u=P.Items,w="No organizations found.";let V;t[29]!==n?(V=D=>a.jsx(P.Item,{item:D,onClick:L=>n({to:"/$org",params:{org:L.slug}})},D.slug),t[29]=n,t[30]=V):V=t[30],g=ie.map(V),t[4]=i,t[5]=n,t[6]=s,t[7]=r,t[8]=o,t[9]=u,t[10]=f,t[11]=x,t[12]=p,t[13]=w,t[14]=g,t[15]=b,t[16]=v}else u=t[9],f=t[10],x=t[11],p=t[12],w=t[13],g=t[14],b=t[15],v=t[16];let C;t[31]!==u||t[32]!==w||t[33]!==g?(C=a.jsx(u,{emptyMessage:w,children:g}),t[31]=u,t[32]=w,t[33]=g,t[34]=C):C=t[34];let S,y;t[35]===Symbol.for("react.memo_cache_sentinel")?(S=a.jsx(P.Actions,{children:a.jsx(P.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),y=a.jsx(P.Separator,{}),t[35]=S,t[36]=y):(S=t[35],y=t[36]);let j;t[37]!==n?(j=()=>n({to:"/"}),t[37]=n,t[38]=j):j=t[38];let _;t[39]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(os,{}),t[39]=_):_=t[39];let O;t[40]!==j?(O=a.jsx(P.Actions,{children:a.jsx(P.Action,{onClick:j,icon:_,children:"See all organizations"})}),t[40]=j,t[41]=O):O=t[41];let k;t[42]!==f||t[43]!==O||t[44]!==b||t[45]!==C?(k=a.jsxs(f,{children:[b,C,S,y,O]}),t[42]=f,t[43]=O,t[44]=b,t[45]=C,t[46]=k):k=t[46];let I;t[47]!==x||t[48]!==k?(I=a.jsx(x,{children:k}),t[47]=x,t[48]=k,t[49]=I):I=t[49];let z;t[50]!==p||t[51]!==I||t[52]!==v?(z=a.jsxs(p,{children:[v,I]}),t[50]=p,t[51]=I,t[52]=v,t[53]=z):z=t[53];let E;t[54]!==d?(E=a.jsx(es,{open:d,onOpenChange:m}),t[54]=d,t[55]=E):E=t[55];let A;return t[56]!==z||t[57]!==E?(A=a.jsxs(a.Fragment,{children:[z,E]}),t[56]=z,t[57]=E,t[58]=A):A=t[58],A}function vn(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}ce.Skeleton=P.Skeleton;const Xe=N.createContext({setOpen:()=>{}}),wn=()=>N.useContext(Xe),Sn=t=>{const e=h.c(25);let s,o,n,l,i;e[0]!==t?({children:s,defaultOpen:o,open:l,onOpenChange:n,...i}=t,e[0]=t,e[1]=s,e[2]=o,e[3]=n,e[4]=l,e[5]=i):(s=e[1],o=e[2],n=e[3],l=e[4],i=e[5]);const r=o??!1;let c;e[6]!==n||e[7]!==l||e[8]!==r?(c={prop:l,defaultProp:r,onChange:n},e[6]=n,e[7]=l,e[8]=r,e[9]=c):c=e[9];const[d,m]=ds(c);let u;e[10]!==m?(u={setOpen:m},e[10]=m,e[11]=u):u=e[11];let f;e[12]!==s||e[13]!==d||e[14]!==i||e[15]!==m?(f=a.jsx(ms,{open:d,onOpenChange:m,...i,children:s}),e[12]=s,e[13]=d,e[14]=i,e[15]=m,e[16]=f):f=e[16];let x;e[17]!==d||e[18]!==i||e[19]!==m||e[20]!==f?(x=a.jsx(hs,{open:d,onOpenChange:m,...i,children:f}),e[17]=d,e[18]=i,e[19]=m,e[20]=f,e[21]=x):x=e[21];let p;return e[22]!==u||e[23]!==x?(p=a.jsx(Xe.Provider,{value:u,children:x}),e[22]=u,e[23]=x,e[24]=p):p=e[24],p},Nn=t=>{const{children:e,title:s,...o}=t,n=J(),{className:l,...i}=o;return n?a.jsxs(is,{...i,children:[a.jsx(rs,{className:"hidden",children:a.jsx(cs,{children:s})}),a.jsx("div",{className:$("flex flex-col gap-2 p-2 py-4",l),children:e})]}):a.jsx(fs,{...o,children:e})},Cn=t=>{const{children:e,...s}=t,{setOpen:o}=wn(),n=J(),{className:l,...i}=s;return n?a.jsx("div",{...i,onClick:r=>{o(!1);const{onClick:c}=i;c?.(r)},className:$("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-lg 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",l),children:e}):a.jsx(ps,{...s,children:e})},yn=t=>{const e=h.c(7);let s,o;e[0]!==t?({children:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=J();let l;return e[3]!==s||e[4]!==n||e[5]!==o?(l=n?a.jsx(ls,{asChild:!0,children:s}):a.jsx(us,{...o,children:s}),e[3]=s,e[4]=n,e[5]=o,e[6]=l):l=e[6],l},_n=t=>{const e=h.c(7);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=J();let l;return e[3]!==s||e[4]!==n||e[5]!==o?(l=n?a.jsx(ge,{className:$(s),...o}):a.jsx(ge,{className:$(s),...o}),e[3]=s,e[4]=n,e[5]=o,e[6]=l):l=e[6],l};function kn(t){const e=h.c(11),{user:s,trigger:o,align:n,children:l}=t,i=n===void 0?"start":n;let r;e[0]!==o||e[1]!==s?(r=o(s),e[0]=o,e[1]=s,e[2]=r):r=e[2];let c;e[3]!==r?(c=a.jsx(yn,{asChild:!0,children:a.jsx("div",{children:r})}),e[3]=r,e[4]=c):c=e[4];let d;e[5]!==i||e[6]!==l?(d=a.jsx(Nn,{side:"top",align:i,className:"md:w-[240px]",children:l}),e[5]=i,e[6]=l,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=a.jsxs(Sn,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function In(t){const e=h.c(8),{children:s,onClick:o,className:n,asChild:l}=t;let i;e[0]!==l||e[1]!==s||e[2]!==o?(i=l?s:a.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:o,children:s}),e[0]=l,e[1]=s,e[2]=o,e[3]=i):i=e[3];let r;return e[4]!==l||e[5]!==n||e[6]!==i?(r=a.jsx(Cn,{asChild:l,className:n,children:i}),e[4]=l,e[5]=n,e[6]=i,e[7]=r):r=e[7],r}function $n(t){const e=h.c(2),{className:s}=t;let o;return e[0]!==s?(o=a.jsx(_n,{className:s}),e[0]=s,e[1]=o):o=e[1],o}function Mn(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const G=Object.assign(kn,{Item:In,Separator:$n,Skeleton:Mn});function On(t){const e=h.c(32),{open:s,onOpenChange:o,user:n,userImage:l}=t,[i,r]=N.useState(!1);let c;e[0]!==n.id?(c=()=>{navigator.clipboard.writeText(n.id),r(!0),setTimeout(()=>r(!1),2e3)},e[0]=n.id,e[1]=c):c=e[1];const d=c;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsxs(ke,{children:[a.jsx(Ie,{children:"Profile"}),a.jsx($e,{children:"Your account information"})]}),e[2]=m):m=e[2];const u=n.name||n.email||"U";let f;e[3]!==u||e[4]!==l?(f=a.jsx(Y,{url:l,fallback:u,shape:"circle",size:"2xl"}),e[3]=u,e[4]=l,e[5]=f):f=e[5];const x=n.name||n.email;let p;e[6]!==x?(p=a.jsx("div",{className:"text-lg font-semibold text-center",children:x}),e[6]=x,e[7]=p):p=e[7];let w;e[8]!==n.email?(w=a.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n.email}),e[8]=n.email,e[9]=w):w=e[9];let g;e[10]!==p||e[11]!==w?(g=a.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[p,w]}),e[10]=p,e[11]=w,e[12]=g):g=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=b):b=e[13];let v;e[14]!==n.id?(v=a.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[b,a.jsx("span",{className:"text-sm font-mono truncate",children:n.id})]}),e[14]=n.id,e[15]=v):v=e[15];let C;e[16]!==i?(C=i?a.jsx(Et,{size:16,className:"text-green-600"}):a.jsx(xs,{size:16,className:"text-muted-foreground"}),e[16]=i,e[17]=C):C=e[17];let S;e[18]!==d||e[19]!==C?(S=a.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:C}),e[18]=d,e[19]=C,e[20]=S):S=e[20];let y;e[21]!==v||e[22]!==S?(y=a.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:[v,S]}),e[21]=v,e[22]=S,e[23]=y):y=e[23];let j;e[24]!==y||e[25]!==f||e[26]!==g?(j=a.jsxs(Me,{className:"sm:max-w-md",children:[m,a.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[f,g,y]})]}),e[24]=y,e[25]=f,e[26]=g,e[27]=j):j=e[27];let _;return e[28]!==o||e[29]!==s||e[30]!==j?(_=a.jsx(Oe,{open:s,onOpenChange:o,children:j}),e[28]=o,e[29]=s,e[30]=j,e[31]=_):_=e[31],_}function Tn(t){const e=h.c(5),{open:s,onOpenChange:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsxs(ke,{children:[a.jsx(Ie,{children:"Invitations"}),a.jsx($e,{children:"Your pending organization invitations"})]}),e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsxs(Me,{className:"sm:max-w-lg",children:[n,a.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:a.jsx(xt,{})})]}),e[1]=l):l=e[1];let i;return e[2]!==o||e[3]!==s?(i=a.jsx(Oe,{open:s,onOpenChange:o,children:l}),e[2]=o,e[3]=s,e[4]=i):i=e[4],i}function zn(t){const e=h.c(31),{user:s,userImage:o,hasInvites:n,showInvitesItem:l}=t,[i,r]=N.useState(!1),[c,d]=N.useState(!1);let m;e[0]!==n||e[1]!==s.email||e[2]!==s.name||e[3]!==o?(m=()=>a.jsxs("div",{className:"relative",children:[a.jsx(Y,{url:o,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),n&&a.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]=n,e[1]=s.email,e[2]=s.name,e[3]=o,e[4]=m):m=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsxs(G.Item,{onClick:()=>r(!0),children:[a.jsx(Ue,{className:"text-muted-foreground",size:18}),"Profile"]}),e[5]=u):u=e[5];let f;e[6]!==n||e[7]!==l?(f=l&&a.jsxs(G.Item,{onClick:()=>d(!0),children:[a.jsx(Le,{className:"text-muted-foreground",size:18}),"Invitations",n&&a.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=n,e[7]=l,e[8]=f):f=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(G.Separator,{}),e[9]=x):x=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(pt,{className:"w-4 h-4 text-muted-foreground"}),e[10]=p):p=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(G.Item,{asChild:!0,children:a.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",a.jsx(be,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=a.jsx(Pe,{className:"text-muted-foreground",size:18}),e[12]=g):g=e[12];let b,v;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=a.jsx(G.Item,{asChild:!0,children:a.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[g,"Homepage",a.jsx(be,{size:18,className:"ml-auto text-muted-foreground"})]})}),v=a.jsx(G.Separator,{}),e[13]=b,e[14]=v):(b=e[13],v=e[14]);let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C=a.jsxs(G.Item,{onClick:En,children:[a.jsx(De,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=C):C=e[15];let S;e[16]!==m||e[17]!==f||e[18]!==s?(S=a.jsxs(G,{user:s,trigger:m,align:"end",children:[u,f,x,w,b,v,C]}),e[16]=m,e[17]=f,e[18]=s,e[19]=S):S=e[19];let y;e[20]!==i||e[21]!==s||e[22]!==o?(y=i&&a.jsx(On,{open:i,onOpenChange:r,user:s,userImage:o}),e[20]=i,e[21]=s,e[22]=o,e[23]=y):y=e[23];let j;e[24]!==c||e[25]!==l?(j=l&&c&&a.jsx(Tn,{open:c,onOpenChange:d}),e[24]=c,e[25]=l,e[26]=j):j=e[26];let _;return e[27]!==S||e[28]!==y||e[29]!==j?(_=a.jsxs(a.Fragment,{children:[S,y,j]}),e[27]=S,e[28]=y,e[29]=j,e[30]=_):_=e[30],_}function En(){return Q.signOut()}function Pn(){const{data:t}=Q.useSession(),e=N.useContext(ht),{data:s}=e.hooks.useListUserInvitations(),n=(s??[]).length>0;if(!t?.user)return a.jsx(Y,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const l=t.user,i={...l,name:l.name??void 0},r=l.image;return a.jsx(zn,{user:i,userImage:r,hasInvites:n,showInvitesItem:!0})}function An(t){const e=h.c(6),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(gt,{children:a.jsx(Ne,{})}),e[0]=o):o=e[0];let n;e[1]!==s?(n=a.jsx(bt,{children:s}),e[1]=s,e[2]=n):n=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(jt,{children:a.jsx(vt,{to:"/login",replace:!0})}),e[3]=l):l=e[3];let i;return e[4]!==n?(i=a.jsxs(a.Fragment,{children:[o,n,l]}),e[4]=n,e[5]=i):i=e[5],i}function Rn(t){const e=h.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=$("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==s||e[3]!==n?(l=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=l):l=e[4],l}function Dn(t){const e=h.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=$("flex items-center justify-center px-2 h-full border-r border-border",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==s||e[3]!==n?(l=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=l):l=e[4],l}function Ln(t){const e=h.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=$("flex items-center gap-2 px-2 h-full",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==s||e[3]!==n?(l=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=l):l=e[4],l}function Bn(t){const e=h.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=$("flex items-center gap-2 px-2 h-full flex-1",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==s||e[3]!==n?(l=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=l):l=e[4],l}function Un(t){const e=h.c(5),{children:s,className:o}=t;let n;e[0]!==o?(n=$("flex items-center gap-2 px-2 h-full ml-auto",o),e[0]=o,e[1]=n):n=e[1];let l;return e[2]!==s||e[3]!==n?(l=a.jsx("div",{className:n,children:s}),e[2]=s,e[3]=n,e[4]=l):l=e[4],l}function Hn(){const t=h.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:a.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:a.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.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,s,a.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:a.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=o):o=t[2],o}const ee=Object.assign(Rn,{Sidebar:Dn,Left:Ln,Center:Bn,Right:Un,Skeleton:Hn});function Gn(){const t=h.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsxs("div",{className:"flex items-center gap-3",children:[e,a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),a.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:a.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[s,a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),a.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=o):o=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:a.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[a.jsx(te,{align:"right",width:"w-3/4"}),a.jsx(te,{align:"left",width:"w-full",lines:3}),a.jsx(te,{align:"right",width:"w-2/3"}),a.jsx(te,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=n):n=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:a.jsx("div",{className:"relative flex-1",children:a.jsxs("div",{className:"space-y-2 p-2",children:[a.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),a.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=l):l=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("div",{className:"flex items-center gap-1",children:a.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=i):i=t[5];let r;return t[6]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[o,n,a.jsx("div",{className:"px-4 py-4",children:a.jsx("div",{className:"mx-auto w-full max-w-2xl",children:a.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[l,a.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[i,a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),a.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=r):r=t[6],r}function te(t){const e=h.c(22),{align:s,width:o,lines:n}=t,l=o===void 0?"w-full":o,i=n===void 0?1:n,r=s==="right"?"flex-row-reverse":"flex-row";let c;e[0]!==r?(c=$("flex w-full gap-4 px-4 py-2",r),e[0]=r,e[1]=c):c=e[1];const d=s==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let m;e[2]!==d?(m=$("flex min-w-0 flex-col gap-2",d),e[2]=d,e[3]=m):m=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=u):u=e[4];const f=s==="right"?"bg-muted":"bg-transparent border border-border/40";let x;e[5]!==f||e[6]!==l?(x=$("min-w-0 rounded-2xl p-4",f,l),e[5]=f,e[6]=l,e[7]=x):x=e[7];let p;e[8]!==i?(p=Array.from({length:i}),e[8]=i,e[9]=p):p=e[9];let w;e[10]!==i||e[11]!==p?(w=a.jsx("div",{className:"space-y-2",children:p.map((C,S)=>a.jsx("div",{className:$("h-3 rounded bg-muted-foreground/20 animate-pulse",S===i-1?"w-3/4":"w-full"),style:{animationDelay:`${S*.1}s`}},S))}),e[10]=i,e[11]=p,e[12]=w):w=e[12];let g;e[13]!==w||e[14]!==x?(g=a.jsx("div",{className:x,children:w}),e[13]=w,e[14]=x,e[15]=g):g=e[15];let b;e[16]!==g||e[17]!==m?(b=a.jsxs("div",{className:m,children:[u,g]}),e[16]=g,e[17]=m,e[18]=b):b=e[18];let v;return e[19]!==b||e[20]!==c?(v=a.jsx("div",{className:c,children:b}),e[19]=b,e[20]=c,e[21]=v):v=e[21],v}function Je(){const t=h.c(3),{toggleSidebar:e}=fe();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(Re,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:20}),t[0]=s):s=t[0];let o;return t[1]!==e?(o=a.jsx(a.Fragment,{children:a.jsx(W,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:s})}),t[1]=e,t[2]=o):o=t[2],o}Je.Skeleton=function(){return a.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})};const Wn="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function we(t){const e=h.c(18),{showSidebarToggle:s,showOrgSwitcher:o,showDecoChat:n}=t,l=s===void 0?!1:s,i=o===void 0?!1:o,r=n===void 0?!1:n,[,c]=ue();let d;e[0]!==c?(d=()=>c(Vn),e[0]=c,e[1]=d):d=e[1];const m=d;let u;e[2]!==l?(u=l&&a.jsx(ee.Sidebar,{children:a.jsx(Je,{})}),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==i?(f=i&&a.jsx(N.Suspense,{fallback:a.jsx(ce.Skeleton,{}),children:a.jsx(ce,{})}),e[4]=i,e[5]=f):f=e[5];let x;e[6]!==f?(x=a.jsx(ee.Left,{children:f}),e[6]=f,e[7]=x):x=e[7];let p;e[8]!==r||e[9]!==m?(p=r&&a.jsxs(W,{size:"sm",variant:"default",onClick:m,children:[a.jsx(Y,{url:Wn,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[8]=r,e[9]=m,e[10]=p):p=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=a.jsx(Pn,{}),e[11]=w):w=e[11];let g;e[12]!==p?(g=a.jsxs(ee.Right,{className:"gap-2",children:[p,w]}),e[12]=p,e[13]=g):g=e[13];let b;return e[14]!==g||e[15]!==u||e[16]!==x?(b=a.jsxs(ee,{children:[u,x,g]}),e[14]=g,e[15]=u,e[16]=x,e[17]=b):b=e[17],b}function Vn(t){return!t}function Fn(t){const e=h.c(10),{children:s,className:o}=t,[,n]=N.useTransition();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=oe.decoChatPanelWidth(),e[0]=l):l=e[0];const[i,r]=ae(l,30);let c;e[1]!==r?(c=f=>n(()=>r(f)),e[1]=r,e[2]=c):c=e[2];const d=c;let m;e[3]!==o?(m=$("min-w-0",o),e[3]=o,e[4]=m):m=e[4];let u;return e[5]!==i||e[6]!==s||e[7]!==d||e[8]!==m?(u=a.jsx(ye,{defaultSize:i,minSize:20,className:m,onResize:d,children:s}),e[5]=i,e[6]=s,e[7]=d,e[8]=m,e[9]=u):u=e[9],u}function Kn(t){const e=h.c(5),{children:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=oe.sidebarOpen(),e[0]=o):o=e[0];const[n,l]=ae(o,!0);let i;return e[1]!==s||e[2]!==l||e[3]!==n?(i=a.jsx(Bs,{open:n,onOpenChange:l,children:s}),e[1]=s,e[2]=l,e[3]=n,e[4]=i):i=e[4],i}function Zn(){const t=h.c(9),[e]=ue();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=a.jsx(ye,{className:"bg-background",children:a.jsx(Ce,{})}),t[0]=s):s=t[0];let o;t[1]!==e?(o=a.jsx(qt,{withHandle:e}),t[1]=e,t[2]=o):o=t[2];const n=e?"max-w-none":"max-w-0";let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=a.jsx(me,{children:a.jsx(N.Suspense,{fallback:a.jsx(Gn,{}),children:a.jsx(_s,{})})}),t[3]=l):l=t[3];let i;t[4]!==n?(i=a.jsx(Fn,{className:n,children:l}),t[4]=n,t[5]=i):i=t[5];let r;return t[6]!==o||t[7]!==i?(r=a.jsxs(Qt,{direction:"horizontal",children:[s,o,i]}),t[6]=o,t[7]=i,t[8]=r):r=t[8],r}function Yn(){const t=h.c(16);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=de(e);let o;t[1]!==s?(o=Se.activeOrganization(s),t[1]=s,t[2]=o):o=t[2];let n;t[3]!==s?(n=async()=>{if(!s)return null;const{data:f}=await Q.organization.setActive({organizationSlug:s});return{org:f,project:{slug:At}}},t[3]=s,t[4]=n):n=t[4];let l;t[5]!==o||t[6]!==n?(l={queryKey:o,queryFn:n,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=o,t[6]=n,t[7]=l):l=t[7];const{data:i}=wt(l);if(!i){let f;t[8]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(we,{}),t[8]=f):f=t[8];let x;return t[9]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsxs("div",{className:"min-h-screen bg-background",children:[f,a.jsx("div",{className:"pt-12",children:a.jsx(Ce,{})})]}),t[9]=x):x=t[9],x}let r;t[10]===Symbol.for("react.memo_cache_sentinel")?(r=a.jsx(we,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=r):r=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=a.jsx(an,{}),t[12]=d):d=t[12];let m;t[13]===Symbol.for("react.memo_cache_sentinel")?(m=a.jsx(Kn,{children:a.jsxs("div",{className:"flex flex-col h-screen",children:[r,a.jsxs(Gs,{className:"flex-1 bg-sidebar",style:c,children:[d,a.jsx(Vs,{className:"pt-12",children:a.jsx(Zn,{})})]})]})}),t[13]=m):m=t[13];let u;return t[14]!==i?(u=a.jsx(Pt,{...i,children:m}),t[14]=i,t[15]=u):u=t[15],u}function Ua(){const t=h.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=a.jsx(An,{children:a.jsx(N.Suspense,{fallback:a.jsx(Ne,{}),children:a.jsx(Yn,{})})}),t[0]=e):e=t[0],e}export{Ua as default};
@@ -1 +0,0 @@
1
- import{ad as u,a9 as s}from"./index-Wt1f1puE.js";function o(e,r){return u(e,s,r)}export{o as u};
@@ -1 +0,0 @@
1
- import{a as L,f as P,r as b,j as e,c as k}from"./index-Wt1f1puE.js";import{d as _}from"./well-known-mcp-D13f-8h2.js";import{C as M}from"./collection-tab-CislJm1o.js";import{a as R,u as z}from"./use-connection-Bw5VjMDS.js";import{u as B}from"./tooltip-TfGvrkSe.js";import{B as y}from"./button-DekBQWZX.js";import{E as A}from"./SearchMd-CTe41Otq.js";import{C as F}from"./collection-header-BzcsMkVk.js";import{u as O,b as H}from"./use-binding-C0D0SiIL.js";import{i as T}from"./Loading01-CYe6KHQ_.js";import"./generate-id-Dyweu44Y.js";import"./collection-display-button-CcmMGuN1.js";import"./dropdown-menu-DEOghZY2.js";import"./Grid01-C9Qy-QMm.js";import"./view-mode-toggle-CP1Lj0do.js";import"./collection-search-D31FObj2.js";import"./input-BKIlqldN.js";import"./card-CjPFi-mt.js";import"./Copy01-Do_2DOpc.js";import"./DotsVertical-DEHJGPWq.js";import"./use-list-state-BFqdzcLT.js";import"./use-mobile-DxFWm-MR.js";import"./Trash01-nRDGqZAh.js";import"./collection-table-wrapper-DttYG93Q.js";import"./empty-state-DPKHlkpV.js";import"./Inbox01-D6ujw7pC.js";import"./avatar-DYifUjuR.js";import"./useQuery-xVxOaLKm.js";import"./pin-to-sidebar-button-kBAZ-5ye.js";import"./use-organization-settings-DNW7rc_y.js";import"./constants-BP-f87DW.js";import"./alert-dialog-BU4z5vIU.js";import"./Plus-B_341Z-m.js";import"./layout-DZ2ngf-d.js";import"./ArrowLeft-Dh26Pdy9.js";import"./auth-DrOI2Q5h.js";function V({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const r=R(),{org:{slug:m}}=B(),{data:h}=L.useSession(),d=P(),[a,w]=b.useState(!1),l=async()=>{if(!(!o||!h?.user?.id)){w(!0);try{const c=await r.create.mutateAsync(o);s?.(c.id),d({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{w(!1)}}},j=()=>{d({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(A,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(y,{variant:"outline",onClick:l,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(y,{variant:"outline",onClick:j,children:"Install MCP Server"})]})})}function q(i){const t=k.c(28),{bindingName:o,collectionName:n,title:s,emptyState:r,wellKnownMcp:m}=i,{org:h}=B(),d=z();let a;t[0]!==d||t[1]!==o?(a={connections:d,binding:o},t[0]=d,t[1]=o,t[2]=a):a=t[2];const l=O(a)[0],j=H(l);let c;if(t[3]!==n||t[4]!==j){let C;t[6]!==n?(C=$=>$.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=C):C=t[7],c=j.find(C),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const S=c,[E,W]=b.useState(null),N=l&&S&&(l.id||E);let f;t[8]!==s?(f=e.jsx(F,{title:s}),t[8]=s,t[9]=f):f=t[9];let I;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=e.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=I):I=t[10];let p;t[11]!==s?(p=s.toLowerCase(),t[11]=s,t[12]=p):p=t[12];let u;t[13]!==p?(u=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[I,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",p,"..."]})]}),t[13]=p,t[14]=u):u=t[14];let g;t[15]!==S||t[16]!==l||t[17]!==r||t[18]!==h||t[19]!==N||t[20]!==m?(g=N?e.jsx(M,{connectionId:l.id,org:h.slug,activeCollection:S}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(V,{title:r.title,description:r.description,wellKnownMcp:m,imageSrc:r.imageSrc,onConnected:C=>{W(C)}})}),t[15]=S,t[16]=l,t[17]=r,t[18]=h,t[19]=N,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==u||t[23]!==g?(x=e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(b.Suspense,{fallback:u,children:g})}),t[22]=u,t[23]=g,t[24]=x):x=t[24];let v;return t[25]!==f||t[26]!==x?(v=e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[f,x]}),t[25]=f,t[26]=x,t[27]=v):v=t[27],v}function kt(){const i=k.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:_()}),i[0]=t):t=i[0],t}export{kt as default};