@decocms/mesh 2.19.0 → 2.20.1

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 (140) hide show
  1. package/dist/client/assets/{AlertCircle-DZfqNByx.js → AlertCircle-DeGhTF84.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Cd6RM4A6.js → ArrowLeft-m6KeIjPT.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-VMKONnWJ.js → ArrowUp-BDjaIiFu.js} +1 -1
  4. package/dist/client/assets/{Check-Clnl6VO2.js → Check-Cs5AiVxS.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CUCzTkUk.js → ChevronDown-7pGjkuTY.js} +1 -1
  6. package/dist/client/assets/{Code01-BAik7hF-.js → Code01-BdN1qNoI.js} +1 -1
  7. package/dist/client/assets/{Copy01-CCfh45Hm.js → Copy01-B_oHlu2-.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-H1CDe03p.js → DotsHorizontal-B-RZHKDt.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-CubHWPM8.js → DotsVertical-HKe7Lpcg.js} +1 -1
  10. package/dist/client/assets/{Download01-DUxaWCdv.js → Download01-4uLxYlt-.js} +1 -1
  11. package/dist/client/assets/{Edit01-tXex8wx0.js → Edit01-CcxqoKWW.js} +1 -1
  12. package/dist/client/assets/{File06-1GHbOIr4.js → File06-K5gpmB1y.js} +1 -1
  13. package/dist/client/assets/{FilterLines-Ttp2swRG.js → FilterLines-BCus583X.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-BkcMu9OY.js → FlipBackward-MuxfY5vX.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-V6D4YBhB.js → GitBranch01-ClkRJDdk.js} +1 -1
  16. package/dist/client/assets/{Grid01-Bf8eAyhK.js → Grid01-XLGz76ym.js} +1 -1
  17. package/dist/client/assets/{Home02-8q2bbK8n.js → Home02-CeVIG1t0.js} +1 -1
  18. package/dist/client/assets/{Image01-Ba0mxAoN.js → Image01-CycaMeSm.js} +1 -1
  19. package/dist/client/assets/{Inbox01-BvYPvM_p.js → Inbox01-1DQwZbO-.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-DKA0-FHH.js → InfoCircle-DXvgKrQ3.js} +1 -1
  21. package/dist/client/assets/{Key01-CrI4HON6.js → Key01-B8mxyE2f.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-CqAE-za3.js → LinkExternal01-B4WpWXG7.js} +1 -1
  23. package/dist/client/assets/{List-C6tpn114.js → List-DWWQESNh.js} +1 -1
  24. package/dist/client/assets/{Loading01-wy6i08TR.js → Loading01-BtKovu_m.js} +1 -1
  25. package/dist/client/assets/{Lock01-CGlDIBQ9.js → Lock01-CDOVc6ZJ.js} +1 -1
  26. package/dist/client/assets/{Play-BvhASZjZ.js → Play-DYDE6oE1.js} +1 -1
  27. package/dist/client/assets/{Plus-DaMIylfN.js → Plus-CPExS1G1.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DsK25qy7.js → SearchMd-DwKDi1yz.js} +1 -1
  29. package/dist/client/assets/{Terminal-cal0VHQd.js → Terminal-LP4GeLJv.js} +1 -1
  30. package/dist/client/assets/{Trash01-pB5oOXYU.js → Trash01-DCb3R_1E.js} +1 -1
  31. package/dist/client/assets/{Upload01-BRGUFGKZ.js → Upload01-BKDlh_J7.js} +1 -1
  32. package/dist/client/assets/{X-Bq7VzczH.js → X-DWXiZn3v.js} +1 -1
  33. package/dist/client/assets/{XClose-zOphE63W.js → XClose-s9vu-dQj.js} +1 -1
  34. package/dist/client/assets/{alert-dialog-BBkPKiLO.js → alert-dialog-CNXrLp-S.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-D7-AwG4p.js → auth-catchall-M9fqis8u.js} +1 -1
  36. package/dist/client/assets/{avatar-CumXES9B.js → avatar-noXapmql.js} +1 -1
  37. package/dist/client/assets/{badge-tnyrO2LA.js → badge-ChGpQW0J.js} +1 -1
  38. package/dist/client/assets/{binder-BxHiGQ64.js → binder-DZT62WgB.js} +1 -1
  39. package/dist/client/assets/{button-BQMZIX_4.js → button-Dh_UOMtF.js} +1 -1
  40. package/dist/client/assets/{card-B-rrjyBF.js → card-Bjs7HBa2.js} +1 -1
  41. package/dist/client/assets/{checkbox-CJvAgYlu.js → checkbox-DiEhrfCa.js} +1 -1
  42. package/dist/client/assets/{collection-detail-w6psdBlt.js → collection-detail-BHOMTlVb.js} +1 -1
  43. package/dist/client/assets/{collection-display-button-Bi_NXbuN.js → collection-display-button-DKfm8yFW.js} +1 -1
  44. package/dist/client/assets/{collection-header-BfNxri-N.js → collection-header-Cn-YMrm9.js} +1 -1
  45. package/dist/client/assets/{collection-page-DJtrTRMH.js → collection-page-A6cy4ewQ.js} +1 -1
  46. package/dist/client/assets/{collection-search-9baWd84b.js → collection-search-Bm9HY_m8.js} +1 -1
  47. package/dist/client/assets/collection-tab-BQzpUnQW.js +1 -0
  48. package/dist/client/assets/{collection-table-wrapper-Cu-yqUsH.js → collection-table-wrapper-CnCS_a8f.js} +1 -1
  49. package/dist/client/assets/{connection-BdWKvn2K.js → connection-DuIRkEvB.js} +1 -1
  50. package/dist/client/assets/{connection-card-CwhA62aK.js → connection-card-Db71-JIc.js} +1 -1
  51. package/dist/client/assets/{connection-detail-BvvvvXz6.js → connection-detail-C1yH43Km.js} +1 -1
  52. package/dist/client/assets/{connections-CfRRCGSZ.js → connections-Bd35VTO7.js} +1 -1
  53. package/dist/client/assets/constants-C1rpewgJ.js +1 -0
  54. package/dist/client/assets/{create-organization-dialog-gxAB4wwP.js → create-organization-dialog-B19KPYZ1.js} +1 -1
  55. package/dist/client/assets/{dialog-BOTxth8M.js → dialog-BFNjB_wS.js} +1 -1
  56. package/dist/client/assets/{dropdown-menu-Cwg_0qoi.js → dropdown-menu-T7u8fl7N.js} +1 -1
  57. package/dist/client/assets/{dynamic-plugin-layout-DcLqC1O8.js → dynamic-plugin-layout-CaPvL2ak.js} +1 -1
  58. package/dist/client/assets/{empty-state-DeORHrTg.js → empty-state-DhpaMqQD.js} +1 -1
  59. package/dist/client/assets/{empty-state-2SJ3WxPr.js → empty-state-ylKJe6-v.js} +1 -1
  60. package/dist/client/assets/{env-vars-editor-qkfhYptd.js → env-vars-editor-BwDtTYE8.js} +1 -1
  61. package/dist/client/assets/{error-boundary-KUKN2TxD.js → error-boundary-_npCfvs4.js} +1 -1
  62. package/dist/client/assets/{extract-connection-data-37AfJqs-.js → extract-connection-data-DfFE7uXb.js} +1 -1
  63. package/dist/client/assets/file-browser-NWpg0oN1.js +2 -0
  64. package/dist/client/assets/{form-o9xmUpnK.js → form-BEM8UzSv.js} +1 -1
  65. package/dist/client/assets/gateway-detail-BrjbS3jo.js +1 -0
  66. package/dist/client/assets/{gateways-fe-SAKln.js → gateways-DhcOJhD5.js} +1 -1
  67. package/dist/client/assets/grid-view-BUF5kath.js +1 -0
  68. package/dist/client/assets/{home-OB-BKE3S.js → home-DyK0jpSk.js} +1 -1
  69. package/dist/client/assets/{index-BGlkGnRh.js → index-BRipTsvS.js} +12 -12
  70. package/dist/client/assets/{index-DuoIQX0P.js → index-C6eYxyql.js} +1 -1
  71. package/dist/client/assets/{index-DB3RU6w4.js → index-DanqEyuv.js} +1 -1
  72. package/dist/client/assets/{index-nfXEOl8p.js → index-Dh8Y3NBs.js} +9 -9
  73. package/dist/client/assets/index-H07QDM93.css +1 -0
  74. package/dist/client/assets/{index-BdoGlqOh.js → index-skH-OUyO.js} +2 -2
  75. package/dist/client/assets/{infiniteQueryObserver-B-zosqIG.js → infiniteQueryObserver-Dvgbvv4A.js} +1 -1
  76. package/dist/client/assets/{input-B0JGK4qg.js → input-CdlPz8Vq.js} +1 -1
  77. package/dist/client/assets/{layout-LCGR_e4n.js → layout-DopLDDPE.js} +1 -1
  78. package/dist/client/assets/{lazy-highlighter-7Ygumnp-.js → lazy-highlighter-CQ8gN0d3.js} +1 -1
  79. package/dist/client/assets/{localstorage-keys-DJgrMpsR.js → localstorage-keys-B_H3St2R.js} +1 -1
  80. package/dist/client/assets/{login-CPHiXmVM.js → login-1cuD6_Oo.js} +1 -1
  81. package/dist/client/assets/{mcp-oauth-DHBNZNZN.js → mcp-oauth-B6eUt4Mr.js} +1 -1
  82. package/dist/client/assets/{mcp-server-card-CCJD8rY5.js → mcp-server-card-DTQIT3pj.js} +1 -1
  83. package/dist/client/assets/mcp-server-detail-BB_FT5IH.js +1 -0
  84. package/dist/client/assets/{members-BUKGWKo1.js → members-Cy4UaFKY.js} +1 -1
  85. package/dist/client/assets/{monaco-editor-2dgkKSmS.js → monaco-editor-CKUC5K4P.js} +1 -1
  86. package/dist/client/assets/{monitoring-Co2ahvWI.js → monitoring-DOZ3Tm1E.js} +11 -11
  87. package/dist/client/assets/{oauth-callback-DqMgYj7o.js → oauth-callback-DxWqmOqk.js} +1 -1
  88. package/dist/client/assets/page-wGlLXgmM.js +1 -0
  89. package/dist/client/assets/{page-CUhEXv2W.js → page-zq0-MjKt.js} +1 -1
  90. package/dist/client/assets/{pin-to-sidebar-button-BcuLv1ea.js → pin-to-sidebar-button-C5qdidS1.js} +1 -1
  91. package/dist/client/assets/{plugin-empty-state-BMZ2lKdt.js → plugin-empty-state-cSLsH0S-.js} +1 -1
  92. package/dist/client/assets/{plugin-header-CzG6IJ7x.js → plugin-header-CzG38AxU.js} +1 -1
  93. package/dist/client/assets/{plugins-DrfogMhA.js → plugins-BqbdQ0eM.js} +1 -1
  94. package/dist/client/assets/{popover-CXUBdgho.js → popover-B4iU4oXK.js} +1 -1
  95. package/dist/client/assets/{project-context-provider-DhgIBvJ2.js → project-context-provider-Ci1EHyGR.js} +1 -1
  96. package/dist/client/assets/{registry-utils-C1MEHnjt.js → registry-utils-8goOeMwE.js} +1 -1
  97. package/dist/client/assets/{resizable-CwvNlApq.js → resizable-BteAr06H.js} +1 -1
  98. package/dist/client/assets/{resource-tabs-BnWaqzvN.js → resource-tabs-Dzc9tSXU.js} +1 -1
  99. package/dist/client/assets/{select--nDzC8in.js → select-B4aq4vxk.js} +1 -1
  100. package/dist/client/assets/{settings-18XrU-68.js → settings-B6nAEWR5.js} +1 -1
  101. package/dist/client/assets/shell-layout-CNkO6ROG.js +3 -0
  102. package/dist/client/assets/{spinner-BJxZd1VB.js → spinner-DwVZzFPC.js} +1 -1
  103. package/dist/client/assets/{switch-BFRma3Oi.js → switch-PB1r01nO.js} +1 -1
  104. package/dist/client/assets/{textarea-CZGp5M36.js → textarea-B7no0HbU.js} +1 -1
  105. package/dist/client/assets/{tool-set-selector-D-ihTeCw.js → tool-set-selector-Cl3nu1df.js} +1 -1
  106. package/dist/client/assets/{tools-list-DdaO5B-A.js → tools-list-DNdG8U23.js} +1 -1
  107. package/dist/client/assets/{tooltip-DSjdME5j.js → tooltip-DgJ4R-G6.js} +1 -1
  108. package/dist/client/assets/{typewriter-title-D3pHLziM.js → typewriter-title-YmbwonUg.js} +1 -1
  109. package/dist/client/assets/{use-binding-CdMfLY85.js → use-binding-R6SoNecZ.js} +1 -1
  110. package/dist/client/assets/{use-collections-B_r4T3b1.js → use-collections-CC15C_nK.js} +1 -1
  111. package/dist/client/assets/{use-connection-W2V2j8pE.js → use-connection-BY9aOm7H.js} +1 -1
  112. package/dist/client/assets/{use-connection-resources-_fz_82N5.js → use-connection-resources-D2N-7Fdh.js} +1 -1
  113. package/dist/client/assets/{use-create-gateway-DGaCqRhz.js → use-create-gateway-D4_8vfl-.js} +1 -1
  114. package/dist/client/assets/{use-gateway-CijYzCU9.js → use-gateway-CmDE4xLF.js} +1 -1
  115. package/dist/client/assets/{use-gateway-system-prompt-CusPzWe3.js → use-gateway-system-prompt-nzDoNyO-.js} +1 -1
  116. package/dist/client/assets/{use-list-state-DNPGmD9A.js → use-list-state-B0HVVNOr.js} +1 -1
  117. package/dist/client/assets/{use-mcp-fzL3ILVj.js → use-mcp-DUgnx05H.js} +1 -1
  118. package/dist/client/assets/{use-members-Cs5znkoZ.js → use-members-DEeTkVb7.js} +1 -1
  119. package/dist/client/assets/{use-mobile-DPzmQj9d.js → use-mobile-CZeMkOxo.js} +1 -1
  120. package/dist/client/assets/{use-organization-settings-sFF34W-p.js → use-organization-settings-8tWqPbhq.js} +1 -1
  121. package/dist/client/assets/{use-tool-call-CCdok443.js → use-tool-call-_jHZu2qb.js} +1 -1
  122. package/dist/client/assets/useInfiniteQuery-x4_y1w34.js +1 -0
  123. package/dist/client/assets/{useMutation-mOecCzvG.js → useMutation-n0xwrWOz.js} +1 -1
  124. package/dist/client/assets/useQuery-FRehIqtM.js +1 -0
  125. package/dist/client/assets/{value-C7yMc_BN.js → value-BOu8imSs.js} +1 -1
  126. package/dist/client/assets/{view-mode-toggle-DdRtk7o-.js → view-mode-toggle-Z5AVjYj0.js} +1 -1
  127. package/dist/client/assets/{workflow-Ca7LNIxD.js → workflow-CZ2JUtj_.js} +1 -1
  128. package/dist/client/index.html +2 -2
  129. package/package.json +2 -2
  130. package/dist/client/assets/collection-tab-Ct4krCcB.js +0 -1
  131. package/dist/client/assets/constants-BoL9C76L.js +0 -1
  132. package/dist/client/assets/file-browser-D3uR2C9M.js +0 -2
  133. package/dist/client/assets/gateway-detail-B6zUy6TE.js +0 -1
  134. package/dist/client/assets/grid-view-vZ2Zpkzy.js +0 -1
  135. package/dist/client/assets/index-Dh9ePU0t.css +0 -1
  136. package/dist/client/assets/mcp-server-detail-B2BLpdBe.js +0 -1
  137. package/dist/client/assets/page-Xy2zuFaN.js +0 -1
  138. package/dist/client/assets/shell-layout-DPrrZeqr.js +0 -3
  139. package/dist/client/assets/useInfiniteQuery-Bx9UQHNH.js +0 -1
  140. package/dist/client/assets/useQuery-B_cnJjvx.js +0 -1
@@ -1 +1 @@
1
- import{b2 as l,b4 as b,bR as a,bS as d,b3 as h,x as p,r as o,bc as m,bT as v}from"./index-BdoGlqOh.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),b(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=p(s),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
1
+ import{b2 as l,b4 as b,bR as a,bS as d,b3 as h,x as p,r as o,bc as m,bT as v}from"./index-skH-OUyO.js";var y=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),b(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&a(s.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,r=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#e.onSuccess?.(t.data,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(t.data,null,s,r,e)}catch(i){Promise.reject(i)}}else if(t?.type==="error"){try{this.#e.onError?.(t.error,s,r,e)}catch(i){Promise.reject(i)}try{this.#e.onSettled?.(void 0,t.error,s,r,e)}catch(i){Promise.reject(i)}}}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const r=p(s),[e]=o.useState(()=>new y(r,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const i=o.useSyncExternalStore(o.useCallback(n=>e.subscribe(h.batchCalls(n)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((n,c)=>{e.mutate(n,c).catch(m)},[e]);if(i.error&&v(e.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}export{O as u};
@@ -0,0 +1 @@
1
+ import{U as u,b6 as s}from"./index-skH-OUyO.js";function o(e,r){return u(e,s,r)}export{o as u};
@@ -1 +1 @@
1
- import{r as z,aa as A,j as u,a6 as M,a8 as ge,H as h,a5 as he,ab as X,ac as pe,a4 as be,ad as me,h as ve,c as Y}from"./index-BdoGlqOh.js";import{c as Z}from"./button-BQMZIX_4.js";var ee="Toggle",te=z.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n,onPressedChange:a,...o}=t,[i,s]=A({prop:r,onChange:a,defaultProp:n??!1,caller:ee});return u.jsx(M.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:ge(t.onClick,()=>{t.disabled||s(!i)})})});te.displayName=ee;var b="ToggleGroup",[re]=he(b,[X]),ne=X(),S=h.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const a=n;return u.jsx(we,{...a,ref:e})}if(r==="multiple"){const a=n;return u.jsx(ye,{...a,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${b}\``)});S.displayName=b;var[ae,ie]=re(b),we=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??"",onChange:a,caller:b});return u.jsx(ae,{scope:t.__scopeToggleGroup,type:"single",value:h.useMemo(()=>i?[i]:[],[i]),onItemActivate:s,onItemDeactivate:h.useCallback(()=>s(""),[s]),children:u.jsx(oe,{...o,ref:e})})}),ye=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??[],onChange:a,caller:b}),f=h.useCallback(l=>s((d=[])=>[...d,l]),[s]),c=h.useCallback(l=>s((d=[])=>d.filter(xe=>xe!==l)),[s]);return u.jsx(ae,{scope:t.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:f,onItemDeactivate:c,children:u.jsx(oe,{...o,ref:e})})});S.displayName=b;var[$e,Ne]=re(b),oe=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:s=!0,...f}=t,c=ne(r),l=be(i),d={role:"group",dir:l,...f};return u.jsx($e,{scope:r,rovingFocus:a,disabled:n,children:a?u.jsx(me,{asChild:!0,...c,orientation:o,dir:l,loop:s,children:u.jsx(M.div,{...d,ref:e})}):u.jsx(M.div,{...d,ref:e})})}),k="ToggleGroupItem",se=h.forwardRef((t,e)=>{const r=ie(k,t.__scopeToggleGroup),n=Ne(k,t.__scopeToggleGroup),a=ne(t.__scopeToggleGroup),o=r.value.includes(t.value),i=n.disabled||t.disabled,s={...t,pressed:o,disabled:i},f=h.useRef(null);return n.rovingFocus?u.jsx(pe,{asChild:!0,...a,focusable:!i,active:o,ref:f,children:u.jsx(D,{...s,ref:e})}):u.jsx(D,{...s,ref:e})});se.displayName=k;var D=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...a}=t,o=ie(k,r),i={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},s=o.type==="single"?i:void 0;return u.jsx(te,{...s,...a,ref:e,onPressedChange:f=>{f?o.onItemActivate(n):o.onItemDeactivate(n)}})}),Ge=S,Pe=se;const Re=ve("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fe=z.createContext({size:"default",variant:"default"});function Ye(t){const e=Y.c(20);let r,n,a,o,i;e[0]!==t?({className:n,variant:i,size:o,children:r,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);let s;e[6]!==n?(s=Z("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),e[6]=n,e[7]=s):s=e[7];let f;e[8]!==o||e[9]!==i?(f={variant:i,size:o},e[8]=o,e[9]=i,e[10]=f):f=e[10];let c;e[11]!==r||e[12]!==f?(c=u.jsx(fe.Provider,{value:f,children:r}),e[11]=r,e[12]=f,e[13]=c):c=e[13];let l;return e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==i?(l=u.jsx(Ge,{"data-slot":"toggle-group","data-variant":i,"data-size":o,className:s,...a,children:c}),e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=i,e[19]=l):l=e[19],l}function Ze(t){const e=Y.c(18);let r,n,a,o,i;e[0]!==t?({className:n,children:r,variant:i,size:o,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);const s=z.useContext(fe),f=s.variant||i,c=s.size||o;let l;e[6]!==n||e[7]!==s.size||e[8]!==s.variant||e[9]!==o||e[10]!==i?(l=Z(Re({variant:s.variant||i,size:s.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),e[6]=n,e[7]=s.size,e[8]=s.variant,e[9]=o,e[10]=i,e[11]=l):l=e[11];let d;return e[12]!==r||e[13]!==a||e[14]!==f||e[15]!==c||e[16]!==l?(d=u.jsx(Pe,{"data-slot":"toggle-group-item","data-variant":f,"data-size":c,className:l,...a,children:r}),e[12]=r,e[13]=a,e[14]=f,e[15]=c,e[16]=l,e[17]=d):d=e[17],d}function V(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function G(){}var y=.7,C=1/y,w="\\s*([+-]?\\d+)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ke=/^#([0-9a-f]{3,8})$/,Ce=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Te=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),je=new RegExp(`^rgba\\(${w},${w},${w},${$}\\)$`),_e=new RegExp(`^rgba\\(${p},${p},${p},${$}\\)$`),Me=new RegExp(`^hsl\\(${$},${p},${p}\\)$`),Ie=new RegExp(`^hsla\\(${$},${p},${p},${$}\\)$`),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V(G,N,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:O,formatHex:O,formatHex8:Ee,formatHsl:He,formatRgb:B,toString:B});function O(){return this.rgb().formatHex()}function Ee(){return this.rgb().formatHex8()}function He(){return ce(this).formatHsl()}function B(){return this.rgb().formatRgb()}function N(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ke.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?L(e):r===3?new x(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?P(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?P(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ce.exec(t))?new x(e[1],e[2],e[3],1):(e=Te.exec(t))?new x(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=je.exec(t))?P(e[1],e[2],e[3],e[4]):(e=_e.exec(t))?P(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Me.exec(t))?K(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?K(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?L(F[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function L(t){return new x(t>>16&255,t>>8&255,t&255,1)}function P(t,e,r,n){return n<=0&&(t=e=r=NaN),new x(t,e,r,n)}function ze(t){return t instanceof G||(t=N(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function I(t,e,r,n){return arguments.length===1?ze(t):new x(t,e,r,n??1)}function x(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}V(x,I,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(v(this.r),v(this.g),v(this.b),T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U,formatHex:U,formatHex8:Ae,formatRgb:J,toString:J}));function U(){return`#${m(this.r)}${m(this.g)}${m(this.b)}`}function Ae(){return`#${m(this.r)}${m(this.g)}${m(this.b)}${m((isNaN(this.opacity)?1:this.opacity)*255)}`}function J(){const t=T(this.opacity);return`${t===1?"rgb(":"rgba("}${v(this.r)}, ${v(this.g)}, ${v(this.b)}${t===1?")":`, ${t})`}`}function T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function v(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function m(t){return t=v(t),(t<16?"0":"")+t.toString(16)}function K(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new g(t,e,r,n)}function ce(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=N(t)),!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,s=o-a,f=(o+a)/2;return s?(e===o?i=(r-n)/s+(r<n)*6:r===o?i=(n-e)/s+2:i=(e-r)/s+4,s/=f<.5?o+a:2-o-a,i*=60):s=f>0&&f<1?0:i,new g(i,s,f,t.opacity)}function Se(t,e,r,n){return arguments.length===1?ce(t):new g(t,e,r,n??1)}function g(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}V(g,Se,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new g(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new x(j(t>=240?t-240:t+120,a,n),j(t,a,n),j(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new g(Q(this.h),R(this.s),R(this.l),T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=T(this.opacity);return`${t===1?"hsl(":"hsla("}${Q(this.h)}, ${R(this.s)*100}%, ${R(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Q(t){return t=(t||0)%360,t<0?t+360:t}function R(t){return Math.max(0,Math.min(1,t||0))}function j(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const q=t=>()=>t;function Ve(t,e){return function(r){return t+r*e}}function qe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function De(t){return(t=+t)==1?ue:function(e,r){return r-e?qe(e,r,t):q(isNaN(e)?r:e)}}function ue(t,e){var r=e-t;return r?Ve(t,r):q(isNaN(t)?e:t)}const W=(function t(e){var r=De(e);function n(a,o){var i=r((a=I(a)).r,(o=I(o)).r),s=r(a.g,o.g),f=r(a.b,o.b),c=ue(a.opacity,o.opacity);return function(l){return a.r=i(l),a.g=s(l),a.b=f(l),a.opacity=c(l),a+""}}return n.gamma=t,n})(1);function Fe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=t[a]*(1-o)+e[a]*o;return n}}function Oe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Be(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),o=new Array(r),i;for(i=0;i<n;++i)a[i]=de(t[i],e[i]);for(;i<r;++i)o[i]=e[i];return function(s){for(i=0;i<n;++i)o[i]=a[i](s);return o}}function Le(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function E(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ue(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=de(t[a],e[a]):n[a]=e[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var H=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(H.source,"g");function Je(t){return function(){return t}}function Ke(t){return function(e){return t(e)+""}}function Qe(t,e){var r=H.lastIndex=_.lastIndex=0,n,a,o,i=-1,s=[],f=[];for(t=t+"",e=e+"";(n=H.exec(t))&&(a=_.exec(e));)(o=a.index)>r&&(o=e.slice(r,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(a=a[0])?s[i]?s[i]+=a:s[++i]=a:(s[++i]=null,f.push({i,x:E(n,a)})),r=_.lastIndex;return r<e.length&&(o=e.slice(r),s[i]?s[i]+=o:s[++i]=o),s.length<2?f[0]?Ke(f[0].x):Je(e):(e=f.length,function(c){for(var l=0,d;l<e;++l)s[(d=f[l]).i]=d.x(c);return s.join("")})}function de(t,e){var r=typeof e,n;return e==null||r==="boolean"?q(e):(r==="number"?E:r==="string"?(n=N(e))?(e=n,W):Qe:e instanceof N?W:e instanceof Date?Le:Oe(e)?Fe:Array.isArray(e)?Be:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ue:E)(t,e)}export{Ze as T,W as a,Qe as b,N as c,de as d,Ye as e,E as i};
1
+ import{r as z,aa as A,j as u,a6 as M,a8 as ge,H as h,a5 as he,ab as X,ac as pe,a4 as be,ad as me,h as ve,c as Y}from"./index-skH-OUyO.js";import{c as Z}from"./button-Dh_UOMtF.js";var ee="Toggle",te=z.forwardRef((t,e)=>{const{pressed:r,defaultPressed:n,onPressedChange:a,...o}=t,[i,s]=A({prop:r,onChange:a,defaultProp:n??!1,caller:ee});return u.jsx(M.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":t.disabled?"":void 0,...o,ref:e,onClick:ge(t.onClick,()=>{t.disabled||s(!i)})})});te.displayName=ee;var b="ToggleGroup",[re]=he(b,[X]),ne=X(),S=h.forwardRef((t,e)=>{const{type:r,...n}=t;if(r==="single"){const a=n;return u.jsx(we,{...a,ref:e})}if(r==="multiple"){const a=n;return u.jsx(ye,{...a,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${b}\``)});S.displayName=b;var[ae,ie]=re(b),we=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??"",onChange:a,caller:b});return u.jsx(ae,{scope:t.__scopeToggleGroup,type:"single",value:h.useMemo(()=>i?[i]:[],[i]),onItemActivate:s,onItemDeactivate:h.useCallback(()=>s(""),[s]),children:u.jsx(oe,{...o,ref:e})})}),ye=h.forwardRef((t,e)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...o}=t,[i,s]=A({prop:r,defaultProp:n??[],onChange:a,caller:b}),f=h.useCallback(l=>s((d=[])=>[...d,l]),[s]),c=h.useCallback(l=>s((d=[])=>d.filter(xe=>xe!==l)),[s]);return u.jsx(ae,{scope:t.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:f,onItemDeactivate:c,children:u.jsx(oe,{...o,ref:e})})});S.displayName=b;var[$e,Ne]=re(b),oe=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,disabled:n=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:s=!0,...f}=t,c=ne(r),l=be(i),d={role:"group",dir:l,...f};return u.jsx($e,{scope:r,rovingFocus:a,disabled:n,children:a?u.jsx(me,{asChild:!0,...c,orientation:o,dir:l,loop:s,children:u.jsx(M.div,{...d,ref:e})}):u.jsx(M.div,{...d,ref:e})})}),k="ToggleGroupItem",se=h.forwardRef((t,e)=>{const r=ie(k,t.__scopeToggleGroup),n=Ne(k,t.__scopeToggleGroup),a=ne(t.__scopeToggleGroup),o=r.value.includes(t.value),i=n.disabled||t.disabled,s={...t,pressed:o,disabled:i},f=h.useRef(null);return n.rovingFocus?u.jsx(pe,{asChild:!0,...a,focusable:!i,active:o,ref:f,children:u.jsx(D,{...s,ref:e})}):u.jsx(D,{...s,ref:e})});se.displayName=k;var D=h.forwardRef((t,e)=>{const{__scopeToggleGroup:r,value:n,...a}=t,o=ie(k,r),i={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},s=o.type==="single"?i:void 0;return u.jsx(te,{...s,...a,ref:e,onPressedChange:f=>{f?o.onItemActivate(n):o.onItemDeactivate(n)}})}),Ge=S,Pe=se;const Re=ve("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),fe=z.createContext({size:"default",variant:"default"});function Ye(t){const e=Y.c(20);let r,n,a,o,i;e[0]!==t?({className:n,variant:i,size:o,children:r,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);let s;e[6]!==n?(s=Z("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",n),e[6]=n,e[7]=s):s=e[7];let f;e[8]!==o||e[9]!==i?(f={variant:i,size:o},e[8]=o,e[9]=i,e[10]=f):f=e[10];let c;e[11]!==r||e[12]!==f?(c=u.jsx(fe.Provider,{value:f,children:r}),e[11]=r,e[12]=f,e[13]=c):c=e[13];let l;return e[14]!==a||e[15]!==o||e[16]!==s||e[17]!==c||e[18]!==i?(l=u.jsx(Ge,{"data-slot":"toggle-group","data-variant":i,"data-size":o,className:s,...a,children:c}),e[14]=a,e[15]=o,e[16]=s,e[17]=c,e[18]=i,e[19]=l):l=e[19],l}function Ze(t){const e=Y.c(18);let r,n,a,o,i;e[0]!==t?({className:n,children:r,variant:i,size:o,...a}=t,e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=i):(r=e[1],n=e[2],a=e[3],o=e[4],i=e[5]);const s=z.useContext(fe),f=s.variant||i,c=s.size||o;let l;e[6]!==n||e[7]!==s.size||e[8]!==s.variant||e[9]!==o||e[10]!==i?(l=Z(Re({variant:s.variant||i,size:s.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",n),e[6]=n,e[7]=s.size,e[8]=s.variant,e[9]=o,e[10]=i,e[11]=l):l=e[11];let d;return e[12]!==r||e[13]!==a||e[14]!==f||e[15]!==c||e[16]!==l?(d=u.jsx(Pe,{"data-slot":"toggle-group-item","data-variant":f,"data-size":c,className:l,...a,children:r}),e[12]=r,e[13]=a,e[14]=f,e[15]=c,e[16]=l,e[17]=d):d=e[17],d}function V(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function le(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function G(){}var y=.7,C=1/y,w="\\s*([+-]?\\d+)\\s*",$="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ke=/^#([0-9a-f]{3,8})$/,Ce=new RegExp(`^rgb\\(${w},${w},${w}\\)$`),Te=new RegExp(`^rgb\\(${p},${p},${p}\\)$`),je=new RegExp(`^rgba\\(${w},${w},${w},${$}\\)$`),_e=new RegExp(`^rgba\\(${p},${p},${p},${$}\\)$`),Me=new RegExp(`^hsl\\(${$},${p},${p}\\)$`),Ie=new RegExp(`^hsla\\(${$},${p},${p},${$}\\)$`),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V(G,N,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:O,formatHex:O,formatHex8:Ee,formatHsl:He,formatRgb:B,toString:B});function O(){return this.rgb().formatHex()}function Ee(){return this.rgb().formatHex8()}function He(){return ce(this).formatHsl()}function B(){return this.rgb().formatRgb()}function N(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ke.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?L(e):r===3?new x(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?P(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?P(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ce.exec(t))?new x(e[1],e[2],e[3],1):(e=Te.exec(t))?new x(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=je.exec(t))?P(e[1],e[2],e[3],e[4]):(e=_e.exec(t))?P(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Me.exec(t))?K(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?K(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?L(F[t]):t==="transparent"?new x(NaN,NaN,NaN,0):null}function L(t){return new x(t>>16&255,t>>8&255,t&255,1)}function P(t,e,r,n){return n<=0&&(t=e=r=NaN),new x(t,e,r,n)}function ze(t){return t instanceof G||(t=N(t)),t?(t=t.rgb(),new x(t.r,t.g,t.b,t.opacity)):new x}function I(t,e,r,n){return arguments.length===1?ze(t):new x(t,e,r,n??1)}function x(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}V(x,I,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new x(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new x(v(this.r),v(this.g),v(this.b),T(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:U,formatHex:U,formatHex8:Ae,formatRgb:J,toString:J}));function U(){return`#${m(this.r)}${m(this.g)}${m(this.b)}`}function Ae(){return`#${m(this.r)}${m(this.g)}${m(this.b)}${m((isNaN(this.opacity)?1:this.opacity)*255)}`}function J(){const t=T(this.opacity);return`${t===1?"rgb(":"rgba("}${v(this.r)}, ${v(this.g)}, ${v(this.b)}${t===1?")":`, ${t})`}`}function T(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function v(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function m(t){return t=v(t),(t<16?"0":"")+t.toString(16)}function K(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new g(t,e,r,n)}function ce(t){if(t instanceof g)return new g(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=N(t)),!t)return new g;if(t instanceof g)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,s=o-a,f=(o+a)/2;return s?(e===o?i=(r-n)/s+(r<n)*6:r===o?i=(n-e)/s+2:i=(e-r)/s+4,s/=f<.5?o+a:2-o-a,i*=60):s=f>0&&f<1?0:i,new g(i,s,f,t.opacity)}function Se(t,e,r,n){return arguments.length===1?ce(t):new g(t,e,r,n??1)}function g(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}V(g,Se,le(G,{brighter(t){return t=t==null?C:Math.pow(C,t),new g(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?y:Math.pow(y,t),new g(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new x(j(t>=240?t-240:t+120,a,n),j(t,a,n),j(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new g(Q(this.h),R(this.s),R(this.l),T(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=T(this.opacity);return`${t===1?"hsl(":"hsla("}${Q(this.h)}, ${R(this.s)*100}%, ${R(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Q(t){return t=(t||0)%360,t<0?t+360:t}function R(t){return Math.max(0,Math.min(1,t||0))}function j(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const q=t=>()=>t;function Ve(t,e){return function(r){return t+r*e}}function qe(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function De(t){return(t=+t)==1?ue:function(e,r){return r-e?qe(e,r,t):q(isNaN(e)?r:e)}}function ue(t,e){var r=e-t;return r?Ve(t,r):q(isNaN(t)?e:t)}const W=(function t(e){var r=De(e);function n(a,o){var i=r((a=I(a)).r,(o=I(o)).r),s=r(a.g,o.g),f=r(a.b,o.b),c=ue(a.opacity,o.opacity);return function(l){return a.r=i(l),a.g=s(l),a.b=f(l),a.opacity=c(l),a+""}}return n.gamma=t,n})(1);function Fe(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(o){for(a=0;a<r;++a)n[a]=t[a]*(1-o)+e[a]*o;return n}}function Oe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Be(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),o=new Array(r),i;for(i=0;i<n;++i)a[i]=de(t[i],e[i]);for(;i<r;++i)o[i]=e[i];return function(s){for(i=0;i<n;++i)o[i]=a[i](s);return o}}function Le(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function E(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Ue(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=de(t[a],e[a]):n[a]=e[a];return function(o){for(a in r)n[a]=r[a](o);return n}}var H=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_=new RegExp(H.source,"g");function Je(t){return function(){return t}}function Ke(t){return function(e){return t(e)+""}}function Qe(t,e){var r=H.lastIndex=_.lastIndex=0,n,a,o,i=-1,s=[],f=[];for(t=t+"",e=e+"";(n=H.exec(t))&&(a=_.exec(e));)(o=a.index)>r&&(o=e.slice(r,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(a=a[0])?s[i]?s[i]+=a:s[++i]=a:(s[++i]=null,f.push({i,x:E(n,a)})),r=_.lastIndex;return r<e.length&&(o=e.slice(r),s[i]?s[i]+=o:s[++i]=o),s.length<2?f[0]?Ke(f[0].x):Je(e):(e=f.length,function(c){for(var l=0,d;l<e;++l)s[(d=f[l]).i]=d.x(c);return s.join("")})}function de(t,e){var r=typeof e,n;return e==null||r==="boolean"?q(e):(r==="number"?E:r==="string"?(n=N(e))?(e=n,W):Qe:e instanceof N?W:e instanceof Date?Le:Oe(e)?Fe:Array.isArray(e)?Be:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ue:E)(t,e)}export{Ze as T,W as a,Qe as b,N as c,de as d,Ye as e,E as i};
@@ -1 +1 @@
1
- import{c as Y,r as V,j as i}from"./index-BdoGlqOh.js";import{c as n}from"./button-BQMZIX_4.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
1
+ import{c as Y,r as V,j as i}from"./index-skH-OUyO.js";import{c as n}from"./button-Dh_UOMtF.js";const Z={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function oe(J){const e=Y.c(66),{value:o,onValueChange:l,options:t,size:D,fullWidth:F,className:W}=J,K=D===void 0?"sm":D,w=F===void 0?!1:F,G=V.useRef(null),H=V.useRef(null);let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R={left:0,width:0,opacity:0},e[0]=R):R=e[0];const[N,O]=V.useState(R);let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=S=>{if(!S.current)return;const{offsetLeft:U,offsetWidth:X}=S.current;O({left:U,width:X,opacity:1})},e[1]=_):_=e[1];const Q=_;let C;e[2]!==t[0].value||e[3]!==o?(C=()=>{const S=o===t[0].value?G:H;Q(S)},e[2]=t[0].value,e[3]=o,e[4]=C):C=e[4];let E;e[5]!==t||e[6]!==o?(E=[o,t],e[5]=t,e[6]=o,e[7]=E):E=e[7],V.useEffect(C,E);const s=Z[K];let a;e[8]!==W?(a=n("relative flex gap-0 bg-muted rounded-lg",W),e[8]=W,e[9]=a):a=e[9];let c;e[10]!==l||e[11]!==t[0].value?(c=()=>l(t[0].value),e[10]=l,e[11]=t[0].value,e[12]=c):c=e[12];const $=w?"flex-1 h-12 px-4":s.button,I=!w&&t[0].label?"px-3":"";let r;e[13]!==I||e[14]!==$?(r=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",$,I),e[13]=I,e[14]=$,e[15]=r):r=e[15];const P=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==s.icon||e[17]!==P?(u=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,P),e[16]=s.icon,e[17]=P,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=i.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let d;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(d=t[0].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=d):d=e[25];let m;e[26]!==r||e[27]!==f||e[28]!==d||e[29]!==c?(m=i.jsxs("button",{ref:G,type:"button",onClick:c,className:r,children:[f,d]}),e[26]=r,e[27]=f,e[28]=d,e[29]=c,e[30]=m):m=e[30];let x;e[31]!==l||e[32]!==t[1].value?(x=()=>l(t[1].value),e[31]=l,e[32]=t[1].value,e[33]=x):x=e[33];const L=w?"flex-1 h-12 px-4":s.button,M=!w&&t[1].label?"px-3":"";let p;e[34]!==L||e[35]!==M?(p=n("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",L,M),e[34]=L,e[35]=M,e[36]=p):p=e[36];const T=o===t[1].value?"text-foreground":"text-muted-foreground";let b;e[37]!==s.icon||e[38]!==T?(b=n("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",s.icon,T),e[37]=s.icon,e[38]=T,e[39]=b):b=e[39];let v;e[40]!==t[1].icon||e[41]!==b?(v=i.jsx("span",{className:b,children:t[1].icon}),e[40]=t[1].icon,e[41]=b,e[42]=v):v=e[42];let g;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(g=t[1].label&&i.jsx("span",{className:n("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=g):g=e[46];let h;e[47]!==x||e[48]!==p||e[49]!==v||e[50]!==g?(h=i.jsxs("button",{ref:H,type:"button",onClick:x,className:p,children:[v,g]}),e[47]=x,e[48]=p,e[49]=v,e[50]=g,e[51]=h):h=e[51];const q=w?"h-12":s.button;let y;e[52]!==q?(y=n("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",q),e[52]=q,e[53]=y):y=e[53];const A=`${N.left}px`,B=`${N.width}px`;let j;e[54]!==N.opacity||e[55]!==A||e[56]!==B?(j={left:A,width:B,opacity:N.opacity},e[54]=N.opacity,e[55]=A,e[56]=B,e[57]=j):j=e[57];let z;e[58]!==y||e[59]!==j?(z=i.jsx("div",{className:y,style:j}),e[58]=y,e[59]=j,e[60]=z):z=e[60];let k;return e[61]!==m||e[62]!==h||e[63]!==z||e[64]!==a?(k=i.jsxs("div",{className:a,children:[m,h,z]}),e[61]=m,e[62]=h,e[63]=z,e[64]=a,e[65]=k):k=e[65],k}export{oe as V};
@@ -1 +1 @@
1
- import{a as L,f as P,r as v,j as e,c as k}from"./index-BdoGlqOh.js";import{d as _}from"./well-known-mcp-DOEdYmKO.js";import{C as R}from"./collection-tab-Ct4krCcB.js";import{a as z,u as A}from"./use-connection-W2V2j8pE.js";import{u as B}from"./project-context-provider-DhgIBvJ2.js";import{B as y}from"./button-BQMZIX_4.js";import{E as F}from"./empty-state-DeORHrTg.js";import{C as M}from"./collection-header-BfNxri-N.js";import{b as O,a as H}from"./use-binding-CdMfLY85.js";import{i as T}from"./Loading01-wy6i08TR.js";import"./generate-id-Dyweu44Y.js";import"./connection-BdWKvn2K.js";import"./collection-display-button-Bi_NXbuN.js";import"./dropdown-menu-Cwg_0qoi.js";import"./Grid01-Bf8eAyhK.js";import"./ArrowUp-VMKONnWJ.js";import"./Check-Clnl6VO2.js";import"./List-C6tpn114.js";import"./tooltip-DSjdME5j.js";import"./view-mode-toggle-DdRtk7o-.js";import"./collection-search-9baWd84b.js";import"./SearchMd-DsK25qy7.js";import"./input-B0JGK4qg.js";import"./card-B-rrjyBF.js";import"./Copy01-CCfh45Hm.js";import"./DotsVertical-CubHWPM8.js";import"./Edit01-tXex8wx0.js";import"./use-list-state-DNPGmD9A.js";import"./use-mobile-DPzmQj9d.js";import"./Trash01-pB5oOXYU.js";import"./collection-table-wrapper-Cu-yqUsH.js";import"./empty-state-2SJ3WxPr.js";import"./Inbox01-BvYPvM_p.js";import"./avatar-CumXES9B.js";import"./useQuery-B_cnJjvx.js";import"./pin-to-sidebar-button-BcuLv1ea.js";import"./use-organization-settings-sFF34W-p.js";import"./useMutation-mOecCzvG.js";import"./use-collections-B_r4T3b1.js";import"./constants-BoL9C76L.js";import"./alert-dialog-BBkPKiLO.js";import"./Plus-DaMIylfN.js";import"./layout-LCGR_e4n.js";import"./ArrowLeft-Cd6RM4A6.js";import"./binder-BxHiGQ64.js";function V({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const r=z(),{org:{slug:m}}=B(),{data:h}=L.useSession(),p=P(),[a,N]=v.useState(!1),l=async()=>{if(!(!o||!h?.user?.id)){N(!0);try{const c=await r.create.mutateAsync(o);s?.(c.id),p({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{N(!1)}}},j=()=>{p({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(F,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(y,{variant:"outline",onClick:l,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(y,{variant:"outline",onClick:j,children:"Custom Connection"})]})})}function q(i){const t=k.c(28),{bindingName:o,collectionName:n,title:s,emptyState:r,wellKnownMcp:m}=i,{org:h}=B(),p=A();let a;t[0]!==p||t[1]!==o?(a={connections:p,binding:o},t[0]=p,t[1]=o,t[2]=a):a=t[2];const l=O(a)[0],j=H(l);let c;if(t[3]!==n||t[4]!==j){let C;t[6]!==n?(C=$=>$.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=C):C=t[7],c=j.find(C),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const S=c,[E,W]=v.useState(null),b=l&&S&&(l.id||E);let d;t[8]!==s?(d=e.jsx(M,{title:s}),t[8]=s,t[9]=d):d=t[9];let I;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=e.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=I):I=t[10];let f;t[11]!==s?(f=s.toLowerCase(),t[11]=s,t[12]=f):f=t[12];let u;t[13]!==f?(u=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[I,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",f,"..."]})]}),t[13]=f,t[14]=u):u=t[14];let g;t[15]!==S||t[16]!==l||t[17]!==r||t[18]!==h||t[19]!==b||t[20]!==m?(g=b?e.jsx(R,{connectionId:l.id,org:h.slug,activeCollection:S}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(V,{title:r.title,description:r.description,wellKnownMcp:m,imageSrc:r.imageSrc,onConnected:C=>{W(C)}})}),t[15]=S,t[16]=l,t[17]=r,t[18]=h,t[19]=b,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==u||t[23]!==g?(x=e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(v.Suspense,{fallback:u,children:g})}),t[22]=u,t[23]=g,t[24]=x):x=t[24];let w;return t[25]!==d||t[26]!==x?(w=e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[d,x]}),t[25]=d,t[26]=x,t[27]=w):w=t[27],w}function zt(){const i=k.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:_()}),i[0]=t):t=i[0],t}export{zt as default};
1
+ import{a as L,f as P,r as v,j as e,c as k}from"./index-skH-OUyO.js";import{d as _}from"./well-known-mcp-DOEdYmKO.js";import{C as R}from"./collection-tab-BQzpUnQW.js";import{a as z,u as A}from"./use-connection-BY9aOm7H.js";import{u as B}from"./project-context-provider-Ci1EHyGR.js";import{B as y}from"./button-Dh_UOMtF.js";import{E as F}from"./empty-state-DhpaMqQD.js";import{C as M}from"./collection-header-Cn-YMrm9.js";import{b as O,a as H}from"./use-binding-R6SoNecZ.js";import{i as T}from"./Loading01-BtKovu_m.js";import"./generate-id-Dyweu44Y.js";import"./connection-DuIRkEvB.js";import"./collection-display-button-DKfm8yFW.js";import"./dropdown-menu-T7u8fl7N.js";import"./Grid01-XLGz76ym.js";import"./ArrowUp-BDjaIiFu.js";import"./Check-Cs5AiVxS.js";import"./List-DWWQESNh.js";import"./tooltip-DgJ4R-G6.js";import"./view-mode-toggle-Z5AVjYj0.js";import"./collection-search-Bm9HY_m8.js";import"./SearchMd-DwKDi1yz.js";import"./input-CdlPz8Vq.js";import"./card-Bjs7HBa2.js";import"./Copy01-B_oHlu2-.js";import"./DotsVertical-HKe7Lpcg.js";import"./Edit01-CcxqoKWW.js";import"./use-list-state-B0HVVNOr.js";import"./use-mobile-CZeMkOxo.js";import"./Trash01-DCb3R_1E.js";import"./collection-table-wrapper-CnCS_a8f.js";import"./empty-state-ylKJe6-v.js";import"./Inbox01-1DQwZbO-.js";import"./avatar-noXapmql.js";import"./useQuery-FRehIqtM.js";import"./pin-to-sidebar-button-C5qdidS1.js";import"./use-organization-settings-8tWqPbhq.js";import"./useMutation-n0xwrWOz.js";import"./use-collections-CC15C_nK.js";import"./constants-C1rpewgJ.js";import"./alert-dialog-CNXrLp-S.js";import"./Plus-CPExS1G1.js";import"./layout-DopLDDPE.js";import"./ArrowLeft-m6KeIjPT.js";import"./binder-DZT62WgB.js";function V({title:i,description:t,wellKnownMcp:o,imageSrc:n,onConnected:s}){const r=z(),{org:{slug:m}}=B(),{data:h}=L.useSession(),p=P(),[a,N]=v.useState(!1),l=async()=>{if(!(!o||!h?.user?.id)){N(!0);try{const c=await r.create.mutateAsync(o);s?.(c.id),p({to:"/$org/mcps/$connectionId",params:{org:m,connectionId:c.id}})}finally{N(!1)}}},j=()=>{p({to:"/$org/mcps",params:{org:m},search:{action:"create"}})};return e.jsx(F,{image:n?e.jsx("img",{src:n,alt:i,width:336,height:320,className:"max-w-full h-auto"}):null,title:i,description:t,actions:e.jsxs(e.Fragment,{children:[e.jsxs(y,{variant:"outline",onClick:l,disabled:a||!o,children:[o?.icon&&e.jsx("img",{src:o.icon,alt:"",className:"size-4"}),a?"Installing...":`Install ${o?.title||"MCP"}`]}),e.jsx(y,{variant:"outline",onClick:j,children:"Custom Connection"})]})})}function q(i){const t=k.c(28),{bindingName:o,collectionName:n,title:s,emptyState:r,wellKnownMcp:m}=i,{org:h}=B(),p=A();let a;t[0]!==p||t[1]!==o?(a={connections:p,binding:o},t[0]=p,t[1]=o,t[2]=a):a=t[2];const l=O(a)[0],j=H(l);let c;if(t[3]!==n||t[4]!==j){let C;t[6]!==n?(C=$=>$.name.toLowerCase()===n.toLowerCase(),t[6]=n,t[7]=C):C=t[7],c=j.find(C),t[3]=n,t[4]=j,t[5]=c}else c=t[5];const S=c,[E,W]=v.useState(null),b=l&&S&&(l.id||E);let d;t[8]!==s?(d=e.jsx(M,{title:s}),t[8]=s,t[9]=d):d=t[9];let I;t[10]===Symbol.for("react.memo_cache_sentinel")?(I=e.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t[10]=I):I=t[10];let f;t[11]!==s?(f=s.toLowerCase(),t[11]=s,t[12]=f):f=t[12];let u;t[13]!==f?(u=e.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[I,e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",f,"..."]})]}),t[13]=f,t[14]=u):u=t[14];let g;t[15]!==S||t[16]!==l||t[17]!==r||t[18]!==h||t[19]!==b||t[20]!==m?(g=b?e.jsx(R,{connectionId:l.id,org:h.slug,activeCollection:S}):e.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:e.jsx(V,{title:r.title,description:r.description,wellKnownMcp:m,imageSrc:r.imageSrc,onConnected:C=>{W(C)}})}),t[15]=S,t[16]=l,t[17]=r,t[18]=h,t[19]=b,t[20]=m,t[21]=g):g=t[21];let x;t[22]!==u||t[23]!==g?(x=e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx(v.Suspense,{fallback:u,children:g})}),t[22]=u,t[23]=g,t[24]=x):x=t[24];let w;return t[25]!==d||t[26]!==x?(w=e.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[d,x]}),t[25]=d,t[26]=x,t[27]=w):w=t[27],w}function zt(){const i=k.c(1);let t;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(q,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Install MCP Studio to create and manage automated workflows with multiple steps and integrations."},wellKnownMcp:_()}),i[0]=t):t=i[0],t}export{zt as default};
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <title>MCP Mesh</title>
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
- <script type="module" crossorigin src="/assets/index-BdoGlqOh.js"></script>
7
- <link rel="stylesheet" crossorigin href="/assets/index-Dh9ePU0t.css">
6
+ <script type="module" crossorigin src="/assets/index-skH-OUyO.js"></script>
7
+ <link rel="stylesheet" crossorigin href="/assets/index-H07QDM93.css">
8
8
  </head>
9
9
  <body>
10
10
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.19.0",
3
+ "version": "2.20.1",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  "@decocms/runtime": "workspace:*",
55
55
  "@decocms/vite-plugin": "workspace:*",
56
56
  "@hookform/resolvers": "^5.2.2",
57
- "@modelcontextprotocol/sdk": "1.25.1",
57
+ "@modelcontextprotocol/sdk": "1.25.2",
58
58
  "@monaco-editor/react": "^4.7.0",
59
59
  "@opentelemetry/api": "^1.9.0",
60
60
  "@opentelemetry/exporter-prometheus": "^0.208.0",
@@ -1 +0,0 @@
1
- import{c as ne,j as t,K as it,f as nt,k as lt,a as rt,r as at,t as ct}from"./index-BdoGlqOh.js";import{g as Ke}from"./generate-id-Dyweu44Y.js";import{c as Le}from"./connection-BdWKvn2K.js";import{C as Re}from"./collection-display-button-Bi_NXbuN.js";import{C as dt}from"./collection-search-9baWd84b.js";import{C as mt}from"./card-B-rrjyBF.js";import{I as Ve,E as ft}from"./empty-state-DeORHrTg.js";import{b as qe,D as Ge,a as We,c as F}from"./dropdown-menu-Cwg_0qoi.js";import{B as Oe}from"./button-BQMZIX_4.js";import{a as He}from"./Copy01-CCfh45Hm.js";import{i as Je}from"./DotsVertical-CubHWPM8.js";import{i as Qe}from"./Edit01-tXex8wx0.js";import{s as Ye,u as ut}from"./use-list-state-DNPGmD9A.js";import{s as Xe}from"./Trash01-pB5oOXYU.js";import{C as pt}from"./collection-table-wrapper-Cu-yqUsH.js";import{E as Me}from"./empty-state-2SJ3WxPr.js";import{n as Ue}from"./Inbox01-BvYPvM_p.js";import{A as ze}from"./avatar-CumXES9B.js";import{u as ht}from"./useQuery-B_cnJjvx.js";import{P as xt}from"./pin-to-sidebar-button-BcuLv1ea.js";import{b as gt}from"./use-connection-W2V2j8pE.js";import{a as jt,b as Ct}from"./use-collections-B_r4T3b1.js";import{B as vt}from"./constants-BoL9C76L.js";import{A as bt,g as yt,c as Nt,b as wt,d as St,e as _t,a as Dt,f as At}from"./alert-dialog-BBkPKiLO.js";import{s as Tt}from"./Plus-DaMIylfN.js";import{V as $t}from"./layout-LCGR_e4n.js";function It(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const d=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of d)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Pt(n){const e=ne.c(25),{item:s,schema:d,actions:i}=n;let l;e[0]!==s||e[1]!==d?(l=It(d,s),e[0]=s,e[1]=d,e[2]=l):l=e[2];const a=l,c=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let f;e[3]!==i?(f=i&&Object.keys(i).length>0,e[3]=i,e[4]=f):f=e[4];const o=f;let u;e[5]!==a||e[6]!==s.title?(u=t.jsx(Ve,{icon:a,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=a,e[6]=s.title,e[7]=u):u=e[7];let v;e[8]!==s.title?(v=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=v):v=e[9];const h=c||"No description";let m;e[10]!==h?(m=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=m):m=e[11];let x;e[12]!==v||e[13]!==m?(x=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[v,m]}),e[12]=v,e[13]=m,e[14]=x):x=e[14];let y;e[15]!==u||e[16]!==x?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[u,x]}),e[15]=u,e[16]=x,e[17]=y):y=e[17];let j;e[18]!==i||e[19]!==o||e[20]!==s?(j=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:kt,onMouseDown:Ot,children:t.jsxs(qe,{children:[t.jsx(Ge,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:t.jsx(Je,{size:20})})}),t.jsxs(We,{align:"end",onClick:Et,children:[i.open&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.open?.(s)},children:[t.jsx(Ye,{size:16}),"Open"]}),i.edit&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.edit?.(s)},children:[t.jsx(Qe,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(F,{onClick:r=>{r.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(He,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(F,{variant:"destructive",onClick:r=>{r.stopPropagation(),i.delete?.(s)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=j):j=e[21];let S;return e[22]!==y||e[23]!==j?(S=t.jsxs(mt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,j]}),e[22]=y,e[23]=j,e[24]=S):S=e[24],S}function Et(n){return n.stopPropagation()}function zt(n){return n.stopPropagation()}function Ot(n){return n.stopPropagation()}function kt(n){return n.stopPropagation()}function Ft(n){const e=ne.c(9);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Le(),e[0]=s):s=e[0];const d=s;let i;e[1]!==n?(i=it.user(n),e[1]=n,e[2]=i):i=e[2];let l;e[3]!==n?(l=async()=>(await d("USER_GET",{id:n})).user,e[3]=n,e[4]=l):l=e[4];const a=!!n;let c;return e[5]!==i||e[6]!==l||e[7]!==a?(c={queryKey:i,queryFn:l,staleTime:3e5,retry:1,enabled:a},e[5]=i,e[6]=l,e[7]=a,e[8]=c):c=e[8],ht(c)}function Kt(n){const e=ne.c(33),{id:s,size:d,showEmail:i,className:l}=n,a=d===void 0?"xs":d,c=i===void 0?!1:i,{data:f,isLoading:o,isError:u}=Ft(s);if(o){const r=`flex items-center gap-2 ${l||""}`;let g;e[0]!==a?(g=t.jsx(ze.Skeleton,{shape:"circle",size:a}),e[0]=a,e[1]=g):g=e[1];let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[2]=C):C=e[2];let p;e[3]!==c?(p=c&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[3]=c,e[4]=p):p=e[4];let _;e[5]!==p?(_=t.jsxs("div",{className:"flex flex-col gap-1",children:[C,p]}),e[5]=p,e[6]=_):_=e[6];let b;return e[7]!==r||e[8]!==g||e[9]!==_?(b=t.jsxs("div",{className:r,children:[g,_]}),e[7]=r,e[8]=g,e[9]=_,e[10]=b):b=e[10],b}if(u||!f){const r=`flex items-center gap-2 ${l||""}`;let g;e[11]!==a?(g=t.jsx(ze,{shape:"circle",size:a,fallback:"?",muted:!0}),e[11]=a,e[12]=g):g=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[13]=C):C=e[13];let p;return e[14]!==r||e[15]!==g?(p=t.jsxs("div",{className:r,children:[g,C]}),e[14]=r,e[15]=g,e[16]=p):p=e[16],p}const v=`flex items-center gap-2 ${l||""}`,h=f.image??void 0;let m;e[17]!==a||e[18]!==h||e[19]!==f.name?(m=t.jsx(ze,{shape:"circle",size:a,url:h,fallback:f.name}),e[17]=a,e[18]=h,e[19]=f.name,e[20]=m):m=e[20];let x;e[21]!==f.name?(x=t.jsx("div",{className:"text-sm font-medium",children:f.name}),e[21]=f.name,e[22]=x):x=e[22];let y;e[23]!==c||e[24]!==f.email?(y=c&&t.jsx("div",{className:"text-xs text-muted-foreground",children:f.email}),e[23]=c,e[24]=f.email,e[25]=y):y=e[25];let j;e[26]!==x||e[27]!==y?(j=t.jsxs("div",{className:"flex flex-col",children:[x,y]}),e[26]=x,e[27]=y,e[28]=j):j=e[28];let S;return e[29]!==v||e[30]!==m||e[31]!==j?(S=t.jsxs("div",{className:v,children:[m,j]}),e[29]=v,e[30]=m,e[31]=j,e[32]=S):S=e[32],S}const Mt=["icon","avatar","logo"],Be=["created_at","created_by","id"];function Ut(n){return Object.keys(n).find(e=>Mt.includes(e.toLowerCase()))}function Ze(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Bt(n){const e=ne.c(32),{data:s,schema:d,viewMode:i,onViewModeChange:l,search:a,sortKey:c,sortDirection:f,onSort:o,actions:u,onItemClick:v,headerActions:h,emptyState:m,readOnly:x,columns:y,hideToolbar:j,sortableFields:S}=n,r=l===void 0?Gt:l,g=f===void 0?"asc":f,C=o===void 0?qt:o;let p;e[0]!==u?(p=u===void 0?{}:u,e[0]=u,e[1]=p):p=e[1];const _=p,b=v===void 0?Vt:v,I=h===void 0?null:h,T=m===void 0?null:m,E=x===void 0?!1:x,N=y===void 0?void 0:y,P=j===void 0?!1:j,D=S===void 0?void 0:S;let z;e[2]!==N||e[3]!==d||e[4]!==D?(z=N?N.filter(Rt).filter(k=>!D||D.includes(k.id)).map(Lt):Ze(d,D),e[2]=N,e[3]=d,e[4]=D,e[5]=z):z=e[5];const K=z;let $;e[6]!==I||e[7]!==P||e[8]!==C||e[9]!==r||e[10]!==g||e[11]!==c||e[12]!==K||e[13]!==i?($=!P&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:I}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Re,{viewMode:i,onViewModeChange:r,sortKey:c,sortDirection:g,onSort:C,sortOptions:K})})]})}),e[6]=I,e[7]=P,e[8]=C,e[9]=r,e[10]=g,e[11]=c,e[12]=K,e[13]=i,e[14]=$):$=e[14];let A;e[15]!==_||e[16]!==N||e[17]!==s||e[18]!==T||e[19]!==b||e[20]!==C||e[21]!==E||e[22]!==d||e[23]!==a||e[24]!==g||e[25]!==c||e[26]!==D||e[27]!==i?(A=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:T||t.jsx(Me,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(k=>t.jsx("div",{onClick:()=>b?.(k),className:"cursor-pointer h-full",children:t.jsx(Pt,{item:k,schema:d,readOnly:E,actions:_})},k.id))})}):t.jsx(pt,{columns:Jt(N,d,D,_),data:s,sortKey:c,sortDirection:g,onSort:C,onRowClick:b,emptyState:T||t.jsx(Me,{icon:t.jsx(Ue,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=N,e[17]=s,e[18]=T,e[19]=b,e[20]=C,e[21]=E,e[22]=d,e[23]=a,e[24]=g,e[25]=c,e[26]=D,e[27]=i,e[28]=A):A=e[28];let O;return e[29]!==$||e[30]!==A?(O=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[$,A]}),e[29]=$,e[30]=A,e[31]=O):O=e[31],O}function Lt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Rt(n){return n.sortable!==!1}function Vt(){}function qt(){}function Gt(){}function Wt(n){return{id:"actions",header:"",render:e=>t.jsxs(qe,{children:[t.jsx(Ge,{asChild:!0,children:t.jsx(Oe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Je,{size:20})})}),t.jsxs(We,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ye,{size:16}),"Open"]}),n.edit&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Qe,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(F,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(He,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(F,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Xe,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function et(n){const e=n.type;return Array.isArray(e)?e.every(s=>et({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Ht(n,e){const s=n.properties||{},d=Object.keys(s).filter(o=>{const u=s[o];return u&&et(u)}),i=Ut(s),l=[],a=new Set;i&&d.includes(i)&&(l.push(i),a.add(i));const c=["title","description","updated_at","updated_by"];for(const o of c)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));const f=d.filter(o=>!a.has(o)&&!Be.includes(o)).sort((o,u)=>o.localeCompare(u));for(const o of f)l.push(o),a.add(o);for(const o of Be)d.includes(o)&&!a.has(o)&&(l.push(o),a.add(o));return l.map(o=>{const u=s[o],v=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:h=>{const m=h[o];return t.jsx(Ve,{icon:m,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(m)})},sortable:v,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx(Kt,{id:String(m),size:"xs"}):"—"},sortable:v,cellClassName:"max-w-[250px]"}:u?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m?t.jsx("span",{className:"block truncate max-w-full",children:new Date(m).toLocaleDateString()}):"—"},sortable:v,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const m=h[o];return m==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(m)})},sortable:v,cellClassName:"max-w-[200px]"}})}function Jt(n,e,s,d){const i=n||Ht(e,s);return i.some(c=>c.id==="actions")?i:Object.keys(d).length>0?[...i,Wt(d)]:i}function Ns(n){const e=ne.c(117),{connectionId:s,org:d,activeCollection:i}=n,l=i.name,a=i.schema??vt,c=i.hasCreateTool,f=i.hasUpdateTool,o=i.hasDeleteTool,u=nt(),h=lt().location.href,{data:m}=rt.useSession(),x=m?.user?.id||"unknown",y=gt(s);let j;e[0]!==s?(j=Le(s),e[0]=s,e[1]=j):j=e[1];const S=j,r=jt(s,l,S),g=`${s}-${l}`;let C;e[2]!==d||e[3]!==g?(C={namespace:d,resource:g,defaultSortKey:"updated_at"},e[2]=d,e[3]=g,e[4]=C):C=e[4];const{search:p,searchTerm:_,setSearch:b,viewMode:I,setViewMode:T,sortKey:E,sortDirection:N,handleSort:P}=ut(C);let D;e[5]!==_||e[6]!==N||e[7]!==E?(D={searchTerm:_,sortKey:E,sortDirection:N},e[5]=_,e[6]=N,e[7]=E,e[8]=D):D=e[8];const z=Ct(s,l,S,D),K=!c&&!f&&!o;let $;e[9]!==l||e[10]!==s||e[11]!==u||e[12]!==d?($=w=>{u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:w.id}})},e[9]=l,e[10]=s,e[11]=u,e[12]=d,e[13]=$):$=e[13];const A=$;let O;e[14]!==r.create||e[15]!==x?(O=async w=>{const he=new Date().toISOString();await r.create.mutateAsync({...w,id:Ke("conn"),title:`${w.title} (Copy)`,created_at:he,updated_at:he,created_by:x,updated_by:x})},e[14]=r.create,e[15]=x,e[16]=O):O=e[16];const k=O,[M,xe]=at.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=w=>{xe(w)},e[17]=le):le=e[17];const tt=le;let U;e[18]!==A||e[19]!==f?(U=f&&{edit:A},e[18]=A,e[19]=f,e[20]=U):U=e[20];let B;e[21]!==k||e[22]!==c?(B=c&&{duplicate:k},e[21]=k,e[22]=c,e[23]=B):B=e[23];let L;e[24]!==o?(L=o&&{delete:tt},e[24]=o,e[25]=L):L=e[25];let re;e[26]!==L||e[27]!==U||e[28]!==B?(re={...U,...B,...L},e[26]=L,e[27]=U,e[28]=B,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==r.delete||e[31]!==M?(ae=async()=>{M&&(await r.delete.mutateAsync(M.id),xe(null))},e[30]=r.delete,e[31]=M,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==r.create||e[34]!==l||e[35]!==s||e[36]!==c||e[37]!==u||e[38]!==d||e[39]!==x?(ce=async()=>{if(!c){ct.error("Create operation is not available for this collection");return}const w=new Date().toISOString(),he={id:Ke("conn"),title:"New Item",description:"A brief description of the item",created_at:w,updated_at:w,created_by:x,updated_by:x};try{const Ee=await r.create.mutateAsync(he);u({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:d,connectionId:s,collectionName:l,itemId:Ee.id}})}catch(Ee){console.error("Failed to create item:",Ee)}},e[33]=r.create,e[34]=l,e[35]=s,e[36]=c,e[37]=u,e[38]=d,e[39]=x,e[40]=ce):ce=e[40];const Ce=ce;let de;e[41]!==a?(de=Ze(a),e[41]=a,e[42]=de):de=e[42];const ve=de,ke=(z?.length??0)>0,st=c&&ke,ot=c&&!ke&&!p;let me;e[43]!==r.create||e[44]!==Ce||e[45]!==c?(me=c?t.jsxs(Oe,{onClick:Ce,size:"sm",disabled:r.create.isPending,className:"h-7",children:[t.jsx(Tt,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=Ce,e[45]=c,e[46]=me):me=e[46];const Fe=me,be=E;let R;e[47]!==P||e[48]!==T||e[49]!==N||e[50]!==ve||e[51]!==be||e[52]!==I?(R=t.jsx(Re,{viewMode:I,onViewModeChange:T,sortKey:be,sortDirection:N,onSort:P,sortOptions:ve}),e[47]=P,e[48]=T,e[49]=N,e[50]=ve,e[51]=be,e[52]=I,e[53]=R):R=e[53];const ye=`${l}s`,Ne=y?.icon??"grid_view";let V;e[54]!==ye||e[55]!==Ne||e[56]!==h?(V=t.jsx(xt,{title:ye,url:h,icon:Ne}),e[54]=ye,e[55]=Ne,e[56]=h,e[57]=V):V=e[57];const we=st&&Fe;let q;e[58]!==R||e[59]!==V||e[60]!==we?(q=t.jsxs($t,{children:[R,V,we]}),e[58]=R,e[59]=V,e[60]=we,e[61]=q):q=e[61];const Se=`Search ${l}...`;let G;e[62]!==b?(G=w=>{w.key==="Escape"&&(b(""),w.target.blur())},e[62]=b,e[63]=G):G=e[63];let W;e[64]!==p||e[65]!==b||e[66]!==Se||e[67]!==G?(W=t.jsx(dt,{value:p,onChange:b,placeholder:Se,onKeyDown:G}),e[64]=p,e[65]=b,e[66]=Se,e[67]=G,e[68]=W):W=e[68];let H;e[69]!==z?(H=z??[],e[69]=z,e[70]=H):H=e[70];const _e=E;let J;e[71]!==A?(J=w=>A(w),e[71]=A,e[72]=J):J=e[72];const De="No items found",Ae=p?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=ot?Fe:void 0;let Q;e[73]!==De||e[74]!==Ae||e[75]!==Te?(Q=t.jsx(ft,{image:null,title:De,description:Ae,actions:Te}),e[73]=De,e[74]=Ae,e[75]=Te,e[76]=Q):Q=e[76];let Y;e[77]!==P||e[78]!==K||e[79]!==ge||e[80]!==a||e[81]!==p||e[82]!==b||e[83]!==T||e[84]!==N||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Q||e[89]!==I?(Y=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Bt,{hideToolbar:!0,data:H,schema:a,viewMode:I,onViewModeChange:T,search:p,onSearchChange:b,sortKey:_e,sortDirection:N,onSort:P,actions:ge,onItemClick:J,readOnly:K,emptyState:Q})}),e[77]=P,e[78]=K,e[79]=ge,e[80]=a,e[81]=p,e[82]=b,e[83]=T,e[84]=N,e[85]=H,e[86]=_e,e[87]=J,e[88]=Q,e[89]=I,e[90]=Y):Y=e[90];let X;e[91]!==W||e[92]!==Y?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,Y]}),e[91]=W,e[92]=Y,e[93]=X):X=e[93];const $e=!!M;let fe;e[94]===Symbol.for("react.memo_cache_sentinel")?(fe=w=>{w||xe(null)},e[94]=fe):fe=e[94];let ue;e[95]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(Nt,{children:"Delete item?"}),e[95]=ue):ue=e[95];const Ie=M?.title;let Z;e[96]!==Ie?(Z=t.jsxs(wt,{children:[ue,t.jsxs(St,{children:['Are you sure you want to delete "',Ie,'"? This action cannot be undone.']})]}),e[96]=Ie,e[97]=Z):Z=e[97];let ee;e[98]!==r.delete.isPending?(ee=t.jsx(bt,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=ee):ee=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let te;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(te=t.jsx(yt,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(_t,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==Z||e[108]!==se?(oe=t.jsxs(Dt,{children:[Z,se]}),e[107]=Z,e[108]=se,e[109]=oe):oe=e[109];let ie;e[110]!==$e||e[111]!==oe?(ie=t.jsx(At,{open:$e,onOpenChange:fe,children:oe}),e[110]=$e,e[111]=oe,e[112]=ie):ie=e[112];let pe;return e[113]!==q||e[114]!==X||e[115]!==ie?(pe=t.jsxs(t.Fragment,{children:[q,X,ie]}),e[113]=q,e[114]=X,e[115]=ie,e[116]=pe):pe=e[116],pe}export{Ns as C};
@@ -1 +0,0 @@
1
- import{aJ as a,bo as o}from"./index-BdoGlqOh.js";const e="mcp.mesh",s=a(o,{target:"draft-7"});export{s as B,e as M};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-vZ2Zpkzy.js","assets/index-BdoGlqOh.js","assets/index-Dh9ePU0t.css","assets/button-BQMZIX_4.js","assets/AlertCircle-DZfqNByx.js","assets/Download01-DUxaWCdv.js","assets/File06-1GHbOIr4.js","assets/Image01-Ba0mxAoN.js","assets/Loading01-wy6i08TR.js","assets/Trash01-pB5oOXYU.js","assets/Upload01-BRGUFGKZ.js","assets/useMutation-mOecCzvG.js","assets/useQuery-B_cnJjvx.js","assets/useInfiniteQuery-Bx9UQHNH.js","assets/infiniteQueryObserver-B-zosqIG.js","assets/checkbox-CJvAgYlu.js","assets/Check-Clnl6VO2.js","assets/Grid01-Bf8eAyhK.js","assets/Home02-8q2bbK8n.js","assets/List-C6tpn114.js"])))=>i.map(i=>d[i]);
2
- import{r as _,c as K,bM as Q,bN as A,x as Y,j as t,t as B,aV as X,bL as ee}from"./index-BdoGlqOh.js";import{u as te}from"./useInfiniteQuery-Bx9UQHNH.js";import{B as M}from"./button-BQMZIX_4.js";import{C as D}from"./checkbox-CJvAgYlu.js";import{i as se}from"./AlertCircle-DZfqNByx.js";import{c as H,i as ae}from"./Grid01-Bf8eAyhK.js";import{n as ie}from"./Download01-DUxaWCdv.js";import{a as re}from"./Home02-8q2bbK8n.js";import{i as V}from"./List-C6tpn114.js";import{i as $}from"./Loading01-wy6i08TR.js";import{s as W}from"./Trash01-pB5oOXYU.js";import{i as U}from"./Upload01-BRGUFGKZ.js";import{u as G}from"./useMutation-mOecCzvG.js";const J=({size:s=24,color:e="currentColor",...a})=>_.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},_.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"}));J.displayName="File02";const Z=({size:s=24,color:e="currentColor",...a})=>_.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},_.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}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async 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=_.lazy(()=>X(()=>import("./grid-view-vZ2Zpkzy.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(J,{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(M,{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(W,{size:14}),e[36]=P):P=e[36];let F;e[37]!==C?(F=t.jsx(M,{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]=_.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=_.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{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(M,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(M,{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(M,{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(_.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(M,{variant:a==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(H,{size:16})}),t.jsx(M,{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(M,{variant:"outline",size:"sm",className:"text-destructive",onClick:F,disabled:z.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(M,{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(M,{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,J as i,Z as s,ne as u};
@@ -1 +0,0 @@
1
- import{r as S,_ as ye,y as re,I as U,z as w,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-BdoGlqOh.js";import{I as Ee,E as rt}from"./empty-state-DeORHrTg.js";import{E as Ve}from"./error-boundary-KUKN2TxD.js";import{C as Ge}from"./checkbox-CJvAgYlu.js";import{c as H,B as V}from"./button-BQMZIX_4.js";import{i as at}from"./ArrowLeft-Cd6RM4A6.js";import{u as We}from"./use-connection-W2V2j8pE.js";import{C as ct}from"./collection-search-9baWd84b.js";import{I as Pe}from"./input-B0JGK4qg.js";import{s as dt}from"./Plus-DaMIylfN.js";import{i as mt}from"./X-Bq7VzczH.js";import{P as ut}from"./pin-to-sidebar-button-BcuLv1ea.js";import{T as ft}from"./tool-set-selector-D-ihTeCw.js";import{b as ht,a as xt,i as pt}from"./use-gateway-CijYzCU9.js";import{u as gt,a as bt}from"./use-connection-resources-_fz_82N5.js";import{u as jt,a as yt}from"./use-gateway-system-prompt-CusPzWe3.js";import{s as He}from"./slugify-CEUa2lfQ.js";import{B as qe}from"./badge-tnyrO2LA.js";import{a as vt,D as St,c as Nt,d as _t}from"./dialog-BOTxth8M.js";import{F as be,a as wt,b as ve,d as Se,f as Ne,c as Ct}from"./form-o9xmUpnK.js";import{I as kt,R as It,a as Tt}from"./index-DuoIQX0P.js";import{R as $t}from"./resource-tabs-BnWaqzvN.js";import{S as Rt,a as zt,b as At,c as Et,d as Ue}from"./select--nDzC8in.js";import{S as Pt}from"./switch-BFRma3Oi.js";import{T as Mt}from"./textarea-CZGp5M36.js";import{a as Z,c as Y,b as J,T as Q}from"./tooltip-DSjdME5j.js";import{i as Ze}from"./Check-Clnl6VO2.js";import{i as Dt}from"./Code01-BAik7hF-.js";import{a as Ut}from"./Copy01-CCfh45Hm.js";import{i as Lt}from"./FlipBackward-BkcMu9OY.js";import{i as je}from"./InfoCircle-DKA0-FHH.js";import{i as ze}from"./Loading01-wy6i08TR.js";import{a as Ot,V as Bt,b as Ft}from"./layout-LCGR_e4n.js";import"./connection-BdWKvn2K.js";import"./project-context-provider-DhgIBvJ2.js";import"./use-collections-B_r4T3b1.js";import"./useMutation-mOecCzvG.js";import"./SearchMd-DsK25qy7.js";import"./use-organization-settings-sFF34W-p.js";import"./localstorage-keys-DJgrMpsR.js";import"./useQuery-B_cnJjvx.js";import"./ChevronDown-CUCzTkUk.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"),Vt=re({connection_id:w().describe("Connection ID"),selected_tools:U(w()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:U(w()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:U(w()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Gt=re({id:w().describe("Unique identifier for the gateway"),title:w().describe("Human-readable name for the gateway"),description:w().nullable().describe("Description of the gateway"),icon:w().nullable().optional().describe("Icon URL for the gateway"),created_at:w().describe("When the gateway was created"),updated_at:w().describe("When the gateway was last updated"),created_by:w().describe("User ID who created the gateway"),updated_by:w().optional().describe("User ID who last updated the gateway"),organization_id:w().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(Vt).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});re({title:w().min(1).max(255).describe("Name for the gateway"),description:w().nullable().optional().describe("Optional description"),tool_selection_mode:Me.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:w().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),connections:U(re({connection_id:w().describe("Connection ID"),selected_tools:U(w()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(w()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(w()).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:w().min(1).max(255).optional().describe("New name"),description:w().nullable().optional().describe("New description (null to clear)"),tool_selection_mode:Me.optional().describe("New tool selection mode"),icon:w().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),connections:U(re({connection_id:w().describe("Connection ID"),selected_tools:U(w()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:U(w()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:U(w()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Wt=S.memo(function(e){const s=R.c(20),{connection:l,isSelected:i,hasItemsEnabled:n,activeItemsCount:a,totalItemsCount:m,onSelect:c,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 b;s[5]!==l.title?(b=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]=b):b=s[6];let x;s[7]!==c||s[8]!==f||s[9]!==b?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[f,b]}),s[7]=c,s[8]=f,s[9]=b,s[10]=x):x=s[10];let p;s[11]!==a||s[12]!==n||s[13]!==r||s[14]!==m?(p=m>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[a,"/",m]}),t.jsx(Ge,{checked:n,onCheckedChange:r,onClick:qt})]}),s[11]=a,s[12]=n,s[13]=r,s[14]=m,s[15]=p):p=s[15];let y;return s[16]!==u||s[17]!==x||s[18]!==p?(y=t.jsxs("div",{className:u,children:[x,p]}),s[16]=u,s[17]=x,s[18]=p,s[19]=y):y=s[19],y}),Ht=S.memo(function(e){const s=R.c(18),{connectionId:l,item:i,isSelected:n,onToggle:a}=e,m=`item-${l}-${i.id}`,c=n?"text-foreground":"text-muted-foreground";let r;s[0]!==c?(r=H("text-sm font-medium",c),s[0]=c,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 b=`item-${l}-${i.id}`;let x;s[10]!==n||s[11]!==a||s[12]!==b?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Ge,{id:b,checked:n,onCheckedChange:a,onClick:Zt})}),s[10]=n,s[11]=a,s[12]=b,s[13]=x):x=s[13];let p;return s[14]!==m||s[15]!==f||s[16]!==x?(p=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:m,children:[f,x]}),s[14]=m,s[15]=f,s[16]=x,s[17]=p):p=s[17],p});function et({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:i,extraContent:n}){const[a,m]=S.useState(""),c=S.useDeferredValue(a),[r,d]=S.useState("all"),[u,f]=S.useState(!1),b=S.useRef(new Set(Object.keys(o))),x=We({searchTerm:c.trim()||void 0}),p=b.current,y=[...p.values()].map(h=>x.find(N=>N.id===h)).filter(h=>h!==void 0),j=x.filter(h=>!p.has(h.id)),v=[...y,...j],g=h=>{const N=o[h];return N!==void 0&&N.length>0},_=v.filter(h=>{if(r==="all")return!0;const N=g(h.id);return r==="selected"?N:r==="unselected"?!N:!0}),[C,I]=S.useState(v[0]?.id??null),k=C?v.find(h=>h.id===C)??null:null,P=k?s(k):[],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,I(h)),e(q)},A=h=>{I(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:m,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:_.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:_.map(h=>{const z=s(h).length,$=o[h.id]?.length??0;return t.jsx(Wt,{connection:h,isSelected:C===h.id,hasItemsEnabled:g(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:k?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:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:k.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(Ht,{connectionId:k.id,item:h,isSelected:E(k.id,h.id),onToggle:()=>L(k.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 qt(o){return o.stopPropagation()}function Zt(o){return o.stopPropagation()}function Yt(o){const e=R.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:i}=o;let n;e[0]!==i?(n=c=>(i.get(c.id)??[]).map(Jt),e[0]=i,e[1]=n):n=e[1];const a=n;let m;return e[2]!==a||e[3]!==l||e[4]!==s?(m=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]=m):m=e[5],m}function Jt(o){return{id:o.name,name:o.name,description:o.description}}function Qt(o){return o.includes("*")}function Kt(o){const e=R.c(27),{patterns:s,onAddPattern:l,onRemovePattern:i}=o,[n,a]=S.useState("");let m;e[0]!==n||e[1]!==l||e[2]!==s?(m=()=>{const f=n.trim();f&&!s.includes(f)&&(l(f),a(""))},e[0]=n,e[1]=l,e[2]=s,e[3]=m):m=e[3];const c=m;let r;e[4]!==c?(r=f=>{f.key==="Enter"&&(f.preventDefault(),c())},e[4]=c,e[5]=r):r=e[5];const d=r;let u;if(e[6]!==c||e[7]!==d||e[8]!==n||e[9]!==i||e[10]!==s){const f=s.filter(Qt);let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("code",{children:"*"}),e[12]=b):b=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 ",b," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=x):x=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=I=>a(I.target.value),e[14]=p):p=e[14];let y;e[15]!==d||e[16]!==n?(y=t.jsx(Pe,{value:n,onChange:p,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 g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(dt,{size:16}),e[20]=g):g=e[20];let _;e[21]!==c||e[22]!==v?(_=t.jsx(V,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:v,children:g}),e[21]=c,e[22]=v,e[23]=_):_=e[23];let C;e[24]!==_||e[25]!==y?(C=t.jsxs("div",{className:"flex gap-2",children:[y,_]}),e[24]=_,e[25]=y,e[26]=C):C=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,C,f.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(I=>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:I}),t.jsx("button",{type:"button",onClick:()=>i(I),className:"text-muted-foreground hover:text-foreground",children:t.jsx(mt,{size:12})})]},I))})]}),e[6]=c,e[7]=d,e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];return u}function Xt(o){const e=R.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:i}=o,[n]=S.useState(null);let a;e[0]!==i?(a=g=>(i.get(g.id)??[]).map(es),e[0]=i,e[1]=a):a=e[1];const m=a;let c;e[2]!==l||e[3]!==s?(c=(g,_)=>{const C=s[g]??[];C.includes(_)||l({...s,[g]:[...C,_]})},e[2]=l,e[3]=s,e[4]=c):c=e[4];const r=c;let d;e[5]!==l||e[6]!==s?(d=(g,_)=>{const I=(s[g]??[]).filter(k=>k!==_);if(I.length===0){const k={...s};delete k[g],l(k)}else l({...s,[g]:I})},e[5]=l,e[6]=s,e[7]=d):d=e[7];const u=d;let f;e[8]!==l?(f=g=>{l(g)},e[8]=l,e[9]=f):f=e[9];const b=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 p=x;let y;e[13]!==r||e[14]!==u||e[15]!==n||e[16]!==p?(y=n?t.jsx(Kt,{patterns:p,onAddPattern:g=>r(n,g),onRemovePattern:g=>u(n,g)}):null,e[13]=r,e[14]=u,e[15]=n,e[16]=p,e[17]=y):y=e[17];const j=y;let v;return e[18]!==j||e[19]!==m||e[20]!==b||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(et,{itemSet:s,onItemSetChange:b,getItems:m,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:j})}),e[18]=j,e[19]=m,e[20]=b,e[21]=s,e[22]=v):v=e[22],v}function es(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function ts(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(It,{"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(Tt,{"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(kt,{"data-slot":"radio-group-item",className:i,...l,children:n}),e[6]=l,e[7]=i,e[8]=a):a=e[8],a}function ss(o){const s=new TextEncoder().encode(o),l=Array.from(s,i=>String.fromCharCode(i)).join("");return btoa(l)}const os=Gt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0}).extend({title:w().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 ls(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]??[],m=l.get(n)??[],c=m.length>0&&m.every(r=>a.includes(r));return{connection_id:n,selected_tools:a.length===0||c?null:a,selected_resources:e[n]??null,selected_prompts:s[n]??null}})}function ns(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 m;e[2]!==l?(m=l?t.jsx(Ze,{size:20,className:"text-green-600"}):t.jsx(Ut,{size:20}),e[2]=l,e[3]=m):m=e[3];const c=l?"Copied!":"Copy URL";let r;e[4]!==c?(r=t.jsx("span",{className:"text-xs font-medium",children:c}),e[4]=c,e[5]=r):r=e[5];let d;return e[6]!==a||e[7]!==m||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:[m,r]}),e[6]=a,e[7]=m,e[8]=r,e[9]=d):d=e[9],d}function is(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=ss(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,m;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%)"}}),m=t.jsx("span",{className:"text-xs font-medium",children:"Install on Cursor"}),e[3]=a,e[4]=m):(a=e[3],m=e[4]);let c;return e[5]!==n?(c=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,m]}),e[5]=n,e[6]=c):c=e[6],c}function rs(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),p=`claude mcp add "${f}" --config '${x.replace(/'/g,"'\\''")}'`;await navigator.clipboard.writeText(p),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 m=a;let c;e[3]!==i?(c=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]=c):c=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]!==m||e[8]!==c||e[9]!==d?(u=t.jsxs(V,{type:"button",variant:"outline",onClick:m,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,d]}),e[7]=m,e[8]=c,e[9]=d,e[10]=u):u=e[10],u}function as(o){const e=R.c(40),{open:s,onOpenChange:l,gateway:i}=o,[n,a]=S.useState("code_execution");let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=$=>{($==="passthrough"||$==="smart_tool_selection"||$==="code_execution")&&a($)},e[0]=m):m=e[0];const c=m;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(vt,{children:t.jsx(St,{children:"Share Agent"})}),e[7]=f):f=e[7];let b;e[8]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mt-1",children:"How should this agent work?"})}),e[8]=b):b=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 p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Direct access"}),e[10]=p):p=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:[p,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 g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart discovery"}),e[14]=g):g=e[14];let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(J,{asChild:!0,children:t.jsx(je,{className:"size-3.5 text-muted-foreground"})}),e[15]=_):_=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=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:[g,t.jsx(Z,{children:t.jsxs(Y,{children:[_,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]=C):C=e[16];let I;e[17]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"p-1.5 shrink-0",children:t.jsx(Dt,{className:"size-5 text-muted-foreground"})}),e[17]=I):I=e[17];let k;e[18]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"text-sm font-medium text-foreground",children:"Smart execution"}),e[18]=k):k=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:[I,t.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[k,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:[b,t.jsxs(ts,{value:n,onValueChange:c,className:"flex flex-col gap-4.5",children:[j,C,E]})]}),e[21]=n,e[22]=L):L=e[22];let B;e[23]!==r.href?(B=t.jsx(ns,{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(is,{gatewayUrl:r.href,serverName:u}),M=t.jsx(rs,{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(Nt,{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(_t,{open:s,onOpenChange:l,children:N}),e[36]=l,e[37]=s,e[38]=N,e[39]=z):z=e[39],z}function cs(o){const e=R.c(32),{form:s,icon:l,gatewayId:i}=o,[n]=jt(),[a,m]=yt(i);let c;e[0]!==s?(c=s.watch("title")||"Agent",e[0]=s,e[1]=c):c=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(pt,{}),e[2]=r):r=e[2];let d;e[3]!==l||e[4]!==c?(d=t.jsx(Ee,{icon:l,name:c,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:r}),e[3]=l,e[4]=c,e[5]=d):d=e[5];let u;e[6]!==s.control?(u=t.jsx(be,{control:s.control,name:"status",render:fs}),e[6]=s.control,e[7]=u):u=e[7];let f;e[8]!==d||e[9]!==u?(f=t.jsxs("div",{className:"flex items-start justify-between",children:[d,u]}),e[8]=d,e[9]=u,e[10]=f):f=e[10];let b;e[11]!==s.control?(b=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:us}),t.jsx(be,{control:s.control,name:"description",render:ms})]}),e[11]=s.control,e[12]=b):b=e[12];let x;e[13]!==f||e[14]!==b?(x=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[f,b]}),e[13]=f,e[14]=b,e[15]=x):x=e[15];let p;e[16]!==n||e[17]!==s.control?(p=n&&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:ds})}),e[16]=n,e[17]=s.control,e[18]=p):p=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=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[19]=y):y=e[19];let j;e[20]!==m?(j=C=>m(C.target.value),e[20]=m,e[21]=j):j=e[21];let v;e[22]!==a||e[23]!==j?(v=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[y,t.jsx(Mt,{value:a,onChange:j,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[22]=a,e[23]=j,e[24]=v):v=e[24];let g;e[25]!==v||e[26]!==x||e[27]!==p?(g=t.jsxs("div",{className:"flex flex-col",children:[x,p,v]}),e[25]=v,e[26]=x,e[27]=p,e[28]=g):g=e[28];let _;return e[29]!==s||e[30]!==g?(_=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx(wt,{...s,children:g})}),e[29]=s,e[30]=g,e[31]=_):_=e[31],_}function ds(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ct,{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(Rt,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Se,{children:t.jsx(zt,{className:"w-[180px]",children:t.jsx(At,{})})}),t.jsxs(Et,{children:[t.jsx(Ue,{value:"inclusion",children:"Include Selected"}),t.jsx(Ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),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,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 us(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 fs(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(Pt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Ne,{})]})}function hs(o){const e=R.c(81),{gateway:s,gatewayId:l,requestedTabId:i}=o,a=ot().location.href,m=lt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/gateways/$gatewayId"},e[0]=c):c=e[0];const r=Fe(c),d=xt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const f=We(u);let b;e[2]!==f?(b=f.map(ps),e[2]=f,e[3]=b):b=e[3];const x=b,{promptsMap:p}=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(xs));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[g,_]=S.useState(v);let C;e[9]!==s?(C=()=>Oe(s),e[9]=s,e[10]=C):C=e[10];const[I,k]=S.useState(C);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=>{_(T),A(!0)},e[13]=N):N=e[13];const z=N;let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=T=>{k(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(os),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]!==I||e[28]!==g?(de=async()=>{const T=O.getValues(),$e=ls(g,I,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]=I,e[28]=g,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"}),_(Le(s,j)),k(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]!==m.history?(K=()=>m.history.back(),e[37]=m.history,e[38]=K):K=e[38];let X;e[39]!==D||e[40]!==Ie?(X=t.jsx(Ot,{children:t.jsx($t,{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(Lt,{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(Bt,{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]!==p||e[59]!==y||e[60]!==O||e[61]!==s.icon||e[62]!==l||e[63]!==E||e[64]!==I||e[65]!==g?(oe=D==="settings"?t.jsx(cs,{form:O,icon:s.icon,gatewayId:l}):D==="tools"?t.jsx(ft,{toolSet:g,onToolSetChange:z}):D==="resources"?t.jsx(Xt,{resourceSet:I,onResourceSetChange:G,connectionResources:y}):D==="prompts"?t.jsx(Yt,{promptSet:E,onPromptSetChange:q,connectionPrompts:p}):null,e[57]=D,e[58]=p,e[59]=y,e[60]=O,e[61]=s.icon,e[62]=l,e[63]=E,e[64]=I,e[65]=g,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(as,{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(Ft,{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 xs(o){return o.name}function ps(o){return o.id}function gs(){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 c=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]!==c?(d=t.jsx(hs,{gateway:r,gatewayId:i,requestedTabId:c}),o[6]=r,o[7]=i,o[8]=c,o[9]=d):d=o[9],d}function bs(){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(gs,{})})}),o[0]=e):e=o[0],e}function ao(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(bs,{}),o[0]=e):e=o[0],e}export{ao as default};
@@ -1 +0,0 @@
1
- import{r as b,c as I,bM as _,j as s,x as O,t as F,bL as q}from"./index-BdoGlqOh.js";import{K as z,u as H,g as L,s as Z,a as Q,i as R,f as T}from"./file-browser-D3uR2C9M.js";import{B as w}from"./button-BQMZIX_4.js";import{i as D}from"./AlertCircle-DZfqNByx.js";import{n as W}from"./Download01-DUxaWCdv.js";import{i as A}from"./File06-1GHbOIr4.js";import{a as S}from"./Image01-Ba0mxAoN.js";import{i as $}from"./Loading01-wy6i08TR.js";import{s as U}from"./Trash01-pB5oOXYU.js";import{i as J}from"./Upload01-BRGUFGKZ.js";import{u as V}from"./useMutation-mOecCzvG.js";import{u as Y}from"./useQuery-B_cnJjvx.js";import"./useInfiniteQuery-Bx9UQHNH.js";import"./infiniteQueryObserver-B-zosqIG.js";import"./checkbox-CJvAgYlu.js";import"./Check-Clnl6VO2.js";import"./Grid01-Bf8eAyhK.js";import"./Home02-8q2bbK8n.js";import"./List-C6tpn114.js";const P=({size:o=24,color:e="currentColor",...t})=>b.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},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));P.displayName="File04";const B=({size:o=24,color:e="currentColor",...t})=>b.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},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File07";const G=({size:o=24,color:e="currentColor",...t})=>b.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},b.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="FileCode01";const K=({size:o=24,color:e="currentColor",...t})=>b.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},b.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));K.displayName="VideoRecorder";function X(o){const e=I.c(5),[t,g]=b.useState(!1),c=b.useRef(null),f=b.useRef(!1);let n;e[0]!==o?(n=d=>{c.current&&(c.current.disconnect(),c.current=null),d&&!f.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!f.current&&(f.current=!0,g(!0),c.current?.disconnect(),c.current=null)},o),c.current.observe(d))},e[0]=o,e[1]=n):n=e[1];const l=n;let p;return e[2]!==t||e[3]!==l?(p=[t,l],e[2]=t,e[3]=l,e[4]=p):p=e[4],p}function ee(o){const e=I.c(22),{objectKey:t,alt:g,className:c}=o,f=c===void 0?"":c,{connectionId:n,toolCaller:l}=_();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={rootMargin:"100px",threshold:0},e[0]=p):p=e[0];const[d,y]=X(p);let a;e[1]!==n||e[2]!==t?(a=z.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let m;e[4]!==t||e[5]!==l?(m=async()=>{const{url:u}=await l("GET_PRESIGNED_URL",{key:t});return u},e[4]=t,e[5]=l,e[6]=m):m=e[6];let k;e[7]!==d||e[8]!==a||e[9]!==m?(k={queryKey:a,queryFn:m,enabled:d,staleTime:3e5,gcTime:6e5},e[7]=d,e[8]=a,e[9]=m,e[10]=k):k=e[10];const{data:h,isLoading:x,error:j}=Y(k),v=`relative w-full h-full flex items-center justify-center overflow-hidden ${f}`;let r;e[11]!==g||e[12]!==j||e[13]!==h||e[14]!==x||e[15]!==d||e[16]!==t?(r=!d||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx($,{size:24,className:"animate-spin"}):s.jsx(S,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(D,{size:24})}):h?s.jsx("img",{src:h,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[11]=g,e[12]=j,e[13]=h,e[14]=x,e[15]=d,e[16]=t,e[17]=r):r=e[17];let i;return e[18]!==y||e[19]!==v||e[20]!==r?(i=s.jsx("div",{ref:y,className:v,children:r}),e[18]=y,e[19]=v,e[20]=r,e[21]=i):i=e[21],i}const E=12,te={Image01:S,VideoRecorder:K,Music01:R,File02:R,File04:P,File06:A,File07:B,FileCode01:G,Folder:q};function se(o){const e=o.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function re(o){const e=I.c(38),{item:t,onNavigate:g,onDownload:c,onDelete:f}=o;let n;e[0]!==t.key?(n=L(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,p=t.isFolder?"Folder":Q(t.key),d=te[p]||R;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&se(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let m;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(m=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=m):m=e[8];const k=`flex flex-col items-center justify-center w-full h-full ${a?"":"p-4"} ${t.isFolder?"cursor-pointer":"cursor-default"}`;let h;e[9]!==d||e[10]!==a||e[11]!==t.isFolder||e[12]!==t.key||e[13]!==l?(h=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(ee,{objectKey:t.key,alt:l})}):s.jsx(d,{size:48,className:t.isFolder?"text-amber-500":"text-muted-foreground"}),e[9]=d,e[10]=a,e[11]=t.isFolder,e[12]=t.key,e[13]=l,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==t.isFolder||e[17]!==t.size||e[18]!==l?(x=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:T(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:T(t.size)})]}),e[15]=a,e[16]=t.isFolder,e[17]=t.size,e[18]=l,e[19]=x):x=e[19];let j;e[20]!==m||e[21]!==k||e[22]!==h||e[23]!==x?(j=s.jsxs("button",{type:"button",onClick:m,className:k,children:[h,x]}),e[20]=m,e[21]=k,e[22]=h,e[23]=x,e[24]=j):j=e[24];let v;e[25]!==t.isFolder||e[26]!==t.key||e[27]!==f||e[28]!==c?(v=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:u=>{u.stopPropagation(),c(t.key)},children:s.jsx(W,{size:14})}),s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})]}),e[25]=t.isFolder,e[26]=t.key,e[27]=f,e[28]=c,e[29]=v):v=e[29];let r;e[30]!==t.isFolder||e[31]!==t.key||e[32]!==f?(r=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(w,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),f(t.key)},children:s.jsx(U,{size:14})})}),e[30]=t.isFolder,e[31]=t.key,e[32]=f,e[33]=r):r=e[33];let i;return e[34]!==j||e[35]!==v||e[36]!==r?(i=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[j,v,r]}),e[34]=j,e[35]=v,e[36]=r,e[37]=i):i=e[37],i}function Ne({prefix:o,flat:e,onNavigate:t}){const g=b.useRef(null),c=O(),{connectionId:f,toolCaller:n}=_(),{objects:l,isLoading:p,isFetchingMore:d,hasMore:y,loadMore:a,error:m}=H({prefix:o,flat:e,pageSize:E}),k=V({mutationFn:async r=>{const i=o+r.name,{url:u}=await n("PUT_PRESIGNED_URL",{key:i,contentType:r.type||"application/octet-stream"}),C=await fetch(u,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!C.ok)throw new Error(`Upload failed: ${C.statusText}`);return i},onSuccess:r=>{F.success(`Uploaded ${L(r)}`),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Upload failed: ${r.message}`)}}),h=V({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{F.success("Deleted successfully"),c.invalidateQueries({queryKey:z.objects(f,o,e,E)})},onError:r=>{F.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:i}=await n("GET_PRESIGNED_URL",{key:r}),u=await fetch(i);if(!u.ok)throw new Error(`Failed to fetch file: ${u.statusText}`);const C=await u.blob(),M=URL.createObjectURL(C),N=document.createElement("a");N.href=M,N.download=L(r),document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(M)}catch(i){F.error(`Download failed: ${i instanceof Error?i.message:"Unknown error"}`)}},j=r=>{const i=r.target.files;if(i){for(const u of Array.from(i))k.mutate(u);r.target.value=""}},v=r=>{if(!y||d)return;const i=r.currentTarget;i.scrollHeight-i.scrollTop-i.clientHeight<200&&a()};return m?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(D,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:m.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:v,children:p?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx($,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(w,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(J,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(re,{item:r,onNavigate:t,onDownload:x,onDelete:i=>h.mutate([i])},r.key))}),d&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx($,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{Ne as default};