@decocms/mesh 1.0.0-alpha.45 → 1.0.0-alpha.46

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 (104) hide show
  1. package/dist/client/assets/{AlertCircle-DVbk7l75.js → AlertCircle-Cu9USDUK.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-B2q5Ncqe.js → ArrowLeft-nKBVB_NL.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-2faIvy7x.js → CheckCircle-BogvGi-0.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BAEvQsP1.js → ChevronDown-B5vWNgW1.js} +1 -1
  5. package/dist/client/assets/{Clock-BkOYcDQ1.js → Clock-Ck2lYkyl.js} +1 -1
  6. package/dist/client/assets/{Copy01-CwQ47sCB.js → Copy01-BeUF9LPk.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-Bxoen-sS.js → CpuChip02-8BkRby_U.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-Rjkn1qAc.js → DotsVertical-CmKPHj4W.js} +1 -1
  9. package/dist/client/assets/{File06-Cml7_jh5.js → File06-Cn7JLPIx.js} +1 -1
  10. package/dist/client/assets/{Grid01-iXkiGD-C.js → Grid01-4uSGUJjV.js} +1 -1
  11. package/dist/client/assets/{Inbox01-48LwpeyS.js → Inbox01-C8nofD1D.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-Db_224Lw.js → InfoCircle-C21KXVBJ.js} +1 -1
  13. package/dist/client/assets/{Key01-BBl7lwdX.js → Key01-CzDrcb2u.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-CGdbeXVa.js → LinkExternal01-DhNFEAza.js} +1 -1
  15. package/dist/client/assets/{Loading01-EBx-peK5.js → Loading01-BUZAT-Ht.js} +1 -1
  16. package/dist/client/assets/{Plus-fvCbDfFA.js → Plus-DTWKiMkv.js} +1 -1
  17. package/dist/client/assets/{SearchMd-CoQHJpld.js → SearchMd-BXC4Yoz_.js} +1 -1
  18. package/dist/client/assets/{Trash01-B-JvszLz.js → Trash01-KhsmIXrl.js} +1 -1
  19. package/dist/client/assets/{Upload01-CFmdCG3U.js → Upload01-Dm3ykMHj.js} +1 -1
  20. package/dist/client/assets/{X-EXSAob0c.js → X-BFstV52u.js} +1 -1
  21. package/dist/client/assets/{XClose-JKlhATZH.js → XClose-OisY7Sog.js} +1 -1
  22. package/dist/client/assets/{alert-dialog-BuGENs_x.js → alert-dialog-Ck-TQRXx.js} +2 -2
  23. package/dist/client/assets/{auth-EiU0mg3W.js → auth-DB_JGgAS.js} +1 -1
  24. package/dist/client/assets/{auth-catchall-J-s0UOos.js → auth-catchall-DDvXFYk4.js} +1 -1
  25. package/dist/client/assets/{avatar-ChLJBc_Q.js → avatar-CqnXtnOZ.js} +1 -1
  26. package/dist/client/assets/{badge-xSWfUH8C.js → badge-RGvdF-cd.js} +1 -1
  27. package/dist/client/assets/{button-DkKLNB2C.js → button-Chm7HSn5.js} +1 -1
  28. package/dist/client/assets/{card-pUBjGsjy.js → card-BVamKRXq.js} +1 -1
  29. package/dist/client/assets/{checkbox-CkDtf7-s.js → checkbox-BMbqVqRo.js} +1 -1
  30. package/dist/client/assets/{collection-detail-C5kf9NWv.js → collection-detail-UyMhNT0c.js} +1 -1
  31. package/dist/client/assets/{collection-display-button-DOaNnrf1.js → collection-display-button-DDw_0fW6.js} +1 -1
  32. package/dist/client/assets/{collection-header-BjOsszVr.js → collection-header-BVYMmoel.js} +1 -1
  33. package/dist/client/assets/{collection-page-BoULTFo5.js → collection-page-BoS9hpji.js} +1 -1
  34. package/dist/client/assets/{collection-search-BaQnC0wl.js → collection-search-CBHWh6W9.js} +1 -1
  35. package/dist/client/assets/{collection-table-wrapper-CWSD0OK_.js → collection-table-wrapper-CGsO_-78.js} +1 -1
  36. package/dist/client/assets/{connection-card-ChEGdD3i.js → connection-card-D6fhK6Cn.js} +1 -1
  37. package/dist/client/assets/connection-detail-ClFH3Tdf.js +1 -0
  38. package/dist/client/assets/{connections-BcVb3yyx.js → connections-BtC-4KRY.js} +1 -1
  39. package/dist/client/assets/{core-DEFgD5b5.js → core-BiybLldu.js} +1 -1
  40. package/dist/client/assets/{create-organization-dialog-CJAzmA5E.js → create-organization-dialog-D3ZZuPXS.js} +1 -1
  41. package/dist/client/assets/{deco-chat-skeleton-DdumS19s.js → deco-chat-skeleton-DHRag8GN.js} +3 -3
  42. package/dist/client/assets/{dialog-D5ajYIuQ.js → dialog-kXtxooG_.js} +1 -1
  43. package/dist/client/assets/{dropdown-menu-BwfRJqX3.js → dropdown-menu-MeaPHHuN.js} +1 -1
  44. package/dist/client/assets/{error-boundary-Ctu3eNTK.js → error-boundary-m5kquR9K.js} +1 -1
  45. package/dist/client/assets/{extract-connection-data-fIUwUi9M.js → extract-connection-data-BSn-ydRW.js} +1 -1
  46. package/dist/client/assets/{form-DGgpciyh.js → form-BBS_Tp5l.js} +1 -1
  47. package/dist/client/assets/formatDistanceToNow-Dkl3nWpl.js +1 -0
  48. package/dist/client/assets/gateway-detail-B6IgcRfH.js +1 -0
  49. package/dist/client/assets/{gateways-Ct2Ku_EE.js → gateways-Bu8MP7ql.js} +1 -1
  50. package/dist/client/assets/{home-Go7erQGg.js → home-BYCoW2D_.js} +1 -1
  51. package/dist/client/assets/{index-CgAMfaaZ.js → index-BZz7aGs7.js} +1 -1
  52. package/dist/client/assets/{index-CzwYLjKx.js → index-C4a1DvcM.js} +15 -15
  53. package/dist/client/assets/index-RS2MPOun.js +1 -0
  54. package/dist/client/assets/{index-CgmRhymO.js → index-hySmljwG.js} +1 -1
  55. package/dist/client/assets/{input-BGhWl8yr.js → input-DCV4VviT.js} +1 -1
  56. package/dist/client/assets/json-CtxcuNHM.js +1 -0
  57. package/dist/client/assets/{json-syntax-highlighter-eop-YGrL.js → json-syntax-highlighter-VMspUwuH.js} +2 -2
  58. package/dist/client/assets/{layout-H0Bo8Mbp.js → layout-BkDVhV_I.js} +1 -1
  59. package/dist/client/assets/{lazy-highlighter-BivZS2NT.js → lazy-highlighter-Bx9tA9px.js} +1 -1
  60. package/dist/client/assets/{localstorage-keys-T4QN4Ys2.js → localstorage-keys-G21128-2.js} +1 -1
  61. package/dist/client/assets/{login-s7Y9QERd.js → login-DEwqVT25.js} +1 -1
  62. package/dist/client/assets/{mcp-oauth-BpODx-Yp.js → mcp-oauth-Cm2UNUay.js} +1 -1
  63. package/dist/client/assets/{members-YsCX_fsX.js → members-BpGlve-L.js} +1 -1
  64. package/dist/client/assets/{monitoring-DLmYpM2E.js → monitoring-DHEto-A6.js} +1 -1
  65. package/dist/client/assets/{oauth-callback-J1YUg9b4.js → oauth-callback-DchNKQy2.js} +1 -1
  66. package/dist/client/assets/{page-BnR6MH5w.js → page-DGoTXd70.js} +1 -1
  67. package/dist/client/assets/{popover-C7aR-HSJ.js → popover-Cx3pFfUQ.js} +1 -1
  68. package/dist/client/assets/prism-light-DhG4KyCm.js +1 -0
  69. package/dist/client/assets/{resource-tabs-DetRi2Tz.js → resource-tabs-n23Yoxcd.js} +1 -1
  70. package/dist/client/assets/{schema-DefbPj25.js → schema-DIY49r7a.js} +1 -1
  71. package/dist/client/assets/{select-C-8wPfQb.js → select-BXHiOY7b.js} +1 -1
  72. package/dist/client/assets/{settings-lBAYGURO.js → settings-BwVTvZ32.js} +1 -1
  73. package/dist/client/assets/{shell-layout-BURBkVcQ.js → shell-layout-BqZsnuW0.js} +1 -1
  74. package/dist/client/assets/{spinner-C91qSR1a.js → spinner-zi1IadXF.js} +1 -1
  75. package/dist/client/assets/{store-Dbm237Pg.js → store-Bu-y0GHn.js} +1 -1
  76. package/dist/client/assets/{store-app-detail-YHVcg9Z1.js → store-app-detail-BswrVEFL.js} +1 -1
  77. package/dist/client/assets/{switch-BYhk4sLo.js → switch-C8nDXRDi.js} +1 -1
  78. package/dist/client/assets/{textarea-BPpOx-7u.js → textarea-BA6caASm.js} +1 -1
  79. package/dist/client/assets/{tools-list-De28L5_g.js → tools-list-Cw4QW2l7.js} +1 -1
  80. package/dist/client/assets/{tooltip-CRtbHuaD.js → tooltip-DZ8PMo3S.js} +1 -1
  81. package/dist/client/assets/{types-B0H390FJ.js → types-DsEr-_hk.js} +1 -1
  82. package/dist/client/assets/{use-binding-BZo_dE4c.js → use-binding-C1zXgwae.js} +2 -2
  83. package/dist/client/assets/{use-connection-D2GoBb_z.js → use-connection-8aFd9ZgQ.js} +1 -1
  84. package/dist/client/assets/use-connection-resources-BaWWtVSI.js +1 -0
  85. package/dist/client/assets/{use-gateway-CJINNdSX.js → use-gateway-BGsZlt6a.js} +1 -1
  86. package/dist/client/assets/{use-list-state-BjDzxCt9.js → use-list-state-DhJWwg48.js} +1 -1
  87. package/dist/client/assets/{use-mcp-BBboucHu.js → use-mcp-BJzX7M7c.js} +1 -1
  88. package/dist/client/assets/{use-members-DsKRDzl_.js → use-members-BNSWYzmJ.js} +1 -1
  89. package/dist/client/assets/{use-mobile-B89ZoGbj.js → use-mobile-BQAr1bEF.js} +1 -1
  90. package/dist/client/assets/{use-organization-settings-C32KUUMU.js → use-organization-settings-CAOHB7nk.js} +1 -1
  91. package/dist/client/assets/{use-tool-call-B6UiQKbH.js → use-tool-call-Dxebi6Uq.js} +1 -1
  92. package/dist/client/assets/useQuery-39cprZL6.js +1 -0
  93. package/dist/client/assets/utils-BXNVuJET.js +1 -0
  94. package/dist/client/assets/{well-known-mcp-DBI1FVpY.js → well-known-mcp-DizRQm94.js} +1 -1
  95. package/dist/client/index.html +1 -1
  96. package/package.json +1 -1
  97. package/dist/client/assets/connection-detail-BzeSW6yw.js +0 -1
  98. package/dist/client/assets/formatDistanceToNow-Do6wCvgQ.js +0 -1
  99. package/dist/client/assets/gateway-detail-dibsJ_Dr.js +0 -1
  100. package/dist/client/assets/index-Cg6DdXuN.js +0 -1
  101. package/dist/client/assets/json-xSSJeQ8M.js +0 -1
  102. package/dist/client/assets/prism-light-qQIH26P8.js +0 -1
  103. package/dist/client/assets/useQuery-CbqX0Fzv.js +0 -1
  104. package/dist/client/assets/utils-D1FAHWbf.js +0 -1
@@ -1 +1 @@
1
- import{r as I,c as P,d as Q,j as t,av as ie,x as Ne,y as ue,v as ye,w as le,h as we,b as Se,t as Ce}from"./index-CzwYLjKx.js";import{U as V,f as fe,d as ce,c as ne,b as xe,I as ke,n as Ie}from"./use-connection-D2GoBb_z.js";import{d as _e,C as H,e as $e,I as Ee,k as me,G as Te,M as Ae}from"./deco-chat-skeleton-DdumS19s.js";import{E as oe}from"./SearchMd-CoQHJpld.js";import{E as Y}from"./error-boundary-Ctu3eNTK.js";import{u as ze,L as Me}from"./localstorage-keys-T4QN4Ys2.js";import{u as Pe,a as Oe,c as Be,b as De,T as Fe}from"./tooltip-CRtbHuaD.js";import{B as W}from"./button-DkKLNB2C.js";import{F as R,a as he,b as J,c as X,d as Z}from"./form-DGgpciyh.js";import{I as ee}from"./input-BGhWl8yr.js";import{T as te}from"./textarea-BPpOx-7u.js";import{c as K}from"./utils-D1FAHWbf.js";import{A as Le}from"./use-binding-BZo_dE4c.js";import{i as G}from"./Loading01-EBx-peK5.js";import{s as Re}from"./Plus-fvCbDfFA.js";import{i as Ue}from"./Upload01-CFmdCG3U.js";import{V as de,b as se,a as pe}from"./layout-H0Bo8Mbp.js";import{i as Ve}from"./AlertCircle-DVbk7l75.js";import{s as Je}from"./Clock-BkOYcDQ1.js";import{a as We}from"./Copy01-CwQ47sCB.js";import{i as Ge,J as qe}from"./json-syntax-highlighter-eop-YGrL.js";import{s as He}from"./XClose-JKlhATZH.js";import{u as Ke,O as Ze,M as Ye,P as Qe,E as Xe}from"./index-CgAMfaaZ.js";import{u as et}from"./use-mcp-BBboucHu.js";import"./Grid01-iXkiGD-C.js";import"./CpuChip02-Bxoen-sS.js";import"./select-C-8wPfQb.js";import"./ChevronDown-BAEvQsP1.js";import"./use-mobile-B89ZoGbj.js";import"./use-gateway-CJINNdSX.js";import"./connection-card-ChEGdD3i.js";import"./card-pUBjGsjy.js";import"./LinkExternal01-CGdbeXVa.js";import"./spinner-C91qSR1a.js";import"./File06-Cml7_jh5.js";import"./InfoCircle-Db_224Lw.js";import"./useQuery-CbqX0Fzv.js";import"./auth-EiU0mg3W.js";import"./ArrowLeft-B2q5Ncqe.js";import"./mcp-oauth-BpODx-Yp.js";import"./use-organization-settings-C32KUUMU.js";import"./use-tool-call-B6UiQKbH.js";import"./Key01-BBl7lwdX.js";import"./formatDistanceToNow-Do6wCvgQ.js";import"./extract-connection-data-fIUwUi9M.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-CgmRhymO.js";import"./index-Cg6DdXuN.js";import"./schema-DefbPj25.js";const ge=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));ge.displayName="Box";const je=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));je.displayName="Code01";const ve=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ve.displayName="Database01";const be=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M11 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.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));be.displayName="Edit05";const re=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));re.displayName="Users02";function tt(s){const e=P.c(3),{gatewayId:n,onSelect:r}=s,{data:o}=$e(n);if(o.length===0)return null;let l;return e[0]!==r||e[1]!==o?(l=t.jsx(Ee,{prompts:o,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=o,e[2]=l):l=e[2],l}function st(s){const e=P.c(20),{form:n}=s;let r;e[0]!==n?(r=p=>{const{field:g}=p;return t.jsx(dt,{size:"md",value:g.value,onChange:g.onChange,alt:n.watch("title")})},e[0]=n,e[1]=r):r=e[1];let o;e[2]!==n.control||e[3]!==r?(o=t.jsx(R,{control:n.control,name:"avatar",render:r}),e[2]=n.control,e[3]=r,e[4]=o):o=e[4];let l;e[5]!==n.control?(l=t.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[t.jsx(R,{control:n.control,name:"title",render:at}),t.jsx(R,{control:n.control,name:"description",render:lt})]}),e[5]=n.control,e[6]=l):l=e[6];let a;e[7]!==o||e[8]!==l?(a=t.jsxs("div",{className:"flex gap-4 items-start",children:[o,l]}),e[7]=o,e[8]=l,e[9]=a):a=e[9];let i,c;e[10]!==n.control?(i=t.jsxs("div",{className:"flex gap-4",children:[t.jsx(R,{control:n.control,name:"gateway_id",render:rt}),t.jsx(R,{control:n.control,name:"model",render:ot})]}),c=t.jsx(R,{control:n.control,name:"system_prompt",render:nt}),e[10]=n.control,e[11]=i,e[12]=c):(i=e[11],c=e[12]);let m;e[13]!==a||e[14]!==i||e[15]!==c?(m=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[a,i,c]}),e[13]=a,e[14]=i,e[15]=c,e[16]=m):m=e[16];let f;return e[17]!==n||e[18]!==m?(f=t.jsx(he,{...n,children:m}),e[17]=n,e[18]=m,e[19]=f):f=e[19],f}function nt(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 flex flex-col min-h-0",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"System prompt"}),t.jsx(Z,{children:t.jsx(te,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function ot(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Model"}),t.jsx(Ae,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:n=>e.onChange({id:n.id,connectionId:n.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function rt(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Gateway"}),t.jsx(Te,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function lt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(Z,{children:t.jsx(ee,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function at(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Name"}),t.jsx(Z,{children:t.jsx(ee,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function it(s){const e=P.c(62),{activeThreadId:n,mode:r,assistant:o,form:l}=s;let a;e[0]!==n||e[1]!==o.system_prompt?(a={threadId:n,systemPrompt:o.system_prompt},e[0]=n,e[1]=o.system_prompt,e[2]=a):a=e[2];const i=_e(a),c=!!o.gateway_id&&!!o.model?.id&&!!o.model?.connectionId;let m;e[3]!==n||e[4]!==o.gateway_id||e[5]!==o.model||e[6]!==i||e[7]!==c?(m=async L=>{if(!c)return;const U={created_at:new Date().toISOString(),thread_id:n,model:{id:o.model.id,connectionId:o.model.connectionId},gateway:{id:o.gateway_id??""},user:{name:"you"}};await i.sendMessage(L,U)},e[3]=n,e[4]=o.gateway_id,e[5]=o.model,e[6]=i,e[7]=c,e[8]=m):m=e[8];const f=m;let p;e[9]!==o.avatar||e[10]!==o.title?(p=o.avatar?t.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:t.jsx("img",{src:o.avatar,alt:o.title,className:"h-full w-full object-cover"})}):t.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:t.jsx(re,{size:28,className:"text-muted-foreground"})}),e[9]=o.avatar,e[10]=o.title,e[11]=p):p=e[11];let g;e[12]!==o.title?(g=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:o.title}),e[12]=o.title,e[13]=g):g=e[13];let x;e[14]!==o.description?(x=o.description?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:o.description}):null,e[14]=o.description,e[15]=x):x=e[15];let _;e[16]!==p||e[17]!==g||e[18]!==x?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[p,g,x]}),e[16]=p,e[17]=g,e[18]=x,e[19]=_):_=e[19];let u;e[20]!==o.gateway_id||e[21]!==f?(u=o.gateway_id&&t.jsx(Y,{fallback:null,children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(G,{size:20,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tt,{gatewayId:o.gateway_id,onSelect:L=>{f(L.description??L.name)}})})}),e[20]=o.gateway_id,e[21]=f,e[22]=u):u=e[22];let k;e[23]!==_||e[24]!==u?(k=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-8 text-center",children:[_,u]}),e[23]=_,e[24]=u,e[25]=k):k=e[25];const j=k;let b;e[26]!==i.messages?(b=i.messages.filter(ct),e[26]=i.messages,e[27]=b):b=e[27];const w=b,h=r==="edit",N=h?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let $;e[28]!==N?($=K("absolute inset-0 px-2 transition-opacity duration-200 ease-out",N),e[28]=N,e[29]=$):$=e[29];let S;e[30]!==l?(S=t.jsx(st,{form:l}),e[30]=l,e[31]=S):S=e[31];let C;e[32]!==$||e[33]!==S?(C=t.jsx("div",{className:$,children:S}),e[32]=$,e[33]=S,e[34]=C):C=e[34];const A=h?"opacity-0 pointer-events-none":"opacity-100";let z;e[35]!==A?(z=K("h-full transition-opacity duration-200 ease-out",A),e[35]=A,e[36]=z):z=e[36];let T;e[37]!==i.messages||e[38]!==i.status||e[39]!==j||e[40]!==w.length?(T=w.length===0?t.jsx(H.EmptyState,{children:j}):t.jsx(H.Messages,{messages:i.messages,status:i.status,minHeightOffset:240}),e[37]=i.messages,e[38]=i.status,e[39]=j,e[40]=w.length,e[41]=T):T=e[41];let E;e[42]!==z||e[43]!==T?(E=t.jsx("div",{className:z,children:T}),e[42]=z,e[43]=T,e[44]=E):E=e[44];let M;e[45]!==C||e[46]!==E?(M=t.jsxs(H.Main,{className:"h-full relative overflow-hidden",innerClassName:"px-2",children:[C,E]}),e[45]=C,e[46]=E,e[47]=M):M=e[47];const d=h?"translate-y-full":"translate-y-0";let v;e[48]!==d?(v=K("transition-transform duration-300 ease-out",d),e[48]=d,e[49]=v):v=e[49];const y=!c,O=i.status==="submitted"||i.status==="streaming";let B;e[50]!==i.messages||e[51]!==i.stop||e[52]!==f||e[53]!==y||e[54]!==O?(B=t.jsx(H.Footer,{children:t.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:t.jsx(H.Input,{onSubmit:f,onStop:i.stop,disabled:y,isStreaming:O,placeholder:"Ask anything or @ for context",usageMessages:i.messages})})}),e[50]=i.messages,e[51]=i.stop,e[52]=f,e[53]=y,e[54]=O,e[55]=B):B=e[55];let D;e[56]!==v||e[57]!==B?(D=t.jsx("div",{className:v,children:B}),e[56]=v,e[57]=B,e[58]=D):D=e[58];let F;return e[59]!==M||e[60]!==D?(F=t.jsxs(H,{children:[M,D]}),e[59]=M,e[60]=D,e[61]=F):F=e[61],F}function ct(s){return s.role!=="system"}function dt(s){const e=P.c(18),{value:n,onChange:r,alt:o,size:l}=s,a=l===void 0?"md":l,i=I.useRef(null),c=a==="xs"?"h-6 w-6":a==="sm"?"h-8 w-8":"h-16 w-16",m=a==="xs"?"h-3 w-3":a==="sm"?"h-4 w-4":"h-6 w-6",f=a==="xs"?"h-3 w-3":a==="sm"?"h-3.5 w-3.5":"h-5 w-5";let p;e[0]!==r?(p=$=>{const S=$.target.files?.[0];if(!S)return;const C=new FileReader;C.onloadend=()=>{const A=C.result;r(A)},C.readAsDataURL(S)},e[0]=r,e[1]=p):p=e[1];const g=p;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{i.current?.click()},e[2]=x):x=e[2];const _=x,u=`relative ${c} shrink-0 cursor-pointer group`;let k;e[3]!==g?(k=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:g}),e[3]=g,e[4]=k):k=e[4];let j;e[5]!==o||e[6]!==m||e[7]!==n?(j=n?t.jsx("img",{src:n,alt:o||"Avatar",className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:t.jsx(re,{className:m})}),e[5]=o,e[6]=m,e[7]=n,e[8]=j):j=e[8];const b=`${f} text-white`;let w;e[9]!==b?(w=t.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:t.jsx(Ue,{className:b})}),e[9]=b,e[10]=w):w=e[10];let h;e[11]!==j||e[12]!==w?(h=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[j,w]}),e[11]=j,e[12]=w,e[13]=h):h=e[13];let N;return e[14]!==u||e[15]!==k||e[16]!==h?(N=t.jsxs("div",{className:u,onClick:_,children:[k,h]}),e[14]=u,e[15]=k,e[16]=h,e[17]=N):N=e[17],N}function mt(s){const e=P.c(49),{providerId:n,assistantId:r,onBack:o}=s,l=ie();let a;e[0]!==o||e[1]!==l?(a=o??(()=>l.history.back()),e[0]=o,e[1]=l,e[2]=a):a=e[2];const i=a,{locator:c}=Pe();let m;e[3]!==r||e[4]!==c?(m=Me.assistantChatActiveThread(c,r),e[3]=r,e[4]=c,e[5]=m):m=e[5];const[f,p]=ze(m,ut),g=n||V;let x;e[6]!==g?(x=ne(g),e[6]=g,e[7]=x):x=e[7];const _=x,u=fe(n,"ASSISTANT",r,_),k=ce(n,"ASSISTANT",_),j=k.update.isPending,[b,w]=I.useState(u?.model.id&&u?.gateway_id?"chat":"edit");let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Ne(Le),e[8]=h):h=e[8];const N=u??void 0;let $;e[9]!==N?($={resolver:h,values:N},e[9]=N,e[10]=$):$=e[10];const S=ue($);let C;e[11]!==k.update||e[12]!==r||e[13]!==S?(C=S.handleSubmit(async D=>{const F=await k.update.mutateAsync({id:r,data:D});S.reset(F),w("chat")}),e[11]=k.update,e[12]=r,e[13]=S,e[14]=C):C=e[14];const A=C;if(!u){let D;e[15]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(me,{}),e[15]=D):D=e[15];let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=F):F=e[16];let L;return e[17]!==i?(L=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:D,children:t.jsx(se,{onBack:i,children:F})})}),e[17]=i,e[18]=L):L=e[18],L}let z;e[19]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(me,{}),e[19]=z):z=e[19];let T;e[20]!==u.avatar||e[21]!==u.title?(T=t.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:u.avatar?t.jsx("img",{src:u.avatar,alt:u.title,className:"h-full w-full object-cover"}):t.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:t.jsx(re,{size:12,className:"text-muted-foreground"})})}),e[20]=u.avatar,e[21]=u.title,e[22]=T):T=e[22];let E;e[23]!==u.title?(E=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[23]=u.title,e[24]=E):E=e[24];let M;e[25]!==u.description?(M=u.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:u.description})]}):null,e[25]=u.description,e[26]=M):M=e[26];let d;e[27]!==E||e[28]!==M?(d=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[E,M]}),e[27]=E,e[28]=M,e[29]=d):d=e[29];let v;e[30]!==T||e[31]!==d?(v=t.jsx(pe,{children:t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T,d]})}),e[30]=T,e[31]=d,e[32]=v):v=e[32];let y;e[33]!==S.formState.isDirty||e[34]!==j||e[35]!==b||e[36]!==A||e[37]!==p?(y=t.jsx(de,{children:b==="chat"?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>p(crypto.randomUUID()),title:"New thread",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:t.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t.jsx("button",{type:"button",onClick:()=>w("edit"),title:"Edit",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:t.jsx(be,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(W,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:j,onClick:()=>w("chat"),children:"Cancel"}),t.jsx(W,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:!S.formState.isDirty||j,onClick:()=>{A()},children:j?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Saving..."]}):"Save"})]})}),e[33]=S.formState.isDirty,e[34]=j,e[35]=b,e[36]=A,e[37]=p,e[38]=y):y=e[38];let O;e[39]!==f||e[40]!==u||e[41]!==S||e[42]!==b?(O=t.jsx("div",{className:"h-full",children:t.jsx(it,{activeThreadId:f,mode:b,assistant:u,form:S},S.formState.submitCount)}),e[39]=f,e[40]=u,e[41]=S,e[42]=b,e[43]=O):O=e[43];let B;return e[44]!==i||e[45]!==v||e[46]!==y||e[47]!==O?(B=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:z,children:t.jsxs(se,{onBack:i,children:[v,y,O]})})}),e[44]=i,e[45]=v,e[46]=y,e[47]=O,e[48]=B):B=e[48],B}function ut(s){return s||crypto.randomUUID()}function ft(s){const e=P.c(6),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const a=Q(o).connectionId??V;if(!a||a===V){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==a||e[3]!==n||e[4]!==r?(i=t.jsx(mt,{providerId:a,assistantId:n,onBack:r}),e[2]=a,e[3]=n,e[4]=r,e[5]=i):i=e[5],i}ye({title:le().min(1),description:le().nullable(),body:le()});function ae(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function xt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(r=>r==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function ht(s){const e=P.c(13),{form:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let o;e[1]!==n.control?(o=t.jsxs("div",{className:"flex flex-col gap-4",children:[r,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(R,{control:n.control,name:"title",render:jt}),t.jsx(R,{control:n.control,name:"description",render:gt})]})]}),e[1]=n.control,e[2]=o):o=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let i;e[5]!==n.control?(i=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(R,{control:n.control,name:"body",render:pt})]}),e[5]=n.control,e[6]=i):i=e[6];let c;e[7]!==o||e[8]!==i?(c=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[o,i]}),e[7]=o,e[8]=i,e[9]=c):c=e[9];let m;return e[10]!==n||e[11]!==c?(m=t.jsx(he,{...n,children:c}),e[10]=n,e[11]=c,e[12]=m):m=e[12],m}function pt(s){const{field:e}=s;return t.jsx(J,{children:t.jsx(Z,{children:t.jsx(te,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function gt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(Z,{children:t.jsx(ee,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function jt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(Z,{children:t.jsx(ee,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function vt(s){const e=P.c(42),{providerId:n,promptId:r,onBack:o}=s,l=n||V;let a;e[0]!==l?(a=ne(l),e[0]=l,e[1]=a):a=e[1];const i=a,c=fe(n,"PROMPT",r,i),m=ce(n,"PROMPT",i),f=m.update.isPending;let p;e[2]!==c?(p=c?{title:c.title,description:c.description??null,body:ae(c)}:void 0,e[2]=c,e[3]=p):p=e[3];let g;e[4]!==p?(g={values:p},e[4]=p,e[5]=g):g=e[5];const x=ue(g);let _;e[6]!==x||e[7]!==c?(_=()=>{c&&x.reset({title:c.title,description:c.description??null,body:ae(c)})},e[6]=x,e[7]=c,e[8]=_):_=e[8];const u=_;let k;e[9]!==m.update||e[10]!==x||e[11]!==r?(k=x.handleSubmit(async d=>{const v=await m.update.mutateAsync({id:r,data:{title:d.title,description:d.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:d.body}}]}});x.reset({title:v.title,description:v.description??null,body:ae(v)})}),e[9]=m.update,e[10]=x,e[11]=r,e[12]=k):k=e[12];const j=k;if(!c){let d;return e[13]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=d):d=e[13],d}let b;e[14]!==c.title?(b=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:c.title}),e[14]=c.title,e[15]=b):b=e[15];let w;e[16]!==c.description?(w=c.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:c.description})]}):null,e[16]=c.description,e[17]=w):w=e[17];let h;e[18]!==b||e[19]!==w?(h=t.jsx(pe,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,w]})}),e[18]=b,e[19]=w,e[20]=h):h=e[20];const N=!x.formState.isDirty||f;let $;e[21]!==u||e[22]!==N?($=t.jsx(W,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:N,onClick:u,children:"Cancel"}),e[21]=u,e[22]=N,e[23]=$):$=e[23];const S=!x.formState.isDirty||f;let C;e[24]!==j?(C=()=>{j()},e[24]=j,e[25]=C):C=e[25];let A;e[26]!==f?(A=f?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Saving..."]}):"Save",e[26]=f,e[27]=A):A=e[27];let z;e[28]!==S||e[29]!==C||e[30]!==A?(z=t.jsx(W,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:S,onClick:C,children:A}),e[28]=S,e[29]=C,e[30]=A,e[31]=z):z=e[31];let T;e[32]!==$||e[33]!==z?(T=t.jsxs(de,{children:[$,z]}),e[32]=$,e[33]=z,e[34]=T):T=e[34];let E;e[35]!==x?(E=t.jsx("div",{className:"h-full",children:t.jsx(ht,{form:x})}),e[35]=x,e[36]=E):E=e[36];let M;return e[37]!==o||e[38]!==T||e[39]!==E||e[40]!==h?(M=t.jsxs(se,{onBack:o,children:[h,T,E]}),e[37]=o,e[38]=T,e[39]=E,e[40]=h,e[41]=M):M=e[41],M}function bt(s){const e=P.c(5),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=xt()??V,e[0]=o):o=e[0];const l=o;if(!l||l===V){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=i):i=e[1],i}let a;return e[2]!==n||e[3]!==r?(a=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:null,children:t.jsx(vt,{providerId:l,promptId:n,onBack:r})})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}const Nt=we("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function yt(s){const e=P.c(10);let n,r,o;e[0]!==s?({className:n,variant:o,...r}=s,e[0]=s,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let l;e[4]!==n||e[5]!==o?(l=K(Nt({variant:o}),n),e[4]=n,e[5]=o,e[6]=l):l=e[6];let a;return e[7]!==r||e[8]!==l?(a=t.jsx("div",{"data-slot":"alert",role:"alert",className:l,...r}),e[7]=r,e[8]=l,e[9]=a):a=e[9],a}function wt(s){const e=P.c(8);let n,r;e[0]!==s?({className:n,...r}=s,e[0]=s,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=t.jsx("div",{"data-slot":"alert-title",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function St(s){const e=P.c(8);let n,r;e[0]!==s?({className:n,...r}=s,e[0]=s,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=t.jsx("div",{"data-slot":"alert-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}const Ct=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function kt(s){const e=P.c(13),{toolName:n,connectionId:r,onBack:o}=s,l=`/mcp/${r}`;let a;e[0]!==l?(a=new URL(l,window.location.origin),e[0]=l,e[1]=a):a=e[1];const i=a;let c;e[2]!==r?(c={connectionId:r},e[2]=r,e[3]=c):c=e[3];const m=Ke(c);if(!m.isAuthenticated){let g;return e[4]!==m.supportsOAuth||e[5]!==o?(g=t.jsx("div",{className:"flex h-full items-center justify-center",children:m.supportsOAuth?t.jsx(Ze,{onAuthenticate:()=>o(),buttonText:"Go back to authenticate"}):t.jsx(Ye,{hasReadme:!1})}),e[4]=m.supportsOAuth,e[5]=o,e[6]=g):g=e[6],g}const f=`${r}:${n}`;let p;return e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==f||e[11]!==n?(p=t.jsx(It,{toolName:n,connectionId:r,mcpProxyUrl:i,onBack:o},f),e[7]=r,e[8]=i,e[9]=o,e[10]=f,e[11]=n,e[12]=p):p=e[12],p}function It({toolName:s,connectionId:e,mcpProxyUrl:n,onBack:r}){const{replayId:o}=Se({strict:!1}),l=(()=>{if(!o)return null;const d=`replay-${o}`,v=sessionStorage.getItem(d);if(!v)return null;sessionStorage.removeItem(d);try{return JSON.parse(v)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[v,y]of Object.entries(l))y!==null&&typeof y=="object"?d[v]=JSON.stringify(y,null,2):d[v]=y;return d})(),[i,c]=I.useState(a??{}),[m,f]=I.useState(l?JSON.stringify(l,null,2):"{}"),[p,g]=I.useState(null),[x,_]=I.useState(null),[u,k]=I.useState(!1),[j,b]=I.useState(null),w=xe(e),h=et({url:n.href});I.useEffect(()=>{h.error&&console.error("MCP Error:",h.error)},[h.error]);const N=h.tools?.find(d=>d.name===s),$=N?.inputSchema?.properties,S=$?Object.keys($):[],C=S.length>0,A={};if(C&&N?.inputSchema?.properties)for(const d of S)A[d]=N.inputSchema.required?.includes(d)?"":void 0;const z=d=>Object.prototype.hasOwnProperty.call(i,d),T=async()=>{k(!0),_(null),g(null),b(null);const d=performance.now(),v=ne(e);try{const y=C?{...A,...i}:(()=>{const U=m.trim();if(!U)return{};const q=JSON.parse(U);if(q&&typeof q=="object")return q;throw new Error("Raw JSON input must be an object.")})();C&&N?.inputSchema?.properties&&Object.entries(N.inputSchema.properties).forEach(([U,q])=>{if((q.type==="object"||q.type==="array")&&typeof y[U]=="string")try{y[U]=JSON.parse(y[U])}catch{}});const O=await v(s,y),B=performance.now(),D=Math.round(B-d);g(O);const F=JSON.stringify(O),L=new TextEncoder().encode(F).length;b({duration:`${D}ms`,bytes:`${L} bytes`,tokens:`~${Math.ceil(L/4)} tokens`,cost:"$0.0000"})}catch(y){const O=y instanceof Error?y.message:String(y);_(O||"Unknown error occurred");const B=performance.now();b({duration:`${Math.round(B-d)}ms`})}finally{k(!1)}},E=(d,v)=>{c(y=>({...y,[d]:v}))},M=()=>{g(null),_(null),b(null)};return t.jsxs(se,{onBack:r,children:[t.jsx(de,{children:t.jsx(Qe,{connectionId:e,title:N?.name??Ct(s),icon:"build"})}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[t.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:t.jsxs("div",{className:"flex-1 overflow-auto",children:[t.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ke,{icon:w?.icon||null,name:w?.title||s,size:"sm",className:"shadow-sm shrink-0"}),t.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[h.state==="ready"?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):h.state==="connecting"?t.jsx(G,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:h.state.replace("_"," ")})]})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:N?.description||"No description available"})]})}),t.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),N?.inputSchema?.required&&N.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:C&&N?.inputSchema?.properties?Object.entries(N.inputSchema.properties).map(([d,v])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,N.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:v.type})]}),v.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:v.description}),v.type==="object"||v.type==="array"?t.jsx(te,{className:"font-mono text-xs",value:z(d)?i[d]??"":A[d]??"",onChange:y=>E(d,y.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):t.jsx(ee,{value:z(d)?i[d]??"":A[d]??"",onChange:y=>E(d,y.target.value),placeholder:`Enter ${d}...`})]},d)):N?.inputSchema&&!C?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(te,{className:"font-mono text-xs min-h-[120px]",value:m,onChange:d=>f(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),j&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Je,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ge,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ve,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:j.cost})})]})]}),t.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:t.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[t.jsx(W,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:T,disabled:u,children:u?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Executing..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Ge,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),t.jsx(Oe,{children:t.jsxs(Be,{children:[t.jsx(De,{asChild:!0,children:t.jsx(W,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:M,disabled:!p&&!x,children:t.jsx(He,{size:14})})}),t.jsx(Fe,{children:t.jsx("p",{children:"Clear results"})})]})})]})}),x&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(yt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ve,{className:"h-4 w-4"}),t.jsx(wt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(St,{className:"text-xs text-destructive",children:x})]})})}),t.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:p?t.jsxs(t.Fragment,{children:[t.jsx(qe,{jsonString:JSON.stringify(p,null,2),padding:"1.5rem"}),t.jsx(W,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(p,null,2)),Ce.success("Copied to clipboard")},children:t.jsx(We,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(je,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function _t(s){const e=P.c(7),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const a=Q(o).connectionId??V;if(!xe(a)){let f;return e[1]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=f):f=e[1],f}let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(G,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=c):c=e[2];let m;return e[3]!==a||e[4]!==r||e[5]!==n?(m=t.jsx(I.Suspense,{fallback:c,children:t.jsx(kt,{toolName:n,connectionId:a,onBack:r})}),e[3]=a,e[4]=r,e[5]=n,e[6]=m):m=e[6],m}const $t={assistant:ft,prompt:bt};function Et(){const s=P.c(6),e=ie();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const r=Q(n),o=decodeURIComponent(r.itemId);let l;s[1]!==e.history?(l=()=>{e.history.back()},s[1]=e.history,s[2]=l):l=s[2];const a=l,i=Tt;let c;return s[3]!==a||s[4]!==o?(c=t.jsx(_t,{itemId:o,onBack:a,onUpdate:i}),s[3]=a,s[4]=o,s[5]=c):c=s[5],c}async function Tt(s){return Promise.resolve()}function At(){const s=P.c(18),e=ie();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const r=Q(n),o=r.connectionId,l=decodeURIComponent(r.collectionName),a=decodeURIComponent(r.itemId);let i;s[1]!==e.history?(i=()=>{e.history.back()},s[1]=e.history,s[2]=i):i=s[2];const c=i,m=o??V;let f;s[3]!==m?(f=ne(m),s[3]=m,s[4]=f):f=s[4];const g=ce(m,l,f);let x;s[5]!==g||s[6]!==a?(x=async h=>{a&&await g.update.mutateAsync({id:a,data:h})},s[5]=g,s[6]=a,s[7]=x):x=s[7];const _=x;let u;s[8]!==l?(u=l?.toLowerCase(),s[8]=l,s[9]=u):u=s[9];const k=u,j=k&&$t[k];if(j){let h;return s[10]!==j||s[11]!==c||s[12]!==_||s[13]!==a?(h=t.jsx(j,{itemId:a,onBack:c,onUpdate:_}),s[10]=j,s[11]=c,s[12]=_,s[13]=a,s[14]=h):h=s[14],h}let b;s[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Ie,{size:36,className:"text-muted-foreground"}),s[15]=b):b=s[15];let w;return s[16]!==c?(w=t.jsx(Xe,{icon:b,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[16]=c,s[17]=w):w=s[17],w}function zt(){const s=P.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=e):e=s[0];const n=Q(e);if(decodeURIComponent(n.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Et,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(At,{}),s[2]=l):l=s[2],l}function Es(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(G,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(zt,{})})}),s[0]=e):e=s[0],e}export{Es as default};
1
+ import{r as I,c as P,d as Q,j as t,av as ie,x as Ne,y as ue,v as ye,w as le,h as we,b as Se,t as Ce}from"./index-C4a1DvcM.js";import{U as V,f as fe,d as ce,c as ne,b as xe,I as ke,n as Ie}from"./use-connection-8aFd9ZgQ.js";import{d as _e,C as H,e as $e,I as Ee,k as me,G as Te,M as Ae}from"./deco-chat-skeleton-DHRag8GN.js";import{E as oe}from"./SearchMd-BXC4Yoz_.js";import{E as Y}from"./error-boundary-m5kquR9K.js";import{u as ze,L as Me}from"./localstorage-keys-G21128-2.js";import{u as Pe,a as Oe,c as Be,b as De,T as Fe}from"./tooltip-DZ8PMo3S.js";import{B as W}from"./button-Chm7HSn5.js";import{F as R,a as he,b as J,c as X,d as Z}from"./form-BBS_Tp5l.js";import{I as ee}from"./input-DCV4VviT.js";import{T as te}from"./textarea-BA6caASm.js";import{c as K}from"./utils-BXNVuJET.js";import{A as Le}from"./use-binding-C1zXgwae.js";import{i as G}from"./Loading01-BUZAT-Ht.js";import{s as Re}from"./Plus-DTWKiMkv.js";import{i as Ue}from"./Upload01-Dm3ykMHj.js";import{V as de,b as se,a as pe}from"./layout-BkDVhV_I.js";import{i as Ve}from"./AlertCircle-Cu9USDUK.js";import{s as Je}from"./Clock-Ck2lYkyl.js";import{a as We}from"./Copy01-BeUF9LPk.js";import{i as Ge,J as qe}from"./json-syntax-highlighter-VMspUwuH.js";import{s as He}from"./XClose-OisY7Sog.js";import{u as Ke,O as Ze,M as Ye,P as Qe,E as Xe}from"./index-BZz7aGs7.js";import{u as et}from"./use-mcp-BJzX7M7c.js";import"./Grid01-4uSGUJjV.js";import"./CpuChip02-8BkRby_U.js";import"./select-BXHiOY7b.js";import"./ChevronDown-B5vWNgW1.js";import"./use-mobile-BQAr1bEF.js";import"./use-gateway-BGsZlt6a.js";import"./connection-card-D6fhK6Cn.js";import"./card-BVamKRXq.js";import"./LinkExternal01-DhNFEAza.js";import"./spinner-zi1IadXF.js";import"./File06-Cn7JLPIx.js";import"./InfoCircle-C21KXVBJ.js";import"./useQuery-39cprZL6.js";import"./auth-DB_JGgAS.js";import"./ArrowLeft-nKBVB_NL.js";import"./mcp-oauth-Cm2UNUay.js";import"./use-organization-settings-CAOHB7nk.js";import"./use-tool-call-Dxebi6Uq.js";import"./Key01-CzDrcb2u.js";import"./formatDistanceToNow-Dkl3nWpl.js";import"./extract-connection-data-BSn-ydRW.js";import"./registry-utils-ulDDT0d8.js";import"./generate-id-Dyweu44Y.js";import"./index-hySmljwG.js";import"./index-RS2MPOun.js";import"./schema-DIY49r7a.js";const ge=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M20.5 8v8.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.22 21 17.38 21 15.7 21H8.3c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3.5 18.72 3.5 17.88 3.5 16.2V8m.1-5h16.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C22 3.76 22 4.04 22 4.6v1.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C21.24 8 20.96 8 20.4 8H3.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C2 7.24 2 6.96 2 6.4V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C2.76 3 3.04 3 3.6 3Zm6 8.5h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 12.26 16 12.54 16 13.1v.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437c-.214.109-.494.109-1.054.109H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 14.74 8 14.46 8 13.9v-.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 11.5 9.04 11.5 9.6 11.5Z"}));ge.displayName="Box";const je=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"m16 18 6-6-6-6M8 6l-6 6 6 6"}));je.displayName="Code01";const ve=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M21 5c0 1.657-4.03 3-9 3S3 6.657 3 5m18 0c0-1.657-4.03-3-9-3S3 3.343 3 5m18 0v14c0 1.66-4 3-9 3s-9-1.34-9-3V5m18 7c0 1.66-4 3-9 3s-9-1.34-9-3"}));ve.displayName="Database01";const be=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M11 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.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"}));be.displayName="Edit05";const re=({size:s=24,color:e="currentColor",...n})=>I.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},I.createElement("path",{d:"M16 3.468a4.5 4.5 0 0 1 0 8.064m2 5.234c1.512.684 2.872 1.799 4 3.234M2 20c1.946-2.477 4.59-4 7.5-4s5.553 1.523 7.5 4M14 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));re.displayName="Users02";function tt(s){const e=P.c(3),{gatewayId:n,onSelect:r}=s,{data:o}=$e(n);if(o.length===0)return null;let l;return e[0]!==r||e[1]!==o?(l=t.jsx(Ee,{prompts:o,onSelect:r,className:"mt-6"}),e[0]=r,e[1]=o,e[2]=l):l=e[2],l}function st(s){const e=P.c(20),{form:n}=s;let r;e[0]!==n?(r=p=>{const{field:g}=p;return t.jsx(dt,{size:"md",value:g.value,onChange:g.onChange,alt:n.watch("title")})},e[0]=n,e[1]=r):r=e[1];let o;e[2]!==n.control||e[3]!==r?(o=t.jsx(R,{control:n.control,name:"avatar",render:r}),e[2]=n.control,e[3]=r,e[4]=o):o=e[4];let l;e[5]!==n.control?(l=t.jsxs("div",{className:"flex flex-col gap-3 flex-1 min-w-0",children:[t.jsx(R,{control:n.control,name:"title",render:at}),t.jsx(R,{control:n.control,name:"description",render:lt})]}),e[5]=n.control,e[6]=l):l=e[6];let a;e[7]!==o||e[8]!==l?(a=t.jsxs("div",{className:"flex gap-4 items-start",children:[o,l]}),e[7]=o,e[8]=l,e[9]=a):a=e[9];let i,c;e[10]!==n.control?(i=t.jsxs("div",{className:"flex gap-4",children:[t.jsx(R,{control:n.control,name:"gateway_id",render:rt}),t.jsx(R,{control:n.control,name:"model",render:ot})]}),c=t.jsx(R,{control:n.control,name:"system_prompt",render:nt}),e[10]=n.control,e[11]=i,e[12]=c):(i=e[11],c=e[12]);let m;e[13]!==a||e[14]!==i||e[15]!==c?(m=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-2xl mx-auto w-full min-w-0 gap-6 overflow-y-auto",children:[a,i,c]}),e[13]=a,e[14]=i,e[15]=c,e[16]=m):m=e[16];let f;return e[17]!==n||e[18]!==m?(f=t.jsx(he,{...n,children:m}),e[17]=n,e[18]=m,e[19]=f):f=e[19],f}function nt(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1 flex flex-col min-h-0",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"System prompt"}),t.jsx(Z,{children:t.jsx(te,{...e,placeholder:"You are a helpful assistant...",className:"flex-1 min-h-[200px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})]})}function ot(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Model"}),t.jsx(Ae,{selectedModel:e.value?{id:e.value.id,connectionId:e.value.connectionId}:void 0,onModelChange:n=>e.onChange({id:n.id,connectionId:n.connectionId}),placeholder:"Select model",variant:"bordered",className:"w-full"})]})}function rt(s){const{field:e}=s;return t.jsxs(J,{className:"flex-1",children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Gateway"}),t.jsx(Te,{selectedGatewayId:e.value,onGatewayChange:e.onChange,placeholder:"Select gateway",variant:"bordered",className:"w-full"})]})}function lt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(Z,{children:t.jsx(ee,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function at(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx(X,{className:"text-xs text-muted-foreground",children:"Name"}),t.jsx(Z,{children:t.jsx(ee,{...e,placeholder:"Untitled assistant",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function it(s){const e=P.c(62),{activeThreadId:n,mode:r,assistant:o,form:l}=s;let a;e[0]!==n||e[1]!==o.system_prompt?(a={threadId:n,systemPrompt:o.system_prompt},e[0]=n,e[1]=o.system_prompt,e[2]=a):a=e[2];const i=_e(a),c=!!o.gateway_id&&!!o.model?.id&&!!o.model?.connectionId;let m;e[3]!==n||e[4]!==o.gateway_id||e[5]!==o.model||e[6]!==i||e[7]!==c?(m=async L=>{if(!c)return;const U={created_at:new Date().toISOString(),thread_id:n,model:{id:o.model.id,connectionId:o.model.connectionId},gateway:{id:o.gateway_id??""},user:{name:"you"}};await i.sendMessage(L,U)},e[3]=n,e[4]=o.gateway_id,e[5]=o.model,e[6]=i,e[7]=c,e[8]=m):m=e[8];const f=m;let p;e[9]!==o.avatar||e[10]!==o.title?(p=o.avatar?t.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden",children:t.jsx("img",{src:o.avatar,alt:o.title,className:"h-full w-full object-cover"})}):t.jsx("div",{className:"size-[60px] rounded-[18px] border border-border shrink-0 overflow-hidden bg-muted/20 flex items-center justify-center",children:t.jsx(re,{size:28,className:"text-muted-foreground"})}),e[9]=o.avatar,e[10]=o.title,e[11]=p):p=e[11];let g;e[12]!==o.title?(g=t.jsx("h3",{className:"text-xl font-medium text-foreground",children:o.title}),e[12]=o.title,e[13]=g):g=e[13];let x;e[14]!==o.description?(x=o.description?t.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:o.description}):null,e[14]=o.description,e[15]=x):x=e[15];let _;e[16]!==p||e[17]!==g||e[18]!==x?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[p,g,x]}),e[16]=p,e[17]=g,e[18]=x,e[19]=_):_=e[19];let u;e[20]!==o.gateway_id||e[21]!==f?(u=o.gateway_id&&t.jsx(Y,{fallback:null,children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex justify-center mt-6",children:t.jsx(G,{size:20,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tt,{gatewayId:o.gateway_id,onSelect:L=>{f(L.description??L.name)}})})}),e[20]=o.gateway_id,e[21]=f,e[22]=u):u=e[22];let k;e[23]!==_||e[24]!==u?(k=t.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-8 text-center",children:[_,u]}),e[23]=_,e[24]=u,e[25]=k):k=e[25];const j=k;let b;e[26]!==i.messages?(b=i.messages.filter(ct),e[26]=i.messages,e[27]=b):b=e[27];const w=b,h=r==="edit",N=h?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none";let $;e[28]!==N?($=K("absolute inset-0 px-2 transition-opacity duration-200 ease-out",N),e[28]=N,e[29]=$):$=e[29];let S;e[30]!==l?(S=t.jsx(st,{form:l}),e[30]=l,e[31]=S):S=e[31];let C;e[32]!==$||e[33]!==S?(C=t.jsx("div",{className:$,children:S}),e[32]=$,e[33]=S,e[34]=C):C=e[34];const A=h?"opacity-0 pointer-events-none":"opacity-100";let z;e[35]!==A?(z=K("h-full transition-opacity duration-200 ease-out",A),e[35]=A,e[36]=z):z=e[36];let T;e[37]!==i.messages||e[38]!==i.status||e[39]!==j||e[40]!==w.length?(T=w.length===0?t.jsx(H.EmptyState,{children:j}):t.jsx(H.Messages,{messages:i.messages,status:i.status,minHeightOffset:240}),e[37]=i.messages,e[38]=i.status,e[39]=j,e[40]=w.length,e[41]=T):T=e[41];let E;e[42]!==z||e[43]!==T?(E=t.jsx("div",{className:z,children:T}),e[42]=z,e[43]=T,e[44]=E):E=e[44];let M;e[45]!==C||e[46]!==E?(M=t.jsxs(H.Main,{className:"h-full relative overflow-hidden",innerClassName:"px-2",children:[C,E]}),e[45]=C,e[46]=E,e[47]=M):M=e[47];const d=h?"translate-y-full":"translate-y-0";let v;e[48]!==d?(v=K("transition-transform duration-300 ease-out",d),e[48]=d,e[49]=v):v=e[49];const y=!c,O=i.status==="submitted"||i.status==="streaming";let B;e[50]!==i.messages||e[51]!==i.stop||e[52]!==f||e[53]!==y||e[54]!==O?(B=t.jsx(H.Footer,{children:t.jsx("div",{className:"max-w-2xl mx-auto w-full min-w-0",children:t.jsx(H.Input,{onSubmit:f,onStop:i.stop,disabled:y,isStreaming:O,placeholder:"Ask anything or @ for context",usageMessages:i.messages})})}),e[50]=i.messages,e[51]=i.stop,e[52]=f,e[53]=y,e[54]=O,e[55]=B):B=e[55];let D;e[56]!==v||e[57]!==B?(D=t.jsx("div",{className:v,children:B}),e[56]=v,e[57]=B,e[58]=D):D=e[58];let F;return e[59]!==M||e[60]!==D?(F=t.jsxs(H,{children:[M,D]}),e[59]=M,e[60]=D,e[61]=F):F=e[61],F}function ct(s){return s.role!=="system"}function dt(s){const e=P.c(18),{value:n,onChange:r,alt:o,size:l}=s,a=l===void 0?"md":l,i=I.useRef(null),c=a==="xs"?"h-6 w-6":a==="sm"?"h-8 w-8":"h-16 w-16",m=a==="xs"?"h-3 w-3":a==="sm"?"h-4 w-4":"h-6 w-6",f=a==="xs"?"h-3 w-3":a==="sm"?"h-3.5 w-3.5":"h-5 w-5";let p;e[0]!==r?(p=$=>{const S=$.target.files?.[0];if(!S)return;const C=new FileReader;C.onloadend=()=>{const A=C.result;r(A)},C.readAsDataURL(S)},e[0]=r,e[1]=p):p=e[1];const g=p;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{i.current?.click()},e[2]=x):x=e[2];const _=x,u=`relative ${c} shrink-0 cursor-pointer group`;let k;e[3]!==g?(k=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:g}),e[3]=g,e[4]=k):k=e[4];let j;e[5]!==o||e[6]!==m||e[7]!==n?(j=n?t.jsx("img",{src:n,alt:o||"Avatar",className:"w-full h-full object-cover"}):t.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground",children:t.jsx(re,{className:m})}),e[5]=o,e[6]=m,e[7]=n,e[8]=j):j=e[8];const b=`${f} text-white`;let w;e[9]!==b?(w=t.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center rounded-xl",children:t.jsx(Ue,{className:b})}),e[9]=b,e[10]=w):w=e[10];let h;e[11]!==j||e[12]!==w?(h=t.jsxs("div",{className:"h-full w-full rounded-xl border border-border bg-muted/20 overflow-hidden relative",children:[j,w]}),e[11]=j,e[12]=w,e[13]=h):h=e[13];let N;return e[14]!==u||e[15]!==k||e[16]!==h?(N=t.jsxs("div",{className:u,onClick:_,children:[k,h]}),e[14]=u,e[15]=k,e[16]=h,e[17]=N):N=e[17],N}function mt(s){const e=P.c(49),{providerId:n,assistantId:r,onBack:o}=s,l=ie();let a;e[0]!==o||e[1]!==l?(a=o??(()=>l.history.back()),e[0]=o,e[1]=l,e[2]=a):a=e[2];const i=a,{locator:c}=Pe();let m;e[3]!==r||e[4]!==c?(m=Me.assistantChatActiveThread(c,r),e[3]=r,e[4]=c,e[5]=m):m=e[5];const[f,p]=ze(m,ut),g=n||V;let x;e[6]!==g?(x=ne(g),e[6]=g,e[7]=x):x=e[7];const _=x,u=fe(n,"ASSISTANT",r,_),k=ce(n,"ASSISTANT",_),j=k.update.isPending,[b,w]=I.useState(u?.model.id&&u?.gateway_id?"chat":"edit");let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=Ne(Le),e[8]=h):h=e[8];const N=u??void 0;let $;e[9]!==N?($={resolver:h,values:N},e[9]=N,e[10]=$):$=e[10];const S=ue($);let C;e[11]!==k.update||e[12]!==r||e[13]!==S?(C=S.handleSubmit(async D=>{const F=await k.update.mutateAsync({id:r,data:D});S.reset(F),w("chat")}),e[11]=k.update,e[12]=r,e[13]=S,e[14]=C):C=e[14];const A=C;if(!u){let D;e[15]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(me,{}),e[15]=D):D=e[15];let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Assistant not found",description:"This assistant may have been deleted or you may not have access to it."})}),e[16]=F):F=e[16];let L;return e[17]!==i?(L=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:D,children:t.jsx(se,{onBack:i,children:F})})}),e[17]=i,e[18]=L):L=e[18],L}let z;e[19]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(me,{}),e[19]=z):z=e[19];let T;e[20]!==u.avatar||e[21]!==u.title?(T=t.jsx("div",{className:"h-6 w-6 min-w-6 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:u.avatar?t.jsx("img",{src:u.avatar,alt:u.title,className:"h-full w-full object-cover"}):t.jsx("div",{className:"h-full w-full flex items-center justify-center text-muted-foreground",children:t.jsx(re,{size:12,className:"text-muted-foreground"})})}),e[20]=u.avatar,e[21]=u.title,e[22]=T):T=e[22];let E;e[23]!==u.title?(E=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:u.title}),e[23]=u.title,e[24]=E):E=e[24];let M;e[25]!==u.description?(M=u.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:u.description})]}):null,e[25]=u.description,e[26]=M):M=e[26];let d;e[27]!==E||e[28]!==M?(d=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[E,M]}),e[27]=E,e[28]=M,e[29]=d):d=e[29];let v;e[30]!==T||e[31]!==d?(v=t.jsx(pe,{children:t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T,d]})}),e[30]=T,e[31]=d,e[32]=v):v=e[32];let y;e[33]!==S.formState.isDirty||e[34]!==j||e[35]!==b||e[36]!==A||e[37]!==p?(y=t.jsx(de,{children:b==="chat"?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>p(crypto.randomUUID()),title:"New thread",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:t.jsx(Re,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t.jsx("button",{type:"button",onClick:()=>w("edit"),title:"Edit",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",children:t.jsx(be,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(W,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:j,onClick:()=>w("chat"),children:"Cancel"}),t.jsx(W,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:!S.formState.isDirty||j,onClick:()=>{A()},children:j?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Saving..."]}):"Save"})]})}),e[33]=S.formState.isDirty,e[34]=j,e[35]=b,e[36]=A,e[37]=p,e[38]=y):y=e[38];let O;e[39]!==f||e[40]!==u||e[41]!==S||e[42]!==b?(O=t.jsx("div",{className:"h-full",children:t.jsx(it,{activeThreadId:f,mode:b,assistant:u,form:S},S.formState.submitCount)}),e[39]=f,e[40]=u,e[41]=S,e[42]=b,e[43]=O):O=e[43];let B;return e[44]!==i||e[45]!==v||e[46]!==y||e[47]!==O?(B=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:z,children:t.jsxs(se,{onBack:i,children:[v,y,O]})})}),e[44]=i,e[45]=v,e[46]=y,e[47]=O,e[48]=B):B=e[48],B}function ut(s){return s||crypto.randomUUID()}function ft(s){const e=P.c(6),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const a=Q(o).connectionId??V;if(!a||a===V){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Assistant not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==a||e[3]!==n||e[4]!==r?(i=t.jsx(mt,{providerId:a,assistantId:n,onBack:r}),e[2]=a,e[3]=n,e[4]=r,e[5]=i):i=e[5],i}ye({title:le().min(1),description:le().nullable(),body:le()});function ae(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function xt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(r=>r==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function ht(s){const e=P.c(13),{form:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=r):r=e[0];let o;e[1]!==n.control?(o=t.jsxs("div",{className:"flex flex-col gap-4",children:[r,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(R,{control:n.control,name:"title",render:jt}),t.jsx(R,{control:n.control,name:"description",render:gt})]})]}),e[1]=n.control,e[2]=o):o=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let i;e[5]!==n.control?(i=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(R,{control:n.control,name:"body",render:pt})]}),e[5]=n.control,e[6]=i):i=e[6];let c;e[7]!==o||e[8]!==i?(c=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[o,i]}),e[7]=o,e[8]=i,e[9]=c):c=e[9];let m;return e[10]!==n||e[11]!==c?(m=t.jsx(he,{...n,children:c}),e[10]=n,e[11]=c,e[12]=m):m=e[12],m}function pt(s){const{field:e}=s;return t.jsx(J,{children:t.jsx(Z,{children:t.jsx(te,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function gt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(Z,{children:t.jsx(ee,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function jt(s){const{field:e}=s;return t.jsxs(J,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(Z,{children:t.jsx(ee,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function vt(s){const e=P.c(42),{providerId:n,promptId:r,onBack:o}=s,l=n||V;let a;e[0]!==l?(a=ne(l),e[0]=l,e[1]=a):a=e[1];const i=a,c=fe(n,"PROMPT",r,i),m=ce(n,"PROMPT",i),f=m.update.isPending;let p;e[2]!==c?(p=c?{title:c.title,description:c.description??null,body:ae(c)}:void 0,e[2]=c,e[3]=p):p=e[3];let g;e[4]!==p?(g={values:p},e[4]=p,e[5]=g):g=e[5];const x=ue(g);let _;e[6]!==x||e[7]!==c?(_=()=>{c&&x.reset({title:c.title,description:c.description??null,body:ae(c)})},e[6]=x,e[7]=c,e[8]=_):_=e[8];const u=_;let k;e[9]!==m.update||e[10]!==x||e[11]!==r?(k=x.handleSubmit(async d=>{const v=await m.update.mutateAsync({id:r,data:{title:d.title,description:d.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:d.body}}]}});x.reset({title:v.title,description:v.description??null,body:ae(v)})}),e[9]=m.update,e[10]=x,e[11]=r,e[12]=k):k=e[12];const j=k;if(!c){let d;return e[13]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[13]=d):d=e[13],d}let b;e[14]!==c.title?(b=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:c.title}),e[14]=c.title,e[15]=b):b=e[15];let w;e[16]!==c.description?(w=c.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:c.description})]}):null,e[16]=c.description,e[17]=w):w=e[17];let h;e[18]!==b||e[19]!==w?(h=t.jsx(pe,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[b,w]})}),e[18]=b,e[19]=w,e[20]=h):h=e[20];const N=!x.formState.isDirty||f;let $;e[21]!==u||e[22]!==N?($=t.jsx(W,{variant:"ghost",size:"sm",className:"h-7 gap-1.5",disabled:N,onClick:u,children:"Cancel"}),e[21]=u,e[22]=N,e[23]=$):$=e[23];const S=!x.formState.isDirty||f;let C;e[24]!==j?(C=()=>{j()},e[24]=j,e[25]=C):C=e[25];let A;e[26]!==f?(A=f?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Saving..."]}):"Save",e[26]=f,e[27]=A):A=e[27];let z;e[28]!==S||e[29]!==C||e[30]!==A?(z=t.jsx(W,{variant:"default",size:"sm",className:"h-7 gap-1.5",disabled:S,onClick:C,children:A}),e[28]=S,e[29]=C,e[30]=A,e[31]=z):z=e[31];let T;e[32]!==$||e[33]!==z?(T=t.jsxs(de,{children:[$,z]}),e[32]=$,e[33]=z,e[34]=T):T=e[34];let E;e[35]!==x?(E=t.jsx("div",{className:"h-full",children:t.jsx(ht,{form:x})}),e[35]=x,e[36]=E):E=e[36];let M;return e[37]!==o||e[38]!==T||e[39]!==E||e[40]!==h?(M=t.jsxs(se,{onBack:o,children:[h,T,E]}),e[37]=o,e[38]=T,e[39]=E,e[40]=h,e[41]=M):M=e[41],M}function bt(s){const e=P.c(5),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=xt()??V,e[0]=o):o=e[0];const l=o;if(!l||l===V){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(oe,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=i):i=e[1],i}let a;return e[2]!==n||e[3]!==r?(a=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:null,children:t.jsx(vt,{providerId:l,promptId:n,onBack:r})})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}const Nt=we("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function yt(s){const e=P.c(10);let n,r,o;e[0]!==s?({className:n,variant:o,...r}=s,e[0]=s,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let l;e[4]!==n||e[5]!==o?(l=K(Nt({variant:o}),n),e[4]=n,e[5]=o,e[6]=l):l=e[6];let a;return e[7]!==r||e[8]!==l?(a=t.jsx("div",{"data-slot":"alert",role:"alert",className:l,...r}),e[7]=r,e[8]=l,e[9]=a):a=e[9],a}function wt(s){const e=P.c(8);let n,r;e[0]!==s?({className:n,...r}=s,e[0]=s,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("line-clamp-1 min-h-4 font-medium tracking-tight",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=t.jsx("div",{"data-slot":"alert-title",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function St(s){const e=P.c(8);let n,r;e[0]!==s?({className:n,...r}=s,e[0]=s,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("text-muted-foreground leading-relaxed",n),e[3]=n,e[4]=o):o=e[4];let l;return e[5]!==r||e[6]!==o?(l=t.jsx("div",{"data-slot":"alert-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}const Ct=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function kt(s){const e=P.c(13),{toolName:n,connectionId:r,onBack:o}=s,l=`/mcp/${r}`;let a;e[0]!==l?(a=new URL(l,window.location.origin),e[0]=l,e[1]=a):a=e[1];const i=a;let c;e[2]!==r?(c={connectionId:r},e[2]=r,e[3]=c):c=e[3];const m=Ke(c);if(!m.isAuthenticated){let g;return e[4]!==m.supportsOAuth||e[5]!==o?(g=t.jsx("div",{className:"flex h-full items-center justify-center",children:m.supportsOAuth?t.jsx(Ze,{onAuthenticate:()=>o(),buttonText:"Go back to authenticate"}):t.jsx(Ye,{hasReadme:!1})}),e[4]=m.supportsOAuth,e[5]=o,e[6]=g):g=e[6],g}const f=`${r}:${n}`;let p;return e[7]!==r||e[8]!==i||e[9]!==o||e[10]!==f||e[11]!==n?(p=t.jsx(It,{toolName:n,connectionId:r,mcpProxyUrl:i,onBack:o},f),e[7]=r,e[8]=i,e[9]=o,e[10]=f,e[11]=n,e[12]=p):p=e[12],p}function It({toolName:s,connectionId:e,mcpProxyUrl:n,onBack:r}){const{replayId:o}=Se({strict:!1}),l=(()=>{if(!o)return null;const d=`replay-${o}`,v=sessionStorage.getItem(d);if(!v)return null;sessionStorage.removeItem(d);try{return JSON.parse(v)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[v,y]of Object.entries(l))y!==null&&typeof y=="object"?d[v]=JSON.stringify(y,null,2):d[v]=y;return d})(),[i,c]=I.useState(a??{}),[m,f]=I.useState(l?JSON.stringify(l,null,2):"{}"),[p,g]=I.useState(null),[x,_]=I.useState(null),[u,k]=I.useState(!1),[j,b]=I.useState(null),w=xe(e),h=et({url:n.href});I.useEffect(()=>{h.error&&console.error("MCP Error:",h.error)},[h.error]);const N=h.tools?.find(d=>d.name===s),$=N?.inputSchema?.properties,S=$?Object.keys($):[],C=S.length>0,A={};if(C&&N?.inputSchema?.properties)for(const d of S)A[d]=N.inputSchema.required?.includes(d)?"":void 0;const z=d=>Object.prototype.hasOwnProperty.call(i,d),T=async()=>{k(!0),_(null),g(null),b(null);const d=performance.now(),v=ne(e);try{const y=C?{...A,...i}:(()=>{const U=m.trim();if(!U)return{};const q=JSON.parse(U);if(q&&typeof q=="object")return q;throw new Error("Raw JSON input must be an object.")})();C&&N?.inputSchema?.properties&&Object.entries(N.inputSchema.properties).forEach(([U,q])=>{if((q.type==="object"||q.type==="array")&&typeof y[U]=="string")try{y[U]=JSON.parse(y[U])}catch{}});const O=await v(s,y),B=performance.now(),D=Math.round(B-d);g(O);const F=JSON.stringify(O),L=new TextEncoder().encode(F).length;b({duration:`${D}ms`,bytes:`${L} bytes`,tokens:`~${Math.ceil(L/4)} tokens`,cost:"$0.0000"})}catch(y){const O=y instanceof Error?y.message:String(y);_(O||"Unknown error occurred");const B=performance.now();b({duration:`${Math.round(B-d)}ms`})}finally{k(!1)}},E=(d,v)=>{c(y=>({...y,[d]:v}))},M=()=>{g(null),_(null),b(null)};return t.jsxs(se,{onBack:r,children:[t.jsx(de,{children:t.jsx(Qe,{connectionId:e,title:N?.name??Ct(s),icon:"build"})}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 h-full",children:[t.jsx("div",{className:"flex flex-col border-r border-border overflow-hidden",children:t.jsxs("div",{className:"flex-1 overflow-auto",children:[t.jsx("div",{className:"flex flex-col gap-4 p-6 border-b border-border min-h-28",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ke,{icon:w?.icon||null,name:w?.title||s,size:"sm",className:"shadow-sm shrink-0"}),t.jsx("h1",{className:"text-lg font-medium text-foreground leading-none",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit",children:[h.state==="ready"?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):h.state==="connecting"?t.jsx(G,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:h.state.replace("_"," ")})]})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:N?.description||"No description available"})]})}),t.jsxs("div",{className:"flex flex-col p-6 gap-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),N?.inputSchema?.required&&N.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:C&&N?.inputSchema?.properties?Object.entries(N.inputSchema.properties).map(([d,v])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,N.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:v.type})]}),v.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:v.description}),v.type==="object"||v.type==="array"?t.jsx(te,{className:"font-mono text-xs",value:z(d)?i[d]??"":A[d]??"",onChange:y=>E(d,y.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):t.jsx(ee,{value:z(d)?i[d]??"":A[d]??"",onChange:y=>E(d,y.target.value),placeholder:`Enter ${d}...`})]},d)):N?.inputSchema&&!C?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(te,{className:"font-mono text-xs min-h-[120px]",value:m,onChange:d=>f(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})})]})]})}),t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-t lg:border-t-0 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),j&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Je,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.duration})]}),j.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ge,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.tokens})]}),j.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ve,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:j.bytes})]}),j.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:j.cost})})]})]}),t.jsx("div",{className:"flex items-center justify-end lg:justify-between px-4 h-14 border-b border-border bg-background",children:t.jsxs("div",{className:"flex items-center gap-2 w-full lg:w-auto",children:[t.jsx(W,{size:"sm",variant:"default",className:"h-8 gap-2 flex-1 lg:flex-none",onClick:T,disabled:u,children:u?t.jsxs(t.Fragment,{children:[t.jsx(G,{size:14,className:"animate-spin"}),"Executing..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Ge,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})}),t.jsx(Oe,{children:t.jsxs(Be,{children:[t.jsx(De,{asChild:!0,children:t.jsx(W,{size:"icon",variant:"outline",className:"h-8 w-8 shrink-0",onClick:M,disabled:!p&&!x,children:t.jsx(He,{size:14})})}),t.jsx(Fe,{children:t.jsx("p",{children:"Clear results"})})]})})]})}),x&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(yt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ve,{className:"h-4 w-4"}),t.jsx(wt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(St,{className:"text-xs text-destructive",children:x})]})})}),t.jsx("div",{className:"relative flex-1 overflow-auto bg-muted/50",children:p?t.jsxs(t.Fragment,{children:[t.jsx(qe,{jsonString:JSON.stringify(p,null,2),padding:"1.5rem"}),t.jsx(W,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(p,null,2)),Ce.success("Copied to clipboard")},children:t.jsx(We,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(je,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]})]})]})}function _t(s){const e=P.c(7),{itemId:n,onBack:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const a=Q(o).connectionId??V;if(!xe(a)){let f;return e[1]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[1]=f):f=e[1],f}let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(G,{size:32,className:"animate-spin text-muted-foreground"})}),e[2]=c):c=e[2];let m;return e[3]!==a||e[4]!==r||e[5]!==n?(m=t.jsx(I.Suspense,{fallback:c,children:t.jsx(kt,{toolName:n,connectionId:a,onBack:r})}),e[3]=a,e[4]=r,e[5]=n,e[6]=m):m=e[6],m}const $t={assistant:ft,prompt:bt};function Et(){const s=P.c(6),e=ie();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const r=Q(n),o=decodeURIComponent(r.itemId);let l;s[1]!==e.history?(l=()=>{e.history.back()},s[1]=e.history,s[2]=l):l=s[2];const a=l,i=Tt;let c;return s[3]!==a||s[4]!==o?(c=t.jsx(_t,{itemId:o,onBack:a,onUpdate:i}),s[3]=a,s[4]=o,s[5]=c):c=s[5],c}async function Tt(s){return Promise.resolve()}function At(){const s=P.c(18),e=ie();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=n):n=s[0];const r=Q(n),o=r.connectionId,l=decodeURIComponent(r.collectionName),a=decodeURIComponent(r.itemId);let i;s[1]!==e.history?(i=()=>{e.history.back()},s[1]=e.history,s[2]=i):i=s[2];const c=i,m=o??V;let f;s[3]!==m?(f=ne(m),s[3]=m,s[4]=f):f=s[4];const g=ce(m,l,f);let x;s[5]!==g||s[6]!==a?(x=async h=>{a&&await g.update.mutateAsync({id:a,data:h})},s[5]=g,s[6]=a,s[7]=x):x=s[7];const _=x;let u;s[8]!==l?(u=l?.toLowerCase(),s[8]=l,s[9]=u):u=s[9];const k=u,j=k&&$t[k];if(j){let h;return s[10]!==j||s[11]!==c||s[12]!==_||s[13]!==a?(h=t.jsx(j,{itemId:a,onBack:c,onUpdate:_}),s[10]=j,s[11]=c,s[12]=_,s[13]=a,s[14]=h):h=s[14],h}let b;s[15]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Ie,{size:36,className:"text-muted-foreground"}),s[15]=b):b=s[15];let w;return s[16]!==c?(w=t.jsx(Xe,{icon:b,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[16]=c,s[17]=w):w=s[17],w}function zt(){const s=P.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/mcps/$connectionId/$collectionName/$itemId"},s[0]=e):e=s[0];const n=Q(e);if(decodeURIComponent(n.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Et,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(At,{}),s[2]=l):l=s[2],l}function Es(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Y,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(G,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(zt,{})})}),s[0]=e):e=s[0],e}export{Es as default};
@@ -1 +1 @@
1
- import{r as a,c as Q,j as s}from"./index-CzwYLjKx.js";import{B as se}from"./button-DkKLNB2C.js";import{c as oe,D as ie,b as ne,a as le}from"./dropdown-menu-BwfRJqX3.js";import{a as re,c as ae}from"./Grid01-iXkiGD-C.js";import{i as ce,a as de,c as ue,b as fe,T as me}from"./tooltip-CRtbHuaD.js";import{c as m}from"./utils-D1FAHWbf.js";const U=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));U.displayName="ArrowDown";const X=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));X.displayName="List";const Y=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));Y.displayName="Sliders01";const xe={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function he(i){const e=Q.c(66),{value:o,onValueChange:l,options:t,size:p,fullWidth:g,className:x}=i,j=p===void 0?"sm":p,r=g===void 0?!1:g,v=a.useRef(null),b=a.useRef(null);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={left:0,width:0,opacity:0},e[0]=c):c=e[0];const[n,h]=a.useState(c);let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=I=>{if(!I.current)return;const{offsetLeft:ee,offsetWidth:te}=I.current;h({left:ee,width:te,opacity:1})},e[1]=d):d=e[1];const w=d;let u;e[2]!==t[0].value||e[3]!==o?(u=()=>{const I=o===t[0].value?v:b;w(I)},e[2]=t[0].value,e[3]=o,e[4]=u):u=e[4];let R;e[5]!==t||e[6]!==o?(R=[o,t],e[5]=t,e[6]=o,e[7]=R):R=e[7],a.useEffect(u,R);const f=xe[j];let y;e[8]!==x?(y=m("relative flex gap-0 bg-muted rounded-lg",x),e[8]=x,e[9]=y):y=e[9];let N;e[10]!==l||e[11]!==t[0].value?(N=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=N):N=e[12];const P=r?"flex-1 h-12 px-4":f.button,Z=!r&&t[0].label?"px-3":"";let z;e[13]!==Z||e[14]!==P?(z=m("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",P,Z),e[13]=Z,e[14]=P,e[15]=z):z=e[15];const O=o===t[0].value?"text-foreground":"text-muted-foreground";let k;e[16]!==f.icon||e[17]!==O?(k=m("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",f.icon,O),e[16]=f.icon,e[17]=O,e[18]=k):k=e[18];let C;e[19]!==t[0].icon||e[20]!==k?(C=s.jsx("span",{className:k,children:t[0].icon}),e[19]=t[0].icon,e[20]=k,e[21]=C):C=e[21];let M;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(M=t[0].label&&s.jsx("span",{className:m("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=M):M=e[25];let S;e[26]!==z||e[27]!==C||e[28]!==M||e[29]!==N?(S=s.jsxs("button",{ref:v,type:"button",onClick:N,className:z,children:[C,M]}),e[26]=z,e[27]=C,e[28]=M,e[29]=N,e[30]=S):S=e[30];let _;e[31]!==l||e[32]!==t[1].value?(_=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=_):_=e[33];const A=r?"flex-1 h-12 px-4":f.button,K=!r&&t[1].label?"px-3":"";let E;e[34]!==A||e[35]!==K?(E=m("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",A,K),e[34]=A,e[35]=K,e[36]=E):E=e[36];const q=o===t[1].value?"text-foreground":"text-muted-foreground";let D;e[37]!==f.icon||e[38]!==q?(D=m("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",f.icon,q),e[37]=f.icon,e[38]=q,e[39]=D):D=e[39];let L;e[40]!==t[1].icon||e[41]!==D?(L=s.jsx("span",{className:D,children:t[1].icon}),e[40]=t[1].icon,e[41]=D,e[42]=L):L=e[42];let T;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(T=t[1].label&&s.jsx("span",{className:m("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=T):T=e[46];let V;e[47]!==_||e[48]!==E||e[49]!==L||e[50]!==T?(V=s.jsxs("button",{ref:b,type:"button",onClick:_,className:E,children:[L,T]}),e[47]=_,e[48]=E,e[49]=L,e[50]=T,e[51]=V):V=e[51];const F=r?"h-12":f.button;let W;e[52]!==F?(W=m("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",F),e[52]=F,e[53]=W):W=e[53];const G=`${n.left}px`,J=`${n.width}px`;let $;e[54]!==n.opacity||e[55]!==G||e[56]!==J?($={left:G,width:J,opacity:n.opacity},e[54]=n.opacity,e[55]=G,e[56]=J,e[57]=$):$=e[57];let B;e[58]!==W||e[59]!==$?(B=s.jsx("div",{className:W,style:$}),e[58]=W,e[59]=$,e[60]=B):B=e[60];let H;return e[61]!==S||e[62]!==V||e[63]!==B||e[64]!==y?(H=s.jsxs("div",{className:y,children:[S,V,B]}),e[61]=S,e[62]=V,e[63]=B,e[64]=y,e[65]=H):H=e[65],H}function ye(i){const e=Q.c(16),{viewMode:o,onViewModeChange:l,sortKey:t,sortDirection:p,onSort:g,sortOptions:x}=i;let j;e[0]!==x?(j=x===void 0?[]:x,e[0]=x,e[1]=j):j=e[1];const r=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(de,{children:s.jsxs(ue,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(ie,{asChild:!0,children:s.jsx(se,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(Y,{size:16})})})}),s.jsx(me,{children:"Search filters"})]})}),e[2]=v):v=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b={value:"table",icon:s.jsx(X,{})},e[3]=b):b=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=[b,{value:"cards",icon:s.jsx(ae,{})}],e[4]=c):c=e[4];let n;e[5]!==l||e[6]!==o?(n=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(he,{value:o,onValueChange:l,fullWidth:!0,options:c})}),e[5]=l,e[6]=o,e[7]=n):n=e[7];let h;e[8]!==g||e[9]!==p||e[10]!==t||e[11]!==r?(h=r.length>0&&g&&s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),r.map(w=>{const u=t===w.id;return s.jsx(oe,{onClick:()=>g(w.id),className:m("h-8 px-2 py-0 cursor-pointer",u&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u&&s.jsx(ce,{size:16,className:"text-foreground shrink-0"}),!u&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:w.label}),u&&p&&(p==="asc"?s.jsx(re,{size:16,className:"text-foreground shrink-0"}):s.jsx(U,{size:16,className:"text-foreground shrink-0"}))]})},w.id)})]}),e[8]=g,e[9]=p,e[10]=t,e[11]=r,e[12]=h):h=e[12];let d;return e[13]!==n||e[14]!==h?(d=s.jsxs(ne,{children:[v,s.jsxs(le,{align:"end",className:"w-[200px] p-0 gap-0",children:[n,h]})]}),e[13]=n,e[14]=h,e[15]=d):d=e[15],d}export{ye as C,he as V,U as n};
1
+ import{r as a,c as Q,j as s}from"./index-C4a1DvcM.js";import{B as se}from"./button-Chm7HSn5.js";import{c as oe,D as ie,b as ne,a as le}from"./dropdown-menu-MeaPHHuN.js";import{a as re,c as ae}from"./Grid01-4uSGUJjV.js";import{i as ce,a as de,c as ue,b as fe,T as me}from"./tooltip-DZ8PMo3S.js";import{c as m}from"./utils-BXNVuJET.js";const U=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));U.displayName="ArrowDown";const X=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));X.displayName="List";const Y=({size:i=24,color:e="currentColor",...o})=>a.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},a.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));Y.displayName="Sliders01";const xe={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function he(i){const e=Q.c(66),{value:o,onValueChange:l,options:t,size:p,fullWidth:g,className:x}=i,j=p===void 0?"sm":p,r=g===void 0?!1:g,v=a.useRef(null),b=a.useRef(null);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={left:0,width:0,opacity:0},e[0]=c):c=e[0];const[n,h]=a.useState(c);let d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=I=>{if(!I.current)return;const{offsetLeft:ee,offsetWidth:te}=I.current;h({left:ee,width:te,opacity:1})},e[1]=d):d=e[1];const w=d;let u;e[2]!==t[0].value||e[3]!==o?(u=()=>{const I=o===t[0].value?v:b;w(I)},e[2]=t[0].value,e[3]=o,e[4]=u):u=e[4];let R;e[5]!==t||e[6]!==o?(R=[o,t],e[5]=t,e[6]=o,e[7]=R):R=e[7],a.useEffect(u,R);const f=xe[j];let y;e[8]!==x?(y=m("relative flex gap-0 bg-muted rounded-lg",x),e[8]=x,e[9]=y):y=e[9];let N;e[10]!==l||e[11]!==t[0].value?(N=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=N):N=e[12];const P=r?"flex-1 h-12 px-4":f.button,Z=!r&&t[0].label?"px-3":"";let z;e[13]!==Z||e[14]!==P?(z=m("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",P,Z),e[13]=Z,e[14]=P,e[15]=z):z=e[15];const O=o===t[0].value?"text-foreground":"text-muted-foreground";let k;e[16]!==f.icon||e[17]!==O?(k=m("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",f.icon,O),e[16]=f.icon,e[17]=O,e[18]=k):k=e[18];let C;e[19]!==t[0].icon||e[20]!==k?(C=s.jsx("span",{className:k,children:t[0].icon}),e[19]=t[0].icon,e[20]=k,e[21]=C):C=e[21];let M;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(M=t[0].label&&s.jsx("span",{className:m("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=M):M=e[25];let S;e[26]!==z||e[27]!==C||e[28]!==M||e[29]!==N?(S=s.jsxs("button",{ref:v,type:"button",onClick:N,className:z,children:[C,M]}),e[26]=z,e[27]=C,e[28]=M,e[29]=N,e[30]=S):S=e[30];let _;e[31]!==l||e[32]!==t[1].value?(_=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=_):_=e[33];const A=r?"flex-1 h-12 px-4":f.button,K=!r&&t[1].label?"px-3":"";let E;e[34]!==A||e[35]!==K?(E=m("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",A,K),e[34]=A,e[35]=K,e[36]=E):E=e[36];const q=o===t[1].value?"text-foreground":"text-muted-foreground";let D;e[37]!==f.icon||e[38]!==q?(D=m("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",f.icon,q),e[37]=f.icon,e[38]=q,e[39]=D):D=e[39];let L;e[40]!==t[1].icon||e[41]!==D?(L=s.jsx("span",{className:D,children:t[1].icon}),e[40]=t[1].icon,e[41]=D,e[42]=L):L=e[42];let T;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(T=t[1].label&&s.jsx("span",{className:m("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=T):T=e[46];let V;e[47]!==_||e[48]!==E||e[49]!==L||e[50]!==T?(V=s.jsxs("button",{ref:b,type:"button",onClick:_,className:E,children:[L,T]}),e[47]=_,e[48]=E,e[49]=L,e[50]=T,e[51]=V):V=e[51];const F=r?"h-12":f.button;let W;e[52]!==F?(W=m("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",F),e[52]=F,e[53]=W):W=e[53];const G=`${n.left}px`,J=`${n.width}px`;let $;e[54]!==n.opacity||e[55]!==G||e[56]!==J?($={left:G,width:J,opacity:n.opacity},e[54]=n.opacity,e[55]=G,e[56]=J,e[57]=$):$=e[57];let B;e[58]!==W||e[59]!==$?(B=s.jsx("div",{className:W,style:$}),e[58]=W,e[59]=$,e[60]=B):B=e[60];let H;return e[61]!==S||e[62]!==V||e[63]!==B||e[64]!==y?(H=s.jsxs("div",{className:y,children:[S,V,B]}),e[61]=S,e[62]=V,e[63]=B,e[64]=y,e[65]=H):H=e[65],H}function ye(i){const e=Q.c(16),{viewMode:o,onViewModeChange:l,sortKey:t,sortDirection:p,onSort:g,sortOptions:x}=i;let j;e[0]!==x?(j=x===void 0?[]:x,e[0]=x,e[1]=j):j=e[1];const r=j;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(de,{children:s.jsxs(ue,{children:[s.jsx(fe,{asChild:!0,children:s.jsx(ie,{asChild:!0,children:s.jsx(se,{variant:"outline",size:"icon",className:"size-7 border border-input",children:s.jsx(Y,{size:16})})})}),s.jsx(me,{children:"Search filters"})]})}),e[2]=v):v=e[2];let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b={value:"table",icon:s.jsx(X,{})},e[3]=b):b=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=[b,{value:"cards",icon:s.jsx(ae,{})}],e[4]=c):c=e[4];let n;e[5]!==l||e[6]!==o?(n=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(he,{value:o,onValueChange:l,fullWidth:!0,options:c})}),e[5]=l,e[6]=o,e[7]=n):n=e[7];let h;e[8]!==g||e[9]!==p||e[10]!==t||e[11]!==r?(h=r.length>0&&g&&s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),r.map(w=>{const u=t===w.id;return s.jsx(oe,{onClick:()=>g(w.id),className:m("h-8 px-2 py-0 cursor-pointer",u&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u&&s.jsx(ce,{size:16,className:"text-foreground shrink-0"}),!u&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:w.label}),u&&p&&(p==="asc"?s.jsx(re,{size:16,className:"text-foreground shrink-0"}):s.jsx(U,{size:16,className:"text-foreground shrink-0"}))]})},w.id)})]}),e[8]=g,e[9]=p,e[10]=t,e[11]=r,e[12]=h):h=e[12];let d;return e[13]!==n||e[14]!==h?(d=s.jsxs(ne,{children:[v,s.jsxs(le,{align:"end",className:"w-[200px] p-0 gap-0",children:[n,h]})]}),e[13]=n,e[14]=h,e[15]=d):d=e[15],d}export{ye as C,he as V,U as n};
@@ -1 +1 @@
1
- import{c as j,j as i}from"./index-CzwYLjKx.js";import{C as b}from"./collection-display-button-DOaNnrf1.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
1
+ import{c as j,j as i}from"./index-C4a1DvcM.js";import{C as b}from"./collection-display-button-DDw_0fW6.js";function g(h){const e=j.c(17),{title:d,viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:n,ctaButton:p}=h;let c;e[0]!==n?(c=n===void 0?[]:n,e[0]=n,e[1]=c):c=e[1];const u=c;let t;e[2]!==d?(t=i.jsx("h1",{className:"text-sm font-medium text-foreground",children:d}),e[2]=d,e[3]=t):t=e[3];let s;e[4]!==x||e[5]!==l||e[6]!==f||e[7]!==m||e[8]!==u||e[9]!==r?(s=r&&l&&i.jsx(b,{viewMode:r,onViewModeChange:l,sortKey:m,sortDirection:f,onSort:x,sortOptions:u}),e[4]=x,e[5]=l,e[6]=f,e[7]=m,e[8]=u,e[9]=r,e[10]=s):s=e[10];let o;e[11]!==p||e[12]!==s?(o=i.jsxs("div",{className:"flex items-center gap-2",children:[s,p]}),e[11]=p,e[12]=s,e[13]=o):o=e[13];let a;return e[14]!==t||e[15]!==o?(a=i.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:i.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4",children:[t,o]})}),e[14]=t,e[15]=o,e[16]=a):a=e[16],a}export{g as C};
@@ -1 +1 @@
1
- import{c as s,j as c}from"./index-CzwYLjKx.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
1
+ import{c as s,j as c}from"./index-C4a1DvcM.js";function r(t){const e=s.c(2),{children:l}=t;let o;return e[0]!==l?(o=c.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden",children:l}),e[0]=l,e[1]=o):o=e[1],o}export{r as C};
@@ -1 +1 @@
1
- import{c as x,j as a}from"./index-CzwYLjKx.js";import{i as u}from"./SearchMd-CoQHJpld.js";import{I as b}from"./input-BGhWl8yr.js";import{c as g}from"./utils-D1FAHWbf.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
1
+ import{c as x,j as a}from"./index-C4a1DvcM.js";import{i as u}from"./SearchMd-BXC4Yoz_.js";import{I as b}from"./input-DCV4VviT.js";import{c as g}from"./utils-BXNVuJET.js";function w(h){const e=x.c(13),{value:n,onChange:c,placeholder:d,onKeyDown:i,className:m}=h,f=d===void 0?"Search...":d;let t;e[0]!==m?(t=g("shrink-0 w-full border-b border-border h-12",m),e[0]=m,e[1]=t):t=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=a.jsx(u,{size:16,className:"text-muted-foreground shrink-0"}),e[2]=o):o=e[2];let r;e[3]!==c?(r=p=>c(p.target.value),e[3]=c,e[4]=r):r=e[4];let s;e[5]!==i||e[6]!==f||e[7]!==r||e[8]!==n?(s=a.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[o,a.jsx(b,{value:n,onChange:r,onKeyDown:i,placeholder:f,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]}),e[5]=i,e[6]=f,e[7]=r,e[8]=n,e[9]=s):s=e[9];let l;return e[10]!==t||e[11]!==s?(l=a.jsx("div",{className:t,children:s}),e[10]=t,e[11]=s,e[12]=l):l=e[12],l}export{w as C};
@@ -1 +1 @@
1
- import{c as g,j as o}from"./index-CzwYLjKx.js";import{c as u}from"./utils-D1FAHWbf.js";import{n as T}from"./collection-display-button-DOaNnrf1.js";import{a as $}from"./Grid01-iXkiGD-C.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
1
+ import{c as g,j as o}from"./index-C4a1DvcM.js";import{c as u}from"./utils-BXNVuJET.js";import{n as T}from"./collection-display-button-DDw_0fW6.js";import{a as $}from"./Grid01-4uSGUJjV.js";function R(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("w-full caption-bottom text-sm min-w-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full min-w-0",children:o.jsx("table",{"data-slot":"table",className:l,...s})}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function H(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function L(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function S(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("data-[state=selected]:bg-muted border-b transition-colors",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function z(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function D(a){const e=g.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=u("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==s||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...s}),e[5]=s,e[6]=l,e[7]=r):r=e[7],r}function E(a){const e=g.c(29),{columns:t,data:s,sortKey:l,sortDirection:r,onSort:f,onRowClick:c,rowClassName:x}=a;let h;e[0]!==r?(h=function(n,N){return o.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&r&&(r==="asc"?o.jsx($,{size:16,className:"text-muted-foreground transition-colors"}):o.jsx(T,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=r,e[1]=h):h=e[1];const w=h;let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-xs h-9 uppercase tracking-wider w-8"),C},e[2]=p):p=e[2];const i=p;let d;if(e[3]!==t||e[4]!==f||e[5]!==w||e[6]!==l){let m;e[8]!==t.length||e[9]!==f||e[10]!==w||e[11]!==l?(m=(n,N)=>{const C=l===n.id;return o.jsx(z,{className:u(i(N,t.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&f?()=>f(n.id):void 0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&w(n.id,C)]})},n.id)},e[8]=t.length,e[9]=f,e[10]=w,e[11]=l,e[12]=m):m=e[12],d=t.map(m),e[3]=t,e[4]=f,e[5]=w,e[6]=l,e[7]=d}else d=e[7];let j;e[13]!==d?(j=o.jsx(H,{className:"sticky top-0 z-10 border-b-0 bg-muted/30",children:o.jsx(S,{className:"h-9 hover:bg-transparent border-b border-border",children:d})}),e[13]=d,e[14]=j):j=e[14];let v;if(e[15]!==t||e[16]!==s||e[17]!==c||e[18]!==x){let m;e[20]!==t||e[21]!==c||e[22]!==x?(m=(n,N)=>{const C=x?.(n);return o.jsx(S,{"data-row-index":N,className:u("group/data-row transition-colors border-b-0 hover:bg-accent/50",c?"cursor-pointer":"",C),onClick:c?()=>c(n):void 0,children:t.map(b=>o.jsx(D,{className:u("px-5 py-4 h-16 align-middle text-sm text-foreground",b.cellClassName,b.wrap?"whitespace-normal wrap-break-word":""),children:o.jsx("div",{className:u(b.wrap?"w-full":"min-w-0 w-full",!b.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:b.render?b.render(n):b.accessor?b.accessor(n):null})},b.id))},N)},e[20]=t,e[21]=c,e[22]=x,e[23]=m):m=e[23],v=s.map(m),e[15]=t,e[16]=s,e[17]=c,e[18]=x,e[19]=v}else v=e[19];let y;e[24]!==v?(y=o.jsx(L,{children:v}),e[24]=v,e[25]=y):y=e[25];let k;return e[26]!==j||e[27]!==y?(k=o.jsx("div",{className:"w-full bg-background min-w-0",children:o.jsxs(R,{className:"w-full border-collapse",children:[j,y]})}),e[26]=j,e[27]=y,e[28]=k):k=e[28],k}function W(a){const e=g.c(12),{columns:t,data:s,isLoading:l,sortKey:r,sortDirection:f,onSort:c,onRowClick:x,emptyState:h}=a;if(l===void 0?!1:l){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=i):i=e[0],i}if(s.length===0){let i;e[1]!==h?(i=h||o.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=h,e[2]=i):i=e[2];let d;return e[3]!==i?(d=o.jsx("div",{className:"flex items-center justify-center h-full",children:i}),e[3]=i,e[4]=d):d=e[4],d}let p;return e[5]!==t||e[6]!==s||e[7]!==x||e[8]!==c||e[9]!==f||e[10]!==r?(p=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(E,{columns:t,data:s,sortKey:r,sortDirection:f,onSort:c,onRowClick:x})}),e[5]=t,e[6]=s,e[7]=x,e[8]=c,e[9]=f,e[10]=r,e[11]=p):p=e[11],p}export{W as C};
@@ -1 +1 @@
1
- import{c as S,j as s}from"./index-CzwYLjKx.js";import{C as _}from"./card-pUBjGsjy.js";import{c as j}from"./utils-D1FAHWbf.js";import{I as A}from"./use-connection-D2GoBb_z.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
1
+ import{c as S,j as s}from"./index-C4a1DvcM.js";import{C as _}from"./card-BVamKRXq.js";import{c as j}from"./utils-BXNVuJET.js";import{I as A}from"./use-connection-8aFd9ZgQ.js";function H(h){const e=S.c(40),{connection:t,onClick:g,headerActions:v,footer:C,className:k,size:R,fallbackIcon:z}=h,b=R===void 0?"md":R,y=b==="sm"?"p-4":"p-6",I=b==="sm"?"text-sm":"text-base",w=b==="sm"?"text-xs":"text-sm",E=g&&"hover:bg-muted/50";let i;e[0]!==k||e[1]!==E?(i=j("cursor-pointer transition-colors group",E,k),e[0]=k,e[1]=E,e[2]=i):i=e[2];let l;e[3]!==y?(l=j("flex flex-col gap-4 relative",y),e[3]=y,e[4]=l):l=e[4];let o;e[5]!==t.icon||e[6]!==t.title||e[7]!==z?(o=s.jsx(A,{icon:t.icon,name:t.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:z}),e[5]=t.icon,e[6]=t.title,e[7]=z,e[8]=o):o=e[8];let n;e[9]!==v?(n=v&&s.jsx("div",{className:j("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:q,children:v}),e[9]=v,e[10]=n):n=e[10];let c;e[11]!==n?(c=s.jsx("div",{className:"relative",children:n}),e[11]=n,e[12]=c):c=e[12];let r;e[13]!==o||e[14]!==c?(r=s.jsxs("div",{className:"flex items-start justify-between",children:[o,c]}),e[13]=o,e[14]=c,e[15]=r):r=e[15];let a;e[16]!==I?(a=j("font-medium text-foreground truncate",I),e[16]=I,e[17]=a):a=e[17];let m;e[18]!==t.title||e[19]!==a?(m=s.jsx("h3",{className:a,children:t.title}),e[18]=t.title,e[19]=a,e[20]=m):m=e[20];let d;e[21]!==w?(d=j("text-muted-foreground line-clamp-2",w),e[21]=w,e[22]=d):d=e[22];const P=t.description||"No description";let f;e[23]!==d||e[24]!==P?(f=s.jsx("p",{className:d,children:P}),e[23]=d,e[24]=P,e[25]=f):f=e[25];let p;e[26]!==m||e[27]!==f?(p=s.jsxs("div",{className:"flex flex-col gap-0",children:[m,f]}),e[26]=m,e[27]=f,e[28]=p):p=e[28];let x;e[29]!==C?(x=C&&s.jsx("div",{onClick:$,children:C}),e[29]=C,e[30]=x):x=e[30];let u;e[31]!==p||e[32]!==x||e[33]!==l||e[34]!==r?(u=s.jsxs("div",{className:l,children:[r,p,x]}),e[31]=p,e[32]=x,e[33]=l,e[34]=r,e[35]=u):u=e[35];let N;return e[36]!==g||e[37]!==u||e[38]!==i?(N=s.jsx(_,{className:i,onClick:g,children:u}),e[36]=g,e[37]=u,e[38]=i,e[39]=N):N=e[39],N}function $(h){return h.stopPropagation()}function q(h){return h.stopPropagation()}export{H as C};
@@ -0,0 +1 @@
1
+ import{r as B,c as U,j as s,f as je,a as dt,t as mt,d as ut,b as ft,av as pt}from"./index-C4a1DvcM.js";import{E as G}from"./SearchMd-BXC4Yoz_.js";import{E as Ze}from"./error-boundary-m5kquR9K.js";import{I as be,b as Qe,d as ht,e as xt,c as gt,a as jt}from"./use-connection-8aFd9ZgQ.js";import{b as bt}from"./use-binding-C1zXgwae.js";import{E as qe,P as yt,u as Ct,S as vt}from"./index-BZz7aGs7.js";import{u as Nt,a as wt}from"./use-connection-resources-BaWWtVSI.js";import{B as ye}from"./button-Chm7HSn5.js";import{i as Xe}from"./Loading01-BUZAT-Ht.js";import{R as St}from"./resource-tabs-n23Yoxcd.js";import{V as ze,a as Tt,b as _t}from"./layout-BkDVhV_I.js";import{g as Ge}from"./generate-id-Dyweu44Y.js";import{C as Ce}from"./collection-display-button-DDw_0fW6.js";import{C as Ve}from"./collection-search-CBHWh6W9.js";import{C as Ke}from"./card-BVamKRXq.js";import{b as Ye,D as et,a as tt,c as q}from"./dropdown-menu-MeaPHHuN.js";import{a as st}from"./Copy01-BeUF9LPk.js";import{i as ot}from"./DotsVertical-CmKPHj4W.js";import{s as nt,u as $t}from"./use-list-state-DhJWwg48.js";import{s as it}from"./Trash01-KhsmIXrl.js";import{C as Fe}from"./collection-table-wrapper-CGsO_-78.js";import{n as He}from"./Inbox01-C8nofD1D.js";import{B as It}from"./extract-connection-data-BSn-ydRW.js";import{A as Dt,g as At,c as kt,b as Pt,d as Lt,e as Mt,a as Rt,f as Et}from"./alert-dialog-Ck-TQRXx.js";import{s as Ot}from"./Plus-DTWKiMkv.js";import{R as zt,T as Vt}from"./tools-list-Cw4QW2l7.js";import"./utils-BXNVuJET.js";import"./tooltip-DZ8PMo3S.js";import"./auth-DB_JGgAS.js";import"./mcp-oauth-Cm2UNUay.js";import"./use-organization-settings-CAOHB7nk.js";import"./use-tool-call-Dxebi6Uq.js";import"./File06-Cn7JLPIx.js";import"./Key01-CzDrcb2u.js";import"./form-BBS_Tp5l.js";import"./input-DCV4VviT.js";import"./select-BXHiOY7b.js";import"./ChevronDown-B5vWNgW1.js";import"./use-gateway-BGsZlt6a.js";import"./Grid01-4uSGUJjV.js";import"./CpuChip02-8BkRby_U.js";import"./formatDistanceToNow-Dkl3nWpl.js";import"./registry-utils-ulDDT0d8.js";import"./index-hySmljwG.js";import"./index-RS2MPOun.js";import"./schema-DIY49r7a.js";import"./badge-RGvdF-cd.js";import"./ArrowLeft-nKBVB_NL.js";import"./use-mobile-BQAr1bEF.js";import"./useQuery-39cprZL6.js";const Be=({size:t=24,color:e="currentColor",...o})=>B.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},B.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Be.displayName="Edit01";function Kt(t,e){const o=t.properties||{};for(const n in o){const l=o[n];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const i=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of i)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Ft(t){const e=U.c(25),{item:o,schema:i,actions:n}=t;let l;e[0]!==o||e[1]!==i?(l=Kt(i,o),e[0]=o,e[1]=i,e[2]=l):l=e[2];const u=l,y=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let h;e[3]!==n?(h=n&&Object.keys(n).length>0,e[3]=n,e[4]=h):h=e[4];const r=h;let d;e[5]!==u||e[6]!==o.title?(d=s.jsx(be,{icon:u,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=o.title,e[7]=d):d=e[7];let g;e[8]!==o.title?(g=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=g):g=e[9];const c=y||"No description";let f;e[10]!==c?(f=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:c}),e[10]=c,e[11]=f):f=e[11];let x;e[12]!==g||e[13]!==f?(x=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[g,f]}),e[12]=g,e[13]=f,e[14]=x):x=e[14];let j;e[15]!==d||e[16]!==x?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[d,x]}),e[15]=d,e[16]=x,e[17]=j):j=e[17];let a;e[18]!==n||e[19]!==r||e[20]!==o?(a=r&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:qt,onMouseDown:Wt,children:s.jsxs(Ye,{children:[s.jsx(et,{asChild:!0,children:s.jsx(ye,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ut,children:s.jsx(ot,{size:20})})}),s.jsxs(tt,{align:"end",onClick:Bt,children:[n.open&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.open?.(o)},children:[s.jsx(nt,{size:16}),"Open"]}),n.edit&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.edit?.(o)},children:[s.jsx(Be,{size:16}),"Edit"]}),n.duplicate&&s.jsxs(q,{onClick:b=>{b.stopPropagation(),n.duplicate?.(o)},children:[s.jsx(st,{size:16}),"Duplicate"]}),n.delete&&s.jsxs(q,{variant:"destructive",onClick:b=>{b.stopPropagation(),n.delete?.(o)},children:[s.jsx(it,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=r,e[20]=o,e[21]=a):a=e[21];let p;return e[22]!==j||e[23]!==a?(p=s.jsxs(Ke,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,a]}),e[22]=j,e[23]=a,e[24]=p):p=e[24],p}function Bt(t){return t.stopPropagation()}function Ut(t){return t.stopPropagation()}function Wt(t){return t.stopPropagation()}function qt(t){return t.stopPropagation()}const Gt=["icon","avatar","logo"],Je=["created_at","created_by","id"];function Ht(t){return Object.keys(t).find(e=>Gt.includes(e.toLowerCase()))}function rt(t,e){return Object.keys(t.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function Jt(t){const e=U.c(32),{data:o,schema:i,viewMode:n,onViewModeChange:l,search:u,sortKey:y,sortDirection:h,onSort:r,actions:d,onItemClick:g,headerActions:c,emptyState:f,readOnly:x,columns:j,hideToolbar:a,sortableFields:p}=t,b=l===void 0?es:l,N=h===void 0?"asc":h,T=r===void 0?Yt:r;let w;e[0]!==d?(w=d===void 0?{}:d,e[0]=d,e[1]=w):w=e[1];const _=w,S=g===void 0?Xt:g,L=c===void 0?null:c,A=f===void 0?null:f,R=x===void 0?!1:x,M=j===void 0?void 0:j,v=a===void 0?!1:a,$=p===void 0?void 0:p;let k;e[2]!==M||e[3]!==i||e[4]!==$?(k=M?M.filter(Qt).filter(C=>!$||$.includes(C.id)).map(Zt):rt(i,$),e[2]=M,e[3]=i,e[4]=$,e[5]=k):k=e[5];const D=k;let m;e[6]!==L||e[7]!==v||e[8]!==T||e[9]!==b||e[10]!==N||e[11]!==y||e[12]!==D||e[13]!==n?(m=!v&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:L}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(Ce,{viewMode:n,onViewModeChange:b,sortKey:y,sortDirection:N,onSort:T,sortOptions:D})})]})}),e[6]=L,e[7]=v,e[8]=T,e[9]=b,e[10]=N,e[11]=y,e[12]=D,e[13]=n,e[14]=m):m=e[14];let P;e[15]!==_||e[16]!==M||e[17]!==o||e[18]!==A||e[19]!==S||e[20]!==T||e[21]!==R||e[22]!==i||e[23]!==u||e[24]!==N||e[25]!==y||e[26]!==$||e[27]!==n?(P=n==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:A||s.jsx(qe,{icon:s.jsx(He,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(C=>s.jsx("div",{onClick:()=>S?.(C),className:"cursor-pointer h-full",children:s.jsx(Ft,{item:C,schema:i,readOnly:R,actions:_})},C.id))})}):s.jsx(Fe,{columns:os(M,i,$,_),data:o,sortKey:y,sortDirection:N,onSort:T,onRowClick:S,emptyState:A||s.jsx(qe,{icon:s.jsx(He,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=M,e[17]=o,e[18]=A,e[19]=S,e[20]=T,e[21]=R,e[22]=i,e[23]=u,e[24]=N,e[25]=y,e[26]=$,e[27]=n,e[28]=P):P=e[28];let I;return e[29]!==m||e[30]!==P?(I=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[m,P]}),e[29]=m,e[30]=P,e[31]=I):I=e[31],I}function Zt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Qt(t){return t.sortable!==!1}function Xt(){}function Yt(){}function es(){}function ts(t){return{id:"actions",header:"",render:e=>s.jsxs(Ye,{children:[s.jsx(et,{asChild:!0,children:s.jsx(ye,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(ot,{size:20})})}),s.jsxs(tt,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(nt,{size:16}),"Open"]}),t.edit&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(Be,{size:16}),"Edit"]}),t.duplicate&&s.jsxs(q,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(st,{size:16}),"Duplicate"]}),t.delete&&s.jsxs(q,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(it,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function lt(t){const e=t.type;return Array.isArray(e)?e.every(o=>lt({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function ss(t,e){const o=t.properties||{},i=Object.keys(o).filter(r=>{const d=o[r];return d&&lt(d)}),n=Ht(o),l=[],u=new Set;n&&i.includes(n)&&(l.push(n),u.add(n));const y=["title","description","updated_at","updated_by"];for(const r of y)i.includes(r)&&!u.has(r)&&(l.push(r),u.add(r));const h=i.filter(r=>!u.has(r)&&!Je.includes(r)).sort((r,d)=>r.localeCompare(d));for(const r of h)l.push(r),u.add(r);for(const r of Je)i.includes(r)&&!u.has(r)&&(l.push(r),u.add(r));return l.map(r=>{const d=o[r],g=e?e.includes(r):!["id"].includes(r);return r===n?{id:r,header:"",render:c=>{const f=c[r];return s.jsx(be,{icon:f,name:c.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:r==="description"?{id:r,header:"Description",render:c=>{const f=c[r];return f==null?"—":s.jsx("span",{className:"block truncate max-w-[50ch]",children:String(f)})},sortable:g,cellClassName:"max-w-[50ch]"}:d?.format==="date-time"||r.endsWith("_at")?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:c=>{const f=c[r];return f?s.jsx("span",{className:"block truncate max-w-full",children:new Date(f).toLocaleDateString()}):"—"},sortable:g,cellClassName:"max-w-[200px]"}:{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:c=>{const f=c[r];return f==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(f)})},sortable:g,cellClassName:"max-w-[200px]"}})}function os(t,e,o,i){const n=t||ss(e,o);return n.some(y=>y.id==="actions")?n:Object.keys(i).length>0?[...n,ts(i)]:n}function ns(t){const e=U.c(117),{connectionId:o,org:i,activeCollection:n}=t,l=n.name,u=n.schema??It,y=n.hasCreateTool,h=n.hasUpdateTool,r=n.hasDeleteTool,d=je(),{data:g}=dt.useSession(),c=g?.user?.id||"unknown",f=Qe(o);let x;e[0]!==o?(x=gt(o),e[0]=o,e[1]=x):x=e[1];const j=x,a=ht(o,l,j),p=`${o}-${l}`;let b;e[2]!==i||e[3]!==p?(b={namespace:i,resource:p,defaultSortKey:"updated_at"},e[2]=i,e[3]=p,e[4]=b):b=e[4];const{search:N,searchTerm:T,setSearch:w,viewMode:_,setViewMode:S,sortKey:L,sortDirection:A,handleSort:R}=$t(b);let M;e[5]!==T||e[6]!==A||e[7]!==L?(M={searchTerm:T,sortKey:L,sortDirection:A},e[5]=T,e[6]=A,e[7]=L,e[8]=M):M=e[8];const v=xt(o,l,j,M),$=!y&&!h&&!r;let k;e[9]!==l||e[10]!==o||e[11]!==d||e[12]!==i?(k=V=>{d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:V.id}})},e[9]=l,e[10]=o,e[11]=d,e[12]=i,e[13]=k):k=e[13];const D=k;let m;e[14]!==a.create||e[15]!==c?(m=async V=>{const ge=new Date().toISOString();await a.create.mutateAsync({...V,id:Ge("conn"),title:`${V.title} (Copy)`,created_at:ge,updated_at:ge,created_by:c,updated_by:c})},e[14]=a.create,e[15]=c,e[16]=m):m=e[16];const P=m,[I,C]=B.useState(null);let z;e[17]===Symbol.for("react.memo_cache_sentinel")?(z=V=>{C(V)},e[17]=z):z=e[17];const O=z;let K;e[18]!==D||e[19]!==h?(K=h&&{edit:D},e[18]=D,e[19]=h,e[20]=K):K=e[20];let F;e[21]!==P||e[22]!==y?(F=y&&{duplicate:P},e[21]=P,e[22]=y,e[23]=F):F=e[23];let E;e[24]!==r?(E=r&&{delete:O},e[24]=r,e[25]=E):E=e[25];let W;e[26]!==E||e[27]!==K||e[28]!==F?(W={...K,...F,...E},e[26]=E,e[27]=K,e[28]=F,e[29]=W):W=e[29];const ve=W;let de;e[30]!==a.delete||e[31]!==I?(de=async()=>{I&&(await a.delete.mutateAsync(I.id),C(null))},e[30]=a.delete,e[31]=I,e[32]=de):de=e[32];const Ne=de;let me;e[33]!==a.create||e[34]!==l||e[35]!==o||e[36]!==y||e[37]!==d||e[38]!==i||e[39]!==c?(me=async()=>{if(!y){mt.error("Create operation is not available for this collection");return}const V=new Date().toISOString(),ge={id:Ge("conn"),title:"New Item",description:"A brief description of the item",created_at:V,updated_at:V,created_by:c,updated_by:c};try{const Oe=await a.create.mutateAsync(ge);d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:Oe.id}})}catch(Oe){console.error("Failed to create item:",Oe)}},e[33]=a.create,e[34]=l,e[35]=o,e[36]=y,e[37]=d,e[38]=i,e[39]=c,e[40]=me):me=e[40];const we=me;let ue;e[41]!==u?(ue=rt(u),e[41]=u,e[42]=ue):ue=e[42];const Se=ue,Ue=(v?.length??0)>0,at=y&&Ue,ct=y&&!Ue&&!N;let fe;e[43]!==a.create||e[44]!==we||e[45]!==y?(fe=y?s.jsxs(ye,{onClick:we,size:"sm",disabled:a.create.isPending,className:"h-7",children:[s.jsx(Ot,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[43]=a.create,e[44]=we,e[45]=y,e[46]=fe):fe=e[46];const We=fe,Te=L;let H;e[47]!==R||e[48]!==S||e[49]!==A||e[50]!==Se||e[51]!==Te||e[52]!==_?(H=s.jsx(Ce,{viewMode:_,onViewModeChange:S,sortKey:Te,sortDirection:A,onSort:R,sortOptions:Se}),e[47]=R,e[48]=S,e[49]=A,e[50]=Se,e[51]=Te,e[52]=_,e[53]=H):H=e[53];const _e=`${l}s`,$e=f?.icon??"grid_view";let J;e[54]!==o||e[55]!==_e||e[56]!==$e?(J=s.jsx(yt,{connectionId:o,title:_e,icon:$e}),e[54]=o,e[55]=_e,e[56]=$e,e[57]=J):J=e[57];const Ie=at&&We;let Z;e[58]!==H||e[59]!==J||e[60]!==Ie?(Z=s.jsxs(ze,{children:[H,J,Ie]}),e[58]=H,e[59]=J,e[60]=Ie,e[61]=Z):Z=e[61];const De=`Search ${l}...`;let Q;e[62]!==w?(Q=V=>{V.key==="Escape"&&(w(""),V.target.blur())},e[62]=w,e[63]=Q):Q=e[63];let X;e[64]!==N||e[65]!==w||e[66]!==De||e[67]!==Q?(X=s.jsx(Ve,{value:N,onChange:w,placeholder:De,onKeyDown:Q}),e[64]=N,e[65]=w,e[66]=De,e[67]=Q,e[68]=X):X=e[68];let Y;e[69]!==v?(Y=v??[],e[69]=v,e[70]=Y):Y=e[70];const Ae=L;let ee;e[71]!==D?(ee=V=>D(V),e[71]=D,e[72]=ee):ee=e[72];const ke="No items found",Pe=N?"Try adjusting your search terms":"This collection doesn't have any items yet.",Le=ct?We:void 0;let te;e[73]!==ke||e[74]!==Pe||e[75]!==Le?(te=s.jsx(G,{image:null,title:ke,description:Pe,actions:Le}),e[73]=ke,e[74]=Pe,e[75]=Le,e[76]=te):te=e[76];let se;e[77]!==R||e[78]!==$||e[79]!==ve||e[80]!==u||e[81]!==N||e[82]!==w||e[83]!==S||e[84]!==A||e[85]!==Y||e[86]!==Ae||e[87]!==ee||e[88]!==te||e[89]!==_?(se=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Jt,{hideToolbar:!0,data:Y,schema:u,viewMode:_,onViewModeChange:S,search:N,onSearchChange:w,sortKey:Ae,sortDirection:A,onSort:R,actions:ve,onItemClick:ee,readOnly:$,emptyState:te})}),e[77]=R,e[78]=$,e[79]=ve,e[80]=u,e[81]=N,e[82]=w,e[83]=S,e[84]=A,e[85]=Y,e[86]=Ae,e[87]=ee,e[88]=te,e[89]=_,e[90]=se):se=e[90];let oe;e[91]!==X||e[92]!==se?(oe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[X,se]}),e[91]=X,e[92]=se,e[93]=oe):oe=e[93];const Me=!!I;let pe;e[94]===Symbol.for("react.memo_cache_sentinel")?(pe=V=>{V||C(null)},e[94]=pe):pe=e[94];let he;e[95]===Symbol.for("react.memo_cache_sentinel")?(he=s.jsx(kt,{children:"Delete item?"}),e[95]=he):he=e[95];const Re=I?.title;let ne;e[96]!==Re?(ne=s.jsxs(Pt,{children:[he,s.jsxs(Lt,{children:['Are you sure you want to delete "',Re,'"? This action cannot be undone.']})]}),e[96]=Re,e[97]=ne):ne=e[97];let ie;e[98]!==a.delete.isPending?(ie=s.jsx(Dt,{disabled:a.delete.isPending,children:"Cancel"}),e[98]=a.delete.isPending,e[99]=ie):ie=e[99];const Ee=a.delete.isPending?"Deleting...":"Delete";let re;e[100]!==a.delete.isPending||e[101]!==Ne||e[102]!==Ee?(re=s.jsx(At,{onClick:Ne,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ee}),e[100]=a.delete.isPending,e[101]=Ne,e[102]=Ee,e[103]=re):re=e[103];let le;e[104]!==ie||e[105]!==re?(le=s.jsxs(Mt,{children:[ie,re]}),e[104]=ie,e[105]=re,e[106]=le):le=e[106];let ae;e[107]!==ne||e[108]!==le?(ae=s.jsxs(Rt,{children:[ne,le]}),e[107]=ne,e[108]=le,e[109]=ae):ae=e[109];let ce;e[110]!==Me||e[111]!==ae?(ce=s.jsx(Et,{open:Me,onOpenChange:pe,children:ae}),e[110]=Me,e[111]=ae,e[112]=ce):ce=e[112];let xe;return e[113]!==Z||e[114]!==oe||e[115]!==ce?(xe=s.jsxs(s.Fragment,{children:[Z,oe,ce]}),e[113]=Z,e[114]=oe,e[115]=ce,e[116]=xe):xe=e[116],xe}function is(t){const e=U.c(39),{prompts:o,connectionId:i,org:n,onPromptClick:l,showToolbar:u,emptyMessage:y}=t,h=u===void 0?!0:u,r=y===void 0?"This connection doesn't have any prompts yet.":y,d=je(),[g,c]=B.useState(""),[f,x]=B.useState("table"),[j,a]=B.useState("name"),[p,b]=B.useState("asc");let N;e[0]!==p||e[1]!==j?(N=C=>{j===C?(b(ds),p==="desc"&&a(void 0)):(a(C),b("asc"))},e[0]=p,e[1]=j,e[2]=N):N=e[2];const T=N;let w;e[3]!==i||e[4]!==d||e[5]!==l||e[6]!==n?(w=C=>{l?l(C):i&&n&&d({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:n,connectionId:i,collectionName:"prompts",itemId:encodeURIComponent(C.name)}})},e[3]=i,e[4]=d,e[5]=l,e[6]=n,e[7]=w):w=e[7];const _=w;let S;if(e[8]!==o||e[9]!==g||e[10]!==p||e[11]!==j){const C=!o||o.length===0?[]:g.trim()?(()=>{const z=g.toLowerCase();return o.filter(O=>O.name.toLowerCase().includes(z)||O.description&&O.description.toLowerCase().includes(z))})():o;S=!j||!p?C:[...C].sort((z,O)=>{const K=z[j]||"",F=O[j]||"",E=String(K).localeCompare(String(F));return p==="asc"?E:-E}),e[8]=o,e[9]=g,e[10]=p,e[11]=j,e[12]=S}else S=e[12];const L=S;let A;e[13]===Symbol.for("react.memo_cache_sentinel")?(A=[{id:"name",header:"Name",render:cs,sortable:!0},{id:"description",header:"Description",render:as,cellClassName:"flex-1",sortable:!0}],e[13]=A):A=e[13];const R=A;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=R.filter(ls).map(rs),e[14]=M):M=e[14];const v=M;let $;e[15]!==T||e[16]!==h||e[17]!==p||e[18]!==j||e[19]!==f?($=h&&s.jsx(ze,{children:s.jsx(Ce,{viewMode:f,onViewModeChange:x,sortKey:j,sortDirection:p,onSort:T,sortOptions:v})}),e[15]=T,e[16]=h,e[17]=p,e[18]=j,e[19]=f,e[20]=$):$=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=C=>{C.key==="Escape"&&(c(""),C.target.blur())},e[21]=k):k=e[21];let D;e[22]!==g?(D=s.jsx(Ve,{value:g,onChange:c,placeholder:"Search prompts...",onKeyDown:k}),e[22]=g,e[23]=D):D=e[23];let m;e[24]!==r||e[25]!==_||e[26]!==T||e[27]!==g||e[28]!==p||e[29]!==j||e[30]!==L||e[31]!==f?(m=f==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:L.length===0?s.jsx(G,{image:null,title:g?"No prompts found":"No prompts available",description:g?"Try adjusting your search terms":r}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:L.map(C=>s.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>_(C),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(be,{icon:null,name:C.name,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.name}),s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:C.description||"No description"})]})]})},C.name))})}):s.jsx(Fe,{columns:R,data:L,isLoading:!1,sortKey:j,sortDirection:p,onSort:T,onRowClick:C=>_(C),emptyState:s.jsx(G,{image:null,title:g?"No prompts found":"No prompts available",description:g?"Try adjusting your search terms":r})}),e[24]=r,e[25]=_,e[26]=T,e[27]=g,e[28]=p,e[29]=j,e[30]=L,e[31]=f,e[32]=m):m=e[32];let P;e[33]!==D||e[34]!==m?(P=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,m]}),e[33]=D,e[34]=m,e[35]=P):P=e[35];let I;return e[36]!==P||e[37]!==$?(I=s.jsxs(s.Fragment,{children:[$,P]}),e[36]=P,e[37]=$,e[38]=I):I=e[38],I}function rs(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function ls(t){return t.sortable}function as(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function cs(t){return s.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function ds(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function ms(t){const e=U.c(4),{prompts:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(is,{prompts:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function us(t){const e=U.c(2),{repository:o}=t;let i;return e[0]!==o?(i=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(zt,{repository:o})}),e[0]=o,e[1]=i):i=e[1],i}function fs(t){const e=U.c(36),{resources:o,onResourceClick:i,showToolbar:n,emptyMessage:l}=t,u=n===void 0?!0:n,y=l===void 0?"This connection doesn't have any resources yet.":l,[h,r]=B.useState(""),[d,g]=B.useState("table"),[c,f]=B.useState("name"),[x,j]=B.useState("asc");let a;e[0]!==x||e[1]!==c?(a=m=>{c===m?(j(ys),x==="desc"&&f(void 0)):(f(m),j("asc"))},e[0]=x,e[1]=c,e[2]=a):a=e[2];const p=a;let b;e[3]!==i?(b=m=>{i&&i(m)},e[3]=i,e[4]=b):b=e[4];const N=b;let T;if(e[5]!==o||e[6]!==h||e[7]!==x||e[8]!==c){const m=!o||o.length===0?[]:h.trim()?(()=>{const P=h.toLowerCase();return o.filter(I=>I.uri.toLowerCase().includes(P)||I.name&&I.name.toLowerCase().includes(P)||I.description&&I.description.toLowerCase().includes(P))})():o;T=!c||!x?m:[...m].sort((P,I)=>{const C=P[c]||"",z=I[c]||"",O=String(C).localeCompare(String(z));return x==="asc"?O:-O}),e[5]=o,e[6]=h,e[7]=x,e[8]=c,e[9]=T}else T=e[9];const w=T;let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=[{id:"name",header:"Name",render:bs,sortable:!0},{id:"uri",header:"URI",render:js,sortable:!0},{id:"description",header:"Description",render:gs,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:xs,sortable:!0}],e[10]=_):_=e[10];const S=_;let L;e[11]===Symbol.for("react.memo_cache_sentinel")?(L=S.filter(hs).map(ps),e[11]=L):L=e[11];const A=L;let R;e[12]!==p||e[13]!==u||e[14]!==x||e[15]!==c||e[16]!==d?(R=u&&s.jsx(ze,{children:s.jsx(Ce,{viewMode:d,onViewModeChange:g,sortKey:c,sortDirection:x,onSort:p,sortOptions:A})}),e[12]=p,e[13]=u,e[14]=x,e[15]=c,e[16]=d,e[17]=R):R=e[17];let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=m=>{m.key==="Escape"&&(r(""),m.target.blur())},e[18]=M):M=e[18];let v;e[19]!==h?(v=s.jsx(Ve,{value:h,onChange:r,placeholder:"Search resources...",onKeyDown:M}),e[19]=h,e[20]=v):v=e[20];let $;e[21]!==y||e[22]!==N||e[23]!==p||e[24]!==h||e[25]!==x||e[26]!==c||e[27]!==w||e[28]!==d?($=d==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:w.length===0?s.jsx(G,{image:null,title:h?"No resources found":"No resources available",description:h?"Try adjusting your search terms":y}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:w.map(m=>s.jsx(Ke,{className:"cursor-pointer transition-colors",onClick:()=>N(m),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(be,{icon:null,name:m.name||m.uri,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:m.name||m.uri}),s.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:m.uri}),m.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:m.description})]})]})},m.uri))})}):s.jsx(Fe,{columns:S,data:w,isLoading:!1,sortKey:c,sortDirection:x,onSort:p,onRowClick:m=>N(m),emptyState:s.jsx(G,{image:null,title:h?"No resources found":"No resources available",description:h?"Try adjusting your search terms":y})}),e[21]=y,e[22]=N,e[23]=p,e[24]=h,e[25]=x,e[26]=c,e[27]=w,e[28]=d,e[29]=$):$=e[29];let k;e[30]!==v||e[31]!==$?(k=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[v,$]}),e[30]=v,e[31]=$,e[32]=k):k=e[32];let D;return e[33]!==k||e[34]!==R?(D=s.jsxs(s.Fragment,{children:[R,k]}),e[33]=k,e[34]=R,e[35]=D):D=e[35],D}function ps(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function hs(t){return t.sortable}function xs(t){return s.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function gs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function js(t){return s.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function bs(t){return s.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function ys(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Cs(t){const e=U.c(4),{resources:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(fs,{resources:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function vs(t){const e=U.c(4),{tools:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(Vt,{tools:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function Ns(t){const e=U.c(60),{connection:o,connectionId:i,org:n,requestedTabId:l,collections:u,onUpdate:y,isUpdating:h,prompts:r,resources:d}=t,g=pt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/mcps/$connectionId"},e[0]=c):c=e[0];const f=je(c);let x;e[1]!==i?(x={connectionId:i},e[1]=i,e[2]=x):x=e[2];const j=Ct(x),a=j.isAuthenticated,p=o?.metadata?.repository,b=!!p?.url,N=o?.tools?.length??0,T=r.length,w=d.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=e[3];let S;e[4]!==a||e[5]!==N?(S=a&&N>0?[{id:"tools",label:"Tools",count:N}]:[],e[4]=a,e[5]=N,e[6]=S):S=e[6];let L;e[7]!==a||e[8]!==T?(L=a&&T>0?[{id:"prompts",label:"Prompts",count:T}]:[],e[7]=a,e[8]=T,e[9]=L):L=e[9];let A;e[10]!==a||e[11]!==w?(A=a&&w>0?[{id:"resources",label:"Resources",count:w}]:[],e[10]=a,e[11]=w,e[12]=A):A=e[12];let R;if(e[13]!==u||e[14]!==b||e[15]!==a||e[16]!==S||e[17]!==L||e[18]!==A){let E;e[20]!==b?(E=b?[{id:"readme",label:"README"}]:[],e[20]=b,e[21]=E):E=e[21],R=[_,...S,...L,...A,...a?(u||[]).map(ws):[],...E],e[13]=u,e[14]=b,e[15]=a,e[16]=S,e[17]=L,e[18]=A,e[19]=R}else R=e[19];const M=R,v=M.some(E=>E.id===l)?l:"settings";let $;e[22]!==f?($=E=>{f({search:W=>({...W,tab:E}),replace:!0})},e[22]=f,e[23]=$):$=e[23];const k=$;let D;e[24]!==u?(D=u||[],e[24]=u,e[25]=D):D=e[25];let m;if(e[26]!==v||e[27]!==D){let E;e[29]!==v?(E=W=>W.name===v,e[29]=v,e[30]=E):E=e[30],m=D.find(E),e[26]=v,e[27]=D,e[28]=m}else m=e[28];const P=m;let I;e[31]!==g.history?(I=()=>g.history.back(),e[31]=g.history,e[32]=I):I=e[32];let C;e[33]!==v||e[34]!==k||e[35]!==M?(C=s.jsx(Tt,{children:s.jsx(St,{tabs:M,activeTab:v,onTabChange:k})}),e[33]=v,e[34]=k,e[35]=M,e[36]=C):C=e[36];let z;e[37]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=z):z=e[37];let O;e[38]!==P||e[39]!==v||e[40]!==j.supportsOAuth||e[41]!==o||e[42]!==i||e[43]!==k||e[44]!==b||e[45]!==a||e[46]!==h||e[47]!==y||e[48]!==n||e[49]!==r||e[50]!==p||e[51]!==d?(O=s.jsx(B.Suspense,{fallback:z,children:v==="tools"?s.jsx(vs,{tools:o.tools??void 0,connectionId:i,org:n}):v==="prompts"?s.jsx(ms,{prompts:r,connectionId:i,org:n}):v==="resources"?s.jsx(Cs,{resources:d,connectionId:i,org:n}):v==="settings"?s.jsx(vt,{connection:o,onUpdate:y,isUpdating:h,isMCPAuthenticated:a,supportsOAuth:j.supportsOAuth,onViewReadme:b?()=>k("readme"):void 0}):v==="readme"&&b?s.jsx(us,{repository:p}):P&&a?s.jsx(ns,{connectionId:i,org:n,activeCollection:P},v):s.jsx(G,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=P,e[39]=v,e[40]=j.supportsOAuth,e[41]=o,e[42]=i,e[43]=k,e[44]=b,e[45]=a,e[46]=h,e[47]=y,e[48]=n,e[49]=r,e[50]=p,e[51]=d,e[52]=O):O=e[52];let K;e[53]!==v||e[54]!==O?(K=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(Ze,{children:O},v)})}),e[53]=v,e[54]=O,e[55]=K):K=e[55];let F;return e[56]!==I||e[57]!==C||e[58]!==K?(F=s.jsxs(_t,{onBack:I,children:[C,K]}),e[56]=I,e[57]=C,e[58]=K,e[59]=F):F=e[59],F}function ws(t){return{id:t.name,label:t.displayName}}function Ss(){const t=U.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=je(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/mcps/$connectionId"},t[1]=i):i=t[1];const{connectionId:n,org:l}=ut(i);let u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u={from:"/shell/$org/mcps/$connectionId"},t[2]=u):u=t[2];const h=ft(u).tab||"settings",r=Qe(n),d=jt(),g=bt(r??void 0);let c;t[3]!==n?(c=[n],t[3]=n,t[4]=c):c=t[4];const{promptsMap:f}=Nt(c);let x;t[5]!==n?(x=[n],t[5]=n,t[6]=x):x=t[6];const{resourcesMap:j}=wt(x);let a;t[7]!==n||t[8]!==f?(a=f.get(n)??[],t[7]=n,t[8]=f,t[9]=a):a=t[9];const p=a;let b;t[10]!==n||t[11]!==j?(b=j.get(n)??[],t[10]=n,t[11]=j,t[12]=b):b=t[12];const N=b;let T;t[13]!==d.update||t[14]!==n?(T=async S=>{await d.update.mutateAsync({id:n,data:S})},t[13]=d.update,t[14]=n,t[15]=T):T=t[15];const w=T;if(!r){let S;return t[16]!==o||t[17]!==l?(S=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(G,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(ye,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=o,t[17]=l,t[18]=S):S=t[18],S}let _;return t[19]!==d.update.isPending||t[20]!==g||t[21]!==r||t[22]!==n||t[23]!==w||t[24]!==l||t[25]!==p||t[26]!==h||t[27]!==N?(_=s.jsx(Ns,{org:l,connection:r,connectionId:n,requestedTabId:h,collections:g,onUpdate:w,isUpdating:d.update.isPending,prompts:p,resources:N}),t[19]=d.update.isPending,t[20]=g,t[21]=r,t[22]=n,t[23]=w,t[24]=l,t[25]=p,t[26]=h,t[27]=N,t[28]=_):_=t[28],_}function Ts(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ze,{children:s.jsx(B.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(Xe,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(Ss,{})})}),t[0]=e):e=t[0],e}function So(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ts,{}),t[0]=e):e=t[0],e}export{So as default};
@@ -1 +1 @@
1
- import{c as Fe,j as t,r as Me,f as He,b as Oe,a as Re,x as Ve,y as Le}from"./index-CzwYLjKx.js";import{C as Ue}from"./schema-DefbPj25.js";import{C as We}from"./collection-header-BjOsszVr.js";import{C as qe}from"./collection-page-BoULTFo5.js";import{C as Ge}from"./collection-search-BaQnC0wl.js";import{C as Je}from"./collection-table-wrapper-CWSD0OK_.js";import{C as Qe}from"./connection-card-ChEGdD3i.js";import{E as ke}from"./SearchMd-CoQHJpld.js";import{E as Xe}from"./error-boundary-Ctu3eNTK.js";import{a as Ye,u as Ze,n as Ke,I as et}from"./use-connection-D2GoBb_z.js";import{u as tt,s as Pe}from"./use-list-state-BjDzxCt9.js";import{u as nt}from"./tooltip-CRtbHuaD.js";import{c as ot,b as st,d as it,A as rt,e as lt,g as ct,a as at,f as dt}from"./alert-dialog-BuGENs_x.js";import{B as mt}from"./badge-xSWfUH8C.js";import{B as E}from"./button-DkKLNB2C.js";import{a as ut,b as pt,D as ht,f as ft,c as gt,d as xt}from"./dialog-D5ajYIuQ.js";import{b as Te,D as $e,a as Ae,c as he}from"./dropdown-menu-BwfRJqX3.js";import{F as K,a as jt,b as B,c as H,d as O,f as R}from"./form-DGgpciyh.js";import{i as ze}from"./DotsVertical-Rjkn1qAc.js";import{i as Ct}from"./Loading01-EBx-peK5.js";import{s as Ee}from"./Trash01-B-JvszLz.js";import{I as Ie}from"./input-BGhWl8yr.js";import{S as _t,a as St,b as yt,c as vt,d as Ne}from"./select-C-8wPfQb.js";import{T as wt}from"./textarea-BPpOx-7u.js";import{g as bt}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-DOaNnrf1.js";import"./Grid01-iXkiGD-C.js";import"./utils-D1FAHWbf.js";import"./card-pUBjGsjy.js";import"./use-mobile-B89ZoGbj.js";import"./X-EXSAob0c.js";import"./ChevronDown-BAEvQsP1.js";const Dt=Ue.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function kt(e,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function Nt(){const e=Fe.c(126),{org:n}=nt(),r=He();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V={strict:!1},e[0]=V):V=e[0];const Be=Oe(V),{data:fe}=Re.useSession();let L;e[1]!==n.slug?(L={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=L):L=e[2];const o=tt(L),d=Ye(),F=Ze(o);let U;e[3]===Symbol.for("react.memo_cache_sentinel")?(U={mode:"idle"},e[3]=U):U=e[3];const[c,m]=Me.useReducer(kt,U),W=Be.action==="create";let q;e[4]!==r||e[5]!==n.slug?(q=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=q):q=e[6];const ge=q;let G;e[7]!==r||e[8]!==n.slug?(G=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=G):G=e[9];const u=G;let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J={resolver:Ve(Dt),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=J):J=e[10];const i=Le(J),l=c.mode==="editing"?c.connection:null;let Q,X;e[11]!==l||e[12]!==i?(Q=()=>{l?i.reset({title:l.title,description:l.description,connection_type:l.connection_type,connection_url:l.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},X=[l,i],e[11]=l,e[12]=i,e[13]=Q,e[14]=X):(Q=e[13],X=e[14]),Me.useEffect(Q,X);let Y;e[15]!==d||e[16]!==c.connection||e[17]!==c.mode?(Y=async()=>{if(c.mode!=="deleting")return;const s=c.connection.id;m({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=c.connection,e[17]=c.mode,e[18]=Y):Y=e[18];const xe=Y;let Z;e[19]!==d||e[20]!==u||e[21]!==l||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==fe?.user?.id?(Z=async s=>{if(l){await d.update.mutateAsync({id:l.id,data:{title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,...s.connection_token&&{connection_token:s.connection_token}}}),m({type:"close"}),i.reset();return}const a=bt("conn");await d.create.mutateAsync({id:a,title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,connection_token:s.connection_token||null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:fe?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:null,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),u(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=u,e[21]=l,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=fe?.user?.id,e[27]=Z):Z=e[27];const je=Z;let ee;e[28]!==u||e[29]!==i||e[30]!==W?(ee=s=>{s||(W?u():m({type:"close"}),i.reset())},e[28]=u,e[29]=i,e[30]=W,e[31]=ee):ee=e[31];const p=ee;let te,ne,oe,se,ie,re;e[32]===Symbol.for("react.memo_cache_sentinel")?(te={id:"icon",header:"",render:Vt,cellClassName:"w-16 shrink-0",wrap:!0},ne={id:"title",header:"Name",render:Rt,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},oe={id:"description",header:"Description",render:Ot,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},se={id:"connection_type",header:"Type",accessor:Ht,cellClassName:"w-24 shrink-0",sortable:!0},ie={id:"connection_url",header:"URL",render:Bt,cellClassName:"w-48 min-w-0 shrink-0"},re={id:"status",header:"Status",render:Kt,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=te,e[33]=ne,e[34]=oe,e[35]=se,e[36]=ie,e[37]=re):(te=e[32],ne=e[33],oe=e[34],se=e[35],ie=e[36],re=e[37]);let le;e[38]!==r||e[39]!==n.slug?(le=[te,ne,oe,se,ie,re,{id:"actions",header:"",render:s=>t.jsxs(Te,{children:[t.jsx($e,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ft,children:t.jsx(ze,{size:20})})}),t.jsxs(Ae,{align:"end",onClick:Et,children:[t.jsxs(he,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(Pe,{size:16}),"Inspect"]}),t.jsxs(he,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({type:"delete",connection:s})},children:[t.jsx(Ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=le):le=e[40];const Ce=le;let h;e[41]!==r||e[42]!==n.slug?(h=t.jsx(E,{variant:"outline",onClick:()=>r({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e[41]=r,e[42]=n.slug,e[43]=h):h=e[43];let f;e[44]!==ge?(f=t.jsx(E,{onClick:ge,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[44]=ge,e[45]=f):f=e[45];let ce;e[46]!==h||e[47]!==f?(ce=t.jsxs("div",{className:"flex items-center gap-2",children:[h,f]}),e[46]=h,e[47]=f,e[48]=ce):ce=e[48];const _e=ce,Se=W||c.mode==="editing",ye=l?"Edit Connection":"Create New Connection";let g;e[49]!==ye?(g=t.jsx(ut,{children:ye}),e[49]=ye,e[50]=g):g=e[50];const ve=l?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let x;e[51]!==ve?(x=t.jsx(pt,{children:ve}),e[51]=ve,e[52]=x):x=e[52];let j;e[53]!==g||e[54]!==x?(j=t.jsxs(ht,{children:[g,x]}),e[53]=g,e[54]=x,e[55]=j):j=e[55];let C;e[56]!==i||e[57]!==je?(C=i.handleSubmit(je),e[56]=i,e[57]=je,e[58]=C):C=e[58];let _;e[59]!==i.control?(_=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(K,{control:i.control,name:"title",render:zt}),t.jsx(K,{control:i.control,name:"description",render:At}),t.jsx(K,{control:i.control,name:"connection_type",render:$t}),t.jsx(K,{control:i.control,name:"connection_url",render:Tt}),t.jsx(K,{control:i.control,name:"connection_token",render:Pt})]}),e[59]=i.control,e[60]=_):_=e[60];let S;e[61]!==p?(S=t.jsx(E,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[61]=p,e[62]=S):S=e[62];const we=i.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection";let y;e[63]!==i.formState.isSubmitting||e[64]!==we?(y=t.jsx(E,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:we}),e[63]=i.formState.isSubmitting,e[64]=we,e[65]=y):y=e[65];let v;e[66]!==S||e[67]!==y?(v=t.jsxs(ft,{children:[S,y]}),e[66]=S,e[67]=y,e[68]=v):v=e[68];let w;e[69]!==C||e[70]!==_||e[71]!==v?(w=t.jsxs("form",{onSubmit:C,children:[_,v]}),e[69]=C,e[70]=_,e[71]=v,e[72]=w):w=e[72];let b;e[73]!==i||e[74]!==w?(b=t.jsx(jt,{...i,children:w}),e[73]=i,e[74]=w,e[75]=b):b=e[75];let D;e[76]!==j||e[77]!==b?(D=t.jsxs(gt,{className:"sm:max-w-[525px]",children:[j,b]}),e[76]=j,e[77]=b,e[78]=D):D=e[78];let k;e[79]!==p||e[80]!==Se||e[81]!==D?(k=t.jsx(xt,{open:Se,onOpenChange:p,children:D}),e[79]=p,e[80]=Se,e[81]=D,e[82]=k):k=e[82];const be=c.mode==="deleting";let ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(ae=s=>!s&&m({type:"close"}),e[83]=ae):ae=e[83];let de;e[84]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(ot,{children:"Delete Connection?"}),e[84]=de):de=e[84];const De=c.mode==="deleting"&&c.connection.title;let N;e[85]!==De?(N=t.jsxs(st,{children:[de,t.jsxs(it,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:De}),"."]})]}),e[85]=De,e[86]=N):N=e[86];let me;e[87]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(rt,{children:"Cancel"}),e[87]=me):me=e[87];let M;e[88]!==xe?(M=t.jsxs(lt,{children:[me,t.jsx(ct,{onClick:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[88]=xe,e[89]=M):M=e[89];let I;e[90]!==N||e[91]!==M?(I=t.jsxs(at,{children:[N,M]}),e[90]=N,e[91]=M,e[92]=I):I=e[92];let P;e[93]!==be||e[94]!==I?(P=t.jsx(dt,{open:be,onOpenChange:ae,children:I}),e[93]=be,e[94]=I,e[95]=P):P=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[96]=ue):ue=e[96];let T;e[97]!==_e||e[98]!==o.handleSort||e[99]!==o.setViewMode||e[100]!==o.sortDirection||e[101]!==o.sortKey||e[102]!==o.viewMode?(T=t.jsx(We,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:ue,ctaButton:_e}),e[97]=_e,e[98]=o.handleSort,e[99]=o.setViewMode,e[100]=o.sortDirection,e[101]=o.sortKey,e[102]=o.viewMode,e[103]=T):T=e[103];let $;e[104]!==o?($=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[104]=o,e[105]=$):$=e[105];let A;e[106]!==o.search||e[107]!==o.setSearch||e[108]!==$?(A=t.jsx(Ge,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:$}),e[106]=o.search,e[107]=o.setSearch,e[108]=$,e[109]=A):A=e[109];let z;e[110]!==Ce||e[111]!==F||e[112]!==o.handleSort||e[113]!==o.search||e[114]!==o.sortDirection||e[115]!==o.sortKey||e[116]!==o.viewMode||e[117]!==r||e[118]!==n.slug?(z=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:F.length===0?t.jsx(ke,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(o.search,"No MCP Servers found"),description:o.search?`No MCP Servers match "${o.search}"`:"Create a connection to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:F.map(s=>t.jsx(Qe,{connection:s,fallbackIcon:t.jsx(Ke,{}),onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Te,{children:[t.jsx($e,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:It,children:t.jsx(ze,{size:20})})}),t.jsxs(Ae,{align:"end",onClick:Mt,children:[t.jsxs(he,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(Pe,{size:16}),"Inspect"]}),t.jsxs(he,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({type:"delete",connection:s})},children:[t.jsx(Ee,{size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(Je,{columns:Ce,data:F,isLoading:!1,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,onRowClick:s=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),emptyState:o.search?t.jsx(ke,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${o.search}"`}):t.jsx(ke,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})}),e[110]=Ce,e[111]=F,e[112]=o.handleSort,e[113]=o.search,e[114]=o.sortDirection,e[115]=o.sortKey,e[116]=o.viewMode,e[117]=r,e[118]=n.slug,e[119]=z):z=e[119];let pe;return e[120]!==k||e[121]!==P||e[122]!==T||e[123]!==A||e[124]!==z?(pe=t.jsxs(qe,{children:[k,P,T,A,z]}),e[120]=k,e[121]=P,e[122]=T,e[123]=A,e[124]=z,e[125]=pe):pe=e[125],pe}function Mt(e){return e.stopPropagation()}function It(e){return e.stopPropagation()}function Pt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Token (optional)"}),t.jsx(O,{children:t.jsx(Ie,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(R,{})]})}function Tt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"URL *"}),t.jsx(O,{children:t.jsx(Ie,{placeholder:"https://example.com/mcp",...n})}),t.jsx(R,{})]})}function $t(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Type *"}),t.jsxs(_t,{value:n.value,onValueChange:n.onChange,children:[t.jsx(O,{children:t.jsx(St,{children:t.jsx(yt,{})})}),t.jsxs(vt,{children:[t.jsx(Ne,{value:"HTTP",children:"HTTP"}),t.jsx(Ne,{value:"SSE",children:"SSE"}),t.jsx(Ne,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(R,{})]})}function At(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(O,{children:t.jsx(wt,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(R,{})]})}function zt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Name *"}),t.jsx(O,{children:t.jsx(Ie,{placeholder:"My Connection",...n})}),t.jsx(R,{})]})}function Et(e){return e.stopPropagation()}function Ft(e){return e.stopPropagation()}function Kt(e){return t.jsx(mt,{variant:e.status==="active"?"success":"outline",children:e.status})}function Bt(e){const n=e.connection_url,r=n.length>40?`${n.slice(0,40)}...`:n;return t.jsx("span",{className:"text-sm text-muted-foreground",children:r})}function Ht(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function Ot(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Rt(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Vt(e){return t.jsx(et,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(Ke,{})})}function vn(){const e=Fe.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Xe,{children:t.jsx(Me.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ct,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Nt,{})})}),e[0]=n):n=e[0],n}export{vn as default};
1
+ import{c as Fe,j as t,r as Me,f as He,b as Oe,a as Re,x as Ve,y as Le}from"./index-C4a1DvcM.js";import{C as Ue}from"./schema-DIY49r7a.js";import{C as We}from"./collection-header-BVYMmoel.js";import{C as qe}from"./collection-page-BoS9hpji.js";import{C as Ge}from"./collection-search-CBHWh6W9.js";import{C as Je}from"./collection-table-wrapper-CGsO_-78.js";import{C as Qe}from"./connection-card-D6fhK6Cn.js";import{E as ke}from"./SearchMd-BXC4Yoz_.js";import{E as Xe}from"./error-boundary-m5kquR9K.js";import{a as Ye,u as Ze,n as Ke,I as et}from"./use-connection-8aFd9ZgQ.js";import{u as tt,s as Pe}from"./use-list-state-DhJWwg48.js";import{u as nt}from"./tooltip-DZ8PMo3S.js";import{c as ot,b as st,d as it,A as rt,e as lt,g as ct,a as at,f as dt}from"./alert-dialog-Ck-TQRXx.js";import{B as mt}from"./badge-RGvdF-cd.js";import{B as E}from"./button-Chm7HSn5.js";import{a as ut,b as pt,D as ht,f as ft,c as gt,d as xt}from"./dialog-kXtxooG_.js";import{b as Te,D as $e,a as Ae,c as he}from"./dropdown-menu-MeaPHHuN.js";import{F as K,a as jt,b as B,c as H,d as O,f as R}from"./form-BBS_Tp5l.js";import{i as ze}from"./DotsVertical-CmKPHj4W.js";import{i as Ct}from"./Loading01-BUZAT-Ht.js";import{s as Ee}from"./Trash01-KhsmIXrl.js";import{I as Ie}from"./input-DCV4VviT.js";import{S as _t,a as St,b as yt,c as vt,d as Ne}from"./select-BXHiOY7b.js";import{T as wt}from"./textarea-BA6caASm.js";import{g as bt}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-DDw_0fW6.js";import"./Grid01-4uSGUJjV.js";import"./utils-BXNVuJET.js";import"./card-BVamKRXq.js";import"./use-mobile-BQAr1bEF.js";import"./X-BFstV52u.js";import"./ChevronDown-B5vWNgW1.js";const Dt=Ue.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function kt(e,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function Nt(){const e=Fe.c(126),{org:n}=nt(),r=He();let V;e[0]===Symbol.for("react.memo_cache_sentinel")?(V={strict:!1},e[0]=V):V=e[0];const Be=Oe(V),{data:fe}=Re.useSession();let L;e[1]!==n.slug?(L={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=L):L=e[2];const o=tt(L),d=Ye(),F=Ze(o);let U;e[3]===Symbol.for("react.memo_cache_sentinel")?(U={mode:"idle"},e[3]=U):U=e[3];const[c,m]=Me.useReducer(kt,U),W=Be.action==="create";let q;e[4]!==r||e[5]!==n.slug?(q=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=q):q=e[6];const ge=q;let G;e[7]!==r||e[8]!==n.slug?(G=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=G):G=e[9];const u=G;let J;e[10]===Symbol.for("react.memo_cache_sentinel")?(J={resolver:Ve(Dt),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=J):J=e[10];const i=Le(J),l=c.mode==="editing"?c.connection:null;let Q,X;e[11]!==l||e[12]!==i?(Q=()=>{l?i.reset({title:l.title,description:l.description,connection_type:l.connection_type,connection_url:l.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},X=[l,i],e[11]=l,e[12]=i,e[13]=Q,e[14]=X):(Q=e[13],X=e[14]),Me.useEffect(Q,X);let Y;e[15]!==d||e[16]!==c.connection||e[17]!==c.mode?(Y=async()=>{if(c.mode!=="deleting")return;const s=c.connection.id;m({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=c.connection,e[17]=c.mode,e[18]=Y):Y=e[18];const xe=Y;let Z;e[19]!==d||e[20]!==u||e[21]!==l||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==fe?.user?.id?(Z=async s=>{if(l){await d.update.mutateAsync({id:l.id,data:{title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,...s.connection_token&&{connection_token:s.connection_token}}}),m({type:"close"}),i.reset();return}const a=bt("conn");await d.create.mutateAsync({id:a,title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,connection_token:s.connection_token||null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:fe?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:null,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),u(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=u,e[21]=l,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=fe?.user?.id,e[27]=Z):Z=e[27];const je=Z;let ee;e[28]!==u||e[29]!==i||e[30]!==W?(ee=s=>{s||(W?u():m({type:"close"}),i.reset())},e[28]=u,e[29]=i,e[30]=W,e[31]=ee):ee=e[31];const p=ee;let te,ne,oe,se,ie,re;e[32]===Symbol.for("react.memo_cache_sentinel")?(te={id:"icon",header:"",render:Vt,cellClassName:"w-16 shrink-0",wrap:!0},ne={id:"title",header:"Name",render:Rt,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},oe={id:"description",header:"Description",render:Ot,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},se={id:"connection_type",header:"Type",accessor:Ht,cellClassName:"w-24 shrink-0",sortable:!0},ie={id:"connection_url",header:"URL",render:Bt,cellClassName:"w-48 min-w-0 shrink-0"},re={id:"status",header:"Status",render:Kt,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=te,e[33]=ne,e[34]=oe,e[35]=se,e[36]=ie,e[37]=re):(te=e[32],ne=e[33],oe=e[34],se=e[35],ie=e[36],re=e[37]);let le;e[38]!==r||e[39]!==n.slug?(le=[te,ne,oe,se,ie,re,{id:"actions",header:"",render:s=>t.jsxs(Te,{children:[t.jsx($e,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ft,children:t.jsx(ze,{size:20})})}),t.jsxs(Ae,{align:"end",onClick:Et,children:[t.jsxs(he,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(Pe,{size:16}),"Inspect"]}),t.jsxs(he,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({type:"delete",connection:s})},children:[t.jsx(Ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=le):le=e[40];const Ce=le;let h;e[41]!==r||e[42]!==n.slug?(h=t.jsx(E,{variant:"outline",onClick:()=>r({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e[41]=r,e[42]=n.slug,e[43]=h):h=e[43];let f;e[44]!==ge?(f=t.jsx(E,{onClick:ge,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[44]=ge,e[45]=f):f=e[45];let ce;e[46]!==h||e[47]!==f?(ce=t.jsxs("div",{className:"flex items-center gap-2",children:[h,f]}),e[46]=h,e[47]=f,e[48]=ce):ce=e[48];const _e=ce,Se=W||c.mode==="editing",ye=l?"Edit Connection":"Create New Connection";let g;e[49]!==ye?(g=t.jsx(ut,{children:ye}),e[49]=ye,e[50]=g):g=e[50];const ve=l?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let x;e[51]!==ve?(x=t.jsx(pt,{children:ve}),e[51]=ve,e[52]=x):x=e[52];let j;e[53]!==g||e[54]!==x?(j=t.jsxs(ht,{children:[g,x]}),e[53]=g,e[54]=x,e[55]=j):j=e[55];let C;e[56]!==i||e[57]!==je?(C=i.handleSubmit(je),e[56]=i,e[57]=je,e[58]=C):C=e[58];let _;e[59]!==i.control?(_=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(K,{control:i.control,name:"title",render:zt}),t.jsx(K,{control:i.control,name:"description",render:At}),t.jsx(K,{control:i.control,name:"connection_type",render:$t}),t.jsx(K,{control:i.control,name:"connection_url",render:Tt}),t.jsx(K,{control:i.control,name:"connection_token",render:Pt})]}),e[59]=i.control,e[60]=_):_=e[60];let S;e[61]!==p?(S=t.jsx(E,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[61]=p,e[62]=S):S=e[62];const we=i.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection";let y;e[63]!==i.formState.isSubmitting||e[64]!==we?(y=t.jsx(E,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:we}),e[63]=i.formState.isSubmitting,e[64]=we,e[65]=y):y=e[65];let v;e[66]!==S||e[67]!==y?(v=t.jsxs(ft,{children:[S,y]}),e[66]=S,e[67]=y,e[68]=v):v=e[68];let w;e[69]!==C||e[70]!==_||e[71]!==v?(w=t.jsxs("form",{onSubmit:C,children:[_,v]}),e[69]=C,e[70]=_,e[71]=v,e[72]=w):w=e[72];let b;e[73]!==i||e[74]!==w?(b=t.jsx(jt,{...i,children:w}),e[73]=i,e[74]=w,e[75]=b):b=e[75];let D;e[76]!==j||e[77]!==b?(D=t.jsxs(gt,{className:"sm:max-w-[525px]",children:[j,b]}),e[76]=j,e[77]=b,e[78]=D):D=e[78];let k;e[79]!==p||e[80]!==Se||e[81]!==D?(k=t.jsx(xt,{open:Se,onOpenChange:p,children:D}),e[79]=p,e[80]=Se,e[81]=D,e[82]=k):k=e[82];const be=c.mode==="deleting";let ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(ae=s=>!s&&m({type:"close"}),e[83]=ae):ae=e[83];let de;e[84]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(ot,{children:"Delete Connection?"}),e[84]=de):de=e[84];const De=c.mode==="deleting"&&c.connection.title;let N;e[85]!==De?(N=t.jsxs(st,{children:[de,t.jsxs(it,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:De}),"."]})]}),e[85]=De,e[86]=N):N=e[86];let me;e[87]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(rt,{children:"Cancel"}),e[87]=me):me=e[87];let M;e[88]!==xe?(M=t.jsxs(lt,{children:[me,t.jsx(ct,{onClick:xe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[88]=xe,e[89]=M):M=e[89];let I;e[90]!==N||e[91]!==M?(I=t.jsxs(at,{children:[N,M]}),e[90]=N,e[91]=M,e[92]=I):I=e[92];let P;e[93]!==be||e[94]!==I?(P=t.jsx(dt,{open:be,onOpenChange:ae,children:I}),e[93]=be,e[94]=I,e[95]=P):P=e[95];let ue;e[96]===Symbol.for("react.memo_cache_sentinel")?(ue=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[96]=ue):ue=e[96];let T;e[97]!==_e||e[98]!==o.handleSort||e[99]!==o.setViewMode||e[100]!==o.sortDirection||e[101]!==o.sortKey||e[102]!==o.viewMode?(T=t.jsx(We,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:ue,ctaButton:_e}),e[97]=_e,e[98]=o.handleSort,e[99]=o.setViewMode,e[100]=o.sortDirection,e[101]=o.sortKey,e[102]=o.viewMode,e[103]=T):T=e[103];let $;e[104]!==o?($=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[104]=o,e[105]=$):$=e[105];let A;e[106]!==o.search||e[107]!==o.setSearch||e[108]!==$?(A=t.jsx(Ge,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:$}),e[106]=o.search,e[107]=o.setSearch,e[108]=$,e[109]=A):A=e[109];let z;e[110]!==Ce||e[111]!==F||e[112]!==o.handleSort||e[113]!==o.search||e[114]!==o.sortDirection||e[115]!==o.sortKey||e[116]!==o.viewMode||e[117]!==r||e[118]!==n.slug?(z=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:F.length===0?t.jsx(ke,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(o.search,"No MCP Servers found"),description:o.search?`No MCP Servers match "${o.search}"`:"Create a connection to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:F.map(s=>t.jsx(Qe,{connection:s,fallbackIcon:t.jsx(Ke,{}),onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Te,{children:[t.jsx($e,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:It,children:t.jsx(ze,{size:20})})}),t.jsxs(Ae,{align:"end",onClick:Mt,children:[t.jsxs(he,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(Pe,{size:16}),"Inspect"]}),t.jsxs(he,{variant:"destructive",onClick:a=>{a.stopPropagation(),m({type:"delete",connection:s})},children:[t.jsx(Ee,{size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(Je,{columns:Ce,data:F,isLoading:!1,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,onRowClick:s=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),emptyState:o.search?t.jsx(ke,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${o.search}"`}):t.jsx(ke,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})}),e[110]=Ce,e[111]=F,e[112]=o.handleSort,e[113]=o.search,e[114]=o.sortDirection,e[115]=o.sortKey,e[116]=o.viewMode,e[117]=r,e[118]=n.slug,e[119]=z):z=e[119];let pe;return e[120]!==k||e[121]!==P||e[122]!==T||e[123]!==A||e[124]!==z?(pe=t.jsxs(qe,{children:[k,P,T,A,z]}),e[120]=k,e[121]=P,e[122]=T,e[123]=A,e[124]=z,e[125]=pe):pe=e[125],pe}function Mt(e){return e.stopPropagation()}function It(e){return e.stopPropagation()}function Pt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Token (optional)"}),t.jsx(O,{children:t.jsx(Ie,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(R,{})]})}function Tt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"URL *"}),t.jsx(O,{children:t.jsx(Ie,{placeholder:"https://example.com/mcp",...n})}),t.jsx(R,{})]})}function $t(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Type *"}),t.jsxs(_t,{value:n.value,onValueChange:n.onChange,children:[t.jsx(O,{children:t.jsx(St,{children:t.jsx(yt,{})})}),t.jsxs(vt,{children:[t.jsx(Ne,{value:"HTTP",children:"HTTP"}),t.jsx(Ne,{value:"SSE",children:"SSE"}),t.jsx(Ne,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(R,{})]})}function At(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(O,{children:t.jsx(wt,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(R,{})]})}function zt(e){const{field:n}=e;return t.jsxs(B,{children:[t.jsx(H,{children:"Name *"}),t.jsx(O,{children:t.jsx(Ie,{placeholder:"My Connection",...n})}),t.jsx(R,{})]})}function Et(e){return e.stopPropagation()}function Ft(e){return e.stopPropagation()}function Kt(e){return t.jsx(mt,{variant:e.status==="active"?"success":"outline",children:e.status})}function Bt(e){const n=e.connection_url,r=n.length>40?`${n.slice(0,40)}...`:n;return t.jsx("span",{className:"text-sm text-muted-foreground",children:r})}function Ht(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function Ot(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Rt(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Vt(e){return t.jsx(et,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(Ke,{})})}function vn(){const e=Fe.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Xe,{children:t.jsx(Me.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ct,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Nt,{})})}),e[0]=n):n=e[0],n}export{vn as default};
@@ -1,4 +1,4 @@
1
- import{F as te,aj as Ae}from"./index-CzwYLjKx.js";function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},fn.apply(null,arguments)}function bt(e,n){if(e==null)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)!==-1)continue;a[t]=e[t]}return a}function wt(e,n){if(e==null)return{};var a,t,c=bt(e,n);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(t=0;t<d.length;t++)a=d[t],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function xt(e){if(Array.isArray(e))return dn(e)}function St(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kt(e,n){if(e){if(typeof e=="string")return dn(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?dn(e,n):void 0}}function At(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{F as te,aj as Ae}from"./index-C4a1DvcM.js";function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},fn.apply(null,arguments)}function bt(e,n){if(e==null)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)!==-1)continue;a[t]=e[t]}return a}function wt(e,n){if(e==null)return{};var a,t,c=bt(e,n);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(t=0;t<d.length;t++)a=d[t],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function xt(e){if(Array.isArray(e))return dn(e)}function St(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kt(e,n){if(e){if(typeof e=="string")return dn(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?dn(e,n):void 0}}function At(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pn(e){return xt(e)||St(e)||kt(e)||At()}function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},me(e)}function Ct(e,n){if(me(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var t=a.call(e,n);if(me(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ft(e){var n=Ct(e,"string");return me(n)=="symbol"?n:n+""}function it(e,n,a){return(n=Ft(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Sn(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),a.push.apply(a,t)}return a}function pe(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Sn(Object(a),!0).forEach(function(t){it(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Sn(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function Lt(e){var n=e.length;if(n===0||n===1)return e;if(n===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(n===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(n>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ee={};function Nt(e){if(e.length===0||e.length===1)return e;var n=e.join(".");return Ee[n]||(Ee[n]=Lt(e)),Ee[n]}function Ot(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,t=e.filter(function(d){return d!=="token"}),c=Nt(t);return c.reduce(function(d,g){return pe(pe({},d),a[g])},n)}function kn(e){return e.join(" ")}function Tt(e,n){var a=0;return function(t){return a+=1,t.map(function(c,d){return lt({node:c,stylesheet:e,useInlineStyles:n,key:"code-segment-".concat(a,"-").concat(d)})})}}function lt(e){var n=e.node,a=e.stylesheet,t=e.style,c=t===void 0?{}:t,d=e.useInlineStyles,g=e.key,o=n.properties,h=n.type,k=n.tagName,A=n.value;if(h==="text")return A;if(k){var m=Tt(a,d),b;if(!d)b=pe(pe({},o),{},{className:kn(o.className)});else{var y=Object.keys(a).reduce(function(F,l){return l.split(".").forEach(function(i){F.includes(i)||F.push(i)}),F},[]),w=o.className&&o.className.includes("token")?["token"]:[],x=o.className&&w.concat(o.className.filter(function(F){return!y.includes(F)}));b=pe(pe({},o),{},{className:kn(x)||void 0,style:Ot(o.className,Object.assign({},o.style,c),a)})}var S=m(n.children);return te.createElement(k,fn({key:g},b),S)}}const Et=(function(e,n){var a=e.listLanguages();return a.indexOf(n)!==-1});var qt=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function An(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),a.push.apply(a,t)}return a}function ae(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?An(Object(a),!0).forEach(function(t){it(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):An(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}var jt=/\n/g;function $t(e){return e.match(jt)}function It(e){var n=e.lines,a=e.startingLineNumber,t=e.style;return n.map(function(c,d){var g=d+a;return te.createElement("span",{key:"line-".concat(d),className:"react-syntax-highlighter-line-number",style:typeof t=="function"?t(g):t},"".concat(g,`
3
3
  `))})}function Pt(e){var n=e.codeString,a=e.codeStyle,t=e.containerStyle,c=t===void 0?{float:"left",paddingRight:"10px"}:t,d=e.numberStyle,g=d===void 0?{}:d,o=e.startingLineNumber;return te.createElement("code",{style:Object.assign({},a,c)},It({lines:n.replace(/\n$/,"").split(`
4
4
  `),style:g,startingLineNumber:o}))}function Rt(e){return"".concat(e.toString().length,".25em")}function ct(e,n){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:n},children:[{type:"text",value:e}]}}function st(e,n,a){var t={display:"inline-block",minWidth:Rt(a),paddingRight:"1em",textAlign:"right",userSelect:"none"},c=typeof e=="function"?e(n):e,d=ae(ae({},t),c);return d}function ke(e){var n=e.children,a=e.lineNumber,t=e.lineNumberStyle,c=e.largestLineNumber,d=e.showInlineLineNumbers,g=e.lineProps,o=g===void 0?{}:g,h=e.className,k=h===void 0?[]:h,A=e.showLineNumbers,m=e.wrapLongLines,b=e.wrapLines,y=b===void 0?!1:b,w=y?ae({},typeof o=="function"?o(a):o):{};if(w.className=w.className?[].concat(pn(w.className.trim().split(/\s+/)),pn(k)):k,a&&d){var x=st(t,a,c);n.unshift(ct(a,x))}return m&A&&(w.style=ae({display:"flex"},w.style)),{type:"element",tagName:"span",properties:w,children:n}}function ut(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],t=0;t<e.length;t++){var c=e[t];if(c.type==="text")a.push(ke({children:[c],className:pn(new Set(n))}));else if(c.children){var d=n.concat(c.properties.className);ut(c.children,d).forEach(function(g){return a.push(g)})}}return a}function Dt(e,n,a,t,c,d,g,o,h){var k,A=ut(e.value),m=[],b=-1,y=0;function w(u,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return ke({children:u,lineNumber:r,lineNumberStyle:o,largestLineNumber:g,showInlineLineNumbers:c,lineProps:a,className:s,showLineNumbers:t,wrapLongLines:h,wrapLines:n})}function x(u,r){if(t&&r&&c){var s=st(o,r,g);u.unshift(ct(r,s))}return u}function S(u,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return n||s.length>0?w(u,r,s):x(u,r)}for(var F=function(){var r=A[y],s=r.children[0].value,v=$t(s);if(v){var f=s.split(`
@@ -1 +1 @@
1
- import{v as D,w as O,c as _,f as N,x as E,y as T,j as r,a as I}from"./index-CzwYLjKx.js";import{A as M,a as L,b as R,c as $,d as B,e as V,f as k}from"./alert-dialog-BuGENs_x.js";import{u as q,B as H}from"./button-DkKLNB2C.js";import{F as U,a as G,b as J,c as K,d as P,e as Q,f as W}from"./form-DGgpciyh.js";import{I as X}from"./input-BGhWl8yr.js";import{S as Y}from"./spinner-C91qSR1a.js";function A(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z=D({name:O().min(2,"Organization name is required")});function ne(n){const e=_.c(42),{open:o,onOpenChange:l}=n,y=N();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={resolver:E(Z),defaultValues:{name:""}},e[0]=b):b=e[0];const t=T(b);let z;e[1]!==y?(z={mutationFn:ee,onSuccess:i=>{const{orgSlug:s}=i;y({to:"/$org",params:{org:s}})}},e[1]=y,e[2]=z):z=e[2];const a=q(z),F=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsxs(R,{children:[r.jsx($,{children:"Create a new organization"}),r.jsx(B,{children:"Set up a new organization to collaborate with others."})]}),e[3]=w):w=e[3];let m;if(e[4]!==a||e[5]!==t){let i;e[7]!==a?(i=s=>a.mutateAsync(s),e[7]=a,e[8]=i):i=e[8],m=t.handleSubmit(i),e[4]=a,e[5]=t,e[6]=m}else m=e[6];let c;e[9]!==t.formState.isSubmitting?(c=i=>{const{field:s}=i;return r.jsxs(J,{children:[r.jsx(K,{children:"Organization Name"}),r.jsx(P,{children:r.jsx(X,{...s,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(Q,{children:"The name of your company or organization"}),s.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",A(s.value)]})]}),r.jsx(W,{})]})},e[9]=t.formState.isSubmitting,e[10]=c):c=e[10];let g;e[11]!==t.control||e[12]!==c?(g=r.jsx(U,{control:t.control,name:"name",render:c}),e[11]=t.control,e[12]=c,e[13]=g):g=e[13];let f;e[14]!==F?(f=F&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:F}),e[14]=F,e[15]=f):f=e[15];let u;e[16]!==a||e[17]!==t?(u=()=>{a.reset(),t.reset()},e[16]=a,e[17]=t,e[18]=u):u=e[18];let d;e[19]!==t.formState.isSubmitting||e[20]!==u?(d=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:u,children:"Cancel"}),e[19]=t.formState.isSubmitting,e[20]=u,e[21]=d):d=e[21];const v=!t.formState.isValid||t.formState.isSubmitting;let p;e[22]!==t.formState.isSubmitting?(p=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Y,{size:"xs"})," Creating..."]}):"Create Organization",e[22]=t.formState.isSubmitting,e[23]=p):p=e[23];let x;e[24]!==v||e[25]!==p?(x=r.jsx(H,{type:"submit",variant:"default",disabled:v,children:p}),e[24]=v,e[25]=p,e[26]=x):x=e[26];let S;e[27]!==x||e[28]!==d?(S=r.jsxs(V,{children:[d,x]}),e[27]=x,e[28]=d,e[29]=S):S=e[29];let h;e[30]!==S||e[31]!==m||e[32]!==g||e[33]!==f?(h=r.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[g,f,S]}),e[30]=S,e[31]=m,e[32]=g,e[33]=f,e[34]=h):h=e[34];let j;e[35]!==t||e[36]!==h?(j=r.jsxs(L,{children:[w,r.jsx(G,{...t,children:h})]}),e[35]=t,e[36]=h,e[37]=j):j=e[37];let C;return e[38]!==l||e[39]!==o||e[40]!==j?(C=r.jsx(k,{open:o,onOpenChange:l,children:j}),e[38]=l,e[39]=o,e[40]=j,e[41]=C):C=e[41],C}async function ee(n){const e=A(n.name);if(!e)throw new Error("Organization slug is invalid");const o=await I.organization.create({name:n.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const l=o?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}export{ne as C};
1
+ import{v as D,w as O,c as _,f as N,x as E,y as T,j as r,a as I}from"./index-C4a1DvcM.js";import{A as M,a as L,b as R,c as $,d as B,e as V,f as k}from"./alert-dialog-Ck-TQRXx.js";import{u as q,B as H}from"./button-Chm7HSn5.js";import{F as U,a as G,b as J,c as K,d as P,e as Q,f as W}from"./form-BBS_Tp5l.js";import{I as X}from"./input-DCV4VviT.js";import{S as Y}from"./spinner-zi1IadXF.js";function A(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z=D({name:O().min(2,"Organization name is required")});function ne(n){const e=_.c(42),{open:o,onOpenChange:l}=n,y=N();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={resolver:E(Z),defaultValues:{name:""}},e[0]=b):b=e[0];const t=T(b);let z;e[1]!==y?(z={mutationFn:ee,onSuccess:i=>{const{orgSlug:s}=i;y({to:"/$org",params:{org:s}})}},e[1]=y,e[2]=z):z=e[2];const a=q(z),F=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsxs(R,{children:[r.jsx($,{children:"Create a new organization"}),r.jsx(B,{children:"Set up a new organization to collaborate with others."})]}),e[3]=w):w=e[3];let m;if(e[4]!==a||e[5]!==t){let i;e[7]!==a?(i=s=>a.mutateAsync(s),e[7]=a,e[8]=i):i=e[8],m=t.handleSubmit(i),e[4]=a,e[5]=t,e[6]=m}else m=e[6];let c;e[9]!==t.formState.isSubmitting?(c=i=>{const{field:s}=i;return r.jsxs(J,{children:[r.jsx(K,{children:"Organization Name"}),r.jsx(P,{children:r.jsx(X,{...s,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(Q,{children:"The name of your company or organization"}),s.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",A(s.value)]})]}),r.jsx(W,{})]})},e[9]=t.formState.isSubmitting,e[10]=c):c=e[10];let g;e[11]!==t.control||e[12]!==c?(g=r.jsx(U,{control:t.control,name:"name",render:c}),e[11]=t.control,e[12]=c,e[13]=g):g=e[13];let f;e[14]!==F?(f=F&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:F}),e[14]=F,e[15]=f):f=e[15];let u;e[16]!==a||e[17]!==t?(u=()=>{a.reset(),t.reset()},e[16]=a,e[17]=t,e[18]=u):u=e[18];let d;e[19]!==t.formState.isSubmitting||e[20]!==u?(d=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:u,children:"Cancel"}),e[19]=t.formState.isSubmitting,e[20]=u,e[21]=d):d=e[21];const v=!t.formState.isValid||t.formState.isSubmitting;let p;e[22]!==t.formState.isSubmitting?(p=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Y,{size:"xs"})," Creating..."]}):"Create Organization",e[22]=t.formState.isSubmitting,e[23]=p):p=e[23];let x;e[24]!==v||e[25]!==p?(x=r.jsx(H,{type:"submit",variant:"default",disabled:v,children:p}),e[24]=v,e[25]=p,e[26]=x):x=e[26];let S;e[27]!==x||e[28]!==d?(S=r.jsxs(V,{children:[d,x]}),e[27]=x,e[28]=d,e[29]=S):S=e[29];let h;e[30]!==S||e[31]!==m||e[32]!==g||e[33]!==f?(h=r.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[g,f,S]}),e[30]=S,e[31]=m,e[32]=g,e[33]=f,e[34]=h):h=e[34];let j;e[35]!==t||e[36]!==h?(j=r.jsxs(L,{children:[w,r.jsx(G,{...t,children:h})]}),e[35]=t,e[36]=h,e[37]=j):j=e[37];let C;return e[38]!==l||e[39]!==o||e[40]!==j?(C=r.jsx(k,{open:o,onOpenChange:l,children:j}),e[38]=l,e[39]=o,e[40]=j,e[41]=C):C=e[41],C}async function ee(n){const e=A(n.name);if(!e)throw new Error("Organization slug is invalid");const o=await I.organization.create({name:n.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const l=o?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}export{ne as C};