@decocms/mesh 2.74.0 → 2.75.0

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 (153) hide show
  1. package/dist/client/assets/{AlertCircle-C_hR5usO.js → AlertCircle-BtLmHyy8.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-DnJUZ1OS.js → ArrowUp-CS3ZollZ.js} +1 -1
  3. package/dist/client/assets/{Calendar-Dnf0_EY9.js → Calendar-D6iDOsnM.js} +1 -1
  4. package/dist/client/assets/{Check-Sa4xK5Hg.js → Check-D3ubYXxc.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-DRhauZbp.js → CheckCircle-BLc2ASgN.js} +1 -1
  6. package/dist/client/assets/{CheckDone01-I6GfoGdi.js → CheckDone01-C2olQLcp.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DmXLJeAy.js → ChevronDown-DGc_B_pI.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-By4KEpZh.js → ChevronRight-BTZr-xye.js} +1 -1
  9. package/dist/client/assets/{Code01-h_k8K-1e.js → Code01-BgIlNb0q.js} +1 -1
  10. package/dist/client/assets/{Copy01-jvqvZrKj.js → Copy01-VJRVowHJ.js} +1 -1
  11. package/dist/client/assets/{DotsHorizontal-CQJNqVgu.js → DotsHorizontal-J1HamufO.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-gLXmVMYI.js → DotsVertical-XxVvTjZe.js} +1 -1
  13. package/dist/client/assets/{Download01-BKmVPJWY.js → Download01-B76QpppS.js} +1 -1
  14. package/dist/client/assets/{Edit01-BT8zEtQL.js → Edit01-B5aM7o8H.js} +1 -1
  15. package/dist/client/assets/{File02-BNE7fmK0.js → File02-nG54lqZh.js} +1 -1
  16. package/dist/client/assets/{File06-WU23pV9H.js → File06-BTrZX4-T.js} +1 -1
  17. package/dist/client/assets/{FilterLines-DJEB3mgx.js → FilterLines-GHETfQYS.js} +1 -1
  18. package/dist/client/assets/{Globe02-Dp5eUbS2.js → Globe02-Dk07oP0z.js} +1 -1
  19. package/dist/client/assets/{Grid01-CSAsqBFD.js → Grid01-RAa135S1.js} +1 -1
  20. package/dist/client/assets/{Home02-BUr926Eo.js → Home02-QIpDHMcj.js} +1 -1
  21. package/dist/client/assets/{Image01-BnbXZOf7.js → Image01-B2o6vVhA.js} +1 -1
  22. package/dist/client/assets/{Inbox01-XFeiQPbg.js → Inbox01-VryQyU0X.js} +1 -1
  23. package/dist/client/assets/{InfoCircle-5xWfOa8P.js → InfoCircle-DNjRzSWE.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-BJLPX8tt.js → LinkExternal01-CDCzG7Bd.js} +1 -1
  25. package/dist/client/assets/{List-kXpaJIIp.js → List-DS9PzQZf.js} +1 -1
  26. package/dist/client/assets/{Loading01-D8zw0cyg.js → Loading01-B_72CFT3.js} +1 -1
  27. package/dist/client/assets/{Lock01-DCDiY4HG.js → Lock01-D4kTXh33.js} +1 -1
  28. package/dist/client/assets/{Pin01-DWsvacVo.js → Pin01-BnjsacaS.js} +1 -1
  29. package/dist/client/assets/{Play-Yhg_pcqU.js → Play-vW8bpCNs.js} +1 -1
  30. package/dist/client/assets/{Plus-BBD2SckJ.js → Plus-_EIrkETO.js} +1 -1
  31. package/dist/client/assets/{SearchMd-CGuwiAQe.js → SearchMd-DglsF9__.js} +1 -1
  32. package/dist/client/assets/{Settings01-D7-sGWon.js → Settings01-CFqjPjGn.js} +1 -1
  33. package/dist/client/assets/{Share07-C8iek9k4.js → Share07-O85vTLMC.js} +1 -1
  34. package/dist/client/assets/{Terminal-CyioLjuI.js → Terminal-Cy7QpUCs.js} +1 -1
  35. package/dist/client/assets/{Tool01-DF-lT9RC.js → Tool01-DkjdoaMq.js} +1 -1
  36. package/dist/client/assets/{Trash01-CLqhrRia.js → Trash01-CKqlebDm.js} +1 -1
  37. package/dist/client/assets/{Upload01-DrtXkSgF.js → Upload01-DYCMxAjY.js} +1 -1
  38. package/dist/client/assets/{Users03-oV4Gx6fu.js → Users03-CLwVIYNp.js} +1 -1
  39. package/dist/client/assets/{X-CuhyLwhM.js → X-CSVVvPO3.js} +1 -1
  40. package/dist/client/assets/{XClose-BFt2trBc.js → XClose-BOh776sq.js} +1 -1
  41. package/dist/client/assets/{agent-connections-preview-D4bn0NTx.js → agent-connections-preview-DSNJFr0O.js} +1 -1
  42. package/dist/client/assets/{agent-detail-D8YR1Y7H.js → agent-detail-CRgviLOX.js} +1 -1
  43. package/dist/client/assets/{agents-BMyluA59.js → agents-CZ4ZklqY.js} +1 -1
  44. package/dist/client/assets/{alert-dialog-BxcV0D_1.js → alert-dialog-CMFFNJg5.js} +1 -1
  45. package/dist/client/assets/{auth-catchall-DLJkIPQ0.js → auth-catchall-Y9hKDakc.js} +1 -1
  46. package/dist/client/assets/{avatar-D3z5_V3I.js → avatar-C0cccS60.js} +1 -1
  47. package/dist/client/assets/{badge-BklHLRcK.js → badge-67pGhcsZ.js} +1 -1
  48. package/dist/client/assets/{binder-ak1AkjZY.js → binder-BQNmKBxJ.js} +1 -1
  49. package/dist/client/assets/{breadcrumb-B_Yxwj4p.js → breadcrumb-C5T3dJE6.js} +1 -1
  50. package/dist/client/assets/{button-CcO5M7F7.js → button-AB9cXWBb.js} +1 -1
  51. package/dist/client/assets/{card-BNt4WjQv.js → card-DatbcemW.js} +1 -1
  52. package/dist/client/assets/{checkbox-CirsSPdM.js → checkbox-lsjWL6i2.js} +1 -1
  53. package/dist/client/assets/{circle-alert-BcHtOytY.js → circle-alert-BctrA2dR.js} +1 -1
  54. package/dist/client/assets/{collection-detail-iX-6m_0X.js → collection-detail-HRUP2PWH.js} +3 -3
  55. package/dist/client/assets/{collection-search-Cyt8_oQV.js → collection-search-CNaPV8pR.js} +1 -1
  56. package/dist/client/assets/{collection-tab-Cbay3Q2-.js → collection-tab-DV_TP_WM.js} +1 -1
  57. package/dist/client/assets/{collection-table-wrapper-CFNweZN1.js → collection-table-wrapper-DSM2ewq2.js} +1 -1
  58. package/dist/client/assets/{collection-tabs-Dh2bhvAY.js → collection-tabs-CnXL2suk.js} +1 -1
  59. package/dist/client/assets/{command-8Q_FGz0v.js → command-DDT6AGtU.js} +1 -1
  60. package/dist/client/assets/{connect-1mhMrmD4.js → connect-Cvc6-UMK.js} +1 -1
  61. package/dist/client/assets/{connection-card-BGd7kcn-.js → connection-card-BoD60JtX.js} +1 -1
  62. package/dist/client/assets/{connection-detail-dEdcHJ4u.js → connection-detail-CGxZSMNC.js} +1 -1
  63. package/dist/client/assets/{connections-DmGFiu1f.js → connections-CkMfBeE_.js} +1 -1
  64. package/dist/client/assets/constants-DBa8dlFt.js +1 -0
  65. package/dist/client/assets/{constants-DuSOM18S.js → constants-Dd61XPju.js} +1 -1
  66. package/dist/client/assets/{create-organization-dialog-j_P7xuhv.js → create-organization-dialog-lVschU-T.js} +1 -1
  67. package/dist/client/assets/{create-project-dialog-C-mSn_Ux.js → create-project-dialog-oeLTBCgQ.js} +1 -1
  68. package/dist/client/assets/{dialog-B_iTVR3h.js → dialog-V-G7cm4S.js} +1 -1
  69. package/dist/client/assets/{dropdown-menu-BTPpCOPE.js → dropdown-menu-Cr68JTqs.js} +1 -1
  70. package/dist/client/assets/dynamic-plugin-layout-BDN43EV9.js +1 -0
  71. package/dist/client/assets/{empty-state-Ct1fZFlf.js → empty-state-DTsFurx5.js} +1 -1
  72. package/dist/client/assets/{empty-state--JD6ZxUc.js → empty-state-DXDgk150.js} +1 -1
  73. package/dist/client/assets/{env-vars-editor-B4EebJEK.js → env-vars-editor-CJIkUQFq.js} +1 -1
  74. package/dist/client/assets/{error-boundary-DlgelpJG.js → error-boundary-CyPUBnGI.js} +1 -1
  75. package/dist/client/assets/{extract-connection-data-BM37afPK.js → extract-connection-data-Cr8RzppI.js} +1 -1
  76. package/dist/client/assets/file-browser-BMnqO_1p.js +2 -0
  77. package/dist/client/assets/{form-CSsv2IBt.js → form-Dk1BQhBM.js} +1 -1
  78. package/dist/client/assets/grid-view-DowLXjS7.js +1 -0
  79. package/dist/client/assets/{home-D16zlSya.js → home-B0Y3Di4D.js} +1 -1
  80. package/dist/client/assets/{index--g69ISoA.css → index-BEdPWc-P.css} +1 -1
  81. package/dist/client/assets/{index-Bo7hWTur.js → index-CLOGlhow.js} +1 -1
  82. package/dist/client/assets/{index-DZ7G-bvr.js → index-CMGKEOx9.js} +1 -1
  83. package/dist/client/assets/{index-CZtqakWK.js → index-COO_eJWG.js} +1 -1
  84. package/dist/client/assets/{index-DJCm-wAr.js → index-CPvkxTJI.js} +1 -1
  85. package/dist/client/assets/{index-a2nqbblp.js → index-CffYvbOk.js} +1 -1
  86. package/dist/client/assets/{index-CHcJPAjT.js → index-D8Damm96.js} +1 -1
  87. package/dist/client/assets/{index-BHu7Lc_d.js → index-DcpUI1e8.js} +1 -1
  88. package/dist/client/assets/{index-Bn2rDd42.js → index-KcN9jfkO.js} +29 -29
  89. package/dist/client/assets/{index-fr6MaGoE.js → index-XIgm4U89.js} +1 -1
  90. package/dist/client/assets/{infiniteQueryObserver-VnhrjjoH.js → infiniteQueryObserver-BPw7at1z.js} +1 -1
  91. package/dist/client/assets/{input-DBvMwxwE.js → input-DpQoaQfS.js} +1 -1
  92. package/dist/client/assets/{integration-icon-C8seGsuO.js → integration-icon-DzX6vjWU.js} +1 -1
  93. package/dist/client/assets/{label-BjQxQJkg.js → label-B4u_PB72.js} +1 -1
  94. package/dist/client/assets/{layout-ZTsfxACA.js → layout-1uXnWnKk.js} +1 -1
  95. package/dist/client/assets/{localstorage-keys-BhunmwZg.js → localstorage-keys-BM3WWg3m.js} +1 -1
  96. package/dist/client/assets/{login-H0BwFxqL.js → login-B56MGOs9.js} +1 -1
  97. package/dist/client/assets/{mcp-oauth-ZUujauBG.js → mcp-oauth-CKAjCVZP.js} +1 -1
  98. package/dist/client/assets/{mcp-server-card-KgRAONYw.js → mcp-server-card-DoPF_WVv.js} +1 -1
  99. package/dist/client/assets/{mcp-server-detail-Ce9SGjoZ.js → mcp-server-detail-CkS0PbuH.js} +2 -2
  100. package/dist/client/assets/{members-C925BdC6.js → members-BB1doSO5.js} +1 -1
  101. package/dist/client/assets/{monaco-editor-D7Ghoc8y.js → monaco-editor-DEHFPbnX.js} +1 -1
  102. package/dist/client/assets/{monitoring-DI8QAuDx.js → monitoring-DOjL9t3e.js} +1 -1
  103. package/dist/client/assets/{oauth-callback-DqKFxIqr.js → oauth-callback-BBcJg1UX.js} +1 -1
  104. package/dist/client/assets/{page-DCfXF14g.js → page-B3KFw8CR.js} +1 -1
  105. package/dist/client/assets/{page-B2cjdb1f.js → page-C7jIzvcm.js} +1 -1
  106. package/dist/client/assets/{plugin-empty-state-BYB8Yhjv.js → plugin-empty-state-NBfVVy0l.js} +1 -1
  107. package/dist/client/assets/{plugin-header-CLRCQ1W3.js → plugin-header-BXDOmgaW.js} +1 -1
  108. package/dist/client/assets/{popover-BkKSdvGf.js → popover-BuD0r9BV.js} +1 -1
  109. package/dist/client/assets/{project-layout-DzX_Lv0I.js → project-layout-Cnrq-SYE.js} +1 -1
  110. package/dist/client/assets/{project-settings-lapjGGi3.js → project-settings-QWIujTPO.js} +1 -1
  111. package/dist/client/assets/{projects-list-DZgOrcLS.js → projects-list-D8sP5qSm.js} +1 -1
  112. package/dist/client/assets/{registry-utils-BsLp7zXK.js → registry-utils-DBaLa5Rh.js} +1 -1
  113. package/dist/client/assets/{resizable-CdUSPFqv.js → resizable-CgvrBBsS.js} +1 -1
  114. package/dist/client/assets/{select-J2aavKNi.js → select-Bc3qnIp8.js} +1 -1
  115. package/dist/client/assets/shell-layout-BNnUTIs6.js +12 -0
  116. package/dist/client/assets/{spinner-Bn-tqgsf.js → spinner-rSR6baPa.js} +1 -1
  117. package/dist/client/assets/{store-invite-C8stGp_k.js → store-invite-pQr9-dk3.js} +1 -1
  118. package/dist/client/assets/{switch-CG0LWjwI.js → switch-DdokomeM.js} +1 -1
  119. package/dist/client/assets/{table-BNxQWMxG.js → table-a_0ITwUC.js} +1 -1
  120. package/dist/client/assets/{tasks-C_RAoHGr.js → tasks-CTttayn-.js} +1 -1
  121. package/dist/client/assets/{textarea-CKlKOzV4.js → textarea-DYwKTx03.js} +1 -1
  122. package/dist/client/assets/{tools-list-D0G5KWHg.js → tools-list-C7hTP47S.js} +1 -1
  123. package/dist/client/assets/topbar-portal-_MNJb0ke.js +1 -0
  124. package/dist/client/assets/{typewriter-title-BqfnndCW.js → typewriter-title-BZ5Kpwdd.js} +1 -1
  125. package/dist/client/assets/{use-binding-Dgjl_Htk.js → use-binding-Dm7Ehllr.js} +1 -1
  126. package/dist/client/assets/{use-connection-CVk8Bzpz.js → use-connection-0mxTykry.js} +1 -1
  127. package/dist/client/assets/{use-create-virtual-mcp-BpXLuk-p.js → use-create-virtual-mcp-DokNG_Sw.js} +1 -1
  128. package/dist/client/assets/{use-deco-chat-open-CfZI9mqc.js → use-deco-chat-open-ChpE6vuj.js} +5 -5
  129. package/dist/client/assets/{use-install-from-registry-5UUqPBO7.js → use-install-from-registry-1t9k1vMV.js} +1 -1
  130. package/dist/client/assets/{use-list-state-D_1V56-b.js → use-list-state-iF5wqfMX.js} +1 -1
  131. package/dist/client/assets/{use-llm-Ca3pgrIB.js → use-llm-cYoJ456l.js} +1 -1
  132. package/dist/client/assets/{use-mcp-prompts-Cn7tm6ug.js → use-mcp-prompts-DZbjmEdn.js} +1 -1
  133. package/dist/client/assets/{use-mcp-tools-Ddi2i1Nb.js → use-mcp-tools-BQRPyYnS.js} +1 -1
  134. package/dist/client/assets/{use-mobile-p03CcGW0.js → use-mobile-B5hu4mxq.js} +1 -1
  135. package/dist/client/assets/{use-organization-settings-DHZKDAPt.js → use-organization-settings-8Md9ygEM.js} +1 -1
  136. package/dist/client/assets/{use-project-D-mK4K9b.js → use-project-Dun345CA.js} +1 -1
  137. package/dist/client/assets/{use-virtual-mcp-C83o4Rih.js → use-virtual-mcp-DSRU0zGP.js} +1 -1
  138. package/dist/client/assets/useInfiniteQuery-D6oUaKP2.js +1 -0
  139. package/dist/client/assets/{useMutation-CnTeRHmv.js → useMutation-ClyYx3N6.js} +1 -1
  140. package/dist/client/assets/useQuery-DUPTaiAP.js +1 -0
  141. package/dist/client/assets/utils-Ck2p4uOz.js +1 -0
  142. package/dist/client/assets/{view-mode-toggle-CJkT6m07.js → view-mode-toggle-x6y4jYTo.js} +1 -1
  143. package/dist/client/assets/{workflow-2rDY9uo2.js → workflow-Da57Slbz.js} +1 -1
  144. package/dist/client/index.html +2 -2
  145. package/package.json +1 -1
  146. package/dist/client/assets/constants-QC26G_cT.js +0 -1
  147. package/dist/client/assets/dynamic-plugin-layout-BsqDni3U.js +0 -1
  148. package/dist/client/assets/file-browser-DQeqPq9E.js +0 -2
  149. package/dist/client/assets/grid-view-DBKftgaD.js +0 -1
  150. package/dist/client/assets/shell-layout-DOBmQ9ah.js +0 -12
  151. package/dist/client/assets/useInfiniteQuery-DDUEUpOZ.js +0 -1
  152. package/dist/client/assets/useQuery-Ct96KcZp.js +0 -1
  153. package/dist/client/assets/utils-Ckc2UwOp.js +0 -1
@@ -1 +1 @@
1
- import{c as de,j as e,r as R,u as Ce,m as be,f as ke,g as Ne,ai as we,k as Se,h as De,i as Pe,O as h,o as me,aj as Te,s as v,ak as Ie}from"./index-Bn2rDd42.js";import{g as $e}from"./generate-id-Dyweu44Y.js";import{C as Ve,a as Ae}from"./collection-table-wrapper-CFNweZN1.js";import{C as Ee}from"./collection-search-Cyt8_oQV.js";import{C as Me}from"./connection-card-BGd7kcn-.js";import{B as F}from"./badge-BklHLRcK.js";import{i as Oe}from"./AlertCircle-C_hR5usO.js";import{i as Be}from"./CheckCircle-DRhauZbp.js";import{E as H}from"./empty-state--JD6ZxUc.js";import{E as Fe}from"./error-boundary-DlgelpJG.js";import{n as z,I as He}from"./integration-icon-C8seGsuO.js";import{P as I}from"./index-BHu7Lc_d.js";import{u as ze,U as ee,s as te}from"./use-list-state-D_1V56-b.js";import{u as Ue}from"./use-binding-Dgjl_Htk.js";import{f as Re,e as Le}from"./registry-utils-BsLp7zXK.js";import{f as Xe,a as We,b as Ke,c as Ge,d as qe,e as Ye,A as Je,g as Qe}from"./alert-dialog-BxcV0D_1.js";import{B as Ze,a as et,b as tt,c as nt}from"./breadcrumb-B_Yxwj4p.js";import{B as C}from"./button-CcO5M7F7.js";import{D as st,a as ot,b as rt,c as it,d as at,e as ct}from"./dialog-B_iTVR3h.js";import{D as ne,a as se,b as oe,c as E}from"./dropdown-menu-BTPpCOPE.js";import{a as lt,F as x,b as g,c as j,d as f,f as y}from"./form-CSsv2IBt.js";import{I as k}from"./input-DBvMwxwE.js";import{S as dt,a as mt,b as ut,c as pt,d as $}from"./select-J2aavKNi.js";import{T as ht}from"./textarea-CKlKOzV4.js";import{g as xt,h as gt}from"./use-connection-CVk8Bzpz.js";import{u as jt}from"./constants-DuSOM18S.js";import{b as ft}from"./use-mcp-tools-Ddi2i1Nb.js";import{i as re}from"./DotsVertical-gLXmVMYI.js";import{s as U}from"./Globe02-Dp5eUbS2.js";import{i as yt}from"./Loading01-D8zw0cyg.js";import{i as vt}from"./Terminal-CyioLjuI.js";import{s as ie}from"./Trash01-CLqhrRia.js";import{r as _t,E as Ct,e as ue}from"./env-vars-editor-B4EebJEK.js";import{d as bt}from"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowUp-DnJUZ1OS.js";import"./Check-Sa4xK5Hg.js";import"./Grid01-CSAsqBFD.js";import"./List-kXpaJIIp.js";import"./view-mode-toggle-CJkT6m07.js";import"./utils-Ckc2UwOp.js";import"./table-BNxQWMxG.js";import"./SearchMd-CGuwiAQe.js";import"./card-BNt4WjQv.js";import"./index-DZ7G-bvr.js";import"./avatar-D3z5_V3I.js";import"./useQuery-Ct96KcZp.js";import"./use-mobile-p03CcGW0.js";import"./binder-ak1AkjZY.js";import"./ChevronRight-By4KEpZh.js";import"./X-CuhyLwhM.js";import"./label-BjQxQJkg.js";import"./ChevronDown-DmXLJeAy.js";import"./useMutation-CnTeRHmv.js";import"./Plus-BBD2SckJ.js";function ae(s){const n=de.c(3),{status:i}=s;if(i==="active"){let c;return n[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(Be,{size:12}),"Active"]}),n[0]=c):c=n[0],c}if(i==="error"){let c;return n[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Oe,{size:12}),"Error"]}),n[1]=c):c=n[1],c}let d;return n[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(F,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),n[2]=d):d=n[2],d}function ce(s){const n=bt(new Date,s);return n<60?"<1m":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:n<2592e3?`${Math.floor(n/604800)}w ago`:n<31536e3?`${Math.floor(n/2592e3)}mo ago`:`${Math.floor(n/31536e3)}y ago`}const kt=me({key:v(),value:v()}),Nt=me({title:v().min(1,"Name is required"),description:v().nullable().optional(),ui_type:Ie(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:v().optional(),connection_token:v().nullable().optional(),npx_package:v().optional(),stdio_command:v().optional(),stdio_args:v().optional(),stdio_cwd:v().optional(),env_vars:Te(kt).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function O(s){const n=s.trim();if(!n)return"";try{const i=new URL(n),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return n.replace(/\/+$/,"")}}function wt(s){const n=s.trim().split(/\s+/).filter(Boolean);if(n.length<2)return null;const i=n[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=n.slice(1).find(a=>!a.startsWith("-"));return c?{packageName:c}:null}function M(s){const{uiType:n}=s,i=O(s.connectionUrl??"");if((n==="HTTP"||n==="SSE"||n==="Websocket")&&i===O("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return n==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function le(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const n=O(s.connectionUrl??"");if(!n)return null;const i=s.registryItems.find(a=>(a.server?.remotes??[]).some(N=>O(N.url??"")===n));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function St(s,n){const i={command:"npx",args:["-y",s]},d=ue(n);return Object.keys(d).length>0&&(i.envVars=d),i}function Dt(s,n,i,d){const c={command:s};n.trim()&&(c.args=n.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const a=ue(d);return Object.keys(a).length>0&&(c.envVars=a),c}function Pt(s){return s.command==="npx"}function Tt(s){return s.args?.find(n=>!n.startsWith("-"))??""}function It(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function $t(s,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 Vt(){const{org:s}=Ce(),n=be(),i=ke({strict:!1}),{data:d}=Ne.useSession(),{stdioEnabled:c}=we(),a=ze({namespace:s.slug,resource:"connections"}),V=xt(),N=gt(a),[_,w]=R.useReducer($t,{mode:"idle"}),L=Ue(N)[0],X=L?.id??"",W=Re(L?.tools),pe=jt({connectionId:X||null,orgId:s.id}),{data:he}=ft({client:pe,toolName:W,toolArguments:{limit:200},enabled:!!(X&&W),staleTime:3600*1e3,select:t=>t.structuredContent??t}),K=Le(he??[]),G=i.action==="create",xe=()=>{n({to:"/$org/$project/mcps",params:{org:s.slug,project:h},search:{action:"create"}})},q=()=>{n({to:"/$org/$project/mcps",params:{org:s.slug,project:h},search:{}})},r=Se({resolver:De(Nt),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),Y=r.watch("connection_url"),ge=r.watch("npx_package"),P=M({uiType:u,connectionUrl:Y??"",npxPackage:ge??""})??le({uiType:u,connectionUrl:Y??"",registryItems:K}),m=_.mode==="editing"?_.connection:null;R.useEffect(()=>{if(m){const t=Pe(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const o=_t(t.envVars);if(Pt(t)){const l=Tt(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const l=It(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:l.command,stdio_args:l.args,stdio_cwd:l.cwd,env_vars:o})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const je=async()=>{if(_.mode!=="deleting")return;const t=_.connection.id;w({type:"close"});try{await V.delete.mutateAsync(t)}catch{}},fe=async t=>{let o,l=null,S=null,b=null;if(t.ui_type==="NPX"?(o="STDIO",l="",b=St(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",l="",b=Dt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,l=t.connection_url||"",S=t.connection_token||null),m){await V.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:l,...S&&{connection_token:S},...b&&{connection_headers:b}}}),w({type:"close"}),r.reset();return}const D=$e("conn");await V.create.mutateAsync({id:D,title:t.title,description:t.description||null,connection_type:o,connection_url:l,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:b,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),q(),r.reset(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:D}})},J=t=>{t||(G?q():w({type:"close"}),r.reset())},A=t=>{const o=t.trim();if(!o)return;const l=!!r.formState.dirtyFields.title,S=!!r.formState.dirtyFields.description,b=!!r.formState.dirtyFields.env_vars,D=p=>{if(p&&(!l&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!S&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!b&&p.envVarKeys?.length)){const Q=r.getValues("env_vars")??[],_e=new Set(Q.map(T=>T.key)),Z=p.envVarKeys.filter(T=>!_e.has(T));Z.length>0&&r.setValue("env_vars",[...Q,...Z.map(T=>({key:T,value:""}))],{shouldDirty:!0})}},B=wt(o);if(B&&c){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",B.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),D(M({uiType:"NPX",npxPackage:B.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),D(M({uiType:p,connectionUrl:o})??le({uiType:p,connectionUrl:o,registryItems:K}));return}u==="NPX"&&D(M({uiType:"NPX",npxPackage:o}))},ye=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(He,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(ae,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(ee,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ce(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(re,{size:20})})}),e.jsxs(oe,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}})},children:[e.jsx(te,{size:16}),"Open"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],ve=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(C,{onClick:xe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(I,{children:[e.jsx(st,{open:G||_.mode==="editing",onOpenChange:J,children:e.jsxs(ot,{className:"sm:max-w-[525px]",children:[e.jsxs(rt,{children:[e.jsx(it,{children:m?"Edit Connection":"Create Connection"}),e.jsx(at,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(lt,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(fe),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(x,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Type *"}),e.jsxs(dt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(f,{children:e.jsx(mt,{children:e.jsx(ut,{})})}),e.jsxs(pt,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Websocket"]})}),c&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(vt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(y,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(x,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"NPM Package *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("npx_package",l.trim(),{shouldDirty:!0}),A(l))},onBlur:o=>{A(o.target.value),t.onBlur()}})}),e.jsx(y,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(x,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Command *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Arguments"}),e.jsx(f,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(y,{})]})})]}),e.jsx(x,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Working Directory"}),e.jsx(f,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(y,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(x,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Environment Variables"}),e.jsx(f,{children:e.jsx(Ct,{value:t.value??[],onChange:t.onChange})}),e.jsx(y,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(x,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"URL *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("connection_url",l.trim(),{shouldDirty:!0}),A(l))},onBlur:o=>{A(o.target.value),t.onBlur()}})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:P?.token?.label??"Token (optional)"}),e.jsx(f,{children:e.jsx(k,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(y,{})]})})]}),e.jsx(x,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Name *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Description"}),e.jsx(f,{children:e.jsx(ht,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(y,{})]})})]}),e.jsxs(ct,{children:[e.jsx(C,{type:"button",variant:"outline",onClick:()=>J(!1),children:"Cancel"}),e.jsx(C,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Xe,{open:_.mode==="deleting",onOpenChange:t=>!t&&w({type:"close"}),children:e.jsxs(We,{children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:"Delete Connection?"}),e.jsxs(qe,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:_.mode==="deleting"&&_.connection.title}),"."]})]}),e.jsxs(Ye,{children:[e.jsx(Je,{children:"Cancel"}),e.jsx(Qe,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(I.Header,{children:[e.jsx(I.Header.Left,{children:e.jsx(Ze,{children:e.jsx(et,{children:e.jsx(tt,{children:e.jsx(nt,{children:"Connections"})})})})}),e.jsxs(I.Header.Right,{children:[e.jsx(Ve,{viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),ve]})]}),e.jsx(Ee,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(I.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(Me,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}}),headerActions:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(re,{size:20})})}),e.jsxs(oe,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}})},children:[e.jsx(te,{size:16}),"Open"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(ie,{size:16}),"Delete"]})]})]}),body:e.jsx(ae,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ee,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?ce(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Ae,{columns:ye,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}}),emptyState:a.search?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),children:"Browse Store"})})})})})})})]})}function En(){const s=de.c(1);let n;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx(Fe,{children:e.jsx(R.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(yt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Vt,{})})}),s[0]=n):n=s[0],n}export{En as default};
1
+ import{c as de,j as e,r as R,u as Ce,m as be,f as ke,g as Ne,ai as we,k as Se,h as De,i as Pe,O as h,o as me,aj as Te,s as v,ak as Ie}from"./index-KcN9jfkO.js";import{g as $e}from"./generate-id-Dyweu44Y.js";import{C as Ve,a as Ae}from"./collection-table-wrapper-DSM2ewq2.js";import{C as Ee}from"./collection-search-CNaPV8pR.js";import{C as Me}from"./connection-card-BoD60JtX.js";import{B as F}from"./badge-67pGhcsZ.js";import{i as Oe}from"./AlertCircle-BtLmHyy8.js";import{i as Be}from"./CheckCircle-BLc2ASgN.js";import{E as H}from"./empty-state-DXDgk150.js";import{E as Fe}from"./error-boundary-CyPUBnGI.js";import{n as z,I as He}from"./integration-icon-DzX6vjWU.js";import{P as I}from"./index-DcpUI1e8.js";import{u as ze,U as ee,s as te}from"./use-list-state-iF5wqfMX.js";import{u as Ue}from"./use-binding-Dm7Ehllr.js";import{f as Re,e as Le}from"./registry-utils-DBaLa5Rh.js";import{f as Xe,a as We,b as Ke,c as Ge,d as qe,e as Ye,A as Je,g as Qe}from"./alert-dialog-CMFFNJg5.js";import{B as Ze,a as et,b as tt,c as nt}from"./breadcrumb-C5T3dJE6.js";import{B as C}from"./button-AB9cXWBb.js";import{D as st,a as ot,b as rt,c as it,d as at,e as ct}from"./dialog-V-G7cm4S.js";import{D as ne,a as se,b as oe,c as E}from"./dropdown-menu-Cr68JTqs.js";import{a as lt,F as x,b as g,c as j,d as f,f as y}from"./form-Dk1BQhBM.js";import{I as k}from"./input-DpQoaQfS.js";import{S as dt,a as mt,b as ut,c as pt,d as $}from"./select-Bc3qnIp8.js";import{T as ht}from"./textarea-DYwKTx03.js";import{g as xt,h as gt}from"./use-connection-0mxTykry.js";import{u as jt}from"./constants-Dd61XPju.js";import{b as ft}from"./use-mcp-tools-BQRPyYnS.js";import{i as re}from"./DotsVertical-XxVvTjZe.js";import{s as U}from"./Globe02-Dk07oP0z.js";import{i as yt}from"./Loading01-B_72CFT3.js";import{i as vt}from"./Terminal-Cy7QpUCs.js";import{s as ie}from"./Trash01-CKqlebDm.js";import{r as _t,E as Ct,e as ue}from"./env-vars-editor-CJIkUQFq.js";import{d as bt}from"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowUp-CS3ZollZ.js";import"./Check-D3ubYXxc.js";import"./Grid01-RAa135S1.js";import"./List-DS9PzQZf.js";import"./view-mode-toggle-x6y4jYTo.js";import"./utils-Ck2p4uOz.js";import"./table-a_0ITwUC.js";import"./SearchMd-DglsF9__.js";import"./card-DatbcemW.js";import"./index-CMGKEOx9.js";import"./avatar-C0cccS60.js";import"./useQuery-DUPTaiAP.js";import"./use-mobile-B5hu4mxq.js";import"./binder-BQNmKBxJ.js";import"./ChevronRight-BTZr-xye.js";import"./X-CSVVvPO3.js";import"./label-B4u_PB72.js";import"./ChevronDown-DGc_B_pI.js";import"./useMutation-ClyYx3N6.js";import"./Plus-_EIrkETO.js";function ae(s){const n=de.c(3),{status:i}=s;if(i==="active"){let c;return n[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(Be,{size:12}),"Active"]}),n[0]=c):c=n[0],c}if(i==="error"){let c;return n[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Oe,{size:12}),"Error"]}),n[1]=c):c=n[1],c}let d;return n[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(F,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),n[2]=d):d=n[2],d}function ce(s){const n=bt(new Date,s);return n<60?"<1m":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:n<2592e3?`${Math.floor(n/604800)}w ago`:n<31536e3?`${Math.floor(n/2592e3)}mo ago`:`${Math.floor(n/31536e3)}y ago`}const kt=me({key:v(),value:v()}),Nt=me({title:v().min(1,"Name is required"),description:v().nullable().optional(),ui_type:Ie(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:v().optional(),connection_token:v().nullable().optional(),npx_package:v().optional(),stdio_command:v().optional(),stdio_args:v().optional(),stdio_cwd:v().optional(),env_vars:Te(kt).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function O(s){const n=s.trim();if(!n)return"";try{const i=new URL(n),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return n.replace(/\/+$/,"")}}function wt(s){const n=s.trim().split(/\s+/).filter(Boolean);if(n.length<2)return null;const i=n[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=n.slice(1).find(a=>!a.startsWith("-"));return c?{packageName:c}:null}function M(s){const{uiType:n}=s,i=O(s.connectionUrl??"");if((n==="HTTP"||n==="SSE"||n==="Websocket")&&i===O("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return n==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function le(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const n=O(s.connectionUrl??"");if(!n)return null;const i=s.registryItems.find(a=>(a.server?.remotes??[]).some(N=>O(N.url??"")===n));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function St(s,n){const i={command:"npx",args:["-y",s]},d=ue(n);return Object.keys(d).length>0&&(i.envVars=d),i}function Dt(s,n,i,d){const c={command:s};n.trim()&&(c.args=n.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const a=ue(d);return Object.keys(a).length>0&&(c.envVars=a),c}function Pt(s){return s.command==="npx"}function Tt(s){return s.args?.find(n=>!n.startsWith("-"))??""}function It(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function $t(s,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 Vt(){const{org:s}=Ce(),n=be(),i=ke({strict:!1}),{data:d}=Ne.useSession(),{stdioEnabled:c}=we(),a=ze({namespace:s.slug,resource:"connections"}),V=xt(),N=gt(a),[_,w]=R.useReducer($t,{mode:"idle"}),L=Ue(N)[0],X=L?.id??"",W=Re(L?.tools),pe=jt({connectionId:X||null,orgId:s.id}),{data:he}=ft({client:pe,toolName:W,toolArguments:{limit:200},enabled:!!(X&&W),staleTime:3600*1e3,select:t=>t.structuredContent??t}),K=Le(he??[]),G=i.action==="create",xe=()=>{n({to:"/$org/$project/mcps",params:{org:s.slug,project:h},search:{action:"create"}})},q=()=>{n({to:"/$org/$project/mcps",params:{org:s.slug,project:h},search:{}})},r=Se({resolver:De(Nt),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),Y=r.watch("connection_url"),ge=r.watch("npx_package"),P=M({uiType:u,connectionUrl:Y??"",npxPackage:ge??""})??le({uiType:u,connectionUrl:Y??"",registryItems:K}),m=_.mode==="editing"?_.connection:null;R.useEffect(()=>{if(m){const t=Pe(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const o=_t(t.envVars);if(Pt(t)){const l=Tt(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const l=It(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:l.command,stdio_args:l.args,stdio_cwd:l.cwd,env_vars:o})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const je=async()=>{if(_.mode!=="deleting")return;const t=_.connection.id;w({type:"close"});try{await V.delete.mutateAsync(t)}catch{}},fe=async t=>{let o,l=null,S=null,b=null;if(t.ui_type==="NPX"?(o="STDIO",l="",b=St(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",l="",b=Dt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,l=t.connection_url||"",S=t.connection_token||null),m){await V.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:l,...S&&{connection_token:S},...b&&{connection_headers:b}}}),w({type:"close"}),r.reset();return}const D=$e("conn");await V.create.mutateAsync({id:D,title:t.title,description:t.description||null,connection_type:o,connection_url:l,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:b,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),q(),r.reset(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:D}})},J=t=>{t||(G?q():w({type:"close"}),r.reset())},A=t=>{const o=t.trim();if(!o)return;const l=!!r.formState.dirtyFields.title,S=!!r.formState.dirtyFields.description,b=!!r.formState.dirtyFields.env_vars,D=p=>{if(p&&(!l&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!S&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!b&&p.envVarKeys?.length)){const Q=r.getValues("env_vars")??[],_e=new Set(Q.map(T=>T.key)),Z=p.envVarKeys.filter(T=>!_e.has(T));Z.length>0&&r.setValue("env_vars",[...Q,...Z.map(T=>({key:T,value:""}))],{shouldDirty:!0})}},B=wt(o);if(B&&c){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",B.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),D(M({uiType:"NPX",npxPackage:B.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),D(M({uiType:p,connectionUrl:o})??le({uiType:p,connectionUrl:o,registryItems:K}));return}u==="NPX"&&D(M({uiType:"NPX",npxPackage:o}))},ye=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(He,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(z,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(ae,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(ee,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ce(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(re,{size:20})})}),e.jsxs(oe,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}})},children:[e.jsx(te,{size:16}),"Open"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],ve=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(C,{onClick:xe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(I,{children:[e.jsx(st,{open:G||_.mode==="editing",onOpenChange:J,children:e.jsxs(ot,{className:"sm:max-w-[525px]",children:[e.jsxs(rt,{children:[e.jsx(it,{children:m?"Edit Connection":"Create Connection"}),e.jsx(at,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(lt,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(fe),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(x,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Type *"}),e.jsxs(dt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(f,{children:e.jsx(mt,{children:e.jsx(ut,{})})}),e.jsxs(pt,{children:[e.jsx($,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx($,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"SSE"]})}),e.jsx($,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4"}),"Websocket"]})}),c&&e.jsxs(e.Fragment,{children:[e.jsx($,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx($,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(vt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(y,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(x,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"NPM Package *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("npx_package",l.trim(),{shouldDirty:!0}),A(l))},onBlur:o=>{A(o.target.value),t.onBlur()}})}),e.jsx(y,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(x,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Command *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Arguments"}),e.jsx(f,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(y,{})]})})]}),e.jsx(x,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Working Directory"}),e.jsx(f,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(y,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(x,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Environment Variables"}),e.jsx(f,{children:e.jsx(Ct,{value:t.value??[],onChange:t.onChange})}),e.jsx(y,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(x,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"URL *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("connection_url",l.trim(),{shouldDirty:!0}),A(l))},onBlur:o=>{A(o.target.value),t.onBlur()}})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:P?.token?.label??"Token (optional)"}),e.jsx(f,{children:e.jsx(k,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),P?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(y,{})]})})]}),e.jsx(x,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Name *"}),e.jsx(f,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(y,{})]})}),e.jsx(x,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(j,{children:"Description"}),e.jsx(f,{children:e.jsx(ht,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(y,{})]})})]}),e.jsxs(ct,{children:[e.jsx(C,{type:"button",variant:"outline",onClick:()=>J(!1),children:"Cancel"}),e.jsx(C,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Xe,{open:_.mode==="deleting",onOpenChange:t=>!t&&w({type:"close"}),children:e.jsxs(We,{children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:"Delete Connection?"}),e.jsxs(qe,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:_.mode==="deleting"&&_.connection.title}),"."]})]}),e.jsxs(Ye,{children:[e.jsx(Je,{children:"Cancel"}),e.jsx(Qe,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(I.Header,{children:[e.jsx(I.Header.Left,{children:e.jsx(Ze,{children:e.jsx(et,{children:e.jsx(tt,{children:e.jsx(nt,{children:"Connections"})})})})}),e.jsxs(I.Header.Right,{children:[e.jsx(Ve,{viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),ve]})]}),e.jsx(Ee,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(I.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(Me,{connection:t,fallbackIcon:e.jsx(z,{}),onClick:()=>n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}}),headerActions:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsx(C,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(re,{size:20})})}),e.jsxs(oe,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}})},children:[e.jsx(te,{size:16}),"Open"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(ie,{size:16}),"Delete"]})]})]}),body:e.jsx(ae,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ee,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?ce(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Ae,{columns:ye,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>n({to:"/$org/$project/mcps/$connectionId",params:{org:s.slug,project:h,connectionId:t.id}}),emptyState:a.search?e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(H,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(C,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:s.slug,project:h}}),children:"Browse Store"})})})})})})})]})}function En(){const s=de.c(1);let n;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx(Fe,{children:e.jsx(R.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(yt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Vt,{})})}),s[0]=n):n=s[0],n}export{En as default};
@@ -0,0 +1 @@
1
+ import{M as t,Q as a}from"./index-KcN9jfkO.js";const e=t(a,{target:"draft-7"});export{e as B};
@@ -1 +1 @@
1
- import{b3 as h,c as d,y as f,b4 as _}from"./index-Bn2rDd42.js";const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class y extends h{constructor(e,n){super(e,n)}send(e,n){const o=b(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function b(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const C={name:"mesh-sdk",version:"1.0.0"};function T(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function g({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=T(t,o),c=new _(C,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new y(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const a=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${a.join(":")}`,c}function S(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u}function I(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u??null}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function E(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function O(t){return{id:v(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function $(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{m as K,y as S,P as W,M as a,L as b,g as c,O as d,E as e,D as f,v as g,R as h,$ as i,I as j,S as u};
1
+ import{b2 as h,c as d,y as f,b3 as _}from"./index-KcN9jfkO.js";const m={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class y extends h{constructor(e,n){super(e,n)}send(e,n){const o=b(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function b(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const C={name:"mesh-sdk",version:"1.0.0"};function T(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function g({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=T(t,o),c=new _(C,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),r=new y(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(r);const a=m.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${a.join(":")}`,c}function S(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=m.mcpClient(o,n??"self",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=()=>g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u}function I(t){const e=d.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let r;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(r=n!==void 0?m.mcpClient(o,n??"self",i??"",c??""):["mcp","client","skip",o],e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=r):r=e[4];const a=r;let s;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(s=async()=>n===void 0?null:g({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=s):s=e[9];let l;e[10]!==a||e[11]!==s?(l={queryKey:a,queryFn:s,staleTime:1/0,gcTime:0},e[10]=a,e[11]=s,e[12]=l):l=e[12];const{data:u}=f(l);return u??null}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function D(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://assets.decocache.com/decocms/b2e2f64f-6025-45f7-9e8c-3b3ebdd073d8/openrouter_logojpg.jpg",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function E(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function O(t){return{id:v(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function $(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{m as K,y as S,P as W,M as a,L as b,g as c,O as d,E as e,D as f,v as g,R as h,$ as i,I as j,S as u};
@@ -1 +1 @@
1
- import{o as A,s as D,c as O,h as v,k as E,j as r,g as N}from"./index-Bn2rDd42.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-BxcV0D_1.js";import{B}from"./button-CcO5M7F7.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-CSsv2IBt.js";import{I as P}from"./input-DBvMwxwE.js";import{S as Q}from"./spinner-Bn-tqgsf.js";import{u as W}from"./useMutation-CnTeRHmv.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.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:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let h;e[26]!==d||e[27]!==g?(h=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==n||e[31]!==m||e[32]!==c?(S=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,h]}),e[29]=h,e[30]=n,e[31]=m,e[32]=c,e[33]=S):S=e[33];let p;e[34]!==t||e[35]!==S?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:S})]}),e[34]=t,e[35]=S,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
1
+ import{o as A,s as D,c as O,h as v,k as E,j as r,g as N}from"./index-KcN9jfkO.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-CMFFNJg5.js";import{B}from"./button-AB9cXWBb.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-Dk1BQhBM.js";import{I as P}from"./input-DpQoaQfS.js";import{S as Q}from"./spinner-rSR6baPa.js";import{u as W}from"./useMutation-ClyYx3N6.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.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:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let h;e[26]!==d||e[27]!==g?(h=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==n||e[31]!==m||e[32]!==c?(S=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,h]}),e[29]=h,e[30]=n,e[31]=m,e[32]=c,e[33]=S):S=e[33];let p;e[34]!==t||e[35]!==S?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:S})]}),e[34]=t,e[35]=S,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
@@ -1 +1 @@
1
- import{c as k,j as e,u as z,m as A,z as L,r as R,k as M,t as B,K as T,O as j,o as V,s as f}from"./index-Bn2rDd42.js";import{u as $}from"./useMutation-CnTeRHmv.js";import{u as q,a as O}from"./constants-DuSOM18S.js";import{D as K,a as U,b as G,c as J,d as Q,e as Y}from"./dialog-B_iTVR3h.js";import{B as D}from"./button-CcO5M7F7.js";import{a as H,F as v,b as F,c as N,d as S,f as w}from"./form-CSsv2IBt.js";import{I}from"./input-DBvMwxwE.js";import{T as W}from"./textarea-CKlKOzV4.js";import{L as X}from"./label-BjQxQJkg.js";import{i as Z}from"./Check-Sa4xK5Hg.js";import{c as ee}from"./utils-Ckc2UwOp.js";function se(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(o){return/^[a-z0-9-]+$/.test(o)&&o.length>0&&o.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function re(o){const s=k.c(16),{value:n,onChange:i}=o;let c;s[0]!==i||s[1]!==n?(c=te.map(l=>e.jsx("button",{type:"button",onClick:()=>i(l),className:ee("size-8 rounded-lg transition-all",n===l&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:l},children:n===l&&e.jsx(Z,{className:"size-4 text-white mx-auto"})},l)),s[0]=i,s[1]=n,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=n??"#3B82F6";let d;s[5]!==i?(d=l=>i(l.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}V({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function pe({open:o,onOpenChange:s}){const{org:n}=z(),i=A(),c=L(),[u,g]=R.useState(!1),d=q({connectionId:O,orgId:n.id}),t=M({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=$({mutationFn:async r=>{const h=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:n.id,slug:r.slug,name:r.name,description:r.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:r.bannerColor??null,icon:null,themeColor:r.bannerColor??null}}});return h.structuredContent??h},onSuccess:r=>{c.invalidateQueries({queryKey:T.projects(n.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:n.slug,project:r.project.slug}})},onError:r=>{B.error("Failed to create project: "+(r instanceof Error?r.message:"Unknown error"))}}),m=async r=>{if(!_(r.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(r.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(r)},x=r=>{const h=r.target.value;if(t.setValue("name",h),!u){const P=se(h);t.setValue("slug",P)}},l=r=>{g(!0),t.setValue("slug",r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),p=t.watch("slug"),b=t.watch("name"),y=p===j,E=p.length>0&&!_(p);return e.jsx(K,{open:o,onOpenChange:s,children:e.jsxs(U,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(G,{children:[e.jsx(J,{children:"Create New Project"}),e.jsxs(Q,{children:["Set up a new project in ",n.name,". You can configure plugins and settings after creation."]})]}),e.jsx(H,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(X,{children:"Banner Color"}),e.jsx(re,{value:C??null,onChange:r=>t.setValue("bannerColor",r)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",n.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:p,onChange:l,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:r})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(W,{...r,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(Y,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!p,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{pe as C};
1
+ import{c as k,j as e,u as z,m as A,z as L,r as R,k as M,t as B,K as T,O as j,o as V,s as f}from"./index-KcN9jfkO.js";import{u as $}from"./useMutation-ClyYx3N6.js";import{u as q,a as O}from"./constants-Dd61XPju.js";import{D as K,a as U,b as G,c as J,d as Q,e as Y}from"./dialog-V-G7cm4S.js";import{B as D}from"./button-AB9cXWBb.js";import{a as H,F as v,b as F,c as N,d as S,f as w}from"./form-Dk1BQhBM.js";import{I}from"./input-DpQoaQfS.js";import{T as W}from"./textarea-DYwKTx03.js";import{L as X}from"./label-B4u_PB72.js";import{i as Z}from"./Check-D3ubYXxc.js";import{c as ee}from"./utils-Ck2p4uOz.js";function se(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function _(o){return/^[a-z0-9-]+$/.test(o)&&o.length>0&&o.length<=100}const te=["#3B82F6","#8B5CF6","#EC4899","#EF4444","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#6366F1","#64748B","#000000"];function re(o){const s=k.c(16),{value:n,onChange:i}=o;let c;s[0]!==i||s[1]!==n?(c=te.map(l=>e.jsx("button",{type:"button",onClick:()=>i(l),className:ee("size-8 rounded-lg transition-all",n===l&&"ring-2 ring-offset-2 ring-primary"),style:{backgroundColor:l},children:n===l&&e.jsx(Z,{className:"size-4 text-white mx-auto"})},l)),s[0]=i,s[1]=n,s[2]=c):c=s[2];let u;s[3]!==c?(u=e.jsx("div",{className:"grid grid-cols-6 gap-2",children:c}),s[3]=c,s[4]=u):u=s[4];const g=n??"#3B82F6";let d;s[5]!==i?(d=l=>i(l.target.value),s[5]=i,s[6]=d):d=s[6];let t;s[7]!==g||s[8]!==d?(t=e.jsx("input",{type:"color",value:g,onChange:d,className:"size-8 rounded cursor-pointer"}),s[7]=g,s[8]=d,s[9]=t):t=s[9];let a;s[10]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx("span",{className:"text-sm text-muted-foreground",children:"Custom color"}),s[10]=a):a=s[10];let m;s[11]!==t?(m=e.jsxs("div",{className:"flex items-center gap-2",children:[t,a]}),s[11]=t,s[12]=m):m=s[12];let x;return s[13]!==u||s[14]!==m?(x=e.jsxs("div",{className:"space-y-3",children:[u,m]}),s[13]=u,s[14]=m,s[15]=x):x=s[15],x}V({name:f().min(1,"Name is required").max(200),slug:f().min(1,"Slug is required").max(100),description:f().max(1e3).optional(),bannerColor:f().nullable().optional()});function pe({open:o,onOpenChange:s}){const{org:n}=z(),i=A(),c=L(),[u,g]=R.useState(!1),d=q({connectionId:O,orgId:n.id}),t=M({mode:"onChange",defaultValues:{name:"",slug:"",description:"",bannerColor:"#3B82F6"}}),a=$({mutationFn:async r=>{const h=await d.callTool({name:"PROJECT_CREATE",arguments:{organizationId:n.id,slug:r.slug,name:r.name,description:r.description||null,enabledPlugins:[],ui:{banner:null,bannerColor:r.bannerColor??null,icon:null,themeColor:r.bannerColor??null}}});return h.structuredContent??h},onSuccess:r=>{c.invalidateQueries({queryKey:T.projects(n.id)}),B.success("Project created successfully"),s(!1),t.reset({name:"",slug:"",description:"",bannerColor:"#3B82F6"}),g(!1),i({to:"/$org/$project",params:{org:n.slug,project:r.project.slug}})},onError:r=>{B.error("Failed to create project: "+(r instanceof Error?r.message:"Unknown error"))}}),m=async r=>{if(!_(r.slug)){t.setError("slug",{message:"Slug must be lowercase alphanumeric with hyphens only"});return}if(r.slug===j){t.setError("slug",{message:`"${j}" is a reserved slug`});return}await a.mutateAsync(r)},x=r=>{const h=r.target.value;if(t.setValue("name",h),!u){const P=se(h);t.setValue("slug",P)}},l=r=>{g(!0),t.setValue("slug",r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))},C=t.watch("bannerColor"),p=t.watch("slug"),b=t.watch("name"),y=p===j,E=p.length>0&&!_(p);return e.jsx(K,{open:o,onOpenChange:s,children:e.jsxs(U,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsxs(G,{children:[e.jsx(J,{children:"Create New Project"}),e.jsxs(Q,{children:["Set up a new project in ",n.name,". You can configure plugins and settings after creation."]})]}),e.jsx(H,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(m),className:"space-y-6",children:[e.jsx("div",{className:"h-20 rounded-lg relative",style:{backgroundColor:C??"#3B82F6"},children:e.jsx("div",{className:"absolute -bottom-4 left-4",children:e.jsx("div",{className:"size-12 rounded-lg border-2 border-background flex items-center justify-center text-lg font-semibold text-white",style:{backgroundColor:C??"#3B82F6"},children:b?.charAt(0)?.toUpperCase()||"P"})})}),e.jsxs("div",{className:"space-y-2 pt-4",children:[e.jsx(X,{children:"Banner Color"}),e.jsx(re,{value:C??null,onChange:r=>t.setValue("bannerColor",r)})]}),e.jsx(v,{control:t.control,name:"name",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Project Name *"}),e.jsx(S,{children:e.jsx(I,{value:b,onChange:x,placeholder:"My Awesome Project",autoFocus:!0,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"slug",render:()=>e.jsxs(F,{children:[e.jsx(N,{children:"Slug *"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/",n.slug,"/"]}),e.jsx(S,{children:e.jsx(I,{value:p,onChange:l,placeholder:"my-awesome-project",className:"flex-1",disabled:a.isPending})})]}),y&&e.jsxs("p",{className:"text-xs text-destructive",children:['"',j,'" is a reserved slug']}),E&&!y&&e.jsx("p",{className:"text-xs text-destructive",children:"Slug must be lowercase alphanumeric with hyphens only"}),e.jsx(w,{})]})}),e.jsx(v,{control:t.control,name:"description",render:({field:r})=>e.jsxs(F,{children:[e.jsx(N,{children:"Description"}),e.jsx(S,{children:e.jsx(W,{...r,placeholder:"What is this project for?",rows:2,disabled:a.isPending})}),e.jsx(w,{})]})}),e.jsxs(Y,{children:[e.jsx(D,{type:"button",variant:"outline",onClick:()=>s(!1),disabled:a.isPending,children:"Cancel"}),e.jsx(D,{type:"submit",disabled:a.isPending||y||E||!b||!p,children:a.isPending?"Creating...":"Create Project"})]})]})})]})})}export{pe as C};
@@ -1 +1 @@
1
- import{c as n,j as i,B as u,D as m,T as x,E as j,G as N,H as D,I as b,J as g}from"./index-Bn2rDd42.js";import{i as h}from"./X-CuhyLwhM.js";import{c}from"./utils-Ckc2UwOp.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function B(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function H(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,B as a,E as b,H as c,O as d,R as e,w as f,T as g};
1
+ import{c as n,j as i,B as u,D as m,T as x,E as j,G as N,H as D,I as b,J as g}from"./index-KcN9jfkO.js";import{i as h}from"./X-CSVVvPO3.js";import{c}from"./utils-Ck2p4uOz.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function B(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function H(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{k as D,B as a,E as b,H as c,O as d,R as e,w as f,T as g};
@@ -1 +1 @@
1
- import{c,j as i,U as p,W as f,X as m,Y as g,Z as x,_ as v,$ as b,a0 as w,a1 as h}from"./index-Bn2rDd42.js";import{i as j}from"./ChevronRight-By4KEpZh.js";import{c as u}from"./utils-Ckc2UwOp.js";function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function _(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function y(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{S as D,$ as a,M as b,_ as c,C as d,T as e,R as f,y as g};
1
+ import{c,j as i,U as p,W as f,X as m,Y as g,Z as x,_ as v,$ as b,a0 as w,a1 as h}from"./index-KcN9jfkO.js";import{i as j}from"./ChevronRight-BTZr-xye.js";import{c as u}from"./utils-Ck2p4uOz.js";function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function _(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function y(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(b,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{S as D,$ as a,M as b,_ as c,C as d,T as e,R as f,y as g};
@@ -0,0 +1 @@
1
+ import{c as A,u as W,a as D,g as X,K as Z,j as n,r as q,l as J,aM as ee,aN as te}from"./index-KcN9jfkO.js";import{i as v}from"./Loading01-B_72CFT3.js";import{c as ne}from"./binder-BQNmKBxJ.js";import{P as $}from"./topbar-portal-_MNJb0ke.js";import{u as se}from"./useQuery-DUPTaiAP.js";import{h as ie}from"./use-connection-0mxTykry.js";import{a as oe,u as le,j as re}from"./constants-Dd61XPju.js";import{t as ae}from"./Settings01-CFqjPjGn.js";import{B as ce}from"./button-AB9cXWBb.js";import{P as E}from"./index-DcpUI1e8.js";import"./useMutation-ClyYx3N6.js";import"./utils-Ck2p4uOz.js";function de(t,e){return t?t.filter(m=>ne(m,e)):[]}function R(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=A.c(35),{binding:m,renderHeader:f,renderEmptyState:s}=t,{org:o,project:l}=W();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const{org:r,project:g,pluginId:u}=D(c),Q=ie(),{data:y}=X.useSession();let _;e[1]!==o.id?(_={connectionId:oe,orgId:o.id},e[1]=o.id,e[2]=_):_=e[2];const H=le(_);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const i=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return i.structuredContent??i},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let b;e[10]!==x||e[11]!==p||e[12]!==T?(b={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=b):b=e[13];const{data:U,isLoading:Y}=se(b),F=de(Q,m),K=U?.config?.connectionId,j=K?F.find(i=>i.id===K):null,P=re({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let i;return e[14]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=i):i=e[14],i}if(F.length===0){const i={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let a;e[15]!==s?(a=s(),e[15]=s,e[16]=a):a=e[16];let d;return e[17]!==a?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:a}),e[17]=a,e[18]=d):d=e[18],n.jsx($,{value:i,children:d})}if(!j){const i={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let a;e[19]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=a):a=e[19];const d=r??o.slug,O=g??l.slug??"";let L;return e[20]!==d||e[21]!==O?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[a,n.jsx(ce,{asChild:!0,children:n.jsx(ee,{to:"/$org/$project/settings",params:{org:d,project:O},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=O,e[22]=L):L=e[22],n.jsx($,{value:i,children:L})}let S;e[23]!==P?(S=(i,a)=>P?P.callTool({name:i,arguments:a}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:R(j),toolCaller:S,org:z,session:w},B=E,G=E,M=E,k=f({connections:[R(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==k||e[26]!==M.Header.Left?(h=n.jsx(M.Header.Left,{children:k}),e[25]=k,e[26]=M.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx(q.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx($,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Ie(){const t=A.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=D(e);let f;t[1]!==m?(f=te.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const s=f;if(s?.renderHeader&&s?.renderEmptyState){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==s.binding||t[5]!==s.renderEmptyState||t[6]!==s.renderHeader?(g=n.jsx(q.Suspense,{fallback:r,children:n.jsx(me,{binding:s.binding,renderHeader:s.renderHeader,renderEmptyState:s.renderEmptyState})}),t[4]=s.binding,t[5]=s.renderEmptyState,t[6]=s.renderHeader,t[7]=g):g=t[7],g}const o=s?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let c;return t[10]!==o?(c=n.jsx(q.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=c):c=t[11],c}export{Ie as default};
@@ -1 +1 @@
1
- import{c as p,j as t}from"./index-Bn2rDd42.js";import{B as j}from"./button-CcO5M7F7.js";import{c as b}from"./utils-Ckc2UwOp.js";function g(u){const e=p.c(18),{icon:a,title:m,description:f,buttonProps:c,buttonComponent:x}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==f?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:f}),e[4]=f,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==x||e[10]!==c?(i=x??(c&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",c?.className),...c})),e[9]=x,e[10]=c,e[11]=i):i=e[11];let o;e[12]!==i?(o=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=o):o=e[13];let n;return e[14]!==s||e[15]!==d||e[16]!==o?(n=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,o]}),e[14]=s,e[15]=d,e[16]=o,e[17]=n):n=e[17],n}export{g as E};
1
+ import{c as p,j as t}from"./index-KcN9jfkO.js";import{B as j}from"./button-AB9cXWBb.js";import{c as b}from"./utils-Ck2p4uOz.js";function g(u){const e=p.c(18),{icon:a,title:m,description:f,buttonProps:c,buttonComponent:x}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==f?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:f}),e[4]=f,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==x||e[10]!==c?(i=x??(c&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",c?.className),...c})),e[9]=x,e[10]=c,e[11]=i):i=e[11];let o;e[12]!==i?(o=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=o):o=e[13];let n;return e[14]!==s||e[15]!==d||e[16]!==o?(n=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,o]}),e[14]=s,e[15]=d,e[16]=o,e[17]=n):n=e[17],n}export{g as E};
@@ -1 +1 @@
1
- import{c as v,j as t}from"./index-Bn2rDd42.js";import{c as N}from"./utils-Ckc2UwOp.js";function y(){const f=v.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),f[0]=e):e=f[0],e}function S(f){const e=v.c(24),{image:o,title:p,description:u,actions:x,className:h,descriptionClassName:j,actionsClassName:g}=f;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==o?(l=o!==null&&t.jsx("div",{className:"flex items-center justify-center",children:o??t.jsx(y,{})}),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let r;e[11]!==i||e[12]!==a?(r=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=r):r=e[13];let n;e[14]!==x||e[15]!==g?(n=x&&t.jsx("div",{className:N("flex items-center gap-2",g),children:x}),e[14]=x,e[15]=g,e[16]=n):n=e[16];let m;e[17]!==r||e[18]!==n?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r,n]}),e[17]=r,e[18]=n,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{S as E};
1
+ import{c as v,j as t}from"./index-KcN9jfkO.js";import{c as N}from"./utils-Ck2p4uOz.js";function y(){const f=v.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),f[0]=e):e=f[0],e}function S(f){const e=v.c(24),{image:o,title:p,description:u,actions:x,className:h,descriptionClassName:j,actionsClassName:g}=f;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==o?(l=o!==null&&t.jsx("div",{className:"flex items-center justify-center",children:o??t.jsx(y,{})}),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let r;e[11]!==i||e[12]!==a?(r=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=r):r=e[13];let n;e[14]!==x||e[15]!==g?(n=x&&t.jsx("div",{className:N("flex items-center gap-2",g),children:x}),e[14]=x,e[15]=g,e[16]=n):n=e[16];let m;e[17]!==r||e[18]!==n?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r,n]}),e[17]=r,e[18]=n,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{S as E};
@@ -1 +1 @@
1
- import{c as V,j as o}from"./index-Bn2rDd42.js";import{B as C}from"./button-CcO5M7F7.js";import{I as P}from"./input-DBvMwxwE.js";import{s as A}from"./Plus-BBD2SckJ.js";import{s as R}from"./Trash01-CLqhrRia.js";function z(i){const e=i.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function T(i){const e=V.c(34),{value:t,onChange:s,keyPlaceholder:j,valuePlaceholder:l,className:E}=i,p=j===void 0?"VARIABLE_NAME":j,h=l===void 0?"value...":l;let k;e[0]!==s||e[1]!==t?(k=()=>{s([...t,{key:"",value:""}])},e[0]=s,e[1]=t,e[2]=k):k=e[2];const N=k;let y;e[3]!==s||e[4]!==t?(y=n=>{s(t.filter((c,r)=>r!==n))},e[3]=s,e[4]=t,e[5]=y):y=e[5];const m=y;let g;e[6]!==s||e[7]!==t?(g=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:c,value:a.value},s(r))},e[6]=s,e[7]=t,e[8]=g):g=e[8];const _=g;let x;e[9]!==s||e[10]!==t?(x=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:a.key,value:c},s(r))},e[9]=s,e[10]=t,e[11]=x):x=e[11];const v=x;let u;if(e[12]!==_||e[13]!==m||e[14]!==v||e[15]!==p||e[16]!==t||e[17]!==h){let n;e[19]!==_||e[20]!==m||e[21]!==v||e[22]!==p||e[23]!==h?(n=(c,r)=>o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx(P,{placeholder:p,value:c.key,onChange:a=>_(r,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),o.jsx(P,{type:z(c.key)?"password":"text",placeholder:h,value:c.value,onChange:a=>v(r,a.target.value),className:"h-10 rounded-lg flex-1"}),o.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>m(r),children:o.jsx(R,{size:16})})]},r),e[19]=_,e[20]=m,e[21]=v,e[22]=p,e[23]=h,e[24]=n):n=e[24],u=t.map(n),e[12]=_,e[13]=m,e[14]=v,e[15]=p,e[16]=t,e[17]=h,e[18]=u}else u=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==N?(f=o.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=f):f=e[27];let d;e[28]!==u||e[29]!==f?(d=o.jsxs("div",{className:"flex flex-col gap-2",children:[u,f]}),e[28]=u,e[29]=f,e[30]=d):d=e[30];let b;return e[31]!==E||e[32]!==d?(b=o.jsx("div",{className:E,children:d}),e[31]=E,e[32]=d,e[33]=b):b=e[33],b}function W(i){const e={};for(const{key:t,value:s}of i)t.trim()&&(e[t.trim()]=s);return e}function $(i){return i?Object.entries(i).map(([e,t])=>({key:e,value:t})):[]}export{T as E,W as e,$ as r};
1
+ import{c as V,j as o}from"./index-KcN9jfkO.js";import{B as C}from"./button-AB9cXWBb.js";import{I as P}from"./input-DpQoaQfS.js";import{s as A}from"./Plus-_EIrkETO.js";import{s as R}from"./Trash01-CKqlebDm.js";function z(i){const e=i.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function T(i){const e=V.c(34),{value:t,onChange:s,keyPlaceholder:j,valuePlaceholder:l,className:E}=i,p=j===void 0?"VARIABLE_NAME":j,h=l===void 0?"value...":l;let k;e[0]!==s||e[1]!==t?(k=()=>{s([...t,{key:"",value:""}])},e[0]=s,e[1]=t,e[2]=k):k=e[2];const N=k;let y;e[3]!==s||e[4]!==t?(y=n=>{s(t.filter((c,r)=>r!==n))},e[3]=s,e[4]=t,e[5]=y):y=e[5];const m=y;let g;e[6]!==s||e[7]!==t?(g=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:c,value:a.value},s(r))},e[6]=s,e[7]=t,e[8]=g):g=e[8];const _=g;let x;e[9]!==s||e[10]!==t?(x=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:a.key,value:c},s(r))},e[9]=s,e[10]=t,e[11]=x):x=e[11];const v=x;let u;if(e[12]!==_||e[13]!==m||e[14]!==v||e[15]!==p||e[16]!==t||e[17]!==h){let n;e[19]!==_||e[20]!==m||e[21]!==v||e[22]!==p||e[23]!==h?(n=(c,r)=>o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx(P,{placeholder:p,value:c.key,onChange:a=>_(r,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),o.jsx(P,{type:z(c.key)?"password":"text",placeholder:h,value:c.value,onChange:a=>v(r,a.target.value),className:"h-10 rounded-lg flex-1"}),o.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>m(r),children:o.jsx(R,{size:16})})]},r),e[19]=_,e[20]=m,e[21]=v,e[22]=p,e[23]=h,e[24]=n):n=e[24],u=t.map(n),e[12]=_,e[13]=m,e[14]=v,e[15]=p,e[16]=t,e[17]=h,e[18]=u}else u=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==N?(f=o.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=f):f=e[27];let d;e[28]!==u||e[29]!==f?(d=o.jsxs("div",{className:"flex flex-col gap-2",children:[u,f]}),e[28]=u,e[29]=f,e[30]=d):d=e[30];let b;return e[31]!==E||e[32]!==d?(b=o.jsx("div",{className:E,children:d}),e[31]=E,e[32]=d,e[33]=b):b=e[33],b}function W(i){const e={};for(const{key:t,value:s}of i)t.trim()&&(e[t.trim()]=s);return e}function $(i){return i?Object.entries(i).map(([e,t])=>({key:e,value:t})):[]}export{T as E,W as e,$ as r};
@@ -1 +1 @@
1
- import{r as o,j as e}from"./index-Bn2rDd42.js";import{B as n}from"./button-CcO5M7F7.js";const a=({size:t=24,color:r="currentColor",...s})=>o.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},o.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));a.displayName="AlertTriangle";class l extends o.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:r}=this.props;return typeof r=="function"?r({error:this.state.error,resetError:this.resetError}):r!==void 0?r:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(a,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}export{l as E,a as i};
1
+ import{r as o,j as e}from"./index-KcN9jfkO.js";import{B as n}from"./button-AB9cXWBb.js";const a=({size:t=24,color:r="currentColor",...s})=>o.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},o.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));a.displayName="AlertTriangle";class l extends o.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:r}=this.props;return typeof r=="function"?r({error:this.state.error,resetError:this.resetError}):r!==void 0?r:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(a,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}export{l as E,a as i};
@@ -1 +1 @@
1
- import"./constants-QC26G_cT.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-BsLp7zXK.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
1
+ import"./constants-DBa8dlFt.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-DBaLa5Rh.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-DowLXjS7.js","assets/index-KcN9jfkO.js","assets/index-BEdPWc-P.css","assets/topbar-portal-_MNJb0ke.js","assets/button-AB9cXWBb.js","assets/utils-Ck2p4uOz.js","assets/AlertCircle-BtLmHyy8.js","assets/Download01-B76QpppS.js","assets/File02-nG54lqZh.js","assets/File06-BTrZX4-T.js","assets/Image01-B2o6vVhA.js","assets/Loading01-B_72CFT3.js","assets/Trash01-CKqlebDm.js","assets/Upload01-DYCMxAjY.js","assets/useMutation-ClyYx3N6.js","assets/useQuery-DUPTaiAP.js","assets/useInfiniteQuery-D6oUaKP2.js","assets/infiniteQueryObserver-BPw7at1z.js","assets/checkbox-lsjWL6i2.js","assets/Check-D3ubYXxc.js","assets/ChevronRight-BTZr-xye.js","assets/Grid01-RAa135S1.js","assets/Home02-QIpDHMcj.js","assets/List-DS9PzQZf.js"])))=>i.map(i=>d[i]);
2
+ import{r as M,c as K,bl as A,z as Y,j as t,t as D,bm as X,a4 as ee}from"./index-KcN9jfkO.js";import{u as Q}from"./topbar-portal-_MNJb0ke.js";import{u as te}from"./useInfiniteQuery-D6oUaKP2.js";import{B as _}from"./button-AB9cXWBb.js";import{C as U}from"./checkbox-lsjWL6i2.js";import{c as J}from"./utils-Ck2p4uOz.js";import{i as se}from"./AlertCircle-BtLmHyy8.js";import{i as ae}from"./ChevronRight-BTZr-xye.js";import{n as ie}from"./Download01-B76QpppS.js";import{i as re}from"./File02-nG54lqZh.js";import{c as G}from"./Grid01-RAa135S1.js";import{a as oe}from"./Home02-QIpDHMcj.js";import{i as V}from"./List-DS9PzQZf.js";import{i as L}from"./Loading01-B_72CFT3.js";import{s as W}from"./Trash01-CKqlebDm.js";import{i as $}from"./Upload01-DYCMxAjY.js";import{u as q}from"./useMutation-ClyYx3N6.js";const Z=({size:s=24,color:e="currentColor",...i})=>M.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},M.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,i=!1,o=100)=>["object-storage","objects",s,e,{flat:i,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},ne=100;function le(s){const e=K.c(30);let i;e[0]!==s?(i=s===void 0?{}:s,e[0]=s,e[1]=i):i=e[1];const o=i,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?ne:d,{connectionId:b,toolCaller:S}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async a=>{const{pageParam:r}=a;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:ge,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:z,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:w}=te(E);let v;if(l){let a;e[15]!==p?.pages?(a=p?.pages.flatMap(he).filter(pe).map(xe)??[],e[15]=p?.pages,e[16]=a):a=e[16],v=a}else{let a;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(ue)??[],j=p?.pages.flatMap(de)??[];a=[...r.sort(ce),...j],e[17]=p?.pages,e[18]=a}else a=e[18];v=a}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,F=y??!1,P=w;let k;return e[23]!==g||e[24]!==z||e[25]!==C||e[26]!==v||e[27]!==P||e[28]!==F?(k={objects:v,isLoading:z,isFetchingMore:g,hasMore:F,loadMore:C,error:P},e[23]=g,e[24]=z,e[25]=C,e[26]=v,e[27]=P,e[28]=F,e[29]=k):k=e[29],k}function ce(s,e){return s.key.localeCompare(e.key)}function de(s){return s.objects.filter(fe).map(me)}function me(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function fe(s){return!s.key.endsWith("/")}function ue(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function xe(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function pe(s){return!s.key.endsWith("/")}function he(s){return s.objects}function ge(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function je(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(s)/Math.log(i));return`${parseFloat((s/Math.pow(i,o)).toFixed(1))} ${e[o]}`}function ye(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ve(s){const e=[],i=s.split("/").filter(Boolean);let o="";for(const n of i)o+=n+"/",e.push({name:n,path:o});return e}function Ke(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const Ne=M.lazy(()=>X(()=>import("./grid-view-DowLXjS7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])));function be(s){const e=K.c(50),{item:i,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==i.key||e[1]!==c?(b=c?i.key:I(i.key),e[0]=i.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(U,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==i.isFolder||e[7]!==i.key||e[8]!==d?(u=()=>i.isFolder?d(i.key):void 0,e[6]=i.isFolder,e[7]=i.key,e[8]=d,e[9]=u):u=e[9];const E=i.isFolder&&"cursor-pointer hover:text-primary";let p;e[10]!==E?(p=J("flex items-center gap-2 flex-1 min-w-0 text-left",E),e[10]=E,e[11]=p):p=e[11];let z;e[12]!==i.isFolder?(z=i.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(re,{size:18,className:"text-muted-foreground shrink-0"}),e[12]=i.isFolder,e[13]=z):z=e[13];let g;e[14]!==S?(g=t.jsx("span",{className:"truncate",children:S}),e[14]=S,e[15]=g):g=e[15];let y;e[16]!==u||e[17]!==p||e[18]!==z||e[19]!==g?(y=t.jsxs("button",{type:"button",onClick:u,className:p,children:[z,g]}),e[16]=u,e[17]=p,e[18]=z,e[19]=g,e[20]=y):y=e[20];let h;e[21]!==i.isFolder||e[22]!==i.size?(h=i.isFolder?"-":je(i.size),e[21]=i.isFolder,e[22]=i.size,e[23]=h):h=e[23];let w;e[24]!==h?(w=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:h}),e[24]=h,e[25]=w):w=e[25];let v;e[26]!==i.isFolder||e[27]!==i.lastModified?(v=i.isFolder?"-":ye(i.lastModified),e[26]=i.isFolder,e[27]=i.lastModified,e[28]=v):v=e[28];let N;e[29]!==v?(N=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:v}),e[29]=v,e[30]=N):N=e[30];let C;e[31]!==i.isFolder||e[32]!==i.key||e[33]!==m?(C=!i.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(i.key),children:t.jsx(ie,{size:14})}),e[31]=i.isFolder,e[32]=i.key,e[33]=m,e[34]=C):C=e[34];let F;e[35]!==i.key||e[36]!==l?(F=()=>l(i.key),e[35]=i.key,e[36]=l,e[37]=F):F=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[38]=P):P=e[38];let k;e[39]!==F?(k=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F,children:P}),e[39]=F,e[40]=k):k=e[40];let a;e[41]!==C||e[42]!==k?(a=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[C,k]}),e[41]=C,e[42]=k,e[43]=a):a=e[43];let r;return e[44]!==w||e[45]!==N||e[46]!==a||e[47]!==f||e[48]!==y?(r=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,y,w,N,a]}),e[44]=w,e[45]=N,e[46]=a,e[47]=f,e[48]=y,e[49]=r):r=e[49],r}function H(s){const e=K.c(8),{prefix:i,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==i){const x=ve(i);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(oe,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:J("hover:text-primary",b===x.length-1?"font-medium text-foreground":"text-muted-foreground"),children:c.name})]},c.path))]}),e[0]=o,e[1]=i,e[2]=n}else n=e[2];return n}function ke(){const{path:s="",flat:e=!1,view:i="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=a=>{x(new Set),o({to:"/",search:{path:a||void 0,flat:e,view:i}})},m=a=>{x(new Set),o({to:"/",search:{path:a?void 0:s||void 0,flat:a,view:i}})},l=a=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:a}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:z,loadMore:g,error:y}=le({prefix:s,flat:e}),h=q({mutationFn:async a=>{const r=s+a.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:a.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:a,headers:{"Content-Type":a.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:a=>{D.success(`Uploaded ${I(a)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Upload failed: ${a.message}`)}}),w=q({mutationFn:async a=>a.length===1&&a[0]?f("DELETE_OBJECT",{key:a[0]}):f("DELETE_OBJECTS",{keys:a}),onSuccess:()=>{D.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Delete failed: ${a.message}`)}}),v=async a=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:a}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),B=document.createElement("a");B.href=O,B.download=I(a),document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(O)}catch(r){D.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=a=>{const r=a.target.files;if(r){for(const j of Array.from(r))h.mutate(j);a.target.value=""}},C=(a,r)=>{const j=new Set(n);r?j.add(a):j.delete(a),x(j)},F=a=>{x(a?new Set(u.map(r=>r.key)):new Set)},P=()=>{n.size!==0&&w.mutate(Array.from(n))},k=a=>{if(!z||p)return;const r=a.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):i==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(M.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ne,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(_,{variant:"outline",size:"sm",className:"text-destructive",onClick:P,disabled:w.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(U,{checked:n.size>0&&n.size===u.length,onCheckedChange:F}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx(L,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(_,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx($,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(a=>t.jsx(be,{item:a,selected:n.has(a.key),showFullPath:e,onSelect:r=>C(a.key,r),onNavigate:d,onDownload:v,onDelete:r=>w.mutate([r])},a.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(L,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const Oe=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{R as K,Ke as a,Oe as b,je as f,I as g,Z as s,le as u};
@@ -1 +1 @@
1
- import{F as C,c as f,j as c,n as j,r as d,q as v,v as b,w as h}from"./index-Bn2rDd42.js";import{L as N}from"./label-BjQxQJkg.js";import{c as p}from"./utils-Ckc2UwOp.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=b();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function L(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function P(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function y(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(v,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function R(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function q(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,L as b,P as c,y as d,R as e,q as f};
1
+ import{F as C,c as f,j as c,n as j,r as d,q as v,v as b,w as h}from"./index-KcN9jfkO.js";import{L as N}from"./label-B4u_PB72.js";import{c as p}from"./utils-Ck2p4uOz.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=b();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function L(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function P(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function y(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(v,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function R(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function q(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,L as b,P as c,y as d,R as e,q as f};
@@ -0,0 +1 @@
1
+ import{r as v,c as M,j as s,z as q,t as w,a4 as H}from"./index-KcN9jfkO.js";import{u as D}from"./topbar-portal-_MNJb0ke.js";import{K as L,u as Z,g as R,s as Q,a as W,f as U}from"./file-browser-BMnqO_1p.js";import{B as E}from"./button-AB9cXWBb.js";import{c as I}from"./utils-Ck2p4uOz.js";import{i as S}from"./AlertCircle-BtLmHyy8.js";import{n as A}from"./Download01-B76QpppS.js";import{i as $}from"./File02-nG54lqZh.js";import{i as J}from"./File06-BTrZX4-T.js";import{a as P}from"./Image01-B2o6vVhA.js";import{i as T}from"./Loading01-B_72CFT3.js";import{s as V}from"./Trash01-CKqlebDm.js";import{i as Y}from"./Upload01-DYCMxAjY.js";import{u as _}from"./useMutation-ClyYx3N6.js";import{u as X}from"./useQuery-DUPTaiAP.js";import"./useInfiniteQuery-D6oUaKP2.js";import"./infiniteQueryObserver-BPw7at1z.js";import"./checkbox-lsjWL6i2.js";import"./Check-D3ubYXxc.js";import"./ChevronRight-BTZr-xye.js";import"./Grid01-RAa135S1.js";import"./Home02-QIpDHMcj.js";import"./List-DS9PzQZf.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));K.displayName="FileCode01";const O=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));O.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),c=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{c.current&&(c.current.disconnect(),c.current=null),u&&!d.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!d.current&&(d.current=!0,g(!0),c.current?.disconnect(),c.current=null)},i),c.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:c}=i,d=c===void 0?"":c,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let a;e[1]!==n||e[2]!==t?(a=L.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==a||e[9]!==f?(k={queryKey:a,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=a,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=I("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:O,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:K,Folder:H};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:c,onDelete:d}=i;let n;e[0]!==t.key?(n=R(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!a&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=I("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==a||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:I(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=a,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==a||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=a,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==c?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),c(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=c,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function ze({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),c=q(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:a,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${R(r)}`),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=R(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&a()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{ze as default};
@@ -1 +1 @@
1
- import{c as f,j as s,g as _,r as C,a_ as F,m as E,z as O,t as w}from"./index-Bn2rDd42.js";import{C as k}from"./card-BNt4WjQv.js";import{c as y}from"./utils-Ckc2UwOp.js";import{A as R}from"./avatar-D3z5_V3I.js";import{i as D}from"./AlertCircle-C_hR5usO.js";import{i as H}from"./Check-Sa4xK5Hg.js";import{s as G}from"./Plus-BBD2SckJ.js";import{i as Q}from"./SearchMd-CGuwiAQe.js";import{s as q}from"./XClose-BFt2trBc.js";import{B as $}from"./button-CcO5M7F7.js";import{I as B}from"./input-DBvMwxwE.js";import{C as T}from"./create-organization-dialog-j_P7xuhv.js";import"./alert-dialog-BxcV0D_1.js";import"./form-CSsv2IBt.js";import"./label-BjQxQJkg.js";import"./spinner-Bn-tqgsf.js";import"./useMutation-CnTeRHmv.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:P,Title:V,Subtitle:X,Content:Y,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await _.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await _.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await _.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"&&new Date(d.expiresAt)>new Date),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=_.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=_.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let I;return t[24]!==S||t[25]!==z?(I=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=I):I=t[26],I}function $e(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{$e as default};
1
+ import{c as f,j as s,g as I,r as C,aZ as F,m as E,z as O,t as w}from"./index-KcN9jfkO.js";import{C as k}from"./card-DatbcemW.js";import{c as y}from"./utils-Ck2p4uOz.js";import{A as R}from"./avatar-C0cccS60.js";import{i as D}from"./AlertCircle-BtLmHyy8.js";import{i as H}from"./Check-D3ubYXxc.js";import{s as G}from"./Plus-_EIrkETO.js";import{i as Q}from"./SearchMd-DglsF9__.js";import{s as q}from"./XClose-BOh776sq.js";import{B as $}from"./button-AB9cXWBb.js";import{I as B}from"./input-DpQoaQfS.js";import{C as T}from"./create-organization-dialog-lVschU-T.js";import"./alert-dialog-CMFFNJg5.js";import"./form-Dk1BQhBM.js";import"./label-B4u_PB72.js";import"./spinner-rSR6baPa.js";import"./useMutation-ClyYx3N6.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:Z,Header:P,Title:V,Subtitle:X,Content:Y,Footer:J,Badge:K,Skeleton:W}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"&&new Date(d.expiresAt)>new Date),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function $e(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{$e as default};