@decocms/mesh 2.76.0 → 2.77.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 (155) hide show
  1. package/dist/client/assets/{AlertCircle-TbirTaeA.js → AlertCircle-oGnqqT1Z.js} +1 -1
  2. package/dist/client/assets/{ArrowUp-DVhz9MPT.js → ArrowUp-DyvHGnwT.js} +1 -1
  3. package/dist/client/assets/{Calendar-BhleOqT-.js → Calendar-DH27yGmZ.js} +1 -1
  4. package/dist/client/assets/{Check-BIlnRzi6.js → Check-BlatIqwx.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-CSYoAEm3.js → CheckCircle-A7jAb6dO.js} +1 -1
  6. package/dist/client/assets/{CheckDone01-gZo2F6uL.js → CheckDone01-6mjKztKu.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-jAfIG9nZ.js → ChevronDown-CCp2JMaE.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CNYkXy1u.js → ChevronRight-BcCazbVH.js} +1 -1
  9. package/dist/client/assets/{Code01-DeVT5m93.js → Code01-D97OsfSf.js} +1 -1
  10. package/dist/client/assets/{Copy01-BJPi2nBZ.js → Copy01-DGJsTP15.js} +1 -1
  11. package/dist/client/assets/{DotsHorizontal-CZIcl0Ye.js → DotsHorizontal-C2NdUnkY.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CPJps54j.js → DotsVertical-BahQdspO.js} +1 -1
  13. package/dist/client/assets/{Download01-BVA62GFI.js → Download01-NaPFxXbm.js} +1 -1
  14. package/dist/client/assets/{Edit01-CLT1AKyh.js → Edit01-CSl-FU1V.js} +1 -1
  15. package/dist/client/assets/{File02-M7e4eeKQ.js → File02-DCmcNtYa.js} +1 -1
  16. package/dist/client/assets/{File06-BUOJeS0C.js → File06-BmPjFHnz.js} +1 -1
  17. package/dist/client/assets/{FilterLines-CDkZPaiO.js → FilterLines-Bbx0mrEz.js} +1 -1
  18. package/dist/client/assets/{Globe02-CNtZ4Mz7.js → Globe02-B4QQLqTF.js} +1 -1
  19. package/dist/client/assets/{Grid01-BhCIE3UE.js → Grid01-CXhtcjgR.js} +1 -1
  20. package/dist/client/assets/{Home02-Zp_wVezk.js → Home02-DTzcdbjE.js} +1 -1
  21. package/dist/client/assets/{Image01-Bmljn0R6.js → Image01-Cw_RHYUi.js} +1 -1
  22. package/dist/client/assets/{Inbox01-Bz-1SNbb.js → Inbox01-Cd7KCD-D.js} +1 -1
  23. package/dist/client/assets/{InfoCircle-DutDNmXq.js → InfoCircle-D87-HsMo.js} +1 -1
  24. package/dist/client/assets/{LinkExternal01-npl2D9IH.js → LinkExternal01-DAYrBD75.js} +1 -1
  25. package/dist/client/assets/{List-B95opsr5.js → List-BOdL1TDJ.js} +1 -1
  26. package/dist/client/assets/{Loading01-CudhqwtJ.js → Loading01-DcUBqOzt.js} +1 -1
  27. package/dist/client/assets/{Lock01-C3j5poil.js → Lock01-CJlTX6d9.js} +1 -1
  28. package/dist/client/assets/{Pin01-DpTwe7GO.js → Pin01-Cetrd1z7.js} +1 -1
  29. package/dist/client/assets/{Play-BxFFyAEF.js → Play-76i3R5Mg.js} +1 -1
  30. package/dist/client/assets/{Plus-BVPnBK8D.js → Plus-CBeTqgO0.js} +1 -1
  31. package/dist/client/assets/{RefreshCcw01-Dzlid7sh.js → RefreshCcw01-qWaidSs5.js} +1 -1
  32. package/dist/client/assets/{SearchMd-yRVgOeax.js → SearchMd-DlO0jVus.js} +1 -1
  33. package/dist/client/assets/{Settings01-DGIrqZBI.js → Settings01-Dyku2FbW.js} +1 -1
  34. package/dist/client/assets/{Settings02-CW4MK9LY.js → Settings02-CYlXe29M.js} +1 -1
  35. package/dist/client/assets/{Share07-BKNvns4q.js → Share07-5RJmIBaS.js} +1 -1
  36. package/dist/client/assets/{Terminal-DV_yPRWa.js → Terminal-CwhCdVNd.js} +1 -1
  37. package/dist/client/assets/{Tool01-C0EKLKq5.js → Tool01-SB9NL9XB.js} +1 -1
  38. package/dist/client/assets/{Trash01-py7ft8Od.js → Trash01-B5rQsNj_.js} +1 -1
  39. package/dist/client/assets/{Upload01-CCoXEdI4.js → Upload01-up-2G0Zk.js} +1 -1
  40. package/dist/client/assets/{Users03-D2F2bran.js → Users03-YVnet25Q.js} +1 -1
  41. package/dist/client/assets/{X-CixxHrye.js → X-CDixI9Fp.js} +1 -1
  42. package/dist/client/assets/{XClose-S1Me7eeg.js → XClose-9HhuzPl1.js} +1 -1
  43. package/dist/client/assets/{agent-connections-preview-DZgc-mir.js → agent-connections-preview-D_HsP759.js} +1 -1
  44. package/dist/client/assets/{agent-detail-DPLDxB9n.js → agent-detail-CNliY0im.js} +1 -1
  45. package/dist/client/assets/{agents-CynO2-IY.js → agents-DSOm54r8.js} +1 -1
  46. package/dist/client/assets/{alert-dialog-B1nWkQHx.js → alert-dialog-CezkcFZv.js} +1 -1
  47. package/dist/client/assets/{auth-catchall-CJ49F7Eq.js → auth-catchall-Ddtu2gr8.js} +1 -1
  48. package/dist/client/assets/{avatar-BbH9O0kN.js → avatar-a-IdsKtd.js} +1 -1
  49. package/dist/client/assets/{badge-C898LHvV.js → badge-DyTP00ui.js} +1 -1
  50. package/dist/client/assets/{binder-xcUkLvPC.js → binder-D3g26T9_.js} +1 -1
  51. package/dist/client/assets/{breadcrumb-t_Ccp20G.js → breadcrumb-CrQKEc0V.js} +1 -1
  52. package/dist/client/assets/{button-C1iesapY.js → button-IcLvDS7b.js} +1 -1
  53. package/dist/client/assets/{card-DKzkS6ji.js → card-DPhTtE1j.js} +1 -1
  54. package/dist/client/assets/{checkbox-B82l7mBw.js → checkbox-BMOSGAPg.js} +1 -1
  55. package/dist/client/assets/{circle-alert-_5s_KbQk.js → circle-alert-CUdPHotP.js} +1 -1
  56. package/dist/client/assets/collection-detail-CVwTrXbU.js +26 -0
  57. package/dist/client/assets/{collection-search-D3a5_1zR.js → collection-search-C9obF9Ju.js} +1 -1
  58. package/dist/client/assets/{collection-tab-Y58MHDMK.js → collection-tab-B0D5Ge1w.js} +1 -1
  59. package/dist/client/assets/{collection-table-wrapper-B6XWzQ-4.js → collection-table-wrapper-B0DqLvbL.js} +1 -1
  60. package/dist/client/assets/{collection-tabs-BPHWDFL4.js → collection-tabs-Bh3_w0C-.js} +1 -1
  61. package/dist/client/assets/{command-DepzRVHX.js → command-xbgaBPKx.js} +1 -1
  62. package/dist/client/assets/{connect-OP0J5SPJ.js → connect-B1f578pl.js} +1 -1
  63. package/dist/client/assets/{connection-card-DkCny6Ez.js → connection-card-DzzffrUK.js} +1 -1
  64. package/dist/client/assets/{connection-detail-CdLleACg.js → connection-detail-Dc9842ih.js} +1 -1
  65. package/dist/client/assets/{connections-BZUVvBGs.js → connections-DMThZLY2.js} +1 -1
  66. package/dist/client/assets/{constants-BEco_-y7.js → constants-Bb6jn5pm.js} +1 -1
  67. package/dist/client/assets/constants-D3p69qeS.js +1 -0
  68. package/dist/client/assets/{create-organization-dialog-58b_GUv7.js → create-organization-dialog-Cv4z3yf1.js} +1 -1
  69. package/dist/client/assets/{create-project-dialog-C5GAJOOY.js → create-project-dialog-B-TMsdZD.js} +1 -1
  70. package/dist/client/assets/{dialog-CpkgwzHW.js → dialog-BP68A3-r.js} +1 -1
  71. package/dist/client/assets/{dropdown-menu-D6YYwFq7.js → dropdown-menu-C0weu07S.js} +1 -1
  72. package/dist/client/assets/{dynamic-plugin-layout-BMgNBEQS.js → dynamic-plugin-layout-C3YR0WSk.js} +1 -1
  73. package/dist/client/assets/{empty-state-BQPtoYZe.js → empty-state-BY2kT0YF.js} +1 -1
  74. package/dist/client/assets/{empty-state-CH3e4Xzf.js → empty-state-CcIz0DtW.js} +1 -1
  75. package/dist/client/assets/{env-vars-editor-Vpi1vdW2.js → env-vars-editor-DJJKlTL9.js} +1 -1
  76. package/dist/client/assets/{error-boundary-BGFWaL1J.js → error-boundary-Dxa9vN4s.js} +1 -1
  77. package/dist/client/assets/{estree-CwOGYdhi.js → estree-BOE5AzoZ.js} +2 -2
  78. package/dist/client/assets/{extract-connection-data-CDmQ7rLP.js → extract-connection-data-qxA4zC_1.js} +1 -1
  79. package/dist/client/assets/{file-browser-DUDclrRh.js → file-browser-C4JlHX7p.js} +2 -2
  80. package/dist/client/assets/{form-NA0-x5iN.js → form-CPbw8FiC.js} +1 -1
  81. package/dist/client/assets/{grid-view-DbtTgaoS.js → grid-view-Pi_wFmga.js} +1 -1
  82. package/dist/client/assets/{home-DtmWz3MA.js → home-D9pqYJxL.js} +1 -1
  83. package/dist/client/assets/{index-DlY6KFzI.js → index-BE8lTkR-.js} +1 -1
  84. package/dist/client/assets/{index-GRocoNYa.js → index-BQaDRMwA.js} +1 -1
  85. package/dist/client/assets/{index-ByJoFAq_.js → index-Bofa5A4c.js} +1 -1
  86. package/dist/client/assets/{index-43_iGxlN.js → index-CIjJkh1w.js} +1 -1
  87. package/dist/client/assets/{index-wUnd_o-U.js → index-CV7G73w0.js} +1 -1
  88. package/dist/client/assets/{index-HxeE9C0A.js → index-ChHDKIbN.js} +6 -6
  89. package/dist/client/assets/{index-Kq8ytqk9.js → index-DIqndGeg.js} +1 -1
  90. package/dist/client/assets/{index-C9Dn0opW.js → index-DauKEk3R.js} +2 -2
  91. package/dist/client/assets/index-Dw0obvD7.js +25 -0
  92. package/dist/client/assets/{infiniteQueryObserver-CSOdbqFL.js → infiniteQueryObserver-BJxHLYt6.js} +1 -1
  93. package/dist/client/assets/{input-DBGu1Yhi.js → input-BiH6tKYM.js} +1 -1
  94. package/dist/client/assets/{integration-icon-CmJggqPx.js → integration-icon-D8EX8kVH.js} +1 -1
  95. package/dist/client/assets/{label-11d5Pe_w.js → label-CL-z0zvN.js} +1 -1
  96. package/dist/client/assets/{layout-BQSZy0Ao.js → layout-DS9ZU1FV.js} +1 -1
  97. package/dist/client/assets/{localstorage-keys-BxVB7BFB.js → localstorage-keys-CglJRhni.js} +1 -1
  98. package/dist/client/assets/{login-CMpn2tdR.js → login-CQ4DI182.js} +1 -1
  99. package/dist/client/assets/{mcp-oauth-JrpxCLx4.js → mcp-oauth-pNbworXN.js} +1 -1
  100. package/dist/client/assets/{mcp-server-card-8DET7nVd.js → mcp-server-card-CiBv2daD.js} +1 -1
  101. package/dist/client/assets/{mcp-server-detail-CMrzxsYv.js → mcp-server-detail-CWlOVXjE.js} +2 -2
  102. package/dist/client/assets/{members-CUWgr5ku.js → members-DP31FB6R.js} +1 -1
  103. package/dist/client/assets/{monaco-editor-DvJ6AQm-.js → monaco-editor-B3-QQ48f.js} +2 -2
  104. package/dist/client/assets/{monitoring-Db1K0NxK.js → monitoring-CEJjhEzo.js} +3 -3
  105. package/dist/client/assets/{oauth-callback-Bh-LWKIz.js → oauth-callback-DwNVkFW_.js} +1 -1
  106. package/dist/client/assets/{page-79TZOOqo.js → page-BYKRtBSp.js} +1 -1
  107. package/dist/client/assets/{page-Bx3m0Nlj.js → page-UBkAPmC5.js} +1 -1
  108. package/dist/client/assets/{plugin-empty-state-34Wj3C93.js → plugin-empty-state-BpFO_GZ3.js} +1 -1
  109. package/dist/client/assets/{plugin-header-KrvIXXbF.js → plugin-header-COGg6PEu.js} +1 -1
  110. package/dist/client/assets/{popover-BbAo_V3q.js → popover-JVz1MvYo.js} +1 -1
  111. package/dist/client/assets/{project-layout-QE2hcM6x.js → project-layout-D_GhuXhx.js} +1 -1
  112. package/dist/client/assets/{project-settings-2bxHgR8P.js → project-settings-YCZbbN-X.js} +1 -1
  113. package/dist/client/assets/{projects-list-CSrfAb2G.js → projects-list-DK4ua0bt.js} +1 -1
  114. package/dist/client/assets/{registry-utils-CLfG2KJO.js → registry-utils-BAvR5D-B.js} +1 -1
  115. package/dist/client/assets/{resizable-D5fgPQWp.js → resizable-Z1lo2KUF.js} +1 -1
  116. package/dist/client/assets/{select-CnIfeZ9k.js → select-DWWlFXcM.js} +1 -1
  117. package/dist/client/assets/{shell-layout-DIuzNmm5.js → shell-layout-j0caJ6cv.js} +1 -1
  118. package/dist/client/assets/{spinner-BbdUl9_5.js → spinner-DDglcYN3.js} +1 -1
  119. package/dist/client/assets/{store-invite-eQ6O_LcC.js → store-invite-DE3oTPEQ.js} +1 -1
  120. package/dist/client/assets/{switch-7wa9WQCt.js → switch-BU39MRXa.js} +1 -1
  121. package/dist/client/assets/{table-F_F9uG31.js → table-DkKXRH0o.js} +1 -1
  122. package/dist/client/assets/{tasks-Bo849zPQ.js → tasks-B5becd8b.js} +1 -1
  123. package/dist/client/assets/{textarea-CX1AXmSo.js → textarea-B0H-V_2P.js} +1 -1
  124. package/dist/client/assets/{tools-list-CeBZ5K9_.js → tools-list-BPmcCiBX.js} +1 -1
  125. package/dist/client/assets/{topbar-portal-DTnSGvrH.js → topbar-portal-COlO8Xo1.js} +1 -1
  126. package/dist/client/assets/{typewriter-title-CydscG0b.js → typewriter-title-Bwf3Eryu.js} +1 -1
  127. package/dist/client/assets/{use-binding-BIvDtNoa.js → use-binding-BF44Dr3v.js} +1 -1
  128. package/dist/client/assets/{use-connection-DWpxH8iy.js → use-connection-DMc1ed7A.js} +1 -1
  129. package/dist/client/assets/{use-create-virtual-mcp-CMegJpH_.js → use-create-virtual-mcp-DFreYzbI.js} +1 -1
  130. package/dist/client/assets/{use-deco-chat-open-DeBMXnMx.js → use-deco-chat-open-C_KGQyGq.js} +2 -2
  131. package/dist/client/assets/{use-install-from-registry-CNdLBCwL.js → use-install-from-registry--Nvk5mQH.js} +1 -1
  132. package/dist/client/assets/{use-list-state-CqdwrHCA.js → use-list-state-BHsqFECN.js} +1 -1
  133. package/dist/client/assets/{use-llm-B2BVGott.js → use-llm-B0wA4ukF.js} +1 -1
  134. package/dist/client/assets/{use-mcp-prompts-CUow6VVK.js → use-mcp-prompts-DnDIhnz1.js} +1 -1
  135. package/dist/client/assets/{use-mcp-tools-DO_-llbI.js → use-mcp-tools-D7_YQODs.js} +1 -1
  136. package/dist/client/assets/{use-mobile-CqANtQ4e.js → use-mobile-DKBgr338.js} +1 -1
  137. package/dist/client/assets/{use-organization-settings-ANLw4ex1.js → use-organization-settings-DhaOb6f0.js} +1 -1
  138. package/dist/client/assets/{use-project-C1G7xlcy.js → use-project-DuJfQ5Lc.js} +1 -1
  139. package/dist/client/assets/{use-virtual-mcp-DaI2d98r.js → use-virtual-mcp-Dx2SDNW7.js} +1 -1
  140. package/dist/client/assets/useInfiniteQuery-l-SVnEZQ.js +1 -0
  141. package/dist/client/assets/{useMutation-M3-wug2Q.js → useMutation-CR-ZbATX.js} +1 -1
  142. package/dist/client/assets/useQuery-t9jS7IDj.js +1 -0
  143. package/dist/client/assets/utils-B_eWxCLR.js +1 -0
  144. package/dist/client/assets/{view-mode-toggle-JVmuLwXe.js → view-mode-toggle-DL3lAsm5.js} +1 -1
  145. package/dist/client/assets/{workflow-BKKAfuJP.js → workflow-COg9B_We.js} +1 -1
  146. package/dist/client/index.html +1 -1
  147. package/dist/server/cli.js +154 -154
  148. package/dist/server/server.js +127 -127
  149. package/package.json +1 -1
  150. package/dist/client/assets/collection-detail-B-hnHfhu.js +0 -26
  151. package/dist/client/assets/constants-gwxE8_b0.js +0 -1
  152. package/dist/client/assets/index-Dv4saiJc.js +0 -25
  153. package/dist/client/assets/useInfiniteQuery-CL3o6Gdm.js +0 -1
  154. package/dist/client/assets/useQuery-jRtVXI31.js +0 -1
  155. package/dist/client/assets/utils-D1Qd9-I_.js +0 -1
@@ -1 +1 @@
1
- import"./constants-gwxE8_b0.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-CLfG2KJO.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
1
+ import"./constants-D3p69qeS.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-BAvR5D-B.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-DbtTgaoS.js","assets/index-HxeE9C0A.js","assets/index-BEdPWc-P.css","assets/topbar-portal-DTnSGvrH.js","assets/button-C1iesapY.js","assets/utils-D1Qd9-I_.js","assets/AlertCircle-TbirTaeA.js","assets/Download01-BVA62GFI.js","assets/File02-M7e4eeKQ.js","assets/File06-BUOJeS0C.js","assets/Image01-Bmljn0R6.js","assets/Loading01-CudhqwtJ.js","assets/Trash01-py7ft8Od.js","assets/Upload01-CCoXEdI4.js","assets/useMutation-M3-wug2Q.js","assets/useQuery-jRtVXI31.js","assets/useInfiniteQuery-CL3o6Gdm.js","assets/infiniteQueryObserver-CSOdbqFL.js","assets/checkbox-B82l7mBw.js","assets/Check-BIlnRzi6.js","assets/ChevronRight-CNYkXy1u.js","assets/Grid01-BhCIE3UE.js","assets/Home02-Zp_wVezk.js","assets/List-B95opsr5.js"])))=>i.map(i=>d[i]);
2
- import{r as M,c as K,bl as A,z as Y,j as t,t as D,bm as X,a4 as ee}from"./index-HxeE9C0A.js";import{u as Q}from"./topbar-portal-DTnSGvrH.js";import{u as te}from"./useInfiniteQuery-CL3o6Gdm.js";import{B as _}from"./button-C1iesapY.js";import{C as U}from"./checkbox-B82l7mBw.js";import{c as J}from"./utils-D1Qd9-I_.js";import{i as se}from"./AlertCircle-TbirTaeA.js";import{i as ae}from"./ChevronRight-CNYkXy1u.js";import{n as ie}from"./Download01-BVA62GFI.js";import{i as re}from"./File02-M7e4eeKQ.js";import{c as G}from"./Grid01-BhCIE3UE.js";import{a as oe}from"./Home02-Zp_wVezk.js";import{i as V}from"./List-B95opsr5.js";import{i as L}from"./Loading01-CudhqwtJ.js";import{s as W}from"./Trash01-py7ft8Od.js";import{i as $}from"./Upload01-CCoXEdI4.js";import{u as q}from"./useMutation-M3-wug2Q.js";const Z=({size:s=24,color:e="currentColor",...i})=>M.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},M.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,i=!1,o=100)=>["object-storage","objects",s,e,{flat:i,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},ne=100;function le(s){const e=K.c(30);let i;e[0]!==s?(i=s===void 0?{}:s,e[0]=s,e[1]=i):i=e[1];const o=i,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?ne:d,{connectionId:b,toolCaller:S}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async a=>{const{pageParam:r}=a;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:ge,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:z,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:w}=te(E);let v;if(l){let a;e[15]!==p?.pages?(a=p?.pages.flatMap(he).filter(pe).map(xe)??[],e[15]=p?.pages,e[16]=a):a=e[16],v=a}else{let a;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(ue)??[],j=p?.pages.flatMap(de)??[];a=[...r.sort(ce),...j],e[17]=p?.pages,e[18]=a}else a=e[18];v=a}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,F=y??!1,P=w;let k;return e[23]!==g||e[24]!==z||e[25]!==C||e[26]!==v||e[27]!==P||e[28]!==F?(k={objects:v,isLoading:z,isFetchingMore:g,hasMore:F,loadMore:C,error:P},e[23]=g,e[24]=z,e[25]=C,e[26]=v,e[27]=P,e[28]=F,e[29]=k):k=e[29],k}function ce(s,e){return s.key.localeCompare(e.key)}function de(s){return s.objects.filter(fe).map(me)}function me(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function fe(s){return!s.key.endsWith("/")}function ue(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function xe(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function pe(s){return!s.key.endsWith("/")}function he(s){return s.objects}function ge(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function je(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(s)/Math.log(i));return`${parseFloat((s/Math.pow(i,o)).toFixed(1))} ${e[o]}`}function ye(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ve(s){const e=[],i=s.split("/").filter(Boolean);let o="";for(const n of i)o+=n+"/",e.push({name:n,path:o});return e}function Ke(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const Ne=M.lazy(()=>X(()=>import("./grid-view-DbtTgaoS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])));function be(s){const e=K.c(50),{item:i,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==i.key||e[1]!==c?(b=c?i.key:I(i.key),e[0]=i.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(U,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==i.isFolder||e[7]!==i.key||e[8]!==d?(u=()=>i.isFolder?d(i.key):void 0,e[6]=i.isFolder,e[7]=i.key,e[8]=d,e[9]=u):u=e[9];const E=i.isFolder&&"cursor-pointer hover:text-primary";let p;e[10]!==E?(p=J("flex items-center gap-2 flex-1 min-w-0 text-left",E),e[10]=E,e[11]=p):p=e[11];let z;e[12]!==i.isFolder?(z=i.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(re,{size:18,className:"text-muted-foreground shrink-0"}),e[12]=i.isFolder,e[13]=z):z=e[13];let g;e[14]!==S?(g=t.jsx("span",{className:"truncate",children:S}),e[14]=S,e[15]=g):g=e[15];let y;e[16]!==u||e[17]!==p||e[18]!==z||e[19]!==g?(y=t.jsxs("button",{type:"button",onClick:u,className:p,children:[z,g]}),e[16]=u,e[17]=p,e[18]=z,e[19]=g,e[20]=y):y=e[20];let h;e[21]!==i.isFolder||e[22]!==i.size?(h=i.isFolder?"-":je(i.size),e[21]=i.isFolder,e[22]=i.size,e[23]=h):h=e[23];let w;e[24]!==h?(w=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:h}),e[24]=h,e[25]=w):w=e[25];let v;e[26]!==i.isFolder||e[27]!==i.lastModified?(v=i.isFolder?"-":ye(i.lastModified),e[26]=i.isFolder,e[27]=i.lastModified,e[28]=v):v=e[28];let N;e[29]!==v?(N=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:v}),e[29]=v,e[30]=N):N=e[30];let C;e[31]!==i.isFolder||e[32]!==i.key||e[33]!==m?(C=!i.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(i.key),children:t.jsx(ie,{size:14})}),e[31]=i.isFolder,e[32]=i.key,e[33]=m,e[34]=C):C=e[34];let F;e[35]!==i.key||e[36]!==l?(F=()=>l(i.key),e[35]=i.key,e[36]=l,e[37]=F):F=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[38]=P):P=e[38];let k;e[39]!==F?(k=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F,children:P}),e[39]=F,e[40]=k):k=e[40];let a;e[41]!==C||e[42]!==k?(a=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[C,k]}),e[41]=C,e[42]=k,e[43]=a):a=e[43];let r;return e[44]!==w||e[45]!==N||e[46]!==a||e[47]!==f||e[48]!==y?(r=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,y,w,N,a]}),e[44]=w,e[45]=N,e[46]=a,e[47]=f,e[48]=y,e[49]=r):r=e[49],r}function H(s){const e=K.c(8),{prefix:i,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==i){const x=ve(i);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(oe,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:J("hover:text-primary",b===x.length-1?"font-medium text-foreground":"text-muted-foreground"),children:c.name})]},c.path))]}),e[0]=o,e[1]=i,e[2]=n}else n=e[2];return n}function ke(){const{path:s="",flat:e=!1,view:i="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=a=>{x(new Set),o({to:"/",search:{path:a||void 0,flat:e,view:i}})},m=a=>{x(new Set),o({to:"/",search:{path:a?void 0:s||void 0,flat:a,view:i}})},l=a=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:a}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:z,loadMore:g,error:y}=le({prefix:s,flat:e}),h=q({mutationFn:async a=>{const r=s+a.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:a.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:a,headers:{"Content-Type":a.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:a=>{D.success(`Uploaded ${I(a)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Upload failed: ${a.message}`)}}),w=q({mutationFn:async a=>a.length===1&&a[0]?f("DELETE_OBJECT",{key:a[0]}):f("DELETE_OBJECTS",{keys:a}),onSuccess:()=>{D.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Delete failed: ${a.message}`)}}),v=async a=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:a}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),B=document.createElement("a");B.href=O,B.download=I(a),document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(O)}catch(r){D.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=a=>{const r=a.target.files;if(r){for(const j of Array.from(r))h.mutate(j);a.target.value=""}},C=(a,r)=>{const j=new Set(n);r?j.add(a):j.delete(a),x(j)},F=a=>{x(a?new Set(u.map(r=>r.key)):new Set)},P=()=>{n.size!==0&&w.mutate(Array.from(n))},k=a=>{if(!z||p)return;const r=a.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):i==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(M.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ne,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(_,{variant:"outline",size:"sm",className:"text-destructive",onClick:P,disabled:w.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(U,{checked:n.size>0&&n.size===u.length,onCheckedChange:F}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx(L,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(_,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx($,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(a=>t.jsx(be,{item:a,selected:n.has(a.key),showFullPath:e,onSelect:r=>C(a.key,r),onNavigate:d,onDownload:v,onDelete:r=>w.mutate([r])},a.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(L,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const Oe=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{R as K,Ke as a,Oe as b,je as f,I as g,Z as s,le as u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/grid-view-Pi_wFmga.js","assets/index-ChHDKIbN.js","assets/index-BEdPWc-P.css","assets/topbar-portal-COlO8Xo1.js","assets/button-IcLvDS7b.js","assets/utils-B_eWxCLR.js","assets/AlertCircle-oGnqqT1Z.js","assets/Download01-NaPFxXbm.js","assets/File02-DCmcNtYa.js","assets/File06-BmPjFHnz.js","assets/Image01-Cw_RHYUi.js","assets/Loading01-DcUBqOzt.js","assets/Trash01-B5rQsNj_.js","assets/Upload01-up-2G0Zk.js","assets/useMutation-CR-ZbATX.js","assets/useQuery-t9jS7IDj.js","assets/useInfiniteQuery-l-SVnEZQ.js","assets/infiniteQueryObserver-BJxHLYt6.js","assets/checkbox-BMOSGAPg.js","assets/Check-BlatIqwx.js","assets/ChevronRight-BcCazbVH.js","assets/Grid01-CXhtcjgR.js","assets/Home02-DTzcdbjE.js","assets/List-BOdL1TDJ.js"])))=>i.map(i=>d[i]);
2
+ import{r as M,c as K,bk as A,z as Y,j as t,t as D,bl as X,a4 as ee}from"./index-ChHDKIbN.js";import{u as Q}from"./topbar-portal-COlO8Xo1.js";import{u as te}from"./useInfiniteQuery-l-SVnEZQ.js";import{B as _}from"./button-IcLvDS7b.js";import{C as U}from"./checkbox-BMOSGAPg.js";import{c as J}from"./utils-B_eWxCLR.js";import{i as se}from"./AlertCircle-oGnqqT1Z.js";import{i as ae}from"./ChevronRight-BcCazbVH.js";import{n as ie}from"./Download01-NaPFxXbm.js";import{i as re}from"./File02-DCmcNtYa.js";import{c as G}from"./Grid01-CXhtcjgR.js";import{a as oe}from"./Home02-DTzcdbjE.js";import{i as V}from"./List-BOdL1TDJ.js";import{i as L}from"./Loading01-DcUBqOzt.js";import{s as W}from"./Trash01-B5rQsNj_.js";import{i as $}from"./Upload01-up-2G0Zk.js";import{u as q}from"./useMutation-CR-ZbATX.js";const Z=({size:s=24,color:e="currentColor",...i})=>M.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},M.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));Z.displayName="FolderPlus";const R={objects:(s,e,i=!1,o=100)=>["object-storage","objects",s,e,{flat:i,pageSize:o}],metadata:(s,e)=>["object-storage","metadata",s,e],imagePreview:(s,e)=>["object-storage","image-preview",s,e]},ne=100;function le(s){const e=K.c(30);let i;e[0]!==s?(i=s===void 0?{}:s,e[0]=s,e[1]=i):i=e[1];const o=i,{prefix:n,flat:x,pageSize:d}=o,m=n===void 0?"":n,l=x===void 0?!1:x,c=d===void 0?ne:d,{connectionId:b,toolCaller:S}=Q();let f;e[2]!==b||e[3]!==l||e[4]!==c||e[5]!==m?(f=R.objects(b,m,l,c),e[2]=b,e[3]=l,e[4]=c,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l||e[8]!==c||e[9]!==m||e[10]!==S?(u=async a=>{const{pageParam:r}=a;return await S("LIST_OBJECTS",{prefix:m||void 0,maxKeys:c,continuationToken:r,delimiter:l?void 0:"/"})},e[7]=l,e[8]=c,e[9]=m,e[10]=S,e[11]=u):u=e[11];let E;e[12]!==f||e[13]!==u?(E={queryKey:f,queryFn:u,initialPageParam:void 0,getNextPageParam:ge,staleTime:3e4},e[12]=f,e[13]=u,e[14]=E):E=e[14];const{data:p,isLoading:z,isFetchingNextPage:g,hasNextPage:y,fetchNextPage:h,error:w}=te(E);let v;if(l){let a;e[15]!==p?.pages?(a=p?.pages.flatMap(he).filter(pe).map(xe)??[],e[15]=p?.pages,e[16]=a):a=e[16],v=a}else{let a;if(e[17]!==p?.pages){const r=p?.pages[0]?.commonPrefixes?.map(ue)??[],j=p?.pages.flatMap(de)??[];a=[...r.sort(ce),...j],e[17]=p?.pages,e[18]=a}else a=e[18];v=a}let N;e[19]!==h||e[20]!==y||e[21]!==g?(N=()=>{y&&!g&&h()},e[19]=h,e[20]=y,e[21]=g,e[22]=N):N=e[22];const C=N,F=y??!1,P=w;let k;return e[23]!==g||e[24]!==z||e[25]!==C||e[26]!==v||e[27]!==P||e[28]!==F?(k={objects:v,isLoading:z,isFetchingMore:g,hasMore:F,loadMore:C,error:P},e[23]=g,e[24]=z,e[25]=C,e[26]=v,e[27]=P,e[28]=F,e[29]=k):k=e[29],k}function ce(s,e){return s.key.localeCompare(e.key)}function de(s){return s.objects.filter(fe).map(me)}function me(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function fe(s){return!s.key.endsWith("/")}function ue(s){return{key:s,size:0,lastModified:"",etag:"",isFolder:!0}}function xe(s){return{key:s.key,size:s.size,lastModified:s.lastModified,etag:s.etag,isFolder:!1}}function pe(s){return!s.key.endsWith("/")}function he(s){return s.objects}function ge(s){return s.nextContinuationToken}function I(s){const e=s.split("/").filter(Boolean);return e[e.length-1]||s}function je(s){if(s===0)return"0 B";const e=["B","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(s)/Math.log(i));return`${parseFloat((s/Math.pow(i,o)).toFixed(1))} ${e[o]}`}function ye(s){return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ve(s){const e=[],i=s.split("/").filter(Boolean);let o="";for(const n of i)o+=n+"/",e.push({name:n,path:o});return e}function Ke(s,e){switch(s.split(".").pop()?.toLowerCase()){case"jpg":case"jpeg":case"png":case"gif":case"webp":case"svg":return"Image01";case"mp4":case"mov":case"avi":case"webm":return"VideoRecorder";case"mp3":case"wav":case"ogg":return"Music01";case"pdf":return"File06";case"zip":case"tar":case"gz":case"rar":return"File07";case"js":case"ts":case"tsx":case"jsx":case"json":case"html":case"css":return"FileCode01";case"md":case"txt":return"File04";default:return"File02"}}const Ne=M.lazy(()=>X(()=>import("./grid-view-Pi_wFmga.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])));function be(s){const e=K.c(50),{item:i,selected:o,showFullPath:n,onSelect:x,onNavigate:d,onDownload:m,onDelete:l}=s,c=n===void 0?!1:n;let b;e[0]!==i.key||e[1]!==c?(b=c?i.key:I(i.key),e[0]=i.key,e[1]=c,e[2]=b):b=e[2];const S=b;let f;e[3]!==x||e[4]!==o?(f=t.jsx(U,{checked:o,onCheckedChange:x,className:"opacity-0 group-hover:opacity-100 focus:opacity-100 data-[state=checked]:opacity-100"}),e[3]=x,e[4]=o,e[5]=f):f=e[5];let u;e[6]!==i.isFolder||e[7]!==i.key||e[8]!==d?(u=()=>i.isFolder?d(i.key):void 0,e[6]=i.isFolder,e[7]=i.key,e[8]=d,e[9]=u):u=e[9];const E=i.isFolder&&"cursor-pointer hover:text-primary";let p;e[10]!==E?(p=J("flex items-center gap-2 flex-1 min-w-0 text-left",E),e[10]=E,e[11]=p):p=e[11];let z;e[12]!==i.isFolder?(z=i.isFolder?t.jsx(ee,{size:18,className:"text-amber-500 shrink-0"}):t.jsx(re,{size:18,className:"text-muted-foreground shrink-0"}),e[12]=i.isFolder,e[13]=z):z=e[13];let g;e[14]!==S?(g=t.jsx("span",{className:"truncate",children:S}),e[14]=S,e[15]=g):g=e[15];let y;e[16]!==u||e[17]!==p||e[18]!==z||e[19]!==g?(y=t.jsxs("button",{type:"button",onClick:u,className:p,children:[z,g]}),e[16]=u,e[17]=p,e[18]=z,e[19]=g,e[20]=y):y=e[20];let h;e[21]!==i.isFolder||e[22]!==i.size?(h=i.isFolder?"-":je(i.size),e[21]=i.isFolder,e[22]=i.size,e[23]=h):h=e[23];let w;e[24]!==h?(w=t.jsx("span",{className:"text-sm text-muted-foreground w-20 text-right shrink-0",children:h}),e[24]=h,e[25]=w):w=e[25];let v;e[26]!==i.isFolder||e[27]!==i.lastModified?(v=i.isFolder?"-":ye(i.lastModified),e[26]=i.isFolder,e[27]=i.lastModified,e[28]=v):v=e[28];let N;e[29]!==v?(N=t.jsx("span",{className:"text-sm text-muted-foreground w-28 text-right shrink-0",children:v}),e[29]=v,e[30]=N):N=e[30];let C;e[31]!==i.isFolder||e[32]!==i.key||e[33]!==m?(C=!i.isFolder&&t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0",onClick:()=>m(i.key),children:t.jsx(ie,{size:14})}),e[31]=i.isFolder,e[32]=i.key,e[33]=m,e[34]=C):C=e[34];let F;e[35]!==i.key||e[36]!==l?(F=()=>l(i.key),e[35]=i.key,e[36]=l,e[37]=F):F=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(W,{size:14}),e[38]=P):P=e[38];let k;e[39]!==F?(k=t.jsx(_,{variant:"ghost",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F,children:P}),e[39]=F,e[40]=k):k=e[40];let a;e[41]!==C||e[42]!==k?(a=t.jsxs("div",{className:"flex items-center gap-1 w-16 justify-end shrink-0 opacity-0 group-hover:opacity-100",children:[C,k]}),e[41]=C,e[42]=k,e[43]=a):a=e[43];let r;return e[44]!==w||e[45]!==N||e[46]!==a||e[47]!==f||e[48]!==y?(r=t.jsxs("div",{className:"group flex items-center gap-3 px-4 py-2 hover:bg-muted/50 border-b border-border last:border-b-0",children:[f,y,w,N,a]}),e[44]=w,e[45]=N,e[46]=a,e[47]=f,e[48]=y,e[49]=r):r=e[49],r}function H(s){const e=K.c(8),{prefix:i,onNavigate:o}=s;let n;if(e[0]!==o||e[1]!==i){const x=ve(i);let d;e[3]!==o?(d=()=>o(""),e[3]=o,e[4]=d):d=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(oe,{size:16}),e[5]=m):m=e[5];let l;e[6]!==d?(l=t.jsx("button",{type:"button",onClick:d,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:m}),e[6]=d,e[7]=l):l=e[7],n=t.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[l,x.map((c,b)=>t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ae,{size:14,className:"text-muted-foreground"}),t.jsx("button",{type:"button",onClick:()=>o(c.path),className:J("hover:text-primary",b===x.length-1?"font-medium text-foreground":"text-muted-foreground"),children:c.name})]},c.path))]}),e[0]=o,e[1]=i,e[2]=n}else n=e[2];return n}function ke(){const{path:s="",flat:e=!1,view:i="table"}=A.useSearch({from:"/"}),o=A.useNavigate(),[n,x]=M.useState(new Set),d=a=>{x(new Set),o({to:"/",search:{path:a||void 0,flat:e,view:i}})},m=a=>{x(new Set),o({to:"/",search:{path:a?void 0:s||void 0,flat:a,view:i}})},l=a=>{x(new Set),o({to:"/",search:{path:s||void 0,flat:e,view:a}})},c=M.useRef(null),b=Y(),{connectionId:S,toolCaller:f}=Q(),{objects:u,isLoading:E,isFetchingMore:p,hasMore:z,loadMore:g,error:y}=le({prefix:s,flat:e}),h=q({mutationFn:async a=>{const r=s+a.name,{url:j}=await f("PUT_PRESIGNED_URL",{key:r,contentType:a.type||"application/octet-stream"}),T=await fetch(j,{method:"PUT",body:a,headers:{"Content-Type":a.type||"application/octet-stream"}});if(!T.ok)throw new Error(`Upload failed: ${T.statusText}`);return r},onSuccess:a=>{D.success(`Uploaded ${I(a)}`),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Upload failed: ${a.message}`)}}),w=q({mutationFn:async a=>a.length===1&&a[0]?f("DELETE_OBJECT",{key:a[0]}):f("DELETE_OBJECTS",{keys:a}),onSuccess:()=>{D.success("Deleted successfully"),x(new Set),b.invalidateQueries({queryKey:R.objects(S,s)})},onError:a=>{D.error(`Delete failed: ${a.message}`)}}),v=async a=>{try{const{url:r}=await f("GET_PRESIGNED_URL",{key:a}),j=await fetch(r);if(!j.ok)throw new Error(`Failed to fetch file: ${j.statusText}`);const T=await j.blob(),O=URL.createObjectURL(T),B=document.createElement("a");B.href=O,B.download=I(a),document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(O)}catch(r){D.error(`Download failed: ${r instanceof Error?r.message:"Unknown error"}`)}},N=a=>{const r=a.target.files;if(r){for(const j of Array.from(r))h.mutate(j);a.target.value=""}},C=(a,r)=>{const j=new Set(n);r?j.add(a):j.delete(a),x(j)},F=a=>{x(a?new Set(u.map(r=>r.key)):new Set)},P=()=>{n.size!==0&&w.mutate(Array.from(n))},k=a=>{if(!z||p)return;const r=a.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<200&&g()};return y?t.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[t.jsx(se,{size:48,className:"text-destructive mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),t.jsx("p",{className:"text-muted-foreground text-center",children:y.message})]}):i==="grid"?t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]}),t.jsx(M.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(L,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ne,{prefix:s,flat:e,onNavigate:d})})]}):t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-background",children:[e?t.jsx("span",{className:"text-sm text-muted-foreground",children:"All files (flat)"}):t.jsx(H,{prefix:s,onNavigate:d}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[t.jsx(U,{checked:!e,onCheckedChange:a=>m(!a)}),t.jsx("span",{className:"text-muted-foreground",children:"Show as directories"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(_,{variant:i==="grid"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("grid"),children:t.jsx(G,{size:16})}),t.jsx(_,{variant:i==="table"?"secondary":"ghost",size:"sm",className:"size-8 p-0",onClick:()=>l("table"),children:t.jsx(V,{size:16})})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[n.size>0&&t.jsxs(_,{variant:"outline",size:"sm",className:"text-destructive",onClick:P,disabled:w.isPending,children:[t.jsx(W,{size:14,className:"mr-1"}),"Delete (",n.size,")"]}),t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:N}),t.jsxs(_,{variant:"outline",size:"sm",onClick:()=>c.current?.click(),disabled:h.isPending,children:[h.isPending?t.jsx(L,{size:14,className:"mr-1 animate-spin"}):t.jsx($,{size:14,className:"mr-1"}),"Upload"]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30 text-sm font-medium text-muted-foreground",children:[t.jsx(U,{checked:n.size>0&&n.size===u.length,onCheckedChange:F}),t.jsx("span",{className:"flex-1",children:"Name"}),t.jsx("span",{className:"w-20 text-right",children:"Size"}),t.jsx("span",{className:"w-28 text-right",children:"Modified"}),t.jsx("span",{className:"w-16"})]}),t.jsx("div",{className:"flex-1 overflow-y-auto",onScroll:k,children:E?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx(L,{size:32,className:"animate-spin text-muted-foreground mb-4"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):u.length===0?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[t.jsx(Z,{size:48,className:"text-muted-foreground mb-4"}),t.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),t.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),t.jsxs(_,{variant:"outline",onClick:()=>c.current?.click(),children:[t.jsx($,{size:14,className:"mr-1"}),"Upload files"]})]}):t.jsxs(t.Fragment,{children:[u.map(a=>t.jsx(be,{item:a,selected:n.has(a.key),showFullPath:e,onSelect:r=>C(a.key,r),onNavigate:d,onDownload:v,onDelete:r=>w.mutate([r])},a.key)),p&&t.jsx("div",{className:"flex justify-center py-4",children:t.jsx(L,{size:20,className:"animate-spin text-muted-foreground"})})]})})]})}const Oe=Object.freeze(Object.defineProperty({__proto__:null,default:ke},Symbol.toStringTag,{value:"Module"}));export{R as K,Ke as a,Oe as b,je as f,I as g,Z as s,le as u};
@@ -1 +1 @@
1
- import{F as C,c as f,j as c,n as j,r as d,q as v,v as b,w as h}from"./index-HxeE9C0A.js";import{L as N}from"./label-11d5Pe_w.js";import{c as p}from"./utils-D1Qd9-I_.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=b();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function L(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function P(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function y(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(v,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function R(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function q(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,L as b,P as c,y as d,R as e,q as f};
1
+ import{F as C,c as f,j as c,n as j,r as d,q as v,v as b,w as h}from"./index-ChHDKIbN.js";import{L as N}from"./label-CL-z0zvN.js";import{c as p}from"./utils-B_eWxCLR.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=b();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function L(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function P(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function y(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(v,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function R(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function q(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,L as b,P as c,y as d,R as e,q as f};
@@ -1 +1 @@
1
- import{r as v,c as M,j as s,z as q,t as w,a4 as H}from"./index-HxeE9C0A.js";import{u as D}from"./topbar-portal-DTnSGvrH.js";import{K as L,u as Z,g as R,s as Q,a as W,f as U}from"./file-browser-DUDclrRh.js";import{B as E}from"./button-C1iesapY.js";import{c as I}from"./utils-D1Qd9-I_.js";import{i as S}from"./AlertCircle-TbirTaeA.js";import{n as A}from"./Download01-BVA62GFI.js";import{i as $}from"./File02-M7e4eeKQ.js";import{i as J}from"./File06-BUOJeS0C.js";import{a as P}from"./Image01-Bmljn0R6.js";import{i as T}from"./Loading01-CudhqwtJ.js";import{s as V}from"./Trash01-py7ft8Od.js";import{i as Y}from"./Upload01-CCoXEdI4.js";import{u as _}from"./useMutation-M3-wug2Q.js";import{u as X}from"./useQuery-jRtVXI31.js";import"./useInfiniteQuery-CL3o6Gdm.js";import"./infiniteQueryObserver-CSOdbqFL.js";import"./checkbox-B82l7mBw.js";import"./Check-BIlnRzi6.js";import"./ChevronRight-CNYkXy1u.js";import"./Grid01-BhCIE3UE.js";import"./Home02-Zp_wVezk.js";import"./List-B95opsr5.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));K.displayName="FileCode01";const O=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));O.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),c=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{c.current&&(c.current.disconnect(),c.current=null),u&&!d.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!d.current&&(d.current=!0,g(!0),c.current?.disconnect(),c.current=null)},i),c.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:c}=i,d=c===void 0?"":c,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let a;e[1]!==n||e[2]!==t?(a=L.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==a||e[9]!==f?(k={queryKey:a,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=a,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=I("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:O,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:K,Folder:H};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:c,onDelete:d}=i;let n;e[0]!==t.key?(n=R(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!a&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=I("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==a||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:I(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=a,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==a||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=a,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==c?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),c(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=c,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function ze({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),c=q(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:a,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${R(r)}`),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=R(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&a()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{ze as default};
1
+ import{r as v,c as M,j as s,z as q,t as w,a4 as H}from"./index-ChHDKIbN.js";import{u as D}from"./topbar-portal-COlO8Xo1.js";import{K as L,u as Z,g as R,s as Q,a as W,f as U}from"./file-browser-C4JlHX7p.js";import{B as E}from"./button-IcLvDS7b.js";import{c as I}from"./utils-B_eWxCLR.js";import{i as S}from"./AlertCircle-oGnqqT1Z.js";import{n as A}from"./Download01-NaPFxXbm.js";import{i as $}from"./File02-DCmcNtYa.js";import{i as J}from"./File06-BmPjFHnz.js";import{a as P}from"./Image01-Cw_RHYUi.js";import{i as T}from"./Loading01-DcUBqOzt.js";import{s as V}from"./Trash01-B5rQsNj_.js";import{i as Y}from"./Upload01-up-2G0Zk.js";import{u as _}from"./useMutation-CR-ZbATX.js";import{u as X}from"./useQuery-t9jS7IDj.js";import"./useInfiniteQuery-l-SVnEZQ.js";import"./infiniteQueryObserver-BJxHLYt6.js";import"./checkbox-BMOSGAPg.js";import"./Check-BlatIqwx.js";import"./ChevronRight-BcCazbVH.js";import"./Grid01-CXhtcjgR.js";import"./Home02-DTzcdbjE.js";import"./List-BOdL1TDJ.js";const B=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 8 15.04 8 15.6 8h4.13M20 9.988V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));B.displayName="File04";const G=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M8 15v3m8-5v5m-4-7.5V18m8-8.012V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));G.displayName="File07";const K=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437c.214.11.494.11 1.054.11h4.13M14 17.5l2.5-2.5-2.5-2.5m-4 0L7.5 15l2.5 2.5m10-7.512V17.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C6.28 2 7.12 2 8.8 2h3.212c.733 0 1.1 0 1.446.083.306.073.598.195.867.36.303.185.562.444 1.08.963l3.19 3.188c.518.519.777.778.963 1.081a3 3 0 0 1 .36.867c.082.346.082.712.082 1.446Z"}));K.displayName="FileCode01";const O=({size:i=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M22 8.931c0-.605 0-.908-.12-1.049a.5.5 0 0 0-.42-.173c-.183.014-.397.228-.826.657L17 12l3.634 3.634c.429.429.643.643.827.657a.5.5 0 0 0 .42-.173c.119-.14.119-.444.119-1.05V8.932ZM2 9.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 5 5.12 5 6.8 5h5.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C17 7.28 17 8.12 17 9.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C14.72 19 13.88 19 12.2 19H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 16.72 2 15.88 2 14.2V9.8Z"}));O.displayName="VideoRecorder";function ee(i){const e=M.c(5),[t,g]=v.useState(!1),c=v.useRef(null),d=v.useRef(!1);let n;e[0]!==i?(n=u=>{c.current&&(c.current.disconnect(),c.current=null),u&&!d.current&&(c.current=new IntersectionObserver(y=>{const[a]=y;a?.isIntersecting&&!d.current&&(d.current=!0,g(!0),c.current?.disconnect(),c.current=null)},i),c.current.observe(u))},e[0]=i,e[1]=n):n=e[1];const l=n;let h;return e[2]!==t||e[3]!==l?(h=[t,l],e[2]=t,e[3]=l,e[4]=h):h=e[4],h}function te(i){const e=M.c(24),{objectKey:t,alt:g,className:c}=i,d=c===void 0?"":c,{connectionId:n,toolCaller:l}=D();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={rootMargin:"100px",threshold:0},e[0]=h):h=e[0];const[u,y]=ee(h);let a;e[1]!==n||e[2]!==t?(a=L.imagePreview(n,t),e[1]=n,e[2]=t,e[3]=a):a=e[3];let f;e[4]!==t||e[5]!==l?(f=async()=>{const{url:m}=await l("GET_PRESIGNED_URL",{key:t});return m},e[4]=t,e[5]=l,e[6]=f):f=e[6];let k;e[7]!==u||e[8]!==a||e[9]!==f?(k={queryKey:a,queryFn:f,enabled:u,staleTime:3e5,gcTime:6e5},e[7]=u,e[8]=a,e[9]=f,e[10]=k):k=e[10];const{data:b,isLoading:x,error:j}=X(k);let p;e[11]!==d?(p=I("relative w-full h-full flex items-center justify-center overflow-hidden",d),e[11]=d,e[12]=p):p=e[12];let r;e[13]!==g||e[14]!==j||e[15]!==b||e[16]!==x||e[17]!==u||e[18]!==t?(r=!u||x?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:x?s.jsx(T,{size:24,className:"animate-spin"}):s.jsx(P,{size:48})}):j?s.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:s.jsx(S,{size:24})}):b?s.jsx("img",{src:b,alt:g||t,className:"w-full h-full object-cover",loading:"lazy"}):null,e[13]=g,e[14]=j,e[15]=b,e[16]=x,e[17]=u,e[18]=t,e[19]=r):r=e[19];let o;return e[20]!==y||e[21]!==p||e[22]!==r?(o=s.jsx("div",{ref:y,className:p,children:r}),e[20]=y,e[21]=p,e[22]=r,e[23]=o):o=e[23],o}const z=12,se={Image01:P,VideoRecorder:O,Music01:$,File02:$,File04:B,File06:J,File07:G,FileCode01:K,Folder:H};function re(i){const e=i.split(".").pop()?.toLowerCase();return["jpg","jpeg","png","gif","webp","svg","bmp","ico"].includes(e||"")}function oe(i){const e=M.c(41),{item:t,onNavigate:g,onDownload:c,onDelete:d}=i;let n;e[0]!==t.key?(n=R(t.key),e[0]=t.key,e[1]=n):n=e[1];const l=n,h=t.isFolder?"Folder":W(t.key),u=se[h]||$;let y;e[2]!==t.isFolder||e[3]!==t.key?(y=!t.isFolder&&re(t.key),e[2]=t.isFolder,e[3]=t.key,e[4]=y):y=e[4];const a=y;let f;e[5]!==t.isFolder||e[6]!==t.key||e[7]!==g?(f=()=>t.isFolder?g(t.key):void 0,e[5]=t.isFolder,e[6]=t.key,e[7]=g,e[8]=f):f=e[8];const k=!a&&"p-4",b=t.isFolder?"cursor-pointer":"cursor-default";let x;e[9]!==k||e[10]!==b?(x=I("flex flex-col items-center justify-center w-full h-full",k,b),e[9]=k,e[10]=b,e[11]=x):x=e[11];let j;e[12]!==u||e[13]!==a||e[14]!==t.isFolder||e[15]!==t.key||e[16]!==l?(j=a?s.jsx("div",{className:"absolute inset-0",children:s.jsx(te,{objectKey:t.key,alt:l})}):s.jsx(u,{size:48,className:I(t.isFolder?"text-amber-500":"text-muted-foreground")}),e[12]=u,e[13]=a,e[14]=t.isFolder,e[15]=t.key,e[16]=l,e[17]=j):j=e[17];let p;e[18]!==a||e[19]!==t.isFolder||e[20]!==t.size||e[21]!==l?(p=a?s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2 pt-6",children:[s.jsx("span",{className:"text-sm text-white text-center line-clamp-1 block",children:l}),s.jsx("span",{className:"text-xs text-white/70 text-center block",children:U(t.size)})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mt-3 text-sm text-center line-clamp-2 px-2",children:l}),!t.isFolder&&s.jsx("span",{className:"mt-1 text-xs text-muted-foreground",children:U(t.size)})]}),e[18]=a,e[19]=t.isFolder,e[20]=t.size,e[21]=l,e[22]=p):p=e[22];let r;e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==p?(r=s.jsxs("button",{type:"button",onClick:f,className:x,children:[j,p]}),e[23]=f,e[24]=x,e[25]=j,e[26]=p,e[27]=r):r=e[27];let o;e[28]!==t.isFolder||e[29]!==t.key||e[30]!==d||e[31]!==c?(o=!t.isFolder&&s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0",onClick:F=>{F.stopPropagation(),c(t.key)},children:s.jsx(A,{size:14})}),s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})]}),e[28]=t.isFolder,e[29]=t.key,e[30]=d,e[31]=c,e[32]=o):o=e[32];let m;e[33]!==t.isFolder||e[34]!==t.key||e[35]!==d?(m=t.isFolder&&s.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(E,{variant:"secondary",size:"sm",className:"size-7 p-0 text-destructive hover:text-destructive",onClick:F=>{F.stopPropagation(),d(t.key)},children:s.jsx(V,{size:14})})}),e[33]=t.isFolder,e[34]=t.key,e[35]=d,e[36]=m):m=e[36];let N;return e[37]!==o||e[38]!==m||e[39]!==r?(N=s.jsxs("div",{className:"group relative aspect-square bg-muted/30 rounded-lg border border-border hover:border-primary/50 hover:bg-muted/50 transition-colors overflow-hidden",children:[r,o,m]}),e[37]=o,e[38]=m,e[39]=r,e[40]=N):N=e[40],N}function ze({prefix:i,flat:e,onNavigate:t}){const g=v.useRef(null),c=q(),{connectionId:d,toolCaller:n}=D(),{objects:l,isLoading:h,isFetchingMore:u,hasMore:y,loadMore:a,error:f}=Z({prefix:i,flat:e,pageSize:z}),k=_({mutationFn:async r=>{const o=i+r.name,{url:m}=await n("PUT_PRESIGNED_URL",{key:o,contentType:r.type||"application/octet-stream"}),N=await fetch(m,{method:"PUT",body:r,headers:{"Content-Type":r.type||"application/octet-stream"}});if(!N.ok)throw new Error(`Upload failed: ${N.statusText}`);return o},onSuccess:r=>{w.success(`Uploaded ${R(r)}`),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Upload failed: ${r.message}`)}}),b=_({mutationFn:async r=>r.length===1&&r[0]?n("DELETE_OBJECT",{key:r[0]}):n("DELETE_OBJECTS",{keys:r}),onSuccess:()=>{w.success("Deleted successfully"),c.invalidateQueries({queryKey:L.objects(d,i,e,z)})},onError:r=>{w.error(`Delete failed: ${r.message}`)}}),x=async r=>{try{const{url:o}=await n("GET_PRESIGNED_URL",{key:r}),m=await fetch(o);if(!m.ok)throw new Error(`Failed to fetch file: ${m.statusText}`);const N=await m.blob(),F=URL.createObjectURL(N),C=document.createElement("a");C.href=F,C.download=R(r),document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(F)}catch(o){w.error(`Download failed: ${o instanceof Error?o.message:"Unknown error"}`)}},j=r=>{const o=r.target.files;if(o){for(const m of Array.from(o))k.mutate(m);r.target.value=""}},p=r=>{if(!y||u)return;const o=r.currentTarget;o.scrollHeight-o.scrollTop-o.clientHeight<200&&a()};return f?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8",children:[s.jsx(S,{size:48,className:"text-destructive mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading files"}),s.jsx("p",{className:"text-muted-foreground text-center",children:f.message})]}):s.jsx("div",{className:"flex-1 overflow-y-auto p-4",onScroll:p,children:h?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[s.jsx(T,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading files..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(Q,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Upload files to get started"}),s.jsx("input",{ref:g,type:"file",multiple:!0,className:"hidden",onChange:j}),s.jsxs(E,{variant:"outline",onClick:()=>g.current?.click(),children:[s.jsx(Y,{size:14,className:"mr-1"}),"Upload files"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:l.map(r=>s.jsx(oe,{item:r,onNavigate:t,onDownload:x,onDelete:o=>b.mutate([o])},r.key))}),u&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(T,{size:24,className:"animate-spin text-muted-foreground"})})]})})}export{ze as default};
@@ -1 +1 @@
1
- import{c as f,j as s,g as I,r as C,aZ as F,m as E,z as O,t as w}from"./index-HxeE9C0A.js";import{C as k}from"./card-DKzkS6ji.js";import{c as y}from"./utils-D1Qd9-I_.js";import{A as R}from"./avatar-BbH9O0kN.js";import{i as D}from"./AlertCircle-TbirTaeA.js";import{i as H}from"./Check-BIlnRzi6.js";import{s as G}from"./Plus-BVPnBK8D.js";import{i as Q}from"./SearchMd-yRVgOeax.js";import{s as q}from"./XClose-S1Me7eeg.js";import{B as $}from"./button-C1iesapY.js";import{I as B}from"./input-DBGu1Yhi.js";import{C as T}from"./create-organization-dialog-58b_GUv7.js";import"./alert-dialog-B1nWkQHx.js";import"./form-NA0-x5iN.js";import"./label-11d5Pe_w.js";import"./spinner-BbdUl9_5.js";import"./useMutation-M3-wug2Q.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:Z,Header:P,Title:V,Subtitle:X,Content:Y,Footer:J,Badge:K,Skeleton:W}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"&&new Date(d.expiresAt)>new Date),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function $e(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{$e as default};
1
+ import{c as f,j as s,g as I,r as C,aY as F,m as E,z as O,t as w}from"./index-ChHDKIbN.js";import{C as k}from"./card-DPhTtE1j.js";import{c as y}from"./utils-B_eWxCLR.js";import{A as R}from"./avatar-a-IdsKtd.js";import{i as D}from"./AlertCircle-oGnqqT1Z.js";import{i as H}from"./Check-BlatIqwx.js";import{s as G}from"./Plus-CBeTqgO0.js";import{i as Q}from"./SearchMd-DlO0jVus.js";import{s as q}from"./XClose-9HhuzPl1.js";import{B as $}from"./button-IcLvDS7b.js";import{I as B}from"./input-BiH6tKYM.js";import{C as T}from"./create-organization-dialog-Cv4z3yf1.js";import"./alert-dialog-CezkcFZv.js";import"./form-CPbw8FiC.js";import"./label-CL-z0zvN.js";import"./spinner-DDglcYN3.js";import"./useMutation-CR-ZbATX.js";function U(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:r}=t,d=r===void 0?!1:r;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",a=d&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==x||e[4]!==a?(c=y("group transition-all flex flex-col gap-0",x,a,l),e[2]=l,e[3]=x,e[4]=a,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==c?(g=s.jsx(k,{className:c,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=c,e[9]=g):g=e[9],g}function M(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:r,objectFit:d,className:o}=t,m=i===void 0?"square":i,x=r===void 0?"lg":r,a=d===void 0?"contain":d;let c;return e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==x||e[5]!==n?(c=s.jsx(R,{url:n,fallback:l,shape:m,size:x,objectFit:a,className:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=m,e[4]=x,e[5]=n,e[6]=c):c=e[6],c}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function P(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function V(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function X(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==i?(r=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=r):r=e[4],r}function Z(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(U,{Avatar:M,AvatarSection:J,Header:Y,Title:P,Subtitle:V,Content:X,Footer:K,Badge:W,Skeleton:Z}),ee={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},te={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},se={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ie={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},le={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},ne={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:r}=t;let d;e[0]!==l?(d=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=d):d=e[1];const o=d,x=ee[i===void 0?4:i],a=o.sm&&te[o.sm],c=o.md&&se[o.md],g=o.lg&&ie[o.lg],p=o.xl&&le[o.xl],v=o["2xl"]&&ne[o["2xl"]];let N;e[2]!==r||e[3]!==x||e[4]!==a||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,a,c,g,p,v,r),e[2]=r,e[3]=x,e[4]=a,e[5]=c,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function re(t){const e=f.c(9),{count:n,columns:l,gap:i,className:r}=t,d=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let a;e[2]!==d?(a=Array.from({length:d}).map(ae),e[2]=d,e[3]=a):a=e[3];let c;return e[4]!==r||e[5]!==m||e[6]!==x||e[7]!==a?(c=s.jsx(L,{columns:m,gap:x,className:r,children:a}),e[4]=r,e[5]=m,e[6]=x,e[7]=a,e[8]=c):c=e[8],c}function ae(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const A=Object.assign(L,{Skeleton:re});function oe({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),r=O(),d=E(),o=async()=>{n(!0);try{const a=await I.organization.acceptInvitation({invitationId:t.id});if(a.error)w.error(a.error.message),n(!1);else{const c=await I.organization.setActive({organizationId:t.organizationId});c?.data?.slug?(w.success("Invitation accepted!"),d({to:"/$org",params:{org:c.data.slug}})):(w.success("Invitation accepted! Redirecting..."),d({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const a=await I.organization.rejectInvitation({invitationId:t.id});a.error?(w.error(a.error.message),i(!1)):(w.success("Invitation rejected"),await r.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(H,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Decline"]})})]})})]})}function ce({query:t}){const e=C.useContext(F),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(d=>d.status==="pending"&&new Date(d.expiresAt)>new Date),r=t?(()=>{const d=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(d)||o.organizationId.toLowerCase().includes(d))})():i;return r.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(A,{columns:{sm:2,md:3,lg:4},children:r.map(d=>s.jsx(oe,{invitation:d},d.id))})]})}function de(t){const e=f.c(14),{query:n}=t,{data:l}=I.useListOrganizations(),i=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const a=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(a)||c.slug.toLowerCase().includes(a))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const d=r;if(!l||l.length===0){let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=a):a=e[3],a}if(d.length===0){let a;return e[4]!==n?(a=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=a):a=e[5],a}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==d||e[8]!==i){let a;e[10]!==i?(a=c=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:c.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",c.slug]}),s.jsx(u.Title,{children:c.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=i,e[11]=a):a=e[11],m=d.map(a),e[7]=d,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(A,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function me(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(D,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function xe(){const t=f.c(27),{error:e,isPending:n}=I.useListOrganizations(),[l,i]=C.useState(""),[r,d]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(me,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(ce,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Q,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=j=>i(j.target.value),t[7]=c):c=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[a,s.jsx(B,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:c})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>d(!0),children:[s.jsx(G,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(A.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(de,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==r?(z=s.jsx(T,{open:r,onOpenChange:d}),t[22]=r,t[23]=z):z=t[23];let _;return t[24]!==S||t[25]!==z?(_=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=_):_=t[26],_}function $e(){const t=f.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-full",children:s.jsx(xe,{})}),t[0]=e):e=t[0],e}export{$e as default};
@@ -1 +1 @@
1
- import{r as n,at as L,aX as R,B as ke,G as Ee,H as Se,D as xe,aY as q}from"./index-HxeE9C0A.js";const Ce=({size:t=24,color:l="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:l,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M17 9a1.99 1.99 0 0 0-.586-1.414A1.994 1.994 0 0 0 15 7m0 8a6 6 0 1 0-5.946-5.193c.058.434.087.651.068.789a.853.853 0 0 1-.117.346c-.068.121-.187.24-.426.479l-5.11 5.11c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C3 17.296 3 17.418 3 17.663V19.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H7v-2h2v-2h2l1.58-1.58c.238-.238.357-.357.478-.425a.852.852 0 0 1 .346-.117c.138-.02.355.01.789.068.264.036.533.054.807.054Z"}));Ce.displayName="Key01";var de=1,Ie=.9,Re=.8,Ae=.17,Z=.1,Q=.999,Me=.9999,$e=.99,De=/[\\\/_+.#"@\[\(\{&]/,Ke=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:$e;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,k,C;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:De.test(t.charAt(i-1))?(h*=Re,k=t.slice(u,i-1).match(Ke),k&&u>0&&(h*=Math.pow(Q,k.length))):Fe.test(t.charAt(i-1))?(h*=Ie,C=t.slice(u,i-1).match(ve),C&&u>0&&(h*=Math.pow(Q,C.length))):(h*=Ae,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Me)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Le(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var j='[cmdk-group=""]',_='[cmdk-group-items=""]',Ve='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",K="data-value",je=(t,l,r)=>Le(t,l,r),pe=n.createContext(void 0),P=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=F(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=F(()=>new Set),u=F(()=>new Map),c=F(()=>new Map),d=F(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:k,loop:C,disablePointerSelection:H=!1,vimBindings:A=!0,...B}=t,N=L(),ne=L(),U=L(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,E.emit()}},[p]),$(()=>{w(6,ae)},[]);let E=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")X(),G(),w(1,T);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(U);y?y.focus():(a=document.getElementById(N))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,E.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}E.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),W=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{G(),E.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{X(),G(),r.current.value||T(),E.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{X(),s?.getAttribute("id")===e&&T(),E.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:N,inputId:U,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:je;return e?m(e,r.current.search,o):0}function G(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;V().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${j}[${K}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function T(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(K);E.setState("value",o||void 0)}function X(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(j))==null?void 0:o.querySelector(Ve))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function Y(e){let o=V()[e];o&&E.setState("value",o.getAttribute(K))}function J(e){var o;let s=D(),a=V(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&E.setState("value",g.getAttribute(K))}function ue(e){let o=D(),s=o?.closest(j),a;for(;s&&!a;)s=e>0?We(s,j):Ge(s,j),a=s?.querySelector(fe);a?E.setState("value",a.getAttribute(K)):J(e)}let ie=()=>Y(V().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):J(1)},ce=e=>{e.preventDefault(),e.metaKey?Y(0):e.altKey?ue(-1):J(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),Y(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:W.inputId,id:W.labelId,style:Ye},b),z(t,e=>n.createElement(he.Provider,{value:E},n.createElement(pe.Provider,{value:W},e))))}),qe=n.forwardRef((t,l)=>{var r,f;let u=L(),c=n.useRef(null),d=n.useContext(ge),v=P(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=I(w=>w.value&&w.value===p.current),k=I(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,C),()=>w.removeEventListener(te,C)},[k,t.onSelect,t.disabled]);function C(){var w,E;H(),(E=(w=b.current).onSelect)==null||E.call(w,p.current)}function H(){h.setState("value",p.current,!0)}if(!k)return null;let{disabled:A,value:B,onSelect:N,forceMount:ne,keywords:U,...M}=t;return n.createElement(R.div,{ref:q(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:H,onClick:A?void 0:C},t.children)}),Pe=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=L(),v=n.useRef(null),b=n.useRef(null),i=L(),p=P(),h=I(k=>u||p.filter()===!1?!0:k.search?k.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:q(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,k=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},k))))}),Be=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=I(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:q(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=I(i=>i.search),v=I(i=>i.selectedItemId),b=P();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),ze=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=I(i=>i.selectedItemId),b=P();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let k=i.offsetHeight;p.style.setProperty("--cmdk-list-height",k.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:q(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:q(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),He=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(ke,{open:r,onOpenChange:f},n.createElement(Ee,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ne=n.forwardRef((t,l)=>I(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ze=Object.assign(be,{List:ze,Item:qe,Input:Oe,Group:Pe,Separator:Be,Dialog:He,Empty:Ne,Loading:Ue});function We(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ge(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function F(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function I(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=P();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(K,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=F(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Xe(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Xe(l),{ref:l.ref},r(l.props.children)):r(l)}var Ye={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ze as _,Ce as i};
1
+ import{r as n,at as L,a3 as R,B as ke,G as Ee,H as Se,D as xe,aX as q}from"./index-ChHDKIbN.js";const Ce=({size:t=24,color:l="currentColor",...r})=>n.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:l,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},n.createElement("path",{d:"M17 9a1.99 1.99 0 0 0-.586-1.414A1.994 1.994 0 0 0 15 7m0 8a6 6 0 1 0-5.946-5.193c.058.434.087.651.068.789a.853.853 0 0 1-.117.346c-.068.121-.187.24-.426.479l-5.11 5.11c-.173.173-.26.26-.322.36a1 1 0 0 0-.12.29C3 17.296 3 17.418 3 17.663V19.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H7v-2h2v-2h2l1.58-1.58c.238-.238.357-.357.478-.425a.852.852 0 0 1 .346-.117c.138-.02.355.01.789.068.264.036.533.054.807.054Z"}));Ce.displayName="Key01";var de=1,Ie=.9,Re=.8,Ae=.17,Z=.1,Q=.999,Me=.9999,$e=.99,De=/[\\\/_+.#"@\[\(\{&]/,Ke=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:$e;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,k,C;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:De.test(t.charAt(i-1))?(h*=Re,k=t.slice(u,i-1).match(Ke),k&&u>0&&(h*=Math.pow(Q,k.length))):Fe.test(t.charAt(i-1))?(h*=Ie,C=t.slice(u,i-1).match(ve),C&&u>0&&(h*=Math.pow(Q,C.length))):(h*=Ae,u>0&&(h*=Math.pow(Q,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Me)),(h<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Z>h&&(h=x*Z)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Le(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var j='[cmdk-group=""]',_='[cmdk-group-items=""]',Ve='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",K="data-value",je=(t,l,r)=>Le(t,l,r),pe=n.createContext(void 0),P=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=F(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=F(()=>new Set),u=F(()=>new Map),c=F(()=>new Map),d=F(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:k,loop:C,disablePointerSelection:H=!1,vimBindings:A=!0,...B}=t,N=L(),ne=L(),U=L(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,E.emit()}},[p]),$(()=>{w(6,ae)},[]);let E=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")X(),G(),w(1,T);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(U);y?y.focus():(a=document.getElementById(N))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,E.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}E.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),W=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{G(),E.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{X(),G(),r.current.value||T(),E.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{X(),s?.getAttribute("id")===e&&T(),E.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:N,inputId:U,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:je;return e?m(e,r.current.search,o):0}function G(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;V().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),O=m.getAttribute("id");return((g=e.get(O))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${j}[${K}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function T(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(K);E.setState("value",o||void 0)}function X(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],O=le(S,y);r.current.filtered.items.set(g,O),O>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(j))==null?void 0:o.querySelector(Ve))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function J(e){let o=V()[e];o&&E.setState("value",o.getAttribute(K))}function Y(e){var o;let s=D(),a=V(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&E.setState("value",g.getAttribute(K))}function ue(e){let o=D(),s=o?.closest(j),a;for(;s&&!a;)s=e>0?We(s,j):Ge(s,j),a=s?.querySelector(fe);a?E.setState("value",a.getAttribute(K)):Y(e)}let ie=()=>J(V().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:e=>{var o;(o=B.onKeyDown)==null||o.call(B,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:W.inputId,id:W.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:E},n.createElement(pe.Provider,{value:W},e))))}),qe=n.forwardRef((t,l)=>{var r,f;let u=L(),c=n.useRef(null),d=n.useContext(ge),v=P(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=I(w=>w.value&&w.value===p.current),k=I(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,C),()=>w.removeEventListener(te,C)},[k,t.onSelect,t.disabled]);function C(){var w,E;H(),(E=(w=b.current).onSelect)==null||E.call(w,p.current)}function H(){h.setState("value",p.current,!0)}if(!k)return null;let{disabled:A,value:B,onSelect:N,forceMount:ne,keywords:U,...M}=t;return n.createElement(R.div,{ref:q(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:H,onClick:A?void 0:C},t.children)}),Pe=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=L(),v=n.useRef(null),b=n.useRef(null),i=L(),p=P(),h=I(k=>u||p.filter()===!1?!0:k.search?k.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:q(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,k=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},k))))}),Be=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=I(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:q(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=I(i=>i.search),v=I(i=>i.selectedItemId),b=P();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),ze=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=I(i=>i.selectedItemId),b=P();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let k=i.offsetHeight;p.style.setProperty("--cmdk-list-height",k.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:q(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:q(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),He=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(ke,{open:r,onOpenChange:f},n.createElement(Ee,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ne=n.forwardRef((t,l)=>I(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ue=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ze=Object.assign(be,{List:ze,Item:qe,Input:Oe,Group:Pe,Separator:Be,Dialog:He,Empty:Ne,Loading:Ue});function We(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ge(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function F(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function I(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=P();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(K,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=F(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Xe(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Xe(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ze as _,Ce as i};
@@ -1 +1 @@
1
- import{r as v,c as S,u as K,j as a,a_ as W,am as $,b5 as X,a3 as g,al as E,b6 as Y,an as k,b7 as w,av as Z,aq as I,ao as J,ap as Q}from"./index-HxeE9C0A.js";import{B as j}from"./button-C1iesapY.js";import{T as ee,a as oe,c as te,b as re}from"./integration-icon-CmJggqPx.js";import{c as ae}from"./Pin01-DpTwe7GO.js";import{u as se,a as ie}from"./use-organization-settings-ANLw4ex1.js";import{i as ne}from"./Loading01-CudhqwtJ.js";const A=({size:n=24,color:e="currentColor",...o})=>v.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},v.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));A.displayName="FlipBackward";const N=({size:n=24,color:e="currentColor",...o})=>v.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},v.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));N.displayName="Save01";function ye(n){const e=S.c(19),{title:o,url:s,icon:r}=n,{org:t}=K(),c=se(t.id),R=ie(t.id);let p;e[0]!==c?.sidebar_items||e[1]!==s?(p=c?.sidebar_items?.some(C=>C.url===s),e[0]=c?.sidebar_items,e[1]=s,e[2]=p):p=e[2];const u=!!p;let f;e[3]!==R.update||e[4]!==r||e[5]!==u||e[6]!==c?.sidebar_items||e[7]!==o||e[8]!==s?(f=async()=>{const C=c?.sidebar_items||[];let y;u?y=C.filter(H=>H.url!==s):y=[...C,{title:o,url:s,icon:r}],await R.update.mutateAsync({sidebar_items:y})},e[3]=R.update,e[4]=r,e[5]=u,e[6]=c?.sidebar_items,e[7]=o,e[8]=s,e[9]=f):f=e[9];const l=f,m=u?"secondary":"outline";let i;e[10]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(ae,{size:16}),e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==m?(d=a.jsx(ee,{asChild:!0,children:a.jsx(j,{onClick:l,size:"icon",variant:m,className:"size-7 border border-input",children:i})}),e[11]=l,e[12]=m,e[13]=d):d=e[13];const b=u?"Pinned":"Pin to sidebar";let h;e[14]!==b?(h=a.jsx(oe,{children:b}),e[14]=b,e[15]=h):h=e[15];let x;return e[16]!==d||e[17]!==h?(x=a.jsx(te,{children:a.jsxs(re,{children:[d,h]})}),e[16]=d,e[17]=h,e[18]=x):x=e[18],x}function ke(n){const e=S.c(15),{onSave:o,onUndo:s,isDirty:r,isSaving:t,saveLabel:c,undoLabel:R}=n,p=c===void 0?"Save":c,u=R===void 0?"Undo":R;if(!r)return null;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(A,{size:14}),e[0]=f):f=e[0];let l;e[1]!==t||e[2]!==s||e[3]!==u?(l=a.jsxs(j,{variant:"outline",size:"sm",onClick:s,disabled:t,"aria-label":u,children:[f,u]}),e[1]=t,e[2]=s,e[3]=u,e[4]=l):l=e[4];let m;e[5]!==t?(m=t?a.jsx(ne,{size:14,className:"animate-spin"}):a.jsx(N,{size:14}),e[5]=t,e[6]=m):m=e[6];let i;e[7]!==t||e[8]!==o||e[9]!==p||e[10]!==m?(i=a.jsxs(j,{variant:"default",size:"sm",onClick:o,disabled:t,"aria-label":p,children:[m,p]}),e[7]=t,e[8]=o,e[9]=p,e[10]=m,e[11]=i):i=e[11];let d;return e[12]!==l||e[13]!==i?(d=a.jsxs(a.Fragment,{children:[l,i]}),e[12]=l,e[13]=i,e[14]=d):d=e[14],d}var P="Radio",[ce,G]=I(P),[de,le]=ce(P),L=v.forwardRef((n,e)=>{const{__scopeRadio:o,name:s,checked:r=!1,required:t,disabled:c,value:R="on",onCheck:p,form:u,...f}=n,[l,m]=v.useState(null),i=E(e,h=>m(h)),d=v.useRef(!1),b=l?u||!!l.closest("form"):!0;return a.jsxs(de,{scope:o,checked:r,disabled:c,children:[a.jsx(g.button,{type:"button",role:"radio","aria-checked":r,"data-state":B(r),"data-disabled":c?"":void 0,disabled:c,value:R,...f,ref:i,onClick:k(n.onClick,h=>{r||p?.(),b&&(d.current=h.isPropagationStopped(),d.current||h.stopPropagation())})}),b&&a.jsx(T,{control:l,bubbles:!d.current,name:s,value:R,checked:r,required:t,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});L.displayName=P;var z="RadioIndicator",M=v.forwardRef((n,e)=>{const{__scopeRadio:o,forceMount:s,...r}=n,t=le(z,o);return a.jsx(Z,{present:s||t.checked,children:a.jsx(g.span,{"data-state":B(t.checked),"data-disabled":t.disabled?"":void 0,...r,ref:e})})});M.displayName=z;var ue="RadioBubbleInput",T=v.forwardRef(({__scopeRadio:n,control:e,checked:o,bubbles:s=!0,...r},t)=>{const c=v.useRef(null),R=E(c,t),p=J(o),u=Q(e);return v.useEffect(()=>{const f=c.current;if(!f)return;const l=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(l,"checked").set;if(p!==o&&i){const d=new Event("click",{bubbles:s});i.call(f,o),f.dispatchEvent(d)}},[p,o,s]),a.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...r,tabIndex:-1,ref:R,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});T.displayName=ue;function B(n){return n?"checked":"unchecked"}var pe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_="RadioGroup",[fe]=I(_,[w,G]),D=w(),O=G(),[me,ve]=fe(_),F=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,name:s,defaultValue:r,value:t,required:c=!1,disabled:R=!1,orientation:p,dir:u,loop:f=!0,onValueChange:l,...m}=n,i=D(o),d=W(u),[b,h]=$({prop:t,defaultProp:r??null,onChange:l,caller:_});return a.jsx(me,{scope:o,name:s,required:c,disabled:R,value:b,onValueChange:h,children:a.jsx(X,{asChild:!0,...i,orientation:p,dir:d,loop:f,children:a.jsx(g.div,{role:"radiogroup","aria-required":c,"aria-orientation":p,"data-disabled":R?"":void 0,dir:d,...m,ref:e})})})});F.displayName=_;var V="RadioGroupItem",U=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,disabled:s,...r}=n,t=ve(V,o),c=t.disabled||s,R=D(o),p=O(o),u=v.useRef(null),f=E(e,u),l=t.value===r.value,m=v.useRef(!1);return v.useEffect(()=>{const i=b=>{pe.includes(b.key)&&(m.current=!0)},d=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",d),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",d)}},[]),a.jsx(Y,{asChild:!0,...R,focusable:!c,active:l,children:a.jsx(L,{disabled:c,required:t.required,checked:l,...p,...r,name:t.name,ref:f,onCheck:()=>t.onValueChange(r.value),onKeyDown:k(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:k(r.onFocus,()=>{m.current&&u.current?.click()})})})});U.displayName=V;var Re="RadioGroupIndicator",q=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,...s}=n,r=O(o);return a.jsx(M,{...r,...s,ref:e})});q.displayName=Re;var je=F,Ee=U,Pe=q;export{Ee as I,ye as P,je as R,ke as S,Pe as a};
1
+ import{r as v,c as S,u as K,j as a,aZ as W,am as $,b4 as Z,a3 as g,al as E,b5 as X,an as k,b6 as w,av as Y,aq as I,ao as J,ap as Q}from"./index-ChHDKIbN.js";import{B as j}from"./button-IcLvDS7b.js";import{T as ee,a as oe,c as te,b as re}from"./integration-icon-D8EX8kVH.js";import{c as ae}from"./Pin01-Cetrd1z7.js";import{u as se,a as ie}from"./use-organization-settings-DhaOb6f0.js";import{i as ne}from"./Loading01-DcUBqOzt.js";const A=({size:n=24,color:e="currentColor",...o})=>v.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},v.createElement("path",{d:"M3 9h13.5a4.5 4.5 0 1 1 0 9H12M3 9l4-4M3 9l4 4"}));A.displayName="FlipBackward";const N=({size:n=24,color:e="currentColor",...o})=>v.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},v.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));N.displayName="Save01";function _e(n){const e=S.c(19),{title:o,url:s,icon:r}=n,{org:t}=K(),c=se(t.id),R=ie(t.id);let p;e[0]!==c?.sidebar_items||e[1]!==s?(p=c?.sidebar_items?.some(C=>C.url===s),e[0]=c?.sidebar_items,e[1]=s,e[2]=p):p=e[2];const u=!!p;let f;e[3]!==R.update||e[4]!==r||e[5]!==u||e[6]!==c?.sidebar_items||e[7]!==o||e[8]!==s?(f=async()=>{const C=c?.sidebar_items||[];let _;u?_=C.filter(H=>H.url!==s):_=[...C,{title:o,url:s,icon:r}],await R.update.mutateAsync({sidebar_items:_})},e[3]=R.update,e[4]=r,e[5]=u,e[6]=c?.sidebar_items,e[7]=o,e[8]=s,e[9]=f):f=e[9];const l=f,m=u?"secondary":"outline";let i;e[10]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx(ae,{size:16}),e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==m?(d=a.jsx(ee,{asChild:!0,children:a.jsx(j,{onClick:l,size:"icon",variant:m,className:"size-7 border border-input",children:i})}),e[11]=l,e[12]=m,e[13]=d):d=e[13];const b=u?"Pinned":"Pin to sidebar";let h;e[14]!==b?(h=a.jsx(oe,{children:b}),e[14]=b,e[15]=h):h=e[15];let x;return e[16]!==d||e[17]!==h?(x=a.jsx(te,{children:a.jsxs(re,{children:[d,h]})}),e[16]=d,e[17]=h,e[18]=x):x=e[18],x}function ke(n){const e=S.c(15),{onSave:o,onUndo:s,isDirty:r,isSaving:t,saveLabel:c,undoLabel:R}=n,p=c===void 0?"Save":c,u=R===void 0?"Undo":R;if(!r)return null;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=a.jsx(A,{size:14}),e[0]=f):f=e[0];let l;e[1]!==t||e[2]!==s||e[3]!==u?(l=a.jsxs(j,{variant:"outline",size:"sm",onClick:s,disabled:t,"aria-label":u,children:[f,u]}),e[1]=t,e[2]=s,e[3]=u,e[4]=l):l=e[4];let m;e[5]!==t?(m=t?a.jsx(ne,{size:14,className:"animate-spin"}):a.jsx(N,{size:14}),e[5]=t,e[6]=m):m=e[6];let i;e[7]!==t||e[8]!==o||e[9]!==p||e[10]!==m?(i=a.jsxs(j,{variant:"default",size:"sm",onClick:o,disabled:t,"aria-label":p,children:[m,p]}),e[7]=t,e[8]=o,e[9]=p,e[10]=m,e[11]=i):i=e[11];let d;return e[12]!==l||e[13]!==i?(d=a.jsxs(a.Fragment,{children:[l,i]}),e[12]=l,e[13]=i,e[14]=d):d=e[14],d}var P="Radio",[ce,G]=I(P),[de,le]=ce(P),L=v.forwardRef((n,e)=>{const{__scopeRadio:o,name:s,checked:r=!1,required:t,disabled:c,value:R="on",onCheck:p,form:u,...f}=n,[l,m]=v.useState(null),i=E(e,h=>m(h)),d=v.useRef(!1),b=l?u||!!l.closest("form"):!0;return a.jsxs(de,{scope:o,checked:r,disabled:c,children:[a.jsx(g.button,{type:"button",role:"radio","aria-checked":r,"data-state":B(r),"data-disabled":c?"":void 0,disabled:c,value:R,...f,ref:i,onClick:k(n.onClick,h=>{r||p?.(),b&&(d.current=h.isPropagationStopped(),d.current||h.stopPropagation())})}),b&&a.jsx(T,{control:l,bubbles:!d.current,name:s,value:R,checked:r,required:t,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});L.displayName=P;var z="RadioIndicator",M=v.forwardRef((n,e)=>{const{__scopeRadio:o,forceMount:s,...r}=n,t=le(z,o);return a.jsx(Y,{present:s||t.checked,children:a.jsx(g.span,{"data-state":B(t.checked),"data-disabled":t.disabled?"":void 0,...r,ref:e})})});M.displayName=z;var ue="RadioBubbleInput",T=v.forwardRef(({__scopeRadio:n,control:e,checked:o,bubbles:s=!0,...r},t)=>{const c=v.useRef(null),R=E(c,t),p=J(o),u=Q(e);return v.useEffect(()=>{const f=c.current;if(!f)return;const l=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(l,"checked").set;if(p!==o&&i){const d=new Event("click",{bubbles:s});i.call(f,o),f.dispatchEvent(d)}},[p,o,s]),a.jsx(g.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...r,tabIndex:-1,ref:R,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});T.displayName=ue;function B(n){return n?"checked":"unchecked"}var pe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[fe]=I(y,[w,G]),D=w(),O=G(),[me,ve]=fe(y),F=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,name:s,defaultValue:r,value:t,required:c=!1,disabled:R=!1,orientation:p,dir:u,loop:f=!0,onValueChange:l,...m}=n,i=D(o),d=W(u),[b,h]=$({prop:t,defaultProp:r??null,onChange:l,caller:y});return a.jsx(me,{scope:o,name:s,required:c,disabled:R,value:b,onValueChange:h,children:a.jsx(Z,{asChild:!0,...i,orientation:p,dir:d,loop:f,children:a.jsx(g.div,{role:"radiogroup","aria-required":c,"aria-orientation":p,"data-disabled":R?"":void 0,dir:d,...m,ref:e})})})});F.displayName=y;var V="RadioGroupItem",U=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,disabled:s,...r}=n,t=ve(V,o),c=t.disabled||s,R=D(o),p=O(o),u=v.useRef(null),f=E(e,u),l=t.value===r.value,m=v.useRef(!1);return v.useEffect(()=>{const i=b=>{pe.includes(b.key)&&(m.current=!0)},d=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",d),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",d)}},[]),a.jsx(X,{asChild:!0,...R,focusable:!c,active:l,children:a.jsx(L,{disabled:c,required:t.required,checked:l,...p,...r,name:t.name,ref:f,onCheck:()=>t.onValueChange(r.value),onKeyDown:k(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:k(r.onFocus,()=>{m.current&&u.current?.click()})})})});U.displayName=V;var Re="RadioGroupIndicator",q=v.forwardRef((n,e)=>{const{__scopeRadioGroup:o,...s}=n,r=O(o);return a.jsx(M,{...r,...s,ref:e})});q.displayName=Re;var je=F,Ee=U,Pe=q;export{Ee as I,_e as P,je as R,ke as S,Pe as a};
@@ -1 +1 @@
1
- import{r as i,j as t,a3 as o}from"./index-HxeE9C0A.js";var s=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"}),d="VisuallyHidden",a=i.forwardRef((r,e)=>t.jsx(o.span,{...r,ref:e,style:{...s,...r.style}}));a.displayName=d;var n=a;export{n as R,s as V};
1
+ import{r as i,j as t,a3 as o}from"./index-ChHDKIbN.js";var s=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"}),d="VisuallyHidden",a=i.forwardRef((r,e)=>t.jsx(o.span,{...r,ref:e,style:{...s,...r.style}}));a.displayName=d;var n=a;export{n as R,s as V};
@@ -1 +1 @@
1
- import{C as n,L as r,O as l,P as u,V as C,i as c,p as P,u as p}from"./index-HxeE9C0A.js";import{E as m,b as d,a as L,c as g,u as T,d as x,e as y,f as S,g as E,h as b}from"./use-connection-DWpxH8iy.js";import{S as e}from"./constants-BEco_-y7.js";import{K as h,a as O,W as R,c as K,g as _,b as A,d as I,e as W,f as V,h as w,i as D,u as Q,j}from"./constants-BEco_-y7.js";import{u as G,a as N,b as Y,c as k,d as v}from"./use-mcp-tools-DO_-llbI.js";import{g as F,l as H,a as J,r as q,u as z,b as X,c as Z,d as $}from"./use-mcp-prompts-CUow6VVK.js";import{u as es,a as os,b as ts}from"./use-virtual-mcp-DaI2d98r.js";import{a as is,h as ns,i as rs}from"./mcp-oauth-JrpxCLx4.js";import"./useMutation-M3-wug2Q.js";import"./useQuery-jRtVXI31.js";export{n as ConnectionEntitySchema,m as EMPTY_COLLECTION_LIST_RESULT,h as KEYS,r as Locator,l as ORG_ADMIN_PROJECT_SLUG,u as ProjectContextProvider,O as SELF_MCP_ALIAS_ID,e as StreamableHTTPClientTransport,C as VirtualMCPEntitySchema,R as WellKnownOrgMCPId,is as authenticateMcp,d as buildCollectionQueryKey,L as buildOrderByExpression,g as buildWhereExpression,K as createMCPClient,_ as getDecopilotId,F as getPrompt,A as getWellKnownCommunityRegistryConnection,I as getWellKnownDecopilotVirtualMCP,W as getWellKnownMcpStudioConnection,V as getWellKnownOpenRouterConnection,w as getWellKnownRegistryConnection,ns as handleOAuthCallback,rs as isConnectionAuthenticated,D as isDecopilot,c as isStdioParameters,H as listPrompts,J as listResources,P as parseVirtualUrl,q as readResource,T as useCollectionActions,x as useCollectionItem,y as useCollectionList,S as useConnection,E as useConnectionActions,b as useConnections,Q as useMCPClient,j as useMCPClientOptional,z as useMCPPromptsList,X as useMCPPromptsListQuery,Z as useMCPResourcesList,$ as useMCPResourcesListQuery,G as useMCPToolCall,N as useMCPToolCallMutation,Y as useMCPToolCallQuery,k as useMCPToolsList,v as useMCPToolsListQuery,p as useProjectContext,es as useVirtualMCP,os as useVirtualMCPActions,ts as useVirtualMCPs};
1
+ import{C as n,L as r,O as l,P as u,V as C,i as c,p as P,u as p}from"./index-ChHDKIbN.js";import{E as m,b as d,a as L,c as g,u as T,d as x,e as y,f as S,g as E,h as b}from"./use-connection-DMc1ed7A.js";import{S as e}from"./constants-Bb6jn5pm.js";import{K as h,a as O,W as R,c as K,g as _,b as A,d as I,e as W,f as V,h as w,i as D,u as Q,j}from"./constants-Bb6jn5pm.js";import{u as G,a as N,b as Y,c as k,d as v}from"./use-mcp-tools-D7_YQODs.js";import{g as F,l as H,a as J,r as q,u as z,b as X,c as Z,d as $}from"./use-mcp-prompts-DnDIhnz1.js";import{u as es,a as os,b as ts}from"./use-virtual-mcp-Dx2SDNW7.js";import{a as is,h as ns,i as rs}from"./mcp-oauth-pNbworXN.js";import"./useMutation-CR-ZbATX.js";import"./useQuery-t9jS7IDj.js";export{n as ConnectionEntitySchema,m as EMPTY_COLLECTION_LIST_RESULT,h as KEYS,r as Locator,l as ORG_ADMIN_PROJECT_SLUG,u as ProjectContextProvider,O as SELF_MCP_ALIAS_ID,e as StreamableHTTPClientTransport,C as VirtualMCPEntitySchema,R as WellKnownOrgMCPId,is as authenticateMcp,d as buildCollectionQueryKey,L as buildOrderByExpression,g as buildWhereExpression,K as createMCPClient,_ as getDecopilotId,F as getPrompt,A as getWellKnownCommunityRegistryConnection,I as getWellKnownDecopilotVirtualMCP,W as getWellKnownMcpStudioConnection,V as getWellKnownOpenRouterConnection,w as getWellKnownRegistryConnection,ns as handleOAuthCallback,rs as isConnectionAuthenticated,D as isDecopilot,c as isStdioParameters,H as listPrompts,J as listResources,P as parseVirtualUrl,q as readResource,T as useCollectionActions,x as useCollectionItem,y as useCollectionList,S as useConnection,E as useConnectionActions,b as useConnections,Q as useMCPClient,j as useMCPClientOptional,z as useMCPPromptsList,X as useMCPPromptsListQuery,Z as useMCPResourcesList,$ as useMCPResourcesListQuery,G as useMCPToolCall,N as useMCPToolCallMutation,Y as useMCPToolCallQuery,k as useMCPToolsList,v as useMCPToolsListQuery,p as useProjectContext,es as useVirtualMCP,os as useVirtualMCPActions,ts as useVirtualMCPs};
@@ -1 +1 @@
1
- import{c as o,r as u,j as c}from"./index-HxeE9C0A.js";import{c as a}from"./utils-D1Qd9-I_.js";function x(n,e){const s=u.Children.toArray(n);for(const l of s)if(u.isValidElement(l)&&l.type===e)return l;return null}function p(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex flex-col h-full bg-background overflow-hidden",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function b(n){const e=o.c(10),{children:s,className:l}=n;let t;e[0]!==s?(t=x(s,h),e[0]=s,e[1]=t):t=e[1];const r=t;let f;e[2]!==s?(f=x(s,g),e[2]=s,e[3]=f):f=e[3];const m=f;let i;e[4]!==l?(i=a("shrink-0 w-full border-b border-border h-12 overflow-x-auto","flex items-center justify-between gap-3 px-4 min-w-max",l),e[4]=l,e[5]=i):i=e[5];let d;return e[6]!==r||e[7]!==m||e[8]!==i?(d=c.jsxs("div",{className:i,children:[r,m]}),e[6]=r,e[7]=m,e[8]=i,e[9]=d):d=e[9],d}function h(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex items-center gap-2 flex-shrink-0 overflow-hidden",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function g(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex items-center gap-2 flex-shrink-0 overflow-hidden border-l border-border pl-3",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function j(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex-1 overflow-auto",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const w=Object.assign(p,{Header:Object.assign(b,{Left:h,Right:g}),Content:j});export{w as P};
1
+ import{c as o,r as u,j as c}from"./index-ChHDKIbN.js";import{c as a}from"./utils-B_eWxCLR.js";function x(n,e){const s=u.Children.toArray(n);for(const l of s)if(u.isValidElement(l)&&l.type===e)return l;return null}function p(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex flex-col h-full bg-background overflow-hidden",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function b(n){const e=o.c(10),{children:s,className:l}=n;let t;e[0]!==s?(t=x(s,h),e[0]=s,e[1]=t):t=e[1];const r=t;let f;e[2]!==s?(f=x(s,g),e[2]=s,e[3]=f):f=e[3];const m=f;let i;e[4]!==l?(i=a("shrink-0 w-full border-b border-border h-12 overflow-x-auto","flex items-center justify-between gap-3 px-4 min-w-max",l),e[4]=l,e[5]=i):i=e[5];let d;return e[6]!==r||e[7]!==m||e[8]!==i?(d=c.jsxs("div",{className:i,children:[r,m]}),e[6]=r,e[7]=m,e[8]=i,e[9]=d):d=e[9],d}function h(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex items-center gap-2 flex-shrink-0 overflow-hidden",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function g(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex items-center gap-2 flex-shrink-0 overflow-hidden border-l border-border pl-3",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function j(n){const e=o.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=a("flex-1 overflow-auto",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=c.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const w=Object.assign(p,{Header:Object.assign(b,{Left:h,Right:g}),Content:j});export{w as P};