@arbidocs/blocks 0.4.154 → 0.4.156

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 (141) hide show
  1. package/dist/{ConnectedNativeDocxComparison-OLWRQSRS.js → ConnectedNativeDocxComparison-2PLOOXSH.js} +7 -7
  2. package/dist/{ConnectedNativeDocxComparison-OLWRQSRS.js.map → ConnectedNativeDocxComparison-2PLOOXSH.js.map} +1 -1
  3. package/dist/{ConnectedNativeDocxComparison-YORMOPPN.cjs → ConnectedNativeDocxComparison-S25BPUH5.cjs} +8 -8
  4. package/dist/{ConnectedNativeDocxComparison-YORMOPPN.cjs.map → ConnectedNativeDocxComparison-S25BPUH5.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxEditor-34EBIIFS.js → ConnectedNativeDocxEditor-JJAGMHZC.js} +5 -5
  6. package/dist/{ConnectedNativeDocxEditor-34EBIIFS.js.map → ConnectedNativeDocxEditor-JJAGMHZC.js.map} +1 -1
  7. package/dist/{ConnectedNativeDocxEditor-EHTWGGX3.cjs → ConnectedNativeDocxEditor-YA4HWLY4.cjs} +7 -7
  8. package/dist/{ConnectedNativeDocxEditor-EHTWGGX3.cjs.map → ConnectedNativeDocxEditor-YA4HWLY4.cjs.map} +1 -1
  9. package/dist/{ConnectedStreamedWordArtifact-5DK6QGYN.cjs → ConnectedStreamedWordArtifact-EXYZAU4Y.cjs} +8 -8
  10. package/dist/ConnectedStreamedWordArtifact-EXYZAU4Y.cjs.map +1 -0
  11. package/dist/{ConnectedStreamedWordArtifact-GLIDLSAS.js → ConnectedStreamedWordArtifact-YAAXY5KY.js} +7 -7
  12. package/dist/{ConnectedStreamedWordArtifact-GLIDLSAS.js.map → ConnectedStreamedWordArtifact-YAAXY5KY.js.map} +1 -1
  13. package/dist/{NativeDocxEditor-XT5ZLFGU.js → NativeDocxEditor-JBQMH3MP.js} +3 -3
  14. package/dist/{NativeDocxEditor-XT5ZLFGU.js.map → NativeDocxEditor-JBQMH3MP.js.map} +1 -1
  15. package/dist/{NativeDocxEditor-5VBNM5I7.cjs → NativeDocxEditor-M3I776GD.cjs} +7 -7
  16. package/dist/{NativeDocxEditor-5VBNM5I7.cjs.map → NativeDocxEditor-M3I776GD.cjs.map} +1 -1
  17. package/dist/agents/index.cjs +238 -238
  18. package/dist/agents/index.js +4 -4
  19. package/dist/chat/index.cjs +1 -1
  20. package/dist/chat/index.js +1 -1
  21. package/dist/{chunk-MF5KQ4PS.js → chunk-2CWM2CFZ.js} +4 -4
  22. package/dist/{chunk-MF5KQ4PS.js.map → chunk-2CWM2CFZ.js.map} +1 -1
  23. package/dist/{chunk-QKR5LWDO.js → chunk-6HG56GCT.js} +4 -4
  24. package/dist/{chunk-QKR5LWDO.js.map → chunk-6HG56GCT.js.map} +1 -1
  25. package/dist/chunk-6HMCF4AJ.js +1720 -0
  26. package/dist/chunk-6HMCF4AJ.js.map +1 -0
  27. package/dist/{chunk-KHXEIEXN.js → chunk-7IRSCMNK.js} +3 -3
  28. package/dist/{chunk-KHXEIEXN.js.map → chunk-7IRSCMNK.js.map} +1 -1
  29. package/dist/{chunk-TZOQKV64.js → chunk-EWCJXUBP.js} +3 -3
  30. package/dist/{chunk-TZOQKV64.js.map → chunk-EWCJXUBP.js.map} +1 -1
  31. package/dist/{chunk-CU6LDQ57.js → chunk-F3EZDBDJ.js} +4 -4
  32. package/dist/{chunk-CU6LDQ57.js.map → chunk-F3EZDBDJ.js.map} +1 -1
  33. package/dist/{chunk-YF3QUHKN.cjs → chunk-FEGXFABZ.cjs} +3 -3
  34. package/dist/{chunk-YF3QUHKN.cjs.map → chunk-FEGXFABZ.cjs.map} +1 -1
  35. package/dist/{chunk-GC2FSPSQ.cjs → chunk-HDJRSCRE.cjs} +6 -6
  36. package/dist/{chunk-GC2FSPSQ.cjs.map → chunk-HDJRSCRE.cjs.map} +1 -1
  37. package/dist/{chunk-CQCNU5KT.cjs → chunk-IJEISII2.cjs} +6 -6
  38. package/dist/{chunk-CQCNU5KT.cjs.map → chunk-IJEISII2.cjs.map} +1 -1
  39. package/dist/{chunk-NPR5BGFF.cjs → chunk-JSQEAPTC.cjs} +26 -14
  40. package/dist/chunk-JSQEAPTC.cjs.map +1 -0
  41. package/dist/{chunk-BDA3RHYD.cjs → chunk-MUDEL7UL.cjs} +25 -884
  42. package/dist/chunk-MUDEL7UL.cjs.map +1 -0
  43. package/dist/{chunk-6QAAIDQQ.cjs → chunk-O3FB62T5.cjs} +47 -47
  44. package/dist/{chunk-6QAAIDQQ.cjs.map → chunk-O3FB62T5.cjs.map} +1 -1
  45. package/dist/{chunk-265GOG4W.js → chunk-ONTUMV74.js} +26 -14
  46. package/dist/chunk-ONTUMV74.js.map +1 -0
  47. package/dist/chunk-OTU5KGQ6.cjs +18 -0
  48. package/dist/{chunk-HUATKA3M.cjs.map → chunk-OTU5KGQ6.cjs.map} +1 -1
  49. package/dist/{chunk-GO3BN76C.js → chunk-PGOSIJ2I.js} +3 -3
  50. package/dist/{chunk-GO3BN76C.js.map → chunk-PGOSIJ2I.js.map} +1 -1
  51. package/dist/chunk-S74QMZVZ.cjs +18 -0
  52. package/dist/{chunk-C3SMTA3C.cjs.map → chunk-S74QMZVZ.cjs.map} +1 -1
  53. package/dist/{chunk-KUT2Y7JF.cjs → chunk-TQIY2SVY.cjs} +5 -5
  54. package/dist/{chunk-KUT2Y7JF.cjs.map → chunk-TQIY2SVY.cjs.map} +1 -1
  55. package/dist/{chunk-MNG7N6M2.js → chunk-UKCCV63X.js} +4 -4
  56. package/dist/{chunk-MNG7N6M2.js.map → chunk-UKCCV63X.js.map} +1 -1
  57. package/dist/{chunk-B3FMUFAW.cjs → chunk-UKT3WH5Z.cjs} +3 -3
  58. package/dist/{chunk-B3FMUFAW.cjs.map → chunk-UKT3WH5Z.cjs.map} +1 -1
  59. package/dist/{chunk-P6RIBIVN.js → chunk-UPMADXDU.js} +3 -3
  60. package/dist/{chunk-P6RIBIVN.js.map → chunk-UPMADXDU.js.map} +1 -1
  61. package/dist/{chunk-757OYF6G.cjs → chunk-VY4UFXTM.cjs} +4 -4
  62. package/dist/{chunk-757OYF6G.cjs.map → chunk-VY4UFXTM.cjs.map} +1 -1
  63. package/dist/{chunk-RE7NULEY.js → chunk-W7CWGURO.js} +28 -873
  64. package/dist/chunk-W7CWGURO.js.map +1 -0
  65. package/dist/chunk-WV4TD2HZ.cjs +1785 -0
  66. package/dist/chunk-WV4TD2HZ.cjs.map +1 -0
  67. package/dist/{chunk-WU34CHU5.js → chunk-YMQDDUKW.js} +3 -3
  68. package/dist/{chunk-WU34CHU5.js.map → chunk-YMQDDUKW.js.map} +1 -1
  69. package/dist/connect/docx.cjs +11 -11
  70. package/dist/connect/docx.js +7 -7
  71. package/dist/connect/index.cjs +1313 -151
  72. package/dist/connect/index.cjs.map +1 -1
  73. package/dist/connect/index.d.ts +1 -0
  74. package/dist/connect/index.js +1175 -27
  75. package/dist/connect/index.js.map +1 -1
  76. package/dist/connect/viewer.cjs +48 -52
  77. package/dist/connect/viewer.cjs.map +1 -1
  78. package/dist/connect/viewer.js +10 -14
  79. package/dist/connect/viewer.js.map +1 -1
  80. package/dist/connection/files/DocumentSyncGlyph.d.ts +28 -0
  81. package/dist/connection/files/explorer/ConnectedFilesExplorer.d.ts +56 -0
  82. package/dist/connection/files/explorer/FileTiles.d.ts +87 -0
  83. package/dist/connection/files/index.d.ts +5 -0
  84. package/dist/connection/files/store.d.ts +27 -0
  85. package/dist/connection/files/support.d.ts +38 -0
  86. package/dist/document-tools/index.cjs +1 -1
  87. package/dist/document-tools/index.js +1 -1
  88. package/dist/docx/index.cjs +47 -47
  89. package/dist/docx/index.js +3 -3
  90. package/dist/facts/index.cjs +54 -54
  91. package/dist/facts/index.js +4 -4
  92. package/dist/files/DocStatusIcon.d.ts +5 -4
  93. package/dist/files/FailedStageIcon.d.ts +26 -0
  94. package/dist/files/folders/FolderProviderIcon.d.ts +29 -0
  95. package/dist/files/folders/folderPaths.d.ts +86 -0
  96. package/dist/files/folders/index.d.ts +2 -0
  97. package/dist/files/index.cjs +326 -238
  98. package/dist/files/index.d.ts +5 -0
  99. package/dist/files/index.js +2 -2
  100. package/dist/files/permissions.d.ts +28 -0
  101. package/dist/files/recently-deleted.d.ts +7 -0
  102. package/dist/files/visibility.d.ts +31 -0
  103. package/dist/index.cjs +371 -371
  104. package/dist/index.js +10 -10
  105. package/dist/studio/index.cjs +1 -1
  106. package/dist/studio/index.js +1 -1
  107. package/dist/workflow-canvas/index.cjs +16 -16
  108. package/dist/workflow-canvas/index.js +4 -4
  109. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +96 -29
  110. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -1
  111. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.cts +1 -1
  112. package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.ts +1 -1
  113. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +98 -31
  114. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -1
  115. package/node_modules/@arbidocs/coedit/dist/index.cjs +96 -29
  116. package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -1
  117. package/node_modules/@arbidocs/coedit/dist/index.d.cts +1 -1
  118. package/node_modules/@arbidocs/coedit/dist/index.d.ts +1 -1
  119. package/node_modules/@arbidocs/coedit/dist/index.js +98 -31
  120. package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -1
  121. package/node_modules/@arbidocs/coedit/dist/server.cjs +98 -33
  122. package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
  123. package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
  124. package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
  125. package/node_modules/@arbidocs/coedit/dist/server.js +99 -34
  126. package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
  127. package/node_modules/@arbidocs/coedit/dist/{session-Cf9iu1Vt.d.cts → session-WGvWs6yO.d.cts} +22 -4
  128. package/node_modules/@arbidocs/coedit/dist/{session-Cf9iu1Vt.d.ts → session-WGvWs6yO.d.ts} +22 -4
  129. package/node_modules/@arbidocs/coedit/package.json +1 -1
  130. package/package.json +6 -5
  131. package/dist/ConnectedStreamedWordArtifact-5DK6QGYN.cjs.map +0 -1
  132. package/dist/chunk-265GOG4W.js.map +0 -1
  133. package/dist/chunk-BDA3RHYD.cjs.map +0 -1
  134. package/dist/chunk-C3SMTA3C.cjs +0 -18
  135. package/dist/chunk-HUATKA3M.cjs +0 -18
  136. package/dist/chunk-JGOST4IL.js +0 -648
  137. package/dist/chunk-JGOST4IL.js.map +0 -1
  138. package/dist/chunk-NPR5BGFF.cjs.map +0 -1
  139. package/dist/chunk-RE7NULEY.js.map +0 -1
  140. package/dist/chunk-YAEXSCUW.cjs +0 -677
  141. package/dist/chunk-YAEXSCUW.cjs.map +0 -1
@@ -9,51 +9,49 @@ var chunkOU3RGQFX_cjs = require('../chunk-OU3RGQFX.cjs');
9
9
  require('../chunk-REH7PX3N.cjs');
10
10
  var chunkSN2GZ4ZM_cjs = require('../chunk-SN2GZ4ZM.cjs');
11
11
  var chunkKBO75NLM_cjs = require('../chunk-KBO75NLM.cjs');
12
- var chunkCQCNU5KT_cjs = require('../chunk-CQCNU5KT.cjs');
12
+ var chunkIJEISII2_cjs = require('../chunk-IJEISII2.cjs');
13
13
  var chunk6I6CVX5G_cjs = require('../chunk-6I6CVX5G.cjs');
14
- var chunkYAEXSCUW_cjs = require('../chunk-YAEXSCUW.cjs');
15
- require('../chunk-223D4727.cjs');
16
14
  var chunkCB4TIDEX_cjs = require('../chunk-CB4TIDEX.cjs');
17
15
  var chunkFM3IRQJW_cjs = require('../chunk-FM3IRQJW.cjs');
18
16
  var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
19
17
  require('../chunk-464YPRAE.cjs');
20
- require('../chunk-NPR5BGFF.cjs');
21
- var chunkB3FMUFAW_cjs = require('../chunk-B3FMUFAW.cjs');
22
- var chunk2WLXQGWC_cjs = require('../chunk-2WLXQGWC.cjs');
18
+ require('../chunk-JSQEAPTC.cjs');
19
+ var chunkUKT3WH5Z_cjs = require('../chunk-UKT3WH5Z.cjs');
23
20
  var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
24
- var chunkGC2FSPSQ_cjs = require('../chunk-GC2FSPSQ.cjs');
21
+ var chunkWV4TD2HZ_cjs = require('../chunk-WV4TD2HZ.cjs');
22
+ require('../chunk-223D4727.cjs');
23
+ var chunk2WLXQGWC_cjs = require('../chunk-2WLXQGWC.cjs');
24
+ var chunkHDJRSCRE_cjs = require('../chunk-HDJRSCRE.cjs');
25
25
  var chunkXAJIKT6Y_cjs = require('../chunk-XAJIKT6Y.cjs');
26
+ require('../chunk-D54JXTPG.cjs');
27
+ var chunkGOWXP5KT_cjs = require('../chunk-GOWXP5KT.cjs');
26
28
  var chunkQZTNTP75_cjs = require('../chunk-QZTNTP75.cjs');
27
29
  require('../chunk-PCB2BPN3.cjs');
28
30
  require('../chunk-NWNVWO6L.cjs');
29
- var chunkGOWXP5KT_cjs = require('../chunk-GOWXP5KT.cjs');
30
31
  var chunkCROGFB46_cjs = require('../chunk-CROGFB46.cjs');
31
32
  require('../chunk-7G2LJMUG.cjs');
32
- require('../chunk-FAXXN7KI.cjs');
33
33
  var chunkV46W7YLI_cjs = require('../chunk-V46W7YLI.cjs');
34
34
  var chunkLJJJ6CYH_cjs = require('../chunk-LJJJ6CYH.cjs');
35
- require('../chunk-D54JXTPG.cjs');
36
35
  var chunkQT3A4PFC_cjs = require('../chunk-QT3A4PFC.cjs');
37
36
  var chunk4RPBUMHB_cjs = require('../chunk-4RPBUMHB.cjs');
38
37
  var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
39
38
  var chunkRC25WMVB_cjs = require('../chunk-RC25WMVB.cjs');
40
- var chunkYF3QUHKN_cjs = require('../chunk-YF3QUHKN.cjs');
39
+ require('../chunk-FAXXN7KI.cjs');
40
+ var chunkFEGXFABZ_cjs = require('../chunk-FEGXFABZ.cjs');
41
41
  var chunkRFIBUWLF_cjs = require('../chunk-RFIBUWLF.cjs');
42
42
  var chunkYBJ4QGNH_cjs = require('../chunk-YBJ4QGNH.cjs');
43
43
  var chunkOALEDG67_cjs = require('../chunk-OALEDG67.cjs');
44
44
  var chunk2VHYOTWW_cjs = require('../chunk-2VHYOTWW.cjs');
45
45
  require('../chunk-ZW6FPIFC.cjs');
46
+ require('../chunk-AHDJXIUB.cjs');
46
47
  require('../chunk-SIB6C7P7.cjs');
47
48
  require('../chunk-DVUZTGVL.cjs');
48
- require('../chunk-AHDJXIUB.cjs');
49
49
  require('../chunk-3VULDTNL.cjs');
50
50
  var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
51
51
  var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
52
52
  var chunkC2CWWEHO_cjs = require('../chunk-C2CWWEHO.cjs');
53
53
  var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
54
54
  require('../chunk-ADOKTJHV.cjs');
55
- var chunkLLYZGH3L_cjs = require('../chunk-LLYZGH3L.cjs');
56
- var chunkBIXHB4LV_cjs = require('../chunk-BIXHB4LV.cjs');
57
55
  var chunkDWZXSPMB_cjs = require('../chunk-DWZXSPMB.cjs');
58
56
  var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
59
57
  var chunk5A2QQAF5_cjs = require('../chunk-5A2QQAF5.cjs');
@@ -61,11 +59,13 @@ require('../chunk-B6MVQCXW.cjs');
61
59
  var chunkJKB7WT7L_cjs = require('../chunk-JKB7WT7L.cjs');
62
60
  var chunkJSTKEZBS_cjs = require('../chunk-JSTKEZBS.cjs');
63
61
  require('../chunk-76L6LOP3.cjs');
64
- require('../chunk-32HW2Q33.cjs');
65
62
  require('../chunk-7UTB4PHM.cjs');
63
+ require('../chunk-32HW2Q33.cjs');
66
64
  var chunkFX3K6LNZ_cjs = require('../chunk-FX3K6LNZ.cjs');
67
65
  require('../chunk-PPCATBOY.cjs');
68
66
  require('../chunk-MHVNT4J3.cjs');
67
+ var chunkLLYZGH3L_cjs = require('../chunk-LLYZGH3L.cjs');
68
+ var chunkBIXHB4LV_cjs = require('../chunk-BIXHB4LV.cjs');
69
69
  var chunkQ7CQYYZW_cjs = require('../chunk-Q7CQYYZW.cjs');
70
70
  var chunkCNHUJRQ4_cjs = require('../chunk-CNHUJRQ4.cjs');
71
71
  var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
@@ -85,6 +85,8 @@ var client = require('@arbidocs/client');
85
85
  var reactDom = require('react-dom');
86
86
  var zustand = require('zustand');
87
87
  var middleware = require('zustand/middleware');
88
+ var core = require('@dnd-kit/core');
89
+ var reactVirtual = require('@tanstack/react-virtual');
88
90
 
89
91
  function ConnectionBoundWebSocket({ children }) {
90
92
  const { status } = chunkFM3IRQJW_cjs.useConnection();
@@ -162,7 +164,7 @@ function ConnectedWorkspaceActivity({
162
164
  [feed.data]
163
165
  );
164
166
  return /* @__PURE__ */ jsxRuntime.jsx(
165
- chunkGC2FSPSQ_cjs.WorkspaceActivityList,
167
+ chunkHDJRSCRE_cjs.WorkspaceActivityList,
166
168
  {
167
169
  ...listProps,
168
170
  items,
@@ -840,7 +842,7 @@ function ConnectedWorkspaceNotificationMenu({
840
842
  }, [error, notify14]);
841
843
  if (!workspaceId) return null;
842
844
  return /* @__PURE__ */ jsxRuntime.jsx(
843
- chunkGC2FSPSQ_cjs.WorkspaceNotificationMenu,
845
+ chunkHDJRSCRE_cjs.WorkspaceNotificationMenu,
844
846
  {
845
847
  ...menuProps,
846
848
  level,
@@ -859,7 +861,7 @@ function ConnectedThreadFollow({
859
861
  enabled: live
860
862
  });
861
863
  if (!conversationId) return null;
862
- const Control = as === "menu-item" ? chunkGC2FSPSQ_cjs.ThreadFollowMenuItem : chunkGC2FSPSQ_cjs.ThreadFollowButton;
864
+ const Control = as === "menu-item" ? chunkHDJRSCRE_cjs.ThreadFollowMenuItem : chunkHDJRSCRE_cjs.ThreadFollowButton;
863
865
  return /* @__PURE__ */ jsxRuntime.jsx(
864
866
  Control,
865
867
  {
@@ -932,7 +934,7 @@ function ConnectedSkillUpload({ onDone, labels, className }) {
932
934
  onChange: (e) => {
933
935
  const file = e.target.files?.[0];
934
936
  e.target.value = "";
935
- if (file) void add(() => chunkYF3QUHKN_cjs.importSkillFile(file));
937
+ if (file) void add(() => chunkFEGXFABZ_cjs.importSkillFile(file));
936
938
  }
937
939
  }
938
940
  ),
@@ -957,7 +959,7 @@ function ConnectedSkillUpload({ onDone, labels, className }) {
957
959
  className: "space-y-2",
958
960
  onSubmit: (e) => {
959
961
  e.preventDefault();
960
- if (url.trim()) void add(() => chunkYF3QUHKN_cjs.importSkillFromUrl(url));
962
+ if (url.trim()) void add(() => chunkFEGXFABZ_cjs.importSkillFromUrl(url));
961
963
  },
962
964
  children: [
963
965
  /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "skills-add-url", children: l.fromLink }),
@@ -1021,9 +1023,9 @@ function ConnectedSkillsLibrary({
1021
1023
  const [type, setType] = react.useState("all");
1022
1024
  const [view, setView] = react.useState("gallery");
1023
1025
  const [isBusy, setIsBusy] = react.useState(false);
1024
- const all = react.useMemo(() => chunkYF3QUHKN_cjs.buildLibrarySkills(builtins, listings ?? []), [builtins, listings]);
1026
+ const all = react.useMemo(() => chunkFEGXFABZ_cjs.buildLibrarySkills(builtins, listings ?? []), [builtins, listings]);
1025
1027
  const shown = react.useMemo(
1026
- () => chunkYF3QUHKN_cjs.filterLibrarySkills(all, { query, source, type }),
1028
+ () => chunkFEGXFABZ_cjs.filterLibrarySkills(all, { query, source, type }),
1027
1029
  [all, query, source, type]
1028
1030
  );
1029
1031
  const current = all.find((s) => s.slug === selected) ?? null;
@@ -1034,21 +1036,21 @@ function ConnectedSkillsLibrary({
1034
1036
  const count = (s) => all.filter((x) => x.source === s).length;
1035
1037
  const sourceOptions = [
1036
1038
  { id: "all", label: "All", count: all.length },
1037
- { id: "builtin", label: chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS.builtin, count: count("builtin") },
1038
- { id: "mine", label: chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS.mine, count: count("mine") },
1039
- { id: "shared", label: chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS.shared, count: count("shared") }
1039
+ { id: "builtin", label: chunkFEGXFABZ_cjs.SKILL_SOURCE_LABELS.builtin, count: count("builtin") },
1040
+ { id: "mine", label: chunkFEGXFABZ_cjs.SKILL_SOURCE_LABELS.mine, count: count("mine") },
1041
+ { id: "shared", label: chunkFEGXFABZ_cjs.SKILL_SOURCE_LABELS.shared, count: count("shared") }
1040
1042
  ];
1041
1043
  const types = [...new Set(all.map((s) => s.type))];
1042
1044
  const typeOptions = [
1043
1045
  { id: "all", label: "Any kind" },
1044
- ...types.map((t) => ({ id: t, label: chunkYF3QUHKN_cjs.SKILL_TYPE_LABELS[t] ?? t }))
1046
+ ...types.map((t) => ({ id: t, label: chunkFEGXFABZ_cjs.SKILL_TYPE_LABELS[t] ?? t }))
1045
1047
  ];
1046
1048
  const pick = (slug) => {
1047
1049
  setSelected(slug);
1048
1050
  setMode("detail");
1049
1051
  };
1050
1052
  const markdownOf = async (skill) => {
1051
- if (!skill.docExtId) return chunkYF3QUHKN_cjs.workflowToSkillMarkdown(skill.workflow);
1053
+ if (!skill.docExtId) return chunkFEGXFABZ_cjs.workflowToSkillMarkdown(skill.workflow);
1052
1054
  const response = await arbi.documents.download(skill.docExtId);
1053
1055
  if (!response.ok) throw new Error(`Could not read the skill (${response.status})`);
1054
1056
  return response.text();
@@ -1056,7 +1058,7 @@ function ConnectedSkillsLibrary({
1056
1058
  const saveAs = (slug, markdown, shared = false) => upload.mutateAsync([
1057
1059
  {
1058
1060
  folder: `${SKILL_FOLDER}${slug}`,
1059
- fileName: chunkYF3QUHKN_cjs.SKILL_MAIN_FILENAME,
1061
+ fileName: chunkFEGXFABZ_cjs.SKILL_MAIN_FILENAME,
1060
1062
  content: new Blob([markdown], { type: "text/markdown" }),
1061
1063
  shared
1062
1064
  }
@@ -1119,7 +1121,7 @@ function ConnectedSkillsLibrary({
1119
1121
  try {
1120
1122
  documentTools.downloadBlob(
1121
1123
  new Blob([await markdownOf(skill)], { type: "text/markdown" }),
1122
- chunkYF3QUHKN_cjs.SKILL_MAIN_FILENAME
1124
+ chunkFEGXFABZ_cjs.SKILL_MAIN_FILENAME
1123
1125
  );
1124
1126
  } catch (error) {
1125
1127
  notify14(errorText(error, "Could not export the skill"), "error");
@@ -1160,10 +1162,10 @@ function ConnectedSkillsLibrary({
1160
1162
  }
1161
1163
  )
1162
1164
  ] }),
1163
- /* @__PURE__ */ jsxRuntime.jsx(chunkYF3QUHKN_cjs.SkillViewToggle, { value: view, onChange: setView })
1165
+ /* @__PURE__ */ jsxRuntime.jsx(chunkFEGXFABZ_cjs.SkillViewToggle, { value: view, onChange: setView })
1164
1166
  ] }),
1165
1167
  /* @__PURE__ */ jsxRuntime.jsx(
1166
- chunkYF3QUHKN_cjs.SkillFilterChips,
1168
+ chunkFEGXFABZ_cjs.SkillFilterChips,
1167
1169
  {
1168
1170
  label: "Show",
1169
1171
  value: source,
@@ -1172,7 +1174,7 @@ function ConnectedSkillsLibrary({
1172
1174
  }
1173
1175
  ),
1174
1176
  types.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
1175
- chunkYF3QUHKN_cjs.SkillFilterChips,
1177
+ chunkFEGXFABZ_cjs.SkillFilterChips,
1176
1178
  {
1177
1179
  label: "Kind",
1178
1180
  value: type,
@@ -1219,12 +1221,12 @@ function ConnectedSkillsLibrary({
1219
1221
  view === "gallery" ? "grid grid-cols-[repeat(auto-fill,minmax(9.5rem,1fr))]" : "flex flex-col"
1220
1222
  ),
1221
1223
  children: shown.map((skill) => /* @__PURE__ */ jsxRuntime.jsx(
1222
- chunkYF3QUHKN_cjs.SkillTile,
1224
+ chunkFEGXFABZ_cjs.SkillTile,
1223
1225
  {
1224
1226
  name: skill.title,
1225
1227
  testId: `skill-tile-${skill.slug}`,
1226
1228
  description: skill.description,
1227
- sourceLabel: skill.isShared ? `${chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS.mine}, shared` : chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS[skill.source],
1229
+ sourceLabel: skill.isShared ? `${chunkFEGXFABZ_cjs.SKILL_SOURCE_LABELS.mine}, shared` : chunkFEGXFABZ_cjs.SKILL_SOURCE_LABELS[skill.source],
1228
1230
  type: skill.type,
1229
1231
  icon,
1230
1232
  layout: view,
@@ -1259,7 +1261,7 @@ function ConnectedSkillsLibrary({
1259
1261
  }
1260
1262
  ),
1261
1263
  mode === "new" && /* @__PURE__ */ jsxRuntime.jsx(
1262
- chunkYF3QUHKN_cjs.SkillGenerateForm,
1264
+ chunkFEGXFABZ_cjs.SkillGenerateForm,
1263
1265
  {
1264
1266
  icon,
1265
1267
  onGenerate: (desc) => {
@@ -1286,11 +1288,11 @@ function ConnectedSkillsLibrary({
1286
1288
  ),
1287
1289
  mode === "add" && /* @__PURE__ */ jsxRuntime.jsx(ConnectedSkillUpload, { onDone: done }),
1288
1290
  mode === "detail" && current && /* @__PURE__ */ jsxRuntime.jsx(
1289
- chunkYF3QUHKN_cjs.SkillLibraryDetail,
1291
+ chunkFEGXFABZ_cjs.SkillLibraryDetail,
1290
1292
  {
1291
1293
  skill: current,
1292
1294
  icon,
1293
- instructions: current.docExtId ? currentText ? chunkYF3QUHKN_cjs.parseSkillFrontmatter(currentText, chunkYF3QUHKN_cjs.SKILL_MAIN_FILENAME).content : "" : current.workflow.run.kind === "prompt" ? current.workflow.run.promptTemplate : "",
1295
+ instructions: current.docExtId ? currentText ? chunkFEGXFABZ_cjs.parseSkillFrontmatter(currentText, chunkFEGXFABZ_cjs.SKILL_MAIN_FILENAME).content : "" : current.workflow.run.kind === "prompt" ? current.workflow.run.promptTemplate : "",
1294
1296
  isLoading: !!current.docExtId && textLoading,
1295
1297
  actions: {
1296
1298
  onRun: () => onRun(current.slug),
@@ -1325,7 +1327,7 @@ function SkillEditor({
1325
1327
  const [seeded, setSeeded] = react.useState(!isEditing);
1326
1328
  const [nameError, setNameError] = react.useState(null);
1327
1329
  if (isEditing && !seeded && text !== void 0) {
1328
- const parsed = chunkYF3QUHKN_cjs.parseSkillFrontmatter(text, chunkYF3QUHKN_cjs.SKILL_MAIN_FILENAME);
1330
+ const parsed = chunkFEGXFABZ_cjs.parseSkillFrontmatter(text, chunkFEGXFABZ_cjs.SKILL_MAIN_FILENAME);
1329
1331
  setDescription(parsed.description ?? "");
1330
1332
  setBody(parsed.content ?? "");
1331
1333
  setSeeded(true);
@@ -1339,15 +1341,15 @@ function SkillEditor({
1339
1341
  notify14("Add a short description.", "error");
1340
1342
  return;
1341
1343
  }
1342
- const slug = chunkYF3QUHKN_cjs.skillSlug(name);
1344
+ const slug = chunkFEGXFABZ_cjs.skillSlug(name);
1343
1345
  try {
1344
- await onSave(slug, chunkYF3QUHKN_cjs.serializeSkill({ name: slug, description, body }), isEditing);
1346
+ await onSave(slug, chunkFEGXFABZ_cjs.serializeSkill({ name: slug, description, body }), isEditing);
1345
1347
  } catch (err) {
1346
1348
  notify14(errorText(err, "Could not save the skill"), "error");
1347
1349
  }
1348
1350
  };
1349
1351
  return /* @__PURE__ */ jsxRuntime.jsx(
1350
- chunkYF3QUHKN_cjs.SkillEditForm,
1352
+ chunkFEGXFABZ_cjs.SkillEditForm,
1351
1353
  {
1352
1354
  name,
1353
1355
  onNameChange: setName,
@@ -1383,9 +1385,9 @@ function ConnectedAgentCreator({
1383
1385
  agent,
1384
1386
  initialName,
1385
1387
  onSaved,
1386
- capabilities = chunkYF3QUHKN_cjs.DEFAULT_AGENT_CAPABILITIES,
1387
- templates = chunkYF3QUHKN_cjs.DEFAULT_AGENT_TEMPLATES,
1388
- types = chunkYF3QUHKN_cjs.DEFAULT_AGENT_TYPES,
1388
+ capabilities = chunkFEGXFABZ_cjs.DEFAULT_AGENT_CAPABILITIES,
1389
+ templates = chunkFEGXFABZ_cjs.DEFAULT_AGENT_TEMPLATES,
1390
+ types = chunkFEGXFABZ_cjs.DEFAULT_AGENT_TYPES,
1389
1391
  canRevokeWorkspaces = false,
1390
1392
  labels
1391
1393
  }) {
@@ -1427,7 +1429,7 @@ function ConnectedAgentCreator({
1427
1429
  const initialValues = react.useMemo(
1428
1430
  () => ({
1429
1431
  name: agent?.given_name ?? initialName ?? "",
1430
- persona: isEdit ? chunkYF3QUHKN_cjs.stripPersonaPreamble(String(agents.PERSONA ?? "")) : "",
1432
+ persona: isEdit ? chunkFEGXFABZ_cjs.stripPersonaPreamble(String(agents.PERSONA ?? "")) : "",
1431
1433
  modelName: String(agents.AGENT_MODEL_NAME ?? ""),
1432
1434
  capabilities: Object.fromEntries(capabilities.map(({ key }) => [key, Boolean(agents[key])])),
1433
1435
  type: "builtin",
@@ -1446,7 +1448,7 @@ function ConnectedAgentCreator({
1446
1448
  try {
1447
1449
  let agentExtId = agent?.external_id ?? early?.id ?? "";
1448
1450
  if (!agentExtId) {
1449
- if (!chunkYF3QUHKN_cjs.isValidAgentName(values.name)) {
1451
+ if (!chunkFEGXFABZ_cjs.isValidAgentName(values.name)) {
1450
1452
  notify14("Give the agent a name first.", "error");
1451
1453
  return;
1452
1454
  }
@@ -1482,7 +1484,7 @@ function ConnectedAgentCreator({
1482
1484
  title: `agent-${name}`,
1483
1485
  sections: {
1484
1486
  Agents: {
1485
- PERSONA: chunkYF3QUHKN_cjs.composePersona(name, values.persona),
1487
+ PERSONA: chunkFEGXFABZ_cjs.composePersona(name, values.persona),
1486
1488
  ...values.modelName ? { AGENT_MODEL_NAME: values.modelName } : {},
1487
1489
  ...Object.fromEntries(capabilities.map(({ key }) => [key, !!values.capabilities[key]])),
1488
1490
  ENABLED_SKILLS: values.capabilities.SKILLS_ENABLED && skills.length ? skills : null,
@@ -1505,7 +1507,7 @@ function ConnectedAgentCreator({
1505
1507
  };
1506
1508
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1507
1509
  /* @__PURE__ */ jsxRuntime.jsx(
1508
- chunkYF3QUHKN_cjs.AgentCreator,
1510
+ chunkFEGXFABZ_cjs.AgentCreator,
1509
1511
  {
1510
1512
  open: ready,
1511
1513
  onOpenChange,
@@ -1521,11 +1523,11 @@ function ConnectedAgentCreator({
1521
1523
  ) : void 0,
1522
1524
  revokingWorkspaceId: revokeAccess.isPending ? revokeAccess.variables?.workspaceId : void 0,
1523
1525
  avatar: (values) => /* @__PURE__ */ jsxRuntime.jsx(
1524
- chunkYF3QUHKN_cjs.AgentAvatarField,
1526
+ chunkFEGXFABZ_cjs.AgentAvatarField,
1525
1527
  {
1526
1528
  picture,
1527
1529
  isBusy: avatarBusy,
1528
- canGenerate: isEdit || chunkYF3QUHKN_cjs.isValidAgentName(values.name),
1530
+ canGenerate: isEdit || chunkFEGXFABZ_cjs.isValidAgentName(values.name),
1529
1531
  onGenerate: () => handleGenerateAvatar(values)
1530
1532
  }
1531
1533
  ),
@@ -1577,7 +1579,7 @@ function ConnectedAgentCreator({
1577
1579
  /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Connect your agent" }),
1578
1580
  /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "This key is shown once. Run the script on the machine that will host the agent." })
1579
1581
  ] }),
1580
- connect && /* @__PURE__ */ jsxRuntime.jsx(chunkYF3QUHKN_cjs.AgentConnectInstructions, { email: connect.email, signingKey: connect.signingKey })
1582
+ connect && /* @__PURE__ */ jsxRuntime.jsx(chunkFEGXFABZ_cjs.AgentConnectInstructions, { email: connect.email, signingKey: connect.signingKey })
1581
1583
  ]
1582
1584
  }
1583
1585
  ) })
@@ -1614,7 +1616,7 @@ function ConnectedWorkflowHistory({
1614
1616
  const { openConversation } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
1615
1617
  const { data: runs = [], isLoading } = react$1.useWorkflowRuns(workflow?.external_id);
1616
1618
  return /* @__PURE__ */ jsxRuntime.jsx(
1617
- chunkYF3QUHKN_cjs.TaskRunsDialog,
1619
+ chunkFEGXFABZ_cjs.TaskRunsDialog,
1618
1620
  {
1619
1621
  inline,
1620
1622
  hideHeader,
@@ -1650,7 +1652,7 @@ function ConnectedTaskActivityDialog({
1650
1652
  const activity = react$1.useConversationActivity(conversationId, { live });
1651
1653
  const { data: agents = [] } = react$1.useAgents();
1652
1654
  const { userId } = chunkFM3IRQJW_cjs.useConnectedWorkspace();
1653
- const { members } = chunkCQCNU5KT_cjs.useConnectedWorkspaceRole();
1655
+ const { members } = chunkIJEISII2_cjs.useConnectedWorkspaceRole();
1654
1656
  const renderPerson = react.useCallback(
1655
1657
  (id) => {
1656
1658
  const isMe = !!id && id === userId;
@@ -1666,7 +1668,7 @@ function ConnectedTaskActivityDialog({
1666
1668
  [agents]
1667
1669
  );
1668
1670
  return /* @__PURE__ */ jsxRuntime.jsx(
1669
- chunkYF3QUHKN_cjs.TaskActivityDialog,
1671
+ chunkFEGXFABZ_cjs.TaskActivityDialog,
1670
1672
  {
1671
1673
  open: true,
1672
1674
  onOpenChange: (open) => !open && onClose(),
@@ -1812,7 +1814,7 @@ function useWorkflowThread(workflow, options2 = {}) {
1812
1814
  );
1813
1815
  const conversation = conversations.data?.find((c) => c.external_id === threadId);
1814
1816
  const steps = react.useMemo(
1815
- () => chunkJSTKEZBS_cjs.workflowSteps(workflow).length > 0 ? chunkJSTKEZBS_cjs.workflowSteps(workflow) : chunkYF3QUHKN_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
1817
+ () => chunkJSTKEZBS_cjs.workflowSteps(workflow).length > 0 ? chunkJSTKEZBS_cjs.workflowSteps(workflow) : chunkFEGXFABZ_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
1816
1818
  [workflow, conversation?.plan?.steps]
1817
1819
  );
1818
1820
  const activity = react$1.useConversationActivity(threadId, { live: !!threadId });
@@ -1872,7 +1874,7 @@ function useWorkflowThread(workflow, options2 = {}) {
1872
1874
  criteria: [],
1873
1875
  max_passes: 3,
1874
1876
  documents: [],
1875
- steps: chunkYF3QUHKN_cjs.toPlanSteps(workflow, {
1877
+ steps: chunkFEGXFABZ_cjs.toPlanSteps(workflow, {
1876
1878
  inputs: values,
1877
1879
  resolveWorkflow: options2.resolveWorkflow,
1878
1880
  compose: options2.compose
@@ -1959,7 +1961,7 @@ function useWorkflowThread(workflow, options2 = {}) {
1959
1961
  const anyRunning = Object.values(states).some((s) => s.status === "running");
1960
1962
  const needsStart = !threadId || idle && !anyRunning;
1961
1963
  const runError = idle ? conversation?.last_error ?? null : null;
1962
- const view = chunkYF3QUHKN_cjs.useWorkflowView({
1964
+ const view = chunkFEGXFABZ_cjs.useWorkflowView({
1963
1965
  steps,
1964
1966
  states,
1965
1967
  inputs,
@@ -2127,7 +2129,7 @@ function WorkflowWordDialog({
2127
2129
  title: title ?? labels.wordTitle,
2128
2130
  size: "xl",
2129
2131
  testId: "workflow-word-dialog",
2130
- children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkCQCNU5KT_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
2132
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkIJEISII2_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
2131
2133
  }
2132
2134
  );
2133
2135
  }
@@ -2436,7 +2438,7 @@ function ConnectedWorkflowRunner({
2436
2438
  );
2437
2439
  };
2438
2440
  const runner = (compact) => /* @__PURE__ */ jsxRuntime.jsx(
2439
- chunkYF3QUHKN_cjs.WorkflowRunner,
2441
+ chunkFEGXFABZ_cjs.WorkflowRunner,
2440
2442
  {
2441
2443
  people,
2442
2444
  ...runnerProps,
@@ -2482,7 +2484,7 @@ function ConnectedWorkflowRunner({
2482
2484
  ) }),
2483
2485
  inThread && conversationId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2484
2486
  /* @__PURE__ */ jsxRuntime.jsx(
2485
- chunkYF3QUHKN_cjs.WorkflowStepBar,
2487
+ chunkFEGXFABZ_cjs.WorkflowStepBar,
2486
2488
  {
2487
2489
  run: view,
2488
2490
  levels: chunkJSTKEZBS_cjs.stepLevels(view.steps),
@@ -2773,7 +2775,7 @@ function ConnectedTagTable({
2773
2775
  const fail = (fallback) => (e) => notify14(browser.refusalReason(e, fallback), "error");
2774
2776
  const snapshot2 = (data) => {
2775
2777
  const title = exportTitle ?? ui.tagKindTitle(kind, { plural: true });
2776
- const bytes = chunkGC2FSPSQ_cjs.tagTableDocx(data, {
2778
+ const bytes = chunkHDJRSCRE_cjs.tagTableDocx(data, {
2777
2779
  title,
2778
2780
  nameOf: (id) => people.find((p) => p.value === id)?.label
2779
2781
  });
@@ -2782,7 +2784,7 @@ function ConnectedTagTable({
2782
2784
  return { blob: new Blob([bytes], { type: chunkQT3A4PFC_cjs.DOCX_MIME_TYPE }), name };
2783
2785
  };
2784
2786
  return /* @__PURE__ */ jsxRuntime.jsx(
2785
- chunkGC2FSPSQ_cjs.TagTable,
2787
+ chunkHDJRSCRE_cjs.TagTable,
2786
2788
  {
2787
2789
  ...props,
2788
2790
  table,
@@ -2823,7 +2825,7 @@ function DocTagPassages({ docId, tagId, label, docOf, testId }) {
2823
2825
  const [open, setOpen] = react.useState(false);
2824
2826
  const doctag = docOf(docId)?.doctags?.find((dt) => dt.tag_ext_id === tagId);
2825
2827
  const citations = react.useMemo(
2826
- () => chunkB3FMUFAW_cjs.toFactCitations(doctag?.citations) ?? [],
2828
+ () => chunkUKT3WH5Z_cjs.toFactCitations(doctag?.citations) ?? [],
2827
2829
  [doctag?.citations]
2828
2830
  );
2829
2831
  const { quoteFor, orderOf } = react$1.usePassageQuotes(
@@ -2832,7 +2834,7 @@ function DocTagPassages({ docId, tagId, label, docOf, testId }) {
2832
2834
  const { openDocument } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
2833
2835
  const viewingPassageId = react$1.useArbiSessionState((s) => s.viewingDocument?.passageId ?? null);
2834
2836
  const id = testId ?? `doctag-passages-${docId}`;
2835
- const refOf = (cited) => chunkB3FMUFAW_cjs.citedVersionRef(cited.doc_ext_id, cited.version, docOf(cited.doc_ext_id)?.current_version);
2837
+ const refOf = (cited) => chunkUKT3WH5Z_cjs.citedVersionRef(cited.doc_ext_id, cited.version, docOf(cited.doc_ext_id)?.current_version);
2836
2838
  const ordered = (cited) => [...cited.chunks].sort((a, b) => {
2837
2839
  const oa = orderOf(a.chunk_id);
2838
2840
  const ob = orderOf(b.chunk_id);
@@ -2863,7 +2865,7 @@ function DocTagPassages({ docId, tagId, label, docOf, testId }) {
2863
2865
  const doc = docOf(cited.doc_ext_id);
2864
2866
  const passages = ordered(cited);
2865
2867
  return /* @__PURE__ */ jsxRuntime.jsx(
2866
- chunkB3FMUFAW_cjs.FactSourceGroup,
2868
+ chunkUKT3WH5Z_cjs.FactSourceGroup,
2867
2869
  {
2868
2870
  docId: cited.doc_ext_id,
2869
2871
  hasPassages: passages.length > 0,
@@ -2920,9 +2922,9 @@ function GlossaryExport({ labelId, nameOf }) {
2920
2922
  const narrowed = agreements.find((a) => a.id === narrowTo);
2921
2923
  const title = narrowed ? `Glossary - ${narrowed.name}` : "Glossary";
2922
2924
  const download = (format) => {
2923
- const entries = chunkGC2FSPSQ_cjs.glossaryEntries(sources, { labelId: narrowed?.id });
2924
- const blob = format === "docx" ? new Blob([chunkGC2FSPSQ_cjs.glossaryDocx(entries, { title })], { type: chunkQT3A4PFC_cjs.DOCX_MIME_TYPE }) : new Blob([chunkGC2FSPSQ_cjs.glossaryMarkdown(entries, { title })], { type: "text/markdown" });
2925
- documentTools.downloadBlob(blob, chunkGC2FSPSQ_cjs.glossaryFileName(title, format));
2925
+ const entries = chunkHDJRSCRE_cjs.glossaryEntries(sources, { labelId: narrowed?.id });
2926
+ const blob = format === "docx" ? new Blob([chunkHDJRSCRE_cjs.glossaryDocx(entries, { title })], { type: chunkQT3A4PFC_cjs.DOCX_MIME_TYPE }) : new Blob([chunkHDJRSCRE_cjs.glossaryMarkdown(entries, { title })], { type: "text/markdown" });
2927
+ documentTools.downloadBlob(blob, chunkHDJRSCRE_cjs.glossaryFileName(title, format));
2926
2928
  };
2927
2929
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", "data-testid": "tags-glossary", children: [
2928
2930
  agreements.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3141,7 +3143,7 @@ function KindSection({
3141
3143
  {
3142
3144
  testId: `tags-kind-${kind}`,
3143
3145
  title: ui.tagKindTitle(kind, { plural: true }),
3144
- description: chunkGC2FSPSQ_cjs.tagKindDescription(kind),
3146
+ description: chunkHDJRSCRE_cjs.tagKindDescription(kind),
3145
3147
  actions: picker,
3146
3148
  children: [
3147
3149
  browser.isEntityTag({ kind }) && extractingCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3152,9 +3154,9 @@ function KindSection({
3152
3154
  children: [
3153
3155
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
3154
3156
  "Extracting ",
3155
- chunkGC2FSPSQ_cjs.entitiesPhrase().toLowerCase(),
3157
+ chunkHDJRSCRE_cjs.entitiesPhrase().toLowerCase(),
3156
3158
  " from ",
3157
- chunkGC2FSPSQ_cjs.documentCount(extractingCount),
3159
+ chunkHDJRSCRE_cjs.documentCount(extractingCount),
3158
3160
  "\u2026"
3159
3161
  ]
3160
3162
  }
@@ -3172,7 +3174,7 @@ function KindSection({
3172
3174
  onOpenDocument: (id) => openDocument(id),
3173
3175
  onOpenFact: ctx.onOpenFact,
3174
3176
  onOpenThread: (id) => openConversation(id),
3175
- labels: chunkGC2FSPSQ_cjs.tagTableLabels(kind),
3177
+ labels: chunkHDJRSCRE_cjs.tagTableLabels(kind),
3176
3178
  testId: `tags-table-${kind}`
3177
3179
  }
3178
3180
  )
@@ -3274,12 +3276,12 @@ function TagSection({
3274
3276
  onOpenDocument: (id) => openDocument(id),
3275
3277
  onOpenFact: ctx.onOpenFact,
3276
3278
  onOpenThread: (id) => openConversation(id),
3277
- labels: chunkGC2FSPSQ_cjs.tagTableLabels(tag.kind),
3279
+ labels: chunkHDJRSCRE_cjs.tagTableLabels(tag.kind),
3278
3280
  testId: "tags-rows"
3279
3281
  }
3280
3282
  ),
3281
3283
  /* @__PURE__ */ jsxRuntime.jsx(
3282
- chunkGC2FSPSQ_cjs.TagDetail,
3284
+ chunkHDJRSCRE_cjs.TagDetail,
3283
3285
  {
3284
3286
  row: detailRow && narrowTagRow(detailRow, ctx.filter.matches),
3285
3287
  fields: schema.data?.fields ?? [],
@@ -3291,10 +3293,10 @@ function TagSection({
3291
3293
  onOpenDocument: (id) => openDocument(id),
3292
3294
  onOpenFact: ctx.onOpenFact,
3293
3295
  onOpenThread: (id) => openConversation(id),
3294
- noteLabel: chunkGC2FSPSQ_cjs.tagNoteLabel(tag.kind),
3296
+ noteLabel: chunkHDJRSCRE_cjs.tagNoteLabel(tag.kind),
3295
3297
  noteIsValue: tag.kind === "annotation",
3296
3298
  renderPassages: (d, label) => renderPassages(d.doc_ext_id, label),
3297
- labels: chunkGC2FSPSQ_cjs.tagDetailLabels(),
3299
+ labels: chunkHDJRSCRE_cjs.tagDetailLabels(),
3298
3300
  testId: "tags-detail"
3299
3301
  }
3300
3302
  )
@@ -3383,7 +3385,7 @@ function ConnectedTagsPage({
3383
3385
  const onDelete = async (t) => {
3384
3386
  const nested = browser.getChildTags([...tags], t.external_id);
3385
3387
  const uses = browser.tagUseCount(t);
3386
- const n2 = chunkGC2FSPSQ_cjs.tagsPageNouns();
3388
+ const n2 = chunkHDJRSCRE_cjs.tagsPageNouns();
3387
3389
  const tagNoun = (count) => (count === 1 ? n2.tag : n2.tags).toLowerCase();
3388
3390
  const carriers = uses === 1 ? `${n2.document}, ${n2.fact} or ${n2.thread}` : `${n2.documents}, ${n2.facts} and ${n2.threads}`;
3389
3391
  const message = `Delete ${ui.tagKindNouns(t.kind).singular} "${t.name}"?` + (uses > 0 ? `
@@ -3404,16 +3406,16 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
3404
3406
  try {
3405
3407
  await extract.mutateAsync(docIds);
3406
3408
  notify14(
3407
- `Extracting ${chunkGC2FSPSQ_cjs.entitiesPhrase().toLowerCase()} from ${chunkGC2FSPSQ_cjs.documentCount(docIds.length)}. You will be notified when it is done.`,
3409
+ `Extracting ${chunkHDJRSCRE_cjs.entitiesPhrase().toLowerCase()} from ${chunkHDJRSCRE_cjs.documentCount(docIds.length)}. You will be notified when it is done.`,
3408
3410
  "info"
3409
3411
  );
3410
3412
  } catch (error) {
3411
- notify14(browser.refusalReason(error, `Could not extract ${chunkGC2FSPSQ_cjs.entitiesPhrase().toLowerCase()}`), "error");
3413
+ notify14(browser.refusalReason(error, `Could not extract ${chunkHDJRSCRE_cjs.entitiesPhrase().toLowerCase()}`), "error");
3412
3414
  throw error;
3413
3415
  }
3414
3416
  };
3415
3417
  const picker = /* @__PURE__ */ jsxRuntime.jsx(
3416
- chunkGC2FSPSQ_cjs.TagPicker,
3418
+ chunkHDJRSCRE_cjs.TagPicker,
3417
3419
  {
3418
3420
  tags: viewTags,
3419
3421
  selectedId: tag?.external_id,
@@ -3427,10 +3429,10 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
3427
3429
  onOpenTag: openTag,
3428
3430
  onOpenFact
3429
3431
  };
3430
- const n = chunkGC2FSPSQ_cjs.tagsPageNouns();
3432
+ const n = chunkHDJRSCRE_cjs.tagsPageNouns();
3431
3433
  const action = view === "person" || view === "organisation" ? {
3432
3434
  label: "Extract",
3433
- title: `Extract ${chunkGC2FSPSQ_cjs.entitiesPhrase().toLowerCase()} from ${n.documents.toLowerCase()}`,
3435
+ title: `Extract ${chunkHDJRSCRE_cjs.entitiesPhrase().toLowerCase()} from ${n.documents.toLowerCase()}`,
3434
3436
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "h-4 w-4" }),
3435
3437
  run: () => setExtracting(true),
3436
3438
  testId: "tags-extract-entities"
@@ -3470,7 +3472,7 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
3470
3472
  onTabChange: () => {
3471
3473
  },
3472
3474
  variant: "underline",
3473
- firstTabContent: /* @__PURE__ */ jsxRuntime.jsx(chunkYAEXSCUW_cjs.FilesFilterBar, { className: "flex-none", "data-testid": "tags-header-actions", children: /* @__PURE__ */ jsxRuntime.jsx(
3475
+ firstTabContent: /* @__PURE__ */ jsxRuntime.jsx(chunkWV4TD2HZ_cjs.FilesFilterBar, { className: "flex-none", "data-testid": "tags-header-actions", children: /* @__PURE__ */ jsxRuntime.jsx(
3474
3476
  chunk2EI7NCUA_cjs.FilterInput,
3475
3477
  {
3476
3478
  value: filterText,
@@ -3498,7 +3500,7 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
3498
3500
  )
3499
3501
  }
3500
3502
  ) }),
3501
- centerContent: /* @__PURE__ */ jsxRuntime.jsx(chunkYAEXSCUW_cjs.FilesViewCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(
3503
+ centerContent: /* @__PURE__ */ jsxRuntime.jsx(chunkWV4TD2HZ_cjs.FilesViewCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(
3502
3504
  chunk2WLXQGWC_cjs.ViewToggle,
3503
3505
  {
3504
3506
  options: browser.TAG_KINDS.map((k) => ({
@@ -3577,7 +3579,7 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
3577
3579
  onCreated: openTag
3578
3580
  }),
3579
3581
  /* @__PURE__ */ jsxRuntime.jsx(
3580
- chunkGC2FSPSQ_cjs.ExtractEntitiesDialog,
3582
+ chunkHDJRSCRE_cjs.ExtractEntitiesDialog,
3581
3583
  {
3582
3584
  open: extracting,
3583
3585
  onOpenChange: setExtracting,
@@ -3638,7 +3640,7 @@ function FactSourcesPopover({
3638
3640
  reset();
3639
3641
  }
3640
3642
  };
3641
- const refOf = (docId) => chunkB3FMUFAW_cjs.citedVersionRef(
3643
+ const refOf = (docId) => chunkUKT3WH5Z_cjs.citedVersionRef(
3642
3644
  docId,
3643
3645
  citations.find((d) => d.doc_ext_id === docId)?.version,
3644
3646
  citedDocs?.[docId]?.current_version
@@ -3668,7 +3670,7 @@ function FactSourcesPopover({
3668
3670
  const olderVersion = refOf(docId) !== docId ? refOf(docId).split("@v")[1] : null;
3669
3671
  const cited = passagesOf(docId);
3670
3672
  return /* @__PURE__ */ jsxRuntime.jsx(
3671
- chunkB3FMUFAW_cjs.FactSourceGroup,
3673
+ chunkUKT3WH5Z_cjs.FactSourceGroup,
3672
3674
  {
3673
3675
  docId,
3674
3676
  isViewing,
@@ -3737,8 +3739,8 @@ function FactMarkdownEditor({
3737
3739
  citationContainer,
3738
3740
  "data-testid": dataTestId
3739
3741
  }) {
3740
- const sources = react.useMemo(() => chunkB3FMUFAW_cjs.toFactCitations(citations) ?? [], [citations]);
3741
- const docIds = chunkB3FMUFAW_cjs.docIdsOf(sources);
3742
+ const sources = react.useMemo(() => chunkUKT3WH5Z_cjs.toFactCitations(citations) ?? [], [citations]);
3743
+ const docIds = chunkUKT3WH5Z_cjs.docIdsOf(sources);
3742
3744
  const hasSources = docIds.length > 0;
3743
3745
  const { quoteFor, orderOf } = react$1.usePassageQuotes(
3744
3746
  react.useMemo(() => sources.filter((d) => d.chunks.length > 0).map((d) => d.doc_ext_id), [sources])
@@ -3757,7 +3759,7 @@ function FactMarkdownEditor({
3757
3759
  const editorRef = react.useRef(null);
3758
3760
  react.useEffect(() => {
3759
3761
  if (!editorRef.current) return;
3760
- return chunkB3FMUFAW_cjs.enableFactTableColumnResize(editorRef.current);
3762
+ return chunkUKT3WH5Z_cjs.enableFactTableColumnResize(editorRef.current);
3761
3763
  }, []);
3762
3764
  react.useEffect(() => {
3763
3765
  if (!editing) return;
@@ -3772,14 +3774,14 @@ function FactMarkdownEditor({
3772
3774
  return () => document.removeEventListener("pointerdown", onPointerDown, true);
3773
3775
  }, [editing]);
3774
3776
  const removeDoc = (docExtId) => {
3775
- const remaining = chunkB3FMUFAW_cjs.withoutDoc(sources, docExtId);
3777
+ const remaining = chunkUKT3WH5Z_cjs.withoutDoc(sources, docExtId);
3776
3778
  if (!remaining) setSourcesOpen(false);
3777
3779
  onChange(value, remaining);
3778
3780
  };
3779
3781
  const citeDocument = (docExtId) => onCiteDocument(docExtId, { toggle: false });
3780
3782
  const handleToggleDoc = (docExtId) => {
3781
3783
  if (docIds.includes(docExtId)) removeDoc(docExtId);
3782
- else onChange(value, chunkB3FMUFAW_cjs.withDoc(sources, docExtId));
3784
+ else onChange(value, chunkUKT3WH5Z_cjs.withDoc(sources, docExtId));
3783
3785
  };
3784
3786
  const expandToggle = /* @__PURE__ */ jsxRuntime.jsx(
3785
3787
  "button",
@@ -3998,7 +4000,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
3998
4000
  const [composing, setComposing] = react.useState(false);
3999
4001
  const [draft, setDraft] = react.useState("");
4000
4002
  const [baselineText, setBaselineText] = react.useState("");
4001
- const [draftDateFields, setDraftDateFields] = react.useState(chunkB3FMUFAW_cjs.EMPTY_FACT_DATE_FIELDS);
4003
+ const [draftDateFields, setDraftDateFields] = react.useState(chunkUKT3WH5Z_cjs.EMPTY_FACT_DATE_FIELDS);
4002
4004
  const [composerError, setComposerError] = react.useState(null);
4003
4005
  const [editingId, setEditingId] = react.useState(null);
4004
4006
  const [draftShared, setDraftShared] = react.useState(false);
@@ -4055,9 +4057,9 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
4055
4057
  if (!collector || !picked?.length || !collectingFor || !docBeingCollected) return;
4056
4058
  const docExtId = docBeingCollected;
4057
4059
  const apply = (prev) => {
4058
- let next = chunkB3FMUFAW_cjs.toFactCitations(prev);
4060
+ let next = chunkUKT3WH5Z_cjs.toFactCitations(prev);
4059
4061
  for (const pending of picked) {
4060
- next = chunkB3FMUFAW_cjs.withChunk(next, docExtId, { chunk_id: pending.chunk_id, page: pending.page ?? null });
4062
+ next = chunkUKT3WH5Z_cjs.withChunk(next, docExtId, { chunk_id: pending.chunk_id, page: pending.page ?? null });
4061
4063
  }
4062
4064
  return next ?? [];
4063
4065
  };
@@ -4068,8 +4070,8 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
4068
4070
  react.useEffect(() => {
4069
4071
  if (!collector || !unpicked?.length || !collectingFor) return;
4070
4072
  setDraftCitations((prev) => {
4071
- let next = chunkB3FMUFAW_cjs.toFactCitations(prev);
4072
- for (const chunkId of unpicked) next = chunkB3FMUFAW_cjs.withoutChunk(next, chunkId);
4073
+ let next = chunkUKT3WH5Z_cjs.toFactCitations(prev);
4074
+ for (const chunkId of unpicked) next = chunkUKT3WH5Z_cjs.withoutChunk(next, chunkId);
4073
4075
  return next;
4074
4076
  });
4075
4077
  collector.consumeUnpicked();
@@ -4079,7 +4081,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
4079
4081
  setBaselineText("");
4080
4082
  setDraftCitations(null);
4081
4083
  setDraftTagIds([]);
4082
- setDraftDateFields(chunkB3FMUFAW_cjs.EMPTY_FACT_DATE_FIELDS);
4084
+ setDraftDateFields(chunkUKT3WH5Z_cjs.EMPTY_FACT_DATE_FIELDS);
4083
4085
  setDraftShared(false);
4084
4086
  setDraftConfirmed(true);
4085
4087
  setComposerError(null);
@@ -4093,7 +4095,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
4093
4095
  setBaselineText("");
4094
4096
  setDraftCitations(null);
4095
4097
  setDraftTagIds([]);
4096
- setDraftDateFields(chunkB3FMUFAW_cjs.EMPTY_FACT_DATE_FIELDS);
4098
+ setDraftDateFields(chunkUKT3WH5Z_cjs.EMPTY_FACT_DATE_FIELDS);
4097
4099
  setDraftShared(false);
4098
4100
  setDraftConfirmed(true);
4099
4101
  setComposerError(null);
@@ -4104,7 +4106,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
4104
4106
  const content = chunkRC25WMVB_cjs.decodeWhitespaceEntities(draft).trim();
4105
4107
  if (!content) return;
4106
4108
  setComposerError(null);
4107
- const span = chunkB3FMUFAW_cjs.factDateFieldsToSpan(draftDateFields);
4109
+ const span = chunkUKT3WH5Z_cjs.factDateFieldsToSpan(draftDateFields);
4108
4110
  try {
4109
4111
  let saved;
4110
4112
  if (editingId) {
@@ -4142,7 +4144,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
4142
4144
  setBaselineText(draft);
4143
4145
  setDraftCitations(saved.citations ?? null);
4144
4146
  setDraftTagIds(saved.tags.map((t) => t.tag_ext_id));
4145
- setDraftDateFields(chunkB3FMUFAW_cjs.factDateSpanToFields(saved.date_start, saved.date_end, saved.timezone));
4147
+ setDraftDateFields(chunkUKT3WH5Z_cjs.factDateSpanToFields(saved.date_start, saved.date_end, saved.timezone));
4146
4148
  setDraftShared(saved.shared ?? false);
4147
4149
  setDraftConfirmed(saved.confirmed ?? true);
4148
4150
  }
@@ -4167,7 +4169,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
4167
4169
  setBaselineText(m.text);
4168
4170
  setDraftCitations(m.citations ?? null);
4169
4171
  setDraftTagIds(m.tags.map((t) => t.tag_ext_id));
4170
- setDraftDateFields(chunkB3FMUFAW_cjs.factDateSpanToFields(m.date_start, m.date_end, m.timezone));
4172
+ setDraftDateFields(chunkUKT3WH5Z_cjs.factDateSpanToFields(m.date_start, m.date_end, m.timezone));
4171
4173
  setDraftShared(m.shared ?? false);
4172
4174
  setDraftConfirmed(m.confirmed ?? true);
4173
4175
  setComposerError(null);
@@ -4181,7 +4183,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
4181
4183
  const textChanged = draft.trim() !== baselineText.trim();
4182
4184
  const citationsChanged = JSON.stringify(draftCitations ?? null) !== JSON.stringify(f.citations ?? null);
4183
4185
  const tagsChanged = JSON.stringify([...draftTagIds].sort()) !== JSON.stringify(f.tags.map((t) => t.tag_ext_id).sort());
4184
- const dateChanged = JSON.stringify(draftDateFields) !== JSON.stringify(chunkB3FMUFAW_cjs.factDateSpanToFields(f.date_start, f.date_end, f.timezone));
4186
+ const dateChanged = JSON.stringify(draftDateFields) !== JSON.stringify(chunkUKT3WH5Z_cjs.factDateSpanToFields(f.date_start, f.date_end, f.timezone));
4185
4187
  const sharedChanged = draftShared !== (f.shared ?? false);
4186
4188
  const confirmedChanged = draftConfirmed !== (f.confirmed ?? true);
4187
4189
  return textChanged || citationsChanged || tagsChanged || dateChanged || sharedChanged || confirmedChanged;
@@ -4355,8 +4357,8 @@ function useFactFilters(notes, view, chat) {
4355
4357
  const makeTagPicker = react.useCallback(
4356
4358
  (selected, setSelected, opts) => {
4357
4359
  const applied = new Set(selected);
4358
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactFieldRow, { label: "Labels", children: /* @__PURE__ */ jsxRuntime.jsx(
4359
- chunkYAEXSCUW_cjs.FieldLabelsSelect,
4360
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkUKT3WH5Z_cjs.FactFieldRow, { label: "Labels", children: /* @__PURE__ */ jsxRuntime.jsx(
4361
+ chunkWV4TD2HZ_cjs.FieldLabelsSelect,
4360
4362
  {
4361
4363
  options: labelOptions,
4362
4364
  appliedIds: applied,
@@ -4546,14 +4548,14 @@ function useFactSelection(notes, gridApiRef, setFactTags, chat) {
4546
4548
  }
4547
4549
  function renderSourcesCell(params) {
4548
4550
  const fact = params.data;
4549
- const count = chunkB3FMUFAW_cjs.sourceDocCount(fact);
4551
+ const count = chunkUKT3WH5Z_cjs.sourceDocCount(fact);
4550
4552
  if (!fact || count === 0) return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/40", children: "\u2014" });
4551
4553
  return /* @__PURE__ */ jsxRuntime.jsxs(
4552
4554
  "button",
4553
4555
  {
4554
4556
  type: "button",
4555
4557
  onClick: () => params.context?.openEdit?.(fact),
4556
- title: chunkB3FMUFAW_cjs.DEFAULT_FACT_COLUMN_LABELS.sourcedFrom(count),
4558
+ title: chunkUKT3WH5Z_cjs.DEFAULT_FACT_COLUMN_LABELS.sourcedFrom(count),
4557
4559
  "data-testid": `facts-grid-sources-${fact.external_id}`,
4558
4560
  className: "inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",
4559
4561
  children: [
@@ -4582,7 +4584,7 @@ var FactHeader = react.memo(function FactHeader2({
4582
4584
  if (params.enableSorting) params.progressSort(e.shiftKey);
4583
4585
  },
4584
4586
  children: [
4585
- /* @__PURE__ */ jsxRuntime.jsx(chunkYAEXSCUW_cjs.FilterButton, { params, colId }),
4587
+ /* @__PURE__ */ jsxRuntime.jsx(chunkWV4TD2HZ_cjs.FilterButton, { params, colId }),
4586
4588
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "order-2 min-w-0 flex-1 truncate", children: params.displayName }),
4587
4589
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ag-sort-indicator-container order-2 flex-shrink-0", "aria-hidden": "true", children: [
4588
4590
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -4610,14 +4612,14 @@ function createFactPageColumns({
4610
4612
  onToggleConfirmed,
4611
4613
  onToggleShared
4612
4614
  }) {
4613
- const columns = chunkB3FMUFAW_cjs.createFactColumns({
4615
+ const columns = chunkUKT3WH5Z_cjs.createFactColumns({
4614
4616
  onToggleInChat,
4615
4617
  isInChat,
4616
4618
  renderHeader: (params, colId) => /* @__PURE__ */ jsxRuntime.jsx(FactHeader, { params, colId }),
4617
4619
  renderRowActions: (fact, params) => {
4618
4620
  const ctx = params.context;
4619
4621
  return /* @__PURE__ */ jsxRuntime.jsx(
4620
- chunkB3FMUFAW_cjs.FactRowActions,
4622
+ chunkUKT3WH5Z_cjs.FactRowActions,
4621
4623
  {
4622
4624
  onEdit: () => ctx?.openEdit?.(fact),
4623
4625
  canEdit: ctx?.canRewrite?.(fact) !== false,
@@ -4747,7 +4749,7 @@ function useFactsGrid({
4747
4749
  );
4748
4750
  const renderFactTags = react.useCallback(
4749
4751
  (fact, rowHeight) => /* @__PURE__ */ jsxRuntime.jsx(
4750
- chunkB3FMUFAW_cjs.FactLabelsCell,
4752
+ chunkUKT3WH5Z_cjs.FactLabelsCell,
4751
4753
  {
4752
4754
  options: labelOptions,
4753
4755
  selectedIds: fact.tags.map((t) => t.tag_ext_id),
@@ -4846,7 +4848,7 @@ function useFactsGrid({
4846
4848
  var DEFAULT_TIMELINE_LABEL_WIDTH = 240;
4847
4849
  function useFactsPageView() {
4848
4850
  const [view, setView] = react.useState("table");
4849
- const [rowHeight, setRowHeight] = react.useState(chunkYAEXSCUW_cjs.ROW_MIN);
4851
+ const [rowHeight, setRowHeight] = react.useState(chunkWV4TD2HZ_cjs.ROW_MIN);
4850
4852
  const [labelWidth, setLabelWidth] = react.useState(DEFAULT_TIMELINE_LABEL_WIDTH);
4851
4853
  const [zoom, setZoom] = react.useState(1);
4852
4854
  const [filterText, setFilterText] = react.useState("");
@@ -4879,7 +4881,7 @@ var citedDocIdsCache = /* @__PURE__ */ new WeakMap();
4879
4881
  function citedDocIds(m) {
4880
4882
  const cached = citedDocIdsCache.get(m);
4881
4883
  if (cached) return cached;
4882
- const ids = chunkB3FMUFAW_cjs.docIdsOf(chunkB3FMUFAW_cjs.toFactCitations(m.citations));
4884
+ const ids = chunkUKT3WH5Z_cjs.docIdsOf(chunkUKT3WH5Z_cjs.toFactCitations(m.citations));
4883
4885
  citedDocIdsCache.set(m, ids);
4884
4886
  return ids;
4885
4887
  }
@@ -4971,7 +4973,7 @@ function ConnectedFactsPage({
4971
4973
  const citedDocs = react.useMemo(() => {
4972
4974
  const wanted = /* @__PURE__ */ new Set([
4973
4975
  ...notes.flatMap((n) => citedDocIds(n)),
4974
- ...chunkB3FMUFAW_cjs.docIdsOf(chunkB3FMUFAW_cjs.toFactCitations(composer.draftCitations))
4976
+ ...chunkUKT3WH5Z_cjs.docIdsOf(chunkUKT3WH5Z_cjs.toFactCitations(composer.draftCitations))
4975
4977
  ]);
4976
4978
  return Object.fromEntries(
4977
4979
  documents.filter((d) => wanted.has(d.external_id)).map((d) => [d.external_id, d])
@@ -5000,7 +5002,7 @@ function ConnectedFactsPage({
5000
5002
  setView(request.view === "list" ? "table" : request.view);
5001
5003
  onRequestHandled?.("view");
5002
5004
  }, [request?.view]);
5003
- const factsRowHeight = pageView.rowHeight === chunkYAEXSCUW_cjs.ROW_MIN ? chunkYAEXSCUW_cjs.ROW_MIN : chunkYAEXSCUW_cjs.rowHeightForLines(chunkYAEXSCUW_cjs.linesForRowHeight(pageView.rowHeight));
5005
+ const factsRowHeight = pageView.rowHeight === chunkWV4TD2HZ_cjs.ROW_MIN ? chunkWV4TD2HZ_cjs.ROW_MIN : chunkWV4TD2HZ_cjs.rowHeightForLines(chunkWV4TD2HZ_cjs.linesForRowHeight(pageView.rowHeight));
5004
5006
  const [isExportOpen, setIsExportOpen] = react.useState(false);
5005
5007
  const [filterOpen, setFilterOpen] = react.useState(false);
5006
5008
  const [factSection, setFactSection] = react.useState(null);
@@ -5025,7 +5027,7 @@ function ConnectedFactsPage({
5025
5027
  };
5026
5028
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: setFactSection, className: "relative flex h-full flex-col", "data-testid": "facts-page", children: [
5027
5029
  /* @__PURE__ */ jsxRuntime.jsx(
5028
- chunkB3FMUFAW_cjs.FactsToolbar,
5030
+ chunkUKT3WH5Z_cjs.FactsToolbar,
5029
5031
  {
5030
5032
  count: filteredNotes.length,
5031
5033
  hasActiveFilters: filters.hasActiveFilters,
@@ -5054,7 +5056,7 @@ function ConnectedFactsPage({
5054
5056
  onNewFact: composing && !editingId ? () => void 0 : composer.startNewFact,
5055
5057
  navSlotRef: setNavSlot,
5056
5058
  navigator: view === "table" ? /* @__PURE__ */ jsxRuntime.jsx(
5057
- chunkGC2FSPSQ_cjs.GridRowNavigator,
5059
+ chunkHDJRSCRE_cjs.GridRowNavigator,
5058
5060
  {
5059
5061
  gridApi,
5060
5062
  selectedId: editingId,
@@ -5065,9 +5067,9 @@ function ConnectedFactsPage({
5065
5067
  ) : null,
5066
5068
  showToolbarRow: view !== "smart_search",
5067
5069
  tools: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5068
- view === "table" && /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactsFieldsButton, { getGridApi: () => gridApiRef.current }),
5070
+ view === "table" && /* @__PURE__ */ jsxRuntime.jsx(chunkUKT3WH5Z_cjs.FactsFieldsButton, { getGridApi: () => gridApiRef.current }),
5069
5071
  view === "table" && /* @__PURE__ */ jsxRuntime.jsx(
5070
- chunkYAEXSCUW_cjs.RowDensityControl,
5072
+ chunkWV4TD2HZ_cjs.RowDensityControl,
5071
5073
  {
5072
5074
  rowHeight: factsRowHeight,
5073
5075
  onRowHeightChange: pageView.setRowHeight,
@@ -5086,7 +5088,7 @@ function ConnectedFactsPage({
5086
5088
  }
5087
5089
  ),
5088
5090
  /* @__PURE__ */ jsxRuntime.jsx(
5089
- chunkB3FMUFAW_cjs.FactComposer,
5091
+ chunkUKT3WH5Z_cjs.FactComposer,
5090
5092
  {
5091
5093
  isOpen: composing,
5092
5094
  isEditing: !!editingId,
@@ -5119,7 +5121,7 @@ function ConnectedFactsPage({
5119
5121
  reserveSourcesSpace: view === "gantt" || view === "calendar",
5120
5122
  citationContainer: factSection,
5121
5123
  renderDocumentPicker: (onSelect, selectedIds, onOpen, sourcesToggle, sourcesOpen) => /* @__PURE__ */ jsxRuntime.jsx(
5122
- chunkB3FMUFAW_cjs.FactSourcesRow,
5124
+ chunkUKT3WH5Z_cjs.FactSourcesRow,
5123
5125
  {
5124
5126
  toggle: sourcesToggle,
5125
5127
  picker: /* @__PURE__ */ jsxRuntime.jsx(
@@ -5165,7 +5167,7 @@ function ConnectedFactsPage({
5165
5167
  }
5166
5168
  ),
5167
5169
  dateInput: /* @__PURE__ */ jsxRuntime.jsx(
5168
- chunkB3FMUFAW_cjs.FactDateInput,
5170
+ chunkUKT3WH5Z_cjs.FactDateInput,
5169
5171
  {
5170
5172
  value: composer.draftDateFields,
5171
5173
  onChange: composer.setDraftDateFields,
@@ -5175,13 +5177,13 @@ function ConnectedFactsPage({
5175
5177
  }
5176
5178
  ),
5177
5179
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "scrollbar-subtle flex-1 overflow-y-auto pb-2", children: [
5178
- isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactsLoading, {}) : isError ? /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactsLoadError, { onRetry: () => refetch() }) : smartSearch ? (
5180
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkUKT3WH5Z_cjs.FactsLoading, {}) : isError ? /* @__PURE__ */ jsxRuntime.jsx(chunkUKT3WH5Z_cjs.FactsLoadError, { onRetry: () => refetch() }) : smartSearch ? (
5179
5181
  // Searches facts only (never documents). Kept before the empty-state guard so the
5180
5182
  // search UI is reachable even in an empty workspace.
5181
5183
  smartSearch({ selectedFactId: editingId, onOpenFact: openFactById })
5182
5184
  ) : notes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-full flex-col items-center justify-center", children: [
5183
5185
  /* @__PURE__ */ jsxRuntime.jsx(
5184
- chunkB3FMUFAW_cjs.FactsEmptyState,
5186
+ chunkUKT3WH5Z_cjs.FactsEmptyState,
5185
5187
  {
5186
5188
  onUseExample: (text) => {
5187
5189
  composer.setDraft(text);
@@ -5192,7 +5194,7 @@ function ConnectedFactsPage({
5192
5194
  ),
5193
5195
  emptyStateExtra
5194
5196
  ] }) : view === "calendar" ? /* @__PURE__ */ jsxRuntime.jsx(
5195
- chunkB3FMUFAW_cjs.FactsCalendar,
5197
+ chunkUKT3WH5Z_cjs.FactsCalendar,
5196
5198
  {
5197
5199
  facts: filteredNotes,
5198
5200
  onSelect: (n) => openEditIfAllowed(n),
@@ -5201,7 +5203,7 @@ function ConnectedFactsPage({
5201
5203
  navigatorTotal: filteredNotes.length
5202
5204
  }
5203
5205
  ) : view === "gantt" ? /* @__PURE__ */ jsxRuntime.jsx(
5204
- chunkB3FMUFAW_cjs.FactsGanttPane,
5206
+ chunkUKT3WH5Z_cjs.FactsGanttPane,
5205
5207
  {
5206
5208
  items: ganttItems,
5207
5209
  labelWidth: pageView.labelWidth,
@@ -5251,7 +5253,7 @@ function ConnectedFactsPage({
5251
5253
  )
5252
5254
  ] }),
5253
5255
  selectable && notes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
5254
- chunkB3FMUFAW_cjs.FactsBulkBar,
5256
+ chunkUKT3WH5Z_cjs.FactsBulkBar,
5255
5257
  {
5256
5258
  count: selection.selectedFacts.length,
5257
5259
  onClear: selection.clearSelection,
@@ -6958,13 +6960,13 @@ function ConnectedWorkspaceSettings({
6958
6960
  const [membersExpanded, setMembersExpanded] = react.useState(false);
6959
6961
  const [shareOpen, setShareOpen] = react.useState(false);
6960
6962
  if (!workspace) {
6961
- return /* @__PURE__ */ jsxRuntime.jsx(chunkMSFQDELO_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkGC2FSPSQ_cjs.LoadingIndicator, { message: "Loading workspace..." }) });
6963
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkMSFQDELO_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkHDJRSCRE_cjs.LoadingIndicator, { message: "Loading workspace..." }) });
6962
6964
  }
6963
6965
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6964
6966
  /* @__PURE__ */ jsxRuntime.jsxs(chunkMSFQDELO_cjs.WorkspacePageFrame, { testId, children: [
6965
6967
  /* @__PURE__ */ jsxRuntime.jsxs(chunkMSFQDELO_cjs.WorkspaceIdentityPanel, { children: [
6966
6968
  /* @__PURE__ */ jsxRuntime.jsx(
6967
- chunkGC2FSPSQ_cjs.EntityIdentityBar,
6969
+ chunkHDJRSCRE_cjs.EntityIdentityBar,
6968
6970
  {
6969
6971
  testId: "workspace-identity-bar",
6970
6972
  canEdit: isOwner,
@@ -6981,7 +6983,7 @@ function ConnectedWorkspaceSettings({
6981
6983
  label: "Name",
6982
6984
  value: workspace.name,
6983
6985
  placeholder: "Untitled",
6984
- maxLength: chunkGC2FSPSQ_cjs.IDENTITY_NAME_MAX_LENGTH,
6986
+ maxLength: chunkHDJRSCRE_cjs.IDENTITY_NAME_MAX_LENGTH,
6985
6987
  valueClassName: "truncate text-base font-semibold",
6986
6988
  testId: "workspace-home-title",
6987
6989
  hideLabel: true,
@@ -10815,7 +10817,7 @@ function ConnectedWorkspaceList({
10815
10817
  };
10816
10818
  const open = (workspace) => void openWorkspace(workspace.external_id, { name: workspace.name });
10817
10819
  const createDisabledReason = list.canCreateProjects === false ? react$1.PROJECT_CREATION_DENIED_REASON : void 0;
10818
- if (list.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkGC2FSPSQ_cjs.LoadingIndicator, { message: "Loading workspaces..." });
10820
+ if (list.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkHDJRSCRE_cjs.LoadingIndicator, { message: "Loading workspaces..." });
10819
10821
  if (list.error) {
10820
10822
  return /* @__PURE__ */ jsxRuntime.jsx(
10821
10823
  chunkOOU4QLRK_cjs.HomeLoadError,
@@ -10887,7 +10889,7 @@ function ConnectedWorkspaceList({
10887
10889
  createDisabledReason
10888
10890
  }
10889
10891
  ) })
10890
- ) : /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkGC2FSPSQ_cjs.LoadingIndicator, { message: "Loading grid..." }), children: /* @__PURE__ */ jsxRuntime.jsx(chunkOOU4QLRK_cjs.HomeCenteredColumn, { children: /* @__PURE__ */ jsxRuntime.jsx(
10892
+ ) : /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkHDJRSCRE_cjs.LoadingIndicator, { message: "Loading grid..." }), children: /* @__PURE__ */ jsxRuntime.jsx(chunkOOU4QLRK_cjs.HomeCenteredColumn, { children: /* @__PURE__ */ jsxRuntime.jsx(
10891
10893
  WorkspaceTableView,
10892
10894
  {
10893
10895
  list,
@@ -11043,7 +11045,7 @@ function recentConversations(conversations) {
11043
11045
  return [...conversations].sort((a, b) => time(b.updated_at) - time(a.updated_at)).slice(0, RECENT_ROWS).map((c) => ({
11044
11046
  id: c.external_id,
11045
11047
  title: c.title?.trim() || "Untitled thread",
11046
- subtitle: c.status ? [chunkYF3QUHKN_cjs.STATUS_LABELS[chunkYF3QUHKN_cjs.asTaskStatus(c.status)], c.due_at ? `due ${shortDate(c.due_at)}` : null].filter(Boolean).join(" \xB7 ") : `${c.message_count} ${c.message_count === 1 ? "message" : "messages"}`,
11048
+ subtitle: c.status ? [chunkFEGXFABZ_cjs.STATUS_LABELS[chunkFEGXFABZ_cjs.asTaskStatus(c.status)], c.due_at ? `due ${shortDate(c.due_at)}` : null].filter(Boolean).join(" \xB7 ") : `${c.message_count} ${c.message_count === 1 ? "message" : "messages"}`,
11047
11049
  time: timeAndDate(c.updated_at)
11048
11050
  }));
11049
11051
  }
@@ -11960,7 +11962,7 @@ var MailBodyEditor = react.lazy(
11960
11962
  }))
11961
11963
  );
11962
11964
  var NativeDocxEditor = react.lazy(
11963
- () => import('../NativeDocxEditor-5VBNM5I7.cjs').then((m) => ({ default: m.NativeDocxEditor }))
11965
+ () => import('../NativeDocxEditor-M3I776GD.cjs').then((m) => ({ default: m.NativeDocxEditor }))
11964
11966
  );
11965
11967
  var NO_WORD = {
11966
11968
  adapter: {
@@ -13135,7 +13137,7 @@ function ConnectedMailbox({
13135
13137
  onTabChange: () => {
13136
13138
  },
13137
13139
  compactBreakpoint: 360,
13138
- firstTabContent: account ? /* @__PURE__ */ jsxRuntime.jsxs(chunkYAEXSCUW_cjs.FilesFilterBar, { children: [
13140
+ firstTabContent: account ? /* @__PURE__ */ jsxRuntime.jsxs(chunkWV4TD2HZ_cjs.FilesFilterBar, { children: [
13139
13141
  /* @__PURE__ */ jsxRuntime.jsx(
13140
13142
  chunk2EI7NCUA_cjs.FilterInput,
13141
13143
  {
@@ -13170,7 +13172,7 @@ function ConnectedMailbox({
13170
13172
  }
13171
13173
  ),
13172
13174
  folderList && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(
13173
- chunkYAEXSCUW_cjs.FolderFilterButton,
13175
+ chunkWV4TD2HZ_cjs.FolderFilterButton,
13174
13176
  {
13175
13177
  label: folderList.find((f) => f.id === folderId)?.name ?? "Folders",
13176
13178
  isActive: false,
@@ -13178,7 +13180,7 @@ function ConnectedMailbox({
13178
13180
  onOpenChange: setFolderMenuOpen,
13179
13181
  testId: "mail-folder-button",
13180
13182
  children: folderList.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
13181
- chunkYAEXSCUW_cjs.FolderPickerRow,
13183
+ chunkWV4TD2HZ_cjs.FolderPickerRow,
13182
13184
  {
13183
13185
  label: item.name,
13184
13186
  count: item.unread > 0 ? item.unread : void 0,
@@ -14385,7 +14387,7 @@ function BookingPagesPanel({ defaultTimeZone, className }) {
14385
14387
  var selectClass4 = "h-9 w-full rounded-md border border-input bg-background px-2 text-sm text-foreground shadow-sm";
14386
14388
  function CreateRoomForm({ zone, onDone }) {
14387
14389
  const { notify: notify14 } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
14388
- const create2 = react$1.useCreateRoom();
14390
+ const create3 = react$1.useCreateRoom();
14389
14391
  const [name, setName] = react.useState("");
14390
14392
  const [type, setType] = react.useState("room");
14391
14393
  const [capacity, setCapacity] = react.useState("");
@@ -14405,7 +14407,7 @@ function CreateRoomForm({ zone, onDone }) {
14405
14407
  const cap = capacity.trim() ? Number(capacity) : null;
14406
14408
  if (cap !== null && (!Number.isInteger(cap) || cap < 1))
14407
14409
  return setError("Capacity must be a whole number");
14408
- create2.mutate(
14410
+ create3.mutate(
14409
14411
  {
14410
14412
  name: name.trim(),
14411
14413
  type,
@@ -14496,8 +14498,8 @@ function CreateRoomForm({ zone, onDone }) {
14496
14498
  error && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive", children: error }),
14497
14499
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
14498
14500
  /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { type: "button", variant: "ghost", onClick: onDone, children: "Cancel" }),
14499
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { type: "submit", disabled: create2.isPending, children: [
14500
- create2.isPending && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-1 size-4 animate-spin" }),
14501
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { type: "submit", disabled: create3.isPending, children: [
14502
+ create3.isPending && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-1 size-4 animate-spin" }),
14501
14503
  "Create"
14502
14504
  ] })
14503
14505
  ] })
@@ -16813,6 +16815,1152 @@ function ConnectedPublicBooking({ slug, cancelToken }) {
16813
16815
  ] })
16814
16816
  ] });
16815
16817
  }
16818
+ var useFilesStore = zustand.create()(
16819
+ middleware.persist(
16820
+ (set) => ({
16821
+ pendingFolders: {},
16822
+ addPendingFolder: (workspaceId, path) => set((state) => {
16823
+ const current = state.pendingFolders[workspaceId] ?? [];
16824
+ if (current.includes(path)) return state;
16825
+ return { pendingFolders: { ...state.pendingFolders, [workspaceId]: [...current, path] } };
16826
+ }),
16827
+ removePendingFolder: (workspaceId, path) => set((state) => {
16828
+ const current = state.pendingFolders[workspaceId] ?? [];
16829
+ if (!current.includes(path)) return state;
16830
+ return {
16831
+ pendingFolders: {
16832
+ ...state.pendingFolders,
16833
+ [workspaceId]: current.filter((p) => p !== path)
16834
+ }
16835
+ };
16836
+ })
16837
+ }),
16838
+ {
16839
+ name: "arbi_explorer_pending_folders",
16840
+ storage: middleware.createJSONStorage(() => sessionStorage),
16841
+ partialize: (state) => ({ pendingFolders: state.pendingFolders })
16842
+ }
16843
+ )
16844
+ );
16845
+ var NONE = [];
16846
+ function usePendingFolders(workspaceId) {
16847
+ return useFilesStore(
16848
+ (state) => (workspaceId ? state.pendingFolders[workspaceId] : void 0) ?? NONE
16849
+ );
16850
+ }
16851
+ var FilesSupportContext = react.createContext({});
16852
+ function FilesSupportProvider({
16853
+ value,
16854
+ children
16855
+ }) {
16856
+ return /* @__PURE__ */ jsxRuntime.jsx(FilesSupportContext.Provider, { value, children });
16857
+ }
16858
+ function useFilesSupport() {
16859
+ return react.useContext(FilesSupportContext);
16860
+ }
16861
+ var NO_IDS3 = /* @__PURE__ */ new Set();
16862
+ function useOfflineDocumentIds() {
16863
+ const { useOfflineDocumentIds: useHostIds } = useFilesSupport();
16864
+ return useHostIds?.() ?? NO_IDS3;
16865
+ }
16866
+ function useViewingDocumentId() {
16867
+ const { useViewingDocumentId: useHostViewing } = useFilesSupport();
16868
+ return useHostViewing?.() ?? null;
16869
+ }
16870
+ function DocumentSyncGlyph({
16871
+ docExtId,
16872
+ size = 13,
16873
+ className,
16874
+ bgClassName = "bg-muted-foreground"
16875
+ }) {
16876
+ const isAvailableOffline = useOfflineDocumentIds().has(docExtId);
16877
+ if (!isAvailableOffline) return null;
16878
+ return /* @__PURE__ */ jsxRuntime.jsx(
16879
+ "span",
16880
+ {
16881
+ title: "Available offline (saved on this device)",
16882
+ "aria-label": "Available offline",
16883
+ "data-testid": `offline-available-badge-${docExtId}`,
16884
+ className: ui.cn(
16885
+ "inline-flex items-center justify-center rounded-full text-white ring-1 ring-white",
16886
+ bgClassName,
16887
+ className
16888
+ ),
16889
+ style: { width: size, height: size },
16890
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDownToLine, { size: Math.round(size * 0.7), strokeWidth: 2.75 })
16891
+ }
16892
+ );
16893
+ }
16894
+ var ACTIVE_STATUSES = /* @__PURE__ */ new Set([
16895
+ "uploading",
16896
+ "queued",
16897
+ "parsing",
16898
+ "encrypting",
16899
+ "indexing",
16900
+ "analysing"
16901
+ ]);
16902
+ var TERMINAL_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "skipped", "empty", "low-content"]);
16903
+ var STATUS_LABEL = {
16904
+ uploading: "Uploading",
16905
+ queued: "Queued",
16906
+ parsing: "Parsing",
16907
+ encrypting: "Encrypting",
16908
+ indexing: "Indexing",
16909
+ analysing: "Analysing"
16910
+ };
16911
+ function isActiveDocumentStatus(status) {
16912
+ return ACTIVE_STATUSES.has(status.toLowerCase());
16913
+ }
16914
+ function useDocStatus(doc) {
16915
+ const liveStatus = react$1.useProcessingTask(doc.external_id)?.status;
16916
+ const rowStatus = (doc.status ?? "").toLowerCase();
16917
+ if (liveStatus && ACTIVE_STATUSES.has(liveStatus)) return liveStatus;
16918
+ if (TERMINAL_STATUSES.has(rowStatus)) return rowStatus;
16919
+ return liveStatus ?? rowStatus;
16920
+ }
16921
+ function TileStatusBadge({ doc, status }) {
16922
+ let tone = "neutral";
16923
+ let icon2 = null;
16924
+ let title = "";
16925
+ switch (status) {
16926
+ case "completed":
16927
+ tone = "success";
16928
+ icon2 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "size-4 text-green-text", strokeWidth: 2.75 });
16929
+ title = "Ready";
16930
+ break;
16931
+ case "failed":
16932
+ tone = "danger";
16933
+ icon2 = /* @__PURE__ */ jsxRuntime.jsx(
16934
+ chunkWV4TD2HZ_cjs.FailedStageIcon,
16935
+ {
16936
+ stage: doc.failed_stage ?? null,
16937
+ errorMessage: doc.error_message,
16938
+ className: "size-4 text-red-text"
16939
+ }
16940
+ );
16941
+ title = "Failed";
16942
+ break;
16943
+ case "skipped":
16944
+ icon2 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SkipForward, { className: "size-4 text-muted-foreground", strokeWidth: 2.75 });
16945
+ title = "Skipped";
16946
+ break;
16947
+ case "empty":
16948
+ tone = "warning";
16949
+ icon2 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileX, { className: "size-4 text-yellow-text", strokeWidth: 2.75 });
16950
+ title = "Empty \u2014 no extractable content";
16951
+ break;
16952
+ case "low-content":
16953
+ tone = "warning";
16954
+ icon2 = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-4 text-yellow-text", strokeWidth: 2.75 });
16955
+ title = "Low content \u2014 minimal extractable content";
16956
+ break;
16957
+ default:
16958
+ return null;
16959
+ }
16960
+ return /* @__PURE__ */ jsxRuntime.jsx(
16961
+ chunkWV4TD2HZ_cjs.StatusPill,
16962
+ {
16963
+ tone,
16964
+ icon: icon2,
16965
+ title,
16966
+ testId: `explorer-file-status-${doc.external_id}`
16967
+ }
16968
+ );
16969
+ }
16970
+ function TileVisibilityBadge({ doc }) {
16971
+ const shared = !!doc.shared;
16972
+ return /* @__PURE__ */ jsxRuntime.jsx(
16973
+ chunkWV4TD2HZ_cjs.StatusPill,
16974
+ {
16975
+ icon: /* @__PURE__ */ jsxRuntime.jsx(ui.VisibilityIcon, { isShared: shared, className: "size-3.5", "aria-hidden": true }),
16976
+ label: shared ? ui.getEntityLabel("WORKSPACE") : "Only you",
16977
+ title: chunkWV4TD2HZ_cjs.visibilityAudience(shared),
16978
+ testId: `explorer-file-visibility-${doc.external_id}`
16979
+ }
16980
+ );
16981
+ }
16982
+ function MiniUserAvatar({ user }) {
16983
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.Avatar, { className: "h-4 w-4 border border-white", children: [
16984
+ user.picture && /* @__PURE__ */ jsxRuntime.jsx(ui.AvatarImage, { src: user.picture, alt: ui.getUserDisplayName(user) }),
16985
+ /* @__PURE__ */ jsxRuntime.jsx(
16986
+ ui.AvatarFallback,
16987
+ {
16988
+ className: ui.cn(
16989
+ "text-xs font-semibold leading-none text-white",
16990
+ ui.getUserAvatarColor(user.external_id)
16991
+ ),
16992
+ children: ui.getUserInitials(user)
16993
+ }
16994
+ )
16995
+ ] });
16996
+ }
16997
+ function FileTooltipContent({
16998
+ doc,
16999
+ modifiedBy,
17000
+ tagNameById
17001
+ }) {
17002
+ const labels = (doc.doctags ?? []).map((dt) => tagNameById.get(dt.tag_ext_id)).filter((name) => !!name);
17003
+ return /* @__PURE__ */ jsxRuntime.jsx(
17004
+ chunkWV4TD2HZ_cjs.ExplorerFileTooltip,
17005
+ {
17006
+ title: ui.getDocumentTitle(doc, doc.file_name ?? ""),
17007
+ summary: react$1.getDocumentSubject(doc),
17008
+ modifiedLabel: doc.updated_at ? ui.formatFriendlyDate(doc.updated_at, false) : null,
17009
+ modifiedByAvatar: modifiedBy && /* @__PURE__ */ jsxRuntime.jsx(MiniUserAvatar, { user: modifiedBy }),
17010
+ shared: !!doc.shared,
17011
+ visibilityIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.VisibilityIcon, { isShared: !!doc.shared, className: "h-3 w-3" }),
17012
+ labels,
17013
+ uiLabels: { shared: chunkWV4TD2HZ_cjs.visibilityAudience(true), private: chunkWV4TD2HZ_cjs.visibilityAudience(false) }
17014
+ }
17015
+ );
17016
+ }
17017
+ function startMenuItem(items) {
17018
+ if (items.length === 0) return [];
17019
+ return [
17020
+ {
17021
+ id: "start",
17022
+ label: "Start\u2026",
17023
+ icon: lucideReact.Sparkles,
17024
+ testId: "explorer-start-menu",
17025
+ onSelect: () => {
17026
+ },
17027
+ submenu: items.map((item) => ({
17028
+ id: item.id,
17029
+ label: item.title,
17030
+ icon: lucideReact.Play,
17031
+ onSelect: item.run,
17032
+ testId: `explorer-start-${item.id}`
17033
+ }))
17034
+ }
17035
+ ];
17036
+ }
17037
+ var FileTile = react.memo(function FileTile2({
17038
+ doc,
17039
+ density,
17040
+ selected,
17041
+ dragging,
17042
+ dndActive,
17043
+ renaming,
17044
+ canDelete,
17045
+ thumbnailUrl,
17046
+ modifiedBy,
17047
+ tagNameById,
17048
+ onSelect,
17049
+ onToggle,
17050
+ onOpen,
17051
+ onReview,
17052
+ onStartRename,
17053
+ onCommitRename,
17054
+ onCancelRename,
17055
+ onDownload,
17056
+ onMove,
17057
+ onDelete
17058
+ }) {
17059
+ const { attributes, listeners: listeners2, setNodeRef } = core.useDraggable({
17060
+ id: `doc:${doc.external_id}`,
17061
+ data: { type: "doc", docId: doc.external_id }
17062
+ });
17063
+ const { notify: notify14 } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
17064
+ const { startItemsForFile, openDocumentChat, emailDocument } = useFilesSupport();
17065
+ const status = useDocStatus(doc);
17066
+ const isProcessing = ACTIVE_STATUSES.has(status);
17067
+ const isOffline = useOfflineDocumentIds().has(doc.external_id);
17068
+ const isViewing = useViewingDocumentId() === doc.external_id;
17069
+ const showStatusMarker = !isProcessing && TERMINAL_STATUSES.has(status);
17070
+ const Icon = ui.getFileTypeIcon(doc.file_name, { mime: doc.file_type });
17071
+ const { data: mailPolicy } = react$1.useMailPolicy();
17072
+ const shareAsEmail = async () => {
17073
+ try {
17074
+ await emailDocument?.(doc);
17075
+ } catch (error) {
17076
+ notify14(error instanceof Error ? error.message : "Could not attach document", "error");
17077
+ }
17078
+ };
17079
+ const startItems = startItemsForFile?.(doc);
17080
+ const menuItems = [
17081
+ { id: "open", label: "Open", icon: lucideReact.SquarePen, onSelect: () => onOpen(doc) },
17082
+ ...onReview ? [{ id: "review", label: "Open in Review", icon: lucideReact.BookOpen, onSelect: () => onReview(doc) }] : [],
17083
+ ...openDocumentChat ? [
17084
+ {
17085
+ id: "chat",
17086
+ label: "Document chat",
17087
+ icon: lucideReact.MessagesSquare,
17088
+ onSelect: () => openDocumentChat(doc.external_id)
17089
+ }
17090
+ ] : [],
17091
+ ...startMenuItem(startItems ?? []),
17092
+ {
17093
+ id: "rename",
17094
+ label: "Rename",
17095
+ icon: lucideReact.Pencil,
17096
+ onSelect: () => onStartRename(doc),
17097
+ separatorBefore: true
17098
+ },
17099
+ { id: "download", label: "Download", icon: lucideReact.Download, onSelect: () => onDownload(doc) },
17100
+ ...emailDocument && mailPolicy?.enabled ? [
17101
+ {
17102
+ id: "email",
17103
+ label: "Send as email attachment",
17104
+ icon: lucideReact.Mail,
17105
+ onSelect: () => {
17106
+ void shareAsEmail();
17107
+ }
17108
+ }
17109
+ ] : [],
17110
+ ...onMove ? [{ id: "move", label: "Move to\u2026", icon: lucideReact.FolderInput, onSelect: () => onMove(doc) }] : [],
17111
+ ...canDelete ? [
17112
+ {
17113
+ id: "delete",
17114
+ label: "Delete",
17115
+ icon: lucideReact.Trash2,
17116
+ onSelect: () => onDelete(doc),
17117
+ destructive: true,
17118
+ separatorBefore: true
17119
+ }
17120
+ ] : []
17121
+ ];
17122
+ const tooltip = renaming || dndActive ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(FileTooltipContent, { doc, modifiedBy, tagNameById });
17123
+ return /* @__PURE__ */ jsxRuntime.jsx(
17124
+ chunkWV4TD2HZ_cjs.ExplorerFileTile,
17125
+ {
17126
+ id: doc.external_id,
17127
+ title: ui.getDocumentTitle(doc, doc.file_name ?? ""),
17128
+ density,
17129
+ selected,
17130
+ dragging,
17131
+ renaming,
17132
+ thumbnailUrl,
17133
+ renderFileIcon: (size) => /* @__PURE__ */ jsxRuntime.jsx(Icon, { size, className: "drop-shadow-sm" }),
17134
+ progress: isProcessing ? { label: STATUS_LABEL[status] ?? status, queued: status === "queued" } : void 0,
17135
+ statusMarker: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
17136
+ /* @__PURE__ */ jsxRuntime.jsx(TileVisibilityBadge, { doc }),
17137
+ showStatusMarker && /* @__PURE__ */ jsxRuntime.jsx(TileStatusBadge, { doc, status })
17138
+ ] }),
17139
+ offlineMarker: isOffline ? /* @__PURE__ */ jsxRuntime.jsx(DocumentSyncGlyph, { docExtId: doc.external_id, size: 24, bgClassName: "bg-primary" }) : void 0,
17140
+ entity: /* @__PURE__ */ jsxRuntime.jsx(
17141
+ ui.DocumentEntity,
17142
+ {
17143
+ doc,
17144
+ labelMaxWidth: "max-w-full",
17145
+ noClamp: true,
17146
+ labelClassName: "whitespace-normal line-clamp-2 break-words",
17147
+ viewing: isViewing,
17148
+ tooltipContent: /* @__PURE__ */ jsxRuntime.jsx(FileTooltipContent, { doc, modifiedBy, tagNameById }),
17149
+ className: ui.cn(
17150
+ "w-full min-w-0 max-w-full bg-background/90 backdrop-blur-sm",
17151
+ density === "list" ? "text-xs" : void 0
17152
+ ),
17153
+ onClick: (e) => {
17154
+ e.stopPropagation();
17155
+ onOpen(doc);
17156
+ }
17157
+ }
17158
+ ),
17159
+ tooltip,
17160
+ menuItems,
17161
+ rootRef: setNodeRef,
17162
+ rootProps: { ...listeners2, ...attributes },
17163
+ onOpen: () => onOpen(doc),
17164
+ onSelect: (e) => onSelect(doc, e),
17165
+ onToggle: (e) => onToggle(doc, e),
17166
+ onCommitRename: (name) => onCommitRename(doc, name),
17167
+ onCancelRename
17168
+ }
17169
+ );
17170
+ });
17171
+ var FolderTile = react.memo(function FolderTile2({
17172
+ folder,
17173
+ density,
17174
+ editing,
17175
+ selected,
17176
+ partiallySelected,
17177
+ documents,
17178
+ onOpen,
17179
+ onToggleSelect,
17180
+ onCommitName,
17181
+ onCancelName,
17182
+ onStartRename,
17183
+ onDownload,
17184
+ onMove,
17185
+ onDelete
17186
+ }) {
17187
+ const { setNodeRef, isOver } = core.useDroppable({
17188
+ id: `folder:${folder.path.join("/")}`,
17189
+ data: { type: "folder", path: folder.path }
17190
+ });
17191
+ const { startItemsForFolder } = useFilesSupport();
17192
+ const tasks = react$1.useProcessingTasks();
17193
+ const processingCount = react.useMemo(
17194
+ () => documents.filter(
17195
+ (doc) => isActiveDocumentStatus(tasks[doc.external_id]?.status ?? doc.status ?? "")
17196
+ ).length,
17197
+ [documents, tasks]
17198
+ );
17199
+ const isEmpty = folder.count === 0;
17200
+ const iconSize = density === "list" ? 34 : 48;
17201
+ const menuItems = [
17202
+ ...onStartRename ? [{ id: "rename", label: "Rename", icon: lucideReact.Pencil, onSelect: () => onStartRename(folder) }] : [],
17203
+ ...!isEmpty ? startMenuItem(startItemsForFolder?.(folder.path.join("/")) ?? []) : [],
17204
+ ...onDownload && !isEmpty ? [{ id: "download", label: "Download", icon: lucideReact.Download, onSelect: () => onDownload(folder) }] : [],
17205
+ ...onMove && !isEmpty ? [{ id: "move", label: "Move to\u2026", icon: lucideReact.FolderInput, onSelect: () => onMove(folder) }] : [],
17206
+ ...onDelete ? [
17207
+ {
17208
+ id: "delete",
17209
+ label: "Delete",
17210
+ icon: lucideReact.Trash2,
17211
+ onSelect: () => onDelete(folder),
17212
+ destructive: true,
17213
+ separatorBefore: true
17214
+ }
17215
+ ] : []
17216
+ ];
17217
+ const displayName = folder.path.length === 1 ? chunkWV4TD2HZ_cjs.formatFolderSegment(folder.name) : folder.name;
17218
+ const providerIcon = folder.path.length === 1 && chunkWV4TD2HZ_cjs.hasFolderProviderIcon(folder.name) ? /* @__PURE__ */ jsxRuntime.jsx(
17219
+ "span",
17220
+ {
17221
+ className: "flex items-center justify-center drop-shadow-sm",
17222
+ style: { width: iconSize, height: iconSize },
17223
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkWV4TD2HZ_cjs.FolderProviderIcon, { folderPath: folder.name, className: "h-full w-full" })
17224
+ }
17225
+ ) : void 0;
17226
+ return /* @__PURE__ */ jsxRuntime.jsx(
17227
+ chunkWV4TD2HZ_cjs.ExplorerFolderTile,
17228
+ {
17229
+ name: folder.name,
17230
+ displayName: displayName === "" ? null : displayName,
17231
+ path: folder.path,
17232
+ count: folder.count,
17233
+ density,
17234
+ editing,
17235
+ selected,
17236
+ partiallySelected,
17237
+ processingCount,
17238
+ isOver,
17239
+ icon: providerIcon,
17240
+ menuItems,
17241
+ rootRef: setNodeRef,
17242
+ onOpen: () => onOpen(folder),
17243
+ onToggleSelect: onToggleSelect ? (e) => onToggleSelect(folder, e) : void 0,
17244
+ onCommitName: (name) => onCommitName?.(folder, name),
17245
+ onCancelName
17246
+ }
17247
+ );
17248
+ });
17249
+ var GRID_GAP = 12;
17250
+ var SCROLL_PADDING_X = 32;
17251
+ var PAGE_ASPECT = 1.3;
17252
+ var TILE_MIN = 88;
17253
+ var TILE_MAX = 232;
17254
+ var TILE_DEFAULT = 200;
17255
+ var COMPACT_BELOW = 132;
17256
+ var NO_DOCUMENTS = [];
17257
+ function useFilesWorkspace() {
17258
+ const { workspaceId, userId, live } = chunkFM3IRQJW_cjs.useConnectedWorkspace();
17259
+ const { members, role } = chunkIJEISII2_cjs.useConnectedWorkspaceRole();
17260
+ const { data: workspaces } = react$1.useWorkspaces({ enabled: live });
17261
+ const workspaceName = workspaces?.find((w) => w.external_id === workspaceId)?.name;
17262
+ return {
17263
+ workspaceId: workspaceId ?? "",
17264
+ workspaceName,
17265
+ userId,
17266
+ role: role ?? null,
17267
+ members
17268
+ };
17269
+ }
17270
+ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
17271
+ documents,
17272
+ isLoading,
17273
+ canUpload,
17274
+ selectedIds,
17275
+ onSelectionChange,
17276
+ onOrderedFilesChange,
17277
+ onOpenDocument,
17278
+ onUploadFiles,
17279
+ folderPath,
17280
+ onFolderPathChange,
17281
+ search = "",
17282
+ sort,
17283
+ sortReversed,
17284
+ tileSize,
17285
+ onMoveSelected,
17286
+ onFolderMove,
17287
+ onOpenInReview,
17288
+ emptyWorkspace
17289
+ }, ref) {
17290
+ const { confirm, notify: notify14 } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
17291
+ const currentPath = folderPath;
17292
+ const density = tileSize < COMPACT_BELOW ? "list" : "grid";
17293
+ const [containerWidth, setContainerWidth] = react.useState(0);
17294
+ const [activeDragId, setActiveDragId] = react.useState(null);
17295
+ const [isFileDragOver, setIsFileDragOver] = react.useState(false);
17296
+ const [renamingId, setRenamingId] = react.useState(null);
17297
+ const scrollRef = react.useRef(null);
17298
+ const anchorRef = react.useRef(null);
17299
+ const dragIdsRef = react.useRef([]);
17300
+ const fileDragDepth = react.useRef(0);
17301
+ const marqueeOverlayRef = react.useRef(null);
17302
+ const marqueeRef = react.useRef(
17303
+ null
17304
+ );
17305
+ const didMarqueeRef = react.useRef(false);
17306
+ const updateDocument = react$1.useUpdateDocuments();
17307
+ const deleteDocuments = react$1.useDeleteDocuments();
17308
+ const renameFolder = react$1.useRenameFolder();
17309
+ const { workspaceId: wsId, workspaceName, userId, role, members } = useFilesWorkspace();
17310
+ const { downloadDocuments, downloadDocument } = react$1.useDownloadDocuments({ workspaceName });
17311
+ const { data: workspaceTags } = react$1.useTags();
17312
+ const userById = react.useMemo(() => {
17313
+ const map = /* @__PURE__ */ new Map();
17314
+ for (const member of members) map.set(member.user.external_id, member.user);
17315
+ return map;
17316
+ }, [members]);
17317
+ const tagNameById = react.useMemo(() => {
17318
+ const map = /* @__PURE__ */ new Map();
17319
+ for (const tag of workspaceTags ?? []) map.set(tag.external_id, tag.name);
17320
+ return map;
17321
+ }, [workspaceTags]);
17322
+ const pendingFolders = usePendingFolders(wsId);
17323
+ const addPendingFolder = useFilesStore((state) => state.addPendingFolder);
17324
+ const removePendingFolder = useFilesStore((state) => state.removePendingFolder);
17325
+ const [editingFolderPath, setEditingFolderPath] = react.useState(null);
17326
+ const isSearching = search.trim().length > 0;
17327
+ const selectedSet = react.useMemo(() => new Set(selectedIds), [selectedIds]);
17328
+ const selectedIdsRef = react.useRef(selectedIds);
17329
+ selectedIdsRef.current = selectedIds;
17330
+ const { folders, files } = react.useMemo(() => {
17331
+ const result = isSearching ? {
17332
+ folders: [],
17333
+ files: chunkWV4TD2HZ_cjs.searchExplorerDocuments(documents, search, sort)
17334
+ } : chunkWV4TD2HZ_cjs.buildExplorerEntries(documents, currentPath, sort, [...pendingFolders]);
17335
+ if (sortReversed) result.files = [...result.files].reverse();
17336
+ return result;
17337
+ }, [documents, currentPath, sort, isSearching, search, sortReversed, pendingFolders]);
17338
+ const entries = react.useMemo(
17339
+ () => [...folders, ...files.map((doc) => ({ kind: "file", doc }))],
17340
+ [folders, files]
17341
+ );
17342
+ const orderedFileIds = react.useMemo(() => files.map((d) => d.external_id), [files]);
17343
+ const folderDocs = react.useMemo(() => {
17344
+ const map = /* @__PURE__ */ new Map();
17345
+ for (const f of folders) map.set(f.path.join("/"), chunkWV4TD2HZ_cjs.collectFolderDocs(documents, f.path));
17346
+ return map;
17347
+ }, [folders, documents]);
17348
+ const folderSelection = react.useMemo(() => {
17349
+ const map = /* @__PURE__ */ new Map();
17350
+ for (const [key, docs] of folderDocs) {
17351
+ const sel = docs.reduce((n, d) => selectedSet.has(d.external_id) ? n + 1 : n, 0);
17352
+ map.set(key, { all: docs.length > 0 && sel === docs.length, some: sel > 0 });
17353
+ }
17354
+ return map;
17355
+ }, [folderDocs, selectedSet]);
17356
+ const contentWidth = Math.max(0, containerWidth - SCROLL_PADDING_X);
17357
+ const columnCount = Math.max(
17358
+ 1,
17359
+ Math.floor((contentWidth + GRID_GAP) / (tileSize + GRID_GAP)) || 1
17360
+ );
17361
+ const colWidth = contentWidth > 0 ? (contentWidth - (columnCount - 1) * GRID_GAP) / columnCount : tileSize;
17362
+ const tileHeight = Math.max(120, Math.round(colWidth * PAGE_ASPECT));
17363
+ const rowHeight = tileHeight + GRID_GAP;
17364
+ const rowCount = Math.ceil(entries.length / columnCount);
17365
+ const rowVirtualizer = reactVirtual.useVirtualizer({
17366
+ count: rowCount,
17367
+ getScrollElement: () => scrollRef.current,
17368
+ estimateSize: () => rowHeight,
17369
+ overscan: 3
17370
+ });
17371
+ const virtualRows = rowVirtualizer.getVirtualItems();
17372
+ const firstRow = virtualRows.length > 0 ? virtualRows[0].index : 0;
17373
+ const lastRow = virtualRows.length > 0 ? virtualRows[virtualRows.length - 1].index : -1;
17374
+ const visibleFileIds = react.useMemo(() => {
17375
+ const ids = [];
17376
+ for (let r = firstRow; r <= lastRow; r++) {
17377
+ const start = r * columnCount;
17378
+ for (let c = 0; c < columnCount; c++) {
17379
+ const entry = entries[start + c];
17380
+ if (entry?.kind === "file") ids.push(entry.doc.external_id);
17381
+ }
17382
+ }
17383
+ return ids;
17384
+ }, [firstRow, lastRow, columnCount, entries]);
17385
+ const thumbnailsById = react$1.useDocumentThumbnails(visibleFileIds);
17386
+ react.useEffect(() => {
17387
+ rowVirtualizer.measure();
17388
+ }, [rowVirtualizer, columnCount, rowHeight, entries.length]);
17389
+ const isWholeWorkspaceEmpty = !isLoading && documents.length === 0 && canUpload && emptyWorkspace !== void 0;
17390
+ react.useLayoutEffect(() => {
17391
+ const el = scrollRef.current;
17392
+ if (!el) return;
17393
+ const apply = () => {
17394
+ const next = Math.round(el.clientWidth);
17395
+ setContainerWidth((prev) => prev === next ? prev : next);
17396
+ };
17397
+ apply();
17398
+ const ro = new ResizeObserver(apply);
17399
+ ro.observe(el);
17400
+ return () => ro.disconnect();
17401
+ }, [isWholeWorkspaceEmpty]);
17402
+ react.useEffect(() => {
17403
+ anchorRef.current = null;
17404
+ if (scrollRef.current) scrollRef.current.scrollTop = 0;
17405
+ }, [currentPath, search]);
17406
+ react.useEffect(() => {
17407
+ const MARQUEE_THRESHOLD = 5;
17408
+ let rafId = 0;
17409
+ let cur = null;
17410
+ const paint = () => {
17411
+ rafId = 0;
17412
+ const el = marqueeOverlayRef.current;
17413
+ if (!el || !cur) return;
17414
+ el.style.display = "block";
17415
+ el.style.left = `${cur.left}px`;
17416
+ el.style.top = `${cur.top}px`;
17417
+ el.style.width = `${cur.right - cur.left}px`;
17418
+ el.style.height = `${cur.bottom - cur.top}px`;
17419
+ };
17420
+ const onMove = (e) => {
17421
+ const m = marqueeRef.current;
17422
+ if (!m) return;
17423
+ if (!didMarqueeRef.current && Math.hypot(e.clientX - m.x, e.clientY - m.y) < MARQUEE_THRESHOLD)
17424
+ return;
17425
+ didMarqueeRef.current = true;
17426
+ const b = scrollRef.current?.getBoundingClientRect();
17427
+ const px = b ? Math.max(b.left, Math.min(e.clientX, b.right)) : e.clientX;
17428
+ const py = b ? Math.max(b.top, Math.min(e.clientY, b.bottom)) : e.clientY;
17429
+ cur = {
17430
+ left: Math.min(m.x, px),
17431
+ top: Math.min(m.y, py),
17432
+ right: Math.max(m.x, px),
17433
+ bottom: Math.max(m.y, py)
17434
+ };
17435
+ if (!rafId) rafId = requestAnimationFrame(paint);
17436
+ };
17437
+ const onUp = () => {
17438
+ const m = marqueeRef.current;
17439
+ if (!m) return;
17440
+ marqueeRef.current = null;
17441
+ if (rafId) cancelAnimationFrame(rafId);
17442
+ rafId = 0;
17443
+ const el = marqueeOverlayRef.current;
17444
+ if (el) el.style.display = "none";
17445
+ if (!didMarqueeRef.current || !cur) return;
17446
+ const box = cur;
17447
+ const hit = [];
17448
+ scrollRef.current?.querySelectorAll("[data-doc-id]").forEach((node) => {
17449
+ const r = node.getBoundingClientRect();
17450
+ if (r.left < box.right && r.right > box.left && r.top < box.bottom && r.bottom > box.top) {
17451
+ const id = node.getAttribute("data-doc-id");
17452
+ if (id) hit.push(id);
17453
+ }
17454
+ });
17455
+ onSelectionChange(m.additive ? Array.from(/* @__PURE__ */ new Set([...m.base, ...hit])) : hit);
17456
+ };
17457
+ window.addEventListener("pointermove", onMove);
17458
+ window.addEventListener("pointerup", onUp);
17459
+ return () => {
17460
+ window.removeEventListener("pointermove", onMove);
17461
+ window.removeEventListener("pointerup", onUp);
17462
+ if (rafId) cancelAnimationFrame(rafId);
17463
+ };
17464
+ }, [onSelectionChange]);
17465
+ const handleScrollPointerDown = react.useCallback((e) => {
17466
+ if (e.button !== 0) return;
17467
+ const el = e.target;
17468
+ if (el.closest(
17469
+ '[data-testid="explorer-file"],[data-testid="explorer-folder"],button,input,select,a,[role="button"]'
17470
+ )) {
17471
+ return;
17472
+ }
17473
+ const additive = e.shiftKey || e.metaKey || e.ctrlKey;
17474
+ marqueeRef.current = {
17475
+ x: e.clientX,
17476
+ y: e.clientY,
17477
+ additive,
17478
+ base: additive ? selectedIdsRef.current : []
17479
+ };
17480
+ didMarqueeRef.current = false;
17481
+ }, []);
17482
+ const openFolder = react.useCallback(
17483
+ (folder) => onFolderPathChange(folder.path),
17484
+ [onFolderPathChange]
17485
+ );
17486
+ const handleNewFolder = react.useCallback(() => {
17487
+ if (!wsId) return;
17488
+ const siblings = new Set(folders.map((f) => f.name.toLowerCase()));
17489
+ const base = "New folder";
17490
+ let name = base;
17491
+ let i = 2;
17492
+ while (siblings.has(name.toLowerCase())) name = `${base} ${i++}`;
17493
+ const path = chunkWV4TD2HZ_cjs.joinFolderPath([...currentPath, name]);
17494
+ if (!path) return;
17495
+ addPendingFolder(wsId, path);
17496
+ setEditingFolderPath(path);
17497
+ }, [wsId, folders, currentPath, addPendingFolder]);
17498
+ const lastOrderedRef = react.useRef([]);
17499
+ react.useEffect(() => {
17500
+ const prev = lastOrderedRef.current;
17501
+ if (prev.length === orderedFileIds.length && prev.every((id, i) => id === orderedFileIds[i])) {
17502
+ return;
17503
+ }
17504
+ lastOrderedRef.current = orderedFileIds;
17505
+ onOrderedFilesChange?.(orderedFileIds);
17506
+ }, [onOrderedFilesChange, orderedFileIds]);
17507
+ const scrollToDocument = react.useCallback(
17508
+ (docId) => {
17509
+ const index = entries.findIndex((e) => e.kind === "file" && e.doc.external_id === docId);
17510
+ if (index < 0) return;
17511
+ rowVirtualizer.scrollToIndex(Math.floor(index / columnCount), { align: "center" });
17512
+ },
17513
+ [entries, columnCount, rowVirtualizer]
17514
+ );
17515
+ react.useImperativeHandle(ref, () => ({ triggerNewFolder: handleNewFolder, scrollToDocument }), [
17516
+ handleNewFolder,
17517
+ scrollToDocument
17518
+ ]);
17519
+ const commitFolderName = react.useCallback(
17520
+ async (folder, rawName) => {
17521
+ setEditingFolderPath(null);
17522
+ const name = rawName.trim();
17523
+ if (!wsId || !name || name === folder.name) return;
17524
+ const siblings = new Set(folders.filter((f) => f !== folder).map((f) => f.name.toLowerCase()));
17525
+ if (siblings.has(name.toLowerCase())) {
17526
+ notify14(`A folder named "${name}" already exists here.`, "error");
17527
+ return;
17528
+ }
17529
+ const oldPath = chunkWV4TD2HZ_cjs.joinFolderPath(folder.path);
17530
+ const newPrefix = [...folder.path.slice(0, -1), name];
17531
+ const newPath = chunkWV4TD2HZ_cjs.joinFolderPath(newPrefix);
17532
+ const docs = chunkWV4TD2HZ_cjs.collectFolderDocs(documents, folder.path);
17533
+ try {
17534
+ if (await renameFolder(docs, folder.path, newPrefix) > 0) {
17535
+ notify14(`Renamed folder to "${name}"`, "success");
17536
+ }
17537
+ } catch {
17538
+ notify14("Failed to rename folder. Please try again.", "error");
17539
+ return;
17540
+ }
17541
+ if (oldPath) removePendingFolder(wsId, oldPath);
17542
+ if (docs.length === 0 && newPath) addPendingFolder(wsId, newPath);
17543
+ },
17544
+ [wsId, folders, documents, renameFolder, notify14, addPendingFolder, removePendingFolder]
17545
+ );
17546
+ const cancelFolderName = react.useCallback(() => setEditingFolderPath(null), []);
17547
+ const clearSelection = react.useCallback(() => {
17548
+ if (selectedIdsRef.current.length > 0) onSelectionChange([]);
17549
+ anchorRef.current = null;
17550
+ }, [onSelectionChange]);
17551
+ const handleSelect = react.useCallback(
17552
+ (doc, e) => {
17553
+ const id = doc.external_id;
17554
+ if (e.shiftKey) {
17555
+ const from = anchorRef.current ?? id;
17556
+ const a = orderedFileIds.indexOf(from);
17557
+ const b = orderedFileIds.indexOf(id);
17558
+ if (a !== -1 && b !== -1) {
17559
+ anchorRef.current = from;
17560
+ const [lo, hi] = a < b ? [a, b] : [b, a];
17561
+ onSelectionChange(orderedFileIds.slice(lo, hi + 1));
17562
+ return;
17563
+ }
17564
+ }
17565
+ if (e.metaKey || e.ctrlKey) {
17566
+ onSelectionChange(
17567
+ selectedSet.has(id) ? selectedIds.filter((s) => s !== id) : [...selectedIds, id]
17568
+ );
17569
+ anchorRef.current = id;
17570
+ return;
17571
+ }
17572
+ onSelectionChange([id]);
17573
+ anchorRef.current = id;
17574
+ },
17575
+ [onSelectionChange, orderedFileIds, selectedIds, selectedSet]
17576
+ );
17577
+ const handleToggle = react.useCallback(
17578
+ (doc, e) => {
17579
+ e.stopPropagation();
17580
+ const id = doc.external_id;
17581
+ onSelectionChange(
17582
+ selectedSet.has(id) ? selectedIds.filter((s) => s !== id) : [...selectedIds, id]
17583
+ );
17584
+ anchorRef.current = id;
17585
+ },
17586
+ [onSelectionChange, selectedIds, selectedSet]
17587
+ );
17588
+ const handleToggleFolder = react.useCallback(
17589
+ (folder, e) => {
17590
+ e.stopPropagation();
17591
+ const ids = chunkWV4TD2HZ_cjs.collectFolderDocs(documents, folder.path).map((d) => d.external_id);
17592
+ if (ids.length === 0) return;
17593
+ if (ids.every((id) => selectedSet.has(id))) {
17594
+ const remove = new Set(ids);
17595
+ onSelectionChange(selectedIds.filter((id) => !remove.has(id)));
17596
+ } else {
17597
+ onSelectionChange(Array.from(/* @__PURE__ */ new Set([...selectedIds, ...ids])));
17598
+ }
17599
+ anchorRef.current = null;
17600
+ },
17601
+ [documents, onSelectionChange, selectedIds, selectedSet]
17602
+ );
17603
+ const handleOpenFile = react.useCallback(
17604
+ (doc) => onOpenDocument(doc.external_id),
17605
+ [onOpenDocument]
17606
+ );
17607
+ const handleOpenInReview = react.useMemo(
17608
+ () => onOpenInReview ? (doc) => onOpenInReview(doc.external_id) : void 0,
17609
+ [onOpenInReview]
17610
+ );
17611
+ const startRename = react.useCallback((doc) => setRenamingId(doc.external_id), []);
17612
+ const cancelRename = react.useCallback(() => setRenamingId(null), []);
17613
+ const commitRename = react.useCallback(
17614
+ async (doc, name) => {
17615
+ setRenamingId(null);
17616
+ try {
17617
+ await updateDocument.mutateAsync({
17618
+ documents: [
17619
+ { external_id: doc.external_id, doc_metadata: { ...doc.doc_metadata, title: name } }
17620
+ ]
17621
+ });
17622
+ notify14(`Renamed to "${name}"`, "success");
17623
+ } catch {
17624
+ notify14("Failed to rename. Please try again.", "error");
17625
+ }
17626
+ },
17627
+ [updateDocument, notify14]
17628
+ );
17629
+ react.useEffect(() => {
17630
+ const onKey = (e) => {
17631
+ if (e.key !== "F2" || renamingId) return;
17632
+ const target = e.target;
17633
+ if (target && /^(input|textarea|select)$/i.test(target.tagName)) return;
17634
+ if (selectedIdsRef.current.length === 1) setRenamingId(selectedIdsRef.current[0]);
17635
+ };
17636
+ window.addEventListener("keydown", onKey);
17637
+ return () => window.removeEventListener("keydown", onKey);
17638
+ }, [renamingId]);
17639
+ const handleDownload = react.useCallback(
17640
+ (doc) => void downloadDocument(doc),
17641
+ [downloadDocument]
17642
+ );
17643
+ const handleMove = react.useMemo(
17644
+ () => onMoveSelected ? (doc) => {
17645
+ onSelectionChange([doc.external_id]);
17646
+ onMoveSelected();
17647
+ } : void 0,
17648
+ [onSelectionChange, onMoveSelected]
17649
+ );
17650
+ const handleDelete = react.useCallback(
17651
+ async (doc) => {
17652
+ const name = chunkWV4TD2HZ_cjs.getExplorerDisplayName(doc);
17653
+ const confirmed = await confirm({
17654
+ message: `Delete "${name}"? ${chunkWV4TD2HZ_cjs.RECENTLY_DELETED_HINT}`,
17655
+ title: "Delete file"
17656
+ });
17657
+ if (!confirmed) return;
17658
+ try {
17659
+ await deleteDocuments.mutateAsync([doc.external_id]);
17660
+ onSelectionChange(selectedIdsRef.current.filter((id) => id !== doc.external_id));
17661
+ notify14(`Deleted "${name}"`, "success");
17662
+ } catch {
17663
+ notify14("Failed to delete. Please try again.", "error");
17664
+ }
17665
+ },
17666
+ [confirm, deleteDocuments, onSelectionChange, notify14]
17667
+ );
17668
+ const startFolderRename = react.useCallback(
17669
+ (folder) => setEditingFolderPath(folder.path.join("/")),
17670
+ []
17671
+ );
17672
+ const handleFolderDownload = react.useCallback(
17673
+ (folder) => {
17674
+ const docs = chunkWV4TD2HZ_cjs.collectFolderDocs(documents, folder.path);
17675
+ if (docs.length > 0) void downloadDocuments(docs);
17676
+ },
17677
+ [documents, downloadDocuments]
17678
+ );
17679
+ const handleFolderMove = react.useMemo(() => {
17680
+ if (onFolderMove) return onFolderMove;
17681
+ if (!onMoveSelected) return void 0;
17682
+ return (folder) => {
17683
+ const ids = chunkWV4TD2HZ_cjs.collectFolderDocs(documents, folder.path).map((d) => d.external_id);
17684
+ if (ids.length === 0) return;
17685
+ onSelectionChange(ids);
17686
+ onMoveSelected();
17687
+ };
17688
+ }, [documents, onFolderMove, onMoveSelected, onSelectionChange]);
17689
+ const handleFolderDelete = react.useCallback(
17690
+ async (folder) => {
17691
+ const docs = chunkWV4TD2HZ_cjs.collectFolderDocs(documents, folder.path);
17692
+ if (docs.length === 0) {
17693
+ const path = chunkWV4TD2HZ_cjs.joinFolderPath(folder.path);
17694
+ if (wsId && path) removePendingFolder(wsId, path);
17695
+ return;
17696
+ }
17697
+ const confirmed = await confirm({
17698
+ message: `Delete folder "${folder.name}" and its ${docs.length} item${docs.length === 1 ? "" : "s"}? ${chunkWV4TD2HZ_cjs.RECENTLY_DELETED_HINT_PLURAL}`,
17699
+ title: "Delete folder"
17700
+ });
17701
+ if (!confirmed) return;
17702
+ try {
17703
+ const ids = docs.map((d) => d.external_id);
17704
+ await deleteDocuments.mutateAsync(ids);
17705
+ const removed = new Set(ids);
17706
+ onSelectionChange(selectedIdsRef.current.filter((id) => !removed.has(id)));
17707
+ notify14(`Deleted folder "${folder.name}"`, "success");
17708
+ } catch {
17709
+ notify14("Failed to delete folder. Please try again.", "error");
17710
+ }
17711
+ },
17712
+ [confirm, documents, deleteDocuments, onSelectionChange, removePendingFolder, wsId, notify14]
17713
+ );
17714
+ const canDeleteFolder = react.useCallback(
17715
+ (folder) => canUpload && chunkWV4TD2HZ_cjs.collectFolderDocs(documents, folder.path).every(
17716
+ (doc) => chunkWV4TD2HZ_cjs.canDeleteDocument(doc, userId, role)
17717
+ ),
17718
+ [canUpload, documents, userId, role]
17719
+ );
17720
+ const handleBackgroundClick = react.useCallback(
17721
+ (e) => {
17722
+ if (didMarqueeRef.current) {
17723
+ didMarqueeRef.current = false;
17724
+ return;
17725
+ }
17726
+ if (!e.target.closest('[data-testid^="explorer-"]')) clearSelection();
17727
+ },
17728
+ [clearSelection]
17729
+ );
17730
+ const moveDocs = react.useCallback(
17731
+ async (ids, folder) => {
17732
+ if (ids.length === 0) return;
17733
+ try {
17734
+ await updateDocument.mutateAsync({
17735
+ documents: ids.map((external_id) => ({ external_id, folder }))
17736
+ });
17737
+ clearSelection();
17738
+ notify14(
17739
+ `Moved ${ids.length} item${ids.length === 1 ? "" : "s"} to "${folder ?? "Home"}"`,
17740
+ "success"
17741
+ );
17742
+ } catch {
17743
+ notify14("Failed to move. Please try again.", "error");
17744
+ }
17745
+ },
17746
+ [updateDocument, clearSelection, notify14]
17747
+ );
17748
+ const sensors = core.useSensors(
17749
+ core.useSensor(core.MouseSensor, { activationConstraint: { distance: 6 } }),
17750
+ core.useSensor(core.TouchSensor, { activationConstraint: { delay: 150, tolerance: 8 } })
17751
+ );
17752
+ const collisionDetection = react.useCallback((args) => {
17753
+ const hits = core.pointerWithin(args);
17754
+ return hits.length > 0 ? hits : core.rectIntersection(args);
17755
+ }, []);
17756
+ const handleDragStart = react.useCallback(
17757
+ (event) => {
17758
+ const docId = event.active.data.current?.docId;
17759
+ if (!docId) return;
17760
+ setActiveDragId(docId);
17761
+ if (!selectedIdsRef.current.includes(docId)) {
17762
+ onSelectionChange([docId]);
17763
+ dragIdsRef.current = [docId];
17764
+ } else {
17765
+ dragIdsRef.current = selectedIdsRef.current;
17766
+ }
17767
+ },
17768
+ [onSelectionChange]
17769
+ );
17770
+ const handleDragEnd = react.useCallback(
17771
+ (event) => {
17772
+ setActiveDragId(null);
17773
+ const data = event.over?.data.current;
17774
+ if (data?.type === "folder" && data.path) {
17775
+ const targetFolder = chunkWV4TD2HZ_cjs.joinFolderPath(data.path);
17776
+ const moving = dragIdsRef.current.filter((id) => {
17777
+ const doc = documents.find((d) => d.external_id === id);
17778
+ return doc && (doc.folder ?? null) !== targetFolder;
17779
+ });
17780
+ void moveDocs(moving, targetFolder);
17781
+ }
17782
+ },
17783
+ [documents, moveDocs]
17784
+ );
17785
+ const handleNativeDragOver = react.useCallback(
17786
+ (e) => {
17787
+ if (!canUpload) return;
17788
+ if (e.dataTransfer.types.includes("Files")) {
17789
+ e.preventDefault();
17790
+ e.dataTransfer.dropEffect = "copy";
17791
+ }
17792
+ },
17793
+ [canUpload]
17794
+ );
17795
+ const handleNativeDragEnter = react.useCallback(
17796
+ (e) => {
17797
+ if (!canUpload || !e.dataTransfer.types.includes("Files")) return;
17798
+ fileDragDepth.current += 1;
17799
+ setIsFileDragOver(true);
17800
+ },
17801
+ [canUpload]
17802
+ );
17803
+ const handleNativeDragLeave = react.useCallback(() => {
17804
+ fileDragDepth.current = Math.max(0, fileDragDepth.current - 1);
17805
+ if (fileDragDepth.current === 0) setIsFileDragOver(false);
17806
+ }, []);
17807
+ const handleNativeDrop = react.useCallback(
17808
+ (e) => {
17809
+ fileDragDepth.current = 0;
17810
+ setIsFileDragOver(false);
17811
+ if (!canUpload) return;
17812
+ const dropped = Array.from(e.dataTransfer.files ?? []);
17813
+ if (dropped.length > 0) {
17814
+ e.preventDefault();
17815
+ onUploadFiles(dropped, chunkWV4TD2HZ_cjs.joinFolderPath(currentPath));
17816
+ }
17817
+ },
17818
+ [canUpload, currentPath, onUploadFiles]
17819
+ );
17820
+ const activeDoc = activeDragId ? documents.find((d) => d.external_id === activeDragId) : null;
17821
+ const dragCount = dragIdsRef.current.length || 1;
17822
+ if (isWholeWorkspaceEmpty) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: emptyWorkspace });
17823
+ return /* @__PURE__ */ jsxRuntime.jsxs(
17824
+ core.DndContext,
17825
+ {
17826
+ sensors,
17827
+ collisionDetection,
17828
+ onDragStart: handleDragStart,
17829
+ onDragEnd: handleDragEnd,
17830
+ onDragCancel: () => setActiveDragId(null),
17831
+ children: [
17832
+ /* @__PURE__ */ jsxRuntime.jsx(chunkWV4TD2HZ_cjs.ExplorerFrame, { "data-testid": "documents-explorer", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWV4TD2HZ_cjs.ExplorerStage, { children: [
17833
+ /* @__PURE__ */ jsxRuntime.jsx(
17834
+ chunkWV4TD2HZ_cjs.ExplorerScroller,
17835
+ {
17836
+ ref: scrollRef,
17837
+ onClick: handleBackgroundClick,
17838
+ onPointerDown: handleScrollPointerDown,
17839
+ onDragEnter: handleNativeDragEnter,
17840
+ onDragOver: handleNativeDragOver,
17841
+ onDragLeave: handleNativeDragLeave,
17842
+ onDrop: handleNativeDrop,
17843
+ "data-testid": "explorer-scroll",
17844
+ children: isLoading && documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkWV4TD2HZ_cjs.ExplorerLoadingTiles, {}) : entries.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
17845
+ chunkWV4TD2HZ_cjs.ExplorerEmpty,
17846
+ {
17847
+ title: isSearching ? `No files match "${search.trim()}"` : "This folder is empty",
17848
+ description: isSearching ? "Try a different search." : canUpload ? "Drop files here or use Upload to add documents." : "No documents here yet."
17849
+ }
17850
+ ) : containerWidth === 0 ? (
17851
+ // Not measured yet: rendering now would flash one stretched column.
17852
+ /* @__PURE__ */ jsxRuntime.jsx(chunkWV4TD2HZ_cjs.ExplorerLoadingTiles, {})
17853
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
17854
+ "div",
17855
+ {
17856
+ style: {
17857
+ height: rowVirtualizer.getTotalSize(),
17858
+ position: "relative",
17859
+ width: "100%"
17860
+ },
17861
+ children: virtualRows.map((virtualRow) => {
17862
+ const start = virtualRow.index * columnCount;
17863
+ const rowEntries = entries.slice(start, start + columnCount);
17864
+ return /* @__PURE__ */ jsxRuntime.jsx(
17865
+ "div",
17866
+ {
17867
+ style: {
17868
+ position: "absolute",
17869
+ top: 0,
17870
+ left: 0,
17871
+ width: "100%",
17872
+ height: tileHeight,
17873
+ transform: `translateY(${virtualRow.start}px)`,
17874
+ display: "grid",
17875
+ gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))`,
17876
+ columnGap: GRID_GAP
17877
+ },
17878
+ children: rowEntries.map((entry) => {
17879
+ if (entry.kind === "folder") {
17880
+ const key = entry.path.join("/");
17881
+ return /* @__PURE__ */ jsxRuntime.jsx(
17882
+ FolderTile,
17883
+ {
17884
+ folder: entry,
17885
+ density,
17886
+ editing: editingFolderPath === key,
17887
+ selected: folderSelection.get(key)?.all,
17888
+ partiallySelected: folderSelection.get(key)?.some,
17889
+ documents: folderDocs.get(key) ?? NO_DOCUMENTS,
17890
+ onOpen: openFolder,
17891
+ onToggleSelect: handleToggleFolder,
17892
+ onCommitName: commitFolderName,
17893
+ onCancelName: cancelFolderName,
17894
+ onStartRename: canUpload ? startFolderRename : void 0,
17895
+ onDownload: handleFolderDownload,
17896
+ onMove: canUpload ? handleFolderMove : void 0,
17897
+ onDelete: canDeleteFolder(entry) ? handleFolderDelete : void 0
17898
+ },
17899
+ `folder:${key}`
17900
+ );
17901
+ }
17902
+ const doc = entry.doc;
17903
+ return /* @__PURE__ */ jsxRuntime.jsx(
17904
+ FileTile,
17905
+ {
17906
+ doc,
17907
+ density,
17908
+ selected: selectedSet.has(doc.external_id),
17909
+ dragging: activeDragId === doc.external_id,
17910
+ dndActive: activeDragId !== null,
17911
+ renaming: renamingId === doc.external_id,
17912
+ canDelete: chunkWV4TD2HZ_cjs.canDeleteDocument(doc, userId, role),
17913
+ thumbnailUrl: thumbnailsById.get(doc.external_id),
17914
+ modifiedBy: userById.get(
17915
+ doc.updated_by_ext_id ?? doc.created_by_ext_id
17916
+ ),
17917
+ tagNameById,
17918
+ onSelect: handleSelect,
17919
+ onToggle: handleToggle,
17920
+ onOpen: handleOpenFile,
17921
+ onReview: handleOpenInReview,
17922
+ onStartRename: startRename,
17923
+ onCommitRename: commitRename,
17924
+ onCancelRename: cancelRename,
17925
+ onDownload: handleDownload,
17926
+ onMove: canUpload ? handleMove : void 0,
17927
+ onDelete: handleDelete
17928
+ },
17929
+ doc.external_id
17930
+ );
17931
+ })
17932
+ },
17933
+ virtualRow.key
17934
+ );
17935
+ })
17936
+ }
17937
+ )
17938
+ }
17939
+ ),
17940
+ /* @__PURE__ */ jsxRuntime.jsx(chunkWV4TD2HZ_cjs.ExplorerMarquee, { ref: marqueeOverlayRef, "data-testid": "explorer-marquee" }),
17941
+ isFileDragOver && /* @__PURE__ */ jsxRuntime.jsx(
17942
+ chunkWV4TD2HZ_cjs.ExplorerDropOverlay,
17943
+ {
17944
+ label: `Drop to upload${currentPath.length > 0 ? ` to "${currentPath[currentPath.length - 1]}"` : ""}`
17945
+ }
17946
+ )
17947
+ ] }) }),
17948
+ /* @__PURE__ */ jsxRuntime.jsx(core.DragOverlay, { dropAnimation: null, children: activeDoc ? /* @__PURE__ */ jsxRuntime.jsx(DragPreview, { doc: activeDoc, count: dragCount }) : null })
17949
+ ]
17950
+ }
17951
+ );
17952
+ });
17953
+ function DragPreview({ doc, count }) {
17954
+ const Icon = ui.getFileTypeIcon(doc.file_name, { mime: doc.file_type });
17955
+ return /* @__PURE__ */ jsxRuntime.jsx(
17956
+ chunkWV4TD2HZ_cjs.ExplorerDragPreview,
17957
+ {
17958
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 20 }),
17959
+ title: ui.getDocumentTitle(doc, doc.file_name ?? "Untitled"),
17960
+ count
17961
+ }
17962
+ );
17963
+ }
16816
17964
  function ActiveChat({ agentId, workspaceId }) {
16817
17965
  const chat = react$1.useArbiChat({
16818
17966
  agentId,
@@ -16970,43 +18118,43 @@ Object.defineProperty(exports, "useWorkspaceDocs", {
16970
18118
  });
16971
18119
  Object.defineProperty(exports, "ConnectedWorkflowDocumentsField", {
16972
18120
  enumerable: true,
16973
- get: function () { return chunkCQCNU5KT_cjs.ConnectedWorkflowDocumentsField; }
18121
+ get: function () { return chunkIJEISII2_cjs.ConnectedWorkflowDocumentsField; }
16974
18122
  });
16975
18123
  Object.defineProperty(exports, "ConnectedWorkflowLauncher", {
16976
18124
  enumerable: true,
16977
- get: function () { return chunkCQCNU5KT_cjs.ConnectedWorkflowLauncher; }
18125
+ get: function () { return chunkIJEISII2_cjs.ConnectedWorkflowLauncher; }
16978
18126
  });
16979
18127
  Object.defineProperty(exports, "ConnectedWorkflowsTable", {
16980
18128
  enumerable: true,
16981
- get: function () { return chunkCQCNU5KT_cjs.ConnectedWorkflowsTable; }
18129
+ get: function () { return chunkIJEISII2_cjs.ConnectedWorkflowsTable; }
16982
18130
  });
16983
18131
  Object.defineProperty(exports, "DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS", {
16984
18132
  enumerable: true,
16985
- get: function () { return chunkCQCNU5KT_cjs.DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS; }
18133
+ get: function () { return chunkIJEISII2_cjs.DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS; }
16986
18134
  });
16987
18135
  Object.defineProperty(exports, "NativeDocxSupportProvider", {
16988
18136
  enumerable: true,
16989
- get: function () { return chunkCQCNU5KT_cjs.NativeDocxSupportProvider; }
18137
+ get: function () { return chunkIJEISII2_cjs.NativeDocxSupportProvider; }
16990
18138
  });
16991
18139
  Object.defineProperty(exports, "toWorkflowFieldDocument", {
16992
18140
  enumerable: true,
16993
- get: function () { return chunkCQCNU5KT_cjs.toWorkflowFieldDocument; }
18141
+ get: function () { return chunkIJEISII2_cjs.toWorkflowFieldDocument; }
16994
18142
  });
16995
18143
  Object.defineProperty(exports, "useConnectedAgentOptions", {
16996
18144
  enumerable: true,
16997
- get: function () { return chunkCQCNU5KT_cjs.useConnectedAgentOptions; }
18145
+ get: function () { return chunkIJEISII2_cjs.useConnectedAgentOptions; }
16998
18146
  });
16999
18147
  Object.defineProperty(exports, "useConnectedWorkflowScopeSource", {
17000
18148
  enumerable: true,
17001
- get: function () { return chunkCQCNU5KT_cjs.useConnectedWorkflowScopeSource; }
18149
+ get: function () { return chunkIJEISII2_cjs.useConnectedWorkflowScopeSource; }
17002
18150
  });
17003
18151
  Object.defineProperty(exports, "useConnectedWorkspaceRole", {
17004
18152
  enumerable: true,
17005
- get: function () { return chunkCQCNU5KT_cjs.useConnectedWorkspaceRole; }
18153
+ get: function () { return chunkIJEISII2_cjs.useConnectedWorkspaceRole; }
17006
18154
  });
17007
18155
  Object.defineProperty(exports, "useNativeDocxSupport", {
17008
18156
  enumerable: true,
17009
- get: function () { return chunkCQCNU5KT_cjs.useNativeDocxSupport; }
18157
+ get: function () { return chunkIJEISII2_cjs.useNativeDocxSupport; }
17010
18158
  });
17011
18159
  Object.defineProperty(exports, "DocumentViewerSupportProvider", {
17012
18160
  enumerable: true,
@@ -17065,6 +18213,7 @@ exports.ConnectedCalendar = ConnectedCalendar;
17065
18213
  exports.ConnectedDangerZone = ConnectedDangerZone;
17066
18214
  exports.ConnectedDriveSyncDialog = ConnectedDriveSyncDialog;
17067
18215
  exports.ConnectedFactsPage = ConnectedFactsPage;
18216
+ exports.ConnectedFilesExplorer = ConnectedFilesExplorer;
17068
18217
  exports.ConnectedIdentityVerification = ConnectedIdentityVerification;
17069
18218
  exports.ConnectedLogoutDialog = ConnectedLogoutDialog;
17070
18219
  exports.ConnectedMailAccounts = ConnectedMailAccounts;
@@ -17111,7 +18260,10 @@ exports.DEFAULT_SEARCH_ROW_LABELS = DEFAULT_SEARCH_ROW_LABELS;
17111
18260
  exports.DEFAULT_SETTINGS_SECTIONS = DEFAULT_SETTINGS_SECTIONS;
17112
18261
  exports.DEFAULT_TIMELINE_LABEL_WIDTH = DEFAULT_TIMELINE_LABEL_WIDTH;
17113
18262
  exports.DEFAULT_WORKSPACE_LIST_LABELS = DEFAULT_WORKSPACE_LIST_LABELS;
18263
+ exports.DocumentSyncGlyph = DocumentSyncGlyph;
17114
18264
  exports.FACTS_GRID_ID = FACTS_GRID_ID;
18265
+ exports.FileTooltipContent = FileTooltipContent;
18266
+ exports.FilesSupportProvider = FilesSupportProvider;
17115
18267
  exports.InvoicesModal = InvoicesModal;
17116
18268
  exports.NewProjectFlow = NewProjectFlow;
17117
18269
  exports.NotificationCenter = NotificationCenter;
@@ -17124,6 +18276,9 @@ exports.SETTINGS_SECTION_IDS = SETTINGS_SECTION_IDS;
17124
18276
  exports.SessionStatusIcon = SessionStatusIcon;
17125
18277
  exports.SharedProjects = SharedProjects;
17126
18278
  exports.StreamedArtifact = StreamedArtifact;
18279
+ exports.TILE_DEFAULT = TILE_DEFAULT;
18280
+ exports.TILE_MAX = TILE_MAX;
18281
+ exports.TILE_MIN = TILE_MIN;
17127
18282
  exports.WORKSPACES_TAB_ID = WORKSPACES_TAB_ID;
17128
18283
  exports.WorkflowRunThread = WorkflowRunThread;
17129
18284
  exports.accountSettingsSection = accountSettingsSection;
@@ -17135,6 +18290,7 @@ exports.countNotificationTypes = countNotificationTypes;
17135
18290
  exports.defaultUnmetPasswordRequirement = defaultUnmetPasswordRequirement;
17136
18291
  exports.filterNotificationCenterItems = filterNotificationCenterItems;
17137
18292
  exports.formatLastSync = formatLastSync;
18293
+ exports.isActiveDocumentStatus = isActiveDocumentStatus;
17138
18294
  exports.mailSettingsSection = mailSettingsSection;
17139
18295
  exports.openMeetingLink = openMeetingLink;
17140
18296
  exports.privacySettingsSection = privacySettingsSection;
@@ -17143,6 +18299,7 @@ exports.requestCalendarComposer = requestCalendarComposer;
17143
18299
  exports.requestCalendarEvent = requestCalendarEvent;
17144
18300
  exports.requestProjectBillingFocus = requestProjectBillingFocus;
17145
18301
  exports.resolveMailbox = resolveMailbox;
18302
+ exports.startMenuItem = startMenuItem;
17146
18303
  exports.toWorkspaceSummary = toWorkspaceSummary;
17147
18304
  exports.useAutoRefreshPendingProjects = useAutoRefreshPendingProjects;
17148
18305
  exports.useCalendarViewStore = useCalendarViewStore;
@@ -17151,9 +18308,14 @@ exports.useConnectedShellWorkspaces = useConnectedShellWorkspaces;
17151
18308
  exports.useConnectedWorkNotifications = useConnectedWorkNotifications;
17152
18309
  exports.useConnectedWorkspaceList = useConnectedWorkspaceList;
17153
18310
  exports.useConnectedWorkspaceSettings = useConnectedWorkspaceSettings;
18311
+ exports.useFilesStore = useFilesStore;
18312
+ exports.useFilesSupport = useFilesSupport;
18313
+ exports.useOfflineDocumentIds = useOfflineDocumentIds;
17154
18314
  exports.useOpenBillingPortal = useOpenBillingPortal;
18315
+ exports.usePendingFolders = usePendingFolders;
17155
18316
  exports.useProjectBillingFocus = useProjectBillingFocus;
17156
18317
  exports.useReferralReward = useReferralReward;
18318
+ exports.useViewingDocumentId = useViewingDocumentId;
17157
18319
  exports.windowLabel = windowLabel;
17158
18320
  exports.workflowRunView = workflowRunView;
17159
18321
  //# sourceMappingURL=index.cjs.map