@decocms/mesh 2.15.1 → 2.17.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 (154) hide show
  1. package/dist/client/assets/{AlertCircle-DlBo4Xw9.js → AlertCircle-DOBZDZTf.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CCqPW2JN.js → ArrowLeft-CiX5attk.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-KvHCnFh3.js → ArrowUp-Cb5IgbXf.js} +1 -1
  4. package/dist/client/assets/{Check-D4dBNJmC.js → Check-D_y2LGJG.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CJaS1NVA.js → ChevronDown-CK8tBMwt.js} +1 -1
  6. package/dist/client/assets/{Code01-CMazpegY.js → Code01-CHaKquD7.js} +1 -1
  7. package/dist/client/assets/{Copy01-Rf_P7R5F.js → Copy01-DEYUyyKa.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-Nj82ZW12.js → DotsHorizontal-CJj2K5Fj.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-f9rnazjX.js → DotsVertical-DBgin8Gd.js} +1 -1
  10. package/dist/client/assets/{Download01-Cnas0PSW.js → Download01-D480FrAl.js} +1 -1
  11. package/dist/client/assets/{Edit01-MWKLkbpZ.js → Edit01-C2wyoLl_.js} +1 -1
  12. package/dist/client/assets/{File06-Dir7h2_j.js → File06-Dss_qxDP.js} +1 -1
  13. package/dist/client/assets/{FilterLines-BgxUhbig.js → FilterLines-BIIc2m5u.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-B1KVh_65.js → FlipBackward-C6tD49bS.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-CA4KhZZx.js → GitBranch01-CCs9Y7UL.js} +1 -1
  16. package/dist/client/assets/{Grid01-BgBQwtBY.js → Grid01-CPcgzk-j.js} +1 -1
  17. package/dist/client/assets/{Home02-CR-W2ctm.js → Home02-B2DfszMd.js} +1 -1
  18. package/dist/client/assets/{Image01-B8cj-qoF.js → Image01-CWiMChMV.js} +1 -1
  19. package/dist/client/assets/{Inbox01-Bh5pMKE1.js → Inbox01-E54Xv1AH.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-CVdyaBb8.js → InfoCircle-C1Hk7qxK.js} +1 -1
  21. package/dist/client/assets/{Key01-BcxLAym0.js → Key01-D3jgPHnl.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-D41WE0Cl.js → LinkExternal01-DXt_okRr.js} +1 -1
  23. package/dist/client/assets/{List-hTdqyLGB.js → List-vJTsFkGC.js} +1 -1
  24. package/dist/client/assets/{Loading01-Bq_7Os6T.js → Loading01-CXxLrMyp.js} +1 -1
  25. package/dist/client/assets/{Lock01-DOJDUqUZ.js → Lock01-C0IcfwAr.js} +1 -1
  26. package/dist/client/assets/MessageChatSquare-BAK3msQ9.js +1 -0
  27. package/dist/client/assets/{Play-CoxjBx7-.js → Play-D5UR01Yp.js} +1 -1
  28. package/dist/client/assets/{Plus-C4F6mby2.js → Plus-BwqRnIpw.js} +1 -1
  29. package/dist/client/assets/{SearchMd-B_A85eif.js → SearchMd-B72GLhSo.js} +1 -1
  30. package/dist/client/assets/{Terminal-BWurH474.js → Terminal-C6oII67o.js} +1 -1
  31. package/dist/client/assets/{Trash01-GrzirNvV.js → Trash01-pQsQJfD7.js} +1 -1
  32. package/dist/client/assets/{Upload01-Ba_zCXbQ.js → Upload01-CPXoheIk.js} +1 -1
  33. package/dist/client/assets/{X-D09jV0HO.js → X-Ta7e64fd.js} +1 -1
  34. package/dist/client/assets/{XClose-D9UXYoHK.js → XClose-COWRVEvP.js} +1 -1
  35. package/dist/client/assets/{alert-dialog-Df8ZsItX.js → alert-dialog-CwDNNTWs.js} +1 -1
  36. package/dist/client/assets/{auth-catchall-Bu_AmzqF.js → auth-catchall-DOIkjlbS.js} +1 -1
  37. package/dist/client/assets/{avatar-CrVRRbJ7.js → avatar-Bbu1o6br.js} +1 -1
  38. package/dist/client/assets/{badge-BPKvq16e.js → badge-BF26aj7r.js} +1 -1
  39. package/dist/client/assets/{binder-BtPpbY4I.js → binder-CZMsXyzM.js} +1 -1
  40. package/dist/client/assets/button-CKEM3eQL.js +1 -0
  41. package/dist/client/assets/{card-Rz2C5-Lx.js → card-2L27xRvH.js} +1 -1
  42. package/dist/client/assets/{checkbox-DGIT6WZ3.js → checkbox-D-u8zfFA.js} +1 -1
  43. package/dist/client/assets/{collection-detail-CIorpvYQ.js → collection-detail-DRvlQkfI.js} +2 -2
  44. package/dist/client/assets/{collection-display-button-C_GfVLwh.js → collection-display-button-BRmjKmXA.js} +1 -1
  45. package/dist/client/assets/{collection-header-Dl8Ii13M.js → collection-header-DxthRGYV.js} +1 -1
  46. package/dist/client/assets/{collection-page-C75JriCh.js → collection-page-D_yHhDuI.js} +1 -1
  47. package/dist/client/assets/{collection-search-D67e9ppe.js → collection-search-B1XW3AZu.js} +1 -1
  48. package/dist/client/assets/{collection-tab-DVmiR956.js → collection-tab-tjhO7Mrn.js} +1 -1
  49. package/dist/client/assets/{collection-table-wrapper-DDHrDWif.js → collection-table-wrapper-D0Ju0-U8.js} +1 -1
  50. package/dist/client/assets/{connection-card-BuCHeT4K.js → connection-card-DtL0ugHI.js} +1 -1
  51. package/dist/client/assets/connection-detail-CfQ3feir.js +1 -0
  52. package/dist/client/assets/{connection-CmMMEDBY.js → connection-iGG9vveH.js} +1 -1
  53. package/dist/client/assets/connections-D3zmX0Z9.js +1 -0
  54. package/dist/client/assets/constants-rLrKmanL.js +1 -0
  55. package/dist/client/assets/{create-organization-dialog-DQ5uy2r0.js → create-organization-dialog-eRNW8Qxh.js} +1 -1
  56. package/dist/client/assets/{dialog-bW33A1d_.js → dialog-CDtau8Kt.js} +1 -1
  57. package/dist/client/assets/{dropdown-menu-dsr_wyw0.js → dropdown-menu-wWS-zaMN.js} +1 -1
  58. package/dist/client/assets/dynamic-plugin-layout-DputRlYb.js +1 -0
  59. package/dist/client/assets/{empty-state-By_kA__m.js → empty-state-BHbK0lgC.js} +1 -1
  60. package/dist/client/assets/{empty-state-B1DU5702.js → empty-state-CVNEuxZY.js} +1 -1
  61. package/dist/client/assets/{env-vars-editor-BjH5KdVc.js → env-vars-editor-C51mNjyA.js} +1 -1
  62. package/dist/client/assets/{error-boundary-BOBkDZ1Y.js → error-boundary-Bcxx4rfP.js} +1 -1
  63. package/dist/client/assets/{extract-connection-data-CNcw3HV2.js → extract-connection-data-Dpmksiuo.js} +1 -1
  64. package/dist/client/assets/{file-browser-BDyBPrc6.js → file-browser-BGJT68ml.js} +2 -2
  65. package/dist/client/assets/{form-ChO7tWCF.js → form-V7XQlTI9.js} +1 -1
  66. package/dist/client/assets/gateway-detail-Dwo3tRMv.js +1 -0
  67. package/dist/client/assets/{gateways-ckyn_Uas.js → gateways-zERSWoJy.js} +1 -1
  68. package/dist/client/assets/{grid-view-CTAOtRDs.js → grid-view-D8luahOM.js} +1 -1
  69. package/dist/client/assets/{home-CpIhQ8D8.js → home-BzIxKv5R.js} +1 -1
  70. package/dist/client/assets/index-BuhwJgoT.js +1 -0
  71. package/dist/client/assets/index-CCciYu2S.css +1 -0
  72. package/dist/client/assets/{index-ChF3uWl9.js → index-COEG5bG9.js} +1 -1
  73. package/dist/client/assets/{index-CH2G6_zW.js → index-D93bwXlh.js} +1 -1
  74. package/dist/client/assets/index-Dm3KUy-5.js +107 -0
  75. package/dist/client/assets/{index-ZiFjEqyT.js → index-H8waGLZX.js} +3 -3
  76. package/dist/client/assets/{infiniteQueryObserver-DEh2zauU.js → infiniteQueryObserver-CorNdPTl.js} +1 -1
  77. package/dist/client/assets/{input-DEsmZ6es.js → input-B_S0H_Hl.js} +1 -1
  78. package/dist/client/assets/layout-CSDcjZIC.js +1 -0
  79. package/dist/client/assets/{lazy-highlighter-B2TKQCpQ.js → lazy-highlighter-C9yEt-oj.js} +1 -1
  80. package/dist/client/assets/{localstorage-keys-DhdYpXZj.js → localstorage-keys-bcceq1xC.js} +1 -1
  81. package/dist/client/assets/{login-DtC787Hg.js → login-BYnVwbER.js} +1 -1
  82. package/dist/client/assets/{mcp-oauth-D8a9d38x.js → mcp-oauth-BQzIgGw8.js} +1 -1
  83. package/dist/client/assets/{mcp-server-card-DSQZ-b3I.js → mcp-server-card-_ATNoXTX.js} +1 -1
  84. package/dist/client/assets/{mcp-server-detail-rW4PqaOO.js → mcp-server-detail-DObA9nLB.js} +1 -1
  85. package/dist/client/assets/{members-C4HTAJHG.js → members-BebBEAXI.js} +2 -2
  86. package/dist/client/assets/{monaco-editor-BYgR7J38.js → monaco-editor-DKdQnknl.js} +4 -4
  87. package/dist/client/assets/{monitoring-BGY0w02b.js → monitoring-CDDlEqUx.js} +6 -6
  88. package/dist/client/assets/{oauth-callback-BSZdPTYI.js → oauth-callback-gzfkrrQW.js} +1 -1
  89. package/dist/client/assets/page-CLLgwmPE.js +35 -0
  90. package/dist/client/assets/page-Do6tc7Ak.js +1 -0
  91. package/dist/client/assets/{pin-to-sidebar-button-BahvsjHH.js → pin-to-sidebar-button-NqMT4AF7.js} +1 -1
  92. package/dist/client/assets/{plugin-empty-state-CIiB0IAw.js → plugin-empty-state-CsEwK0UI.js} +1 -1
  93. package/dist/client/assets/{plugin-header-CvDO4WmD.js → plugin-header-DMvUkTVw.js} +1 -1
  94. package/dist/client/assets/plugins-femIOaN7.js +1 -0
  95. package/dist/client/assets/{popover-DW05feED.js → popover-CUHksX3w.js} +1 -1
  96. package/dist/client/assets/{project-context-provider-BPo-49FO.js → project-context-provider-DTbOrAFq.js} +1 -1
  97. package/dist/client/assets/{registry-utils-DzI73csj.js → registry-utils-C5W-BZ_1.js} +1 -1
  98. package/dist/client/assets/{resizable-BAPLF4RD.js → resizable-BEUt05S8.js} +1 -1
  99. package/dist/client/assets/{resource-tabs-CC5dHHUl.js → resource-tabs-kfeiBQEL.js} +1 -1
  100. package/dist/client/assets/select-H2esePZI.js +1 -0
  101. package/dist/client/assets/settings-DO0PkWA0.js +1 -0
  102. package/dist/client/assets/shell-layout-Bx8F46Gf.js +17 -0
  103. package/dist/client/assets/{spinner-DqooIng7.js → spinner-BZhaf6l_.js} +1 -1
  104. package/dist/client/assets/{switch-dZML6kqo.js → switch-CIfCfD81.js} +1 -1
  105. package/dist/client/assets/{textarea-DFRypKCQ.js → textarea-CC9KHQpw.js} +1 -1
  106. package/dist/client/assets/{tool-set-selector-DRx4AOzy.js → tool-set-selector-Cty6fXdH.js} +1 -1
  107. package/dist/client/assets/{tools-list-C8nSsOKD.js → tools-list-rrG-PiCB.js} +1 -1
  108. package/dist/client/assets/{tooltip-BJO9sFhZ.js → tooltip-DixY1Sbc.js} +1 -1
  109. package/dist/client/assets/use-binding-CPqdk4GE.js +23 -0
  110. package/dist/client/assets/{use-collections-g067BPxP.js → use-collections-S6OVeMx0.js} +1 -1
  111. package/dist/client/assets/{use-connection-BskZam-G.js → use-connection-C_QQYkok.js} +1 -1
  112. package/dist/client/assets/use-connection-resources-h_CY6VEc.js +1 -0
  113. package/dist/client/assets/{use-create-gateway-CCmt4GT8.js → use-create-gateway-eDGGqEOS.js} +1 -1
  114. package/dist/client/assets/{use-gateway-v7etejE8.js → use-gateway-DMJjVwlU.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-DoCpWoeh.js → use-gateway-system-prompt-CfIIyZId.js} +1 -1
  116. package/dist/client/assets/{use-list-state-C5pgFF_z.js → use-list-state-Bt6QEhtR.js} +1 -1
  117. package/dist/client/assets/{use-mcp-ZNQ-iMEF.js → use-mcp-DuKh-Xf7.js} +1 -1
  118. package/dist/client/assets/{use-members-dVasH0ez.js → use-members-Hsme2FMs.js} +1 -1
  119. package/dist/client/assets/{use-mobile-Co7MtEW-.js → use-mobile-Bh6onNnL.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-K7SU43aD.js → use-organization-settings-C4u9V1Gg.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-BbfSyOCz.js → use-tool-call-BSVniqlJ.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-BYo7uk8S.js +1 -0
  123. package/dist/client/assets/{useMutation-4fnzP4bc.js → useMutation-DXyBs08e.js} +1 -1
  124. package/dist/client/assets/useQuery-9rHAo5k0.js +1 -0
  125. package/dist/client/assets/{value-zEqR5KPg.js → value-EQeDZr5M.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-tlrhMsiy.js → view-mode-toggle-CoxeG-5F.js} +1 -1
  127. package/dist/client/assets/{well-known-mcp-D13f-8h2.js → well-known-mcp-DOEdYmKO.js} +1 -1
  128. package/dist/client/assets/{workflow-B8_jtBci.js → workflow-CdkAFtfl.js} +1 -1
  129. package/dist/client/index.html +2 -2
  130. package/dist/server/cli.js +33 -33
  131. package/dist/server/server.js +49 -49
  132. package/package.json +1 -1
  133. package/dist/client/assets/Clock-ljBuaWDA.js +0 -1
  134. package/dist/client/assets/button-Co_HOc3E.js +0 -1
  135. package/dist/client/assets/connection-detail-BsC5t8hY.js +0 -1
  136. package/dist/client/assets/connections-B3RW87mz.js +0 -1
  137. package/dist/client/assets/constants-B5NZDm4s.js +0 -1
  138. package/dist/client/assets/dynamic-plugin-layout-IH0Gl52A.js +0 -1
  139. package/dist/client/assets/gateway-detail-CzuSbsFr.js +0 -1
  140. package/dist/client/assets/index-BUdiVz6f.js +0 -1
  141. package/dist/client/assets/index-Bc30BcYv.js +0 -88
  142. package/dist/client/assets/index-JAPwCHXJ.css +0 -1
  143. package/dist/client/assets/layout-tF7tb_Qc.js +0 -1
  144. package/dist/client/assets/page-DcQoSvJk.js +0 -35
  145. package/dist/client/assets/page-DxMYdFSw.js +0 -1
  146. package/dist/client/assets/plugins-CyUBsABC.js +0 -1
  147. package/dist/client/assets/select-CVEPeRAQ.js +0 -1
  148. package/dist/client/assets/settings-BfbdOKrl.js +0 -1
  149. package/dist/client/assets/shell-layout-DJjajsTY.js +0 -3
  150. package/dist/client/assets/use-binding-C8KxuIY6.js +0 -23
  151. package/dist/client/assets/use-connection-resources-YXIBGXnm.js +0 -1
  152. package/dist/client/assets/use-model-state-B8hL-q1r.js +0 -20
  153. package/dist/client/assets/useInfiniteQuery-Dbq7IS1q.js +0 -1
  154. package/dist/client/assets/useQuery-Bn2Wcch_.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as ge,j as e,r as M,f as xe,b as je,a as fe,u as ye,E as ve,B as _e,y as se,I as Ce,z as y,_ as ke}from"./index-H8waGLZX.js";import{C as Ne}from"./collection-header-DxthRGYV.js";import{C as Se}from"./collection-page-D_yHhDuI.js";import{C as Te}from"./collection-search-B1XW3AZu.js";import{C as we}from"./collection-table-wrapper-D0Ju0-U8.js";import{C as De}from"./connection-card-DtL0ugHI.js";import{n as O,E as B,I as be}from"./empty-state-CVNEuxZY.js";import{E as Pe}from"./error-boundary-Bcxx4rfP.js";import{a as Ie,u as Ve}from"./use-connection-C_QQYkok.js";import{u as Ee}from"./use-binding-CPqdk4GE.js";import{u as $e,s as Q}from"./use-list-state-Bt6QEhtR.js";import{u as Ae}from"./project-context-provider-DTbOrAFq.js";import{f as Fe,a as He,b as Oe,c as Be,d as ze,e as Me,A as Re,g as Ue}from"./alert-dialog-CwDNNTWs.js";import{B as Xe}from"./badge-BF26aj7r.js";import{B as _}from"./button-CKEM3eQL.js";import{d as Le,c as We,a as Ke,D as Ge,g as qe,f as Ye}from"./dialog-CDtau8Kt.js";import{b as J,D as Z,a as ee,c as E}from"./dropdown-menu-wWS-zaMN.js";import{a as Qe,F as h,b as g,c as x,d as j,f}from"./form-V7XQlTI9.js";import{i as te}from"./DotsVertical-DBgin8Gd.js";import{f as Je,e as Ze,s as z}from"./registry-utils-C5W-BZ_1.js";import{i as et}from"./Loading01-CXxLrMyp.js";import{i as tt}from"./Terminal-C6oII67o.js";import{s as ne}from"./Trash01-pQsQJfD7.js";import{I as k}from"./input-B_S0H_Hl.js";import{S as nt,a as ot,b as st,c as rt,d as P}from"./select-H2esePZI.js";import{T as it}from"./textarea-CC9KHQpw.js";import{g as at}from"./generate-id-Dyweu44Y.js";import{a as ct}from"./use-tool-call-BSVniqlJ.js";import{c as lt}from"./connection-iGG9vveH.js";import{i as dt,r as mt,E as ut,e as re}from"./env-vars-editor-C51mNjyA.js";import"./collection-display-button-BRmjKmXA.js";import"./ArrowUp-Cb5IgbXf.js";import"./Check-D_y2LGJG.js";import"./Grid01-CPcgzk-j.js";import"./List-vJTsFkGC.js";import"./tooltip-DixY1Sbc.js";import"./view-mode-toggle-CoxeG-5F.js";import"./SearchMd-B72GLhSo.js";import"./card-2L27xRvH.js";import"./use-collections-S6OVeMx0.js";import"./useMutation-DXyBs08e.js";import"./binder-CZMsXyzM.js";import"./use-mobile-Bh6onNnL.js";import"./X-Ta7e64fd.js";import"./ChevronDown-CK8tBMwt.js";import"./useQuery-9rHAo5k0.js";import"./Plus-BwqRnIpw.js";const pt=se({key:y(),value:y()}),ht=se({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Ce(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function A(n){const s=n.trim();if(!s)return"";try{const i=new URL(s),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return s.replace(/\/+$/,"")}}function gt(n){const s=n.trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;const i=s[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const u=s.slice(1).find(a=>!a.startsWith("-"));return u?{packageName:u}:null}function $(n){const{uiType:s}=n,i=A(n.connectionUrl??"");if((s==="HTTP"||s==="SSE"||s==="Websocket")&&i===A("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=(n.npxPackage??"").trim();return s==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function oe(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const s=A(n.connectionUrl??"");if(!s)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===s));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",u=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:u}:null}function xt(n,s){const i={command:"npx",args:["-y",n]},d=re(s);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,s,i,d){const u={command:n};s.trim()&&(u.args=s.trim().split(/\s+/)),i?.trim()&&(u.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(u.envVars=a),u}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(s=>!s.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,s){switch(s.type){case"edit":return{mode:"editing",connection:s.connection};case"delete":return{mode:"deleting",connection:s.connection};case"close":return{mode:"idle"}}}function Ct(){const{org:n}=Ae(),s=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:u}=ye(),a=$e({namespace:n.slug,resource:"connections"}),I=Ie(),N=Ve(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=Ee(N)[0],F=R?.id??"",U=Je(R?.tools),ie=lt(F||void 0),{data:ae}=ct({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=Ze(ae??[]),L=i.action==="create",ce=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},W=()=>{s({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=ve({resolver:_e(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),m=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),D=$({uiType:m,connectionUrl:K??"",npxPackage:le??""})??oe({uiType:m,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=dt(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const o=mt(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const c=vt(t);r.reset({title:l.title,description:l.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:o})}}else r.reset({title:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.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:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},me=async t=>{let o,c=null,T=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,c=t.connection_url||"",T=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:c,...T&&{connection_token:T},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const w=at("conn");await I.create.mutateAsync({id:w,title:t.title,description:t.description||null,connection_type:o,connection_url:c,connection_token:T,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),W(),r.reset(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:w}})},G=t=>{t||(L?W():S({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const c=!!r.formState.dirtyFields.title,T=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,w=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!T&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(b=>b.key)),Y=p.envVarKeys.filter(b=>!he.has(b));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},H=gt(o);if(H&&u){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),w($({uiType:"NPX",npxPackage:H.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=m==="HTTP"||m==="SSE"||m==="Websocket"?m:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),w($({uiType:p,connectionUrl:o})??oe({uiType:p,connectionUrl:o,registryItems:X}));return}m==="NPX"&&w($({uiType:"NPX",npxPackage:o}))},ue=[{id:"icon",header:"",render:t=>e.jsx(be,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const o=t.connection_url??"",c=o.length>40?`${o.slice(0,40)}...`:o;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:t=>e.jsx(Xe,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(Se,{children:[e.jsx(Le,{open:L||v.mode==="editing",onOpenChange:G,children:e.jsxs(We,{className:"sm:max-w-[525px]",children:[e.jsxs(Ke,{children:[e.jsx(Ge,{children:l?"Edit Connection":"Create Connection"}),e.jsx(qe,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Qe,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(me),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(nt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(ot,{children:e.jsx(st,{})})}),e.jsxs(rt,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),u&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(tt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),m==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),m==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{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(f,{})]})})]}),(m==="NPX"||m==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(ut,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),m!=="NPX"&&m!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const c=o.clipboardData.getData("text");c&&(o.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:D?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.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(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(it,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Ye,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Fe,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(He,{children:[e.jsxs(Oe,{children:[e.jsx(Be,{children:"Delete Connection?"}),e.jsxs(ze,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Me,{children:[e.jsx(Re,{children:"Cancel"}),e.jsx(Ue,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Ne,{title:"Connections",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:"status",label:"Status"}],ctaButton:pe}),e.jsx(Te,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(B,{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(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),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(De,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(E,{onClick:o=>{o.stopPropagation(),s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs(E,{variant:"destructive",onClick:o=>{o.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(we,{columns:ue,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>s({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(B,{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(B,{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(_,{variant:"outline",onClick:()=>s({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function jn(){const n=ge.c(1);let s;return n[0]===Symbol.for("react.memo_cache_sentinel")?(s=e.jsx(Pe,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(et,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=s):s=n[0],s}export{jn as default};
@@ -0,0 +1 @@
1
+ import{aJ as a,bm as t}from"./index-H8waGLZX.js";const e="mcp.mesh",s=a(t,{target:"draft-7"});export{s as B,e as M};
@@ -1 +1 @@
1
- import{y as A,z as D,c as O,B as v,E,j as r,a as N}from"./index-ZiFjEqyT.js";import{A as I,a as M,b as B,c as L,d as R,e as T,f as $}from"./alert-dialog-Df8ZsItX.js";import{B as V}from"./button-Co_HOc3E.js";import{F as k,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-ChO7tWCF.js";import{I as P}from"./input-DEsmZ6es.js";import{S as Q}from"./spinner-DqooIng7.js";import{u as W}from"./useMutation-4fnzP4bc.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 z;e[1]===Symbol.for("react.memo_cache_sentinel")?(z={mutationFn:Z,onSuccess:Y},e[1]=z):z=e[1];const i=W(z),w=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(B,{children:[r.jsx(L,{children:"Create a new organization"}),r.jsx(R,{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(k,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==w?(c=w&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:w}),e[13]=w,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(V,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs(T,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx($,{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{y as A,z as D,c as O,B as v,E,j as r,a as N}from"./index-H8waGLZX.js";import{A as I,a as M,b as B,c as L,d as R,e as T,f as $}from"./alert-dialog-CwDNNTWs.js";import{B as V}from"./button-CKEM3eQL.js";import{F as k,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-V7XQlTI9.js";import{I as P}from"./input-B_S0H_Hl.js";import{S as Q}from"./spinner-BZhaf6l_.js";import{u as W}from"./useMutation-DXyBs08e.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 z;e[1]===Symbol.for("react.memo_cache_sentinel")?(z={mutationFn:Z,onSuccess:Y},e[1]=z):z=e[1];const i=W(z),w=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(B,{children:[r.jsx(L,{children:"Create a new organization"}),r.jsx(R,{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(k,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==w?(c=w&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:w}),e[13]=w,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(V,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs(T,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let p;e[34]!==t||e[35]!==h?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx($,{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 n,j as i,R as u,C as m,T as x,D as j,P as N,O as D,a$ as b,g as p}from"./index-ZiFjEqyT.js";import{i as h}from"./X-D09jV0HO.js";import{c}from"./button-Co_HOc3E.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(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(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 y(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(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(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($,{}),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(y,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=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]=g):g=e[14],g}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("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 P(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 B(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 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("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{B as D,O as a,T as b,R as c,k as d,w as e,P as f,E as g};
1
+ import{c as n,j as i,R as u,C as m,T as x,D as j,P as N,O as D,a$ as b,g as p}from"./index-H8waGLZX.js";import{i as h}from"./X-Ta7e64fd.js";import{c}from"./button-CKEM3eQL.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(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(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 y(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(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(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($,{}),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(y,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=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]=g):g=e[14],g}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("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 P(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 B(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 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("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{B as D,O as a,T as b,R as c,k as d,w as e,P as f,E as g};
@@ -1 +1 @@
1
- import{c,j as i,bv as p,bw as f,bx as m,by as g,bz as b,bA as x,bB as v,bC as w,bD as h}from"./index-ZiFjEqyT.js";import{i as j}from"./Grid01-BgBQwtBY.js";import{c as u}from"./button-Co_HOc3E.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 M(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 $(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 y(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(b,{"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 _(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(x,{"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(v,{"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{M as D,$ as a,S as b,y as c,_ as d,C as e,T as f,R as g};
1
+ import{c,j as i,bv as p,bw as f,bx as m,by as g,bz as b,bA as x,bB as v,bC as w,bD as h}from"./index-H8waGLZX.js";import{i as j}from"./Grid01-CPcgzk-j.js";import{c as u}from"./button-CKEM3eQL.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 M(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 $(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 y(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(b,{"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 _(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(x,{"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(v,{"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{M as D,$ as a,S as b,y as c,_ as d,C as e,T as f,R as g};
@@ -0,0 +1 @@
1
+ import{c as I,d as P,a as O,j as n,bE as N,r as b,w as H,Q as R}from"./index-H8waGLZX.js";import{i as _}from"./Loading01-CXxLrMyp.js";import{a as T}from"./binder-CZMsXyzM.js";import{u as A}from"./use-connection-C_QQYkok.js";import{L as $,u as D}from"./localstorage-keys-bcceq1xC.js";import{u as G}from"./project-context-provider-DTbOrAFq.js";import{c as K}from"./connection-iGG9vveH.js";import"./use-collections-S6OVeMx0.js";import"./useMutation-DXyBs08e.js";import"./useQuery-9rHAo5k0.js";function Q(e,t){return e?e.filter(d=>T(d,t)):[]}function L(e){return{id:e.id,title:e.title,icon:e.icon,description:e.description,app_name:e.app_name,app_id:e.app_id,tools:e.tools,metadata:e.metadata}}function Y(e){const t=I.c(13),{binding:d,renderHeader:m,renderEmptyState:s}=e,{org:l}=G();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{pluginId:a}=P(r),i=A(),{data:o}=O.useSession(),p=Q(i,d);let x;t[1]!==l.slug||t[2]!==a?(x=$.pluginConnection(l.slug,a),t[1]=l.slug,t[2]=a,t[3]=x):x=t[3];const[y,w]=D(x,q);let g;t[4]!==y?(g=f=>f.id===y,t[4]=y,t[5]=g):g=t[5];const u=p.find(g)??p[0]??null,v=o?.user?{user:{id:o.user.id,name:o.user.name,email:o.user.email,image:o.user.image}}:null,E={id:l.id,slug:l.slug,name:l.name};if(p.length===0||!u){const f={connectionId:null,connection:null,toolCaller:null,org:E,session:v};let c;t[6]!==s?(c=s(),t[6]=s,t[7]=c):c=t[7];let C;return t[8]!==c?(C=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),t[8]=c,t[9]=C):C=t[9],n.jsx(N,{value:f,children:C})}const k=K(u.id),z={connectionId:u.id,connection:L(u),toolCaller:((f,c)=>k(f,c)),org:E,session:v},B="h-full flex flex-col overflow-hidden",S=m({connections:p.map(L),selectedConnectionId:u.id,onConnectionChange:w});let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(b.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(H,{})})}),t[10]=h):h=t[10];let j;return t[11]!==S?(j=n.jsxs("div",{className:B,children:[S,h]}),t[11]=S,t[12]=j):j=t[12],n.jsx(N,{value:z,children:j})}function q(e){return e??""}function se(){const e=I.c(12);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{pluginId:d}=P(t);let m;e[1]!==d?(m=R.find(i=>i.id===d),e[1]=d,e[2]=m):m=e[2];const s=m;if(s?.renderHeader&&s?.renderEmptyState){let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=i):i=e[3];let o;return e[4]!==s.binding||e[5]!==s.renderEmptyState||e[6]!==s.renderHeader?(o=n.jsx(b.Suspense,{fallback:i,children:n.jsx(Y,{binding:s.binding,renderHeader:s.renderHeader,renderEmptyState:s.renderEmptyState})}),e[4]=s.binding,e[5]=s.renderEmptyState,e[6]=s.renderHeader,e[7]=o):o=e[7],o}const l=s?.LayoutComponent;if(!l){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(H,{}),e[8]=i):i=e[8],i}let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(_,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[9]=r):r=e[9];let a;return e[10]!==l?(a=n.jsx(b.Suspense,{fallback:r,children:n.jsx(l,{})}),e[10]=l,e[11]=a):a=e[11],a}export{se as default};
@@ -1 +1 @@
1
- import{c as p,j as t}from"./index-ZiFjEqyT.js";import{B as j,c as b}from"./button-Co_HOc3E.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=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]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,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]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
1
+ import{c as p,j as t}from"./index-H8waGLZX.js";import{B as j,c as b}from"./button-CKEM3eQL.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=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]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,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]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
@@ -1 +1 @@
1
- import{r as y,c as C,j as l}from"./index-ZiFjEqyT.js";import{c as I}from"./button-Co_HOc3E.js";const _=({size:o=24,color:e="currentColor",...t})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},y.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));_.displayName="Container";const L={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},$={"2xs":8,xs:12,sm:16,md:24,lg:32};function R(o){const e=C.c(7),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,g=t??"no-icon";let s;return e[0]!==a||e[1]!==m||e[2]!==t||e[3]!==r||e[4]!==n||e[5]!==g?(s=l.jsx(M,{icon:t,name:r,size:n,className:a,fallbackIcon:m},g),e[0]=a,e[1]=m,e[2]=t,e[3]=r,e[4]=n,e[5]=g,e[6]=s):s=e[6],s}function M(o){const e=C.c(24),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,[g,s]=y.useState(!1),j=!!t&&g,d=L[n],f=z[n];let c;e[0]!==a||e[1]!==d||e[2]!==f?(c=I("rounded-lg border border-border shrink-0 overflow-hidden",d,f,a),e[0]=a,e[1]=d,e[2]=f,e[3]=c):c=e[3];const x=t||void 0,u=!j&&"hidden";let i;e[4]!==u?(i=I("h-full w-full object-cover",u),e[4]=u,e[5]=i):i=e[5];let p,E;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=()=>s(!1),E=()=>s(!0),e[6]=p,e[7]=E):(p=e[6],E=e[7]);let N;e[8]!==r||e[9]!==x||e[10]!==i?(N=l.jsx("img",{src:x,alt:r,className:i,onError:p,onLoad:E}),e[8]=r,e[9]=x,e[10]=i,e[11]=N):N=e[11];const k=j&&"hidden";let w;e[12]!==k?(w=I("h-full w-full flex items-center justify-center bg-muted/20",k),e[12]=k,e[13]=w):w=e[13];let v;e[14]!==m||e[15]!==n?(v=m??l.jsx(_,{size:$[n],className:"text-muted-foreground"}),e[14]=m,e[15]=n,e[16]=v):v=e[16];let S;e[17]!==w||e[18]!==v?(S=l.jsx("div",{className:w,children:v}),e[17]=w,e[18]=v,e[19]=S):S=e[19];let b;return e[20]!==N||e[21]!==S||e[22]!==c?(b=l.jsxs("div",{className:c,children:[N,S]}),e[20]=N,e[21]=S,e[22]=c,e[23]=b):b=e[23],b}function Z(){const o=C.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),o[0]=e):e=o[0],e}function W(o){const e=C.c(24),{image:t,title:r,description:h,actions:a,className:m,descriptionClassName:n,actionsClassName:g}=o;let s;e[0]!==m?(s=I("flex flex-1 flex-col items-center justify-center gap-8 p-4",m),e[0]=m,e[1]=s):s=e[1];let j;e[2]!==t?(j=t!==null&&l.jsx("div",{className:"flex items-center justify-center",children:t??l.jsx(Z,{})}),e[2]=t,e[3]=j):j=e[3];let d;e[4]!==r?(d=l.jsx("h3",{className:"text-lg font-medium text-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let f;e[6]!==n?(f=I("text-sm text-muted-foreground text-center max-w-[300px]",n),e[6]=n,e[7]=f):f=e[7];let c;e[8]!==h||e[9]!==f?(c=l.jsx("div",{className:f,children:h}),e[8]=h,e[9]=f,e[10]=c):c=e[10];let x;e[11]!==d||e[12]!==c?(x=l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d,c]}),e[11]=d,e[12]=c,e[13]=x):x=e[13];let u;e[14]!==a||e[15]!==g?(u=a&&l.jsx("div",{className:I("flex items-center gap-2",g),children:a}),e[14]=a,e[15]=g,e[16]=u):u=e[16];let i;e[17]!==x||e[18]!==u?(i=l.jsxs("div",{className:"flex flex-col items-center gap-4",children:[x,u]}),e[17]=x,e[18]=u,e[19]=i):i=e[19];let p;return e[20]!==s||e[21]!==j||e[22]!==i?(p=l.jsxs("div",{className:s,children:[j,i]}),e[20]=s,e[21]=j,e[22]=i,e[23]=p):p=e[23],p}export{W as E,R as I,_ as n};
1
+ import{r as y,c as C,j as l}from"./index-H8waGLZX.js";import{c as I}from"./button-CKEM3eQL.js";const _=({size:o=24,color:e="currentColor",...t})=>y.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},y.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));_.displayName="Container";const L={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},$={"2xs":8,xs:12,sm:16,md:24,lg:32};function R(o){const e=C.c(7),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,g=t??"no-icon";let s;return e[0]!==a||e[1]!==m||e[2]!==t||e[3]!==r||e[4]!==n||e[5]!==g?(s=l.jsx(M,{icon:t,name:r,size:n,className:a,fallbackIcon:m},g),e[0]=a,e[1]=m,e[2]=t,e[3]=r,e[4]=n,e[5]=g,e[6]=s):s=e[6],s}function M(o){const e=C.c(24),{icon:t,name:r,size:h,className:a,fallbackIcon:m}=o,n=h===void 0?"md":h,[g,s]=y.useState(!1),j=!!t&&g,d=L[n],f=z[n];let c;e[0]!==a||e[1]!==d||e[2]!==f?(c=I("rounded-lg border border-border shrink-0 overflow-hidden",d,f,a),e[0]=a,e[1]=d,e[2]=f,e[3]=c):c=e[3];const x=t||void 0,u=!j&&"hidden";let i;e[4]!==u?(i=I("h-full w-full object-cover",u),e[4]=u,e[5]=i):i=e[5];let p,E;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=()=>s(!1),E=()=>s(!0),e[6]=p,e[7]=E):(p=e[6],E=e[7]);let N;e[8]!==r||e[9]!==x||e[10]!==i?(N=l.jsx("img",{src:x,alt:r,className:i,onError:p,onLoad:E}),e[8]=r,e[9]=x,e[10]=i,e[11]=N):N=e[11];const k=j&&"hidden";let w;e[12]!==k?(w=I("h-full w-full flex items-center justify-center bg-muted/20",k),e[12]=k,e[13]=w):w=e[13];let v;e[14]!==m||e[15]!==n?(v=m??l.jsx(_,{size:$[n],className:"text-muted-foreground"}),e[14]=m,e[15]=n,e[16]=v):v=e[16];let S;e[17]!==w||e[18]!==v?(S=l.jsx("div",{className:w,children:v}),e[17]=w,e[18]=v,e[19]=S):S=e[19];let b;return e[20]!==N||e[21]!==S||e[22]!==c?(b=l.jsxs("div",{className:c,children:[N,S]}),e[20]=N,e[21]=S,e[22]=c,e[23]=b):b=e[23],b}function Z(){const o=C.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=l.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),o[0]=e):e=o[0],e}function W(o){const e=C.c(24),{image:t,title:r,description:h,actions:a,className:m,descriptionClassName:n,actionsClassName:g}=o;let s;e[0]!==m?(s=I("flex flex-1 flex-col items-center justify-center gap-8 p-4",m),e[0]=m,e[1]=s):s=e[1];let j;e[2]!==t?(j=t!==null&&l.jsx("div",{className:"flex items-center justify-center",children:t??l.jsx(Z,{})}),e[2]=t,e[3]=j):j=e[3];let d;e[4]!==r?(d=l.jsx("h3",{className:"text-lg font-medium text-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let f;e[6]!==n?(f=I("text-sm text-muted-foreground text-center max-w-[300px]",n),e[6]=n,e[7]=f):f=e[7];let c;e[8]!==h||e[9]!==f?(c=l.jsx("div",{className:f,children:h}),e[8]=h,e[9]=f,e[10]=c):c=e[10];let x;e[11]!==d||e[12]!==c?(x=l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[d,c]}),e[11]=d,e[12]=c,e[13]=x):x=e[13];let u;e[14]!==a||e[15]!==g?(u=a&&l.jsx("div",{className:I("flex items-center gap-2",g),children:a}),e[14]=a,e[15]=g,e[16]=u):u=e[16];let i;e[17]!==x||e[18]!==u?(i=l.jsxs("div",{className:"flex flex-col items-center gap-4",children:[x,u]}),e[17]=x,e[18]=u,e[19]=i):i=e[19];let p;return e[20]!==s||e[21]!==j||e[22]!==i?(p=l.jsxs("div",{className:s,children:[j,i]}),e[20]=s,e[21]=j,e[22]=i,e[23]=p):p=e[23],p}export{W as E,R as I,_ as n};
@@ -1 +1 @@
1
- import{y as k,a3 as D,Z as v,z as t,Y as m,a0 as T,M as O,c as R,j as c}from"./index-ZiFjEqyT.js";import{B as z}from"./button-Co_HOc3E.js";import{I as N}from"./input-DEsmZ6es.js";import{s as W}from"./Plus-C4F6mby2.js";import{s as H}from"./Trash01-GrzirNvV.js";const U=k({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:v(t()),grantType:D(["authorization_code","client_credentials"])}),L=k({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),B=k({headers:m(t(),t()).optional()}),K=k({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:v(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),V=k({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:D(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:O([K,B]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:U.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:v(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:v(L).nullable().describe("Discovered tools from MCP"),bindings:v(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});V.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});V.partial();function G(r){return r!=null&&"command"in r}function M(r){const e=r.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 J(r){const e=R.c(34),{value:n,onChange:o,keyPlaceholder:j,valuePlaceholder:l,className:I}=r,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let x;e[0]!==o||e[1]!==n?(x=()=>{o([...n,{key:"",value:""}])},e[0]=o,e[1]=n,e[2]=x):x=e[2];const A=x;let w;e[3]!==o||e[4]!==n?(w=s=>{o(n.filter((u,i)=>i!==s))},e[3]=o,e[4]=n,e[5]=w):w=e[5];const b=w;let S;e[6]!==o||e[7]!==n?(S=(s,u)=>{const i=[...n],a=i[s];a&&(i[s]={key:u,value:a.value},o(i))},e[6]=o,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==o||e[10]!==n?(C=(s,u)=>{const i=[...n],a=i[s];a&&(i[s]={key:a.key,value:u},o(i))},e[9]=o,e[10]=n,e[11]=C):C=e[11];const y=C;let d;if(e[12]!==g||e[13]!==b||e[14]!==y||e[15]!==f||e[16]!==n||e[17]!==_){let s;e[19]!==g||e[20]!==b||e[21]!==y||e[22]!==f||e[23]!==_?(s=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(N,{placeholder:f,value:u.key,onChange:a=>g(i,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(N,{type:M(u.key)?"password":"text",placeholder:_,value:u.value,onChange:a=>y(i,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(z,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(i),children:c.jsx(H,{size:16})})]},i),e[19]=g,e[20]=b,e[21]=y,e[22]=f,e[23]=_,e[24]=s):s=e[24],d=n.map(s),e[12]=g,e[13]=b,e[14]=y,e[15]=f,e[16]=n,e[17]=_,e[18]=d}else d=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(W,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(z,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==d||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[d,p]}),e[28]=d,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function Q(r){const e={};for(const{key:n,value:o}of r)n.trim()&&(e[n.trim()]=o);return e}function X(r){return r?Object.entries(r).map(([e,n])=>({key:e,value:n})):[]}export{J as E,Q as e,G as i,X as r};
1
+ import{y as k,_ as D,I as v,z as t,J as m,aG as T,aK as O,c as R,j as c}from"./index-H8waGLZX.js";import{B as z}from"./button-CKEM3eQL.js";import{I as N}from"./input-B_S0H_Hl.js";import{s as W}from"./Plus-BwqRnIpw.js";import{s as H}from"./Trash01-pQsQJfD7.js";const U=k({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:v(t()),grantType:D(["authorization_code","client_credentials"])}),K=k({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),L=k({headers:m(t(),t()).optional()}),B=k({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:v(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),V=k({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:D(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:O([B,L]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:U.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:v(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:v(K).nullable().describe("Discovered tools from MCP"),bindings:v(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});V.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});V.partial();function Q(r){return r!=null&&"command"in r}function q(r){const e=r.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 X(r){const e=R.c(34),{value:n,onChange:o,keyPlaceholder:j,valuePlaceholder:l,className:I}=r,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let x;e[0]!==o||e[1]!==n?(x=()=>{o([...n,{key:"",value:""}])},e[0]=o,e[1]=n,e[2]=x):x=e[2];const A=x;let w;e[3]!==o||e[4]!==n?(w=s=>{o(n.filter((u,i)=>i!==s))},e[3]=o,e[4]=n,e[5]=w):w=e[5];const b=w;let S;e[6]!==o||e[7]!==n?(S=(s,u)=>{const i=[...n],a=i[s];a&&(i[s]={key:u,value:a.value},o(i))},e[6]=o,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==o||e[10]!==n?(C=(s,u)=>{const i=[...n],a=i[s];a&&(i[s]={key:a.key,value:u},o(i))},e[9]=o,e[10]=n,e[11]=C):C=e[11];const y=C;let d;if(e[12]!==g||e[13]!==b||e[14]!==y||e[15]!==f||e[16]!==n||e[17]!==_){let s;e[19]!==g||e[20]!==b||e[21]!==y||e[22]!==f||e[23]!==_?(s=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(N,{placeholder:f,value:u.key,onChange:a=>g(i,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(N,{type:q(u.key)?"password":"text",placeholder:_,value:u.value,onChange:a=>y(i,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(z,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(i),children:c.jsx(H,{size:16})})]},i),e[19]=g,e[20]=b,e[21]=y,e[22]=f,e[23]=_,e[24]=s):s=e[24],d=n.map(s),e[12]=g,e[13]=b,e[14]=y,e[15]=f,e[16]=n,e[17]=_,e[18]=d}else d=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(W,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(z,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==d||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[d,p]}),e[28]=d,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function Y(r){const e={};for(const{key:n,value:o}of r)n.trim()&&(e[n.trim()]=o);return e}function Z(r){return r?Object.entries(r).map(([e,n])=>({key:e,value:n})):[]}export{X as E,Y as e,Q as i,Z as r};
@@ -1 +1 @@
1
- import{r as o,j as e}from"./index-ZiFjEqyT.js";import{B as n}from"./button-Co_HOc3E.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-H8waGLZX.js";import{B as n}from"./button-CKEM3eQL.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{r as v}from"./index-ZiFjEqyT.js";import{M as D}from"./constants-B5NZDm4s.js";import{g as R}from"./github-icon-Dp3wHhYE.js";import{g as A}from"./registry-utils-DzI73csj.js";import{g as O}from"./generate-id-Dyweu44Y.js";const z=({size:e=24,color:r="currentColor",...c})=>v.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...c},v.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));z.displayName="CheckCircle";function H(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function L(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function B(e,r,c,i){const n=e.server,t=e._meta?.[D],m=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",C=n?.description||null,x=n?.icons?.[0]?.src||R(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,S=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,p=n?.packages??[],f=n?.remotes??[],w=i?.packageIndex??0,P=i?.remoteIndex??0,y=p.length>0&&i?.packageIndex!==void 0,a=y?p[w]:null,s=y?null:f[P];let l,u,h=null;if(a){const _=a.identifier||a.name;l="STDIO",u="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(l=A(s.type)||"HTTP",u=s.url||""):(l="HTTP",u="");const E=f.length>1,M=p.length>1;let d="";a&&M?d=` (${L(a)})`:s&&E&&(d=` (${H(s)})`);const U=b+d;return{id:O("conn"),title:U,description:C,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:l,connection_url:u,connection_token:null,connection_headers:h,oauth_config:I,configuration_state:N??null,configuration_scopes:S??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:m,updated_at:m,created_by:c,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{B as e,z as i};
1
+ import{r as v}from"./index-H8waGLZX.js";import{M as D}from"./constants-rLrKmanL.js";import{g as R}from"./github-icon-Dp3wHhYE.js";import{g as A}from"./registry-utils-C5W-BZ_1.js";import{g as O}from"./generate-id-Dyweu44Y.js";const z=({size:e=24,color:r="currentColor",...c})=>v.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...c},v.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));z.displayName="CheckCircle";function H(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function L(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function B(e,r,c,i){const n=e.server,t=e._meta?.[D],m=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",C=n?.description||null,x=n?.icons?.[0]?.src||R(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,S=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,p=n?.packages??[],f=n?.remotes??[],w=i?.packageIndex??0,P=i?.remoteIndex??0,y=p.length>0&&i?.packageIndex!==void 0,a=y?p[w]:null,s=y?null:f[P];let l,u,h=null;if(a){const _=a.identifier||a.name;l="STDIO",u="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(l=A(s.type)||"HTTP",u=s.url||""):(l="HTTP",u="");const E=f.length>1,M=p.length>1;let d="";a&&M?d=` (${L(a)})`:s&&E&&(d=` (${H(s)})`);const U=b+d;return{id:O("conn"),title:U,description:C,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:l,connection_url:u,connection_token:null,connection_headers:h,oauth_config:I,configuration_state:N??null,configuration_scopes:S??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:m,updated_at:m,created_by:c,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{B as e,z as i};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-CTAOtRDs.js","assets/index-ZiFjEqyT.js","assets/index-JAPwCHXJ.css","assets/button-Co_HOc3E.js","assets/AlertCircle-DlBo4Xw9.js","assets/Download01-Cnas0PSW.js","assets/File06-Dir7h2_j.js","assets/Image01-B8cj-qoF.js","assets/Loading01-Bq_7Os6T.js","assets/Trash01-GrzirNvV.js","assets/Upload01-Ba_zCXbQ.js","assets/useMutation-4fnzP4bc.js","assets/useQuery-Bn2Wcch_.js","assets/useInfiniteQuery-Dbq7IS1q.js","assets/infiniteQueryObserver-DEh2zauU.js","assets/checkbox-DGIT6WZ3.js","assets/Check-D4dBNJmC.js","assets/Grid01-BgBQwtBY.js","assets/Home02-CR-W2ctm.js","assets/List-hTdqyLGB.js"])))=>i.map(i=>d[i]);
2
- import{r as M,c as K,bK as J,bL as A,x as Y,j as t,t as B,aT as X,bJ as ee}from"./index-ZiFjEqyT.js";import{u as te}from"./useInfiniteQuery-Dbq7IS1q.js";import{B as _}from"./button-Co_HOc3E.js";import{C as D}from"./checkbox-DGIT6WZ3.js";import{i as se}from"./AlertCircle-DlBo4Xw9.js";import{c as H,i as ae}from"./Grid01-BgBQwtBY.js";import{n as ie}from"./Download01-Cnas0PSW.js";import{a as re}from"./Home02-CR-W2ctm.js";import{i as V}from"./List-hTdqyLGB.js";import{i as $}from"./Loading01-Bq_7Os6T.js";import{s as Q}from"./Trash01-GrzirNvV.js";import{i as U}from"./Upload01-Ba_zCXbQ.js";import{u as G}from"./useMutation-4fnzP4bc.js";const W=({size:s=24,color:e="currentColor",...a})=>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",...a},M.createElement("path",{d:"M14 11H8m2 4H8m8-8H8m12-.2v10.4c0 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 2h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C20 4.28 20 5.12 20 6.8Z"}));W.displayName="File02";const Z=({size:s=24,color:e="currentColor",...a})=>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",...a},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,a=!1,o=100)=>["object-storage","objects",s,e,{flat:a,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},oe=100;function ne(s){const e=K.c(30);let a;e[0]!==s?(a=s===void 0?{}:s,e[0]=s,e[1]=a):a=e[1];const o=a,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?oe:d,{connectionId:b,toolCaller:S}=J();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 i=>{const{pageParam:r}=i;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:he,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:w,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:z}=te(E);let v;if(l){let i;e[15]!==p?.pages?(i=p?.pages.flatMap(pe).filter(xe).map(ue)??[],e[15]=p?.pages,e[16]=i):i=e[16],v=i}else{let i;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(fe)??[],j=p?.pages.flatMap(ce)??[];i=[...r.sort(le),...j],e[17]=p?.pages,e[18]=i}else i=e[18];v=i}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,P=y??!1,F=z;let k;return e[23]!==g||e[24]!==w||e[25]!==C||e[26]!==v||e[27]!==F||e[28]!==P?(k={objects:v,isLoading:w,isFetchingMore:g,hasMore:P,loadMore:C,error:F},e[23]=g,e[24]=w,e[25]=C,e[26]=v,e[27]=F,e[28]=P,e[29]=k):k=e[29],k}function le(s,e){return s.key.localeCompare(e.key)}function ce(s){return s.objects.filter(me).map(de)}function de(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function me(s){return!s.key.endsWith("/")}function fe(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function ue(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function xe(s){return!s.key.endsWith("/")}function pe(s){return s.objects}function he(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function ge(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],a=1024,o=Math.floor(Math.log(s)/Math.log(a));return`${parseFloat((s/Math.pow(a,o)).toFixed(1))} ${e[o]}`}function je(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ye(s){const e=[],a=s.split("/").filter(Boolean);let o="";for(const n of a)o+=n+"/",e.push({name:n,path:o});return e}function $e(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 ve=M.lazy(()=>X(()=>import("./grid-view-CTAOtRDs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])));function Ne(s){const e=K.c(48),{item:a,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==a.key||e[1]!==c?(b=c?a.key:I(a.key),e[0]=a.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(D,{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]!==a.isFolder||e[7]!==a.key||e[8]!==d?(u=()=>a.isFolder?d(a.key):void 0,e[6]=a.isFolder,e[7]=a.key,e[8]=d,e[9]=u):u=e[9];const E=`flex items-center gap-2 flex-1 min-w-0 text-left ${a.isFolder?"cursor-pointer hover:text-primary":""}`;let p;e[10]!==a.isFolder?(p=a.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(W,{size:18,className:"text-muted-foreground shrink-0"}),e[10]=a.isFolder,e[11]=p):p=e[11];let w;e[12]!==S?(w=t.jsx("span",{className:"truncate",children:S}),e[12]=S,e[13]=w):w=e[13];let g;e[14]!==u||e[15]!==E||e[16]!==p||e[17]!==w?(g=t.jsxs("button",{type:"button",onClick:u,className:E,children:[p,w]}),e[14]=u,e[15]=E,e[16]=p,e[17]=w,e[18]=g):g=e[18];let y;e[19]!==a.isFolder||e[20]!==a.size?(y=a.isFolder?"-":ge(a.size),e[19]=a.isFolder,e[20]=a.size,e[21]=y):y=e[21];let h;e[22]!==y?(h=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:y}),e[22]=y,e[23]=h):h=e[23];let z;e[24]!==a.isFolder||e[25]!==a.lastModified?(z=a.isFolder?"-":je(a.lastModified),e[24]=a.isFolder,e[25]=a.lastModified,e[26]=z):z=e[26];let v;e[27]!==z?(v=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:z}),e[27]=z,e[28]=v):v=e[28];let N;e[29]!==a.isFolder||e[30]!==a.key||e[31]!==m?(N=!a.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(a.key),children:t.jsx(ie,{size:14})}),e[29]=a.isFolder,e[30]=a.key,e[31]=m,e[32]=N):N=e[32];let C;e[33]!==a.key||e[34]!==l?(C=()=>l(a.key),e[33]=a.key,e[34]=l,e[35]=C):C=e[35];let P;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Q,{size:14}),e[36]=P):P=e[36];let F;e[37]!==C?(F=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:C,children:P}),e[37]=C,e[38]=F):F=e[38];let k;e[39]!==N||e[40]!==F?(k=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[N,F]}),e[39]=N,e[40]=F,e[41]=k):k=e[41];let i;return e[42]!==h||e[43]!==v||e[44]!==k||e[45]!==f||e[46]!==g?(i=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,g,h,v,k]}),e[42]=h,e[43]=v,e[44]=k,e[45]=f,e[46]=g,e[47]=i):i=e[47],i}function q(s){const e=K.c(8),{prefix:a,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==a){const x=ye(a);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(re,{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:`hover:text-primary ${b===x.length-1?"font-medium text-foreground":"text-muted-foreground"}`,children:c.name})]},c.path))]}),e[0]=o,e[1]=a,e[2]=n}else n=e[2];return n}function be(){const{path:s="",flat:e=!1,view:a="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=i=>{x(new Set),o({to:"/",search:{path:i||void 0,flat:e,view:a}})},m=i=>{x(new Set),o({to:"/",search:{path:i?void 0:s||void 0,flat:i,view:a}})},l=i=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:i}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=J(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:w,loadMore:g,error:y}=ne({prefix:s,flat:e}),h=G({mutationFn:async i=>{const r=s+i.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:i.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:i=>{B.success(`Uploaded ${I(i)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Upload failed: ${i.message}`)}}),z=G({mutationFn:async i=>i.length===1&&i[0]?f("DELETE_OBJECT",{key:i[0]}):f("DELETE_OBJECTS",{keys:i}),onSuccess:()=>{B.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Delete failed: ${i.message}`)}}),v=async i=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:i}),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),L=document.createElement("a");L.href=O,L.download=I(i),document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(O)}catch(r){B.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=i=>{const r=i.target.files;if(r){for(const j of Array.from(r))h.mutate(j);i.target.value=""}},C=(i,r)=>{const j=new Set(n);r?j.add(i):j.delete(i),x(j)},P=i=>{x(i?new Set(u.map(r=>r.key)):new Set)},F=()=>{n.size!==0&&z.mutate(Array.from(n))},k=i=>{if(!w||p)return;const r=i.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})]}):a==="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(q,{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(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(_,{variant:a==="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($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{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($,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ve,{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(q,{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(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(_,{variant:a==="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:F,disabled:z.isPending,children:[t.jsx(Q,{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($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{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(D,{checked:n.size>0&&n.size===u.length,onCheckedChange:P}),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($,{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(U,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(i=>t.jsx(Ne,{item:i,selected:n.has(i.key),showFullPath:e,onSelect:r=>C(i.key,r),onNavigate:d,onDownload:v,onDelete:r=>z.mutate([r])},i.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx($,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const De=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{R as K,$e as a,De as b,ge as f,I as g,W as i,Z as s,ne as u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-D8luahOM.js","assets/index-H8waGLZX.js","assets/index-CCciYu2S.css","assets/button-CKEM3eQL.js","assets/AlertCircle-DOBZDZTf.js","assets/Download01-D480FrAl.js","assets/File06-Dss_qxDP.js","assets/Image01-CWiMChMV.js","assets/Loading01-CXxLrMyp.js","assets/Trash01-pQsQJfD7.js","assets/Upload01-CPXoheIk.js","assets/useMutation-DXyBs08e.js","assets/useQuery-9rHAo5k0.js","assets/useInfiniteQuery-BYo7uk8S.js","assets/infiniteQueryObserver-CorNdPTl.js","assets/checkbox-D-u8zfFA.js","assets/Check-D_y2LGJG.js","assets/Grid01-CPcgzk-j.js","assets/Home02-B2DfszMd.js","assets/List-vJTsFkGC.js"])))=>i.map(i=>d[i]);
2
+ import{r as M,c as K,bK as J,bL as A,x as Y,j as t,t as B,aT as X,bJ as ee}from"./index-H8waGLZX.js";import{u as te}from"./useInfiniteQuery-BYo7uk8S.js";import{B as _}from"./button-CKEM3eQL.js";import{C as D}from"./checkbox-D-u8zfFA.js";import{i as se}from"./AlertCircle-DOBZDZTf.js";import{c as H,i as ae}from"./Grid01-CPcgzk-j.js";import{n as ie}from"./Download01-D480FrAl.js";import{a as re}from"./Home02-B2DfszMd.js";import{i as V}from"./List-vJTsFkGC.js";import{i as $}from"./Loading01-CXxLrMyp.js";import{s as Q}from"./Trash01-pQsQJfD7.js";import{i as U}from"./Upload01-CPXoheIk.js";import{u as G}from"./useMutation-DXyBs08e.js";const W=({size:s=24,color:e="currentColor",...a})=>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",...a},M.createElement("path",{d:"M14 11H8m2 4H8m8-8H8m12-.2v10.4c0 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 2h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C20 4.28 20 5.12 20 6.8Z"}));W.displayName="File02";const Z=({size:s=24,color:e="currentColor",...a})=>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",...a},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,a=!1,o=100)=>["object-storage","objects",s,e,{flat:a,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},oe=100;function ne(s){const e=K.c(30);let a;e[0]!==s?(a=s===void 0?{}:s,e[0]=s,e[1]=a):a=e[1];const o=a,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?oe:d,{connectionId:b,toolCaller:S}=J();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 i=>{const{pageParam:r}=i;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:he,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:w,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:z}=te(E);let v;if(l){let i;e[15]!==p?.pages?(i=p?.pages.flatMap(pe).filter(xe).map(ue)??[],e[15]=p?.pages,e[16]=i):i=e[16],v=i}else{let i;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(fe)??[],j=p?.pages.flatMap(ce)??[];i=[...r.sort(le),...j],e[17]=p?.pages,e[18]=i}else i=e[18];v=i}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,P=y??!1,F=z;let k;return e[23]!==g||e[24]!==w||e[25]!==C||e[26]!==v||e[27]!==F||e[28]!==P?(k={objects:v,isLoading:w,isFetchingMore:g,hasMore:P,loadMore:C,error:F},e[23]=g,e[24]=w,e[25]=C,e[26]=v,e[27]=F,e[28]=P,e[29]=k):k=e[29],k}function le(s,e){return s.key.localeCompare(e.key)}function ce(s){return s.objects.filter(me).map(de)}function de(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function me(s){return!s.key.endsWith("/")}function fe(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function ue(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function xe(s){return!s.key.endsWith("/")}function pe(s){return s.objects}function he(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function ge(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],a=1024,o=Math.floor(Math.log(s)/Math.log(a));return`${parseFloat((s/Math.pow(a,o)).toFixed(1))} ${e[o]}`}function je(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ye(s){const e=[],a=s.split("/").filter(Boolean);let o="";for(const n of a)o+=n+"/",e.push({name:n,path:o});return e}function $e(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 ve=M.lazy(()=>X(()=>import("./grid-view-D8luahOM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])));function Ne(s){const e=K.c(48),{item:a,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==a.key||e[1]!==c?(b=c?a.key:I(a.key),e[0]=a.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(D,{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]!==a.isFolder||e[7]!==a.key||e[8]!==d?(u=()=>a.isFolder?d(a.key):void 0,e[6]=a.isFolder,e[7]=a.key,e[8]=d,e[9]=u):u=e[9];const E=`flex items-center gap-2 flex-1 min-w-0 text-left ${a.isFolder?"cursor-pointer hover:text-primary":""}`;let p;e[10]!==a.isFolder?(p=a.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(W,{size:18,className:"text-muted-foreground shrink-0"}),e[10]=a.isFolder,e[11]=p):p=e[11];let w;e[12]!==S?(w=t.jsx("span",{className:"truncate",children:S}),e[12]=S,e[13]=w):w=e[13];let g;e[14]!==u||e[15]!==E||e[16]!==p||e[17]!==w?(g=t.jsxs("button",{type:"button",onClick:u,className:E,children:[p,w]}),e[14]=u,e[15]=E,e[16]=p,e[17]=w,e[18]=g):g=e[18];let y;e[19]!==a.isFolder||e[20]!==a.size?(y=a.isFolder?"-":ge(a.size),e[19]=a.isFolder,e[20]=a.size,e[21]=y):y=e[21];let h;e[22]!==y?(h=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:y}),e[22]=y,e[23]=h):h=e[23];let z;e[24]!==a.isFolder||e[25]!==a.lastModified?(z=a.isFolder?"-":je(a.lastModified),e[24]=a.isFolder,e[25]=a.lastModified,e[26]=z):z=e[26];let v;e[27]!==z?(v=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:z}),e[27]=z,e[28]=v):v=e[28];let N;e[29]!==a.isFolder||e[30]!==a.key||e[31]!==m?(N=!a.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(a.key),children:t.jsx(ie,{size:14})}),e[29]=a.isFolder,e[30]=a.key,e[31]=m,e[32]=N):N=e[32];let C;e[33]!==a.key||e[34]!==l?(C=()=>l(a.key),e[33]=a.key,e[34]=l,e[35]=C):C=e[35];let P;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Q,{size:14}),e[36]=P):P=e[36];let F;e[37]!==C?(F=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:C,children:P}),e[37]=C,e[38]=F):F=e[38];let k;e[39]!==N||e[40]!==F?(k=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[N,F]}),e[39]=N,e[40]=F,e[41]=k):k=e[41];let i;return e[42]!==h||e[43]!==v||e[44]!==k||e[45]!==f||e[46]!==g?(i=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,g,h,v,k]}),e[42]=h,e[43]=v,e[44]=k,e[45]=f,e[46]=g,e[47]=i):i=e[47],i}function q(s){const e=K.c(8),{prefix:a,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==a){const x=ye(a);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(re,{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:`hover:text-primary ${b===x.length-1?"font-medium text-foreground":"text-muted-foreground"}`,children:c.name})]},c.path))]}),e[0]=o,e[1]=a,e[2]=n}else n=e[2];return n}function be(){const{path:s="",flat:e=!1,view:a="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=i=>{x(new Set),o({to:"/",search:{path:i||void 0,flat:e,view:a}})},m=i=>{x(new Set),o({to:"/",search:{path:i?void 0:s||void 0,flat:i,view:a}})},l=i=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:i}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=J(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:w,loadMore:g,error:y}=ne({prefix:s,flat:e}),h=G({mutationFn:async i=>{const r=s+i.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:i.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:i,headers:{"Content-Type":i.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:i=>{B.success(`Uploaded ${I(i)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Upload failed: ${i.message}`)}}),z=G({mutationFn:async i=>i.length===1&&i[0]?f("DELETE_OBJECT",{key:i[0]}):f("DELETE_OBJECTS",{keys:i}),onSuccess:()=>{B.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:i=>{B.error(`Delete failed: ${i.message}`)}}),v=async i=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:i}),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),L=document.createElement("a");L.href=O,L.download=I(i),document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(O)}catch(r){B.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=i=>{const r=i.target.files;if(r){for(const j of Array.from(r))h.mutate(j);i.target.value=""}},C=(i,r)=>{const j=new Set(n);r?j.add(i):j.delete(i),x(j)},P=i=>{x(i?new Set(u.map(r=>r.key)):new Set)},F=()=>{n.size!==0&&z.mutate(Array.from(n))},k=i=>{if(!w||p)return;const r=i.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})]}):a==="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(q,{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(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(_,{variant:a==="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($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{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($,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ve,{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(q,{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(D,{checked:!e,onCheckedChange:i=>m(!i)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(_,{variant:a==="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:F,disabled:z.isPending,children:[t.jsx(Q,{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($,{size:14,className:"mr-1 animate-spin"}):t.jsx(U,{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(D,{checked:n.size>0&&n.size===u.length,onCheckedChange:P}),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($,{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(U,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(i=>t.jsx(Ne,{item:i,selected:n.has(i.key),showFullPath:e,onSelect:r=>C(i.key,r),onNavigate:d,onDownload:v,onDelete:r=>z.mutate([r])},i.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx($,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const De=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{R as K,$e as a,De as b,ge as f,I as g,W as i,Z as s,ne as u};
@@ -1 +1 @@
1
- import{c as d,j as m,aQ as $,bf as j,bg as C,r as f,i as v,bh as N,bi as h}from"./index-ZiFjEqyT.js";import{c as u}from"./button-Co_HOc3E.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,b=f.createContext({}),E=t=>{const e=d.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 l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(b.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(b),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);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 n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,g=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=g,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.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 l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function L(t){const e=d.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:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function R(t){const e=d.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:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function Q(t){const e=d.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:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,S as L,D as a,M as b,L as c,P as d,R as e,Q as f};
1
+ import{c as d,j as m,aD as $,bf as j,bg as C,r as f,i as v,bh as N,bi as h}from"./index-H8waGLZX.js";import{c as u}from"./button-CKEM3eQL.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const y=j,b=f.createContext({}),E=t=>{const e=d.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 l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(b.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(b),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);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 n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,g=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=g,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.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 l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function L(t){const e=d.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:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function R(t){const e=d.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:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function k(t){const e=d.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:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,S as L,y as a,M as b,L as c,P as d,R as e,k as f};
@@ -0,0 +1 @@
1
+ import{r as S,_ as ye,y as re,I as U,z as _,c as R,j as t,f as Fe,d as tt,b as st,k as ot,af as lt,B as nt,E as it,t as Ae}from"./index-H8waGLZX.js";import{I as Ee,E as rt}from"./empty-state-CVNEuxZY.js";import{E as Ve}from"./error-boundary-Bcxx4rfP.js";import{C as Ge}from"./checkbox-D-u8zfFA.js";import{c as H,B as V}from"./button-CKEM3eQL.js";import{i as at}from"./ArrowLeft-CiX5attk.js";import{u as We}from"./use-connection-C_QQYkok.js";import{C as ct}from"./collection-search-B1XW3AZu.js";import{I as Pe}from"./input-B_S0H_Hl.js";import{s as dt}from"./Plus-BwqRnIpw.js";import{i as mt}from"./X-Ta7e64fd.js";import{P as ut}from"./pin-to-sidebar-button-NqMT4AF7.js";import{T as ft}from"./tool-set-selector-Cty6fXdH.js";import{b as ht,a as xt,i as pt}from"./use-gateway-DMJjVwlU.js";import{u as gt,a as bt}from"./use-connection-resources-h_CY6VEc.js";import{u as jt}from"./use-gateway-system-prompt-CfIIyZId.js";import{s as He}from"./slugify-CEUa2lfQ.js";import{B as qe}from"./badge-BF26aj7r.js";import{a as yt,D as vt,c as St,d as Nt}from"./dialog-CDtau8Kt.js";import{F as be,a as _t,b as ve,d as Se,f as Ne,c as wt}from"./form-V7XQlTI9.js";import{I as Ct,R as kt,a as It}from"./index-D93bwXlh.js";import{R as Tt}from"./resource-tabs-kfeiBQEL.js";import{S as $t,a as Rt,b as zt,c as At,d as Ue}from"./select-H2esePZI.js";import{S as Et}from"./switch-CIfCfD81.js";import{T as Pt}from"./textarea-CC9KHQpw.js";import{a as Z,c as Y,b as J,T as Q}from"./tooltip-DixY1Sbc.js";import{i as Ze}from"./Check-D_y2LGJG.js";import{i as Mt}from"./Code01-CHaKquD7.js";import{a as Dt}from"./Copy01-DEYUyyKa.js";import{i as Ut}from"./FlipBackward-C6tD49bS.js";import{i as je}from"./InfoCircle-C1Hk7qxK.js";import{i as ze}from"./Loading01-CXxLrMyp.js";import{a as Lt,V as Ot,b as Bt}from"./layout-CSDcjZIC.js";import"./connection-iGG9vveH.js";import"./project-context-provider-DTbOrAFq.js";import"./use-collections-S6OVeMx0.js";import"./useMutation-DXyBs08e.js";import"./SearchMd-B72GLhSo.js";import"./use-organization-settings-C4u9V1Gg.js";import"./localstorage-keys-bcceq1xC.js";import"./useQuery-9rHAo5k0.js";import"./ChevronDown-CK8tBMwt.js";const Ye=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));Ye.displayName="ArrowsRight";const Je=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}));Je.displayName="Circle";const Qe=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));Qe.displayName="Lightbulb02";const Ke=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));Ke.displayName="Save01";const Xe=({size:o=24,color:e="currentColor",...s})=>S.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},S.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));Xe.displayName="Share07";const Me=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ft=re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:U(_()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:U(_()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Vt=re({id:_().describe("Unique identifier for the gateway"),title:_().describe("Human-readable name for the gateway"),description:_().nullable().describe("Description of the gateway"),icon:_().nullable().optional().describe("Icon URL for the gateway"),created_at:_().describe("When the gateway was created"),updated_at:_().describe("When the gateway was last updated"),created_by:_().describe("User ID who created the gateway"),updated_by:_().optional().describe("User ID who last updated the gateway"),organization_id:_().describe("Organization ID this gateway belongs to"),tool_selection_mode:Me.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),connections:U(Ft).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});re({title:_().min(1).max(255).describe("Name for the gateway"),description:_().nullable().optional().describe("Optional description"),tool_selection_mode:Me.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:_().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});re({title:_().min(1).max(255).optional().describe("New name"),description:_().nullable().optional().describe("New description (null to clear)"),tool_selection_mode:Me.optional().describe("New tool selection mode"),icon:_().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),connections:U(re({connection_id:_().describe("Connection ID"),selected_tools:U(_()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(_()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(_()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Gt=S.memo(function(e){const s=R.c(20),{connection:l,isSelected:i,hasItemsEnabled:n,activeItemsCount:a,totalItemsCount:c,onSelect:m,onToggle:r}=e,d=i?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==d?(u=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),s[0]=d,s[1]=u):u=s[1];let f;s[2]!==l.icon||s[3]!==l.title?(f=t.jsx(Ee,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=f):f=s[4];let p;s[5]!==l.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=p):p=s[6];let x;s[7]!==m||s[8]!==f||s[9]!==p?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[f,p]}),s[7]=m,s[8]=f,s[9]=p,s[10]=x):x=s[10];let g;s[11]!==a||s[12]!==n||s[13]!==r||s[14]!==c?(g=c>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[a,"/",c]}),t.jsx(Ge,{checked:n,onCheckedChange:r,onClick:Ht})]}),s[11]=a,s[12]=n,s[13]=r,s[14]=c,s[15]=g):g=s[15];let y;return s[16]!==u||s[17]!==x||s[18]!==g?(y=t.jsxs("div",{className:u,children:[x,g]}),s[16]=u,s[17]=x,s[18]=g,s[19]=y):y=s[19],y}),Wt=S.memo(function(e){const s=R.c(18),{connectionId:l,item:i,isSelected:n,onToggle:a}=e,c=`item-${l}-${i.id}`,m=n?"text-foreground":"text-muted-foreground";let r;s[0]!==m?(r=H("text-sm font-medium",m),s[0]=m,s[1]=r):r=s[1];let d;s[2]!==i.name||s[3]!==r?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:i.name})}),s[2]=i.name,s[3]=r,s[4]=d):d=s[4];let u;s[5]!==i.description?(u=i.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.description}),s[5]=i.description,s[6]=u):u=s[6];let f;s[7]!==d||s[8]!==u?(f=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),s[7]=d,s[8]=u,s[9]=f):f=s[9];const p=`item-${l}-${i.id}`;let x;s[10]!==n||s[11]!==a||s[12]!==p?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Ge,{id:p,checked:n,onCheckedChange:a,onClick:qt})}),s[10]=n,s[11]=a,s[12]=p,s[13]=x):x=s[13];let g;return s[14]!==c||s[15]!==f||s[16]!==x?(g=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:c,children:[f,x]}),s[14]=c,s[15]=f,s[16]=x,s[17]=g):g=s[17],g});function et({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:i,extraContent:n}){const[a,c]=S.useState(""),m=S.useDeferredValue(a),[r,d]=S.useState("all"),[u,f]=S.useState(!1),p=S.useRef(new Set(Object.keys(o))),x=We({searchTerm:m.trim()||void 0}),g=p.current,y=[...g.values()].map(h=>x.find(N=>N.id===h)).filter(h=>h!==void 0),j=x.filter(h=>!g.has(h.id)),v=[...y,...j],b=h=>{const N=o[h];return N!==void 0&&N.length>0},w=v.filter(h=>{if(r==="all")return!0;const N=b(h.id);return r==="selected"?N:r==="unselected"?!N:!0}),[I,k]=S.useState(v[0]?.id??null),C=I?v.find(h=>h.id===I)??null:null,P=C?s(C):[],E=(h,N)=>o[h]?.includes(N)??!1,L=(h,N)=>{const z=o[h]??[],$=z.includes(N),G={...o};if($){const W=z.filter(q=>q!==N);W.length===0?delete G[h]:G[h]=W}else G[h]=[...z,N];e(G)},B=h=>{const N=v.find(F=>F.id===h);if(!N)return;const z=s(N);if(z.length===0)return;const $=o[h]??[],G=z.map(F=>F.id),W=$.length>0&&G.every(F=>$.includes(F)),q={...o};W?delete q[h]:(q[h]=G,k(h)),e(q)},A=h=>{k(h),f(!0)},M=()=>{f(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(ct,{value:a,onChange:c,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>d("all"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>d("selected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>d("unselected"),className:H("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:w.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:a?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:w.map(h=>{const z=s(h).length,$=o[h.id]?.length??0;return t.jsx(Gt,{connection:h,isSelected:I===h.id,hasItemsEnabled:b(h.id),activeItemsCount:$,totalItemsCount:z,onSelect:()=>A(h.id),onToggle:()=>B(h.id)},h.id)})})})]}),t.jsx("div",{className:H("flex-1 flex-col",u?"flex":"hidden md:flex"),children:C?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(V,{variant:"ghost",size:"sm",onClick:M,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(at,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Ee,{icon:C.icon,name:C.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:C.description})]})]})]}),n,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:P.map(h=>t.jsx(Wt,{connectionId:C.id,item:h,isSelected:E(C.id,h.id),onToggle:()=>L(C.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",l]})})})]})}function Ht(o){return o.stopPropagation()}function qt(o){return o.stopPropagation()}function Zt(o){const e=R.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:i}=o;let n;e[0]!==i?(n=m=>(i.get(m.id)??[]).map(Yt),e[0]=i,e[1]=n):n=e[1];const a=n;let c;return e[2]!==a||e[3]!==l||e[4]!==s?(c=t.jsx(et,{itemSet:s,onItemSetChange:l,getItems:a,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=a,e[3]=l,e[4]=s,e[5]=c):c=e[5],c}function Yt(o){return{id:o.name,name:o.name,description:o.description}}function Jt(o){return o.includes("*")}function Qt(o){const e=R.c(27),{patterns:s,onAddPattern:l,onRemovePattern:i}=o,[n,a]=S.useState("");let c;e[0]!==n||e[1]!==l||e[2]!==s?(c=()=>{const f=n.trim();f&&!s.includes(f)&&(l(f),a(""))},e[0]=n,e[1]=l,e[2]=s,e[3]=c):c=e[3];const m=c;let r;e[4]!==m?(r=f=>{f.key==="Enter"&&(f.preventDefault(),m())},e[4]=m,e[5]=r):r=e[5];const d=r;let u;if(e[6]!==m||e[7]!==d||e[8]!==n||e[9]!==i||e[10]!==s){const f=s.filter(Jt);let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("code",{children:"*"}),e[12]=p):p=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",p," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=x):x=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=k=>a(k.target.value),e[14]=g):g=e[14];let y;e[15]!==d||e[16]!==n?(y=t.jsx(Pe,{value:n,onChange:g,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=n,e[17]=y):y=e[17];let j;e[18]!==n?(j=n.trim(),e[18]=n,e[19]=j):j=e[19];const v=!j;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(dt,{size:16}),e[20]=b):b=e[20];let w;e[21]!==m||e[22]!==v?(w=t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:v,children:b}),e[21]=m,e[22]=v,e[23]=w):w=e[23];let I;e[24]!==w||e[25]!==y?(I=t.jsxs("div",{className:"flex gap-2",children:[y,w]}),e[24]=w,e[25]=y,e[26]=I):I=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,I,f.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(k=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:k}),t.jsx("button",{type:"button",onClick:()=>i(k),className:"text-muted-foreground hover:text-foreground",children:t.jsx(mt,{size:12})})]},k))})]}),e[6]=m,e[7]=d,e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];return u}function Kt(o){const e=R.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:i}=o,[n]=S.useState(null);let a;e[0]!==i?(a=b=>(i.get(b.id)??[]).map(Xt),e[0]=i,e[1]=a):a=e[1];const c=a;let m;e[2]!==l||e[3]!==s?(m=(b,w)=>{const I=s[b]??[];I.includes(w)||l({...s,[b]:[...I,w]})},e[2]=l,e[3]=s,e[4]=m):m=e[4];const r=m;let d;e[5]!==l||e[6]!==s?(d=(b,w)=>{const k=(s[b]??[]).filter(C=>C!==w);if(k.length===0){const C={...s};delete C[b],l(C)}else l({...s,[b]:k})},e[5]=l,e[6]=s,e[7]=d):d=e[7];const u=d;let f;e[8]!==l?(f=b=>{l(b)},e[8]=l,e[9]=f):f=e[9];const p=f;let x;e[10]!==s||e[11]!==n?(x=n?s[n]??[]:[],e[10]=s,e[11]=n,e[12]=x):x=e[12];const g=x;let y;e[13]!==r||e[14]!==u||e[15]!==n||e[16]!==g?(y=n?t.jsx(Qt,{patterns:g,onAddPattern:b=>r(n,b),onRemovePattern:b=>u(n,b)}):null,e[13]=r,e[14]=u,e[15]=n,e[16]=g,e[17]=y):y=e[17];const j=y;let v;return e[18]!==j||e[19]!==c||e[20]!==p||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(et,{itemSet:s,onItemSetChange:p,getItems:c,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:j})}),e[18]=j,e[19]=c,e[20]=p,e[21]=s,e[22]=v):v=e[22],v}function Xt(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function es(o){const e=R.c(8);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("grid gap-3",s),e[3]=s,e[4]=i):i=e[4];let n;return e[5]!==l||e[6]!==i?(n=t.jsx(kt,{"data-slot":"radio-group",className:i,...l}),e[5]=l,e[6]=i,e[7]=n):n=e[7],n}function Re(o){const e=R.c(9);let s,l;e[0]!==o?({className:s,...l}=o,e[0]=o,e[1]=s,e[2]=l):(s=e[1],l=e[2]);let i;e[3]!==s?(i=H("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",s),e[3]=s,e[4]=i):i=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(It,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(Je,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=n):n=e[5];let a;return e[6]!==l||e[7]!==i?(a=t.jsx(Ct,{"data-slot":"radio-group-item",className:i,...l,children:n}),e[6]=l,e[7]=i,e[8]=a):a=e[8],a}function ts(o){const s=new TextEncoder().encode(o),l=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(l)}const ss=Vt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0}).extend({title:_().min(1,"Name is required").max(255)});function Le(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const i=e.get(l.connection_id)??[];i.length>0&&(s[l.connection_id]=i)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Oe(o){const e={};for(const s of o.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function Be(o){const e={};for(const s of o.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function os(o,e,s,l){const i=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(i).map(n=>{const a=o[n]??[],c=l.get(n)??[],m=c.length>0&&c.every(r=>a.includes(r));return{connection_id:n,selected_tools:a.length===0||m?null:a,selected_resources:e[n]??null,selected_prompts:s[n]??null}})}function ls(o){const e=R.c(10),{gatewayUrl:s}=o,[l,i]=S.useState(!1);let n;e[0]!==s?(n=async()=>{await navigator.clipboard.writeText(s),i(!0),Ae.success("Agent URL copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[0]=s,e[1]=n):n=e[1];const a=n;let c;e[2]!==l?(c=l?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx(Dt,{size:20}),e[2]=l,e[3]=c):c=e[3];const m=l?"Copied!":"Copy URL";let r;e[4]!==m?(r=t.jsx("span",{className:"text-xs font-medium",children:m}),e[4]=m,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==c||e[8]!==r?(d=t.jsxs(V,{type:"button",variant:"outline",onClick:a,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,r]}),e[6]=a,e[7]=c,e[8]=r,e[9]=d):d=e[9],d}function ns(o){const e=R.c(7),{gatewayUrl:s,serverName:l}=o;let i;e[0]!==s||e[1]!==l?(i=()=>{const r=He(l),u=ts(JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Cursor"}},null,2)),f=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(r)}&config=${encodeURIComponent(u)}`;window.open(f,"_blank"),Ae.success("Opening Cursor...")},e[0]=s,e[1]=l,e[2]=i):i=e[2];const n=i;let a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),c=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=a,e[4]=c):(a=e[3],c=e[4]);let m;return e[5]!==n?(m=t.jsxs(V,{type:"button",variant:"outline",onClick:n,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[a,c]}),e[5]=n,e[6]=m):m=e[6],m}function is(o){const e=R.c(11),{gatewayUrl:s,serverName:l}=o,[i,n]=S.useState(!1);let a;e[0]!==s||e[1]!==l?(a=async()=>{const f=He(l),x=JSON.stringify({type:"http",url:s,headers:{"x-mesh-client":"Claude Code"}},null,2),g=`claude mcp add "${f}" --config '${x.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(g),n(!0),Ae.success("Claude Code command copied to clipboard"),setTimeout(()=>n(!1),2e3)},e[0]=s,e[1]=l,e[2]=a):a=e[2];const c=a;let m;e[3]!==i?(m=i?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[3]=i,e[4]=m):m=e[4];const r=i?"Copied!":"Install on Claude";let d;e[5]!==r?(d=t.jsx("span",{className:"text-xs font-medium",children:r}),e[5]=r,e[6]=d):d=e[6];let u;return e[7]!==c||e[8]!==m||e[9]!==d?(u=t.jsxs(V,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,d]}),e[7]=c,e[8]=m,e[9]=d,e[10]=u):u=e[10],u}function rs(o){const e=R.c(40),{open:s,onOpenChange:l,gateway:i}=o,[n,a]=S.useState("code_execution");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=$=>{($==="passthrough"||$==="smart_tool_selection"||$==="code_execution")&&a($)},e[0]=c):c=e[0];const m=c;let r;e[1]!==i.id||e[2]!==n?(r=new URL(`/mcp/gateway/${i.id}`,window.location.origin),r.searchParams.set("mode",n),e[1]=i.id,e[2]=n,e[3]=r):r=e[3];let d;e[4]!==i.id||e[5]!==i.title?(d=i.title||`agent-${i.id.slice(0,8)}`,e[4]=i.id,e[5]=i.title,e[6]=d):d=e[6];const u=d;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(yt,{children:t.jsx(vt,{children:"Share Agent"})}),e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=p):p=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Ye,{className:"size-5 text-muted-foreground"})}),e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=g):g=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[11]=y):y=e[11];let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("label",{htmlFor:"mode-passthrough",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[x,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[g,t.jsx(Z,{children:t.jsxs(Y,{children:[y,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"All tools are exposed directly via tools/list. Best for small tool surfaces with deterministic behavior."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Best for small teams or when you need predictable behavior"})]}),t.jsx(Re,{id:"mode-passthrough",value:"passthrough"})]}),e[12]=j):j=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Qe,{className:"size-5 text-muted-foreground"})}),e[13]=v):v=e[13];let b;e[14]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=b):b=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[15]=w):w=e[15];let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsxs("label",{htmlFor:"mode-smart",className:"flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[v,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[b,t.jsx(Z,{children:t.jsxs(Y,{children:[w,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Uses meta-tools (GATEWAY_SEARCH_TOOLS, GATEWAY_DESCRIBE_TOOLS, GATEWAY_CALL_TOOL) to keep the tool list small and request details on demand."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Ideal for large teams with many tools - AI finds what it needs"})]}),t.jsx(Re,{id:"mode-smart",value:"smart_tool_selection"})]}),e[16]=I):I=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Mt,{className:"size-5 text-muted-foreground"})}),e[17]=k):k=e[17];let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=C):C=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[19]=P):P=e[19];let E;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs("label",{htmlFor:"mode-code",className:"relative flex items-center gap-3 px-3 py-5 rounded-lg border border-border hover:border-ring/50 cursor-pointer transition-colors has-checked:border-ring has-checked:bg-accent/5",children:[k,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[C,t.jsx(Z,{children:t.jsxs(Y,{children:[P,t.jsx(Q,{className:"max-w-xs",children:t.jsx("p",{className:"text-xs",children:"Exposes meta-tools for discovery + sandboxed execution (GATEWAY_RUN_CODE). Reduces overhead on large surfaces by shifting work into a controlled runtime."})})]})})]}),t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Maximum flexibility - AI can write code to orchestrate tools"})]}),t.jsx(Re,{id:"mode-code",value:"code_execution"}),t.jsx(qe,{variant:"outline",className:"absolute -top-2.5 left-1/2 -translate-x-1/2 bg-background z-10",children:"Recommended"})]}),e[20]=E):E=e[20];let L;e[21]!==n?(L=t.jsxs("div",{className:"flex flex-col gap-3",children:[p,t.jsxs(es,{value:n,onValueChange:m,className:"flex flex-col gap-4.5",children:[j,I,E]})]}),e[21]=n,e[22]=L):L=e[22];let B;e[23]!==r.href?(B=t.jsx(ls,{gatewayUrl:r.href}),e[23]=r.href,e[24]=B):B=e[24];let A,M;e[25]!==r.href||e[26]!==u?(A=t.jsx(ns,{gatewayUrl:r.href,serverName:u}),M=t.jsx(is,{gatewayUrl:r.href,serverName:u}),e[25]=r.href,e[26]=u,e[27]=A,e[28]=M):(A=e[27],M=e[28]);let h;e[29]!==B||e[30]!==A||e[31]!==M?(h=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[B,A,M]})}),e[29]=B,e[30]=A,e[31]=M,e[32]=h):h=e[32];let N;e[33]!==L||e[34]!==h?(N=t.jsxs(St,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[f,t.jsxs("div",{className:"flex flex-col gap-6",children:[L,h]})]}),e[33]=L,e[34]=h,e[35]=N):N=e[35];let z;return e[36]!==l||e[37]!==s||e[38]!==N?(z=t.jsx(Nt,{open:s,onOpenChange:l,children:N}),e[36]=l,e[37]=s,e[38]=N,e[39]=z):z=e[39],z}function as(o){const e=R.c(31),{form:s,icon:l,gatewayId:i}=o,[n,a]=jt(i);let c;e[0]!==s?(c=s.watch("title")||"Agent",e[0]=s,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(pt,{}),e[2]=m):m=e[2];let r;e[3]!==l||e[4]!==c?(r=t.jsx(Ee,{icon:l,name:c,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=c,e[5]=r):r=e[5];let d;e[6]!==s.control?(d=t.jsx(be,{control:s.control,name:"status",render:us}),e[6]=s.control,e[7]=d):d=e[7];let u;e[8]!==r||e[9]!==d?(u=t.jsxs("div",{className:"flex items-start justify-between",children:[r,d]}),e[8]=r,e[9]=d,e[10]=u):u=e[10];let f;e[11]!==s.control?(f=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:ms}),t.jsx(be,{control:s.control,name:"description",render:ds})]}),e[11]=s.control,e[12]=f):f=e[12];let p;e[13]!==u||e[14]!==f?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15];let x;e[16]!==s.control?(x=t.jsx("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:t.jsx(be,{control:s.control,name:"tool_selection_mode",render:cs})}),e[16]=s.control,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=g):g=e[18];let y;e[19]!==a?(y=w=>a(w.target.value),e[19]=a,e[20]=y):y=e[20];let j;e[21]!==n||e[22]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[g,t.jsx(Pt,{value:n,onChange:y,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=n,e[22]=y,e[23]=j):j=e[23];let v;e[24]!==j||e[25]!==p||e[26]!==x?(v=t.jsxs("div",{className:"flex flex-col",children:[p,x,j]}),e[24]=j,e[25]=p,e[26]=x,e[27]=v):v=e[27];let b;return e[28]!==s||e[29]!==v?(b=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(_t,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function cs(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(wt,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Z,{children:t.jsxs(Y,{children:[t.jsx(J,{asChild:!0,children:t.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(je,{size:14,className:"text-muted-foreground"})})}),t.jsx(Q,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs($t,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Se,{children:t.jsx(Rt,{className:"w-[180px]",children:t.jsx(zt,{})})}),t.jsxs(At,{children:[t.jsx(Ue,{value:"inclusion",children:"Include Selected"}),t.jsx(Ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Ne,{})]})}function ds(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(Ne,{})]})}function ms(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(Se,{children:t.jsx(Pe,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Agent Name"})}),t.jsx(Ne,{})]})}function us(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(qe,{variant:e.value==="active"?"success":"outline",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Se,{children:t.jsx(Et,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Ne,{})]})}function fs(o){const e=R.c(81),{gateway:s,gatewayId:l,requestedTabId:i}=o,a=ot().location.href,c=lt();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/gateways/$gatewayId"},e[0]=m):m=e[0];const r=Fe(m),d=xt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const f=We(u);let p;e[2]!==f?(p=f.map(xs),e[2]=f,e[3]=p):p=e[3];const x=p,{promptsMap:g}=gt(x),{resourcesMap:y}=bt(x);let j;if(e[4]!==f){j=new Map;for(const T of f)T.tools&&T.tools.length>0&&j.set(T.id,T.tools.map(hs));e[4]=f,e[5]=j}else j=e[5];let v;e[6]!==j||e[7]!==s?(v=()=>Le(s,j),e[6]=j,e[7]=s,e[8]=v):v=e[8];const[b,w]=S.useState(v);let I;e[9]!==s?(I=()=>Oe(s),e[9]=s,e[10]=I):I=e[10];const[k,C]=S.useState(I);let P;e[11]!==s?(P=()=>Be(s),e[11]=s,e[12]=P):P=e[12];const[E,L]=S.useState(P),[B,A]=S.useState(!1),[M,h]=S.useState(!1);let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=T=>{w(T),A(!0)},e[13]=N):N=e[13];const z=N;let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=T=>{C(T),A(!0)},e[14]=$):$=e[14];const G=$;let W;e[15]===Symbol.for("react.memo_cache_sentinel")?(W=T=>{L(T),A(!0)},e[15]=W):W=e[15];const q=W;let F;e[16]===Symbol.for("react.memo_cache_sentinel")?(F=nt(ss),e[16]=F):F=e[16];const _e=s.tool_selection_mode??"inclusion";let ce;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==_e?(ce={resolver:F,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:_e}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=_e,e[21]=ce):ce=e[21];const O=it(ce),we=O.formState.isDirty||B;let de;e[22]!==d.update||e[23]!==j||e[24]!==O||e[25]!==l||e[26]!==E||e[27]!==k||e[28]!==b?(de=async()=>{const T=O.getValues(),$e=os(b,k,E,j);await d.update.mutateAsync({id:l,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,connections:$e}}),O.reset(T),A(!1)},e[22]=d.update,e[23]=j,e[24]=O,e[25]=l,e[26]=E,e[27]=k,e[28]=b,e[29]=de):de=e[29];const Ce=de;let me;e[30]!==j||e[31]!==O||e[32]!==s?(me=()=>{O.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion"}),w(Le(s,j)),C(Oe(s)),L(Be(s)),A(!1)},e[30]=j,e[31]=O,e[32]=s,e[33]=me):me=e[33];const ke=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[34]=ue):ue=e[34];const De=ue,D=De.some(T=>T.id===i)?i:"settings";let fe;e[35]!==r?(fe=T=>{r({search:$e=>({...$e,tab:T}),replace:!0})},e[35]=r,e[36]=fe):fe=e[36];const Ie=fe,ae=d.update.isPending;let K;e[37]!==c.history?(K=()=>c.history.back(),e[37]=c.history,e[38]=K):K=e[38];let X;e[39]!==D||e[40]!==Ie?(X=t.jsx(Lt,{children:t.jsx(Tt,{tabs:De,activeTab:D,onTabChange:Ie})}),e[39]=D,e[40]=Ie,e[41]=X):X=e[41];let ee;e[42]!==ke||e[43]!==Ce||e[44]!==we||e[45]!==ae?(ee=we&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:ke,"aria-label":"Cancel",children:t.jsx(Ut,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Cancel"})]})}),t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ae,onClick:Ce,"aria-label":"Save",children:ae?t.jsx(ze,{size:14,className:"animate-spin"}):t.jsx(Ke,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Save"})]})})]}),e[42]=ke,e[43]=Ce,e[44]=we,e[45]=ae,e[46]=ee):ee=e[46];let he;e[47]===Symbol.for("react.memo_cache_sentinel")?(he=()=>h(!0),e[47]=he):he=e[47];let xe;e[48]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(Z,{children:t.jsxs(Y,{delayDuration:0,children:[t.jsx(J,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(V,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:he,"aria-label":"Share",children:t.jsx(Xe,{size:14})})})}),t.jsx(Q,{side:"bottom",children:"Share"})]})}),e[48]=xe):xe=e[48];const Te=s.icon??"cpu_chip";let te;e[49]!==s.title||e[50]!==Te||e[51]!==a?(te=t.jsx(ut,{title:s.title,url:a,icon:Te}),e[49]=s.title,e[50]=Te,e[51]=a,e[52]=te):te=e[52];let se;e[53]!==ee||e[54]!==te?(se=t.jsxs(Ot,{children:[ee,xe,te]}),e[53]=ee,e[54]=te,e[55]=se):se=e[55];let pe;e[56]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),e[56]=pe):pe=e[56];let oe;e[57]!==D||e[58]!==g||e[59]!==y||e[60]!==O||e[61]!==s.icon||e[62]!==l||e[63]!==E||e[64]!==k||e[65]!==b?(oe=D==="settings"?t.jsx(as,{form:O,icon:s.icon,gatewayId:l}):D==="tools"?t.jsx(ft,{toolSet:b,onToolSetChange:z}):D==="resources"?t.jsx(Kt,{resourceSet:k,onResourceSetChange:G,connectionResources:y}):D==="prompts"?t.jsx(Zt,{promptSet:E,onPromptSetChange:q,connectionPrompts:g}):null,e[57]=D,e[58]=g,e[59]=y,e[60]=O,e[61]=s.icon,e[62]=l,e[63]=E,e[64]=k,e[65]=b,e[66]=oe):oe=e[66];let le;e[67]!==oe?(le=t.jsx(S.Suspense,{fallback:pe,children:oe}),e[67]=oe,e[68]=le):le=e[68];let ne;e[69]!==D||e[70]!==le?(ne=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(Ve,{children:le},D)})})}),e[69]=D,e[70]=le,e[71]=ne):ne=e[71];let ie;e[72]!==s||e[73]!==M?(ie=t.jsx(rs,{open:M,onOpenChange:h,gateway:s}),e[72]=s,e[73]=M,e[74]=ie):ie=e[74];let ge;return e[75]!==K||e[76]!==X||e[77]!==se||e[78]!==ne||e[79]!==ie?(ge=t.jsxs(Bt,{onBack:K,children:[X,se,ne,ie]}),e[75]=K,e[76]=X,e[77]=se,e[78]=ne,e[79]=ie,e[80]=ge):ge=e[80],ge}function hs(o){return o.name}function xs(o){return o.id}function ps(){const o=R.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Fe(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:i,org:n}=tt(l);let a;o[2]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/gateways/$gatewayId"},o[2]=a):a=o[2];const m=st(a).tab||"settings",r=ht(i);if(!r){let u;return o[3]!==s||o[4]!==n?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(rt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:n}}),children:"Back to agents"})})}),o[3]=s,o[4]=n,o[5]=u):u=o[5],u}let d;return o[6]!==r||o[7]!==i||o[8]!==m?(d=t.jsx(fs,{gateway:r,gatewayId:i,requestedTabId:m}),o[6]=r,o[7]=i,o[8]=m,o[9]=d):d=o[9],d}function gs(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ve,{children:t.jsx(S.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ze,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ps,{})})}),o[0]=e):e=o[0],e}function ro(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(gs,{}),o[0]=e):e=o[0],e}export{ro as default};
@@ -1 +1 @@
1
- import{c as ee,j as t,r as te,f as oe}from"./index-ZiFjEqyT.js";import{C as re}from"./collection-header-Dl8Ii13M.js";import{C as ie}from"./collection-page-C75JriCh.js";import{C as ne}from"./collection-search-D67e9ppe.js";import{C as ae}from"./collection-table-wrapper-DDHrDWif.js";import{C as le}from"./connection-card-BuCHeT4K.js";import{E as W,I as ce}from"./empty-state-B1DU5702.js";import{E as de}from"./error-boundary-BOBkDZ1Y.js";import{u as me,a as ue,i as x}from"./use-gateway-v7etejE8.js";import{u as pe,s as J}from"./use-list-state-C5pgFF_z.js";import{u as ge}from"./use-create-gateway-CCmt4GT8.js";import{u as he}from"./project-context-provider-BPo-49FO.js";import{c as fe,b as xe,d as je,A as Ce,e as we,g as ye,a as Ne,f as De}from"./alert-dialog-Df8ZsItX.js";import{B as se}from"./badge-BPKvq16e.js";import{B as q}from"./button-Co_HOc3E.js";import{b as Q,D as U,a as X,c as B}from"./dropdown-menu-dsr_wyw0.js";import{i as Y}from"./DotsVertical-f9rnazjX.js";import{i as Se}from"./Loading01-Bq_7Os6T.js";import{s as Z}from"./Trash01-GrzirNvV.js";import"./collection-display-button-C_GfVLwh.js";import"./ArrowUp-KvHCnFh3.js";import"./Check-D4dBNJmC.js";import"./Grid01-BgBQwtBY.js";import"./List-hTdqyLGB.js";import"./tooltip-BJO9sFhZ.js";import"./view-mode-toggle-tlrhMsiy.js";import"./SearchMd-B_A85eif.js";import"./input-DEsmZ6es.js";import"./card-Rz2C5-Lx.js";import"./connection-CmMMEDBY.js";import"./use-collections-g067BPxP.js";import"./useMutation-4fnzP4bc.js";import"./use-mobile-Co7MtEW-.js";function ve(e,r){switch(r.type){case"delete":return{mode:"deleting",gateway:r.gateway};case"close":return{mode:"idle"}}}function be(){const e=ee.c(63),{org:r}=he(),n=oe();let j;e[0]!==r.slug?(j={namespace:r.slug,resource:"gateways"},e[0]=r.slug,e[1]=j):j=e[1];const s=pe(j),f=me(s);let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},e[2]=C):C=e[2];const{createGateway:G,isCreating:w}=ge(C),O=ue();let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={mode:"idle"},e[3]=y):y=e[3];const[i,N]=te.useReducer(ve,y);let D;e[4]!==O||e[5]!==i.gateway||e[6]!==i.mode?(D=async()=>{if(i.mode!=="deleting")return;const o=i.gateway.id;N({type:"close"});try{await O.delete.mutateAsync(o)}catch{}},e[4]=O,e[5]=i.gateway,e[6]=i.mode,e[7]=D):D=e[7];const R=D;let S,v,b,k,I,_;e[8]===Symbol.for("react.memo_cache_sentinel")?(S={id:"icon",header:"",render:Ke,cellClassName:"w-16 shrink-0",wrap:!0},v={id:"title",header:"Name",render:Pe,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},b={id:"description",header:"Description",render:Ee,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},k={id:"mode",header:"Mode",accessor:$e,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:ze,cellClassName:"w-24 shrink-0"},_={id:"status",header:"Status",render:Me,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=S,e[9]=v,e[10]=b,e[11]=k,e[12]=I,e[13]=_):(S=e[8],v=e[9],b=e[10],k=e[11],I=e[12],_=e[13]);let A;e[14]!==n||e[15]!==r.slug?(A=[S,v,b,k,I,_,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ae,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:_e,children:[t.jsxs(B,{onClick:a=>{a.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[14]=n,e[15]=r.slug,e[16]=A):A=e[16];const T=A,V=w?"Creating...":"Create Agent";let M;e[17]!==G||e[18]!==w||e[19]!==V?(M=t.jsx(q,{onClick:G,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:V}),e[17]=G,e[18]=w,e[19]=V,e[20]=M):M=e[20];const H=M,L=i.mode==="deleting";let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[21]=z):z=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(fe,{children:"Delete Agent?"}),e[22]=$):$=e[22];const F=i.mode==="deleting"&&i.gateway.title;let l;e[23]!==F?(l=t.jsxs(xe,{children:[$,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:F}),"."]})]}),e[23]=F,e[24]=l):l=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[25]=E):E=e[25];let c;e[26]!==R?(c=t.jsxs(we,{children:[E,t.jsx(ye,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[26]=R,e[27]=c):c=e[27];let d;e[28]!==l||e[29]!==c?(d=t.jsxs(Ne,{children:[l,c]}),e[28]=l,e[29]=c,e[30]=d):d=e[30];let m;e[31]!==L||e[32]!==d?(m=t.jsx(De,{open:L,onOpenChange:z,children:d}),e[31]=L,e[32]=d,e[33]=m):m=e[33];let P;e[34]===Symbol.for("react.memo_cache_sentinel")?(P=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[34]=P):P=e[34];let u;e[35]!==H||e[36]!==s.handleSort||e[37]!==s.setViewMode||e[38]!==s.sortDirection||e[39]!==s.sortKey||e[40]!==s.viewMode?(u=t.jsx(re,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:P,ctaButton:H}),e[35]=H,e[36]=s.handleSort,e[37]=s.setViewMode,e[38]=s.sortDirection,e[39]=s.sortKey,e[40]=s.viewMode,e[41]=u):u=e[41];let p;e[42]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[42]=s,e[43]=p):p=e[43];let g;e[44]!==s.search||e[45]!==s.setSearch||e[46]!==p?(g=t.jsx(ne,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:p}),e[44]=s.search,e[45]=s.setSearch,e[46]=p,e[47]=g):g=e[47];let h;e[48]!==T||e[49]!==f||e[50]!==s.handleSort||e[51]!==s.search||e[52]!==s.sortDirection||e[53]!==s.sortKey||e[54]!==s.viewMode||e[55]!==n||e[56]!==r.slug?(h=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:f.map(o=>t.jsx(le,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(x,{}),onClick:()=>n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:ke,children:[t.jsxs(B,{onClick:a=>{a.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ae,{columns:T,data:f,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})}),e[48]=T,e[49]=f,e[50]=s.handleSort,e[51]=s.search,e[52]=s.sortDirection,e[53]=s.sortKey,e[54]=s.viewMode,e[55]=n,e[56]=r.slug,e[57]=h):h=e[57];let K;return e[58]!==m||e[59]!==u||e[60]!==g||e[61]!==h?(K=t.jsxs(ie,{children:[m,u,g,h]}),e[58]=m,e[59]=u,e[60]=g,e[61]=h,e[62]=K):K=e[62],K}function ke(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function Me(e){return t.jsx(se,{variant:e.status==="active"?"default":"outline",children:e.status})}function ze(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function $e(e){return t.jsx(se,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ee(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Pe(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ke(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(x,{size:16})})}function ft(){const e=ee.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(de,{children:t.jsx(te.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Se,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(be,{})})}),e[0]=r):r=e[0],r}export{ft as default};
1
+ import{c as ee,j as t,r as te,f as oe}from"./index-H8waGLZX.js";import{C as re}from"./collection-header-DxthRGYV.js";import{C as ie}from"./collection-page-D_yHhDuI.js";import{C as ne}from"./collection-search-B1XW3AZu.js";import{C as ae}from"./collection-table-wrapper-D0Ju0-U8.js";import{C as le}from"./connection-card-DtL0ugHI.js";import{E as W,I as ce}from"./empty-state-CVNEuxZY.js";import{E as de}from"./error-boundary-Bcxx4rfP.js";import{u as me,a as ue,i as x}from"./use-gateway-DMJjVwlU.js";import{u as pe,s as J}from"./use-list-state-Bt6QEhtR.js";import{u as ge}from"./use-create-gateway-eDGGqEOS.js";import{u as he}from"./project-context-provider-DTbOrAFq.js";import{c as fe,b as xe,d as je,A as Ce,e as we,g as ye,a as Ne,f as De}from"./alert-dialog-CwDNNTWs.js";import{B as se}from"./badge-BF26aj7r.js";import{B as q}from"./button-CKEM3eQL.js";import{b as Q,D as U,a as X,c as B}from"./dropdown-menu-wWS-zaMN.js";import{i as Y}from"./DotsVertical-DBgin8Gd.js";import{i as Se}from"./Loading01-CXxLrMyp.js";import{s as Z}from"./Trash01-pQsQJfD7.js";import"./collection-display-button-BRmjKmXA.js";import"./ArrowUp-Cb5IgbXf.js";import"./Check-D_y2LGJG.js";import"./Grid01-CPcgzk-j.js";import"./List-vJTsFkGC.js";import"./tooltip-DixY1Sbc.js";import"./view-mode-toggle-CoxeG-5F.js";import"./SearchMd-B72GLhSo.js";import"./input-B_S0H_Hl.js";import"./card-2L27xRvH.js";import"./connection-iGG9vveH.js";import"./use-collections-S6OVeMx0.js";import"./useMutation-DXyBs08e.js";import"./use-mobile-Bh6onNnL.js";function ve(e,r){switch(r.type){case"delete":return{mode:"deleting",gateway:r.gateway};case"close":return{mode:"idle"}}}function be(){const e=ee.c(63),{org:r}=he(),n=oe();let j;e[0]!==r.slug?(j={namespace:r.slug,resource:"gateways"},e[0]=r.slug,e[1]=j):j=e[1];const s=pe(j),f=me(s);let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C={navigateOnCreate:!0},e[2]=C):C=e[2];const{createGateway:G,isCreating:w}=ge(C),O=ue();let y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y={mode:"idle"},e[3]=y):y=e[3];const[i,N]=te.useReducer(ve,y);let D;e[4]!==O||e[5]!==i.gateway||e[6]!==i.mode?(D=async()=>{if(i.mode!=="deleting")return;const o=i.gateway.id;N({type:"close"});try{await O.delete.mutateAsync(o)}catch{}},e[4]=O,e[5]=i.gateway,e[6]=i.mode,e[7]=D):D=e[7];const R=D;let S,v,b,k,I,_;e[8]===Symbol.for("react.memo_cache_sentinel")?(S={id:"icon",header:"",render:Ke,cellClassName:"w-16 shrink-0",wrap:!0},v={id:"title",header:"Name",render:Pe,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},b={id:"description",header:"Description",render:Ee,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},k={id:"mode",header:"Mode",accessor:$e,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:ze,cellClassName:"w-24 shrink-0"},_={id:"status",header:"Status",render:Me,cellClassName:"w-24 shrink-0",sortable:!0},e[8]=S,e[9]=v,e[10]=b,e[11]=k,e[12]=I,e[13]=_):(S=e[8],v=e[9],b=e[10],k=e[11],I=e[12],_=e[13]);let A;e[14]!==n||e[15]!==r.slug?(A=[S,v,b,k,I,_,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ae,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:_e,children:[t.jsxs(B,{onClick:a=>{a.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[14]=n,e[15]=r.slug,e[16]=A):A=e[16];const T=A,V=w?"Creating...":"Create Agent";let M;e[17]!==G||e[18]!==w||e[19]!==V?(M=t.jsx(q,{onClick:G,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:w,children:V}),e[17]=G,e[18]=w,e[19]=V,e[20]=M):M=e[20];const H=M,L=i.mode==="deleting";let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[21]=z):z=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(fe,{children:"Delete Agent?"}),e[22]=$):$=e[22];const F=i.mode==="deleting"&&i.gateway.title;let l;e[23]!==F?(l=t.jsxs(xe,{children:[$,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:F}),"."]})]}),e[23]=F,e[24]=l):l=e[24];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[25]=E):E=e[25];let c;e[26]!==R?(c=t.jsxs(we,{children:[E,t.jsx(ye,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[26]=R,e[27]=c):c=e[27];let d;e[28]!==l||e[29]!==c?(d=t.jsxs(Ne,{children:[l,c]}),e[28]=l,e[29]=c,e[30]=d):d=e[30];let m;e[31]!==L||e[32]!==d?(m=t.jsx(De,{open:L,onOpenChange:z,children:d}),e[31]=L,e[32]=d,e[33]=m):m=e[33];let P;e[34]===Symbol.for("react.memo_cache_sentinel")?(P=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[34]=P):P=e[34];let u;e[35]!==H||e[36]!==s.handleSort||e[37]!==s.setViewMode||e[38]!==s.sortDirection||e[39]!==s.sortKey||e[40]!==s.viewMode?(u=t.jsx(re,{title:"Agents",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:P,ctaButton:H}),e[35]=H,e[36]=s.handleSort,e[37]=s.setViewMode,e[38]=s.sortDirection,e[39]=s.sortKey,e[40]=s.viewMode,e[41]=u):u=e[41];let p;e[42]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[42]=s,e[43]=p):p=e[43];let g;e[44]!==s.search||e[45]!==s.setSearch||e[46]!==p?(g=t.jsx(ne,{value:s.search,onChange:s.setSearch,placeholder:"Search for an agent...",onKeyDown:p}),e[44]=s.search,e[45]=s.setSearch,e[46]=p,e[47]=g):g=e[47];let h;e[48]!==T||e[49]!==f||e[50]!==s.handleSort||e[51]!==s.search||e[52]!==s.sortDirection||e[53]!==s.sortKey||e[54]!==s.viewMode||e[55]!==n||e[56]!==r.slug?(h=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:f.length===0?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:s.search?"No agents found":"No agents yet",description:s.search?`No agents match "${s.search}"`:"Create an agent to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:f.map(o=>t.jsx(le,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(x,{}),onClick:()=>n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Y,{size:20})})}),t.jsxs(X,{align:"end",onClick:ke,children:[t.jsxs(B,{onClick:a=>{a.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(J,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:a=>{a.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(Z,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ae,{columns:T,data:f,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents found",description:`No agents match "${s.search}"`}):t.jsx(W,{image:t.jsx(x,{size:36,className:"text-muted-foreground"}),title:"No agents yet",description:"Create an agent to aggregate tools from multiple Connections."})}),e[48]=T,e[49]=f,e[50]=s.handleSort,e[51]=s.search,e[52]=s.sortDirection,e[53]=s.sortKey,e[54]=s.viewMode,e[55]=n,e[56]=r.slug,e[57]=h):h=e[57];let K;return e[58]!==m||e[59]!==u||e[60]!==g||e[61]!==h?(K=t.jsxs(ie,{children:[m,u,g,h]}),e[58]=m,e[59]=u,e[60]=g,e[61]=h,e[62]=K):K=e[62],K}function ke(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function Ae(e){return e.stopPropagation()}function Me(e){return t.jsx(se,{variant:e.status==="active"?"default":"outline",children:e.status})}function ze(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function $e(e){return t.jsx(se,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ee(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Pe(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Ke(e){return t.jsx(ce,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(x,{size:16})})}function ft(){const e=ee.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(de,{children:t.jsx(te.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Se,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(be,{})})}),e[0]=r):r=e[0],r}export{ft as default};