@decocms/mesh 1.13.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist/client/assets/{AlertCircle-C7jPyF1i.js → AlertCircle-BnQOnIUK.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-BsEq7RkN.js → ArrowLeft-s2LVd4Jh.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-CTU5QhlY.js → ChevronDown-DLHFQDss.js} +1 -1
  4. package/dist/client/assets/{ChevronRight-UyghVUW5.js → ChevronRight-Df7vxLuO.js} +1 -1
  5. package/dist/client/assets/{Copy01-2N4PsOoQ.js → Copy01-Cg-zZNgL.js} +1 -1
  6. package/dist/client/assets/{DotsHorizontal-K1DaKZpH.js → DotsHorizontal-S6AK1qMQ.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-7n0u_WMH.js → DotsVertical-DL1BOVox.js} +1 -1
  8. package/dist/client/assets/{File06-B-4AkckK.js → File06-BXoByNkx.js} +1 -1
  9. package/dist/client/assets/{FilterLines-3KXsEQsL.js → FilterLines-D-86Z5xi.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-C2XOXx8C.js → FlipBackward-ZBsKqLYA.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-C5iAlTnG.js → GitBranch01-BU4xfNWf.js} +1 -1
  12. package/dist/client/assets/{Grid01-CJPihD4i.js → Grid01-DTA7Ao9S.js} +1 -1
  13. package/dist/client/assets/{Inbox01-BnO6gOQP.js → Inbox01-BMVbBJQA.js} +1 -1
  14. package/dist/client/assets/{InfoCircle-CALL1u00.js → InfoCircle-DrzBjG0U.js} +1 -1
  15. package/dist/client/assets/{Key01-B0l-5fMc.js → Key01-DHDQn1LD.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01--B-xlI11.js → LinkExternal01-cG3zQluY.js} +1 -1
  17. package/dist/client/assets/{Loading01-BIZwCiUc.js → Loading01-ev_d5Ul8.js} +1 -1
  18. package/dist/client/assets/{Lock01-DOOxUber.js → Lock01-SYpb-IcY.js} +1 -1
  19. package/dist/client/assets/{Play-DtfCRxAy.js → Play-vz5syF_s.js} +1 -1
  20. package/dist/client/assets/{Plus-DjZGP-Iq.js → Plus-CoA7veNR.js} +1 -1
  21. package/dist/client/assets/{Terminal-CRoqjoNr.js → Terminal-DmwCXCux.js} +1 -1
  22. package/dist/client/assets/{Trash01-BSvmxP0N.js → Trash01-D5qtjx0n.js} +1 -1
  23. package/dist/client/assets/{X-PqPoM3vz.js → X-ucqgpLkV.js} +1 -1
  24. package/dist/client/assets/{XClose-BIM9TZ-N.js → XClose-DDYQu1Ds.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-BFA_XwNs.js → alert-dialog-IBFLzL1S.js} +1 -1
  26. package/dist/client/assets/{auth-oN0yIABg.js → auth-ClQTpskF.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-DSafll23.js → auth-catchall-C5Hc-_dX.js} +1 -1
  28. package/dist/client/assets/avatar-DyfHzlT3.js +1 -0
  29. package/dist/client/assets/badge-CU1xq8P4.js +1 -0
  30. package/dist/client/assets/card-A0j-GQek.js +1 -0
  31. package/dist/client/assets/checkbox-CKmzIgh_.js +1 -0
  32. package/dist/client/assets/{collection-detail-DKY5TkgR.js → collection-detail-DfA_YTCa.js} +1 -1
  33. package/dist/client/assets/collection-display-button-CWAu-kzM.js +1 -0
  34. package/dist/client/assets/{collection-header-Cq2y0kMK.js → collection-header-BwSc-_Kq.js} +1 -1
  35. package/dist/client/assets/{collection-page-DzdXojp0.js → collection-page-DtIcDiZ6.js} +1 -1
  36. package/dist/client/assets/collection-search-B9hWcULz.js +1 -0
  37. package/dist/client/assets/collection-tab-B_R97p8f.js +1 -0
  38. package/dist/client/assets/collection-table-wrapper-DQxK8uYh.js +1 -0
  39. package/dist/client/assets/connection-card-sB7DQoNm.js +1 -0
  40. package/dist/client/assets/connection-detail-YVncur0H.js +1 -0
  41. package/dist/client/assets/connections-BXFZ3wvT.js +1 -0
  42. package/dist/client/assets/constants-C6wB7wau.js +1 -0
  43. package/dist/client/assets/create-organization-dialog-Ekn1e0rk.js +1 -0
  44. package/dist/client/assets/dialog-BfmlLeqD.js +1 -0
  45. package/dist/client/assets/dropdown-menu-B32DxAz8.js +1 -0
  46. package/dist/client/assets/empty-state-B95c-kPA.js +1 -0
  47. package/dist/client/assets/env-vars-editor-DWx6qXJH.js +1 -0
  48. package/dist/client/assets/error-boundary-CeUty1fN.js +1 -0
  49. package/dist/client/assets/extract-connection-data-BVC8xFla.js +1 -0
  50. package/dist/client/assets/form-JhtOrW0K.js +1 -0
  51. package/dist/client/assets/{formatDistanceToNow-C2AI0RE1.js → formatDistanceToNow-Dn3t8R_C.js} +1 -1
  52. package/dist/client/assets/gateway-detail-CFSYfSyg.js +1 -0
  53. package/dist/client/assets/gateway-selector-Dbt9ey6W.js +1 -0
  54. package/dist/client/assets/gateways-DHNzyrkl.js +1 -0
  55. package/dist/client/assets/github-icon-Dp3wHhYE.js +1 -0
  56. package/dist/client/assets/home-WYDr7ETr.js +1 -0
  57. package/dist/client/assets/{index-CcOnUPVc.js → index-C1mekZiH.js} +2 -2
  58. package/dist/client/assets/index-D34hcbGg.js +25 -0
  59. package/dist/client/assets/index-DU53zBhA.css +1 -0
  60. package/dist/client/assets/{index-79P7ggRz.js → index-DfTxjkaX.js} +1 -1
  61. package/dist/client/assets/{button-Dr2OfS67.js → input-DaU0Ki86.js} +1 -1
  62. package/dist/client/assets/layout-BExJva29.js +1 -0
  63. package/dist/client/assets/{lazy-highlighter-rbKuYd4Y.js → lazy-highlighter-DaSVftiO.js} +1 -1
  64. package/dist/client/assets/localstorage-keys-D0etzHKS.js +1 -0
  65. package/dist/client/assets/login-CxcGRpej.js +1 -0
  66. package/dist/client/assets/{mcp-oauth-CLB05bqO.js → mcp-oauth-BIn8BXP3.js} +1 -1
  67. package/dist/client/assets/mcp-server-detail-D6DvDFSK.js +1 -0
  68. package/dist/client/assets/members-D37gJv0X.js +3 -0
  69. package/dist/client/assets/{monaco-editor-BWGnuKvS.js → monaco-editor-Y-NWUHaI.js} +1 -1
  70. package/dist/client/assets/{monitoring-Daq8j1mw.js → monitoring-DlVue9UD.js} +5 -5
  71. package/dist/client/assets/{oauth-callback-yMv-isiq.js → oauth-callback-WdcYmBNI.js} +1 -1
  72. package/dist/client/assets/{page-DkLEvKFr.js → page-BJvhqDxS.js} +1 -1
  73. package/dist/client/assets/page-CHJwayw7.js +1 -0
  74. package/dist/client/assets/pin-to-sidebar-button-byXh4q4H.js +1 -0
  75. package/dist/client/assets/popover-DBs4BqBC.js +1 -0
  76. package/dist/client/assets/project-context-provider-CNg0H4Fo.js +1 -0
  77. package/dist/client/assets/registry-utils-B7t_ZBUi.js +1 -0
  78. package/dist/client/assets/resizable-CTcl5OQf.js +1 -0
  79. package/dist/client/assets/resource-tabs-Bo8pm6CQ.js +1 -0
  80. package/dist/client/assets/select-DbMbYBva.js +1 -0
  81. package/dist/client/assets/settings-7IN1gw1l.js +1 -0
  82. package/dist/client/assets/shell-layout-nmRRj6_B.js +19 -0
  83. package/dist/client/assets/spinner-BGNFnmXu.js +1 -0
  84. package/dist/client/assets/switch-CmxXnJyM.js +1 -0
  85. package/dist/client/assets/textarea-DAtAmtc7.js +1 -0
  86. package/dist/client/assets/{thread-history-popover-BqhOXgTV.js → thread-history-popover-zKy_UgQq.js} +45 -45
  87. package/dist/client/assets/{tools-list-wGfEy4CM.js → tools-list-DN6AGQNR.js} +1 -1
  88. package/dist/client/assets/{use-binding-DaAdA88g.js → use-binding-DgpwpEbl.js} +1 -1
  89. package/dist/client/assets/{use-connection-Dmp9OF3a.js → use-connection-CqruT03A.js} +1 -1
  90. package/dist/client/assets/{use-connection-resources-BB8wUxFy.js → use-connection-resources-CkpuXaD-.js} +1 -1
  91. package/dist/client/assets/{use-gateway-CqHSf00q.js → use-gateway-B1dIUnIy.js} +1 -1
  92. package/dist/client/assets/{use-list-state-OO7JJFHk.js → use-list-state-JWYeEYSc.js} +1 -1
  93. package/dist/client/assets/{use-mcp-DA1ttZCi.js → use-mcp-JvlAYa3Y.js} +1 -1
  94. package/dist/client/assets/{use-members-CU5bDeq-.js → use-members-Do0dz7W-.js} +1 -1
  95. package/dist/client/assets/{use-mobile-DJYJGOHZ.js → use-mobile-BtDidYAZ.js} +1 -1
  96. package/dist/client/assets/use-organization-settings-BptZoa_W.js +1 -0
  97. package/dist/client/assets/use-tool-call-C_3QXJhb.js +1 -0
  98. package/dist/client/assets/useQuery-BDFKN3rX.js +1 -0
  99. package/dist/client/assets/value-Dr4SJDBJ.js +1 -0
  100. package/dist/client/assets/view-mode-toggle-D5v_tsuM.js +1 -0
  101. package/dist/client/assets/workflow-D697ZMd-.js +1 -0
  102. package/dist/client/index.html +2 -2
  103. package/dist/server/cli.js +108 -108
  104. package/dist/server/server.js +104 -104
  105. package/package.json +1 -1
  106. package/dist/client/assets/avatar-DWNKzJTz.js +0 -1
  107. package/dist/client/assets/badge-CMDsV8CJ.js +0 -1
  108. package/dist/client/assets/card-DGWmxOab.js +0 -1
  109. package/dist/client/assets/checkbox-CH_lW5sL.js +0 -1
  110. package/dist/client/assets/collection-display-button-CF5VNEyr.js +0 -1
  111. package/dist/client/assets/collection-search-5HSGaGGt.js +0 -1
  112. package/dist/client/assets/collection-tab-DfUfYU59.js +0 -1
  113. package/dist/client/assets/collection-table-wrapper-BcST91H1.js +0 -1
  114. package/dist/client/assets/connection-card-BYX60RAK.js +0 -1
  115. package/dist/client/assets/connection-detail-BIJapkB_.js +0 -1
  116. package/dist/client/assets/connections-iA0KSF8d.js +0 -1
  117. package/dist/client/assets/constants-Dj4zd5B9.js +0 -1
  118. package/dist/client/assets/create-organization-dialog-CrdjEf0i.js +0 -1
  119. package/dist/client/assets/dialog-Didf1Cm0.js +0 -1
  120. package/dist/client/assets/dropdown-menu-DW5iGKOq.js +0 -1
  121. package/dist/client/assets/empty-state-BN60qDU7.js +0 -1
  122. package/dist/client/assets/env-vars-editor-Bp_8Hwo3.js +0 -1
  123. package/dist/client/assets/error-boundary-BiqKDyx1.js +0 -1
  124. package/dist/client/assets/extract-connection-data-u9kLLue9.js +0 -1
  125. package/dist/client/assets/form-BXN-QLni.js +0 -1
  126. package/dist/client/assets/gateway-detail-B4v6dTjK.js +0 -1
  127. package/dist/client/assets/gateway-selector-QHaVxB2n.js +0 -1
  128. package/dist/client/assets/gateways-Cx9ti1Cv.js +0 -1
  129. package/dist/client/assets/github-icon-BrF3LMLL.js +0 -1
  130. package/dist/client/assets/home-CJdYeB-M.js +0 -1
  131. package/dist/client/assets/index-BjKus4OW.css +0 -1
  132. package/dist/client/assets/index-ChqW8s3_.js +0 -25
  133. package/dist/client/assets/input-DBy5GvSG.js +0 -1
  134. package/dist/client/assets/layout-C4lOtZCC.js +0 -1
  135. package/dist/client/assets/localstorage-keys-D9YX3_IT.js +0 -1
  136. package/dist/client/assets/login-fLYNz1_K.js +0 -1
  137. package/dist/client/assets/mcp-server-detail-CcpTBZ0r.js +0 -1
  138. package/dist/client/assets/members-zUvSLEug.js +0 -3
  139. package/dist/client/assets/page-CqtvajVn.js +0 -1
  140. package/dist/client/assets/pin-to-sidebar-button-BiLL5QoJ.js +0 -1
  141. package/dist/client/assets/popover-BD8rPm7n.js +0 -1
  142. package/dist/client/assets/project-context-provider-CRa6hysF.js +0 -1
  143. package/dist/client/assets/resizable-CGOknEmg.js +0 -1
  144. package/dist/client/assets/resource-tabs-BPp4Cr-n.js +0 -1
  145. package/dist/client/assets/select-Bw9i3g8J.js +0 -1
  146. package/dist/client/assets/settings-DXlkaFxL.js +0 -1
  147. package/dist/client/assets/shell-layout-DBkPG18-.js +0 -19
  148. package/dist/client/assets/spinner-DhLOJDf8.js +0 -1
  149. package/dist/client/assets/switch-BTv42t3b.js +0 -1
  150. package/dist/client/assets/textarea-C3UNaEli.js +0 -1
  151. package/dist/client/assets/use-organization-settings-BGtwqtxs.js +0 -1
  152. package/dist/client/assets/use-tool-call-xMn-Ysup.js +0 -1
  153. package/dist/client/assets/useQuery-u2B_27A6.js +0 -1
  154. package/dist/client/assets/value-IcpA2Nq4.js +0 -1
  155. package/dist/client/assets/view-mode-toggle-Di5d2VZX.js +0 -1
  156. package/dist/client/assets/workflow-UoaX4VGc.js +0 -1
@@ -1 +1 @@
1
- import{a_ as X,a$ as O,b0 as q,b1 as j,ap as A,B as _,b2 as Y,b3 as z,r as w,b4 as I,b5 as L,b6 as N,b7 as H,b8 as k,b9 as x,ba as V,bb as J}from"./index-CcOnUPVc.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!q(u,h)});!c&&!d||(c&&(this.#u=s,this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=j(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=_(e),r=Y(),i=z(),o=w.useMemo(()=>t.map(l=>{const b=s.defaultQueryOptions(l);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,s,r]);o.forEach(l=>{I(l);const b=s.getQueryCache().get(l.queryHash);L(l,i,b)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const g=c.some((l,b)=>k(o[b],l))?c.flatMap((l,b)=>{const y=o[b];if(y){const R=new A(s,y);if(k(y,l))return x(y,R,i);V(l,r)&&x(y,R,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const m=c.find((l,b)=>{const y=o[b];return y&&J({result:l,errorResetBoundary:i,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,Q=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Q in t?t[Q](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let $={};function K(){return $}function T(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function C(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function G(t){return W(t,Date.now())}function Z(t,n,e){const[s,r]=C(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=C(e?.in,t,t,n),o=P(r,i),a=Math.abs(Z(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Ct=/\d+/i,Rt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},qt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Ct,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:qt,defaultParseWidth:"any"})},_t={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:jt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yt(t,n,e){const s=K(),r=e?.locale??s.locale??_t,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=C(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(T(d)-T(c))/1e3,h=Math.round((u-f)/60);let g;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return g=Math.round(h/D),r.formatDistance("aboutXMonths",g,a)}if(g=at(d,c),g<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=g%12,l=Math.trunc(g/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return Yt(t,G(t),n)}export{Lt as f,It as u};
1
+ import{a_ as X,a$ as O,b0 as q,b1 as j,ap as A,B as _,b2 as Y,b3 as z,r as w,b4 as I,b5 as L,b6 as N,b7 as H,b8 as k,b9 as x,ba as V,bb as J}from"./index-C1mekZiH.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!q(u,h)});!c&&!d||(c&&(this.#u=s,this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=j(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=_(e),r=Y(),i=z(),o=w.useMemo(()=>t.map(l=>{const b=s.defaultQueryOptions(l);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,s,r]);o.forEach(l=>{I(l);const b=s.getQueryCache().get(l.queryHash);L(l,i,b)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const g=c.some((l,b)=>k(o[b],l))?c.flatMap((l,b)=>{const y=o[b];if(y){const R=new A(s,y);if(k(y,l))return x(y,R,i);V(l,r)&&x(y,R,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const m=c.find((l,b)=>{const y=o[b];return y&&J({result:l,errorResetBoundary:i,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,Q=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Q in t?t[Q](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let $={};function K(){return $}function T(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function C(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function G(t){return W(t,Date.now())}function Z(t,n,e){const[s,r]=C(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=C(e?.in,t,t,n),o=P(r,i),a=Math.abs(Z(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Ct=/\d+/i,Rt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Tt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},qt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Ct,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:qt,defaultParseWidth:"any"})},_t={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:jt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yt(t,n,e){const s=K(),r=e?.locale??s.locale??_t,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=C(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(T(d)-T(c))/1e3,h=Math.round((u-f)/60);let g;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return g=Math.round(h/D),r.formatDistance("aboutXMonths",g,a)}if(g=at(d,c),g<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=g%12,l=Math.trunc(g/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return Yt(t,G(t),n)}export{Lt as f,It as u};
@@ -0,0 +1 @@
1
+ import{r as I,c as U,j as t,h as Ve,d as qe,b as Qe,s as Ke,a0 as Ne,v as Te,i as We,aG as Ze,w as Xe,x as Ye,t as $e}from"./index-C1mekZiH.js";import{I as ke,u as Ae,E as et}from"./use-connection-CqruT03A.js";import{E as De}from"./error-boundary-CeUty1fN.js";import{C as Fe}from"./checkbox-CKmzIgh_.js";import{c as K,B as H,I as Ie}from"./input-DaU0Ki86.js";import{i as tt}from"./ArrowLeft-s2LVd4Jh.js";import{C as st}from"./collection-search-B9hWcULz.js";import{s as lt}from"./Plus-CoA7veNR.js";import{i as nt}from"./X-ucqgpLkV.js";import{P as ot}from"./pin-to-sidebar-button-byXh4q4H.js";import{T as it,S as rt}from"./switch-CmxXnJyM.js";import{b as ct,a as at,i as dt}from"./use-gateway-B1dIUnIy.js";import{u as mt,a as ut}from"./use-connection-resources-CkpuXaD-.js";import{s as ft}from"./slugify-CEUa2lfQ.js";import{F as fe,a as ht,b as xe,d as pe,f as ge,c as Me}from"./form-JhtOrW0K.js";import{R as xt}from"./resource-tabs-Bo8pm6CQ.js";import{S as Ge,a as Oe,b as Be,c as Ue,d as he}from"./select-DbMbYBva.js";import{a as W,c as Z,b as X,T as Y,i as Pe}from"./project-context-provider-CNg0H4Fo.js";import{a as pt}from"./Copy01-Cg-zZNgL.js";import{i as gt}from"./FlipBackward-ZBsKqLYA.js";import{i as He}from"./InfoCircle-DrzBjG0U.js";import{i as we}from"./Loading01-ev_d5Ul8.js";import{a as jt,V as bt,b as vt}from"./layout-BExJva29.js";import{f as yt}from"./formatDistanceToNow-Dn3t8R_C.js";import"./use-organization-settings-BptZoa_W.js";import"./badge-CU1xq8P4.js";import"./ChevronDown-DLHFQDss.js";const Le=({size:l=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.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"}));Le.displayName="Save01";const Ct=I.memo(function(e){const s=U.c(20),{connection:n,isSelected:d,hasItemsEnabled:o,activeItemsCount:f,totalItemsCount:h,onSelect:c,onToggle:i}=e,a=d?"bg-accent/50":"hover:bg-muted/50";let m;s[0]!==a?(m=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",a),s[0]=a,s[1]=m):m=s[1];let r;s[2]!==n.icon||s[3]!==n.title?(r=t.jsx(ke,{icon:n.icon,name:n.title,size:"xs"}),s[2]=n.icon,s[3]=n.title,s[4]=r):r=s[4];let j;s[5]!==n.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),s[5]=n.title,s[6]=j):j=s[6];let x;s[7]!==c||s[8]!==r||s[9]!==j?(x=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[r,j]}),s[7]=c,s[8]=r,s[9]=j,s[10]=x):x=s[10];let p;s[11]!==f||s[12]!==o||s[13]!==i||s[14]!==h?(p=h>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[f,"/",h]}),t.jsx(Fe,{checked:o,onCheckedChange:i,onClick:_t})]}),s[11]=f,s[12]=o,s[13]=i,s[14]=h,s[15]=p):p=s[15];let y;return s[16]!==m||s[17]!==x||s[18]!==p?(y=t.jsxs("div",{className:m,children:[x,p]}),s[16]=m,s[17]=x,s[18]=p,s[19]=y):y=s[19],y}),St=I.memo(function(e){const s=U.c(18),{connectionId:n,item:d,isSelected:o,onToggle:f}=e,h=`item-${n}-${d.id}`,c=o?"text-foreground":"text-muted-foreground";let i;s[0]!==c?(i=K("text-sm font-medium",c),s[0]=c,s[1]=i):i=s[1];let a;s[2]!==d.name||s[3]!==i?(a=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:i,children:d.name})}),s[2]=d.name,s[3]=i,s[4]=a):a=s[4];let m;s[5]!==d.description?(m=d.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.description}),s[5]=d.description,s[6]=m):m=s[6];let r;s[7]!==a||s[8]!==m?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,m]}),s[7]=a,s[8]=m,s[9]=r):r=s[9];const j=`item-${n}-${d.id}`;let x;s[10]!==o||s[11]!==f||s[12]!==j?(x=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Fe,{id:j,checked:o,onCheckedChange:f,onClick:Nt})}),s[10]=o,s[11]=f,s[12]=j,s[13]=x):x=s[13];let p;return s[14]!==h||s[15]!==r||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:h,children:[r,x]}),s[14]=h,s[15]=r,s[16]=x,s[17]=p):p=s[17],p});function Je({itemSet:l,onItemSetChange:e,getItems:s,itemLabel:n,emptyItemsMessage:d,extraContent:o}){const[f,h]=I.useState(""),c=I.useDeferredValue(f),[i,a]=I.useState("all"),[m,r]=I.useState(!1),j=I.useRef(new Set(Object.keys(l))),x=Ae({searchTerm:c.trim()||void 0}),p=j.current,y=[...p.values()].map(u=>x.find(S=>S.id===u)).filter(u=>u!==void 0),b=x.filter(u=>!p.has(u.id)),w=[...y,...b],g=u=>{const S=l[u];return S!==void 0&&S.length>0},v=w.filter(u=>{if(i==="all")return!0;const S=g(u.id);return i==="selected"?S:i==="unselected"?!S:!0}),[C,_]=I.useState(w[0]?.id??null),N=C?w.find(u=>u.id===C)??null:null,V=N?s(N):[],E=(u,S)=>l[u]?.includes(S)??!1,O=(u,S)=>{const $=l[u]??[],P=$.includes(S),A={...l};if(P){const z=$.filter(R=>R!==S);z.length===0?delete A[u]:A[u]=z}else A[u]=[...$,S];e(A)},q=u=>{const S=w.find(D=>D.id===u);if(!S)return;const $=s(S);if($.length===0)return;const P=l[u]??[],A=$.map(D=>D.id),z=P.length>0&&A.every(D=>P.includes(D)),R={...l};z?delete R[u]:(R[u]=A,_(u)),e(R)},M=u=>{_(u),r(!0)},F=()=>{r(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[t.jsx(st,{value:f,onChange:h,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>a("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>a("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>a("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",i==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:v.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:f?"No connections found":i==="selected"?"No servers selected":i==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:v.map(u=>{const $=s(u).length,P=l[u.id]?.length??0;return t.jsx(Ct,{connection:u,isSelected:C===u.id,hasItemsEnabled:g(u.id),activeItemsCount:P,totalItemsCount:$,onSelect:()=>M(u.id),onToggle:()=>q(u.id)},u.id)})})})]}),t.jsx("div",{className:K("flex-1 flex-col",m?"flex":"hidden md:flex"),children:N?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(H,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(tt,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(ke,{icon:N.icon,name:N.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:N.title}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:N.description})]})]})]}),o,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:V.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:d||`This connection has no ${n} available`}):t.jsx("div",{className:"space-y-2",children:V.map(u=>t.jsx(St,{connectionId:N.id,item:u,isSelected:E(N.id,u.id),onToggle:()=>O(N.id,u.id)},u.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",n]})})})]})}function _t(l){return l.stopPropagation()}function Nt(l){return l.stopPropagation()}function wt(l){const e=U.c(6),{promptSet:s,onPromptSetChange:n,connectionPrompts:d}=l;let o;e[0]!==d?(o=c=>(d.get(c.id)??[]).map(kt),e[0]=d,e[1]=o):o=e[1];const f=o;let h;return e[2]!==f||e[3]!==n||e[4]!==s?(h=t.jsx(Je,{itemSet:s,onItemSetChange:n,getItems:f,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=f,e[3]=n,e[4]=s,e[5]=h):h=e[5],h}function kt(l){return{id:l.name,name:l.name,description:l.description}}function It(l){return l.includes("*")}function Tt(l){const e=U.c(27),{patterns:s,onAddPattern:n,onRemovePattern:d}=l,[o,f]=I.useState("");let h;e[0]!==o||e[1]!==n||e[2]!==s?(h=()=>{const r=o.trim();r&&!s.includes(r)&&(n(r),f(""))},e[0]=o,e[1]=n,e[2]=s,e[3]=h):h=e[3];const c=h;let i;e[4]!==c?(i=r=>{r.key==="Enter"&&(r.preventDefault(),c())},e[4]=c,e[5]=i):i=e[5];const a=i;let m;if(e[6]!==c||e[7]!==a||e[8]!==o||e[9]!==d||e[10]!==s){const r=s.filter(It);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=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 ",j," 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=_=>f(_.target.value),e[14]=p):p=e[14];let y;e[15]!==a||e[16]!==o?(y=t.jsx(Ie,{value:o,onChange:p,onKeyDown:a,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=a,e[16]=o,e[17]=y):y=e[17];let b;e[18]!==o?(b=o.trim(),e[18]=o,e[19]=b):b=e[19];const w=!b;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(lt,{size:16}),e[20]=g):g=e[20];let v;e[21]!==c||e[22]!==w?(v=t.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:w,children:g}),e[21]=c,e[22]=w,e[23]=v):v=e[23];let C;e[24]!==v||e[25]!==y?(C=t.jsxs("div",{className:"flex gap-2",children:[y,v]}),e[24]=v,e[25]=y,e[26]=C):C=e[26],m=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[x,C,r.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>d(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(nt,{size:12})})]},_))})]}),e[6]=c,e[7]=a,e[8]=o,e[9]=d,e[10]=s,e[11]=m}else m=e[11];return m}function $t(l){const e=U.c(23),{resourceSet:s,onResourceSetChange:n,connectionResources:d}=l,[o]=I.useState(null);let f;e[0]!==d?(f=g=>(d.get(g.id)??[]).map(Pt),e[0]=d,e[1]=f):f=e[1];const h=f;let c;e[2]!==n||e[3]!==s?(c=(g,v)=>{const C=s[g]??[];C.includes(v)||n({...s,[g]:[...C,v]})},e[2]=n,e[3]=s,e[4]=c):c=e[4];const i=c;let a;e[5]!==n||e[6]!==s?(a=(g,v)=>{const _=(s[g]??[]).filter(N=>N!==v);if(_.length===0){const N={...s};delete N[g],n(N)}else n({...s,[g]:_})},e[5]=n,e[6]=s,e[7]=a):a=e[7];const m=a;let r;e[8]!==n?(r=g=>{n(g)},e[8]=n,e[9]=r):r=e[9];const j=r;let x;e[10]!==s||e[11]!==o?(x=o?s[o]??[]:[],e[10]=s,e[11]=o,e[12]=x):x=e[12];const p=x;let y;e[13]!==i||e[14]!==m||e[15]!==o||e[16]!==p?(y=o?t.jsx(Tt,{patterns:p,onAddPattern:g=>i(o,g),onRemovePattern:g=>m(o,g)}):null,e[13]=i,e[14]=m,e[15]=o,e[16]=p,e[17]=y):y=e[17];const b=y;let w;return e[18]!==b||e[19]!==h||e[20]!==j||e[21]!==s?(w=t.jsx("div",{className:"h-full",children:t.jsx(Je,{itemSet:s,onItemSetChange:j,getItems:h,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:b})}),e[18]=b,e[19]=h,e[20]=j,e[21]=s,e[22]=w):w=e[22],w}function Pt(l){return{id:l.uri,name:l.name||l.uri,description:l.description||l.uri}}function zt(l){const s=new TextEncoder().encode(l),n=Array.from(s,d=>String.fromCharCode(d)).join("");return btoa(n)}function Rt(l){const e=U.c(52),{serverName:s,gatewayUrl:n}=l,[d,o]=I.useState(!1),[f,h]=I.useState(null),c=ft(s);let i,a,m,r;if(e[0]!==n||e[1]!==c){const Q={type:"http",url:n},L={[c]:Q};i=JSON.stringify(L,null,2);const ee=je=>JSON.stringify({...Q,headers:{"x-mesh-client":je}},null,2),te=zt(ee("Cursor"));a=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(te)}`;const me=ee("Claude Code");m=c;let J;e[6]===Symbol.for("react.memo_cache_sentinel")?(J=/'/g,e[6]=J):J=e[6],r=me.replace(J,"'\\''"),e[0]=n,e[1]=c,e[2]=i,e[3]=a,e[4]=m,e[5]=r}else i=e[2],a=e[3],m=e[4],r=e[5];const j=`claude mcp add "${m}" --config '${r}'`;let x;e[7]!==i?(x=async()=>{await navigator.clipboard.writeText(i),o(!0),$e.success("Configuration copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[7]=i,e[8]=x):x=e[8];const p=x;let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=async(Q,L)=>{await navigator.clipboard.writeText(Q),h(L),$e.success(`${L} command copied`),setTimeout(()=>h(null),2e3)},e[9]=y):y=e[9];const b=y,w=Et;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=g):g=e[10];let v;e[11]!==d?(v=d?t.jsx(Pe,{size:14}):t.jsx(pt,{size:14}),e[11]=d,e[12]=v):v=e[12];let C;e[13]!==p||e[14]!==v?(C=t.jsx(X,{asChild:!0,children:t.jsx(H,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:v})}),e[13]=p,e[14]=v,e[15]=C):C=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Y,{children:"Copy configuration"}),e[16]=_):_=e[16];let N;e[17]!==C?(N=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(W,{children:t.jsxs(Z,{children:[C,_]})})}),e[17]=C,e[18]=N):N=e[18];let V;e[19]!==i||e[20]!==p?(V=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:p,children:i}),e[19]=i,e[20]=p,e[21]=V):V=e[21];let E;e[22]!==V||e[23]!==N?(E=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[N,V]}),e[22]=V,e[23]=N,e[24]=E):E=e[24];let O;e[25]!==a?(O=()=>w(a),e[25]=a,e[26]=O):O=e[26];let q,M;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),M=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=M):(q=e[27],M=e[28]);let F;e[29]!==O?(F=t.jsx(X,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:O,children:[q,M]})}),e[29]=O,e[30]=F):F=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Y,{children:"Add to Cursor"}),e[31]=u):u=e[31];let S;e[32]!==F?(S=t.jsx(W,{children:t.jsxs(Z,{children:[F,u]})}),e[32]=F,e[33]=S):S=e[33];let $;e[34]!==j?($=()=>b(j,"Claude"),e[34]=j,e[35]=$):$=e[35];let P,A;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),A=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=P,e[37]=A):(P=e[36],A=e[37]);let z;e[38]!==f?(z=f==="Claude"&&t.jsx(Pe,{size:14,className:"ml-2 text-green-500"}),e[38]=f,e[39]=z):z=e[39];let R;e[40]!==$||e[41]!==z?(R=t.jsx(X,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:$,children:[P,A,z]})}),e[40]=$,e[41]=z,e[42]=R):R=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Y,{children:"Add to Claude Code"}),e[43]=D):D=e[43];let B;e[44]!==R?(B=t.jsx(W,{children:t.jsxs(Z,{children:[R,D]})}),e[44]=R,e[45]=B):B=e[45];let T;e[46]!==S||e[47]!==B?(T=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[S,B]}),e[46]=S,e[47]=B,e[48]=T):T=e[48];let de;return e[49]!==E||e[50]!==T?(de=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,E,T]}),e[49]=E,e[50]=T,e[51]=de):de=e[51],de}function Et(l){window.open(l,"_blank")}const Vt=Ke({title:Te().min(1,"Name is required").max(255),description:Te().nullable(),status:Ne(["active","inactive"]),tool_selection_mode:Ne(["inclusion","exclusion"]),tool_selection_strategy:Ne(["passthrough","smart_tool_selection","code_execution"])});function ze(l,e){const s={};for(const n of l.connections)if(n.selected_tools===null){const d=e.get(n.connection_id)??[];d.length>0&&(s[n.connection_id]=d)}else n.selected_tools.length>0&&(s[n.connection_id]=n.selected_tools);return s}function Re(l){const e={};for(const s of l.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 Ee(l){const e={};for(const s of l.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 At(l,e,s,n){const d=new Set([...Object.keys(l),...Object.keys(e),...Object.keys(s)]);return Array.from(d).map(o=>{const f=l[o]??[],h=n.get(o)??[],c=h.length>0&&h.every(i=>f.includes(i));return{connection_id:o,selected_tools:f.length===0||c?null:f,selected_resources:e[o]??null,selected_prompts:s[o]??null}})}function Dt(l){const e=U.c(41),{form:s,gateway:n,icon:d}=l;let o;e[0]!==s?(o=s.watch("title")||"Hub",e[0]=s,e[1]=o):o=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(dt,{}),e[2]=f):f=e[2];let h;e[3]!==d||e[4]!==o?(h=t.jsx(ke,{icon:d,name:o,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=d,e[4]=o,e[5]=h):h=e[5];let c;e[6]!==s.control?(c=t.jsx(fe,{control:s.control,name:"status",render:Bt}),e[6]=s.control,e[7]=c):c=e[7];let i;e[8]!==h||e[9]!==c?(i=t.jsxs("div",{className:"flex items-start justify-between",children:[h,c]}),e[8]=h,e[9]=c,e[10]=i):i=e[10];let a;e[11]!==s.control?(a=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(fe,{control:s.control,name:"title",render:Ot}),t.jsx(fe,{control:s.control,name:"description",render:Gt})]}),e[11]=s.control,e[12]=a):a=e[12];let m;e[13]!==i||e[14]!==a?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[i,a]}),e[13]=i,e[14]=a,e[15]=m):m=e[15];let r;e[16]!==s.control?(r=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(fe,{control:s.control,name:"tool_selection_mode",render:Mt}),t.jsx(fe,{control:s.control,name:"tool_selection_strategy",render:Ft})]}),e[16]=s.control,e[17]=r):r=e[17];let j;e[18]!==m||e[19]!==r?(j=t.jsxs("div",{className:"flex flex-col",children:[m,r]}),e[18]=m,e[19]=r,e[20]=j):j=e[20];let x;e[21]!==s||e[22]!==j?(x=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(ht,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=x):x=e[23];let p;e[24]!==n.id||e[25]!==n.title?(p=n.title||`hub-${n.id.slice(0,8)}`,e[24]=n.id,e[25]=n.title,e[26]=p):p=e[26];const y=`${window.location.origin}/mcp/gateway/${n.id}`;let b;e[27]!==p||e[28]!==y?(b=t.jsx("div",{className:"p-5",children:t.jsx(Rt,{serverName:p,gatewayUrl:y})}),e[27]=p,e[28]=y,e[29]=b):b=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=w):w=e[30];let g;e[31]!==n.updated_at?(g=n.updated_at?yt(new Date(n.updated_at),{addSuffix:!1}):"Unknown",e[31]=n.updated_at,e[32]=g):g=e[32];let v;e[33]!==g?(v=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[w,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=v):v=e[34];let C;e[35]!==b||e[36]!==v?(C=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[b,v]}),e[35]=b,e[36]=v,e[37]=C):C=e[37];let _;return e[38]!==x||e[39]!==C?(_=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[x,C]}),e[38]=x,e[39]=C,e[40]=_):_=e[40],_}function Ft(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Me,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(W,{children:t.jsxs(Z,{children:[t.jsx(X,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Hub strategy help",children:t.jsx(He,{size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(Ge,{value:e.value,onValueChange:e.onChange,children:[t.jsx(pe,{children:t.jsx(Oe,{className:"w-[180px]",children:t.jsx(Be,{})})}),t.jsxs(Ue,{children:[t.jsx(he,{value:"passthrough",children:"Passthrough"}),t.jsx(he,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(he,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(ge,{})]})}function Mt(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Me,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(W,{children:t.jsxs(Z,{children:[t.jsx(X,{asChild:!0,children:t.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(He,{size:14,className:"text-muted-foreground"})})}),t.jsx(Y,{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(Ge,{value:e.value,onValueChange:e.onChange,children:[t.jsx(pe,{children:t.jsx(Oe,{className:"w-[180px]",children:t.jsx(Be,{})})}),t.jsxs(Ue,{children:[t.jsx(he,{value:"inclusion",children:"Include Selected"}),t.jsx(he,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(ge,{})]})}function Gt(l){const{field:e}=l;return t.jsxs(xe,{className:"w-full space-y-0",children:[t.jsx(pe,{children:t.jsx(Ie,{...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(ge,{})]})}function Ot(l){const{field:e}=l;return t.jsxs(xe,{className:"w-full space-y-0",children:[t.jsx(pe,{children:t.jsx(Ie,{...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:"Hub Name"})}),t.jsx(ge,{})]})}function Bt(l){const{field:e}=l;return t.jsxs(xe,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(pe,{children:t.jsx(rt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(ge,{})]})}function Ut(l){const e=U.c(75),{gateway:s,gatewayId:n,requestedTabId:d}=l,f=We().location.href,h=Ze();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/gateways/$gatewayId"},e[0]=c):c=e[0];const i=Ve(c),a=at();let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m={},e[1]=m):m=e[1];const r=Ae(m);let j;e[2]!==r?(j=r.map(Lt),e[2]=r,e[3]=j):j=e[3];const x=j,{promptsMap:p}=mt(x),{resourcesMap:y}=ut(x);let b;if(e[4]!==r){b=new Map;for(const k of r)k.tools&&k.tools.length>0&&b.set(k.id,k.tools.map(Ht));e[4]=r,e[5]=b}else b=e[5];let w;e[6]!==b||e[7]!==s?(w=()=>ze(s,b),e[6]=b,e[7]=s,e[8]=w):w=e[8];const[g,v]=I.useState(w);let C;e[9]!==s?(C=()=>Re(s),e[9]=s,e[10]=C):C=e[10];const[_,N]=I.useState(C);let V;e[11]!==s?(V=()=>Ee(s),e[11]=s,e[12]=V):V=e[12];const[E,O]=I.useState(V),[q,M]=I.useState(!1);let F;e[13]===Symbol.for("react.memo_cache_sentinel")?(F=k=>{v(k),M(!0)},e[13]=F):F=e[13];const u=F;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=k=>{N(k),M(!0)},e[14]=S):S=e[14];const $=S;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=k=>{O(k),M(!0)},e[15]=P):P=e[15];const A=P;let z;e[16]===Symbol.for("react.memo_cache_sentinel")?(z=Xe(Vt),e[16]=z):z=e[16];const R=s.tool_selection_mode??"inclusion",D=s.tool_selection_strategy??"passthrough";let B;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==R||e[21]!==D?(B={resolver:z,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:R,tool_selection_strategy:D}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=R,e[21]=D,e[22]=B):B=e[22];const T=Ye(B),Q=T.formState.isDirty||q;let L;e[23]!==a.update||e[24]!==b||e[25]!==T||e[26]!==n||e[27]!==E||e[28]!==_||e[29]!==g?(L=async()=>{const k=T.getValues(),_e=At(g,_,E,b);await a.update.mutateAsync({id:n,data:{title:k.title,description:k.description,status:k.status,tool_selection_mode:k.tool_selection_mode,tool_selection_strategy:k.tool_selection_strategy,connections:_e}}),T.reset(k),M(!1)},e[23]=a.update,e[24]=b,e[25]=T,e[26]=n,e[27]=E,e[28]=_,e[29]=g,e[30]=L):L=e[30];const ee=L;let te;e[31]!==b||e[32]!==T||e[33]!==s?(te=()=>{T.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion",tool_selection_strategy:s.tool_selection_strategy??"passthrough"}),v(ze(s,b)),N(Re(s)),O(Ee(s)),M(!1)},e[31]=b,e[32]=T,e[33]=s,e[34]=te):te=e[34];const me=te;let J;e[35]===Symbol.for("react.memo_cache_sentinel")?(J=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[35]=J):J=e[35];const je=J,G=je.some(k=>k.id===d)?d:"settings";let be;e[36]!==i?(be=k=>{i({search:_e=>({..._e,tab:k}),replace:!0})},e[36]=i,e[37]=be):be=e[37];const Ce=be,ue=a.update.isPending;let se;e[38]!==h.history?(se=()=>h.history.back(),e[38]=h.history,e[39]=se):se=e[39];let le;e[40]!==G||e[41]!==Ce?(le=t.jsx(jt,{children:t.jsx(xt,{tabs:je,activeTab:G,onTabChange:Ce})}),e[40]=G,e[41]=Ce,e[42]=le):le=e[42];let ne;e[43]!==me||e[44]!==ee||e[45]!==Q||e[46]!==ue?(ne=Q&&t.jsxs(t.Fragment,{children:[t.jsx(W,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(X,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ue,onClick:me,"aria-label":"Cancel",children:t.jsx(gt,{size:14})})})}),t.jsx(Y,{side:"bottom",children:"Cancel"})]})}),t.jsx(W,{children:t.jsxs(Z,{delayDuration:0,children:[t.jsx(X,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(H,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ue,onClick:ee,"aria-label":"Save",children:ue?t.jsx(we,{size:14,className:"animate-spin"}):t.jsx(Le,{size:14})})})}),t.jsx(Y,{side:"bottom",children:"Save"})]})})]}),e[43]=me,e[44]=ee,e[45]=Q,e[46]=ue,e[47]=ne):ne=e[47];const Se=s.icon??"cpu_chip";let oe;e[48]!==s.title||e[49]!==Se||e[50]!==f?(oe=t.jsx(ot,{title:s.title,url:f,icon:Se}),e[48]=s.title,e[49]=Se,e[50]=f,e[51]=oe):oe=e[51];let ie;e[52]!==ne||e[53]!==oe?(ie=t.jsxs(bt,{children:[ne,oe]}),e[52]=ne,e[53]=oe,e[54]=ie):ie=e[54];let ve;e[55]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(we,{size:32,className:"animate-spin text-muted-foreground"})}),e[55]=ve):ve=e[55];let re;e[56]!==G||e[57]!==p||e[58]!==y||e[59]!==T||e[60]!==s||e[61]!==E||e[62]!==_||e[63]!==g?(re=G==="settings"?t.jsx(Dt,{form:T,gateway:s,icon:s.icon}):G==="tools"?t.jsx(it,{toolSet:g,onToolSetChange:u}):G==="resources"?t.jsx($t,{resourceSet:_,onResourceSetChange:$,connectionResources:y}):G==="prompts"?t.jsx(wt,{promptSet:E,onPromptSetChange:A,connectionPrompts:p}):null,e[56]=G,e[57]=p,e[58]=y,e[59]=T,e[60]=s,e[61]=E,e[62]=_,e[63]=g,e[64]=re):re=e[64];let ce;e[65]!==re?(ce=t.jsx(I.Suspense,{fallback:ve,children:re}),e[65]=re,e[66]=ce):ce=e[66];let ae;e[67]!==G||e[68]!==ce?(ae=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(De,{children:ce},G)})})}),e[67]=G,e[68]=ce,e[69]=ae):ae=e[69];let ye;return e[70]!==se||e[71]!==le||e[72]!==ie||e[73]!==ae?(ye=t.jsxs(vt,{onBack:se,children:[le,ie,ae]}),e[70]=se,e[71]=le,e[72]=ie,e[73]=ae,e[74]=ye):ye=e[74],ye}function Ht(l){return l.name}function Lt(l){return l.id}function Jt(){const l=U.c(10);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},l[0]=e):e=l[0];const s=Ve(e);let n;l[1]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/gateways/$gatewayId"},l[1]=n):n=l[1];const{gatewayId:d,org:o}=qe(n);let f;l[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/gateways/$gatewayId"},l[2]=f):f=l[2];const c=Qe(f).tab||"settings",i=ct(d);if(!i){let m;return l[3]!==s||l[4]!==o?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(et,{title:"Hub not found",description:"This Hub may have been deleted or you may not have access.",actions:t.jsx(H,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:o}}),children:"Back to gateways"})})}),l[3]=s,l[4]=o,l[5]=m):m=l[5],m}let a;return l[6]!==i||l[7]!==d||l[8]!==c?(a=t.jsx(Ut,{gateway:i,gatewayId:d,requestedTabId:c}),l[6]=i,l[7]=d,l[8]=c,l[9]=a):a=l[9],a}function qt(){const l=U.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(De,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(we,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Jt,{})})}),l[0]=e):e=l[0],e}function ys(){const l=U.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qt,{}),l[0]=e):e=l[0],e}export{ys as default};
@@ -0,0 +1 @@
1
+ import{r as g,ai as K,c as w,j as o,aO as E}from"./index-C1mekZiH.js";import{i as Y}from"./project-context-provider-CNg0H4Fo.js";import{u as ee,i as Z}from"./use-gateway-B1dIUnIy.js";import{I as Q,i as te}from"./use-connection-CqruT03A.js";import{b as se,a as le,c as ae,S as re}from"./select-DbMbYBva.js";import{c as I,B as oe,I as ne}from"./input-DaU0Ki86.js";import{u as ie}from"./use-mobile-BtDidYAZ.js";const ce=({size:l=24,color:e="currentColor",...t})=>g.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},g.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));ce.displayName="Stop";function J({prop:l,defaultProp:e,onChange:t=()=>{}}){const[s,a]=de({defaultProp:e,onChange:t}),r=l!==void 0,n=r?l:s,i=K(t),c=g.useCallback(d=>{if(r){const f=typeof d=="function"?d(l):d;f!==l&&i(f)}else a(d)},[r,l,a,i]);return[n,c]}function de({defaultProp:l,onChange:e}){const t=g.useState(l),[s]=t,a=g.useRef(s),r=K(e);return g.useEffect(()=>{a.current!==s&&(r(s),a.current=s)},[s,a,r]),t}function fe(l){const e=w.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(E.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=s):s=e[3],s}function ue(l){const e=w.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(E.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function me(l){const e=w.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=o.jsx(E.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function pe(l){const e=w.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=I("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=o.jsx(E.Overlay,{"data-slot":"drawer-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}function xe(l){const e=w.c(12);let t,s,a;e[0]!==l?({className:s,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(pe,{}),e[4]=r):r=e[4];let n;e[5]!==s?(n=I("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",s),e[5]=s,e[6]=n):n=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=i):i=e[7];let c;return e[8]!==t||e[9]!==a||e[10]!==n?(c=o.jsxs(me,{"data-slot":"drawer-portal",children:[r,o.jsxs(E.Content,{"data-slot":"drawer-content",className:n,...a,children:[i,t]})]}),e[8]=t,e[9]=a,e[10]=n,e[11]=c):c=e[11],c}function he(l){const e=w.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=I("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=o.jsx("div",{"data-slot":"drawer-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}function we(l){const e=w.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=I("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=o.jsx(E.Title,{"data-slot":"drawer-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}const X=g.createContext({isMobile:!1,setValue:()=>{}}),q=()=>g.useContext(X),ve=l=>{const e=w.c(37);let t,s,a,r,n,i,c,d;e[0]!==l?({children:t,defaultOpen:s,open:i,onOpenChange:r,defaultValue:a,value:d,onValueChange:n,...c}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=r,e[5]=n,e[6]=i,e[7]=c,e[8]=d):(t=e[1],s=e[2],a=e[3],r=e[4],n=e[5],i=e[6],c=e[7],d=e[8]);const p=ie(),f=s??!1;let m;e[9]!==r||e[10]!==i||e[11]!==f?(m={prop:i,defaultProp:f,onChange:r},e[9]=r,e[10]=i,e[11]=f,e[12]=m):m=e[12];const[x,h]=J(m);let C;e[13]!==a||e[14]!==n||e[15]!==d?(C={prop:d,defaultProp:a,onChange:n},e[13]=a,e[14]=n,e[15]=d,e[16]=C):C=e[16];const[S,k]=J(C);let $;e[17]!==k?($=M=>{M&&k(M)},e[17]=k,e[18]=$):$=e[18];const y=$;let b;e[19]!==p||e[20]!==y?(b={isMobile:p,setValue:y},e[19]=p,e[20]=y,e[21]=b):b=e[21];let j;e[22]!==t||e[23]!==x||e[24]!==c||e[25]!==h?(j=o.jsx(fe,{open:x,onOpenChange:h,...c,children:t}),e[22]=t,e[23]=x,e[24]=c,e[25]=h,e[26]=j):j=e[26];let v;e[27]!==x||e[28]!==c||e[29]!==h||e[30]!==y||e[31]!==j||e[32]!==S?(v=o.jsx(re,{open:x,onOpenChange:h,value:S,onValueChange:y,...c,children:j}),e[27]=x,e[28]=c,e[29]=h,e[30]=y,e[31]=j,e[32]=S,e[33]=v):v=e[33];let N;return e[34]!==b||e[35]!==v?(N=o.jsx(X.Provider,{value:b,children:v}),e[34]=b,e[35]=v,e[36]=N):N=e[36],N},ge=l=>{const{children:e,title:t,headerActions:s,...a}=l,{isMobile:r}=q(),{className:n,...i}=a;return r?o.jsxs(xe,{...i,children:[o.jsxs(he,{className:I(s?"flex flex-row items-center justify-between":"hidden"),children:[o.jsx(we,{children:t}),s]}),o.jsx("div",{className:I("flex flex-col gap-2 p-2 py-4",n),children:e})]}):o.jsx(ae,{...a,children:e})},be=l=>{const e=w.c(7);let t,s;e[0]!==l?({children:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const{isMobile:a}=q();let r;return e[3]!==t||e[4]!==a||e[5]!==s?(r=a?o.jsx(ue,{asChild:!0,children:o.jsx(oe,{variant:"outline",...s,children:t})}):o.jsx(le,{...s,children:t}),e[3]=t,e[4]=a,e[5]=s,e[6]=r):r=e[6],r},je=l=>{const e=w.c(7);let t,s;e[0]!==l?({children:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const{isMobile:a}=q();let r;return e[3]!==t||e[4]!==a||e[5]!==s?(r=a?o.jsx("span",{...s,children:t}):o.jsx(se,{...s,children:t}),e[3]=t,e[4]=a,e[5]=s,e[6]=r):r=e[6],r};function ye(){const l=w.c(4),e=ee();let t;l[0]!==e?(t=e??[],l[0]=e,l[1]=t):t=l[1];let s;return l[2]!==t?(s=t.map(Ce),l[2]=t,l[3]=s):s=l[3],s}function Ce(l){return{id:l.id,title:l.title,description:l.description??null,icon:l.icon??null,fallbackIcon:o.jsx(Z,{})}}function Ne(l){const e=w.c(24),{gateway:t,isSelected:s}=l,a=s&&"bg-accent";let r;e[0]!==a?(r=I("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",a),e[0]=a,e[1]=r):r=e[1];let n;e[2]!==t.fallbackIcon?(n=t.fallbackIcon??o.jsx(Z,{}),e[2]=t.fallbackIcon,e[3]=n):n=e[3];let i;e[4]!==t.icon||e[5]!==t.title||e[6]!==n?(i=o.jsx(Q,{icon:t.icon,name:t.title,size:"sm",fallbackIcon:n,className:"size-10"}),e[4]=t.icon,e[5]=t.title,e[6]=n,e[7]=i):i=e[7];let c;e[8]!==t.title?(c=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[8]=t.title,e[9]=c):c=e[9];let d;e[10]!==s?(d=s&&o.jsx(Y,{size:16,className:"text-foreground shrink-0"}),e[10]=s,e[11]=d):d=e[11];let p;e[12]!==c||e[13]!==d?(p=o.jsxs("div",{className:"flex items-center justify-between",children:[c,d]}),e[12]=c,e[13]=d,e[14]=p):p=e[14];let f;e[15]!==t.description?(f=t.description&&o.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:t.description}),e[15]=t.description,e[16]=f):f=e[16];let m;e[17]!==p||e[18]!==f?(m=o.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[p,f]}),e[17]=p,e[18]=f,e[19]=m):m=e[19];let x;return e[20]!==r||e[21]!==i||e[22]!==m?(x=o.jsxs("div",{className:r,children:[i,m]}),e[20]=r,e[21]=i,e[22]=m,e[23]=x):x=e[23],x}function Se(l){const e=w.c(12),{gateway:t}=l;if(!t){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("span",{className:"text-sm text-muted-foreground",children:"Select gateway"}),e[0]=i):i=e[0],i}let s;e[1]!==t.fallbackIcon?(s=t.fallbackIcon??o.jsx(Z,{}),e[1]=t.fallbackIcon,e[2]=s):s=e[2];let a;e[3]!==t.icon||e[4]!==t.title||e[5]!==s?(a=o.jsx(Q,{icon:t.icon,name:t.title,size:"xs",fallbackIcon:s,className:"w-5! h-5! min-w-5! shrink-0 rounded-sm"}),e[3]=t.icon,e[4]=t.title,e[5]=s,e[6]=a):a=e[6];let r;e[7]!==t.title?(r=o.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:t.title}),e[7]=t.title,e[8]=r):r=e[8];let n;return e[9]!==a||e[10]!==r?(n=o.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[a,r]}),e[9]=a,e[10]=r,e[11]=n):n=e[11],n}function ze(l){const e=w.c(47),{selectedGatewayId:t,onGatewayChange:s,variant:a,className:r,placeholder:n}=l,i=a===void 0?"bordered":a,c=n===void 0?"Select Hub":n,[d,p]=g.useState(!1),[f,m]=g.useState(""),x=g.useRef(null),h=ye();let C,S;e[0]!==d?(C=()=>{d&&setTimeout(()=>{x.current?.focus()},0)},S=[d],e[0]=d,e[1]=C,e[2]=S):(C=e[1],S=e[2]),g.useEffect(C,S);let k;if(e[3]!==h||e[4]!==t){let u;e[6]!==t?(u=U=>U.id===t,e[6]=t,e[7]=u):u=e[7],k=h.find(u),e[3]=h,e[4]=t,e[5]=k}else k=e[5];const $=k;let y;e:{if(!f.trim()){y=h;break e}let u;if(e[8]!==h||e[9]!==f){const U=f.toLowerCase();u=h.filter(F=>F.title.toLowerCase().includes(U)||F.description?.toLowerCase().includes(U)),e[8]=h,e[9]=f,e[10]=u}else u=e[10];y=u}const b=y;let j;e[11]!==s?(j=u=>{s(u),m(""),p(!1)},e[11]=s,e[12]=j):j=e[12];const v=j;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=u=>{p(u),u||m("")},e[13]=N):N=e[13];const M=N,A=t||"",W=i==="borderless"&&"border-0 md:border-none";let R;e[14]!==r||e[15]!==W?(R=I("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",W,r),e[14]=r,e[15]=W,e[16]=R):R=e[16];let D;e[17]!==$?(D=o.jsx(Se,{gateway:$}),e[17]=$,e[18]=D):D=e[18];let G;e[19]!==c||e[20]!==D?(G=o.jsx(je,{placeholder:c,className:"min-w-0 max-w-full",children:D}),e[19]=c,e[20]=D,e[21]=G):G=e[21];let _;e[22]!==R||e[23]!==G?(_=o.jsx(be,{size:"sm",className:R,children:G}),e[22]=R,e[23]=G,e[24]=_):_=e[24];let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(te,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[25]=L):L=e[25];let B;e[26]===Symbol.for("react.memo_cache_sentinel")?(B=u=>m(u.target.value),e[26]=B):B=e[26];let z;e[27]!==f?(z=o.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:o.jsxs("div",{className:"relative",children:[L,o.jsx(ne,{ref:x,type:"text",placeholder:"Search for a gateway...",value:f,onChange:B,className:"pl-9 h-9 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"})]})}),e[27]=f,e[28]=z):z=e[28];let O;e[29]!==b||e[30]!==v||e[31]!==t?(O=b.length>0?b.map(u=>o.jsx("div",{onClick:()=>v(u.id),className:"outline-none",children:o.jsx(Ne,{gateway:u,isSelected:u.id===t})},u.id)):o.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No gateways found"}),e[29]=b,e[30]=v,e[31]=t,e[32]=O):O=e[32];let P;e[33]!==O?(P=o.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:O}),e[33]=O,e[34]=P):P=e[34];let T;e[35]!==z||e[36]!==P?(T=o.jsxs("div",{className:"flex flex-col max-h-[300px]",children:[z,P]}),e[35]=z,e[36]=P,e[37]=T):T=e[37];let V;e[38]!==c||e[39]!==T?(V=o.jsx(ge,{title:c,className:"w-full md:w-[400px] p-0",side:"bottom",children:T}),e[38]=c,e[39]=T,e[40]=V):V=e[40];let H;return e[41]!==v||e[42]!==d||e[43]!==_||e[44]!==V||e[45]!==A?(H=o.jsxs(ve,{open:d,onOpenChange:M,value:A,onValueChange:v,children:[_,V]}),e[41]=v,e[42]=d,e[43]=_,e[44]=V,e[45]=A,e[46]=H):H=e[46],H}export{ue as D,ze as G,je as R,xe as a,he as b,we as c,fe as d,ye as e,be as f,ge as g,ve as h,ce as i,J as u};
@@ -0,0 +1 @@
1
+ import{c as te,j as t,r as se,h as re,t as ie}from"./index-C1mekZiH.js";import{C as ne}from"./collection-header-BwSc-_Kq.js";import{C as ae}from"./collection-page-DtIcDiZ6.js";import{C as le}from"./collection-search-B9hWcULz.js";import{C as ce}from"./collection-table-wrapper-DQxK8uYh.js";import{C as de}from"./connection-card-sB7DQoNm.js";import{u as me,E as q,I as ue}from"./use-connection-CqruT03A.js";import{E as he}from"./error-boundary-CeUty1fN.js";import{a as ge,u as pe,i as j}from"./use-gateway-B1dIUnIy.js";import{u as fe,s as Q}from"./use-list-state-JWYeEYSc.js";import{u as xe}from"./project-context-provider-CNg0H4Fo.js";import{c as je,b as ye,d as we,A as Ce,e as be,g as Ne,a as De,f as Se}from"./alert-dialog-IBFLzL1S.js";import{B as oe}from"./badge-CU1xq8P4.js";import{B as J}from"./input-DaU0Ki86.js";import{b as U,D as X,a as Y,c as B}from"./dropdown-menu-B32DxAz8.js";import{i as Z}from"./DotsVertical-DL1BOVox.js";import{i as ve}from"./Loading01-ev_d5Ul8.js";import{s as ee}from"./Trash01-D5qtjx0n.js";import"./collection-display-button-CWAu-kzM.js";import"./Grid01-DTA7Ao9S.js";import"./view-mode-toggle-D5v_tsuM.js";import"./card-A0j-GQek.js";import"./use-mobile-BtDidYAZ.js";import"./ChevronRight-Df7vxLuO.js";function ke(e,r){switch(r.type){case"delete":return{mode:"deleting",gateway:r.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:r}=xe(),i=re();let y;e[0]!==r.slug?(y={namespace:r.slug,resource:"gateways"},e[0]=r.slug,e[1]=y):y=e[1];const s=fe(y),n=ge(),x=pe(s);let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={},e[2]=w):w=e[2];const G=me(w);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[a,b]=se.useReducer(ke,C);let N;e[4]!==n.create||e[5]!==G.length||e[6]!==i||e[7]!==r.slug?(N=async()=>{if(G.length===0){ie.error("Create at least one Connection first");return}const o=await n.create.mutateAsync({title:"New Hub",description:"Hubs let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},e[4]=n.create,e[5]=G.length,e[6]=i,e[7]=r.slug,e[8]=N):N=e[8];const R=N;let D;e[9]!==n.delete||e[10]!==a.gateway||e[11]!==a.mode?(D=async()=>{if(a.mode!=="deleting")return;const o=a.gateway.id;b({type:"close"});try{await n.delete.mutateAsync(o)}catch{}},e[9]=n.delete,e[10]=a.gateway,e[11]=a.mode,e[12]=D):D=e[12];const T=D;let S,v,k,_,I,$;e[13]===Symbol.for("react.memo_cache_sentinel")?(v={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:He,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ke,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},I={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},$={id:"connections",header:"Connections",render:Pe,cellClassName:"w-24 shrink-0"},S={id:"status",header:"Status",render:Ae,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=S,e[14]=v,e[15]=k,e[16]=_,e[17]=I,e[18]=$):(S=e[13],v=e[14],k=e[15],_=e[16],I=e[17],$=e[18]);let M;e[19]!==i||e[20]!==r.slug?(M=[v,k,_,I,$,S,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ze,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),b({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=i,e[20]=r.slug,e[21]=M):M=e[21];const O=M,V=n.create.isPending?"Creating...":"Create Hub";let z;e[22]!==n.create.isPending||e[23]!==R||e[24]!==V?(z=t.jsx(J,{onClick:R,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:n.create.isPending,children:V}),e[22]=n.create.isPending,e[23]=R,e[24]=V,e[25]=z):z=e[25];const L=z,F=a.mode==="deleting";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=o=>!o&&b({type:"close"}),e[26]=A):A=e[26];let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(je,{children:"Delete Hub?"}),e[27]=P):P=e[27];const W=a.mode==="deleting"&&a.gateway.title;let c;e[28]!==W?(c=t.jsxs(ye,{children:[P,t.jsxs(we,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==T?(d=t.jsxs(be,{children:[E,t.jsx(Ne,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=T,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(De,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(Se,{open:F,onOpenChange:A,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let K;e[39]===Symbol.for("react.memo_cache_sentinel")?(K=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=K):K=e[39];let h;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(h=t.jsx(ne,{title:"Hubs",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:K,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=h):h=e[46];let g;e[47]!==s?(g=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=g):g=e[48];let p;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==g?(p=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a hub...",onKeyDown:g}),e[49]=s.search,e[50]=s.setSearch,e[51]=g,e[52]=p):p=e[52];let f;e[53]!==O||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==i||e[61]!==r.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:s.search?"No hubs found":"No hubs yet",description:s.search?`No hubs match "${s.search}"`:"Create a hub to aggregate tools from multiple Connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(j,{}),onClick:()=>i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Ie,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),b({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:O,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>i({to:"/$org/gateways/$gatewayId",params:{org:r.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No hubs found",description:`No hubs match "${s.search}"`}):t.jsx(q,{image:t.jsx(j,{size:36,className:"text-muted-foreground"}),title:"No hubs yet",description:"Create a hub to aggregate tools from multiple Connections."})}),e[53]=O,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=i,e[61]=r.slug,e[62]=f):f=e[62];let H;return e[63]!==u||e[64]!==h||e[65]!==p||e[66]!==f?(H=t.jsxs(ae,{children:[u,h,p,f]}),e[63]=u,e[64]=h,e[65]=p,e[66]=f,e[67]=H):H=e[67],H}function Ie(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function Me(e){return e.stopPropagation()}function ze(e){return e.stopPropagation()}function Ae(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Pe(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ke(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function He(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(ue,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(j,{size:16})})}function ct(){const e=te.c(1);let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(he,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=r):r=e[0],r}export{ct as default};
@@ -0,0 +1 @@
1
+ function r(t){if(!t)return null;const n=typeof t=="string"?t:t.url;if(!n)return null;const u=n.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return u?{owner:u[1]||"",repo:u[2]||""}:null}function a(t){const n=r(t);if(!n)return null;const u=`https://github.com/${n.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(u)}&output=webp`}export{r as e,a as g};
@@ -0,0 +1 @@
1
+ import{c as u,j as i,a as w,r as C,h as E}from"./index-C1mekZiH.js";import{C as _}from"./card-A0j-GQek.js";import{c as v,I as $,B as k}from"./input-DaU0Ki86.js";import{A}from"./avatar-DyfHzlT3.js";import{i as O}from"./AlertCircle-BnQOnIUK.js";import{s as L}from"./Plus-CoA7veNR.js";import{C as D}from"./create-organization-dialog-Ekn1e0rk.js";import"./alert-dialog-IBFLzL1S.js";import"./form-JhtOrW0K.js";import"./spinner-BGNFnmXu.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let o;e[0]!==s?(o=p=>{s&&s(p)},e[0]=s,e[1]=o):o=e[1];const m=o,d=s&&"cursor-pointer",c=x&&"hover:ring-2 hover:ring-primary";let a;e[2]!==l||e[3]!==d||e[4]!==c?(a=v("group transition-all flex flex-col gap-0",d,c,l),e[2]=l,e[3]=d,e[4]=c,e[5]=a):a=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==a?(g=i.jsx(_,{className:a,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=a,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:o}=t,m=s===void 0?"square":s,d=r===void 0?"lg":r,c=x===void 0?"contain":x;let a;return e[0]!==o||e[1]!==l||e[2]!==c||e[3]!==m||e[4]!==d||e[5]!==n?(a=i.jsx(A,{url:n,fallback:l,shape:m,size:d,objectFit:c,className:o}),e[0]=o,e[1]=l,e[2]=c,e[3]=m,e[4]=d,e[5]=n,e[6]=a):a=e[6],a}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const o=x,d=P[s===void 0?4:s],c=o.sm&&V[o.sm],a=o.md&&X[o.md],g=o.lg&&J[o.lg],p=o.xl&&K[o.xl],j=o["2xl"]&&U[o["2xl"]];let h;e[2]!==r||e[3]!==d||e[4]!==c||e[5]!==a||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",d,c,a,g,p,j,r),e[2]=r,e[3]=d,e[4]=c,e[5]=a,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,d=s===void 0?4:s;let c;e[2]!==x?(c=Array.from({length:x}).map(Y),e[2]=x,e[3]=c):c=e[3];let a;return e[4]!==r||e[5]!==m||e[6]!==d||e[7]!==c?(a=i.jsx(z,{columns:m,gap:d,className:r,children:c}),e[4]=r,e[5]=m,e[6]=d,e[7]=c,e[8]=a):a=e[8],a}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const c=n.toLowerCase();return l.filter(a=>a.name.toLowerCase().includes(c)||a.slug.toLowerCase().includes(c))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let c;return e[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=c):c=e[3],c}if(x.length===0){let c;return e[4]!==n?(c=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=c):c=e[5],c}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==x||e[8]!==s){let c;e[10]!==s?(c=a=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:a.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:a.logo||"",fallback:a.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",a.slug]}),i.jsx(b.Title,{children:a.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(a.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},a.id),e[10]=s,e[11]=c):c=e[11],m=x.map(c),e[7]=x,e[8]=s,e[9]=m}else m=e[9];let d;return e[12]!==m?(d=i.jsx(S,{columns:o,children:m}),e[12]=m,e[13]=d):d=e[13],d}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(O,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),o=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=m):m=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=f=>s(f.target.value),t[5]=d):d=t[5];let c;t[6]!==l?(c=i.jsx($,{className:"max-w-xs",placeholder:"Search",value:l,onChange:d}),t[6]=l,t[7]=c):c=t[7];let a;t[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsxs(k,{variant:"default",onClick:()=>x(!0),children:[i.jsx(L,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=a):a=t[8];let g;t[9]!==c?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[m,i.jsxs("div",{className:"flex items-center gap-2",children:[c,a]})]}),t[9]=c,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==o?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:o})})}),t[12]=o,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function xe(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{xe as default};