@decocms/mesh 2.60.0 → 2.62.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 (180) hide show
  1. package/dist/client/assets/{AlertCircle-CiqOV3gN.js → AlertCircle-Ba1Op7JG.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-DSzSuIWM.js → ArrowUp-CsjFvEVu.js} +1 -1
  3. package/dist/client/assets/{Calendar-Bgzpcx-P.js → Calendar-8At6qOri.js} +1 -1
  4. package/dist/client/assets/{Check-BwWwVwDq.js → Check-BQfWrOsa.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-FrVOX9vD.js → ChevronDown-a23q7ncj.js} +1 -1
  6. package/dist/client/assets/ChevronRight-BKSZBVse.js +1 -0
  7. package/dist/client/assets/{Code01-Bus4rjLa.js → Code01-P3ZWE6Wq.js} +1 -1
  8. package/dist/client/assets/{Copy01-CU0ImpYo.js → Copy01-CIESL5kI.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-BXRQO4eG.js → DotsHorizontal-CcEfPxiK.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DWjt2LuM.js → DotsVertical-CJIZpidj.js} +1 -1
  11. package/dist/client/assets/{Download01-B96RO3w0.js → Download01-CqyWjjTW.js} +1 -1
  12. package/dist/client/assets/{Edit01-1SiMuTuh.js → Edit01-B4XYqrFu.js} +1 -1
  13. package/dist/client/assets/{File02-IAt_f4v7.js → File02-BF9rq9ig.js} +1 -1
  14. package/dist/client/assets/{File06-C2LBZfWa.js → File06-bOvxxnZ2.js} +1 -1
  15. package/dist/client/assets/{FilterLines-CKQEFPmy.js → FilterLines-CmZpHRnn.js} +1 -1
  16. package/dist/client/assets/Grid01-IhRcMWbZ.js +1 -0
  17. package/dist/client/assets/{Home02-B4t-Ls4v.js → Home02-DwOGKHOa.js} +1 -1
  18. package/dist/client/assets/{Image01-Bc9GrKYJ.js → Image01-sUTjP5wq.js} +1 -1
  19. package/dist/client/assets/{Inbox01-Nf9S_z_u.js → Inbox01-BnDnIXUM.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-f6Q2730q.js → InfoCircle-WR60YcfQ.js} +1 -1
  21. package/dist/client/assets/{Key01-CwRA3KGV.js → Key01-CPYx3GjY.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-B00_hrMY.js → LinkExternal01-1QN6qTXo.js} +1 -1
  23. package/dist/client/assets/{List-CeDrqSzo.js → List-BaGrtyGA.js} +1 -1
  24. package/dist/client/assets/{Loading01-k9J_51Wt.js → Loading01-C4MO3DLf.js} +1 -1
  25. package/dist/client/assets/{Lock01-BlcSKNwc.js → Lock01-B8efAtfK.js} +1 -1
  26. package/dist/client/assets/{Pin01-CCrFQOyT.js → Pin01-C-K4KVz6.js} +1 -1
  27. package/dist/client/assets/{Play-DDry1DwY.js → Play-tvHP06ah.js} +1 -1
  28. package/dist/client/assets/{Plus-B4bZuJyH.js → Plus-ByTt0Dzz.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CvLjdKIL.js → SearchMd-DCAvw-zt.js} +1 -1
  30. package/dist/client/assets/{Share07-pQXxyFdr.js → Share07-DWSOuaTc.js} +1 -1
  31. package/dist/client/assets/{Terminal-CUhRn_Km.js → Terminal-CZfhkitA.js} +1 -1
  32. package/dist/client/assets/Tool01-DJkWVCxw.js +1 -0
  33. package/dist/client/assets/{Trash01-CrkjtnA0.js → Trash01-BmWnYoTo.js} +1 -1
  34. package/dist/client/assets/{Upload01-Oco4mhUo.js → Upload01-Dc0X9F2g.js} +1 -1
  35. package/dist/client/assets/{Users03-ChMrWUg7.js → Users03-C-YPAI9c.js} +1 -1
  36. package/dist/client/assets/{X-BYmeb6sr.js → X-BHekJF0G.js} +1 -1
  37. package/dist/client/assets/{XClose-BrPaj-T9.js → XClose-CDs3a-Ob.js} +1 -1
  38. package/dist/client/assets/agent-detail-4k8w16fq.js +1 -0
  39. package/dist/client/assets/agents-6fUxAEpD.js +1 -0
  40. package/dist/client/assets/{alert-dialog-DQH47fXT.js → alert-dialog-DMTRbHIN.js} +1 -1
  41. package/dist/client/assets/{auth-catchall-BUSK9aWX.js → auth-catchall-DrRrFKQk.js} +1 -1
  42. package/dist/client/assets/{avatar-DveL_Zo1.js → avatar-5yweOYlX.js} +1 -1
  43. package/dist/client/assets/{badge-DeCRZtfI.js → badge-B_zXl-jd.js} +1 -1
  44. package/dist/client/assets/{binder-ChJO9Gsr.js → binder-DNt-QaD5.js} +1 -1
  45. package/dist/client/assets/breadcrumb-DYbYAORz.js +1 -0
  46. package/dist/client/assets/{button-D373Gh7m.js → button-ZOo4pjl-.js} +1 -1
  47. package/dist/client/assets/{card-IZISqBEf.js → card-DhGWuaMP.js} +1 -1
  48. package/dist/client/assets/{checkbox-CuEgSK5M.js → checkbox-CQBacaBF.js} +1 -1
  49. package/dist/client/assets/{circle-alert-PbmGURsw.js → circle-alert-BQ9TG01K.js} +1 -1
  50. package/dist/client/assets/{collapsible-D5bXYEu5.js → collapsible-0t7QAPTM.js} +1 -1
  51. package/dist/client/assets/collection-detail-DFhGpw2f.js +26 -0
  52. package/dist/client/assets/{collection-search-B0S_3vCk.js → collection-search-19Uoq0wQ.js} +1 -1
  53. package/dist/client/assets/collection-tab-CogQiK5y.js +1 -0
  54. package/dist/client/assets/collection-table-wrapper-BepAjo7t.js +1 -0
  55. package/dist/client/assets/connect-D53lRIS2.js +1 -0
  56. package/dist/client/assets/{connection-card-CaA_gyt_.js → connection-card-D1HxijTE.js} +1 -1
  57. package/dist/client/assets/connection-detail-C3WTnyuO.js +1 -0
  58. package/dist/client/assets/connections-B0UpBHBH.js +1 -0
  59. package/dist/client/assets/{constants-BsVN3aVM.js → constants-CgYg5TtN.js} +1 -1
  60. package/dist/client/assets/constants-j8UyVq9f.js +1 -0
  61. package/dist/client/assets/{create-organization-dialog-ByLHFsGC.js → create-organization-dialog-DEacdY5C.js} +1 -1
  62. package/dist/client/assets/{dialog-sp1iNNV1.js → dialog-C8W_SUym.js} +1 -1
  63. package/dist/client/assets/dropdown-menu-v13S1hcn.js +1 -0
  64. package/dist/client/assets/dynamic-plugin-layout-B-0mr5zD.js +1 -0
  65. package/dist/client/assets/empty-state-BcO1Ypur.js +1 -0
  66. package/dist/client/assets/{empty-state-D4bELgmw.js → empty-state-FX9PTasG.js} +1 -1
  67. package/dist/client/assets/{env-vars-editor-DdPVHMBR.js → env-vars-editor-BDdZakcM.js} +1 -1
  68. package/dist/client/assets/{error-boundary-DGGozsia.js → error-boundary-m114tUpJ.js} +1 -1
  69. package/dist/client/assets/{extract-connection-data-CgtoPpeo.js → extract-connection-data-DyggfQBs.js} +1 -1
  70. package/dist/client/assets/file-browser-D-KlovGy.js +2 -0
  71. package/dist/client/assets/{form-D_p7nR82.js → form-r49NhVFy.js} +1 -1
  72. package/dist/client/assets/grid-view-DxmE20Kf.js +1 -0
  73. package/dist/client/assets/home-nCCmJCuu.js +1 -0
  74. package/dist/client/assets/index-BbS1IcRL.js +1 -0
  75. package/dist/client/assets/{index-504A5fzu.js → index-Bs29EeVO.js} +2 -2
  76. package/dist/client/assets/{index-CsaK2Zyj.js → index-C4EJpxzW.js} +61 -61
  77. package/dist/client/assets/index-C4iufez8.css +1 -0
  78. package/dist/client/assets/{index-Cu1Yc5G-.js → index-D4SxGvpq.js} +1 -1
  79. package/dist/client/assets/index-DxOSzDZh.js +1 -0
  80. package/dist/client/assets/index-psOxwHJD.js +1 -0
  81. package/dist/client/assets/index-ytnZ687L.js +25 -0
  82. package/dist/client/assets/{infiniteQueryObserver-BZSSiryQ.js → infiniteQueryObserver-HNFv_Ra4.js} +1 -1
  83. package/dist/client/assets/{input-L4CnUGon.js → input-C4GtYEoZ.js} +1 -1
  84. package/dist/client/assets/layout-DIZIdVHa.js +1 -0
  85. package/dist/client/assets/{localstorage-keys-ELyXVtKs.js → localstorage-keys-Bm36wvj7.js} +1 -1
  86. package/dist/client/assets/{login-DXDi7eVk.js → login-94e59ej-.js} +1 -1
  87. package/dist/client/assets/{mcp-oauth-B493s6Am.js → mcp-oauth-Dr83fUMz.js} +1 -1
  88. package/dist/client/assets/mcp-server-card-D3NweLAu.js +1 -0
  89. package/dist/client/assets/mcp-server-detail-5y7XANLb.js +2 -0
  90. package/dist/client/assets/members-DP1aRHjX.js +3 -0
  91. package/dist/client/assets/{monaco-editor-NeTwO1He.js → monaco-editor-Bb429dTQ.js} +1 -1
  92. package/dist/client/assets/monitoring-E-kPGB57.js +49 -0
  93. package/dist/client/assets/{oauth-callback-areeupDS.js → oauth-callback-jLJ-n7ws.js} +1 -1
  94. package/dist/client/assets/page-BDCV1_H1.js +1 -0
  95. package/dist/client/assets/page-BbamCL5c.js +1 -0
  96. package/dist/client/assets/pin-to-sidebar-button-1GCs6x8a.js +1 -0
  97. package/dist/client/assets/{plugin-empty-state-Dyr-7-tg.js → plugin-empty-state-iwSrZL3O.js} +1 -1
  98. package/dist/client/assets/{plugin-header-ei5KGTL7.js → plugin-header-Bp4Gwa8J.js} +1 -1
  99. package/dist/client/assets/plugins-CDmts_jJ.js +1 -0
  100. package/dist/client/assets/popover-CUkUY7Kj.js +1 -0
  101. package/dist/client/assets/{registry-utils-DsqnXOg4.js → registry-utils-Do3XnHa6.js} +1 -1
  102. package/dist/client/assets/{resizable-BKhOe-uT.js → resizable-CI_df1fw.js} +1 -1
  103. package/dist/client/assets/{resource-tabs-BcGtnPlu.js → resource-tabs-D2NgBxYW.js} +1 -1
  104. package/dist/client/assets/select-DqXwJZyT.js +1 -0
  105. package/dist/client/assets/settings-CK6KB251.js +1 -0
  106. package/dist/client/assets/shell-layout-CVRKso4S.js +12 -0
  107. package/dist/client/assets/{spinner-DGXi0Fqy.js → spinner-_C_bSKie.js} +1 -1
  108. package/dist/client/assets/{store-invite-B71tyOTJ.js → store-invite-CJSOrtY9.js} +1 -1
  109. package/dist/client/assets/switch-Cd91eyGn.js +1 -0
  110. package/dist/client/assets/table-BpYYfeqL.js +1 -0
  111. package/dist/client/assets/{textarea-D6uAjk7M.js → textarea-CvbGXUX_.js} +1 -1
  112. package/dist/client/assets/tools-list-BJ4Nz1PD.js +1 -0
  113. package/dist/client/assets/typewriter-title-BmfXfQ4Z.js +16 -0
  114. package/dist/client/assets/use-binding-GlE21mVe.js +23 -0
  115. package/dist/client/assets/use-collections-BNOLiMAP.js +1 -0
  116. package/dist/client/assets/{use-connection-CXgi6BLT.js → use-connection-_63RHsQC.js} +1 -1
  117. package/dist/client/assets/{use-create-virtual-mcp-C56z94et.js → use-create-virtual-mcp-D0aLBOrN.js} +1 -1
  118. package/dist/client/assets/{use-deco-chat-open-CnAfKKCI.js → use-deco-chat-open-CV4KNODR.js} +1 -1
  119. package/dist/client/assets/{use-list-state-DKFwP-fh.js → use-list-state-C35WGVlD.js} +1 -1
  120. package/dist/client/assets/{use-mcp-prompts-Cauox13I.js → use-mcp-prompts-Cs-0fn1r.js} +1 -1
  121. package/dist/client/assets/{use-members-hSITWRgA.js → use-members-k6Mq8L05.js} +1 -1
  122. package/dist/client/assets/{use-mobile-BvueHiH_.js → use-mobile-viw7itqe.js} +1 -1
  123. package/dist/client/assets/{use-organization-settings-wk-RrGpZ.js → use-organization-settings-DmHiyg1G.js} +1 -1
  124. package/dist/client/assets/{use-virtual-mcp-PjR1OFlb.js → use-virtual-mcp-d_sGPR5Q.js} +1 -1
  125. package/dist/client/assets/useInfiniteQuery-3B7DIQNV.js +1 -0
  126. package/dist/client/assets/{useMutation-DjmEVTlE.js → useMutation-DpUHdLIR.js} +1 -1
  127. package/dist/client/assets/useQuery-By0-zS-_.js +1 -0
  128. package/dist/client/assets/useSuspenseInfiniteQuery-CNdbzDY7.js +1 -0
  129. package/dist/client/assets/{view-mode-toggle-CCTPeHCH.js → view-mode-toggle-D5fN84Hq.js} +1 -1
  130. package/dist/client/assets/workflow-FDu9kVkd.js +1 -0
  131. package/dist/client/index.html +2 -2
  132. package/package.json +1 -1
  133. package/dist/client/assets/ArrowLeft-DESkG8WH.js +0 -1
  134. package/dist/client/assets/Grid01-IjiH2KUT.js +0 -1
  135. package/dist/client/assets/Tool01-BuQwOuwj.js +0 -1
  136. package/dist/client/assets/agent-detail-BnemG27J.js +0 -1
  137. package/dist/client/assets/agents-BcQ83pya.js +0 -1
  138. package/dist/client/assets/collection-detail-CKkNR8Za.js +0 -26
  139. package/dist/client/assets/collection-display-button-DRWiQVZp.js +0 -1
  140. package/dist/client/assets/collection-header-BHLaNdMe.js +0 -1
  141. package/dist/client/assets/collection-page-BqHjcMvL.js +0 -1
  142. package/dist/client/assets/collection-tab-DpgA_w33.js +0 -1
  143. package/dist/client/assets/collection-table-wrapper-BP07sMyA.js +0 -1
  144. package/dist/client/assets/connect-FSagTGoo.js +0 -1
  145. package/dist/client/assets/connection-detail-BjIkUIa9.js +0 -1
  146. package/dist/client/assets/connections-C53icvxv.js +0 -1
  147. package/dist/client/assets/constants-BRQkgPgR.js +0 -1
  148. package/dist/client/assets/dropdown-menu-B8A0M-FV.js +0 -1
  149. package/dist/client/assets/dynamic-plugin-layout-D2ubHwXL.js +0 -1
  150. package/dist/client/assets/empty-state-DPLaHs22.js +0 -1
  151. package/dist/client/assets/file-browser-s-7cB8WF.js +0 -2
  152. package/dist/client/assets/grid-view-CR-ahT4K.js +0 -1
  153. package/dist/client/assets/home-BW1R0sGc.js +0 -1
  154. package/dist/client/assets/index-BatxUpyp.js +0 -1
  155. package/dist/client/assets/index-C6RvA3pM.js +0 -25
  156. package/dist/client/assets/index-CrlzOoQD.css +0 -1
  157. package/dist/client/assets/index-DsQNI0Ev.js +0 -1
  158. package/dist/client/assets/layout-Cd5mhjJp.js +0 -1
  159. package/dist/client/assets/mcp-server-card-DAhW5oLh.js +0 -1
  160. package/dist/client/assets/mcp-server-detail-B8SoA6bl.js +0 -2
  161. package/dist/client/assets/members-81fV-UkW.js +0 -3
  162. package/dist/client/assets/monitoring-H5l7qvJR.js +0 -49
  163. package/dist/client/assets/page-CA1T9606.js +0 -1
  164. package/dist/client/assets/page-blk1xcgv.js +0 -1
  165. package/dist/client/assets/pin-to-sidebar-button-CzNm9Z63.js +0 -1
  166. package/dist/client/assets/plugins-QxavFgPC.js +0 -1
  167. package/dist/client/assets/popover-BW-chC87.js +0 -1
  168. package/dist/client/assets/select-BXQ9vi5I.js +0 -1
  169. package/dist/client/assets/settings-BYYaB1XF.js +0 -1
  170. package/dist/client/assets/shell-layout-B3owq9Ia.js +0 -12
  171. package/dist/client/assets/switch-Cy8A6BDO.js +0 -1
  172. package/dist/client/assets/tools-list-B4q7Xm3-.js +0 -1
  173. package/dist/client/assets/tooltip-BXVSpXAI.js +0 -1
  174. package/dist/client/assets/typewriter-title-CO1Atowa.js +0 -16
  175. package/dist/client/assets/use-binding-C0SFeppw.js +0 -23
  176. package/dist/client/assets/use-collections-DgQLvk8y.js +0 -1
  177. package/dist/client/assets/useInfiniteQuery-DcmndbVK.js +0 -1
  178. package/dist/client/assets/useQuery-2fM2t_EQ.js +0 -1
  179. package/dist/client/assets/useSuspenseInfiniteQuery-BQW4uJSq.js +0 -1
  180. package/dist/client/assets/workflow-DcdxDnBB.js +0 -1
@@ -1 +0,0 @@
1
- import{c as b,j as s,r as $,u as ie,g as le,ao as Y}from"./index-504A5fzu.js";import{V as re,C as x}from"./index-CsaK2Zyj.js";import{T as ne,i as oe,a as ae,t as ce}from"./typewriter-title-CO1Atowa.js";import{E as me}from"./error-boundary-DGGozsia.js";import{u as X,S as Q}from"./collapsible-D5bXYEu5.js";import{I as Z}from"./empty-state-DPLaHs22.js";import{P as de,a as fe,b as ue}from"./popover-BW-chC87.js";import{c as ee,B as A}from"./button-D373Gh7m.js";import{i as he,d as xe}from"./constants-BsVN3aVM.js";import{b as pe}from"./use-virtual-mcp-PjR1OFlb.js";import{i as je}from"./Grid01-IjiH2KUT.js";import{t as te}from"./Users03-ChMrWUg7.js";import{T as q,a as G,c as K}from"./tooltip-BXVSpXAI.js";import{c as ge}from"./Pin01-CCrFQOyT.js";import{s as be}from"./Plus-B4bZuJyH.js";import{i as ye}from"./Share07-pQXxyFdr.js";import"./X-BYmeb6sr.js";import"./spinner-DGXi0Fqy.js";import"./use-mcp-prompts-Cauox13I.js";import"./useQuery-2fM2t_EQ.js";import"./dialog-sp1iNNV1.js";import"./form-D_p7nR82.js";import"./input-L4CnUGon.js";import"./AlertCircle-CiqOV3gN.js";import"./ArrowUp-DSzSuIWM.js";import"./ChevronDown-FrVOX9vD.js";import"./Edit01-1SiMuTuh.js";import"./Check-BwWwVwDq.js";import"./Copy01-CU0ImpYo.js";import"./Terminal-CUhRn_Km.js";import"./monaco-editor-NeTwO1He.js";import"./localstorage-keys-ELyXVtKs.js";import"./useMutation-DjmEVTlE.js";import"./use-connection-CXgi6BLT.js";import"./use-collections-DgQLvk8y.js";import"./generate-id-Dyweu44Y.js";import"./SearchMd-CvLjdKIL.js";import"./Trash01-CrkjtnA0.js";import"./use-create-virtual-mcp-C56z94et.js";import"./use-binding-C0SFeppw.js";import"./binder-ChJO9Gsr.js";import"./useSuspenseInfiniteQuery-BQW4uJSq.js";import"./infiniteQueryObserver-BZSSiryQ.js";import"./select-BXQ9vi5I.js";import"./File06-C2LBZfWa.js";import"./Image01-Bc9GrKYJ.js";function _e(e){const t=b.c(15),{agent:i}=e,{setVirtualMcpId:h}=X();let l;t[0]!==i.id||t[1]!==h?(l=()=>{h(i.id)},t[0]=i.id,t[1]=h,t[2]=l):l=t[2];const r=l;let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=ee("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=a):a=t[3];const c=`Select agent ${i.title}`;let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(te,{size:20}),t[4]=d):d=t[4];let n;t[5]!==i.icon||t[6]!==i.title?(n=s.jsx(Z,{icon:i.icon,name:i.title,fallbackIcon:d}),t[5]=i.icon,t[6]=i.title,t[7]=n):n=t[7];let o;t[8]!==i.title?(o=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=o):o=t[9];let m;return t[10]!==r||t[11]!==c||t[12]!==n||t[13]!==o?(m=s.jsxs("button",{type:"button",onClick:r,className:a,"aria-label":c,children:[n,o]}),t[10]=r,t[11]=c,t[12]=n,t[13]=o,t[14]=m):m=t[14],m}function Ne(e){const t=b.c(14),{virtualMcps:i,selectedVirtualMcpId:h,onVirtualMcpChange:l}=e,[r,a]=$.useState(!1),c=$.useRef(null);let d,n;t[0]!==r?(d=()=>{r&&setTimeout(()=>{c.current?.focus()},0)},n=[r],t[0]=r,t[1]=d,t[2]=n):(d=t[1],n=t[2]),$.useEffect(d,n);let o;t[3]!==l?(o=J=>{l(J),a(!1)},t[3]=l,t[4]=o):o=t[4];const m=o;let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=ee("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=f):f=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(de,{asChild:!0,children:s.jsxs("button",{type:"button",className:f,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(je,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=u):u=t[6];let p;t[7]!==m||t[8]!==h||t[9]!==i?(p=s.jsx(fe,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(re,{virtualMcps:i,selectedVirtualMcpId:h,onVirtualMcpChange:m,searchInputRef:c})}),t[7]=m,t[8]=h,t[9]=i,t[10]=p):p=t[10];let g;return t[11]!==r||t[12]!==p?(g=s.jsxs(ue,{open:r,onOpenChange:a,children:[u,p]}),t[11]=r,t[12]=p,t[13]=g):g=t[13],g}function Se(){const e=b.c(20),t=pe(),{selectedVirtualMcp:i,setVirtualMcpId:h}=X();let l,r,a,c,d,n;if(e[0]!==t){d=Symbol.for("react.early_return_sentinel");e:{const p=t.filter(we).slice(0,6);if(p.length===0){d=null;break e}n=t.map(Ce),a="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=c):c=e[7],l="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",r=p.map(ve)}e[0]=t,e[1]=l,e[2]=r,e[3]=a,e[4]=c,e[5]=d,e[6]=n}else l=e[1],r=e[2],a=e[3],c=e[4],d=e[5],n=e[6];if(d!==Symbol.for("react.early_return_sentinel"))return d;const o=i?.id??null;let m;e[8]!==h||e[9]!==o||e[10]!==n?(m=s.jsx(Ne,{virtualMcps:n,selectedVirtualMcpId:o,onVirtualMcpChange:h}),e[8]=h,e[9]=o,e[10]=n,e[11]=m):m=e[11];let f;e[12]!==l||e[13]!==r||e[14]!==m?(f=s.jsxs("div",{className:l,children:[r,m]}),e[12]=l,e[13]=r,e[14]=m,e[15]=f):f=e[15];let u;return e[16]!==a||e[17]!==c||e[18]!==f?(u=s.jsxs("div",{className:a,children:[c,f]}),e[16]=a,e[17]=c,e[18]=f,e[19]=u):u=e[19],u}function ve(e){return s.jsx(_e,{agent:e},e.id??"default")}function Ce(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function we(e){return e.id!==null&&!he(e.id)}function ke(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Q,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(ze)})]}),e[1]=i):i=e[1],i}function ze(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(Q,{className:"size-6 rounded-md shrink-0"}),s.jsx(Q,{className:"h-4 w-full"})]},t)}function Te(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx($.Suspense,{fallback:s.jsx(ke,{}),children:s.jsx(Se,{})}),e[0]=t):t=e[0],t}function Me(){const e=new Date().getHours();return e>=5&&e<12?"Morning":e>=12&&e<17?"Afternoon":e>=17&&e<22?"Evening":"Night"}function Ie(){const e=b.c(60),{org:t}=ie(),{data:i}=le.useSession(),{modelsConnections:h,isChatEmpty:l,activeThreadId:r,setActiveThreadId:a,threads:c,selectedVirtualMcp:d}=X();let n;if(e[0]!==r||e[1]!==c){let j;e[3]!==r?(j=se=>se.id===r,e[3]=r,e[4]=j):j=e[4],n=c.find(j),e[0]=r,e[1]=c,e[2]=n}else n=e[2];const o=n,[m,f]=$.useState(!1);let u;e[5]!==i?.user?.name?(u=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=u):u=e[6];const p=u;let g;e[7]===Symbol.for("react.memo_cache_sentinel")?(g=Me(),e[7]=g):g=e[7];const J=g;let V;e[8]!==t.id?(V=xe(t.id),e[8]=t.id,e[9]=V):V=e[9];const E=d??V;if(h.length===0){let j;return e[10]!==t?(j=s.jsx("div",{className:"flex flex-col size-full bg-background items-center justify-center",children:s.jsx(x.NoLlmBindingEmptyState,{org:t})}),e[10]=t,e[11]=j):j=e[11],j}let y;e[12]!==o||e[13]!==l?(y=s.jsx(x.Header.Left,{children:!l&&o?.title?s.jsx(ne,{text:o.title,className:"text-sm font-medium text-foreground"}):s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Chat"})}),e[12]=o,e[13]=l,e[14]=y):y=e[14];let _;e[15]!==a?(_=()=>a(crypto.randomUUID()),e[15]=a,e[16]=_):_=e[16];let H;e[17]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(be,{size:16}),e[17]=H):H=e[17];let N;e[18]!==l||e[19]!==_?(N=s.jsx(q,{asChild:!0,children:s.jsx(A,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:_,disabled:l,"aria-label":"New chat",children:H})}),e[18]=l,e[19]=_,e[20]=N):N=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(G,{children:"New chat"}),e[21]=R):R=e[21];let S;e[22]!==N?(S=s.jsxs(K,{children:[N,R]}),e[22]=N,e[23]=S):S=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=()=>f(!0),e[24]=O):O=e[24];let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsxs(K,{children:[s.jsx(q,{asChild:!0,children:s.jsx(A,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:O,"aria-label":"Chat history",children:s.jsx(oe,{size:16})})}),s.jsx(G,{children:"Chat history"})]}),e[25]=B):B=e[25];let L;e[26]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(ge,{size:16}),e[26]=L):L=e[26];let v;e[27]!==l?(v=s.jsx(q,{asChild:!0,children:s.jsx(A,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:$e,disabled:l,"aria-label":"Pin chat",children:L})}),e[27]=l,e[28]=v):v=e[28];let D;e[29]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(G,{children:"Pin chat"}),e[29]=D):D=e[29];let C;e[30]!==v?(C=s.jsxs(K,{children:[v,D]}),e[30]=v,e[31]=C):C=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(ye,{size:16}),e[32]=F):F=e[32];let w;e[33]!==l?(w=s.jsx(q,{asChild:!0,children:s.jsx(A,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Pe,disabled:l,"aria-label":"Share chat",children:F})}),e[33]=l,e[34]=w):w=e[34];let U;e[35]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(G,{children:"Share chat"}),e[35]=U):U=e[35];let k;e[36]!==w?(k=s.jsxs(K,{children:[w,U]}),e[36]=w,e[37]=k):k=e[37];let z;e[38]!==C||e[39]!==k||e[40]!==S?(z=s.jsxs(x.Header.Right,{children:[S,B,C,k]}),e[38]=C,e[39]=k,e[40]=S,e[41]=z):z=e[41];let T;e[42]!==z||e[43]!==y?(T=s.jsxs(x.Header,{children:[y,z]}),e[42]=z,e[43]=y,e[44]=T):T=e[44];let M;e[45]!==E||e[46]!==l||e[47]!==p?(M=l?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center gap-3 w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(Z,{icon:E.icon,name:E.title,size:"md",fallbackIcon:s.jsx(te,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-lg font-medium text-foreground",children:[J," ",p,","]}),s.jsx("p",{className:"text-base text-muted-foreground opacity-50 mb-0",children:"What are we building today?"})]}),s.jsx("div",{className:"w-full -mt-1",children:s.jsx(x.Input,{})}),s.jsx(x.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(Te,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(x.Main,{children:s.jsx(x.Messages,{minHeightOffset:230})}),s.jsx(x.Footer,{children:s.jsx(x.Input,{})})]}),e[45]=E,e[46]=l,e[47]=p,e[48]=M):M=e[48];let I;e[49]!==a?(I=j=>{a(j),f(!1)},e[49]=a,e[50]=I):I=e[50];let P;e[51]!==r||e[52]!==m||e[53]!==I||e[54]!==c?(P=s.jsx(ae,{open:m,onOpenChange:f,threads:c,activeThreadId:r,onThreadSelect:I}),e[51]=r,e[52]=m,e[53]=I,e[54]=c,e[55]=P):P=e[55];let W;return e[56]!==T||e[57]!==M||e[58]!==P?(W=s.jsxs(x,{children:[T,M,P]}),e[56]=T,e[57]=M,e[58]=P,e[59]=W):W=e[59],W}function Pe(){Y.info("Share feature coming soon")}function $e(){Y.info("Pin feature coming soon")}function Ae(e){const t=b.c(14),{error:i,onRetry:h}=e,l=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(x.Header,{children:[s.jsx(x.Header.Left,{children:s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Chat"})}),s.jsx(x.Header.Right,{})]}),t[0]=r):r=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(ce,{className:"h-6 w-6 text-destructive"})}),t[1]=a):a=t[1];const c=l?"Unable to load models":"Something went wrong";let d;t[2]!==c?(d=s.jsx("h3",{className:"text-lg font-medium",children:c}),t[2]=c,t[3]=d):d=t[3];const n=l?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let o;t[4]!==n?(o=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),t[4]=n,t[5]=o):o=t[5];let m;t[6]!==d||t[7]!==o?(m=s.jsxs("div",{className:"space-y-2",children:[d,o]}),t[6]=d,t[7]=o,t[8]=m):m=t[8];let f;t[9]!==h?(f=s.jsx(A,{variant:"outline",onClick:h,children:"Try again"}),t[9]=h,t[10]=f):f=t[10];let u;return t[11]!==m||t[12]!==f?(u=s.jsxs(x,{children:[r,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[a,m,f]})})]}),t[11]=m,t[12]=f,t[13]=u):u=t[13],u}function Tt(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(me,{fallback:Ve,children:s.jsx($.Suspense,{fallback:s.jsx(x.Skeleton,{}),children:s.jsx(Ie,{})})}),e[0]=t):t=e[0],t}function Ve(e){const{error:t,resetError:i}=e;return s.jsx(Ae,{error:t,onRetry:i})}export{Tt as default};
@@ -1 +0,0 @@
1
- import{c as G,r as M,u as Z,q as de,K as se,bs as fe,j as s,l as oe,g as ue,b6 as xe,aP as ge}from"./index-504A5fzu.js";import{C as pe}from"./collection-header-BHLaNdMe.js";import{i as ne}from"./FilterLines-CKQEFPmy.js";import{n as he}from"./Inbox01-Nf9S_z_u.js";import{i as J}from"./Loading01-k9J_51Wt.js";import{i as ie}from"./SearchMd-CvLjdKIL.js";import{u as je}from"./useInfiniteQuery-DcmndbVK.js";import{a as ve,f as ye,b as Ne}from"./registry-utils-DsqnXOg4.js";import{u as Ce,h as be,b as Se}from"./constants-BsVN3aVM.js";import{u as we,a as ae,b as Te}from"./use-connection-CXgi6BLT.js";import{s as Ie}from"./slugify-CEUa2lfQ.js";import{C as Re}from"./collection-search-B0S_3vCk.js";import{M as le}from"./mcp-server-card-DAhW5oLh.js";import{c as ce,B as Q}from"./button-D373Gh7m.js";import{I as Pe}from"./input-L4CnUGon.js";import{b as $e,P as ke,a as ze}from"./popover-BW-chC87.js";import{i as Fe}from"./Check-BwWwVwDq.js";import{t as Le}from"./ChevronDown-FrVOX9vD.js";import{s as Y}from"./XClose-BrPaj-T9.js";import{d as Ke,a as Ae,b as Ee,c as De,S as Me}from"./select-BXQ9vi5I.js";import{s as Be}from"./Plus-B4bZuJyH.js";import{E as Ve}from"./empty-state-DPLaHs22.js";import{u as Oe}from"./use-binding-C0SFeppw.js";import{L as We,u as qe}from"./localstorage-keys-ELyXVtKs.js";import"./collection-display-button-DRWiQVZp.js";import"./dropdown-menu-B8A0M-FV.js";import"./Grid01-IjiH2KUT.js";import"./ArrowUp-DSzSuIWM.js";import"./List-CeDrqSzo.js";import"./tooltip-BXVSpXAI.js";import"./view-mode-toggle-CCTPeHCH.js";import"./infiniteQueryObserver-BZSSiryQ.js";import"./use-collections-DgQLvk8y.js";import"./useMutation-DjmEVTlE.js";import"./useQuery-2fM2t_EQ.js";import"./Lock01-BlcSKNwc.js";import"./Terminal-CUhRn_Km.js";import"./card-IZISqBEf.js";import"./github-icon-Dp3wHhYE.js";import"./binder-ChJO9Gsr.js";function _e(t,e){const l=G.c(4),[o,c]=M.useState(t),r=M.useRef(null),a=M.useRef(!0);let i,d;return l[0]!==e||l[1]!==t?(i=()=>{if(a.current){a.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},d=[t,e],l[0]=e,l[1]=t,l[2]=i,l[3]=d):(i=l[2],d=l[3]),M.useEffect(i,d),o}function Ge(t){const e=G.c(14),l=M.useRef(null),o=`scroll-position:${t}`,c=M.useRef(null);let r;e[0]!==o?(r=()=>{l.current&&sessionStorage.setItem(o,String(l.current.scrollTop))},e[0]=o,e[1]=r):r=e[1];const a=r;let i;e[2]!==o?(i=()=>{if(c.current===o)return;const f=sessionStorage.getItem(o);if(f&&l.current){const j=Number.parseInt(f,10);l.current.scrollTop=j}c.current=o},e[2]=o,e[3]=i):i=e[3];const d=i;let y;e[4]!==d||e[5]!==o?(y=()=>{c.current!==o&&d()},e[4]=d,e[5]=o,e[6]=y):y=e[6];const h=y;let n;e[7]!==d||e[8]!==o?(n=f=>{l.current=f,f&&c.current!==o&&requestAnimationFrame(()=>{d()})},e[7]=d,e[8]=o,e[9]=n):n=e[9];const N=n;let u;return e[10]!==h||e[11]!==a||e[12]!==N?(u={scrollRef:N,saveScrollPosition:a,handleScroll:h},e[10]=h,e[11]=a,e[12]=N,e[13]=u):u=e[13],u}const He=24;function Qe(t){const e=G.c(53),{registryId:l,listToolName:o,filtersToolName:c,search:r}=t,{org:a}=Z();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[d,y]=M.useState(i);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[1]=h):h=e[1];const[n,N]=M.useState(h),u=l||null;let f;e[2]!==a.id||e[3]!==u?(f={connectionId:u,orgId:a.id},e[2]=a.id,e[3]=u,e[4]=f):f=e[4];const j=Ce(f),R=!!c;let C;e[5]!==c||e[6]!==l?(C=se.toolCall(l,c||"no-filters","{}"),e[5]=c,e[6]=l,e[7]=C):C=e[7];let b;e[8]!==j||e[9]!==c?(b=async()=>{if(!c)return{tags:[],categories:[]};const D=await j.callTool({name:c,arguments:{}});return D.structuredContent??D},e[8]=j,e[9]=c,e[10]=b):b=e[10];let k;e[11]!==C||e[12]!==b?(k={queryKey:C,queryFn:b,staleTime:36e5},e[11]=C,e[12]=b,e[13]=k):k=e[13];const{data:P}=de(k);let v,S,T;if(e[14]!==o||e[15]!==l||e[16]!==r||e[17]!==n||e[18]!==d){const D=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;v={limit:He,...d.length>0&&{tags:d},...n.length>0&&{categories:n},...D&&{where:D}},T=je,S=se.toolCall(l,o,JSON.stringify(v)),e[14]=o,e[15]=l,e[16]=r,e[17]=n,e[18]=d,e[19]=v,e[20]=S,e[21]=T}else v=e[19],S=e[20],T=e[21];let I;e[22]!==j||e[23]!==v||e[24]!==o?(I=async D=>{const{pageParam:ee}=D,me=ee?{...v,cursor:ee}:v,te=await j.callTool({name:o,arguments:me});return te.structuredContent??te},e[22]=j,e[23]=v,e[24]=o,e[25]=I):I=e[25];let z;e[26]!==I||e[27]!==S?(z={queryKey:S,queryFn:I,initialPageParam:void 0,getNextPageParam:Ue,staleTime:36e5,placeholderData:fe},e[26]=I,e[27]=S,e[28]=z):z=e[28];const{data:L,fetchNextPage:$,hasNextPage:m,isFetchingNextPage:x,isFetching:g,isLoading:w}=T(z);let F;e:{if(!L?.pages||L.pages.length===0){F=null;break e}const D=L.pages[0];if(typeof D=="object"&&D!==null&&"totalCount"in D&&typeof D.totalCount=="number"){F=D.totalCount;break e}F=null}const p=F,K=L?.pages;let A;e[29]!==K?(A=ve(K),e[29]=K,e[30]=A):A=e[30];const E=A;let V;e[31]!==r||e[32]!==n.length||e[33]!==d.length?(V=d.length>0||n.length>0||!!r?.trim(),e[31]=r,e[32]=n.length,e[33]=d.length,e[34]=V):V=e[34];const O=V,q=g&&!x&&!w&&O;let _;e[35]!==$||e[36]!==m||e[37]!==x?(_=()=>{m&&!x&&$()},e[35]=$,e[36]=m,e[37]=x,e[38]=_):_=e[38];const B=_,W=m??!1,H=R?P?.tags:void 0,X=R?P?.categories:void 0;let U;return e[39]!==O||e[40]!==g||e[41]!==x||e[42]!==q||e[43]!==w||e[44]!==E||e[45]!==B||e[46]!==n||e[47]!==d||e[48]!==W||e[49]!==H||e[50]!==X||e[51]!==p?(U={items:E,totalCount:p,hasMore:W,isLoadingMore:x,isFiltering:q,isInitialLoading:w,isFetching:g,loadMore:B,availableTags:H,availableCategories:X,selectedTags:d,selectedCategories:n,setSelectedTags:y,setSelectedCategories:N,hasActiveFilters:O},e[39]=O,e[40]=g,e[41]=x,e[42]=q,e[43]=w,e[44]=E,e[45]=B,e[46]=n,e[47]=d,e[48]=W,e[49]=H,e[50]=X,e[51]=p,e[52]=U):U=e[52],U}function Ue(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Ye(t,e){return[...t].sort((l,o)=>o.count-l.count).slice(0,e)}function re(t){const e=G.c(52),{label:l,items:o,selectedItems:c,onToggle:r,onClear:a}=t,[i,d]=M.useState(""),[y,h]=M.useState(!1);let n,N,u,f,j,R,C,b,k,P,v;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==y||e[4]!==i||e[5]!==c){const $=[...i?o.filter(A=>A.value.toLowerCase().includes(i.toLowerCase())):o].sort(Je);u=c.length,N=$e,k=y,P=h;let m;e[17]!==l?(m=s.jsx("span",{children:l}),e[17]=l,e[18]=m):m=e[18];let x;e[19]!==u?(x=u>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:u}),e[19]=u,e[20]=x):x=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Le,{size:14,className:"opacity-50"}),e[21]=g):g=e[21],e[22]!==x||e[23]!==m?(v=s.jsx(ke,{asChild:!0,children:s.jsxs(Q,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[m,x,g]})}),e[22]=x,e[23]=m,e[24]=v):v=e[24],n=ze,R="w-64 p-0",C="start";let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(ie,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=w):w=e[25];let F;e[26]!==l?(F=l.toLowerCase(),e[26]=l,e[27]=F):F=e[27];const p=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=A=>d(A.target.value),e[28]=K):K=e[28],e[29]!==i||e[30]!==p?(b=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[w,s.jsx(Pe,{type:"text",placeholder:p,value:i,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=i,e[30]=p,e[31]=b):b=e[31],f="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",j=$.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):$.map(A=>{const E=c.includes(A.value);return s.jsxs("button",{onClick:()=>r(A.value),className:ce("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx(Fe,{size:16,className:"text-muted-foreground shrink-0"}),A.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:A.count})]},A.value)}),e[0]=o,e[1]=l,e[2]=r,e[3]=y,e[4]=i,e[5]=c,e[6]=n,e[7]=N,e[8]=u,e[9]=f,e[10]=j,e[11]=R,e[12]=C,e[13]=b,e[14]=k,e[15]=P,e[16]=v}else n=e[6],N=e[7],u=e[8],f=e[9],j=e[10],R=e[11],C=e[12],b=e[13],k=e[14],P=e[15],v=e[16];let S;e[32]!==f||e[33]!==j?(S=s.jsx("div",{className:f,children:j}),e[32]=f,e[33]=j,e[34]=S):S=e[34];let T;e[35]!==l||e[36]!==a||e[37]!==u?(T=u>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(Q,{variant:"ghost",size:"sm",onClick:a,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=a,e[37]=u,e[38]=T):T=e[38];let I;e[39]!==n||e[40]!==T||e[41]!==R||e[42]!==C||e[43]!==b||e[44]!==S?(I=s.jsxs(n,{className:R,align:C,children:[b,S,T]}),e[39]=n,e[40]=T,e[41]=R,e[42]=C,e[43]=b,e[44]=S,e[45]=I):I=e[45];let z;return e[46]!==N||e[47]!==I||e[48]!==k||e[49]!==P||e[50]!==v?(z=s.jsxs(N,{open:k,onOpenChange:P,children:[v,I]}),e[46]=N,e[47]=I,e[48]=k,e[49]=P,e[50]=v,e[51]=z):z=e[51],z}function Je(t,e){return e.count-t.count}function Ze(t){const e=G.c(67),{availableTags:l,availableCategories:o,selectedTags:c,selectedCategories:r,onTagChange:a,onCategoryChange:i}=t,d=l&&l.length>0||o&&o.length>0,y=c.length>0||r.length>0;if(!d)return null;let h;e[0]!==a||e[1]!==c?(h=m=>{c.includes(m)?a(c.filter(x=>x!==m)):a([...c,m])},e[0]=a,e[1]=c,e[2]=h):h=e[2];const n=h;let N;e[3]!==i||e[4]!==r?(N=m=>{r.includes(m)?i(r.filter(x=>x!==m)):i([...r,m])},e[3]=i,e[4]=r,e[5]=N):N=e[5];const u=N;let f;e[6]!==i||e[7]!==a?(f=()=>{a([]),i([])},e[6]=i,e[7]=a,e[8]=f):f=e[8];const j=f;let R,C,b,k,P,v,S;if(e[9]!==o||e[10]!==l||e[11]!==i||e[12]!==a||e[13]!==r||e[14]!==c||e[15]!==u||e[16]!==n){const m=o?Ye(o,6):[];R=r,C=c,S=new Set(m.map(Xe)),P="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(ne,{size:16})}),e[24]=x):x=e[24];let g;e[25]!==o||e[26]!==i||e[27]!==r||e[28]!==u?(g=o&&o.length>0&&s.jsx(re,{label:"Categories",items:o,selectedItems:r,onToggle:u,onClear:()=>i([])}),e[25]=o,e[26]=i,e[27]=r,e[28]=u,e[29]=g):g=e[29];let w;e[30]!==l||e[31]!==a||e[32]!==c||e[33]!==n?(w=l&&l.length>0&&s.jsx(re,{label:"Tags",items:l,selectedItems:c,onToggle:n,onClear:()=>a([])}),e[30]=l,e[31]=a,e[32]=c,e[33]=n,e[34]=w):w=e[34],e[35]!==w||e[36]!==g?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,g,w]}),e[35]=w,e[36]=g,e[37]=v):v=e[37],b="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==r||e[39]!==u?(F=p=>{const K=r.includes(p.value);return s.jsxs("div",{onClick:()=>u(p.value),className:ce("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:p.value}),K&&s.jsx("span",{onClick:A=>{A.stopPropagation(),u(p.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},p.value)},e[38]=r,e[39]=u,e[40]=F):F=e[40],k=m.map(F),e[9]=o,e[10]=l,e[11]=i,e[12]=a,e[13]=r,e[14]=c,e[15]=u,e[16]=n,e[17]=R,e[18]=C,e[19]=b,e[20]=k,e[21]=P,e[22]=v,e[23]=S}else R=e[17],C=e[18],b=e[19],k=e[20],P=e[21],v=e[22],S=e[23];let T;if(e[41]!==R||e[42]!==u||e[43]!==S){let m;e[45]!==S?(m=g=>!S.has(g),e[45]=S,e[46]=m):m=e[46];let x;e[47]!==u?(x=g=>s.jsxs("div",{onClick:()=>u(g),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:g}),s.jsx("span",{onClick:w=>{w.stopPropagation(),u(g)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`cat-${g}`),e[47]=u,e[48]=x):x=e[48],T=R.filter(m).map(x),e[41]=R,e[42]=u,e[43]=S,e[44]=T}else T=e[44];let I;if(e[49]!==C||e[50]!==n){let m;e[52]!==n?(m=x=>s.jsxs("div",{onClick:()=>n(x),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:x}),s.jsx("span",{onClick:g=>{g.stopPropagation(),n(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`tag-${x}`),e[52]=n,e[53]=m):m=e[53],I=C.map(m),e[49]=C,e[50]=n,e[51]=I}else I=e[51];let z;e[54]!==j||e[55]!==y?(z=y&&s.jsxs(Q,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(Y,{size:14}),"Clear all"]}),e[54]=j,e[55]=y,e[56]=z):z=e[56];let L;e[57]!==z||e[58]!==b||e[59]!==k||e[60]!==T||e[61]!==I?(L=s.jsxs("div",{className:b,children:[k,T,I,z]}),e[57]=z,e[58]=b,e[59]=k,e[60]=T,e[61]=I,e[62]=L):L=e[62];let $;return e[63]!==L||e[64]!==P||e[65]!==v?($=s.jsxs("div",{className:P,children:[v,L]}),e[63]=L,e[64]=P,e[65]=v,e[66]=$):$=e[66],$}function Xe(t){return t.value}function et(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(o=>(o.name||o.title||"").toLowerCase().includes(l)||(o.description||o.server.description||"").toLowerCase().includes(l))}function tt(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function st(t){const e=G.c(54),{registryId:l,listToolName:o,filtersToolName:c}=t,[r,a]=M.useState(""),i=_e(r,300),d=oe(),{org:y}=Z(),{scrollRef:h,saveScrollPosition:n,handleScroll:N}=Ge(`store-discovery:${l}`);let u;e[0]!==i||e[1]!==c||e[2]!==o||e[3]!==l?(u={registryId:l,listToolName:o,filtersToolName:c,search:i},e[0]=i,e[1]=c,e[2]=o,e[3]=l,e[4]=u):u=e[4];const{items:f,hasMore:j,isLoadingMore:R,isInitialLoading:C,isFetching:b,loadMore:k,availableTags:P,availableCategories:v,selectedTags:S,selectedCategories:T,setSelectedTags:I,setSelectedCategories:z,hasActiveFilters:L}=Qe(u);let $,m,x,g;e[5]!==i||e[6]!==b||e[7]!==C||e[8]!==f||e[9]!==r?($=r?et(f,r):f,m=(r!==i||b)&&!C&&!!r,g=$.filter(tt),x=$.filter(B=>!g.find(W=>W.id===B.id)),e[5]=i,e[6]=b,e[7]=C,e[8]=f,e[9]=r,e[10]=$,e[11]=m,e[12]=x,e[13]=g):($=e[10],m=e[11],x=e[12],g=e[13]);const w=x;let F;e[14]!==d||e[15]!==y.slug||e[16]!==l||e[17]!==n?(F=B=>{n();const W=Ie(B.name||B.title||B.server.title||""),H=B.server.name;d({to:"/$org/store/$appName",params:{org:y.slug,appName:W},search:{registryId:l,serverName:H}})},e[14]=d,e[15]=y.slug,e[16]=l,e[17]=n,e[18]=F):F=e[18];const p=F;let K;e[19]!==N||e[20]!==j||e[21]!==R||e[22]!==k?(K=B=>{if(N(),!j||R)return;const W=B.currentTarget;W.scrollHeight-W.scrollTop-W.clientHeight<200&&k()},e[19]=N,e[20]=j,e[21]=R,e[22]=k,e[23]=K):K=e[23];const A=K;let E;e[24]!==m||e[25]!==r?(E=s.jsx(Re,{value:r,onChange:a,placeholder:"Search for an MCP Server...",isSearching:m}),e[24]=m,e[25]=r,e[26]=E):E=e[26];let V;e[27]!==v||e[28]!==P||e[29]!==T||e[30]!==S||e[31]!==z||e[32]!==I?(V=s.jsx(Ze,{availableTags:P,availableCategories:v,selectedTags:S,selectedCategories:T,onTagChange:I,onCategoryChange:z}),e[27]=v,e[28]=P,e[29]=T,e[30]=S,e[31]=z,e[32]=I,e[33]=V):V=e[33];let O;e[34]!==w||e[35]!==$||e[36]!==p||e[37]!==L||e[38]!==j||e[39]!==C||e[40]!==R||e[41]!==m||e[42]!==f||e[43]!==r||e[44]!==g?(O=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:C?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):f.length===0&&!L?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(he,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):f.length===0&&L&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ne,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&$.length===0&&!m?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ie,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[m&&$.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),g.length>0&&s.jsx(le,{items:g,title:"Verified",onItemClick:p}),w.length>0&&s.jsx(le,{items:w,title:g.length>0?"All":"",onItemClick:p}),j&&R&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(J,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=w,e[35]=$,e[36]=p,e[37]=L,e[38]=j,e[39]=C,e[40]=R,e[41]=m,e[42]=f,e[43]=r,e[44]=g,e[45]=O):O=e[45];let q;e[46]!==A||e[47]!==h||e[48]!==O?(q=s.jsx("div",{ref:h,className:"flex-1 overflow-y-auto",onScroll:A,children:O}),e[46]=A,e[47]=h,e[48]=O,e[49]=q):q=e[49];let _;return e[50]!==E||e[51]!==V||e[52]!==q?(_=s.jsxs("div",{className:"flex flex-col h-full",children:[E,V,q]}),e[50]=E,e[51]=V,e[52]=q,e[53]=_):_=e[53],_}function lt(t){const e=G.c(8),{registryId:l}=t,o=we(l),c=o?.tools;let r;e[0]!==c?(r=ye(c),e[0]=c,e[1]=r):r=e[1];const a=r;if(!a)throw new Error("This registry does not support listing store items.");const i=o?.tools;let d;e[2]!==i?(d=Ne(i),e[2]=i,e[3]=d):d=e[3];const h=d||void 0;let n;return e[4]!==a||e[5]!==l||e[6]!==h?(n=s.jsx(st,{registryId:l,listToolName:a,filtersToolName:h}),e[4]=a,e[5]=l,e[6]=h,e[7]=n):n=e[7],n}function rt(t){const e=G.c(15),{registries:l,value:o,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:a,placeholder:i}=t,d=i===void 0?"Select a registry...":i;let y;e[0]!==d?(y=s.jsx(Ae,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ee,{placeholder:d})}),e[0]=d,e[1]=y):y=e[1];let h;e[2]!==l?(h=l.map(ot),e[2]=l,e[3]=h):h=e[3];let n;e[4]!==r||e[5]!==a?(n=a.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),a.map(f=>s.jsxs("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),r(f)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[f.icon?s.jsx("img",{src:f.icon,alt:f.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:f.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:f.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(Be,{size:16})})]},f.id??f.title))]}),e[4]=r,e[5]=a,e[6]=n):n=e[6];let N;e[7]!==h||e[8]!==n?(N=s.jsxs(De,{children:[h,n]}),e[7]=h,e[8]=n,e[9]=N):N=e[9];let u;return e[10]!==c||e[11]!==y||e[12]!==N||e[13]!==o?(u=s.jsxs(Me,{value:o,onValueChange:c,children:[y,N]}),e[10]=c,e[11]=y,e[12]=N,e[13]=o,e[14]=u):u=e[14],u}function ot(t){return s.jsx(Ke,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function nt({registries:t,onConnected:e}){const l=ae(),{org:{slug:o}}=Z(),{data:c}=ue.useSession(),r=oe(),[a,i]=M.useState(!1),d=t[0],y=async()=>{if(!(!d||!c?.user?.id)){i(!0);try{const n=await l.create.mutateAsync(d);e?.(n.id)}finally{i(!1)}}},h=()=>{r({to:"/$org/mcps",params:{org:o},search:{action:"create"}})};return s.jsx(Ve,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(Q,{variant:"outline",onClick:y,disabled:a||!d,children:[d?.icon&&s.jsx("img",{src:d.icon,alt:"",className:"size-4"}),a?"Installing...":"Install Registry"]}),s.jsx(Q,{variant:"outline",onClick:h,children:"Custom Connection"})]})})}function Yt(){const t=G.c(41),{org:e}=Z(),l=Te(),o=ae(),c=xe(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,a=Oe(l);let i;t[0]!==a?(i=a.map(ct),t[0]=a,t[1]=i):i=t[1];const d=i;let y;t[2]!==e.slug?(y=We.selectedRegistry(e.slug),t[2]=e.slug,t[3]=y):y=t[3];const[h,n]=qe(y,at);let N;if(t[4]!==a||t[5]!==h){let p;t[7]!==h?(p=K=>K.id===h,t[7]=h,t[8]=p):p=t[8],N=a.find(p),t[4]=a,t[5]=h,t[6]=N}else N=t[6];const f=N?.id||a[0]?.id||"";let j;t[9]!==e.id?(j=be(e.id),t[9]=e.id,t[10]=j):j=t[10];let R;t[11]!==j?(R=[j],t[11]=j,t[12]=R):R=t[12];const C=R;let b;t[13]===Symbol.for("react.memo_cache_sentinel")?(b=[Se()],t[13]=b):b=t[13];const k=b;let P;t[14]!==o.create||t[15]!==n?(P=async p=>{const K=await o.create.mutateAsync(p);n(K.id)},t[14]=o.create,t[15]=n,t[16]=P):P=t[16];const v=P;let S;t[17]!==a?(S=new Set(a.map(it)),t[17]=a,t[18]=S):S=t[18];const T=S;let I;t[19]!==T||t[20]!==C?(I=C.filter(p=>p.id&&!T.has(p.id)),t[19]=T,t[20]=C,t[21]=I):I=t[21];const z=I;let L;t[22]!==T?(L=k.filter(p=>p.id&&!T.has(p.id)),t[22]=T,t[23]=L):L=t[23];const $=L;if(r){let p;return t[24]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ge,{}),t[24]=p):p=t[24],p}let m;t[25]!==v?(m=async p=>v(p),t[25]=v,t[26]=m):m=t[26];let x;t[27]!==z||t[28]!==f||t[29]!==d||t[30]!==n||t[31]!==m?(x=s.jsx(pe,{title:"Store",ctaButton:s.jsx(rt,{wellKnownRegistries:z,registries:d,value:f,onValueChange:n,onAddWellKnown:m,placeholder:"Select store..."})}),t[27]=z,t[28]=f,t[29]=d,t[30]=n,t[31]=m,t[32]=x):x=t[32];let g;t[33]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=g):g=t[33];let w;t[34]!==$||t[35]!==f||t[36]!==n?(w=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(M.Suspense,{fallback:g,children:f?s.jsx(lt,{registryId:f}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(nt,{registries:$,onConnected:p=>{n(p)}})})})}),t[34]=$,t[35]=f,t[36]=n,t[37]=w):w=t[37];let F;return t[38]!==x||t[39]!==w?(F=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[x,w]}),t[38]=x,t[39]=w,t[40]=F):F=t[40],F}function it(t){return t.id}function at(t){return t??""}function ct(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Yt as default};
@@ -1 +0,0 @@
1
- import{c as T,u as z,j as n}from"./index-504A5fzu.js";import{B as y}from"./button-D373Gh7m.js";import{T as C,a as S,b as B,c as v}from"./tooltip-BXVSpXAI.js";import{c as A}from"./Pin01-CCrFQOyT.js";import{u as E,a as I}from"./use-organization-settings-wk-RrGpZ.js";function $(h){const e=T.c(19),{title:u,url:t,icon:p}=h,{org:_}=z(),s=E(_.id),f=I(_.id);let a;e[0]!==s?.sidebar_items||e[1]!==t?(a=s?.sidebar_items?.some(m=>m.url===t),e[0]=s?.sidebar_items,e[1]=t,e[2]=a):a=e[2];const r=!!a;let l;e[3]!==f.update||e[4]!==p||e[5]!==r||e[6]!==s?.sidebar_items||e[7]!==u||e[8]!==t?(l=async()=>{const m=s?.sidebar_items||[];let j;r?j=m.filter(P=>P.url!==t):j=[...m,{title:u,url:t,icon:p}],await f.update.mutateAsync({sidebar_items:j})},e[3]=f.update,e[4]=p,e[5]=r,e[6]=s?.sidebar_items,e[7]=u,e[8]=t,e[9]=l):l=e[9];const b=l,x=r?"secondary":"outline";let c;e[10]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(A,{size:16}),e[10]=c):c=e[10];let i;e[11]!==b||e[12]!==x?(i=n.jsx(C,{asChild:!0,children:n.jsx(y,{onClick:b,size:"icon",variant:x,className:"size-7 border border-input",children:c})}),e[11]=b,e[12]=x,e[13]=i):i=e[13];const g=r?"Pinned":"Pin to sidebar";let o;e[14]!==g?(o=n.jsx(S,{children:g}),e[14]=g,e[15]=o):o=e[15];let d;return e[16]!==i||e[17]!==o?(d=n.jsx(B,{children:n.jsxs(v,{children:[i,o]})}),e[16]=i,e[17]=o,e[18]=d):d=e[18],d}export{$ as P};
@@ -1 +0,0 @@
1
- import{r as x,c as u,j as r,$ as L,u as O,l as A,ap as R,aQ as h,ao as N,a_ as D}from"./index-504A5fzu.js";import{C as I}from"./collection-header-BHLaNdMe.js";import{C as M}from"./collection-page-BqHjcMvL.js";import{u as F,a as H}from"./use-organization-settings-wk-RrGpZ.js";import{c as f,B as j}from"./button-D373Gh7m.js";import{S as Q}from"./switch-Cy8A6BDO.js";import{i as T}from"./ArrowLeft-DESkG8WH.js";import"./collection-display-button-DRWiQVZp.js";import"./dropdown-menu-B8A0M-FV.js";import"./Grid01-IjiH2KUT.js";import"./ArrowUp-DSzSuIWM.js";import"./Check-BwWwVwDq.js";import"./List-CeDrqSzo.js";import"./tooltip-BXVSpXAI.js";import"./view-mode-toggle-CCTPeHCH.js";import"./useMutation-DjmEVTlE.js";import"./constants-BsVN3aVM.js";const S=({size:a=24,color:e="currentColor",...s})=>x.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},x.createElement("path",{d:"M7 22 17 2"}));S.displayName="SlashDivider";function W(a){const e=u.c(4);let s;e[0]!==a?({...s}=a,e[0]=a,e[1]=s):s=e[1];let t;return e[2]!==s?(t=r.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...s}),e[2]=s,e[3]=t):t=e[3],t}function q(a){const e=u.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let i;e[3]!==s?(i=f("flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2",s),e[3]=s,e[4]=i):i=e[4];let n;return e[5]!==t||e[6]!==i?(n=r.jsx("ol",{"data-slot":"breadcrumb-list",className:i,...t}),e[5]=t,e[6]=i,e[7]=n):n=e[7],n}function C(a){const e=u.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let i;e[3]!==s?(i=f("inline-flex items-center gap-1.5",s),e[3]=s,e[4]=i):i=e[4];let n;return e[5]!==t||e[6]!==i?(n=r.jsx("li",{"data-slot":"breadcrumb-item",className:i,...t}),e[5]=t,e[6]=i,e[7]=n):n=e[7],n}function G(a){const e=u.c(10);let s,t,i;e[0]!==a?({asChild:s,className:t,...i}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=i):(s=e[1],t=e[2],i=e[3]);const n=s?L:"a";let o;e[4]!==t?(o=f("hover:text-foreground transition-colors",t),e[4]=t,e[5]=o):o=e[5];let d;return e[6]!==n||e[7]!==i||e[8]!==o?(d=r.jsx(n,{"data-slot":"breadcrumb-link",className:o,...i}),e[6]=n,e[7]=i,e[8]=o,e[9]=d):d=e[9],d}function J(a){const e=u.c(8);let s,t;e[0]!==a?({className:s,...t}=a,e[0]=a,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let i;e[3]!==s?(i=f("text-foreground font-normal",s),e[3]=s,e[4]=i):i=e[4];let n;return e[5]!==t||e[6]!==i?(n=r.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:i,...t}),e[5]=t,e[6]=i,e[7]=n):n=e[7],n}function K(a){const e=u.c(12);let s,t,i;e[0]!==a?({children:s,className:t,...i}=a,e[0]=a,e[1]=s,e[2]=t,e[3]=i):(s=e[1],t=e[2],i=e[3]);let n;e[4]!==t?(n=f("[&>svg]:size-3.5 text-muted-foreground -rotate-12 opacity-50 list-none",t),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==s?(o=s??r.jsx(S,{}),e[6]=s,e[7]=o):o=e[7];let d;return e[8]!==i||e[9]!==n||e[10]!==o?(d=r.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:n,...i,children:o}),e[8]=i,e[9]=n,e[10]=o,e[11]=d):d=e[11],d}function me(){const{org:a}=O(),e=A(),s=F(a.id),{update:t}=H(a.id),[i,n]=x.useState({}),[o,d]=x.useState(!1),p=s?.enabled_plugins??[],k=l=>{const c=i[l];return c!==void 0?c:p.includes(l)},w=()=>{const l=new Set(p);for(const[c,m]of Object.entries(i))m?l.add(c):l.delete(c);return Array.from(l)},b=Object.keys(i).length>0,y=(l,c)=>{const m=p.includes(l);n(c===m?g=>{const{[l]:v,...$}=g;return $}:g=>({...g,[l]:c}))},P=async()=>{d(!0);try{await t.mutateAsync({enabled_plugins:w()}),n({}),N.success("Plugin settings saved")}catch{N.error("Failed to save plugin settings")}finally{d(!1)}},E=()=>{n({})},z=l=>D.find(c=>c.pluginId===l),B=l=>h.find(m=>m.id===l)?.description??null;return r.jsxs(M,{children:[r.jsx(I,{title:r.jsx(W,{children:r.jsxs(q,{children:[r.jsx(C,{children:r.jsx(G,{asChild:!0,children:r.jsx(R,{to:"/$org/settings",params:{org:a.slug},children:"Settings"})})}),r.jsx(K,{}),r.jsx(C,{children:r.jsx(J,{children:"Plugins"})})]})}),leftElement:r.jsx(j,{variant:"ghost",size:"icon",className:"size-8 text-muted-foreground",onClick:()=>e({to:"/$org/settings",params:{org:a.slug}}),children:r.jsx(T,{className:"size-4"})})}),r.jsx("div",{className:"flex-1 overflow-auto",children:r.jsx("div",{className:"flex h-full",children:r.jsx("div",{className:"flex-1 overflow-auto",children:r.jsx("div",{className:"p-5 max-w-2xl",children:r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization."})}),r.jsx("div",{className:"divide-y divide-border border-y border-border",children:h.map(l=>{const c=z(l.id),m=B(l.id),g=k(l.id);return r.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c?.icon&&r.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:c.icon}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-sm font-medium text-foreground",children:c?.label??l.id}),m&&r.jsx("p",{className:"text-xs text-muted-foreground",children:m})]})]}),r.jsx(Q,{checked:g,onCheckedChange:v=>y(l.id,v),disabled:o})]},l.id)})}),h.length===0&&r.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),r.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[r.jsx(j,{onClick:P,disabled:!b||o,className:"min-w-24",children:o?"Saving...":"Save Changes"}),b&&r.jsx(j,{variant:"outline",onClick:E,disabled:o,children:"Cancel"})]})]})})})})})]})}export{me as default};
@@ -1 +0,0 @@
1
- import{r as i,w as $,j as c,av as z,aw as G,y as O,x as _,z as g,ax as w,D as E,ay as H,az as j,aA as L,aB as K,E as B,aC as U,aD as V,aE as W,aF as Z,aG as q,aH as J,c as R}from"./index-504A5fzu.js";import{c as Q}from"./button-D373Gh7m.js";var m="Popover",[b]=B(m,[j]),P=j(),[X,d]=b(m),N=t=>{const{__scopePopover:e,children:o,open:r,defaultOpen:n,onOpenChange:s,modal:a=!1}=t,p=P(e),l=i.useRef(null),[u,h]=i.useState(!1),[x,f]=$({prop:r,defaultProp:n??!1,onChange:s,caller:m});return c.jsx(z,{...p,children:c.jsx(X,{scope:e,contentId:G(),triggerRef:l,open:x,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:a,children:o})})};N.displayName=m;var F="PopoverAnchor",Y=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(F,o),s=P(o),{onCustomAnchorAdd:a,onCustomAnchorRemove:p}=n;return i.useEffect(()=>(a(),()=>p()),[a,p]),c.jsx(w,{...s,...r,ref:e})});Y.displayName=F;var y="PopoverTrigger",S=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(y,o),s=P(o),a=O(e,n.triggerRef),p=c.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":I(n.open),...r,ref:a,onClick:g(t.onClick,n.onOpenToggle)});return n.hasCustomAnchor?p:c.jsx(w,{asChild:!0,...s,children:p})});S.displayName=y;var A="PopoverPortal",[ee,oe]=b(A,{forceMount:void 0}),D=t=>{const{__scopePopover:e,forceMount:o,children:r,container:n}=t,s=d(A,e);return c.jsx(ee,{scope:e,forceMount:o,children:c.jsx(E,{present:o||s.open,children:c.jsx(H,{asChild:!0,container:n,children:r})})})};D.displayName=A;var v="PopoverContent",M=i.forwardRef((t,e)=>{const o=oe(v,t.__scopePopover),{forceMount:r=o.forceMount,...n}=t,s=d(v,t.__scopePopover);return c.jsx(E,{present:r||s.open,children:s.modal?c.jsx(re,{...n,ref:e}):c.jsx(ne,{...n,ref:e})})});M.displayName=v;var te=U("PopoverContent.RemoveScroll"),re=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(null),n=O(e,r),s=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return L(a)},[]),c.jsx(K,{as:te,allowPinchZoom:!0,children:c.jsx(T,{...t,ref:n,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(t.onCloseAutoFocus,a=>{a.preventDefault(),s.current||o.triggerRef.current?.focus()}),onPointerDownOutside:g(t.onPointerDownOutside,a=>{const p=a.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,u=p.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:g(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=i.forwardRef((t,e)=>{const o=d(v,t.__scopePopover),r=i.useRef(!1),n=i.useRef(!1);return c.jsx(T,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||o.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const a=s.target;o.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&n.current&&s.preventDefault()}})}),T=i.forwardRef((t,e)=>{const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:h,...x}=t,f=d(v,o),C=P(o);return V(),c.jsx(W,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:s,children:c.jsx(Z,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(q,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:e,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",se=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=d(k,o);return c.jsx(_.button,{type:"button",...r,ref:e,onClick:g(t.onClick,()=>n.onOpenChange(!1))})});se.displayName=k;var ae="PopoverArrow",ce=i.forwardRef((t,e)=>{const{__scopePopover:o,...r}=t,n=P(o);return c.jsx(J,{...n,...r,ref:e})});ce.displayName=ae;function I(t){return t?"open":"closed"}var ie=N,pe=S,le=D,ue=M;function ve(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(ie,{"data-slot":"popover",...o}),e[2]=o,e[3]=r):r=e[3],r}function ge(t){const e=R.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=c.jsx(pe,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function Pe(t){const e=R.c(12);let o,r,n,s;e[0]!==t?({className:o,align:n,sideOffset:s,...r}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const a=n===void 0?"center":n,p=s===void 0?4:s;let l;e[5]!==o?(l=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg overflow-hidden border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=l):l=e[6];let u;return e[7]!==a||e[8]!==r||e[9]!==p||e[10]!==l?(u=c.jsx(le,{children:c.jsx(ue,{"data-slot":"popover-content",align:a,sideOffset:p,className:l,...r})}),e[7]=a,e[8]=r,e[9]=p,e[10]=l,e[11]=u):u=e[11],u}export{ge as P,Pe as a,ve as b};
@@ -1 +0,0 @@
1
- import{r as c,v as rt,w as Ne,j as d,av as st,aw as be,y as k,ax as lt,x as j,z as P,b1 as $,ay as at,ac as _e,az as Ee,b2 as it,F as ct,b3 as dt,aA as ut,aD as pt,aB as ft,aE as mt,aF as ht,E as vt,aC as gt,aG as xt,aH as St,c as ee}from"./index-504A5fzu.js";import{V as wt}from"./tooltip-BXVSpXAI.js";import{i as Ct}from"./Check-BwWwVwDq.js";import{t as Re}from"./ChevronDown-FrVOX9vD.js";import{c as oe}from"./button-D373Gh7m.js";function Pe(n,[e,t]){return Math.min(t,Math.max(e,n))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=it(J),[ne]=vt(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Nt,Pt]=ne(J),je=n=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=n,p=pe(e),[v,C]=c.useState(null),[m,x]=c.useState(null),[F,M]=c.useState(!1),re=rt(u),[_,O]=Ne({prop:o,defaultProp:r??!1,onChange:i,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:a,caller:J}),L=c.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=c.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(st,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Nt,{scope:n.__scopeSelect,onNativeOptionAdd:c.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:c.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=c.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:o=!1,...r}=n,i=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=c.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(lt,{asChild:!0,...i,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...r,ref:a,onClick:P(r.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:P(r.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(r.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,children:i,placeholder:s="",...l}=n,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=i!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):i})});De.displayName=Oe;var _t="SelectIcon",ke=c.forwardRef((n,e)=>{const{__scopeSelect:t,children:o,...r}=n;return d.jsx(j.span,{"aria-hidden":!0,...r,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=n=>d.jsx(at,{asChild:!0,...n});Le.displayName=Et;var Q="SelectContent",Be=c.forwardRef((n,e)=>{const t=G(Q,n.__scopeSelect),[o,r]=c.useState();if($(()=>{r(new DocumentFragment)},[]),!t.open){const i=o;return i?_e.createPortal(d.jsx(Ve,{scope:n.__scopeSelect,children:d.jsx(de.Slot,{scope:n.__scopeSelect,children:d.jsx("div",{children:n.children})})}),i):null}return d.jsx(He,{...n,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=gt("SelectContent.RemoveScroll"),He=c.forwardRef((n,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=n,m=G(Q,t),[x,F]=c.useState(null),[M,re]=c.useState(null),_=k(e,f=>F(f)),[O,U]=c.useState(null),[q,L]=c.useState(null),B=ue(t),[W,V]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(x)return ut(x)},[x]),pt();const E=c.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===y&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=c.useCallback(()=>E([O,x]),[E,O,x]);c.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;c.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),c.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=c.useCallback(()=>x?.focus(),[x]),te=c.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ie=o==="popper"?Se:ze,se=ie===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(ft,{as:jt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=y.indexOf(I);y=y.slice(N+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=c.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:o,...r}=n,i=G(Q,t),s=Y(Q,t),[l,a]=c.useState(null),[u,h]=c.useState(null),g=k(e,_=>h(_)),b=ue(t),w=c.useRef(!1),S=c.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=c.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&v&&C){const _=i.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(i.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ie=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ie,se+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,i.trigger,i.valueNode,l,u,p,v,C,i.dir,o]);$(()=>x(),[x]);const[F,M]=c.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=c.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...r,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=c.forwardRef((n,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:r=A,...i}=n,s=pe(t);return d.jsx(xt,{...s,...i,ref:e,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Fe=c.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:o,...r}=n,i=Y(we,t),s=Te(we,t),l=k(e,i.onViewportChange),a=c.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:P(r.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=be();return d.jsx(Dt,{scope:t,id:r,children:d.jsx(j.div,{role:"group","aria-labelledby":r,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=kt(We,t);return d.jsx(j.div,{id:r.id,...o,ref:e})});Bt.displayName=We;var ce="SelectItem",[Vt,Ke]=ne(ce),$e=c.forwardRef((n,e)=>{const{__scopeSelect:t,value:o,disabled:r=!1,textValue:i,...s}=n,l=G(ce,t),a=Y(ce,t),u=l.value===o,[h,g]=c.useState(i??""),[b,w]=c.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,r)),p=be(),v=c.useRef("touch"),C=()=>{r||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:r,textId:p,isSelected:u,onItemTextChange:c.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:r,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>w(!0)),onBlur:P(s.onBlur,()=>w(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:P(s.onPointerMove,m=>{v.current=m.pointerType,r?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ce;var le="SelectItemText",Ge=c.forwardRef((n,e)=>{const{__scopeSelect:t,className:o,style:r,...i}=n,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Pt(le,t),[h,g]=c.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=c.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...i,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(i.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=c.forwardRef((n,e)=>{const t=Y(Ce,n.__scopeSelect),o=Te(Ce,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=c.forwardRef((n,e)=>{const t=Y(ye,n.__scopeSelect),o=Te(ye,n.__scopeSelect),[r,i]=c.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;i(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),r?d.jsx(Je,{...n,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=c.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:o,...r}=n,i=Y("SelectScrollButton",t),s=c.useRef(null),l=ue(t),a=c.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return c.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:P(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(r.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=c.forwardRef((n,e)=>{const{__scopeSelect:t,...o}=n,r=pe(t),i=G(Ie,t),s=Y(Ie,t);return i.open&&s.position==="popper"?d.jsx(St,{...r,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=c.forwardRef(({__scopeSelect:n,value:e,...t},o)=>{const r=c.useRef(null),i=k(o,r),s=ct(e);return c.useEffect(()=>{const l=r.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...wt,...t.style},ref:i,defaultValue:e})});Qe.displayName=Ut;function et(n){return n===""||n===void 0}function tt(n){const e=dt(n),t=c.useRef(""),o=c.useRef(0),r=c.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),i=c.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,r,i]}function ot(n,e,t){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=t?n.indexOf(t):-1;let s=Wt(n,Math.max(i,0));r.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==t?a:void 0}function Wt(n,e){return n.map((t,o)=>n[(e+o)%n.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;const nt=({size:n=24,color:e="currentColor",...t})=>c.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},c.createElement("path",{d:"m18 15-6-6-6 6"}));nt.displayName="ChevronUp";function uo(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(n){const e=ee.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(n){const e=ee.c(13);let t,o,r,i;e[0]!==n?({className:o,size:i,children:t,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?"default":i;let l;e[5]!==o?(l=oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-7 data-[size=xs]:h-7 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...r,children:[t,a]}),e[8]=t,e[9]=r,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(n){const e=ee.c(25);let t,o,r,i,s;e[0]!==n?({className:o,children:t,position:i,hideScrollButtons:s,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i,e[5]=s):(t=e[1],o=e[2],r=e[3],i=e[4],s=e[5]);const l=i===void 0?"popper":i,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==r||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",className:h,position:l,...r,children:[g,S,p]})}),e[18]=l,e[19]=r,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(n){const e=ee.c(16);let t,o,r,i;e[0]!==n?({className:o,children:t,hideCheck:i,...r}=n,e[0]=n,e[1]=t,e[2]=o,e[3]=r,e[4]=i):(t=e[1],o=e[2],r=e[3],i=e[4]);const s=i===void 0?!1:i;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(Ct,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==r||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...r,children:[a,u]}),e[11]=r,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(nt,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}function ro(n){const e=ee.c(9);let t,o;e[0]!==n?({className:t,...o}=n,e[0]=n,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let r;e[3]!==t?(r=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=r):r=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Re,{className:"size-4"}),e[5]=i):i=e[5];let s;return e[6]!==o||e[7]!==r?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:r,...o,children:i}),e[6]=o,e[7]=r,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Pe as e,nt as n};
@@ -1 +0,0 @@
1
- import{r as y,l as $,u as B,ab as D,k as P,h as K,ao as C,K as I,g as Q,j as s,ap as A,c as H,o as T,s as L}from"./index-504A5fzu.js";import{C as W}from"./collection-header-BHLaNdMe.js";import{C as Y}from"./collection-page-BqHjcMvL.js";import{u as Z}from"./useMutation-DjmEVTlE.js";import{B as w}from"./button-D373Gh7m.js";import{a as G,F as k,b as R,c as E,d as O,f as M,e as J}from"./form-D_p7nR82.js";import{I as U}from"./input-L4CnUGon.js";import{i as V}from"./Grid01-IjiH2KUT.js";import{i as X}from"./Upload01-Oco4mhUo.js";import{i as _}from"./X-BYmeb6sr.js";import"./collection-display-button-DRWiQVZp.js";import"./dropdown-menu-B8A0M-FV.js";import"./ArrowUp-DSzSuIWM.js";import"./Check-BwWwVwDq.js";import"./List-CeDrqSzo.js";import"./tooltip-BXVSpXAI.js";import"./view-mode-toggle-CCTPeHCH.js";const q=({size:d=24,color:e="currentColor",...o})=>y.createElement("svg",{viewBox:"0 0 24 24",width:d,height:d,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},y.createElement("path",{d:"m2 14.5 9.642 4.821c.131.066.197.099.266.111.06.012.123.012.184 0 .069-.012.135-.045.266-.11L22 14.5m-20-5 9.642-4.821c.131-.066.197-.098.266-.111a.5.5 0 0 1 .184 0c.069.013.135.045.266.111L22 9.5l-9.642 4.821a1.028 1.028 0 0 1-.266.111.501.501 0 0 1-.184 0c-.069-.012-.135-.045-.266-.11L2 9.5Z"}));q.displayName="LayersTwo01";const ee=T({name:L().min(1,"Name is required").max(255,"Name is too long"),slug:L().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:L().optional()});function se(d){const e=H.c(24),{value:o,onChange:a,name:m}=d,r=y.useRef(null);let u;e[0]!==a?(u=z=>{const F=z.target.files?.[0];if(F){if(F.size>2097152){C.error("Image must be smaller than 2MB");return}const c=new FileReader;c.onerror=()=>{const N=c.error;console.error("FileReader error:",N),C.error(N?.message||"Failed to read image file. Please try again."),r.current&&(r.current.value="")},c.onloadend=()=>{if(c.readyState===FileReader.DONE&&c.result){const N=c.result;a(N)}},c.readAsDataURL(F)}},e[0]=a,e[1]=u):u=e[1];const j=u;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{r.current?.click()},e[2]=l):l=e[2];const t=l;let i;e[3]!==a?(i=z=>{z.stopPropagation(),a("")},e[3]=a,e[4]=i):i=e[4];const n=i;let g;e[5]!==j?(g=s.jsx("input",{type:"file",ref:r,className:"hidden",accept:"image/*",onChange:j}),e[5]=j,e[6]=g):g=e[6];let x;e[7]!==n||e[8]!==m||e[9]!==o?(x=o?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:o,alt:m||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:n,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(_,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:t,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(X,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),e[7]=n,e[8]=m,e[9]=o,e[10]=x):x=e[10];const S=o?"Change Logo":"Upload Logo";let h;e[11]!==S?(h=s.jsx(w,{type:"button",variant:"outline",size:"sm",onClick:t,className:"mb-2",children:S}),e[11]=S,e[12]=h):h=e[12];let f;e[13]!==n||e[14]!==o?(f=o&&s.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:n,className:"ml-2",children:"Remove"}),e[13]=n,e[14]=o,e[15]=f):f=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),e[16]=v):v=e[16];let p;e[17]!==h||e[18]!==f?(p=s.jsxs("div",{className:"flex-1",children:[h,f,v]}),e[17]=h,e[18]=f,e[19]=p):p=e[19];let b;return e[20]!==p||e[21]!==g||e[22]!==x?(b=s.jsxs("div",{className:"flex items-start gap-4",children:[g,x,p]}),e[20]=p,e[21]=g,e[22]=x,e[23]=b):b=e[23],b}function ve(){const d=$(),{org:e}=B(),o=D(),[a,m]=y.useState(!1),r=P({resolver:K(ee),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),u=Z({mutationFn:async t=>{const i={name:t.name,slug:t.slug};t.logo&&(i.logo=t.logo);const n=await Q.organization.update({organizationId:e.id,data:i});if(n?.error)throw new Error(n.error.message||"Failed to update organization");return n},onSuccess:t=>{o.invalidateQueries({queryKey:I.organizations()}),o.invalidateQueries({queryKey:I.activeOrganization(e.slug)}),C.success("Organization settings updated successfully"),t?.data?.slug&&t.data.slug!==e.slug&&d({to:"/$org/settings",params:{org:t.data.slug}})},onError:t=>{C.error(t instanceof Error?t.message:"Failed to update organization")},onSettled:()=>{m(!1)}}),j=t=>{m(!0),u.mutate(t)},l=r.formState.isDirty;return s.jsxs(Y,{children:[s.jsx(W,{title:"Settings"}),s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(G,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(j),className:"space-y-6",children:[s.jsx(k,{control:r.control,name:"name",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Organization Name"}),s.jsx(O,{children:s.jsx(U,{placeholder:"My Organization",...t,disabled:a})}),s.jsx(M,{})]})}),s.jsx(k,{control:r.control,name:"slug",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Organization Slug"}),s.jsx(O,{children:s.jsx(U,{placeholder:"my-organization",...t,disabled:a,onChange:i=>{const n=i.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");t.onChange(n)}})}),s.jsx(J,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(M,{})]})}),s.jsx(k,{control:r.control,name:"logo",render:({field:t})=>s.jsxs(R,{children:[s.jsx(E,{children:"Logo"}),s.jsx(O,{children:s.jsx(se,{value:t.value,onChange:t.onChange,name:r.watch("name")})}),s.jsx(M,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(w,{type:"submit",disabled:!l||a,className:"min-w-24",children:a?"Saving...":"Save Changes"}),l&&s.jsx(w,{type:"button",variant:"outline",onClick:()=>r.reset(),disabled:a,children:"Cancel"})]})]})}),s.jsxs("div",{className:"border-t border-border pt-6 mt-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"More Settings"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Additional configuration options for your organization."})]}),s.jsx("div",{className:"mt-4",children:s.jsxs(A,{to:"/$org/settings/plugins",params:{org:e.slug},className:"flex items-center justify-between p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors group",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(q,{className:"h-5 w-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for your organization"})]})]}),s.jsx(V,{className:"h-5 w-5 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]})})})})})]})}export{ve as default};
@@ -1,12 +0,0 @@
1
- import{r as j,c as w,j as n,u as Ne,l as de,b6 as $e,L as Pe,a_ as It,$ as Ot,t as Tt,ao as G,bA as Fe,g as W,a as Ie,b0 as Mt,bB as Et,b3 as Ve,bC as ce,b as Lt,S as Ze,d as At,e as Pt,N as Dt,q as Rt,P as Ht,aP as Ke,K as Ut,O as Bt}from"./index-504A5fzu.js";import{C as P,u as Wt}from"./index-CsaK2Zyj.js";import{I as Ce,n as Ft}from"./empty-state-DPLaHs22.js";import{u as we}from"./use-deco-chat-open-CnAfKKCI.js";import{c as M,B as D}from"./button-D373Gh7m.js";import{d as Vt}from"./constants-BsVN3aVM.js";import{T as Zt,i as Kt,b as Gt,S as qt,c as Yt,d as Jt,e as Xt,f as Qt,t as Ge}from"./typewriter-title-CO1Atowa.js";import{s as qe}from"./Plus-B4bZuJyH.js";import{t as Ye}from"./Users03-ChMrWUg7.js";import{i as xe}from"./X-BYmeb6sr.js";import{E as Je}from"./error-boundary-DGGozsia.js";import{u as es,S as Q,i as ts}from"./collapsible-D5bXYEu5.js";import{a as ss}from"./Home02-B4t-Ls4v.js";import{u as Oe,a as ns}from"./use-organization-settings-wk-RrGpZ.js";import{u as me}from"./use-mobile-BvueHiH_.js";import{b as Xe,a as ge,T as be,c as je}from"./tooltip-BXVSpXAI.js";import{A as J}from"./avatar-DveL_Zo1.js";import{P as Te,a as Me,b as Ee}from"./popover-BW-chC87.js";import{t as as}from"./ChevronDown-FrVOX9vD.js";import{c as rs,b as is,g as ls,a as os,D as cs}from"./dialog-sp1iNNV1.js";import{L as ds}from"./form-D_p7nR82.js";import{S as ms}from"./switch-Cy8A6BDO.js";import{i as ve}from"./Check-BwWwVwDq.js";import{i as fs}from"./Code01-Bus4rjLa.js";import{a as Qe}from"./Copy01-CU0ImpYo.js";import{i as us}from"./Lock01-BlcSKNwc.js";import{C as et}from"./create-organization-dialog-ByLHFsGC.js";import{n as De}from"./Inbox01-Nf9S_z_u.js";import{B as Re}from"./badge-DeCRZtfI.js";import{s as He}from"./XClose-BrPaj-T9.js";import{i as hs}from"./File06-C2LBZfWa.js";import{I as ps}from"./input-L4CnUGon.js";import{c as xs}from"./Grid01-IjiH2KUT.js";import{a as gs,b as bs,D as js,c as vs,g as Ue}from"./dropdown-menu-B8A0M-FV.js";import{n as Be}from"./LinkExternal01-B00_hrMY.js";import{u as tt,L as st}from"./localstorage-keys-ELyXVtKs.js";import{R as Ns,a as nt,b as ws}from"./resizable-BKhOe-uT.js";import"./spinner-DGXi0Fqy.js";import"./use-mcp-prompts-Cauox13I.js";import"./useQuery-2fM2t_EQ.js";import"./AlertCircle-CiqOV3gN.js";import"./ArrowUp-DSzSuIWM.js";import"./Edit01-1SiMuTuh.js";import"./Terminal-CUhRn_Km.js";import"./monaco-editor-NeTwO1He.js";import"./use-connection-CXgi6BLT.js";import"./use-collections-DgQLvk8y.js";import"./useMutation-DjmEVTlE.js";import"./generate-id-Dyweu44Y.js";import"./SearchMd-CvLjdKIL.js";import"./Trash01-CrkjtnA0.js";import"./use-virtual-mcp-PjR1OFlb.js";import"./use-create-virtual-mcp-C56z94et.js";import"./use-binding-C0SFeppw.js";import"./binder-ChJO9Gsr.js";import"./useSuspenseInfiniteQuery-BQW4uJSq.js";import"./infiniteQueryObserver-BZSSiryQ.js";import"./select-BXQ9vi5I.js";import"./Image01-Bc9GrKYJ.js";import"./alert-dialog-DQH47fXT.js";const ke=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M7 17 17 7m0 0H7m10 0v10"}));ke.displayName="ArrowUpRight";const at=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));at.displayName="BarChart10";const rt=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"m12 21-.1-.15c-.695-1.042-1.042-1.563-1.5-1.94a4 4 0 0 0-1.378-.737C8.453 18 7.827 18 6.575 18H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 16.48 2 15.92 2 14.8V6.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 3 4.08 3 5.2 3h.4c2.24 0 3.36 0 4.216.436a4 4 0 0 1 1.748 1.748C12 6.04 12 7.16 12 9.4M12 21V9.4M12 21l.1-.15c.695-1.042 1.042-1.563 1.5-1.94a3.999 3.999 0 0 1 1.378-.737C15.547 18 16.173 18 17.425 18H18.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 16.48 22 15.92 22 14.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 3 19.92 3 18.8 3h-.4c-2.24 0-3.36 0-4.216.436a4 4 0 0 0-1.748 1.748C12 6.04 12 7.16 12 9.4"}));rt.displayName="BookOpen01";const it=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));it.displayName="Building02";const lt=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"m18 17-5-5 5-5m-7 10-5-5 5-5"}));lt.displayName="ChevronLeftDouble";const ot=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"m6 17 5-5-5-5m7 10 5-5-5-5"}));ot.displayName="ChevronRightDouble";const ct=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));ct.displayName="Globe01";const dt=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M15 3v18M7.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.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));dt.displayName="LayoutRight";const mt=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));mt.displayName="LogOut01";const ft=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m3 5c0 .93 0 1.395-.102 1.776a3 3 0 0 1-2.122 2.122C9.395 21 8.93 21 8 21h-.5c-1.398 0-2.097 0-2.648-.228a3 3 0 0 1-1.624-1.624C3 18.597 3 17.898 3 16.5v-9c0-1.398 0-2.097.228-2.648a3 3 0 0 1 1.624-1.624C5.403 3 6.102 3 7.5 3H8c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C12 5.605 12 6.07 12 7"}));ft.displayName="LogOut02";const ut=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));ut.displayName="Mail01";const Le=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),j.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));Le.displayName="Settings01";const ht=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),j.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));ht.displayName="Settings02";const pt=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M3 8h12m0 0a3 3 0 1 0 6 0 3 3 0 0 0-6 0Zm-6 8h12M9 16a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));pt.displayName="Settings04";const xt=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));xt.displayName="UserCircle";const gt=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M4 21.817C4.603 22 5.416 22 6.8 22h10.4c1.384 0 2.197 0 2.8-.183m-16 0a2.18 2.18 0 0 1-.362-.144 3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h10.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 4.28 22 5.12 22 6.8v10.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311 2.18 2.18 0 0 1-.362.144m-16 0c0-.809.005-1.237.077-1.597a4 4 0 0 1 3.143-3.143C7.606 17 8.07 17 9 17h6c.93 0 1.394 0 1.78.077a4 4 0 0 1 3.143 3.143c.072.36.077.788.077 1.597M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));gt.displayName="UserSquare";const bt=({size:t=24,color:e="currentColor",...s})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},j.createElement("path",{d:"M13 2 4.093 12.688c-.348.418-.523.628-.525.804a.5.5 0 0 0 .185.397c.138.111.41.111.955.111H12l-1 8 8.907-10.688c.348-.418.523-.628.525-.804a.5.5 0 0 0-.185-.397c-.138-.111-.41-.111-.955-.111H12l1-8Z"}));bt.displayName="Zap";function Ss(){const t=w.c(82),{org:e}=Ne(),[,s]=we(),{selectedVirtualMcp:a,modelsConnections:r,isChatEmpty:i,activeThreadId:l,setActiveThreadId:o,threads:c}=es();let d;if(t[0]!==l||t[1]!==c){let Z;t[3]!==l?(Z=X=>X.id===l,t[3]=l,t[4]=Z):Z=t[4],d=c.find(Z),t[0]=l,t[1]=c,t[2]=d}else d=t[2];const m=d,[u,h]=j.useState(!1),[x,g]=j.useTransition();let p;t[5]!==e.id?(p=Vt(e.id),t[5]=e.id,t[6]=p):p=t[6];const f=a??p;let v;t[7]!==o?(v=()=>{g(()=>{o(crypto.randomUUID())})},t[7]=o,t[8]=v):v=t[8];const N=v;if(r.length===0){let Z;t[9]!==f.icon||t[10]!==f.title?(Z=n.jsx(Ce,{icon:f.icon,name:f.title,size:"xs",className:"size-5 rounded-md aspect-square shrink-0"}),t[9]=f.icon,t[10]=f.title,t[11]=Z):Z=t[11];let X;t[12]!==f.title?(X=n.jsx("span",{className:"text-sm font-medium",children:f.title}),t[12]=f.title,t[13]=X):X=t[13];let ne;t[14]!==Z||t[15]!==X?(ne=n.jsxs(P.Header.Left,{children:[Z,X]}),t[14]=Z,t[15]=X,t[16]=ne):ne=t[16];let ae;t[17]!==s?(ae=()=>s(!1),t[17]=s,t[18]=ae):ae=t[18];let ue;t[19]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(xe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[19]=ue):ue=t[19];let re;t[20]!==ae?(re=n.jsx(P.Header.Right,{children:n.jsx("button",{type:"button",onClick:ae,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:ue})}),t[20]=ae,t[21]=re):re=t[21];let ie;t[22]!==ne||t[23]!==re?(ie=n.jsxs(P.Header,{children:[ne,re]}),t[22]=ne,t[23]=re,t[24]=ie):ie=t[24];let le;t[25]!==e?(le=n.jsx(P.Main,{className:"flex flex-col items-center",children:n.jsx(P.EmptyState,{children:n.jsx(P.NoLlmBindingEmptyState,{title:"No model provider connected",description:"Connect to a model provider to unlock AI-powered features.",org:e})})}),t[25]=e,t[26]=le):le=t[26];let he;return t[27]!==le||t[28]!==ie?(he=n.jsxs(P,{children:[ie,le]}),t[27]=le,t[28]=ie,t[29]=he):he=t[29],he}const _=u?"duration-300 opacity-0 -translate-x-4 pointer-events-none":x?"duration-200 opacity-0 pointer-events-none":"duration-300 opacity-100 translate-x-0";let S;t[30]!==_?(S=M("absolute inset-0 flex flex-col transition-all ease-in-out",_),t[30]=_,t[31]=S):S=t[31];let k;t[32]!==f.icon||t[33]!==f.title?(k=n.jsx(Ce,{icon:f.icon,name:f.title,size:"xs",className:"size-5 rounded-md aspect-square shrink-0"}),t[32]=f.icon,t[33]=f.title,t[34]=k):k=t[34];let y;t[35]!==m||t[36]!==f.title||t[37]!==i?(y=!i&&m?.title?n.jsx(Zt,{text:m.title,className:"text-sm font-medium text-foreground"}):n.jsx("span",{className:"text-sm font-medium text-foreground",children:f.title}),t[35]=m,t[36]=f.title,t[37]=i,t[38]=y):y=t[38];let z;t[39]!==k||t[40]!==y?(z=n.jsxs(P.Header.Left,{children:[k,y]}),t[39]=k,t[40]=y,t[41]=z):z=t[41];let C;t[42]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(qe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[42]=C):C=t[42];let $;t[43]!==N||t[44]!==x?($=n.jsx("button",{type:"button",onClick:N,disabled:x,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",title:"New chat",children:C}),t[43]=N,t[44]=x,t[45]=$):$=t[45];let I;t[46]===Symbol.for("react.memo_cache_sentinel")?(I=()=>h(!0),t[46]=I):I=t[46];let O;t[47]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx("button",{type:"button",onClick:I,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:n.jsx(Kt,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),t[47]=O):O=t[47];let T;t[48]!==s?(T=()=>s(!1),t[48]=s,t[49]=T):T=t[49];let E;t[50]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(xe,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"}),t[50]=E):E=t[50];let L;t[51]!==T?(L=n.jsx("button",{type:"button",onClick:T,className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:E}),t[51]=T,t[52]=L):L=t[52];let A;t[53]!==L||t[54]!==$?(A=n.jsxs(P.Header.Right,{children:[$,O,L]}),t[53]=L,t[54]=$,t[55]=A):A=t[55];let K;t[56]!==A||t[57]!==z?(K=n.jsxs(P.Header,{children:[z,A]}),t[56]=A,t[57]=z,t[58]=K):K=t[58];let U;t[59]!==f.description||t[60]!==f.icon||t[61]!==f.title||t[62]!==i?(U=n.jsx(P.Main,{children:i?n.jsx(P.EmptyState,{children:n.jsxs("div",{className:"flex flex-col items-center gap-6 w-full px-4",children:[n.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 p-0 text-center",children:[n.jsx(Ce,{icon:f.icon,name:f.title,size:"lg",fallbackIcon:n.jsx(Ye,{size:32}),className:"size-[60px]! rounded-[18px]!"}),n.jsx("h3",{className:"text-xl font-medium text-foreground",children:f.title}),n.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:f.description??"Ask anything about configuring model providers or using MCP Mesh."})]}),n.jsx(P.IceBreakers,{})]})}):n.jsx(P.Messages,{minHeightOffset:230})}),t[59]=f.description,t[60]=f.icon,t[61]=f.title,t[62]=i,t[63]=U):U=t[63];let F;t[64]===Symbol.for("react.memo_cache_sentinel")?(F=n.jsx(P.Footer,{children:n.jsx(P.Input,{})}),t[64]=F):F=t[64];let V;t[65]!==K||t[66]!==U||t[67]!==S?(V=n.jsxs("div",{className:S,children:[K,U,F]}),t[65]=K,t[66]=U,t[67]=S,t[68]=V):V=t[68];const B=u?"opacity-100 translate-x-0":"opacity-0 translate-x-4 pointer-events-none";let R;t[69]!==B?(R=M("absolute inset-0 flex flex-col transition-all duration-300 ease-in-out",B),t[69]=B,t[70]=R):R=t[70];let q;t[71]===Symbol.for("react.memo_cache_sentinel")?(q=()=>h(!1),t[71]=q):q=t[71];let te;t[72]!==l||t[73]!==o||t[74]!==c?(te=n.jsx(Gt,{threads:c,activeThreadId:l,onThreadSelect:o,onClose:q}),t[72]=l,t[73]=o,t[74]=c,t[75]=te):te=t[75];let se;t[76]!==R||t[77]!==te?(se=n.jsx("div",{className:R,children:te}),t[76]=R,t[77]=te,t[78]=se):se=t[78];let fe;return t[79]!==V||t[80]!==se?(fe=n.jsxs(P,{className:"relative overflow-hidden",children:[V,se]}),t[79]=V,t[80]=se,t[81]=fe):fe=t[81],fe}function ys(){const t=w.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(P.Skeleton,{}),t[0]=e):e=t[0];let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Je,{fallback:e,children:n.jsx(j.Suspense,{fallback:n.jsx(P.Skeleton,{}),children:n.jsx(Ss,{})})}),t[1]=s):s=t[1],s}function Cs(){const t=w.c(14),{locator:e,org:s}=Ne(),a=de(),r=$e(),{org:i}=Pe.parse(e);let l;t[0]!==e?(l=Pe.isOrgAdminProject(e),t[0]=e,t[1]=l):l=t[1];const o=l,c=Oe(s.id);let d;t[2]!==c?.enabled_plugins?(d=c?.enabled_plugins??[],t[2]=c?.enabled_plugins,t[3]=d):d=t[3];const m=d;let u;t[4]!==m?(u=y=>m.includes(y.pluginId),t[4]=m,t[5]=u):u=t[5];const h=It.filter(u),x=r.location.pathname===`/${i}`||r.location.pathname===`/${i}/`;let g;t[6]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(ss,{}),t[6]=g):g=t[6];let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(it,{}),t[7]=p):p=t[7];let b;t[8]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Ft,{}),t[8]=b):b=t[8];let f;t[9]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Ye,{}),t[9]=f):f=t[9];let v;t[10]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(bt,{}),t[10]=v):v=t[10];let N;t[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(at,{}),t[11]=N):N=t[11];let _;t[12]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(gt,{}),t[12]=_):_=t[12];let S;t[13]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Le,{}),t[13]=S):S=t[13];const k=[{key:"home",label:"Home",icon:g,onClick:()=>{x?window.dispatchEvent(new CustomEvent("reset-home-view")):a({to:"/$org",params:{org:i}})}},{key:"store",label:"Store",icon:p,onClick:()=>a({to:"/$org/store",params:{org:i}})},...h.map(y=>({key:y.pluginId,label:y.label,icon:y.icon,onClick:()=>a({to:"/$org/$pluginId",params:{org:i,pluginId:y.pluginId}})})),{key:"mcps",label:"Connections",icon:b,onClick:()=>a({to:"/$org/mcps",params:{org:i}})},{key:"agents",label:"Agents",icon:f,onClick:()=>a({to:"/$org/agents",params:{org:i}})},{key:"workflow",label:"Workflows",icon:v,onClick:()=>a({to:"/$org/workflows",params:{org:i}})},{key:"monitoring",label:"Monitoring",icon:N,onClick:()=>a({to:"/$org/monitoring",params:{org:i}})},{key:"members",label:"Members",icon:_,onClick:()=>a({to:"/$org/members",params:{org:i}})},{key:"settings",label:"Settings",icon:S,onClick:()=>a({to:"/$org/settings",params:{org:i}})}];return o?k:[]}const ks="sidebar_state",_s=3600*24*7,zs="16rem",$s="18rem",Is="3rem",Os="b",jt=j.createContext(null);function Se(){const t=j.useContext(jt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Ts(t){const e=w.c(21),{defaultOpen:s,open:a,onOpenChange:r,children:i}=t,l=s===void 0?!0:s,o=me(),[c,d]=j.useState(!1),[m,u]=j.useState(l),h=a??m;let x;e[0]!==h||e[1]!==r?(x=z=>{const C=typeof z=="function"?z(h):z;r?r(C):u(C),document.cookie=`${ks}=${C}; path=/; max-age=${_s}`},e[0]=h,e[1]=r,e[2]=x):x=e[2];const g=x;let p;e[3]!==o||e[4]!==g?(p=()=>o?d(Es):g(Ms),e[3]=o,e[4]=g,e[5]=p):p=e[5];const b=p;let f,v;e[6]!==b?(f=()=>{const z=C=>{if(C.key===Os&&(C.metaKey||C.ctrlKey)){const $=C.target;if($.tagName==="INPUT"||$.tagName==="TEXTAREA"||$.isContentEditable)return;C.preventDefault(),b()}};return globalThis.addEventListener("keydown",z),()=>globalThis.removeEventListener("keydown",z)},v=[b],e[6]=b,e[7]=f,e[8]=v):(f=e[7],v=e[8]),j.useEffect(f,v);const N=h?"expanded":"collapsed";let _;e[9]!==o||e[10]!==h||e[11]!==c||e[12]!==g||e[13]!==N||e[14]!==b?(_={state:N,open:h,setOpen:g,isMobile:o,openMobile:c,setOpenMobile:d,toggleSidebar:b},e[9]=o,e[10]=h,e[11]=c,e[12]=g,e[13]=N,e[14]=b,e[15]=_):_=e[15];const S=_;let k;e[16]!==i?(k=n.jsx(Xe,{delayDuration:0,children:i}),e[16]=i,e[17]=k):k=e[17];let y;return e[18]!==S||e[19]!==k?(y=n.jsx(jt.Provider,{value:S,children:k}),e[18]=S,e[19]=k,e[20]=y):y=e[20],y}function Ms(t){return!t}function Es(t){return!t}function Ls(t){const e=w.c(14);let s,a,r,i;e[0]!==t?({className:a,style:i,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=i):(s=e[1],a=e[2],r=e[3],i=e[4]);let l;e[5]!==i?(l={"--sidebar-width":zs,"--sidebar-width-icon":Is,...i},e[5]=i,e[6]=l):l=e[6];const o=l;let c;e[7]!==a?(c=M("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",a),e[7]=a,e[8]=c):c=e[8];let d;return e[9]!==s||e[10]!==r||e[11]!==o||e[12]!==c?(d=n.jsx("div",{"data-slot":"sidebar-wrapper",style:o,className:c,...r,children:s}),e[9]=s,e[10]=r,e[11]=o,e[12]=c,e[13]=d):d=e[13],d}function As(t){const e=w.c(46);let s,a,r,i,l,o;e[0]!==t?({side:i,variant:l,collapsible:o,className:a,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=o):(s=e[1],a=e[2],r=e[3],i=e[4],l=e[5],o=e[6]);const c=i===void 0?"left":i,d=l===void 0?"sidebar":l,m=o===void 0?"offcanvas":o,{isMobile:u,state:h,openMobile:x,setOpenMobile:g}=Se();if(m==="none"){let C;e[7]!==a?(C=M("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),e[7]=a,e[8]=C):C=e[8];let $;return e[9]!==s||e[10]!==r||e[11]!==C?($=n.jsx("div",{"data-slot":"sidebar",className:C,...r,children:s}),e[9]=s,e[10]=r,e[11]=C,e[12]=$):$=e[12],$}if(u){let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C={"--sidebar-width":$s},e[13]=C):C=e[13];let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=n.jsxs(Yt,{className:"sr-only",children:[n.jsx(Jt,{children:"Sidebar"}),n.jsx(Xt,{children:"Displays the mobile sidebar."})]}),e[14]=$):$=e[14];let I;e[15]!==s?(I=n.jsx("div",{className:"flex h-full w-full flex-col",children:s}),e[15]=s,e[16]=I):I=e[16];let O;e[17]!==c||e[18]!==I?(O=n.jsxs(Qt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:C,side:c,children:[$,I]}),e[17]=c,e[18]=I,e[19]=O):O=e[19];let T;return e[20]!==x||e[21]!==r||e[22]!==g||e[23]!==O?(T=n.jsx(qt,{open:x,onOpenChange:g,...r,children:O}),e[20]=x,e[21]=r,e[22]=g,e[23]=O,e[24]=T):T=e[24],T}const p=h==="collapsed"?m:"",b=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let f;e[25]!==b?(f=M("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),e[25]=b,e[26]=f):f=e[26];let v;e[27]!==f?(v=n.jsx("div",{"data-slot":"sidebar-gap",className:f}),e[27]=f,e[28]=v):v=e[28];const N=c==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",_=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let S;e[29]!==a||e[30]!==N||e[31]!==_?(S=M("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",N,_,a),e[29]=a,e[30]=N,e[31]=_,e[32]=S):S=e[32];let k;e[33]!==s?(k=n.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s}),e[33]=s,e[34]=k):k=e[34];let y;e[35]!==r||e[36]!==S||e[37]!==k?(y=n.jsx("div",{"data-slot":"sidebar-container",className:S,...r,children:k}),e[35]=r,e[36]=S,e[37]=k,e[38]=y):y=e[38];let z;return e[39]!==c||e[40]!==h||e[41]!==y||e[42]!==p||e[43]!==v||e[44]!==d?(z=n.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":p,"data-variant":d,"data-side":c,"data-slot":"sidebar",children:[v,y]}),e[39]=c,e[40]=h,e[41]=y,e[42]=p,e[43]=v,e[44]=d,e[45]=z):z=e[45],z}function Ps(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("main",{"data-slot":"sidebar-inset",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function vt(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-2 p-2",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function Ds(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-2 px-2 items-start justify-start",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function Rs(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("h-4 m-0! w-full",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("div",{"data-sidebar":"separator",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function Hs(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function Us(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function Bs(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("w-full text-sm",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function ye(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex w-full min-w-0 flex-col gap-1",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function ee(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("group/menu-item relative",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}const Ws=Tt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ae(t){const e=w.c(28);let s,a,r,i,l,o,c;e[0]!==t?({asChild:r,isActive:i,variant:l,size:o,tooltip:c,className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=o,e[7]=c):(s=e[1],a=e[2],r=e[3],i=e[4],l=e[5],o=e[6],c=e[7]);const d=r===void 0?!1:r,m=i===void 0?!1:i,u=l===void 0?"default":l,h=o===void 0?"default":o,x=d?Ot:"button",{isMobile:g,state:p}=Se();let b;e[8]!==s||e[9]!==h||e[10]!==u?(b=M(Ws({variant:u,size:h}),s),e[8]=s,e[9]=h,e[10]=u,e[11]=b):b=e[11];let f;e[12]!==x||e[13]!==m||e[14]!==a||e[15]!==h||e[16]!==b?(f=n.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":m,className:b,...a}),e[12]=x,e[13]=m,e[14]=a,e[15]=h,e[16]=b,e[17]=f):f=e[17];const v=f;if(!c)return v;if(typeof c=="string"){let y;e[18]!==c?(y={children:c},e[18]=c,e[19]=y):y=e[19],c=y}let N;e[20]!==v?(N=n.jsx(be,{asChild:!0,children:v}),e[20]=v,e[21]=N):N=e[21];const _=p!=="collapsed"||g;let S;e[22]!==_||e[23]!==c?(S=n.jsx(ge,{side:"right",align:"center",hidden:_,...c}),e[22]=_,e[23]=c,e[24]=S):S=e[24];let k;return e[25]!==N||e[26]!==S?(k=n.jsxs(je,{children:[N,S]}),e[25]=N,e[26]=S,e[27]=k):k=e[27],k}function Nt(t){const e=w.c(11),{navigationItems:s,header:a,footer:r,additionalContent:i,variant:l,collapsible:o}=t,c=l===void 0?"sidebar":l,d=o===void 0?"icon":o;let m;e[0]!==s?(m=s.map(Fs),e[0]=s,e[1]=m):m=e[1];let u;e[2]!==i||e[3]!==m?(u=n.jsx(Hs,{className:"flex-1 overflow-x-hidden",children:n.jsx(Us,{className:"font-medium",children:n.jsx(Bs,{children:n.jsxs(ye,{className:"gap-0.5",children:[m,i]})})})}),e[2]=i,e[3]=m,e[4]=u):u=e[4];let h;return e[5]!==d||e[6]!==r||e[7]!==a||e[8]!==u||e[9]!==c?(h=n.jsxs(As,{variant:c,collapsible:d,children:[a,u,r]}),e[5]=d,e[6]=r,e[7]=a,e[8]=u,e[9]=c,e[10]=h):h=e[10],h}function Fs(t){return n.jsx(ee,{children:n.jsxs(Ae,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),n.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Nt.Skeleton=function(){return n.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,s)=>n.jsx("div",{className:"w-full h-8",children:n.jsx(Q,{className:"h-full bg-sidebar-accent rounded-md"})},s))})};function wt(t){const e=w.c(48),{open:s,onOpenChange:a,user:r,userImage:i}=t,[l,o]=Wt(),[c,d]=j.useState(!1);let m;e[0]!==r.id?(m=()=>{navigator.clipboard.writeText(r.id),d(!0),setTimeout(()=>d(!1),2e3)},e[0]=r.id,e[1]=m):m=e[1];const u=m;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(rs,{className:"text-base",children:"Profile Settings"}),e[2]=h):h=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsxs(is,{className:"px-6 pt-6 pb-4 border-b border-border shrink-0 relative",children:[h,n.jsxs(ls,{className:"absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(xe,{size:16}),n.jsx("span",{className:"sr-only",children:"Close"})]})]}),e[3]=x):x=e[3];const g=r.name||"U";let p;e[4]!==g||e[5]!==i?(p=n.jsx(J,{url:i,fallback:g,shape:"circle",size:"xl",className:"h-16 w-16"}),e[4]=g,e[5]=i,e[6]=p):p=e[6];const b=r.name||"User";let f;e[7]!==b?(f=n.jsx("span",{className:"text-base font-medium text-foreground",children:b}),e[7]=b,e[8]=f):f=e[8];let v;e[9]!==r.email?(v=n.jsx("span",{className:"text-sm text-muted-foreground",children:r.email}),e[9]=r.email,e[10]=v):v=e[10];let N;e[11]!==f||e[12]!==v?(N=n.jsxs("div",{className:"flex flex-col gap-1",children:[f,v]}),e[11]=f,e[12]=v,e[13]=N):N=e[13];let _;e[14]!==p||e[15]!==N?(_=n.jsxs("div",{className:"flex items-center gap-4",children:[p,N]}),e[14]=p,e[15]=N,e[16]=_):_=e[16];let S;e[17]!==l||e[18]!==o?(S=()=>o(!l),e[17]=l,e[18]=o,e[19]=S):S=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[n.jsxs(ds,{className:"text-sm font-medium text-foreground flex items-center gap-2 pointer-events-none",children:[n.jsx(fs,{size:16,className:"text-muted-foreground"}),"Developer Mode"]}),n.jsx("p",{className:"text-xs text-muted-foreground pointer-events-none",children:"Show technical details like JSON input/output for tool calls"})]}),e[20]=k):k=e[20];let y;e[21]!==l||e[22]!==o?(y=n.jsx("div",{onClick:Vs,children:n.jsx(ms,{checked:l,onCheckedChange:o})}),e[21]=l,e[22]=o,e[23]=y):y=e[23];let z;e[24]!==S||e[25]!==y?(z=n.jsxs("button",{type:"button",onClick:S,className:"flex items-center justify-between gap-4 p-4 rounded-lg border border-border hover:bg-accent/50 transition-colors text-left w-full cursor-pointer",children:[k,y]}),e[24]=S,e[25]=y,e[26]=z):z=e[26];let C;e[27]!==_||e[28]!==z?(C=n.jsxs("div",{className:"p-5 space-y-6 min-h-[225px]",children:[_,z]}),e[27]=_,e[28]=z,e[29]=C):C=e[29];let $;e[30]!==r.id?($=n.jsx("span",{className:"font-mono text-xs",children:r.id}),e[30]=r.id,e[31]=$):$=e[31];let I;e[32]!==c?(I=c?n.jsx(ve,{size:14,className:"text-green-600"}):n.jsx(Qe,{size:14,className:"opacity-0 group-hover:opacity-100 transition-opacity"}),e[32]=c,e[33]=I):I=e[33];let O;e[34]!==u||e[35]!==$||e[36]!==I?(O=n.jsx(be,{asChild:!0,children:n.jsxs("button",{type:"button",onClick:u,className:"group flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[$,I]})}),e[34]=u,e[35]=$,e[36]=I,e[37]=O):O=e[37];let T;e[38]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx(ge,{side:"top",children:n.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[38]=T):T=e[38];let E;e[39]!==O?(E=n.jsx("div",{className:"border-t border-border px-5 py-4 flex items-center shrink-0",children:n.jsx(Xe,{children:n.jsxs(je,{children:[O,T]})})}),e[39]=O,e[40]=E):E=e[40];let L;e[41]!==C||e[42]!==E?(L=n.jsxs(os,{className:"sm:max-w-lg sm:max-h-[85vh] p-0 flex flex-col",closeButtonClassName:"hidden",children:[x,n.jsxs("div",{className:"flex flex-col",children:[C,E]})]}),e[41]=C,e[42]=E,e[43]=L):L=e[43];let A;return e[44]!==a||e[45]!==s||e[46]!==L?(A=n.jsx(cs,{open:s,onOpenChange:a,children:L}),e[44]=a,e[45]=s,e[46]=L,e[47]=A):A=e[47],A}function Vs(t){return t.stopPropagation()}const Zs="w-full h-8 justify-start gap-2 px-2 text-sm font-[450] text-sidebar-foreground hover:text-sidebar-foreground hover:bg-sidebar-accent active:bg-sidebar-accent/75 [&>svg]:size-[18px] [&>svg]:text-muted-foreground hover:[&>svg]:text-sidebar-foreground";function oe(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M(Zs,s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx(D,{variant:"ghost",size:"sm",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function Ks(t){const e=w.c(38),{user:s,userImage:a,onSettingsOpenChange:r}=t,[i,l]=j.useState(!1);let o;e[0]!==s?(o=async()=>{if(!s)return;const O=`ID: ${s.id}
2
- Name: ${s.name||"N/A"}
3
- Email: ${s.email}`;try{await navigator.clipboard.writeText(O),G.success("User info copied to clipboard")}catch{G.error("Failed to copy user info to clipboard")}},e[0]=s,e[1]=o):o=e[1];const c=o,d=s.name||s.email||"U";let m;e[2]!==d||e[3]!==a?(m=n.jsx(J,{url:a,fallback:d,shape:"circle",size:"sm",className:"size-8 shrink-0"}),e[2]=d,e[3]=a,e[4]=m):m=e[4];const u=s.name||"User";let h;e[5]!==u?(h=n.jsx("span",{className:"text-sm text-sidebar-foreground truncate font-[450]",children:u}),e[5]=u,e[6]=h):h=e[6];let x;e[7]!==s.email?(x=n.jsx("span",{className:"text-xs text-muted-foreground truncate font-normal",children:s.email}),e[7]=s.email,e[8]=x):x=e[8];let g;e[9]!==h||e[10]!==x?(g=n.jsxs("div",{className:"flex flex-col min-w-0 text-left",children:[h,x]}),e[9]=h,e[10]=x,e[11]=g):g=e[11];let p;e[12]!==c||e[13]!==m||e[14]!==g?(p=n.jsxs(D,{variant:"ghost",onClick:c,className:"h-auto p-2 m-1 mb-0 justify-start gap-2 hover:bg-sidebar-accent hover:text-inherit active:bg-sidebar-accent/75",children:[m,g]}),e[12]=c,e[13]=m,e[14]=g,e[15]=p):p=e[15];let b;e[16]!==r?(b=()=>{r(!1),l(!0)},e[16]=r,e[17]=b):b=e[17];let f;e[18]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(xt,{size:18}),e[18]=f):f=e[18];let v;e[19]!==b?(v=n.jsxs(oe,{onClick:b,children:[f,"Profile"]}),e[19]=b,e[20]=v):v=e[20];let N;e[21]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsxs(oe,{children:[n.jsx(us,{size:18}),"Security & Access"]}),e[21]=N):N=e[21];let _;e[22]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsxs(oe,{children:[n.jsx(pt,{size:18}),"Preferences"]}),e[22]=_):_=e[22];let S;e[23]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(oe,{asChild:!0,children:n.jsxs("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",children:[n.jsx(rt,{size:18}),n.jsx("span",{className:"flex-1",children:"Terms & Conditions"}),n.jsx(ke,{size:14})]})}),e[23]=S):S=e[23];let k;e[24]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(oe,{asChild:!0,children:n.jsxs("a",{href:"https://github.com/decocms/mesh",target:"_blank",rel:"noopener noreferrer",children:[n.jsx(Fe,{className:"size-[18px]"}),n.jsx("span",{className:"flex-1",children:"decocms/mesh"}),n.jsx(ke,{size:14})]})}),e[24]=k):k=e[24];let y;e[25]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsxs(oe,{onClick:Gs,children:[n.jsx(ft,{size:18}),"Log out"]}),e[25]=y):y=e[25];let z;e[26]!==v?(z=n.jsxs("div",{className:"p-1 flex flex-col",children:[v,N,_,S,k,y]}),e[26]=v,e[27]=z):z=e[27];let C;e[28]!==z||e[29]!==p?(C=n.jsxs("div",{className:"flex flex-col gap-0.5 bg-sidebar min-w-[250px]",children:[p,z]}),e[28]=z,e[29]=p,e[30]=C):C=e[30];let $;e[31]!==i||e[32]!==s||e[33]!==a?($=s&&i&&s.email&&n.jsx(wt,{open:i,onOpenChange:l,user:{...s,name:s.name??void 0,email:s.email},userImage:a}),e[31]=i,e[32]=s,e[33]=a,e[34]=$):$=e[34];let I;return e[35]!==C||e[36]!==$?(I=n.jsxs(n.Fragment,{children:[C,$]}),e[35]=C,e[36]=$,e[37]=I):I=e[37],I}function Gs(){return W.signOut()}function qs(t){const e=w.c(22),{org:s,isActive:a,onClick:r,onSettings:i}=t,[l,o]=j.useState(!1),c=a||l,d=a&&"bg-accent hover:bg-accent";let m;e[0]!==d?(m=M("flex items-center gap-2 w-full justify-start font-normal h-10 px-2 rounded-lg cursor-pointer transition-colors hover:bg-accent/50",d),e[0]=d,e[1]=m):m=e[1];let u;e[2]!==r?(u=N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),r?.())},e[2]=r,e[3]=u):u=e[3];let h,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),x=()=>o(!1),e[4]=h,e[5]=x):(h=e[4],x=e[5]);const g=s.logo??void 0;let p;e[6]!==s.name||e[7]!==g?(p=n.jsx(J,{url:g,fallback:s.name,size:"sm",className:"size-6 shrink-0 rounded-md",objectFit:"cover"}),e[6]=s.name,e[7]=g,e[8]=p):p=e[8];let b;e[9]!==s.name?(b=n.jsx("span",{className:"flex-1 text-sm text-foreground truncate text-left min-w-0",children:s.name}),e[9]=s.name,e[10]=b):b=e[10];let f;e[11]!==i||e[12]!==s.name||e[13]!==c?(f=i&&c?n.jsx("button",{type:"button","aria-label":`${s.name} settings`,className:"size-5 shrink-0 flex items-center justify-center rounded-md transition-colors hover:bg-foreground/10",onClick:N=>{N.stopPropagation(),i()},children:n.jsx(ht,{size:16,className:"text-muted-foreground"})}):n.jsx("span",{className:"size-5 shrink-0","aria-hidden":"true"}),e[11]=i,e[12]=s.name,e[13]=c,e[14]=f):f=e[14];let v;return e[15]!==r||e[16]!==m||e[17]!==u||e[18]!==p||e[19]!==b||e[20]!==f?(v=n.jsxs("div",{role:"button",tabIndex:0,className:m,onClick:r,onKeyDown:u,onMouseEnter:h,onMouseLeave:x,children:[p,b,f]}),e[15]=r,e[16]=m,e[17]=u,e[18]=p,e[19]=b,e[20]=f,e[21]=v):v=e[21],v}function Ys(t){const e=w.c(33),{currentOrgSlug:s,onOrgSelect:a,onOrgSettings:r,onPopoverClose:i}=t,{data:l}=W.useListOrganizations(),[o,c]=j.useState(!1);let d,m,u,h;if(e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==i||e[4]!==l){let f;e[9]!==s?(f=(y,z)=>y.slug===s?-1:z.slug===s?1:y.name.localeCompare(z.name),e[9]=s,e[10]=f):f=e[10];const v=[...l??[]].sort(f);u="flex flex-col min-w-[275px] border-l border-border";let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:"Your Organizations"}),e[11]=N):N=e[11];let _;e[12]!==i?(_=()=>{i(),c(!0)},e[12]=i,e[13]=_):_=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(qe,{size:16,className:"text-muted-foreground"}),e[14]=S):S=e[14],e[15]!==_?(h=n.jsxs("div",{className:"flex items-center justify-between h-10 px-3 border-b border-border",children:[N,n.jsx(D,{variant:"ghost",size:"icon",className:"size-5",onClick:_,children:S})]}),e[15]=_,e[16]=h):h=e[16],d="flex flex-col gap-0.5 p-1 flex-1 overflow-y-auto";let k;e[17]!==s||e[18]!==a||e[19]!==r?(k=y=>n.jsx(qs,{org:y,isActive:y.slug===s,onClick:()=>a(y.slug),onSettings:()=>r(y.slug)},y.slug),e[17]=s,e[18]=a,e[19]=r,e[20]=k):k=e[20],m=v.map(k),e[0]=s,e[1]=a,e[2]=r,e[3]=i,e[4]=l,e[5]=d,e[6]=m,e[7]=u,e[8]=h}else d=e[5],m=e[6],u=e[7],h=e[8];let x;e[21]!==d||e[22]!==m?(x=n.jsx("div",{className:d,children:m}),e[21]=d,e[22]=m,e[23]=x):x=e[23];let g;e[24]!==u||e[25]!==h||e[26]!==x?(g=n.jsxs("div",{className:u,children:[h,x]}),e[24]=u,e[25]=h,e[26]=x,e[27]=g):g=e[27];let p;e[28]!==o?(p=n.jsx(et,{open:o,onOpenChange:c}),e[28]=o,e[29]=p):p=e[29];let b;return e[30]!==g||e[31]!==p?(b=n.jsxs(n.Fragment,{children:[g,p]}),e[30]=g,e[31]=p,e[32]=b):b=e[32],b}function St(t){const e=w.c(36),{isCollapsed:s}=t,a=s===void 0?!1:s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const{org:i}=Ie(r),{data:l}=W.useListOrganizations(),{data:o}=W.useSession(),c=de();let d;e[1]!==i||e[2]!==l?(d=l?.find(A=>A.slug===i),e[1]=i,e[2]=l,e[3]=d):d=e[3];const m=d,[u,h]=j.useState(!1),x=o?.user,g=x?.image;let p;e[4]!==c?(p=A=>{h(!1),c({to:"/$org/settings",params:{org:A}})},e[4]=c,e[5]=p):p=e[5];const b=p;let f;e[6]!==c?(f=A=>{h(!1),c({to:"/$org",params:{org:A}})},e[6]=c,e[7]=f):f=e[7];const v=f,N=a?"justify-center":"justify-start",_=a?"":"pl-0.5! px-1.5 gap-1.5";let S;e[8]!==N||e[9]!==_?(S=M("h-7 min-w-0 max-w-full hover:bg-sidebar-accent",N,_),e[8]=N,e[9]=_,e[10]=S):S=e[10];const k=m?.logo??"",y=m?.name??"";let z;e[11]!==y||e[12]!==k?(z=n.jsx(J,{url:k,fallback:y,size:"xs",className:"shrink-0 rounded-[5px]",objectFit:"cover"}),e[11]=y,e[12]=k,e[13]=z):z=e[13];let C;e[14]!==m?.name||e[15]!==a?(C=!a&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate text-[14px] tracking-[-0.00625rem] font-medium text-foreground text-left",children:m?.name??"Select org"}),n.jsx(as,{className:"size-3.5 text-muted-foreground shrink-0"})]}),e[14]=m?.name,e[15]=a,e[16]=C):C=e[16];let $;e[17]!==z||e[18]!==C||e[19]!==S?($=n.jsx(Te,{asChild:!0,children:n.jsxs(D,{variant:"ghost",size:"sm",className:S,children:[z,C]})}),e[17]=z,e[18]=C,e[19]=S,e[20]=$):$=e[20];let I;e[21]!==x||e[22]!==g?(I=x&&n.jsx(Ks,{user:x,userImage:g,onSettingsOpenChange:()=>h(!1)}),e[21]=x,e[22]=g,e[23]=I):I=e[23];let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=()=>h(!1),e[24]=O):O=e[24];let T;e[25]!==b||e[26]!==v||e[27]!==i?(T=n.jsx(Ys,{currentOrgSlug:i,onOrgSelect:v,onOrgSettings:b,onPopoverClose:O}),e[25]=b,e[26]=v,e[27]=i,e[28]=T):T=e[28];let E;e[29]!==I||e[30]!==T?(E=n.jsxs(Me,{align:"start",side:"bottom",className:"p-0 flex w-auto h-88 overflow-hidden",children:[I,T]}),e[29]=I,e[30]=T,e[31]=E):E=e[31];let L;return e[32]!==u||e[33]!==$||e[34]!==E?(L=n.jsx(n.Fragment,{children:n.jsxs(Ee,{open:u,onOpenChange:h,children:[$,E]})}),e[32]=u,e[33]=$,e[34]=E,e[35]=L):L=e[35],L}St.Skeleton=function(){return n.jsxs("div",{className:"flex items-center gap-1.5 h-7 px-1.5 w-full",children:[n.jsx(Q,{className:"size-5 rounded-[5px] shrink-0"}),n.jsx(Q,{className:"h-3.5 flex-1"})]})};function _e(){const t=w.c(45),{state:e,toggleSidebar:s}=Se(),a=e==="collapsed",[r,i]=we();let l;t[0]!==i?(l=()=>{i(Js)},t[0]=i,t[1]=l):l=t[1];const o=l,c=a&&"group-hover/account-switcher:opacity-0 group-hover/account-switcher:pointer-events-none transition-opacity";let d;t[2]!==c?(d=M("w-full min-w-0",c),t[2]=c,t[3]=d):d=t[3];let m;t[4]!==a?(m=n.jsx(St,{isCollapsed:a}),t[4]=a,t[5]=m):m=t[5];let u;t[6]!==d||t[7]!==m?(u=n.jsx("div",{className:d,children:m}),t[6]=d,t[7]=m,t[8]=u):u=t[8];const h=a?"opacity-0 group-hover/account-switcher:opacity-100 pointer-events-none group-hover/account-switcher:pointer-events-auto":"opacity-0 pointer-events-none";let x;t[9]!==h?(x=M("absolute inset-0 m-auto size-7 hover:bg-sidebar-accent transition-opacity",h),t[9]=h,t[10]=x):x=t[10];const g=!a;let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(ot,{className:"size-4 text-muted-foreground shrink-0"}),t[11]=p):p=t[11];let b;t[12]!==x||t[13]!==g||t[14]!==s?(b=n.jsx(D,{variant:"ghost",size:"icon",className:x,onClick:s,"aria-label":"Expand sidebar",disabled:g,children:p}),t[12]=x,t[13]=g,t[14]=s,t[15]=b):b=t[15];let f;t[16]!==u||t[17]!==b?(f=n.jsxs("div",{className:"group/account-switcher relative flex items-center justify-center gap-1.5 min-w-0 flex-1 overflow-hidden",children:[u,b]}),t[16]=u,t[17]=b,t[18]=f):f=t[18];const v=a&&"hidden";let N;t[19]!==v?(N=M("flex items-center gap-0.5 shrink-0",v),t[19]=v,t[20]=N):N=t[20];let _;t[21]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(lt,{className:"size-4 text-muted-foreground"}),t[21]=_):_=t[21];let S;t[22]!==a||t[23]!==s?(S=n.jsx(be,{asChild:!0,children:n.jsx(D,{variant:"ghost",size:"icon",className:"size-7 hover:bg-sidebar-accent",onClick:s,"aria-label":"Collapse sidebar",disabled:a,children:_})}),t[22]=a,t[23]=s,t[24]=S):S=t[24];let k;t[25]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx(ge,{side:"bottom",children:"Collapse sidebar"}),t[25]=k):k=t[25];let y;t[26]!==S?(y=n.jsxs(je,{children:[S,k]}),t[26]=S,t[27]=y):y=t[27];const z=r&&"bg-sidebar-accent";let C;t[28]!==z?(C=M("size-7 hover:bg-sidebar-accent",z),t[28]=z,t[29]=C):C=t[29];let $;t[30]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Ge,{size:11,className:"text-muted-foreground"}),t[30]=$):$=t[30];let I;t[31]!==a||t[32]!==C||t[33]!==o?(I=n.jsx(be,{asChild:!0,children:n.jsx(D,{variant:"ghost",size:"icon",className:C,onClick:o,"aria-label":"Toggle Decopilot",disabled:a,children:$})}),t[31]=a,t[32]=C,t[33]=o,t[34]=I):I=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(ge,{side:"bottom",children:"Toggle Decopilot"}),t[35]=O):O=t[35];let T;t[36]!==I?(T=n.jsxs(je,{children:[I,O]}),t[36]=I,t[37]=T):T=t[37];let E;t[38]!==N||t[39]!==y||t[40]!==T?(E=n.jsxs("div",{className:N,children:[y,T]}),t[38]=N,t[39]=y,t[40]=T,t[41]=E):E=t[41];let L;return t[42]!==f||t[43]!==E?(L=n.jsx(vt,{className:"h-12 gap-0 pt-0",children:n.jsx(ye,{children:n.jsx(ee,{children:n.jsxs("div",{className:"flex items-center justify-between w-full h-12",children:[f,E]})})})}),t[42]=f,t[43]=E,t[44]=L):L=t[44],L}function Js(t){return!t}_e.Skeleton=function(){return n.jsx(vt,{className:"h-12 gap-0 pt-0",children:n.jsx(ye,{children:n.jsx(ee,{children:n.jsxs("div",{className:"flex items-center justify-between w-full h-12",children:[n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 flex-1 px-1.5",children:[n.jsx(Q,{className:"size-5 rounded-[5px] shrink-0"}),n.jsx(Q,{className:"h-3.5 w-16"})]}),n.jsxs("div",{className:"flex items-center gap-0.5",children:[n.jsx(Q,{className:"size-7 rounded-lg"}),n.jsx(Q,{className:"size-7 rounded-lg"})]})]})})})})};function Xs({invitation:t,onStatusChange:e}){const[s,a]=j.useState(!1),[r,i]=j.useState(!1),l=de(),o=async()=>{a(!0);try{const x=await W.organization.acceptInvitation({invitationId:t.id});if(x.error)G.error(x.error.message),a(!1);else{e(t.id,"accepted");const g=await W.organization.setActive({organizationId:t.organizationId});g?.data?.slug?(G.success("Invitation accepted!"),l({to:"/$org",params:{org:g.data.slug}})):(G.success("Invitation accepted! Redirecting..."),l({to:"/"}))}}catch{G.error("Failed to accept invitation"),a(!1)}},c=async()=>{i(!0);try{const x=await W.organization.rejectInvitation({invitationId:t.id});x.error?(G.error(x.error.message),i(!1)):(G.success("Invitation rejected"),e(t.id,"rejected"),i(!1))}catch{G.error("Failed to reject invitation"),i(!1)}},d=t.organizationName||t.organizationId,m=t.status==="pending",u=t.status==="accepted",h=t.status==="rejected";return n.jsxs("div",{className:M("flex items-center gap-3 px-3 py-2 h-12 border-b border-border/50 last:border-b-0",!m&&"opacity-50"),children:[n.jsx("div",{className:"shrink-0 size-5 flex items-center justify-center",children:n.jsx(ut,{size:16,className:"text-muted-foreground"})}),n.jsxs("p",{className:"flex-1 text-sm text-foreground min-w-0 whitespace-nowrap overflow-hidden",children:["You have been invited to ",n.jsx("span",{className:"font-semibold inline-block max-w-[200px] truncate align-bottom",children:d})]}),n.jsx("div",{className:"flex items-center gap-1 shrink-0",children:m?n.jsxs(n.Fragment,{children:[n.jsx(D,{variant:"ghost",size:"icon",onClick:c,disabled:s||r,className:"h-8 w-8",children:n.jsx(He,{size:14})}),n.jsx(D,{variant:"outline",size:"icon",onClick:o,disabled:s||r,className:"h-8 w-8",children:n.jsx(ve,{size:14})})]}):u?n.jsxs(Re,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(ve,{size:12}),"Accepted"]}):h?n.jsxs(Re,{variant:"outline",className:"h-6 px-2 text-xs",children:[n.jsx(He,{size:12}),"Declined"]}):null})]})}function Qs(){const[t,e]=j.useState(!1),s=j.useContext(Mt),{data:a}=s.hooks.useListUserInvitations(),{data:r}=W.useListOrganizations(),[i,l]=j.useState({}),m=(a??[]).filter(p=>new Date(p.expiresAt)>new Date).map(p=>{const b=(r??[]).find(f=>f.id===p.organizationId);return{...p,organizationSlug:b?.slug||p.organizationSlug,organizationName:b?.name||p.organizationName}}).map(p=>({...p,status:i[p.id]||p.status})),u=[...m].sort((p,b)=>{const f={pending:0,accepted:1,rejected:2};return(f[p.status]??999)-(f[b.status]??999)}),x=m.filter(p=>p.status==="pending").length>0,g=(p,b)=>{l(f=>({...f,[p]:b}))};return n.jsx(Ds,{className:"border-t border-border pt-2",children:n.jsx(ye,{children:n.jsx(ee,{children:n.jsxs(Ee,{open:t,onOpenChange:e,children:[n.jsx(Te,{asChild:!0,children:n.jsxs(Ae,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground relative",tooltip:"Inbox",children:[n.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:n.jsx(De,{})}),n.jsx("span",{className:"truncate",children:"Inbox"}),x&&n.jsx("span",{className:"absolute top-1 right-1 h-2 w-2 rounded-full bg-destructive"})]})}),n.jsxs(Me,{align:"end",className:"w-[480px] p-0 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-3 border-b border-border",children:n.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Inbox"})}),n.jsx("div",{className:"max-h-96 overflow-auto",children:u.length>0?u.map(p=>n.jsx(Xs,{invitation:p,onStatusChange:g},p.id)):n.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[n.jsx(De,{size:32,className:"text-muted-foreground/40 mb-2"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"No invitations at the moment"})]})})]})]})})})})}function yt(t){const e=w.c(4),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Rs,{className:"my-2 -ml-1"}),e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(ee,{children:n.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:n.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=r):r=e[1];let i;return e[2]!==s?(i=n.jsxs(n.Fragment,{children:[a,r,s]}),e[2]=s,e[3]=i):i=e[3],i}function en(t){const e=w.c(26),{item:s}=t,a=de(),{org:r}=Ne(),i=Oe(r.id),l=ns(r.id);let o;e[0]!==l.update||e[1]!==s.url||e[2]!==i?.sidebar_items?(o=async()=>{const _=(i?.sidebar_items||[]).filter(S=>S.url!==s.url);await l.update.mutateAsync({sidebar_items:_})},e[0]=l.update,e[1]=s.url,e[2]=i?.sidebar_items,e[3]=o):o=e[3];const c=o;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=/^https?:\/\/.+/,e[4]=d):d=e[4];let m;e[5]!==s.icon?(m=d.test(s.icon),e[5]=s.icon,e[6]=m):m=e[6];const u=m;let h;e[7]!==s.url||e[8]!==a?(h=()=>{a({to:s.url})},e[7]=s.url,e[8]=a,e[9]=h):h=e[9];const x=s.title;let g;e[10]!==u||e[11]!==s.icon||e[12]!==s.title?(g=n.jsx("div",{className:"flex items-center justify-center shrink-0",children:u?n.jsx("img",{src:s.icon,alt:s.title,className:"h-4 w-4 rounded object-cover"}):n.jsx(hs,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=u,e[11]=s.icon,e[12]=s.title,e[13]=g):g=e[13];let p;e[14]!==s.title?(p=s.title.toLocaleLowerCase(),e[14]=s.title,e[15]=p):p=e[15];let b;e[16]!==p?(b=n.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:n.jsx("span",{className:"truncate text-sm w-full capitalize",children:p})}),e[16]=p,e[17]=b):b=e[17];let f;e[18]!==c?(f=n.jsx(xe,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:N=>{N.preventDefault(),N.stopPropagation(),c()}}),e[18]=c,e[19]=f):f=e[19];let v;return e[20]!==s.title||e[21]!==h||e[22]!==g||e[23]!==b||e[24]!==f?(v=n.jsx(ee,{children:n.jsxs(Ae,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:h,tooltip:x,children:[g,b,f]})}),e[20]=s.title,e[21]=h,e[22]=g,e[23]=b,e[24]=f,e[25]=v):v=e[25],v}function We(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ee,{children:n.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:n.jsx(Q,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function tn(){const t=w.c(4),{org:e}=Ne(),a=Oe(e.id)?.sidebar_items;if(!a?.length)return null;let r;t[0]!==a?(r=a.map(sn),t[0]=a,t[1]=r):r=t[1];let i;return t[2]!==r?(i=n.jsx(yt,{children:r}),t[2]=r,t[3]=i):i=t[3],i}function sn(t){return n.jsx(en,{item:t},t.url)}function nn(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(j.Suspense,{fallback:n.jsxs(yt,{children:[n.jsx(We,{}),n.jsx(We,{})]}),children:n.jsx(tn,{})}),t[0]=e):e=t[0],e}function an(){const t=w.c(5),e=Cs();let s,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(j.Suspense,{fallback:n.jsx(_e.Skeleton,{}),children:n.jsx(_e,{})}),a=n.jsx(Qs,{}),t[0]=s,t[1]=a):(s=t[0],a=t[1]);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Je,{children:n.jsx(j.Suspense,{fallback:null,children:n.jsx(nn,{})})}),t[2]=r):r=t[2];let i;return t[3]!==e?(i=n.jsx(Nt,{navigationItems:e,header:s,footer:a,additionalContent:r}),t[3]=e,t[4]=i):i=t[4],i}function rn(t){const e=w.c(12);let s,a,r,i;e[0]!==t?({className:s,orientation:r,decorative:i,...a}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=i):(s=e[1],a=e[2],r=e[3],i=e[4]);const l=r===void 0?"horizontal":r,o=i===void 0?!0:i;let c;e[5]!==s?(c=M("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",s),e[5]=s,e[6]=c):c=e[6];let d;return e[7]!==o||e[8]!==l||e[9]!==a||e[10]!==c?(d=n.jsx(Et,{"data-slot":"separator-root",decorative:o,orientation:l,className:c,...a}),e[7]=o,e[8]=l,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}const Ct=j.createContext(null);function ln(){const t=j.useContext(Ct);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function on(t){const e=w.c(10),{children:s,onItemHover:a}=t,[r,i]=j.useState(null);let l;e[0]!==a?(l=u=>{i(u),a?.(u)},e[0]=a,e[1]=l):l=e[1];const o=l;let c;e[2]!==r||e[3]!==o?(c={hoveredItem:r,setHoveredItem:o},e[2]=r,e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s?(d=n.jsx(Ee,{children:s}),e[5]=s,e[6]=d):d=e[6];let m;return e[7]!==c||e[8]!==d?(m=n.jsx(Ct.Provider,{value:c,children:d}),e[7]=c,e[8]=d,e[9]=m):m=e[9],m}function cn(t){const e=w.c(6),{children:s,onClick:a}=t;let r;e[0]!==s||e[1]!==a?(r=n.jsx(D,{variant:"link",className:"p-0.5 h-auto",onClick:a,type:"button",children:s}),e[0]=s,e[1]=a,e[2]=r):r=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Te,{asChild:!0,children:n.jsx(D,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:n.jsx(ts,{size:16,className:"opacity-50"})})}),e[3]=i):i=e[3];let l;return e[4]!==r?(l=n.jsxs("div",{className:"flex items-center gap-1",children:[r,i]}),e[4]=r,e[5]=l):l=e[5],l}function dn(t){const e=w.c(8),{item:s,fallback:a}=t,r=a===void 0?"":a,i=s?.avatarUrl??"",l=s?.name??r;let o;e[0]!==i||e[1]!==l?(o=n.jsx(J,{url:i,fallback:l,size:"xs",objectFit:"contain"}),e[0]=i,e[1]=l,e[2]=o):o=e[2];const c=s?.name??r;let d;e[3]!==c?(d=n.jsx("span",{children:c}),e[3]=c,e[4]=d):d=e[4];let m;return e[5]!==o||e[6]!==d?(m=n.jsxs("div",{className:"flex items-center gap-2",children:[o,d]}),e[5]=o,e[6]=d,e[7]=m):m=e[7],m}function mn(t){const e=w.c(6),{children:s,align:a}=t,r=a===void 0?"start":a,l=j.Children.toArray(s).filter(fn).length===1?"280px":"480px";let o;e[0]!==l?(o={width:l},e[0]=l,e[1]=o):o=e[1];let c;return e[2]!==r||e[3]!==s||e[4]!==o?(c=n.jsx(Me,{align:r,className:"p-0 flex items-start",style:o,children:s}),e[2]=r,e[3]=s,e[4]=o,e[5]=c):c=e[5],c}function fn(t){return j.isValidElement(t)&&(t.type===_t||t.type===kt)}function kt(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",a),e[0]=a,e[1]=r):r=e[1];let i;return e[2]!==s||e[3]!==r?(i=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i}const _t=kt;function un(t){const e=w.c(6),{placeholder:s,value:a,onChange:r}=t,i=s===void 0?"Search...":s;let l;e[0]!==r?(l=c=>r(c.target.value),e[0]=r,e[1]=l):l=e[1];let o;return e[2]!==i||e[3]!==l||e[4]!==a?(o=n.jsx(ps,{placeholder:i,value:a,onChange:l,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=i,e[3]=l,e[4]=a,e[5]=o):o=e[5],o}function hn(t){const e=w.c(6),{children:s,emptyMessage:a}=t,r=a===void 0?"No items found.":a,i=j.Children.count(s)>0;let l;e[0]!==r||e[1]!==i?(l=!i&&n.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:r}),e[0]=r,e[1]=i,e[2]=l):l=e[2];let o;return e[3]!==s||e[4]!==l?(o=n.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[l,s]}),e[3]=s,e[4]=l,e[5]=o):o=e[5],o}function pn(t){const e=w.c(15),{item:s,onClick:a,onHover:r,children:i}=t,l=ln();let o;e[0]!==l||e[1]!==s||e[2]!==r?(o=()=>{l.setHoveredItem(s.slug),r?.(s)},e[0]=l,e[1]=s,e[2]=r,e[3]=o):o=e[3];const c=o;let d;e[4]!==s||e[5]!==a?(d=()=>a(s),e[4]=s,e[5]=a,e[6]=d):d=e[6];let m;e[7]!==i||e[8]!==s.avatarUrl||e[9]!==s.name?(m=i||n.jsxs(n.Fragment,{children:[n.jsx(J,{url:s.avatarUrl??"",fallback:s.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),n.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.name})]}),e[7]=i,e[8]=s.avatarUrl,e[9]=s.name,e[10]=m):m=e[10];let u;return e[11]!==c||e[12]!==d||e[13]!==m?(u=n.jsx(D,{onClick:d,onMouseEnter:c,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:m}),e[11]=c,e[12]=d,e[13]=m,e[14]=u):u=e[14],u}function xn(t){const e=w.c(2),{children:s}=t;let a;return e[0]!==s?(a=n.jsx("div",{className:"px-1 pb-1 pt-0.5",children:s}),e[0]=s,e[1]=a):a=e[1],a}function gn(t){const e=w.c(11),{onClick:s,icon:a,children:r,variant:i}=t,o=(i===void 0?"default":i)==="muted"&&"text-muted-foreground";let c;e[0]!==o?(c=M("w-full justify-start font-normal",o),e[0]=o,e[1]=c):c=e[1];let d;e[2]!==a?(d=a&&n.jsx("span",{className:"[&>svg]:size-4",children:a}),e[2]=a,e[3]=d):d=e[3];let m;e[4]!==r?(m=n.jsx("span",{children:r}),e[4]=r,e[5]=m):m=e[5];let u;return e[6]!==s||e[7]!==c||e[8]!==d||e[9]!==m?(u=n.jsxs(D,{variant:"ghost",size:"sm",className:c,onClick:s,children:[d,m]}),e[6]=s,e[7]=c,e[8]=d,e[9]=m,e[10]=u):u=e[10],u}function bn(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rn,{}),t[0]=e):e=t[0],e}function jn(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const H=Object.assign(on,{Trigger:cn,CurrentItem:dn,Content:mn,Panel:_t,Search:un,Items:hn,Item:pn,Actions:xn,Action:gn,Separator:bn,Skeleton:jn});function ze(){const t=w.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=Ie(e),{data:a}=W.useListOrganizations(),r=de();let i;t[1]!==s||t[2]!==a?(i=a?.find(E=>E.slug===s),t[1]=s,t[2]=a,t[3]=i):i=t[3];const l=i,[o,c]=j.useState(""),[d,m]=j.useState(!1);let u,h,x,g,p,b,f,v;if(t[4]!==l||t[5]!==r||t[6]!==s||t[7]!==o||t[8]!==a){const L=(a?(()=>{const B=a.filter(R=>R.name.toLowerCase().includes(o.toLowerCase()));if(s){const R=B.findIndex(q=>q.slug===s);if(R>0){const q=B[R];q&&(B.splice(R,1),B.unshift(q))}}return B})():[]).map(vn);let A;t[17]!==l?(A=l?{slug:l.slug,name:l.name,avatarUrl:l.logo}:void 0,t[17]=l,t[18]=A):A=t[18];const K=A;g=H;let U;t[19]!==r||t[20]!==s?(U=()=>r({to:"/$org",params:{org:s??""}}),t[19]=r,t[20]=s,t[21]=U):U=t[21];let F;t[22]!==K?(F=n.jsx(H.CurrentItem,{item:K}),t[22]=K,t[23]=F):F=t[23],t[24]!==U||t[25]!==F?(v=n.jsx(H.Trigger,{onClick:U,children:F}),t[24]=U,t[25]=F,t[26]=v):v=t[26],x=H.Content,h=H.Panel,t[27]!==o?(f=n.jsx(H.Search,{placeholder:"Search organizations...",value:o,onChange:c}),t[27]=o,t[28]=f):f=t[28],u=H.Items,p="No organizations found.";let V;t[29]!==r?(V=B=>n.jsx(H.Item,{item:B,onClick:R=>r({to:"/$org",params:{org:R.slug}})},B.slug),t[29]=r,t[30]=V):V=t[30],b=L.map(V),t[4]=l,t[5]=r,t[6]=s,t[7]=o,t[8]=a,t[9]=u,t[10]=h,t[11]=x,t[12]=g,t[13]=p,t[14]=b,t[15]=f,t[16]=v}else u=t[9],h=t[10],x=t[11],g=t[12],p=t[13],b=t[14],f=t[15],v=t[16];let N;t[31]!==u||t[32]!==p||t[33]!==b?(N=n.jsx(u,{emptyMessage:p,children:b}),t[31]=u,t[32]=p,t[33]=b,t[34]=N):N=t[34];let _,S;t[35]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(H.Actions,{children:n.jsx(H.Action,{onClick:()=>m(!0),variant:"muted",children:"+ Create organization"})}),S=n.jsx(H.Separator,{}),t[35]=_,t[36]=S):(_=t[35],S=t[36]);let k;t[37]!==r?(k=()=>r({to:"/"}),t[37]=r,t[38]=k):k=t[38];let y;t[39]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(xs,{}),t[39]=y):y=t[39];let z;t[40]!==k?(z=n.jsx(H.Actions,{children:n.jsx(H.Action,{onClick:k,icon:y,children:"See all organizations"})}),t[40]=k,t[41]=z):z=t[41];let C;t[42]!==h||t[43]!==z||t[44]!==f||t[45]!==N?(C=n.jsxs(h,{children:[f,N,_,S,z]}),t[42]=h,t[43]=z,t[44]=f,t[45]=N,t[46]=C):C=t[46];let $;t[47]!==x||t[48]!==C?($=n.jsx(x,{children:C}),t[47]=x,t[48]=C,t[49]=$):$=t[49];let I;t[50]!==g||t[51]!==$||t[52]!==v?(I=n.jsxs(g,{children:[v,$]}),t[50]=g,t[51]=$,t[52]=v,t[53]=I):I=t[53];let O;t[54]!==d?(O=n.jsx(et,{open:d,onOpenChange:m}),t[54]=d,t[55]=O):O=t[55];let T;return t[56]!==I||t[57]!==O?(T=n.jsxs(n.Fragment,{children:[I,O]}),t[56]=I,t[57]=O,t[58]=T):T=t[58],T}function vn(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}ze.Skeleton=H.Skeleton;function Nn({prop:t,defaultProp:e,onChange:s=()=>{}}){const[a,r]=wn({defaultProp:e,onChange:s}),i=t!==void 0,l=i?t:a,o=Ve(s),c=j.useCallback(d=>{if(i){const u=typeof d=="function"?d(t):d;u!==t&&o(u)}else r(d)},[i,t,r,o]);return[l,c]}function wn({defaultProp:t,onChange:e}){const s=j.useState(t),[a]=s,r=j.useRef(a),i=Ve(e);return j.useEffect(()=>{r.current!==a&&(i(a),r.current=a)},[a,r,i]),s}function Sn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ce.Root,{"data-slot":"drawer",...s}),e[2]=s,e[3]=a):a=e[3],a}function yn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ce.Trigger,{"data-slot":"drawer-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Cn(t){const e=w.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=n.jsx(ce.Portal,{"data-slot":"drawer-portal",...s}),e[2]=s,e[3]=a):a=e[3],a}function kn(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("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",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx(ce.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function _n(t){const e=w.c(12);let s,a,r;e[0]!==t?({className:a,children:s,...r}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r):(s=e[1],a=e[2],r=e[3]);let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(kn,{}),e[4]=i):i=e[4];let l;e[5]!==a?(l=M("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",a),e[5]=a,e[6]=l):l=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=n.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]=o):o=e[7];let c;return e[8]!==s||e[9]!==r||e[10]!==l?(c=n.jsxs(Cn,{"data-slot":"drawer-portal",children:[i,n.jsxs(ce.Content,{"data-slot":"drawer-content",className:l,...r,children:[o,s]})]}),e[8]=s,e[9]=r,e[10]=l,e[11]=c):c=e[11],c}function zn(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("flex flex-col gap-1.5 px-4 py-2",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}function $n(t){const e=w.c(8);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let r;e[3]!==s?(r=M("text-foreground font-semibold",s),e[3]=s,e[4]=r):r=e[4];let i;return e[5]!==a||e[6]!==r?(i=n.jsx(ce.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=i):i=e[7],i}const zt=j.createContext({setOpen:()=>{}}),In=()=>j.useContext(zt),On=t=>{const e=w.c(25);let s,a,r,i,l;e[0]!==t?({children:s,defaultOpen:a,open:i,onOpenChange:r,...l}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=i,e[5]=l):(s=e[1],a=e[2],r=e[3],i=e[4],l=e[5]);const o=a??!1;let c;e[6]!==r||e[7]!==i||e[8]!==o?(c={prop:i,defaultProp:o,onChange:r},e[6]=r,e[7]=i,e[8]=o,e[9]=c):c=e[9];const[d,m]=Nn(c);let u;e[10]!==m?(u={setOpen:m},e[10]=m,e[11]=u):u=e[11];let h;e[12]!==s||e[13]!==d||e[14]!==l||e[15]!==m?(h=n.jsx(Sn,{open:d,onOpenChange:m,...l,children:s}),e[12]=s,e[13]=d,e[14]=l,e[15]=m,e[16]=h):h=e[16];let x;e[17]!==d||e[18]!==l||e[19]!==m||e[20]!==h?(x=n.jsx(js,{open:d,onOpenChange:m,...l,children:h}),e[17]=d,e[18]=l,e[19]=m,e[20]=h,e[21]=x):x=e[21];let g;return e[22]!==u||e[23]!==x?(g=n.jsx(zt.Provider,{value:u,children:x}),e[22]=u,e[23]=x,e[24]=g):g=e[24],g},Tn=t=>{const{children:e,title:s,...a}=t,r=me(),{className:i,...l}=a;return r?n.jsxs(_n,{...l,children:[n.jsx(zn,{className:"hidden",children:n.jsx($n,{children:s})}),n.jsx("div",{className:M("flex flex-col gap-2 p-2 py-4",i),children:e})]}):n.jsx(bs,{...a,children:e})},Mn=t=>{const{children:e,...s}=t,{setOpen:a}=In(),r=me(),{className:i,...l}=s;return r?n.jsx("div",{...l,onClick:o=>{a(!1);const{onClick:c}=l;c?.(o)},className:M("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),children:e}):n.jsx(vs,{...s,children:e})},En=t=>{const e=w.c(7);let s,a;e[0]!==t?({children:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const r=me();let i;return e[3]!==s||e[4]!==r||e[5]!==a?(i=r?n.jsx(yn,{asChild:!0,children:s}):n.jsx(gs,{...a,children:s}),e[3]=s,e[4]=r,e[5]=a,e[6]=i):i=e[6],i},Ln=t=>{const e=w.c(7);let s,a;e[0]!==t?({className:s,...a}=t,e[0]=t,e[1]=s,e[2]=a):(s=e[1],a=e[2]);const r=me();let i;return e[3]!==s||e[4]!==r||e[5]!==a?(i=r?n.jsx(Ue,{className:M(s),...a}):n.jsx(Ue,{className:M(s),...a}),e[3]=s,e[4]=r,e[5]=a,e[6]=i):i=e[6],i};function An(t){const e=w.c(11),{user:s,trigger:a,align:r,children:i}=t,l=r===void 0?"start":r;let o;e[0]!==a||e[1]!==s?(o=a(s),e[0]=a,e[1]=s,e[2]=o):o=e[2];let c;e[3]!==o?(c=n.jsx(En,{asChild:!0,children:n.jsx("div",{children:o})}),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==l||e[6]!==i?(d=n.jsx(Tn,{side:"top",align:l,className:"md:w-[240px]",children:i}),e[5]=l,e[6]=i,e[7]=d):d=e[7];let m;return e[8]!==c||e[9]!==d?(m=n.jsxs(On,{children:[c,d]}),e[8]=c,e[9]=d,e[10]=m):m=e[10],m}function Pn(t){const e=w.c(8),{children:s,onClick:a,className:r,asChild:i}=t;let l;e[0]!==i||e[1]!==s||e[2]!==a?(l=i?s:n.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:a,children:s}),e[0]=i,e[1]=s,e[2]=a,e[3]=l):l=e[3];let o;return e[4]!==i||e[5]!==r||e[6]!==l?(o=n.jsx(Mn,{asChild:i,className:r,children:l}),e[4]=i,e[5]=r,e[6]=l,e[7]=o):o=e[7],o}function Dn(t){const e=w.c(2),{className:s}=t;let a;return e[0]!==s?(a=n.jsx(Ln,{className:s}),e[0]=s,e[1]=a):a=e[1],a}function Rn(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const Y=Object.assign(An,{Item:Pn,Separator:Dn,Skeleton:Rn});function Hn(t){const e=w.c(47),{user:s,userImage:a}=t,[r,i]=j.useState(!1),[l,o]=j.useState(!1);let c;e[0]!==s.email||e[1]!==s.id||e[2]!==s.name?(c=()=>{const A=`ID: ${s.id}
4
- Name: ${s.name||"N/A"}
5
- Email: ${s.email}`;navigator.clipboard.writeText(A),o(!0),G.success("User info copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[0]=s.email,e[1]=s.id,e[2]=s.name,e[3]=c):c=e[3];const d=c;let m;e[4]!==s.email||e[5]!==s.name||e[6]!==a?(m=()=>n.jsx(J,{url:a,fallback:s.name||s.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all h-7 w-7"}),e[4]=s.email,e[5]=s.name,e[6]=a,e[7]=m):m=e[7];const u=s.name||s.email||"U";let h;e[8]!==u||e[9]!==a?(h=n.jsx(J,{url:a,fallback:u,shape:"circle",size:"sm"}),e[8]=u,e[9]=a,e[10]=h):h=e[10];const x=s.name||"User";let g;e[11]!==x?(g=n.jsx("div",{className:"text-sm font-medium truncate",children:x}),e[11]=x,e[12]=g):g=e[12];let p;e[13]!==s.email?(p=n.jsx("div",{className:"text-xs text-muted-foreground truncate",children:s.email}),e[13]=s.email,e[14]=p):p=e[14];let b;e[15]!==g||e[16]!==p?(b=n.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[g,p]}),e[15]=g,e[16]=p,e[17]=b):b=e[17];let f;e[18]!==l?(f=n.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:l?n.jsx(ve,{size:16,className:"text-green-600"}):n.jsx(Qe,{size:16,className:"text-muted-foreground"})}),e[18]=l,e[19]=f):f=e[19];let v;e[20]!==h||e[21]!==b||e[22]!==f?(v=n.jsxs("div",{className:"group flex items-center gap-3 w-full py-1",children:[h,b,f]}),e[20]=h,e[21]=b,e[22]=f,e[23]=v):v=e[23];let N;e[24]!==d||e[25]!==v?(N=n.jsx(Y.Item,{onClick:d,children:v}),e[24]=d,e[25]=v,e[26]=N):N=e[26];let _;e[27]===Symbol.for("react.memo_cache_sentinel")?(_=n.jsx(Y.Separator,{}),e[27]=_):_=e[27];let S,k;e[28]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsxs(Y.Item,{onClick:()=>i(!0),children:[n.jsx(Le,{className:"text-muted-foreground",size:18}),"Profile Settings"]}),k=n.jsx(Y.Separator,{}),e[28]=S,e[29]=k):(S=e[28],k=e[29]);let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(Fe,{className:"w-4 h-4 text-muted-foreground"}),e[30]=y):y=e[30];let z;e[31]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(Y.Item,{asChild:!0,children:n.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[y,"decocms/admin",n.jsx(Be,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[31]=z):z=e[31];let C;e[32]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(ct,{className:"text-muted-foreground",size:18}),e[32]=C):C=e[32];let $,I;e[33]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(Y.Item,{asChild:!0,children:n.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[C,"Homepage",n.jsx(Be,{size:18,className:"ml-auto text-muted-foreground"})]})}),I=n.jsx(Y.Separator,{}),e[33]=$,e[34]=I):($=e[33],I=e[34]);let O;e[35]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsxs(Y.Item,{onClick:Un,children:[n.jsx(mt,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[35]=O):O=e[35];let T;e[36]!==N||e[37]!==m||e[38]!==s?(T=n.jsxs(Y,{user:s,trigger:m,align:"end",children:[N,_,S,k,z,$,I,O]}),e[36]=N,e[37]=m,e[38]=s,e[39]=T):T=e[39];let E;e[40]!==r||e[41]!==s||e[42]!==a?(E=r&&n.jsx(wt,{open:r,onOpenChange:i,user:s,userImage:a}),e[40]=r,e[41]=s,e[42]=a,e[43]=E):E=e[43];let L;return e[44]!==T||e[45]!==E?(L=n.jsxs(n.Fragment,{children:[T,E]}),e[44]=T,e[45]=E,e[46]=L):L=e[46],L}function Un(){return W.signOut()}function Bn(){const t=w.c(7),{data:e}=W.useSession();if(!e?.user){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(J,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer h-7 w-7",muted:!0}),t[0]=c):c=t[0],c}const s=e.user,a=s.name??void 0;let r;t[1]!==a||t[2]!==s?(r={...s,name:a},t[1]=a,t[2]=s,t[3]=r):r=t[3];const i=r,l=s.image;let o;return t[4]!==l||t[5]!==i?(o=n.jsx(Hn,{user:i,userImage:l}),t[4]=l,t[5]=i,t[6]=o):o=t[6],o}function Wn(){const t=w.c(2),s=$e().location.href;let a;return t[0]!==s?(a=n.jsx(Dt,{to:"/login",search:{next:s},replace:!0}),t[0]=s,t[1]=a):a=t[1],a}function Fn(t){const e=w.c(6),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Lt,{children:n.jsx(Ze,{})}),e[0]=a):a=e[0];let r;e[1]!==s?(r=n.jsx(At,{children:s}),e[1]=s,e[2]=r):r=e[2];let i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Pt,{children:n.jsx(Wn,{})}),e[3]=i):i=e[3];let l;return e[4]!==r?(l=n.jsxs(n.Fragment,{children:[a,r,i]}),e[4]=r,e[5]=l):l=e[5],l}function Vn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",a),e[0]=a,e[1]=r):r=e[1];let i;return e[2]!==s||e[3]!==r?(i=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i}function Zn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex items-center justify-center px-2.5 h-full border-r border-border",a),e[0]=a,e[1]=r):r=e[1];let i;return e[2]!==s||e[3]!==r?(i=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i}function Kn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex items-center gap-2 px-2 h-full",a),e[0]=a,e[1]=r):r=e[1];let i;return e[2]!==s||e[3]!==r?(i=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i}function Gn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex items-center gap-2 px-2 h-full flex-1",a),e[0]=a,e[1]=r):r=e[1];let i;return e[2]!==s||e[3]!==r?(i=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i}function qn(t){const e=w.c(5),{children:s,className:a}=t;let r;e[0]!==a?(r=M("flex items-center gap-2 px-2 h-full ml-auto",a),e[0]=a,e[1]=r):r=e[1];let i;return e[2]!==s||e[3]!==r?(i=n.jsx("div",{className:r,children:s}),e[2]=s,e[3]=r,e[4]=i):i=e[4],i}function Yn(){const t=w.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:n.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=s):s=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,s,n.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:n.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=a):a=t[2],a}const pe=Object.assign(Vn,{Sidebar:Zn,Left:Kn,Center:Gn,Right:qn,Skeleton:Yn});function $t(){const t=w.c(3),{toggleSidebar:e}=Se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(dt,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:18}),t[0]=s):s=t[0];let a;return t[1]!==e?(a=n.jsx(n.Fragment,{children:n.jsx(D,{onClick:e,size:"icon",variant:"ghost",className:"w-7 h-7 rounded-md",children:s})}),t[1]=e,t[2]=a):a=t[2],a}$t.Skeleton=function(){return n.jsx("div",{className:"w-7 h-7 bg-muted rounded-md animate-pulse"})};function Jn({showSidebarToggle:t=!1,showOrgSwitcher:e=!1,showDecoChat:s=!1,disableDecoChat:a=!1}){const[r,i]=we(),l=j.useRef(a);a&&r&&l.current!==a&&i(!1),l.current=a;const o=()=>{a||i(c=>!c)};return n.jsxs(pe,{children:[t&&n.jsx(pe.Sidebar,{children:n.jsx($t,{})}),n.jsx(pe.Left,{children:e&&n.jsx(j.Suspense,{fallback:n.jsx(ze.Skeleton,{}),children:n.jsx(ze,{})})}),n.jsxs(pe.Right,{className:"gap-2",children:[s&&!a&&n.jsxs(D,{size:"sm",variant:"default",onClick:o,className:"h-7 gap-2",children:[n.jsx(Ge,{size:16}),"Chat"]}),n.jsx(Bn,{})]})]})}function Xn(t){const e=w.c(10),{children:s,className:a}=t,[,r]=j.useTransition();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=st.decoChatPanelWidth(),e[0]=i):i=e[0];const[l,o]=tt(i,30);let c;e[1]!==o?(c=h=>r(()=>o(h)),e[1]=o,e[2]=c):c=e[2];const d=c;let m;e[3]!==a?(m=M("min-w-0",a),e[3]=a,e[4]=m):m=e[4];let u;return e[5]!==l||e[6]!==s||e[7]!==d||e[8]!==m?(u=n.jsx(nt,{defaultSize:l,minSize:20,className:m,onResize:d,children:s}),e[5]=l,e[6]=s,e[7]=d,e[8]=m,e[9]=u):u=e[9],u}function Qn(t){const e=w.c(5),{children:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=st.sidebarOpen(),e[0]=a):a=e[0];const[r,i]=tt(a,!0);let l;return e[1]!==s||e[2]!==i||e[3]!==r?(l=n.jsx(Ts,{open:r,onOpenChange:i,children:s}),e[1]=s,e[2]=i,e[3]=r,e[4]=l):l=e[4],l}function ea(t){const e=w.c(6),{disableChat:s}=t,a=s===void 0?!1:s,[r]=we();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(nt,{className:"bg-background",children:n.jsx(Ke,{})}),e[0]=i):i=e[0];let l;e[1]!==r||e[2]!==a?(l=!a&&n.jsxs(n.Fragment,{children:[n.jsx(Ns,{withHandle:r}),n.jsx(Xn,{className:M(r?"max-w-none":"max-w-0"),children:n.jsx(ys,{})})]}),e[1]=r,e[2]=a,e[3]=l):l=e[3];let o;return e[4]!==l?(o=n.jsxs(ws,{direction:"horizontal",children:[i,l]}),e[4]=l,e[5]=o):o=e[5],o}function ta(){const t=w.c(18);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:s}=Ie(e),a=$e(),r=a.location.pathname===`/${s}`||a.location.pathname===`/${s}/`;let i;t[1]!==s?(i=Ut.activeOrganization(s),t[1]=s,t[2]=i):i=t[2];let l;t[3]!==s?(l=async()=>{if(!s)return null;const{data:g}=await W.organization.setActive({organizationSlug:s});return{org:g,project:{slug:Bt}}},t[3]=s,t[4]=l):l=t[4];let o;t[5]!==i||t[6]!==l?(o={queryKey:i,queryFn:l,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=i,t[6]=l,t[7]=o):o=t[7];const{data:c}=Rt(o);if(!c){let g;t[8]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(Jn,{}),t[8]=g):g=t[8];let p;return t[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs("div",{className:"min-h-screen bg-background",children:[g,n.jsx("div",{className:"pt-12",children:n.jsx(Ke,{})})]}),t[9]=p):p=t[9],p}let d;t[10]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("style",{children:`
6
- [data-slot="sidebar-container"] {
7
- top: 0 !important;
8
- }
9
- [data-slot="sidebar-inner"] {
10
- padding-top: 0 !important;
11
- }
12
- `}),t[10]=d):d=t[10];let m;t[11]===Symbol.for("react.memo_cache_sentinel")?(m={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=m):m=t[11];let u;t[12]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(an,{}),t[12]=u):u=t[12];let h;t[13]!==r?(h=n.jsx(Qn,{children:n.jsxs("div",{className:"flex flex-col h-screen",children:[d,n.jsx(P.Provider,{children:n.jsxs(Ls,{className:"flex-1 bg-sidebar",style:m,children:[u,n.jsx(Ps,{children:n.jsx(ea,{disableChat:r})})]})})]})}),t[13]=r,t[14]=h):h=t[14];let x;return t[15]!==c||t[16]!==h?(x=n.jsx(Ht,{...c,children:h}),t[15]=c,t[16]=h,t[17]=x):x=t[17],x}function or(){const t=w.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Fn,{children:n.jsx(j.Suspense,{fallback:n.jsx(Ze,{}),children:n.jsx(ta,{})})}),t[0]=e):e=t[0],e}export{or as default};
@@ -1 +0,0 @@
1
- import{r as c,j as i,x as C,y,w as T,z as I,F as M,G as z,E as H,c as A}from"./index-504A5fzu.js";import{c as g}from"./button-D373Gh7m.js";var b="Switch",[U]=H(b),[q,F]=U(b),E=c.forwardRef((a,e)=>{const{__scopeSwitch:t,name:s,checked:r,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:w,form:l,...k}=a,[p,h]=c.useState(null),v=y(e,m=>h(m)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=T({prop:r,defaultProp:n??!1,onChange:w,caller:b});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...k,ref:v,onClick:I(a.onClick,m=>{N(B=>!B),S&&(x.current=m.isPropagationStopped(),x.current||m.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:s,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=b;var P="SwitchThumb",R=c.forwardRef((a,e)=>{const{__scopeSwitch:t,...s}=a,r=F(P,t);return i.jsx(C.span,{"data-state":j(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:e})});R.displayName=P;var L="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:a,control:e,checked:t,bubbles:s=!0,...r},n)=>{const o=c.useRef(null),d=y(o,n),u=M(t),w=z(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const k=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(k,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:s});h.call(l,t),l.dispatchEvent(v)}},[u,t,s]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:d,style:{...r.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=L;function j(a){return a?"checked":"unchecked"}var O=E,$=R;function W(a){const e=A.c(9);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let r;e[3]!==t?(r=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=r):r=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx($,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==s||e[7]!==r?(o=i.jsx(O,{"data-slot":"switch",className:r,...s,children:n}),e[6]=s,e[7]=r,e[8]=o):o=e[8],o}export{W as S};
@@ -1 +0,0 @@
1
- import{K as Q,j as t,c as U,l as W,r as k}from"./index-504A5fzu.js";import{u as Y}from"./useQuery-2fM2t_EQ.js";import{i as J}from"./File06-C2LBZfWa.js";import{i as P}from"./Loading01-k9J_51Wt.js";import{e as X}from"./github-icon-Dp3wHhYE.js";import{C as Z}from"./collection-display-button-DRWiQVZp.js";import{C as ee}from"./collection-search-B0S_3vCk.js";import{C as te}from"./collection-table-wrapper-BP07sMyA.js";import{E as F,I as se}from"./empty-state-DPLaHs22.js";import{C as oe}from"./card-IZISqBEf.js";import{V as re}from"./layout-Cd5mhjJp.js";function ne(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function ae(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,i)=>i.includes("target=")?e.replace(/target="[^"]*"/gi,'target="_blank"'):`<a ${i} target="_blank" rel="noopener noreferrer">`)}function ie(s){let e=ne(s);return e=ae(e),e}function Ce({repository:s}){const e=s?X(s):null,{data:i,isLoading:c}=Y({queryKey:Q.githubReadme(e?.owner,e?.repo),queryFn:async()=>{if(!e)return null;try{const l=await fetch(`https://api.github.com/repos/${e.owner}/${e.repo}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!l.ok){if(l.status===404)return null;throw new Error(`Failed to fetch README: ${l.statusText}`)}const m=await l.text();return ie(m)}catch(l){return console.error("Error fetching README:",l),null}},enabled:!!e&&!!s,staleTime:3600*1e3,gcTime:1440*60*1e3});return c?t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx(P,{size:32,className:"animate-spin text-muted-foreground"})}):i?t.jsx("div",{className:"p-5 markdown-body",style:{backgroundColor:"transparent"},dangerouslySetInnerHTML:{__html:i}}):t.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[t.jsx(J,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),t.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]})}function Se(s){const e=U.c(40),{tools:i,connectionId:c,org:l,onToolClick:m,showToolbar:M,emptyMessage:$,isLoading:A}=s,L=M===void 0?!0:M,j=$===void 0?"This connection doesn't have any tools yet.":$,D=A===void 0?!1:A,I=W(),[n,_]=k.useState(""),[d,q]=k.useState("table"),[r,V]=k.useState("name"),[a,K]=k.useState("asc");let y;e[0]!==a||e[1]!==r?(y=o=>{r===o?(K(ue),a==="desc"&&V(void 0)):(V(o),K("asc"))},e[0]=a,e[1]=r,e[2]=y):y=e[2];const u=y;let N;e[3]!==c||e[4]!==I||e[5]!==m||e[6]!==l?(N=o=>{m?m(o):c&&l&&I({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:c,collectionName:"tools",itemId:encodeURIComponent(o.name)}})},e[3]=c,e[4]=I,e[5]=m,e[6]=l,e[7]=N):N=e[7];const w=N;let v;if(e[8]!==n||e[9]!==a||e[10]!==r||e[11]!==i){const o=!i||i.length===0?[]:n.trim()?(()=>{const R=n.toLowerCase();return i.filter(b=>b.name.toLowerCase().includes(R)||b.description&&b.description.toLowerCase().includes(R))})():i;v=!r||!a?o:[...o].sort((R,b)=>{const B=R[r]||"",O=b[r]||"",H=String(B).localeCompare(String(O));return a==="asc"?H:-H}),e[8]=n,e[9]=a,e[10]=r,e[11]=i,e[12]=v}else v=e[12];const g=v;let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=[{id:"name",header:"Name",render:de,sortable:!0},{id:"description",header:"Description",render:me,cellClassName:"flex-1",sortable:!0}],e[13]=C):C=e[13];const z=C;let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=z.filter(ce).map(le),e[14]=S):S=e[14];const G=S;let f;e[15]!==u||e[16]!==L||e[17]!==a||e[18]!==r||e[19]!==d?(f=L&&t.jsx(re,{children:t.jsx(Z,{viewMode:d,onViewModeChange:q,sortKey:r,sortDirection:a,onSort:u,sortOptions:G})}),e[15]=u,e[16]=L,e[17]=a,e[18]=r,e[19]=d,e[20]=f):f=e[20];let E;e[21]===Symbol.for("react.memo_cache_sentinel")?(E=o=>{o.key==="Escape"&&(_(""),o.target.blur())},e[21]=E):E=e[21];let p;e[22]!==n?(p=t.jsx(ee,{value:n,onChange:_,placeholder:"Search tools...",onKeyDown:E}),e[22]=n,e[23]=p):p=e[23];let h;e[24]!==j||e[25]!==u||e[26]!==w||e[27]!==D||e[28]!==n||e[29]!==a||e[30]!==r||e[31]!==g||e[32]!==d?(h=d==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:g.length===0?t.jsx(F,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:g.map(o=>t.jsx(oe,{className:"cursor-pointer transition-colors",onClick:()=>w(o),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(se,{icon:null,name:o.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:o.description||"No description"})]})]})},o.name))})}):t.jsx(te,{columns:z,data:g,isLoading:D,sortKey:r,sortDirection:a,onSort:u,onRowClick:o=>w(o),emptyState:t.jsx(F,{image:null,title:n?"No tools found":"No tools available",description:n?"Try adjusting your search terms":j})}),e[24]=j,e[25]=u,e[26]=w,e[27]=D,e[28]=n,e[29]=a,e[30]=r,e[31]=g,e[32]=d,e[33]=h):h=e[33];let x;e[34]!==p||e[35]!==h?(x=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[p,h]}),e[34]=p,e[35]=h,e[36]=x):x=e[36];let T;return e[37]!==x||e[38]!==f?(T=t.jsxs(t.Fragment,{children:[f,x]}),e[37]=x,e[38]=f,e[39]=T):T=e[39],T}function le(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function ce(s){return s.sortable}function me(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function de(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ue(s){return s==="asc"?"desc":s==="desc"?null:"asc"}export{Ce as R,Se as T};
@@ -1 +0,0 @@
1
- import{r as a,j as c,x as M,aw as J,w as Q,av as Z,y as S,ax as ee,z as C,D as G,ay as te,az as $,aF as oe,aG as re,E as ne,aN as se,aH as ae,c as j}from"./index-504A5fzu.js";import{c as ie}from"./button-D373Gh7m.js";var le=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ce="VisuallyHidden",z=a.forwardRef((o,e)=>c.jsx(M.span,{...o,ref:e,style:{...le,...o.style}}));z.displayName=ce;var ue=z,[D]=ne("Tooltip",[$]),O=$(),F="TooltipProvider",de=700,L="tooltip.open",[pe,k]=D(F),V=o=>{const{__scopeTooltip:e,delayDuration:t=de,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=a.useRef(!0),d=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const p=i.current;return()=>window.clearTimeout(p)},[]),c.jsx(pe,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};V.displayName=F;var R="Tooltip",[fe,_]=D(R),Y=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,i=k(R,o.__scopeTooltip),p=O(e),[u,v]=a.useState(null),x=J(),f=a.useRef(0),h=l??i.disableHoverableContent,m=d??i.delayDuration,g=a.useRef(!1),[T,y]=Q({prop:r,defaultProp:n??!1,onChange:I=>{I?(i.onOpen(),document.dispatchEvent(new CustomEvent(L))):i.onClose(),s?.(I)},caller:R}),w=a.useMemo(()=>T?g.current?"delayed-open":"instant-open":"closed",[T]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,y(!0)},[y]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y(!1)},[y]),H=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,y(!0),f.current=0},m)},[m,y]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(Z,{...p,children:c.jsx(fe,{scope:e,contentId:x,open:T,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?H():E()},[i.isOpenDelayedRef,H,E]),onTriggerLeave:a.useCallback(()=>{h?P():(window.clearTimeout(f.current),f.current=0)},[P,h]),onOpen:E,onClose:P,disableHoverableContent:h,children:t})})};Y.displayName=R;var A="TooltipTrigger",B=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(A,t),s=k(A,t),l=O(t),d=a.useRef(null),i=S(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(ee,{asChild:!0,...l,children:c.jsx(M.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});B.displayName=A;var N="TooltipPortal",[ve,xe]=D(N,{forceMount:void 0}),U=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return c.jsx(ve,{scope:e,forceMount:t,children:c.jsx(G,{present:t||s.open,children:c.jsx(te,{asChild:!0,container:n,children:r})})})};U.displayName=N;var b="TooltipContent",q=a.forwardRef((o,e)=>{const t=xe(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return c.jsx(G,{present:r||l.open,children:l.disableHoverableContent?c.jsx(W,{side:n,...s,ref:e}):c.jsx(he,{side:n,...s,ref:e})})}),he=a.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=a.useRef(null),s=S(e,n),[l,d]=a.useState(null),{trigger:i,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((h,m)=>{const g=h.currentTarget,T={x:h.clientX,y:h.clientY},y=Te(T,g.getBoundingClientRect()),w=Ce(T,y),E=be(m.getBoundingClientRect()),P=Ee([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&u){const h=g=>f(g,u),m=g=>f(g,i);return i.addEventListener("pointerleave",h),u.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",m)}}},[i,u,f,x]),a.useEffect(()=>{if(l){const h=m=>{const g=m.target,T={x:m.clientX,y:m.clientY},y=i?.contains(g)||u?.contains(g),w=!we(T,l);y?x():w&&(x(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,u,l,p,x]),c.jsx(W,{...o,ref:s})}),[ge,me]=D(R,{isInside:!1}),ye=se("TooltipContent"),W=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,i=_(b,t),p=O(t),{onClose:u}=i;return a.useEffect(()=>(document.addEventListener(L,u),()=>document.removeEventListener(L,u)),[u]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,u]),c.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(re,{"data-state":i.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(ye,{children:r}),c.jsx(ge,{scope:t,isInside:!0,children:c.jsx(ue,{id:i.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=b;var X="TooltipArrow",K=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=O(t);return me(X,t).isInside?null:c.jsx(ae,{...n,...r,ref:e})});K.displayName=X;function Te(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ce(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function be(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function we(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],i=e[l],p=d.x,u=d.y,v=i.x,x=i.y;u>r!=x>r&&t<(v-p)*(r-u)/(x-u)+p&&(n=!n)}return n}function Ee(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Pe(e)}function Pe(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Re=V,_e=Y,je=B,De=U,Oe=q,Le=K;function Ae(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(Re,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function He(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Ae,{children:c.jsx(_e,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Ie(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(je,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Me(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==r?(d=ie("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Le,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==d?(p=c.jsx(De,{children:c.jsxs(Oe,{"data-slot":"tooltip-content",sideOffset:l,className:d,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=d,e[12]=p):p=e[12],p}export{Ie as T,le as V,Me as a,Ae as b,He as c};
@@ -1,16 +0,0 @@
1
- import{r as T,c as j,j as l,T as z,J as E,H,Q as L,X as V,U as D,M as I}from"./index-504A5fzu.js";import{I as M}from"./input-L4CnUGon.js";import{i as R}from"./X-BYmeb6sr.js";import{c as b}from"./button-D373Gh7m.js";import{i as A}from"./SearchMd-CvLjdKIL.js";const O=({size:n=24,color:e="currentColor",...t})=>T.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},T.createElement("path",{d:"m22.7 13.5-2-2-2 2M21 12a9 9 0 1 1-1.245-4.57M12 7v5l3 2"}));O.displayName="ClockRewind";const _=({size:n=24,color:e="currentColor",...t})=>T.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},T.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));_.displayName="MessageChatSquare";function Q(n){const e=j.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(H,{"data-slot":"sheet",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(n){const e=j.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=l.jsx(L,{"data-slot":"sheet-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(n){const e=j.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=b("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 o;return e[5]!==s||e[6]!==a?(o=l.jsx(D,{"data-slot":"sheet-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function q(n){const e=j.c(17);let t,s,a,o;e[0]!==n?({className:s,children:t,side:o,...a}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);const c=o===void 0?"right":o;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(P,{}),e[5]=h):h=e[5];const d=c==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",i=c==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r=c==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",v=c==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let m;e[6]!==s||e[7]!==d||e[8]!==i||e[9]!==r||e[10]!==v?(m=b("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",d,i,r,v,s),e[6]=s,e[7]=d,e[8]=i,e[9]=r,e[10]=v,e[11]=m):m=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsxs(V,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[l.jsx(R,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=u):u=e[12];let f;return e[13]!==t||e[14]!==a||e[15]!==m?(f=l.jsxs(W,{children:[h,l.jsxs(E,{"data-slot":"sheet-content",className:m,...a,children:[t,u]})]}),e[13]=t,e[14]=a,e[15]=m,e[16]=f):f=e[16],f}function F(n){const e=j.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=b("flex flex-col gap-1.5 p-4",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=l.jsx("div",{"data-slot":"sheet-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function J(n){const e=j.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=b("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=l.jsx(z,{"data-slot":"sheet-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function Y(n){const e=j.c(8);let t,s;e[0]!==n?({className:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=b("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=l.jsx(I,{"data-slot":"sheet-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(n){const e=j.c(24),{threads:t,activeThreadId:s,onThreadSelect:a,onClose:o,showHeader:c,showBackButton:h}=n,d=c===void 0?!0:c,i=h===void 0?!1:h,[r,v]=T.useState("");let m;e[0]!==r||e[1]!==t?(m=r.trim()?t.filter(p=>(p.title||"New chat").toLowerCase().includes(r.toLowerCase())):t,e[0]=r,e[1]=t,e[2]=m):m=e[2];const u=m;let f;e[3]!==o||e[4]!==a?(f=p=>{a(p),o&&o()},e[3]=o,e[4]=a,e[5]=f):f=e[5];const k=f;let y;e[6]!==o||e[7]!==i||e[8]!==d?(y=d&&l.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b shrink-0",children:[l.jsx("span",{className:"text-sm font-medium",children:"Chat History"}),i&&l.jsx("button",{type:"button",onClick:o,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Back to chat"})]}),e[6]=o,e[7]=i,e[8]=d,e[9]=y):y=e[9];let C;e[10]===Symbol.for("react.memo_cache_sentinel")?(C=b("px-3 py-3 border-b","shrink-0"),e[10]=C):C=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=l.jsx(A,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[11]=S):S=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=p=>v(p.target.value),e[12]=g):g=e[12];let x;e[13]!==r?(x=l.jsx("div",{className:C,children:l.jsxs("div",{className:"relative",children:[S,l.jsx(M,{type:"text",placeholder:"Search conversations...",value:r,onChange:g,className:"pl-9 h-9 text-sm"})]})}),e[13]=r,e[14]=x):x=e[14];let w;e[15]!==s||e[16]!==u||e[17]!==k||e[18]!==r?(w=l.jsx("div",{className:"flex-1 overflow-y-auto",children:u.length===0?l.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12 px-4 text-center",children:[l.jsx("div",{className:"size-12 rounded-full bg-muted/50 flex items-center justify-center",children:l.jsx(_,{size:24,className:"text-muted-foreground"})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:r?"No results found":"No conversations yet"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:r?"Try a different search term":"Start a new chat to see your history here"})]})]}):l.jsx("div",{className:"flex flex-col py-2",children:u.map(p=>{const $=p.id===s;return l.jsx("button",{type:"button",onClick:()=>k(p.id),className:b("flex items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-accent/50",$&&"bg-accent/50"),children:l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:b("text-sm truncate",$?"font-medium text-foreground":"text-muted-foreground"),children:p.title||"New chat"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:new Date(p.updatedAt).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})},p.id)})})}),e[15]=s,e[16]=u,e[17]=k,e[18]=r,e[19]=w):w=e[19];let N;return e[20]!==w||e[21]!==y||e[22]!==x?(N=l.jsxs(l.Fragment,{children:[y,x,w]}),e[20]=w,e[21]=y,e[22]=x,e[23]=N):N=e[23],N}function ee(n){const e=j.c(9),{open:t,onOpenChange:s,threads:a,activeThreadId:o,onThreadSelect:c}=n;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=l.jsx(F,{className:"h-12 px-4 flex flex-row items-center justify-between border-b shrink-0",children:l.jsx(J,{className:"text-sm font-medium",children:"Chat History"})}),e[0]=h):h=e[0];let d;e[1]!==o||e[2]!==c||e[3]!==a?(d=l.jsxs(q,{side:"right",className:"w-[320px] sm:w-[380px] p-0 flex flex-col",children:[h,l.jsx(B,{threads:a,activeThreadId:o,onThreadSelect:c,showHeader:!1})]}),e[1]=o,e[2]=c,e[3]=a,e[4]=d):d=e[4];let i;return e[5]!==s||e[6]!==t||e[7]!==d?(i=l.jsx(Q,{open:t,onOpenChange:s,children:d}),e[5]=s,e[6]=t,e[7]=d,e[8]=i):i=e[8],i}function te(n){const e=j.c(5),{threads:t,activeThreadId:s,onThreadSelect:a,onClose:o}=n;let c;return e[0]!==s||e[1]!==o||e[2]!==a||e[3]!==t?(c=l.jsx("div",{className:"flex flex-col h-full w-full bg-background",children:l.jsx(B,{threads:t,activeThreadId:s,onThreadSelect:a,onClose:o,showBackButton:!0})}),e[0]=s,e[1]=o,e[2]=a,e[3]=t,e[4]=c):c=e[4],c}function se(n){const e=j.c(22),{text:t,className:s,speed:a}=n,o=s===void 0?"":s,c=a===void 0?30:a,[h,d]=T.useState(!1),i=t.length/c*1e3,r=t.length,v=`${t.length}ch`;let m;e[0]!==i?(m=()=>{d(!1);const p=setTimeout(()=>{d(!0)},i);return()=>clearTimeout(p)},e[0]=i,e[1]=m):m=e[1];let u;e[2]!==i||e[3]!==t?(u=[t,i],e[2]=i,e[3]=t,e[4]=u):u=e[4],T.useEffect(m,u);let f;e[5]!==o?(f=b(o,"block overflow-hidden inline-flex"),e[5]=o,e[6]=f):f=e[6];const k=`${i}ms`;let y;e[7]!==v||e[8]!==r||e[9]!==k?(y={"--typewriter-duration":k,"--typewriter-steps":r,"--typewriter-max-width":v},e[7]=v,e[8]=r,e[9]=k,e[10]=y):y=e[10];const C=y,S=h&&"truncate";let g;e[11]!==S?(g=b("typewriter-text",S),e[11]=S,e[12]=g):g=e[12];let x;e[13]!==g||e[14]!==t?(x=l.jsx("span",{className:g,children:t}),e[13]=g,e[14]=t,e[15]=x):x=e[15];let w;e[16]===Symbol.for("react.memo_cache_sentinel")?(w=l.jsx("style",{children:`
2
- .typewriter-text {
3
- display: inline-block;
4
- width: 0;
5
- max-width: 100%;
6
- overflow: hidden;
7
- white-space: nowrap;
8
- animation: typewriter var(--typewriter-duration) steps(var(--typewriter-steps)) forwards;
9
- }
10
-
11
- @keyframes typewriter {
12
- to {
13
- width: min(var(--typewriter-max-width), 100%);
14
- }
15
- }
16
- `}),e[16]=w):w=e[16];let N;return e[17]!==x||e[18]!==f||e[19]!==C||e[20]!==t?(N=l.jsxs("span",{className:f,style:C,children:[x,w]},t),e[17]=x,e[18]=f,e[19]=C,e[20]=t,e[21]=N):N=e[21],N}export{Q as S,se as T,ee as a,te as b,F as c,J as d,Y as e,q as f,O as i,_ as t};