@sync-in/server 1.10.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1057) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE +1 -1
  3. package/README.md +3 -11
  4. package/environment/environment.dist.min.yaml +1 -1
  5. package/environment/environment.dist.yaml +173 -28
  6. package/package.json +18 -17
  7. package/server/app.bootstrap.js +1 -5
  8. package/server/app.bootstrap.js.map +1 -1
  9. package/server/app.constants.js +1 -5
  10. package/server/app.constants.js.map +1 -1
  11. package/server/app.e2e-spec.js +1 -5
  12. package/server/app.e2e-spec.js.map +1 -1
  13. package/server/app.functions.js +1 -5
  14. package/server/app.functions.js.map +1 -1
  15. package/server/app.module.js +1 -5
  16. package/server/app.module.js.map +1 -1
  17. package/server/app.service.js +1 -5
  18. package/server/app.service.js.map +1 -1
  19. package/server/app.service.spec.js +2 -6
  20. package/server/app.service.spec.js.map +1 -1
  21. package/server/applications/admin/admin.module.js +1 -5
  22. package/server/applications/admin/admin.module.js.map +1 -1
  23. package/server/applications/admin/constants/routes.js +1 -5
  24. package/server/applications/admin/constants/routes.js.map +1 -1
  25. package/server/applications/admin/interfaces/check-update.interfaces.js +1 -5
  26. package/server/applications/admin/interfaces/check-update.interfaces.js.map +1 -1
  27. package/server/applications/admin/services/admin-scheduler.service.js +1 -5
  28. package/server/applications/admin/services/admin-scheduler.service.js.map +1 -1
  29. package/server/applications/admin/services/admin.service.js +13 -8
  30. package/server/applications/admin/services/admin.service.js.map +1 -1
  31. package/server/applications/admin/services/admin.service.spec.js +1 -5
  32. package/server/applications/admin/services/admin.service.spec.js.map +1 -1
  33. package/server/applications/admin/utils/check-update.js +1 -5
  34. package/server/applications/admin/utils/check-update.js.map +1 -1
  35. package/server/applications/applications.config.js +1 -5
  36. package/server/applications/applications.config.js.map +1 -1
  37. package/server/applications/applications.constants.js +5 -5
  38. package/server/applications/applications.constants.js.map +1 -1
  39. package/server/applications/applications.module.js +1 -5
  40. package/server/applications/applications.module.js.map +1 -1
  41. package/server/applications/comments/comments.controller.js +1 -5
  42. package/server/applications/comments/comments.controller.js.map +1 -1
  43. package/server/applications/comments/comments.controller.spec.js +1 -5
  44. package/server/applications/comments/comments.controller.spec.js.map +1 -1
  45. package/server/applications/comments/comments.module.js +1 -5
  46. package/server/applications/comments/comments.module.js.map +1 -1
  47. package/server/applications/comments/constants/routes.js +1 -5
  48. package/server/applications/comments/constants/routes.js.map +1 -1
  49. package/server/applications/comments/dto/comment.dto.js +1 -5
  50. package/server/applications/comments/dto/comment.dto.js.map +1 -1
  51. package/server/applications/comments/interfaces/comment-recent.interface.js +1 -5
  52. package/server/applications/comments/interfaces/comment-recent.interface.js.map +1 -1
  53. package/server/applications/comments/schemas/comment.interface.js +1 -5
  54. package/server/applications/comments/schemas/comment.interface.js.map +1 -1
  55. package/server/applications/comments/schemas/comments.schema.js +1 -5
  56. package/server/applications/comments/schemas/comments.schema.js.map +1 -1
  57. package/server/applications/comments/services/comments-manager.service.js +9 -7
  58. package/server/applications/comments/services/comments-manager.service.js.map +1 -1
  59. package/server/applications/comments/services/comments-manager.service.spec.js +10 -8
  60. package/server/applications/comments/services/comments-manager.service.spec.js.map +1 -1
  61. package/server/applications/comments/services/comments-queries.service.js +1 -5
  62. package/server/applications/comments/services/comments-queries.service.js.map +1 -1
  63. package/server/applications/files/adapters/files-indexer-mysql.service.js +29 -12
  64. package/server/applications/files/adapters/files-indexer-mysql.service.js.map +1 -1
  65. package/server/applications/files/adapters/files-indexer-mysql.service.spec.js +1 -5
  66. package/server/applications/files/adapters/files-indexer-mysql.service.spec.js.map +1 -1
  67. package/server/applications/files/constants/cache.js +1 -5
  68. package/server/applications/files/constants/cache.js.map +1 -1
  69. package/server/applications/files/constants/compress.js +1 -5
  70. package/server/applications/files/constants/compress.js.map +1 -1
  71. package/server/applications/files/constants/files.js +1 -5
  72. package/server/applications/files/constants/files.js.map +1 -1
  73. package/server/applications/files/constants/indexing.js +1 -5
  74. package/server/applications/files/constants/indexing.js.map +1 -1
  75. package/server/applications/files/constants/operations.js +1 -5
  76. package/server/applications/files/constants/operations.js.map +1 -1
  77. package/server/applications/files/constants/routes.js +1 -5
  78. package/server/applications/files/constants/routes.js.map +1 -1
  79. package/server/applications/files/constants/samples.js +1 -5
  80. package/server/applications/files/constants/samples.js.map +1 -1
  81. package/server/applications/files/dto/file-operations.dto.js +1 -5
  82. package/server/applications/files/dto/file-operations.dto.js.map +1 -1
  83. package/server/applications/files/events/file-task-event.js +1 -5
  84. package/server/applications/files/events/file-task-event.js.map +1 -1
  85. package/server/applications/files/files-tasks.controller.js +1 -5
  86. package/server/applications/files/files-tasks.controller.js.map +1 -1
  87. package/server/applications/files/files-tasks.controller.spec.js +1 -5
  88. package/server/applications/files/files-tasks.controller.spec.js.map +1 -1
  89. package/server/applications/files/files.config.js +1 -5
  90. package/server/applications/files/files.config.js.map +1 -1
  91. package/server/applications/files/files.controller.js +1 -5
  92. package/server/applications/files/files.controller.js.map +1 -1
  93. package/server/applications/files/files.controller.spec.js +1 -5
  94. package/server/applications/files/files.controller.spec.js.map +1 -1
  95. package/server/applications/files/files.module.js +1 -5
  96. package/server/applications/files/files.module.js.map +1 -1
  97. package/server/applications/files/interfaces/file-db-props.interface.js +1 -5
  98. package/server/applications/files/interfaces/file-db-props.interface.js.map +1 -1
  99. package/server/applications/files/interfaces/file-lock.interface.js +1 -5
  100. package/server/applications/files/interfaces/file-lock.interface.js.map +1 -1
  101. package/server/applications/files/interfaces/file-parse-index.js +1 -5
  102. package/server/applications/files/interfaces/file-parse-index.js.map +1 -1
  103. package/server/applications/files/interfaces/file-props.interface.js +1 -5
  104. package/server/applications/files/interfaces/file-props.interface.js.map +1 -1
  105. package/server/applications/files/interfaces/file-recent-location.interface.js +1 -5
  106. package/server/applications/files/interfaces/file-recent-location.interface.js.map +1 -1
  107. package/server/applications/files/interfaces/file-space.interface.js +1 -5
  108. package/server/applications/files/interfaces/file-space.interface.js.map +1 -1
  109. package/server/applications/files/interfaces/file-tree.interface.js +1 -5
  110. package/server/applications/files/interfaces/file-tree.interface.js.map +1 -1
  111. package/server/applications/files/models/file-error.js +1 -5
  112. package/server/applications/files/models/file-error.js.map +1 -1
  113. package/server/applications/files/models/file-lock-error.js +1 -5
  114. package/server/applications/files/models/file-lock-error.js.map +1 -1
  115. package/server/applications/files/models/file-task.js +1 -5
  116. package/server/applications/files/models/file-task.js.map +1 -1
  117. package/server/applications/files/models/files-indexer.js +1 -5
  118. package/server/applications/files/models/files-indexer.js.map +1 -1
  119. package/server/applications/files/modules/collabora-online/collabora-online-environment.decorator.js +1 -5
  120. package/server/applications/files/modules/collabora-online/collabora-online-environment.decorator.js.map +1 -1
  121. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.js +21 -10
  122. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.js.map +1 -1
  123. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.spec.js +1 -5
  124. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.spec.js.map +1 -1
  125. package/server/applications/files/modules/collabora-online/collabora-online.config.js +1 -5
  126. package/server/applications/files/modules/collabora-online/collabora-online.config.js.map +1 -1
  127. package/server/applications/files/modules/collabora-online/collabora-online.constants.js +1 -5
  128. package/server/applications/files/modules/collabora-online/collabora-online.constants.js.map +1 -1
  129. package/server/applications/files/modules/collabora-online/collabora-online.controller.js +1 -5
  130. package/server/applications/files/modules/collabora-online/collabora-online.controller.js.map +1 -1
  131. package/server/applications/files/modules/collabora-online/collabora-online.controller.spec.js +1 -5
  132. package/server/applications/files/modules/collabora-online/collabora-online.controller.spec.js.map +1 -1
  133. package/server/applications/files/modules/collabora-online/collabora-online.dtos.js +1 -5
  134. package/server/applications/files/modules/collabora-online/collabora-online.dtos.js.map +1 -1
  135. package/server/applications/files/modules/collabora-online/collabora-online.guard.js +1 -5
  136. package/server/applications/files/modules/collabora-online/collabora-online.guard.js.map +1 -1
  137. package/server/applications/files/modules/collabora-online/collabora-online.guard.spec.js +1 -5
  138. package/server/applications/files/modules/collabora-online/collabora-online.guard.spec.js.map +1 -1
  139. package/server/applications/files/modules/collabora-online/collabora-online.interface.js +1 -5
  140. package/server/applications/files/modules/collabora-online/collabora-online.interface.js.map +1 -1
  141. package/server/applications/files/modules/collabora-online/collabora-online.module.js +1 -5
  142. package/server/applications/files/modules/collabora-online/collabora-online.module.js.map +1 -1
  143. package/server/applications/files/modules/collabora-online/collabora-online.routes.js +1 -5
  144. package/server/applications/files/modules/collabora-online/collabora-online.routes.js.map +1 -1
  145. package/server/applications/files/modules/collabora-online/collabora-online.strategy.js +1 -5
  146. package/server/applications/files/modules/collabora-online/collabora-online.strategy.js.map +1 -1
  147. package/server/applications/files/modules/collabora-online/collabora-online.utils.js +1 -5
  148. package/server/applications/files/modules/collabora-online/collabora-online.utils.js.map +1 -1
  149. package/server/applications/files/modules/file-editor-providers.interface.js +6 -0
  150. package/server/applications/files/modules/file-editor-providers.interface.js.map +1 -0
  151. package/server/applications/files/modules/only-office/only-office-environment.decorator.js +1 -5
  152. package/server/applications/files/modules/only-office/only-office-environment.decorator.js.map +1 -1
  153. package/server/applications/files/modules/only-office/only-office-manager.service.js +57 -19
  154. package/server/applications/files/modules/only-office/only-office-manager.service.js.map +1 -1
  155. package/server/applications/files/modules/only-office/only-office-manager.service.spec.js +1 -5
  156. package/server/applications/files/modules/only-office/only-office-manager.service.spec.js.map +1 -1
  157. package/server/applications/files/modules/only-office/only-office.config.js +1 -5
  158. package/server/applications/files/modules/only-office/only-office.config.js.map +1 -1
  159. package/server/applications/files/modules/only-office/only-office.constants.js +1 -5
  160. package/server/applications/files/modules/only-office/only-office.constants.js.map +1 -1
  161. package/server/applications/files/modules/only-office/only-office.controller.js +1 -5
  162. package/server/applications/files/modules/only-office/only-office.controller.js.map +1 -1
  163. package/server/applications/files/modules/only-office/only-office.controller.spec.js +1 -5
  164. package/server/applications/files/modules/only-office/only-office.controller.spec.js.map +1 -1
  165. package/server/applications/files/modules/only-office/only-office.dtos.js +1 -5
  166. package/server/applications/files/modules/only-office/only-office.dtos.js.map +1 -1
  167. package/server/applications/files/modules/only-office/only-office.guard.js +1 -5
  168. package/server/applications/files/modules/only-office/only-office.guard.js.map +1 -1
  169. package/server/applications/files/modules/only-office/only-office.guard.spec.js +1 -5
  170. package/server/applications/files/modules/only-office/only-office.guard.spec.js.map +1 -1
  171. package/server/applications/files/modules/only-office/only-office.interface.js +1 -5
  172. package/server/applications/files/modules/only-office/only-office.interface.js.map +1 -1
  173. package/server/applications/files/modules/only-office/only-office.module.js +1 -5
  174. package/server/applications/files/modules/only-office/only-office.module.js.map +1 -1
  175. package/server/applications/files/modules/only-office/only-office.routes.js +1 -5
  176. package/server/applications/files/modules/only-office/only-office.routes.js.map +1 -1
  177. package/server/applications/files/modules/only-office/only-office.strategy.js +1 -5
  178. package/server/applications/files/modules/only-office/only-office.strategy.js.map +1 -1
  179. package/server/applications/files/schemas/file-content.interface.js +1 -5
  180. package/server/applications/files/schemas/file-content.interface.js.map +1 -1
  181. package/server/applications/files/schemas/file-recent.interface.js +1 -5
  182. package/server/applications/files/schemas/file-recent.interface.js.map +1 -1
  183. package/server/applications/files/schemas/file.interface.js +1 -5
  184. package/server/applications/files/schemas/file.interface.js.map +1 -1
  185. package/server/applications/files/schemas/files-content.schema.js +1 -5
  186. package/server/applications/files/schemas/files-content.schema.js.map +1 -1
  187. package/server/applications/files/schemas/files-recents.schema.js +1 -5
  188. package/server/applications/files/schemas/files-recents.schema.js.map +1 -1
  189. package/server/applications/files/schemas/files.schema.js +1 -5
  190. package/server/applications/files/schemas/files.schema.js.map +1 -1
  191. package/server/applications/files/services/files-content-manager.service.js +45 -16
  192. package/server/applications/files/services/files-content-manager.service.js.map +1 -1
  193. package/server/applications/files/services/files-lock-manager.service.js +53 -18
  194. package/server/applications/files/services/files-lock-manager.service.js.map +1 -1
  195. package/server/applications/files/services/files-lock-manager.service.spec.js +1 -5
  196. package/server/applications/files/services/files-lock-manager.service.spec.js.map +1 -1
  197. package/server/applications/files/services/files-manager.service.js +77 -24
  198. package/server/applications/files/services/files-manager.service.js.map +1 -1
  199. package/server/applications/files/services/files-manager.service.spec.js +1 -5
  200. package/server/applications/files/services/files-manager.service.spec.js.map +1 -1
  201. package/server/applications/files/services/files-methods.service.js +5 -6
  202. package/server/applications/files/services/files-methods.service.js.map +1 -1
  203. package/server/applications/files/services/files-methods.service.spec.js +1 -5
  204. package/server/applications/files/services/files-methods.service.spec.js.map +1 -1
  205. package/server/applications/files/services/files-parser.service.js +13 -8
  206. package/server/applications/files/services/files-parser.service.js.map +1 -1
  207. package/server/applications/files/services/files-parser.service.spec.js +1 -5
  208. package/server/applications/files/services/files-parser.service.spec.js.map +1 -1
  209. package/server/applications/files/services/files-queries.service.js +29 -12
  210. package/server/applications/files/services/files-queries.service.js.map +1 -1
  211. package/server/applications/files/services/files-recents.service.js +1 -5
  212. package/server/applications/files/services/files-recents.service.js.map +1 -1
  213. package/server/applications/files/services/files-recents.service.spec.js +1 -5
  214. package/server/applications/files/services/files-recents.service.spec.js.map +1 -1
  215. package/server/applications/files/services/files-scheduler.service.js +77 -24
  216. package/server/applications/files/services/files-scheduler.service.js.map +1 -1
  217. package/server/applications/files/services/files-search-manager.service.js +9 -7
  218. package/server/applications/files/services/files-search-manager.service.js.map +1 -1
  219. package/server/applications/files/services/files-search-manager.service.spec.js +1 -5
  220. package/server/applications/files/services/files-search-manager.service.spec.js.map +1 -1
  221. package/server/applications/files/services/files-tasks-manager.service.js +77 -24
  222. package/server/applications/files/services/files-tasks-manager.service.js.map +1 -1
  223. package/server/applications/files/services/files-tasks-manager.service.spec.js +1 -5
  224. package/server/applications/files/services/files-tasks-manager.service.spec.js.map +1 -1
  225. package/server/applications/files/utils/doc-textify/adapters/excel.js +1 -5
  226. package/server/applications/files/utils/doc-textify/adapters/excel.js.map +1 -1
  227. package/server/applications/files/utils/doc-textify/adapters/html.js +1 -5
  228. package/server/applications/files/utils/doc-textify/adapters/html.js.map +1 -1
  229. package/server/applications/files/utils/doc-textify/adapters/open-office.js +1 -5
  230. package/server/applications/files/utils/doc-textify/adapters/open-office.js.map +1 -1
  231. package/server/applications/files/utils/doc-textify/adapters/pdf.js +1 -5
  232. package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
  233. package/server/applications/files/utils/doc-textify/adapters/power-point.js +1 -5
  234. package/server/applications/files/utils/doc-textify/adapters/power-point.js.map +1 -1
  235. package/server/applications/files/utils/doc-textify/adapters/text.js +1 -5
  236. package/server/applications/files/utils/doc-textify/adapters/text.js.map +1 -1
  237. package/server/applications/files/utils/doc-textify/adapters/word.js +1 -5
  238. package/server/applications/files/utils/doc-textify/adapters/word.js.map +1 -1
  239. package/server/applications/files/utils/doc-textify/doc-textify.js +1 -5
  240. package/server/applications/files/utils/doc-textify/doc-textify.js.map +1 -1
  241. package/server/applications/files/utils/doc-textify/interfaces/doc-textify.interfaces.js +1 -5
  242. package/server/applications/files/utils/doc-textify/interfaces/doc-textify.interfaces.js.map +1 -1
  243. package/server/applications/files/utils/doc-textify/utils/clean.js +1 -5
  244. package/server/applications/files/utils/doc-textify/utils/clean.js.map +1 -1
  245. package/server/applications/files/utils/files-search.js +1 -5
  246. package/server/applications/files/utils/files-search.js.map +1 -1
  247. package/server/applications/files/utils/files-tree.js +1 -5
  248. package/server/applications/files/utils/files-tree.js.map +1 -1
  249. package/server/applications/files/utils/files.js +1 -5
  250. package/server/applications/files/utils/files.js.map +1 -1
  251. package/server/applications/files/utils/send-file.js +1 -5
  252. package/server/applications/files/utils/send-file.js.map +1 -1
  253. package/server/applications/files/utils/unzip-file.js +1 -5
  254. package/server/applications/files/utils/unzip-file.js.map +1 -1
  255. package/server/applications/files/utils/url-file.js +1 -5
  256. package/server/applications/files/utils/url-file.js.map +1 -1
  257. package/server/applications/links/constants/cache.js +1 -5
  258. package/server/applications/links/constants/cache.js.map +1 -1
  259. package/server/applications/links/constants/links.js +1 -5
  260. package/server/applications/links/constants/links.js.map +1 -1
  261. package/server/applications/links/constants/routes.js +1 -5
  262. package/server/applications/links/constants/routes.js.map +1 -1
  263. package/server/applications/links/dto/create-or-update-link.dto.js +1 -5
  264. package/server/applications/links/dto/create-or-update-link.dto.js.map +1 -1
  265. package/server/applications/links/interfaces/link-guest.interface.js +1 -5
  266. package/server/applications/links/interfaces/link-guest.interface.js.map +1 -1
  267. package/server/applications/links/interfaces/link-space.interface.js +1 -5
  268. package/server/applications/links/interfaces/link-space.interface.js.map +1 -1
  269. package/server/applications/links/links.controller.js +1 -5
  270. package/server/applications/links/links.controller.js.map +1 -1
  271. package/server/applications/links/links.controller.spec.js +1 -5
  272. package/server/applications/links/links.controller.spec.js.map +1 -1
  273. package/server/applications/links/schemas/link.interface.js +1 -5
  274. package/server/applications/links/schemas/link.interface.js.map +1 -1
  275. package/server/applications/links/schemas/links.schema.js +1 -5
  276. package/server/applications/links/schemas/links.schema.js.map +1 -1
  277. package/server/applications/links/services/links-manager.service.js +55 -20
  278. package/server/applications/links/services/links-manager.service.js.map +1 -1
  279. package/server/applications/links/services/links-manager.service.spec.js +3 -7
  280. package/server/applications/links/services/links-manager.service.spec.js.map +1 -1
  281. package/server/applications/links/services/links-queries.service.js +1 -5
  282. package/server/applications/links/services/links-queries.service.js.map +1 -1
  283. package/server/applications/notifications/constants/notifications.js +1 -5
  284. package/server/applications/notifications/constants/notifications.js.map +1 -1
  285. package/server/applications/notifications/constants/routes.js +1 -5
  286. package/server/applications/notifications/constants/routes.js.map +1 -1
  287. package/server/applications/notifications/constants/websocket.js +1 -5
  288. package/server/applications/notifications/constants/websocket.js.map +1 -1
  289. package/server/applications/notifications/i18n/de.js +1 -9
  290. package/server/applications/notifications/i18n/de.js.map +1 -1
  291. package/server/applications/notifications/i18n/es.js +1 -5
  292. package/server/applications/notifications/i18n/es.js.map +1 -1
  293. package/server/applications/notifications/i18n/fr.js +1 -5
  294. package/server/applications/notifications/i18n/fr.js.map +1 -1
  295. package/server/applications/notifications/i18n/hi.js +1 -5
  296. package/server/applications/notifications/i18n/hi.js.map +1 -1
  297. package/server/applications/notifications/i18n/index.js +1 -5
  298. package/server/applications/notifications/i18n/index.js.map +1 -1
  299. package/server/applications/notifications/i18n/it.js +1 -5
  300. package/server/applications/notifications/i18n/it.js.map +1 -1
  301. package/server/applications/notifications/i18n/ja.js +1 -5
  302. package/server/applications/notifications/i18n/ja.js.map +1 -1
  303. package/server/applications/notifications/i18n/ko.js +1 -5
  304. package/server/applications/notifications/i18n/ko.js.map +1 -1
  305. package/server/applications/notifications/i18n/pl.js +1 -5
  306. package/server/applications/notifications/i18n/pl.js.map +1 -1
  307. package/server/applications/notifications/i18n/pt.js +1 -5
  308. package/server/applications/notifications/i18n/pt.js.map +1 -1
  309. package/server/applications/notifications/i18n/pt_br.js +1 -5
  310. package/server/applications/notifications/i18n/pt_br.js.map +1 -1
  311. package/server/applications/notifications/i18n/ru.js +1 -5
  312. package/server/applications/notifications/i18n/ru.js.map +1 -1
  313. package/server/applications/notifications/i18n/tr.js +1 -5
  314. package/server/applications/notifications/i18n/tr.js.map +1 -1
  315. package/server/applications/notifications/i18n/zh.js +1 -5
  316. package/server/applications/notifications/i18n/zh.js.map +1 -1
  317. package/server/applications/notifications/interfaces/notification-properties.interface.js +1 -5
  318. package/server/applications/notifications/interfaces/notification-properties.interface.js.map +1 -1
  319. package/server/applications/notifications/interfaces/user-mail-notification.interface.js +1 -5
  320. package/server/applications/notifications/interfaces/user-mail-notification.interface.js.map +1 -1
  321. package/server/applications/notifications/mails/models.js +1 -5
  322. package/server/applications/notifications/mails/models.js.map +1 -1
  323. package/server/applications/notifications/mails/templates.js +1 -5
  324. package/server/applications/notifications/mails/templates.js.map +1 -1
  325. package/server/applications/notifications/mails/urls.js +1 -5
  326. package/server/applications/notifications/mails/urls.js.map +1 -1
  327. package/server/applications/notifications/notifications.controller.js +1 -5
  328. package/server/applications/notifications/notifications.controller.js.map +1 -1
  329. package/server/applications/notifications/notifications.controller.spec.js +1 -5
  330. package/server/applications/notifications/notifications.controller.spec.js.map +1 -1
  331. package/server/applications/notifications/notifications.gateway.js +1 -5
  332. package/server/applications/notifications/notifications.gateway.js.map +1 -1
  333. package/server/applications/notifications/notifications.module.js +1 -5
  334. package/server/applications/notifications/notifications.module.js.map +1 -1
  335. package/server/applications/notifications/schemas/notification.interface.js +1 -5
  336. package/server/applications/notifications/schemas/notification.interface.js.map +1 -1
  337. package/server/applications/notifications/schemas/notifications.schema.js +1 -5
  338. package/server/applications/notifications/schemas/notifications.schema.js.map +1 -1
  339. package/server/applications/notifications/services/notifications-manager.service.js +25 -11
  340. package/server/applications/notifications/services/notifications-manager.service.js.map +1 -1
  341. package/server/applications/notifications/services/notifications-manager.service.spec.js +20 -11
  342. package/server/applications/notifications/services/notifications-manager.service.spec.js.map +1 -1
  343. package/server/applications/notifications/services/notifications-queries.service.js +1 -5
  344. package/server/applications/notifications/services/notifications-queries.service.js.map +1 -1
  345. package/server/applications/shares/constants/routes.js +1 -5
  346. package/server/applications/shares/constants/routes.js.map +1 -1
  347. package/server/applications/shares/constants/shares.js +1 -5
  348. package/server/applications/shares/constants/shares.js.map +1 -1
  349. package/server/applications/shares/dto/create-or-update-share.dto.js +1 -5
  350. package/server/applications/shares/dto/create-or-update-share.dto.js.map +1 -1
  351. package/server/applications/shares/interfaces/share-child.interface.js +1 -5
  352. package/server/applications/shares/interfaces/share-child.interface.js.map +1 -1
  353. package/server/applications/shares/interfaces/share-env.interface.js +1 -5
  354. package/server/applications/shares/interfaces/share-env.interface.js.map +1 -1
  355. package/server/applications/shares/interfaces/share-file.interface.js +1 -5
  356. package/server/applications/shares/interfaces/share-file.interface.js.map +1 -1
  357. package/server/applications/shares/interfaces/share-link.interface.js +1 -5
  358. package/server/applications/shares/interfaces/share-link.interface.js.map +1 -1
  359. package/server/applications/shares/interfaces/share-props.interface.js +1 -5
  360. package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
  361. package/server/applications/shares/models/share-child.model.js +1 -5
  362. package/server/applications/shares/models/share-child.model.js.map +1 -1
  363. package/server/applications/shares/schemas/share-members.interface.js +1 -5
  364. package/server/applications/shares/schemas/share-members.interface.js.map +1 -1
  365. package/server/applications/shares/schemas/share.interface.js +1 -5
  366. package/server/applications/shares/schemas/share.interface.js.map +1 -1
  367. package/server/applications/shares/schemas/shares-members.schema.js +1 -5
  368. package/server/applications/shares/schemas/shares-members.schema.js.map +1 -1
  369. package/server/applications/shares/schemas/shares.schema.js +1 -5
  370. package/server/applications/shares/schemas/shares.schema.js.map +1 -1
  371. package/server/applications/shares/services/shares-manager.service.js +214 -68
  372. package/server/applications/shares/services/shares-manager.service.js.map +1 -1
  373. package/server/applications/shares/services/shares-manager.service.spec.js +1 -5
  374. package/server/applications/shares/services/shares-manager.service.spec.js.map +1 -1
  375. package/server/applications/shares/services/shares-queries.service.js +49 -17
  376. package/server/applications/shares/services/shares-queries.service.js.map +1 -1
  377. package/server/applications/shares/shares.controller.js +1 -5
  378. package/server/applications/shares/shares.controller.js.map +1 -1
  379. package/server/applications/shares/shares.controller.spec.js +1 -5
  380. package/server/applications/shares/shares.controller.spec.js.map +1 -1
  381. package/server/applications/shares/shares.module.js +1 -5
  382. package/server/applications/shares/shares.module.js.map +1 -1
  383. package/server/applications/spaces/constants/cache.js +1 -5
  384. package/server/applications/spaces/constants/cache.js.map +1 -1
  385. package/server/applications/spaces/constants/routes.js +1 -5
  386. package/server/applications/spaces/constants/routes.js.map +1 -1
  387. package/server/applications/spaces/constants/spaces.js +1 -5
  388. package/server/applications/spaces/constants/spaces.js.map +1 -1
  389. package/server/applications/spaces/decorators/space-override-permission.decorator.js +1 -5
  390. package/server/applications/spaces/decorators/space-override-permission.decorator.js.map +1 -1
  391. package/server/applications/spaces/decorators/space-skip-guard.decorator.js +1 -5
  392. package/server/applications/spaces/decorators/space-skip-guard.decorator.js.map +1 -1
  393. package/server/applications/spaces/decorators/space-skip-permissions.decorator.js +1 -5
  394. package/server/applications/spaces/decorators/space-skip-permissions.decorator.js.map +1 -1
  395. package/server/applications/spaces/decorators/space.decorator.js +1 -5
  396. package/server/applications/spaces/decorators/space.decorator.js.map +1 -1
  397. package/server/applications/spaces/dto/create-or-update-space.dto.js +1 -5
  398. package/server/applications/spaces/dto/create-or-update-space.dto.js.map +1 -1
  399. package/server/applications/spaces/dto/delete-space.dto.js +1 -5
  400. package/server/applications/spaces/dto/delete-space.dto.js.map +1 -1
  401. package/server/applications/spaces/dto/search-space.dto.js +1 -5
  402. package/server/applications/spaces/dto/search-space.dto.js.map +1 -1
  403. package/server/applications/spaces/dto/space-roots.dto.js +1 -5
  404. package/server/applications/spaces/dto/space-roots.dto.js.map +1 -1
  405. package/server/applications/spaces/guards/space.guard.js +17 -9
  406. package/server/applications/spaces/guards/space.guard.js.map +1 -1
  407. package/server/applications/spaces/guards/space.guard.spec.js +1 -5
  408. package/server/applications/spaces/guards/space.guard.spec.js.map +1 -1
  409. package/server/applications/spaces/interfaces/space-diff.interface.js +1 -5
  410. package/server/applications/spaces/interfaces/space-diff.interface.js.map +1 -1
  411. package/server/applications/spaces/interfaces/space-files.interface.js +1 -5
  412. package/server/applications/spaces/interfaces/space-files.interface.js.map +1 -1
  413. package/server/applications/spaces/interfaces/space-request.interface.js +1 -5
  414. package/server/applications/spaces/interfaces/space-request.interface.js.map +1 -1
  415. package/server/applications/spaces/interfaces/space-trash.interface.js +1 -5
  416. package/server/applications/spaces/interfaces/space-trash.interface.js.map +1 -1
  417. package/server/applications/spaces/models/space-env.model.js +1 -5
  418. package/server/applications/spaces/models/space-env.model.js.map +1 -1
  419. package/server/applications/spaces/models/space-props.model.js +1 -5
  420. package/server/applications/spaces/models/space-props.model.js.map +1 -1
  421. package/server/applications/spaces/models/space-root-props.model.js +1 -5
  422. package/server/applications/spaces/models/space-root-props.model.js.map +1 -1
  423. package/server/applications/spaces/models/space.model.js +1 -5
  424. package/server/applications/spaces/models/space.model.js.map +1 -1
  425. package/server/applications/spaces/schemas/space-members.interface.js +1 -5
  426. package/server/applications/spaces/schemas/space-members.interface.js.map +1 -1
  427. package/server/applications/spaces/schemas/space-root.interface.js +1 -5
  428. package/server/applications/spaces/schemas/space-root.interface.js.map +1 -1
  429. package/server/applications/spaces/schemas/space.interface.js +1 -5
  430. package/server/applications/spaces/schemas/space.interface.js.map +1 -1
  431. package/server/applications/spaces/schemas/spaces-members.schema.js +1 -5
  432. package/server/applications/spaces/schemas/spaces-members.schema.js.map +1 -1
  433. package/server/applications/spaces/schemas/spaces-roots.schema.js +1 -5
  434. package/server/applications/spaces/schemas/spaces-roots.schema.js.map +1 -1
  435. package/server/applications/spaces/schemas/spaces.schema.js +1 -5
  436. package/server/applications/spaces/schemas/spaces.schema.js.map +1 -1
  437. package/server/applications/spaces/services/spaces-browser.service.js +77 -24
  438. package/server/applications/spaces/services/spaces-browser.service.js.map +1 -1
  439. package/server/applications/spaces/services/spaces-browser.service.spec.js +1 -5
  440. package/server/applications/spaces/services/spaces-browser.service.spec.js.map +1 -1
  441. package/server/applications/spaces/services/spaces-manager.service.js +193 -53
  442. package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
  443. package/server/applications/spaces/services/spaces-manager.service.spec.js +1 -5
  444. package/server/applications/spaces/services/spaces-manager.service.spec.js.map +1 -1
  445. package/server/applications/spaces/services/spaces-queries.service.js +65 -21
  446. package/server/applications/spaces/services/spaces-queries.service.js.map +1 -1
  447. package/server/applications/spaces/services/spaces-scheduler.service.js +49 -17
  448. package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
  449. package/server/applications/spaces/spaces.controller.js +1 -5
  450. package/server/applications/spaces/spaces.controller.js.map +1 -1
  451. package/server/applications/spaces/spaces.controller.spec.js +1 -5
  452. package/server/applications/spaces/spaces.controller.spec.js.map +1 -1
  453. package/server/applications/spaces/spaces.module.js +1 -5
  454. package/server/applications/spaces/spaces.module.js.map +1 -1
  455. package/server/applications/spaces/utils/paths.js +1 -5
  456. package/server/applications/spaces/utils/paths.js.map +1 -1
  457. package/server/applications/spaces/utils/permissions.js +1 -5
  458. package/server/applications/spaces/utils/permissions.js.map +1 -1
  459. package/server/applications/spaces/utils/routes.js +1 -5
  460. package/server/applications/spaces/utils/routes.js.map +1 -1
  461. package/server/applications/sync/constants/auth.js +1 -5
  462. package/server/applications/sync/constants/auth.js.map +1 -1
  463. package/server/applications/sync/constants/routes.js +6 -5
  464. package/server/applications/sync/constants/routes.js.map +1 -1
  465. package/server/applications/sync/constants/store.js +1 -9
  466. package/server/applications/sync/constants/store.js.map +1 -1
  467. package/server/applications/sync/constants/sync.js +2 -6
  468. package/server/applications/sync/constants/sync.js.map +1 -1
  469. package/server/applications/sync/decorators/sync-context.decorator.js +1 -5
  470. package/server/applications/sync/decorators/sync-context.decorator.js.map +1 -1
  471. package/server/applications/sync/decorators/sync-environment.decorator.js +1 -5
  472. package/server/applications/sync/decorators/sync-environment.decorator.js.map +1 -1
  473. package/server/applications/sync/dtos/sync-client-auth.dto.js +12 -8
  474. package/server/applications/sync/dtos/sync-client-auth.dto.js.map +1 -1
  475. package/server/applications/sync/dtos/sync-client-info.dto.js +49 -0
  476. package/server/applications/sync/dtos/sync-client-info.dto.js.map +1 -0
  477. package/server/applications/sync/dtos/sync-client-registration.dto.js +34 -11
  478. package/server/applications/sync/dtos/sync-client-registration.dto.js.map +1 -1
  479. package/server/applications/sync/dtos/sync-operations.dto.js +1 -5
  480. package/server/applications/sync/dtos/sync-operations.dto.js.map +1 -1
  481. package/server/applications/sync/dtos/sync-path.dto.js +1 -5
  482. package/server/applications/sync/dtos/sync-path.dto.js.map +1 -1
  483. package/server/applications/sync/dtos/sync-upload.dto.js +1 -5
  484. package/server/applications/sync/dtos/sync-upload.dto.js.map +1 -1
  485. package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.js +1 -5
  486. package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.js.map +1 -1
  487. package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.spec.js +1 -5
  488. package/server/applications/sync/interceptors/sync-diff-gzip-body.interceptor.spec.js.map +1 -1
  489. package/server/applications/sync/interfaces/store-manifest.interface.js +1 -5
  490. package/server/applications/sync/interfaces/store-manifest.interface.js.map +1 -1
  491. package/server/applications/sync/interfaces/sync-client-auth.interface.js +1 -25
  492. package/server/applications/sync/interfaces/sync-client-auth.interface.js.map +1 -1
  493. package/server/applications/sync/interfaces/sync-client-paths.interface.js +1 -5
  494. package/server/applications/sync/interfaces/sync-client-paths.interface.js.map +1 -1
  495. package/server/applications/sync/interfaces/sync-client.interface.js +1 -5
  496. package/server/applications/sync/interfaces/sync-client.interface.js.map +1 -1
  497. package/server/applications/sync/interfaces/sync-diff.interface.js +1 -5
  498. package/server/applications/sync/interfaces/sync-diff.interface.js.map +1 -1
  499. package/server/applications/sync/interfaces/sync-path.interface.js +1 -5
  500. package/server/applications/sync/interfaces/sync-path.interface.js.map +1 -1
  501. package/server/applications/sync/schemas/sync-client.interface.js +1 -5
  502. package/server/applications/sync/schemas/sync-client.interface.js.map +1 -1
  503. package/server/applications/sync/schemas/sync-clients.schema.js +1 -5
  504. package/server/applications/sync/schemas/sync-clients.schema.js.map +1 -1
  505. package/server/applications/sync/schemas/sync-path.interface.js +1 -5
  506. package/server/applications/sync/schemas/sync-path.interface.js.map +1 -1
  507. package/server/applications/sync/schemas/sync-paths.schema.js +1 -5
  508. package/server/applications/sync/schemas/sync-paths.schema.js.map +1 -1
  509. package/server/applications/sync/services/sync-clients-manager.service.js +108 -44
  510. package/server/applications/sync/services/sync-clients-manager.service.js.map +1 -1
  511. package/server/applications/sync/services/sync-clients-manager.service.spec.js +14 -17
  512. package/server/applications/sync/services/sync-clients-manager.service.spec.js.map +1 -1
  513. package/server/applications/sync/services/sync-manager.service.js +29 -12
  514. package/server/applications/sync/services/sync-manager.service.js.map +1 -1
  515. package/server/applications/sync/services/sync-manager.service.spec.js +1 -5
  516. package/server/applications/sync/services/sync-manager.service.spec.js.map +1 -1
  517. package/server/applications/sync/services/sync-paths-manager.service.js +27 -17
  518. package/server/applications/sync/services/sync-paths-manager.service.js.map +1 -1
  519. package/server/applications/sync/services/sync-paths-manager.service.spec.js +11 -15
  520. package/server/applications/sync/services/sync-paths-manager.service.spec.js.map +1 -1
  521. package/server/applications/sync/services/sync-queries.service.js +1 -5
  522. package/server/applications/sync/services/sync-queries.service.js.map +1 -1
  523. package/server/applications/sync/sync.config.js +1 -5
  524. package/server/applications/sync/sync.config.js.map +1 -1
  525. package/server/applications/sync/sync.controller.js +21 -6
  526. package/server/applications/sync/sync.controller.js.map +1 -1
  527. package/server/applications/sync/sync.controller.spec.js +1 -5
  528. package/server/applications/sync/sync.controller.spec.js.map +1 -1
  529. package/server/applications/sync/sync.module.js +1 -5
  530. package/server/applications/sync/sync.module.js.map +1 -1
  531. package/server/applications/sync/utils/functions.js +1 -5
  532. package/server/applications/sync/utils/functions.js.map +1 -1
  533. package/server/applications/sync/utils/normalizedMap.js +1 -5
  534. package/server/applications/sync/utils/normalizedMap.js.map +1 -1
  535. package/server/applications/sync/utils/routes.js +1 -5
  536. package/server/applications/sync/utils/routes.js.map +1 -1
  537. package/server/applications/users/admin-users.controller.js +2 -6
  538. package/server/applications/users/admin-users.controller.js.map +1 -1
  539. package/server/applications/users/admin-users.controller.spec.js +6 -10
  540. package/server/applications/users/admin-users.controller.spec.js.map +1 -1
  541. package/server/applications/users/constants/group.js +1 -5
  542. package/server/applications/users/constants/group.js.map +1 -1
  543. package/server/applications/users/constants/member.js +1 -5
  544. package/server/applications/users/constants/member.js.map +1 -1
  545. package/server/applications/users/constants/routes.js +1 -5
  546. package/server/applications/users/constants/routes.js.map +1 -1
  547. package/server/applications/users/constants/user.js +1 -5
  548. package/server/applications/users/constants/user.js.map +1 -1
  549. package/server/applications/users/constants/websocket.js +1 -5
  550. package/server/applications/users/constants/websocket.js.map +1 -1
  551. package/server/applications/users/decorators/permissions.decorator.js +1 -5
  552. package/server/applications/users/decorators/permissions.decorator.js.map +1 -1
  553. package/server/applications/users/decorators/roles.decorator.js +1 -5
  554. package/server/applications/users/decorators/roles.decorator.js.map +1 -1
  555. package/server/applications/users/decorators/user.decorator.js +1 -5
  556. package/server/applications/users/decorators/user.decorator.js.map +1 -1
  557. package/server/applications/users/dto/create-or-update-group.dto.js +1 -5
  558. package/server/applications/users/dto/create-or-update-group.dto.js.map +1 -1
  559. package/server/applications/users/dto/create-or-update-user.dto.js +1 -5
  560. package/server/applications/users/dto/create-or-update-user.dto.js.map +1 -1
  561. package/server/applications/users/dto/delete-user.dto.js +1 -5
  562. package/server/applications/users/dto/delete-user.dto.js.map +1 -1
  563. package/server/applications/users/dto/search-members.dto.js +1 -5
  564. package/server/applications/users/dto/search-members.dto.js.map +1 -1
  565. package/server/applications/users/dto/user-properties.dto.js +1 -5
  566. package/server/applications/users/dto/user-properties.dto.js.map +1 -1
  567. package/server/applications/users/guards/permissions.guard.js +1 -5
  568. package/server/applications/users/guards/permissions.guard.js.map +1 -1
  569. package/server/applications/users/guards/permissions.guard.spec.js +1 -5
  570. package/server/applications/users/guards/permissions.guard.spec.js.map +1 -1
  571. package/server/applications/users/guards/roles.guard.js +1 -5
  572. package/server/applications/users/guards/roles.guard.js.map +1 -1
  573. package/server/applications/users/guards/roles.guard.spec.js +1 -5
  574. package/server/applications/users/guards/roles.guard.spec.js.map +1 -1
  575. package/server/applications/users/interfaces/admin-group.interface.js +1 -5
  576. package/server/applications/users/interfaces/admin-group.interface.js.map +1 -1
  577. package/server/applications/users/interfaces/admin-user.interface.js +1 -5
  578. package/server/applications/users/interfaces/admin-user.interface.js.map +1 -1
  579. package/server/applications/users/interfaces/group-browse.interface.js +1 -5
  580. package/server/applications/users/interfaces/group-browse.interface.js.map +1 -1
  581. package/server/applications/users/interfaces/group-member.js +1 -5
  582. package/server/applications/users/interfaces/group-member.js.map +1 -1
  583. package/server/applications/users/interfaces/guest-user.interface.js +1 -5
  584. package/server/applications/users/interfaces/guest-user.interface.js.map +1 -1
  585. package/server/applications/users/interfaces/member.interface.js +1 -5
  586. package/server/applications/users/interfaces/member.interface.js.map +1 -1
  587. package/server/applications/users/interfaces/owner.interface.js +1 -5
  588. package/server/applications/users/interfaces/owner.interface.js.map +1 -1
  589. package/server/applications/users/interfaces/user-secrets.interface.js +1 -5
  590. package/server/applications/users/interfaces/user-secrets.interface.js.map +1 -1
  591. package/server/applications/users/interfaces/websocket.interface.js +1 -5
  592. package/server/applications/users/interfaces/websocket.interface.js.map +1 -1
  593. package/server/applications/users/models/user.model.js +1 -5
  594. package/server/applications/users/models/user.model.js.map +1 -1
  595. package/server/applications/users/schemas/group.interface.js +1 -5
  596. package/server/applications/users/schemas/group.interface.js.map +1 -1
  597. package/server/applications/users/schemas/groups.schema.js +1 -5
  598. package/server/applications/users/schemas/groups.schema.js.map +1 -1
  599. package/server/applications/users/schemas/user-group.interface.js +1 -5
  600. package/server/applications/users/schemas/user-group.interface.js.map +1 -1
  601. package/server/applications/users/schemas/user.interface.js +1 -5
  602. package/server/applications/users/schemas/user.interface.js.map +1 -1
  603. package/server/applications/users/schemas/users-groups.schema.js +1 -5
  604. package/server/applications/users/schemas/users-groups.schema.js.map +1 -1
  605. package/server/applications/users/schemas/users-guests.schema.js +1 -5
  606. package/server/applications/users/schemas/users-guests.schema.js.map +1 -1
  607. package/server/applications/users/schemas/users.schema.js +1 -5
  608. package/server/applications/users/schemas/users.schema.js.map +1 -1
  609. package/server/applications/users/services/admin-users-manager.service.js +67 -23
  610. package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
  611. package/server/applications/users/services/admin-users-manager.service.spec.js +3 -7
  612. package/server/applications/users/services/admin-users-manager.service.spec.js.map +1 -1
  613. package/server/applications/users/services/admin-users-queries.service.js +65 -21
  614. package/server/applications/users/services/admin-users-queries.service.js.map +1 -1
  615. package/server/applications/users/services/users-manager.service.js +81 -25
  616. package/server/applications/users/services/users-manager.service.js.map +1 -1
  617. package/server/applications/users/services/users-manager.service.spec.js +14 -12
  618. package/server/applications/users/services/users-manager.service.spec.js.map +1 -1
  619. package/server/applications/users/services/users-queries.service.js +49 -17
  620. package/server/applications/users/services/users-queries.service.js.map +1 -1
  621. package/server/applications/users/users.controller.js +2 -6
  622. package/server/applications/users/users.controller.js.map +1 -1
  623. package/server/applications/users/users.controller.spec.js +5 -9
  624. package/server/applications/users/users.controller.spec.js.map +1 -1
  625. package/server/applications/users/users.e2e-spec.js +3 -7
  626. package/server/applications/users/users.e2e-spec.js.map +1 -1
  627. package/server/applications/users/users.gateway.js +29 -12
  628. package/server/applications/users/users.gateway.js.map +1 -1
  629. package/server/applications/users/users.gateway.spec.js +1 -5
  630. package/server/applications/users/users.gateway.spec.js.map +1 -1
  631. package/server/applications/users/users.module.js +1 -5
  632. package/server/applications/users/users.module.js.map +1 -1
  633. package/server/applications/users/utils/avatar.js +1 -5
  634. package/server/applications/users/utils/avatar.js.map +1 -1
  635. package/server/applications/users/utils/test.js +1 -5
  636. package/server/applications/users/utils/test.js.map +1 -1
  637. package/server/applications/webdav/constants/routes.js +1 -5
  638. package/server/applications/webdav/constants/routes.js.map +1 -1
  639. package/server/applications/webdav/constants/webdav.js +1 -5
  640. package/server/applications/webdav/constants/webdav.js.map +1 -1
  641. package/server/applications/webdav/decorators/if-header.decorator.js +1 -5
  642. package/server/applications/webdav/decorators/if-header.decorator.js.map +1 -1
  643. package/server/applications/webdav/decorators/webdav-context.decorator.js +1 -5
  644. package/server/applications/webdav/decorators/webdav-context.decorator.js.map +1 -1
  645. package/server/applications/webdav/filters/webdav.filter.js +1 -5
  646. package/server/applications/webdav/filters/webdav.filter.js.map +1 -1
  647. package/server/applications/webdav/filters/webdav.filter.spec.js +1 -5
  648. package/server/applications/webdav/filters/webdav.filter.spec.js.map +1 -1
  649. package/server/applications/webdav/guards/webdav-protocol.guard.js +54 -20
  650. package/server/applications/webdav/guards/webdav-protocol.guard.js.map +1 -1
  651. package/server/applications/webdav/guards/webdav-protocol.guard.spec.js +54 -0
  652. package/server/applications/webdav/guards/webdav-protocol.guard.spec.js.map +1 -1
  653. package/server/applications/webdav/interfaces/if-header.interface.js +1 -5
  654. package/server/applications/webdav/interfaces/if-header.interface.js.map +1 -1
  655. package/server/applications/webdav/interfaces/webdav.interface.js +1 -5
  656. package/server/applications/webdav/interfaces/webdav.interface.js.map +1 -1
  657. package/server/applications/webdav/models/webdav-file.model.js +1 -5
  658. package/server/applications/webdav/models/webdav-file.model.js.map +1 -1
  659. package/server/applications/webdav/services/webdav-methods.service.js +74 -26
  660. package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
  661. package/server/applications/webdav/services/webdav-methods.service.spec.js +15 -18
  662. package/server/applications/webdav/services/webdav-methods.service.spec.js.map +1 -1
  663. package/server/applications/webdav/services/webdav-spaces.service.js +17 -9
  664. package/server/applications/webdav/services/webdav-spaces.service.js.map +1 -1
  665. package/server/applications/webdav/services/webdav-spaces.service.spec.js +1 -5
  666. package/server/applications/webdav/services/webdav-spaces.service.spec.js.map +1 -1
  667. package/server/applications/webdav/utils/bootstrap.js +1 -5
  668. package/server/applications/webdav/utils/bootstrap.js.map +1 -1
  669. package/server/applications/webdav/utils/if-header.js +1 -5
  670. package/server/applications/webdav/utils/if-header.js.map +1 -1
  671. package/server/applications/webdav/utils/routes.js +1 -5
  672. package/server/applications/webdav/utils/routes.js.map +1 -1
  673. package/server/applications/webdav/utils/webdav.js +1 -5
  674. package/server/applications/webdav/utils/webdav.js.map +1 -1
  675. package/server/applications/webdav/utils/xml.js +1 -5
  676. package/server/applications/webdav/utils/xml.js.map +1 -1
  677. package/server/applications/webdav/webdav.controller.js +1 -5
  678. package/server/applications/webdav/webdav.controller.js.map +1 -1
  679. package/server/applications/webdav/webdav.controller.spec.js +1 -5
  680. package/server/applications/webdav/webdav.controller.spec.js.map +1 -1
  681. package/server/applications/webdav/webdav.e2e-spec.js +1 -5
  682. package/server/applications/webdav/webdav.e2e-spec.js.map +1 -1
  683. package/server/applications/webdav/webdav.module.js +1 -5
  684. package/server/applications/webdav/webdav.module.js.map +1 -1
  685. package/server/authentication/auth.config.js +23 -123
  686. package/server/authentication/auth.config.js.map +1 -1
  687. package/server/authentication/auth.controller.js +27 -21
  688. package/server/authentication/auth.controller.js.map +1 -1
  689. package/server/authentication/auth.controller.spec.js +6 -10
  690. package/server/authentication/auth.controller.spec.js.map +1 -1
  691. package/server/authentication/auth.e2e-spec.js +1 -5
  692. package/server/authentication/auth.e2e-spec.js.map +1 -1
  693. package/server/authentication/auth.module.js +17 -20
  694. package/server/authentication/auth.module.js.map +1 -1
  695. package/server/authentication/{services/auth-manager.service.js → auth.service.js} +41 -18
  696. package/server/authentication/auth.service.js.map +1 -0
  697. package/server/authentication/{services/auth-manager.service.spec.js → auth.service.spec.js} +6 -10
  698. package/server/authentication/auth.service.spec.js.map +1 -0
  699. package/server/authentication/constants/auth.js +1 -5
  700. package/server/authentication/constants/auth.js.map +1 -1
  701. package/server/authentication/constants/routes.js +41 -30
  702. package/server/authentication/constants/routes.js.map +1 -1
  703. package/server/authentication/constants/scope.js +2 -5
  704. package/server/authentication/constants/scope.js.map +1 -1
  705. package/server/authentication/decorators/auth-token-optional.decorator.js +1 -5
  706. package/server/authentication/decorators/auth-token-optional.decorator.js.map +1 -1
  707. package/server/authentication/decorators/auth-token-skip.decorator.js +1 -5
  708. package/server/authentication/decorators/auth-token-skip.decorator.js.map +1 -1
  709. package/server/authentication/dto/login-response.dto.js +1 -10
  710. package/server/authentication/dto/login-response.dto.js.map +1 -1
  711. package/server/authentication/dto/token-response.dto.js +1 -5
  712. package/server/authentication/dto/token-response.dto.js.map +1 -1
  713. package/server/authentication/guards/auth-anonymous.guard.js +1 -5
  714. package/server/authentication/guards/auth-anonymous.guard.js.map +1 -1
  715. package/server/authentication/guards/auth-anonymous.guard.spec.js +1 -5
  716. package/server/authentication/guards/auth-anonymous.guard.spec.js.map +1 -1
  717. package/server/authentication/guards/auth-anonymous.strategy.js +1 -5
  718. package/server/authentication/guards/auth-anonymous.strategy.js.map +1 -1
  719. package/server/authentication/guards/auth-basic.guard.js +1 -5
  720. package/server/authentication/guards/auth-basic.guard.js.map +1 -1
  721. package/server/authentication/guards/auth-basic.guard.spec.js +13 -14
  722. package/server/authentication/guards/auth-basic.guard.spec.js.map +1 -1
  723. package/server/authentication/guards/auth-basic.strategy.js +10 -11
  724. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  725. package/server/authentication/guards/auth-digest.guard.js +1 -5
  726. package/server/authentication/guards/auth-digest.guard.js.map +1 -1
  727. package/server/authentication/guards/auth-digest.strategy.js +1 -5
  728. package/server/authentication/guards/auth-digest.strategy.js.map +1 -1
  729. package/server/authentication/guards/auth-local.guard.js +1 -5
  730. package/server/authentication/guards/auth-local.guard.js.map +1 -1
  731. package/server/authentication/guards/auth-local.guard.spec.js +9 -13
  732. package/server/authentication/guards/auth-local.guard.spec.js.map +1 -1
  733. package/server/authentication/guards/auth-local.strategy.js +6 -10
  734. package/server/authentication/guards/auth-local.strategy.js.map +1 -1
  735. package/server/authentication/guards/auth-token-access.guard.js +1 -5
  736. package/server/authentication/guards/auth-token-access.guard.js.map +1 -1
  737. package/server/authentication/guards/auth-token-access.guard.spec.js +3 -7
  738. package/server/authentication/guards/auth-token-access.guard.spec.js.map +1 -1
  739. package/server/authentication/guards/auth-token-access.strategy.js +3 -7
  740. package/server/authentication/guards/auth-token-access.strategy.js.map +1 -1
  741. package/server/authentication/guards/auth-token-refresh.guard.js +1 -5
  742. package/server/authentication/guards/auth-token-refresh.guard.js.map +1 -1
  743. package/server/authentication/guards/auth-token-refresh.guard.spec.js +3 -7
  744. package/server/authentication/guards/auth-token-refresh.guard.spec.js.map +1 -1
  745. package/server/authentication/guards/auth-token-refresh.strategy.js +3 -7
  746. package/server/authentication/guards/auth-token-refresh.strategy.js.map +1 -1
  747. package/server/authentication/guards/implementations/http-basic.strategy.js +1 -5
  748. package/server/authentication/guards/implementations/http-basic.strategy.js.map +1 -1
  749. package/server/authentication/guards/implementations/http-digest.strategy.js +1 -5
  750. package/server/authentication/guards/implementations/http-digest.strategy.js.map +1 -1
  751. package/server/authentication/interfaces/auth-request.interface.js +1 -5
  752. package/server/authentication/interfaces/auth-request.interface.js.map +1 -1
  753. package/server/authentication/interfaces/jwt-payload.interface.js +1 -5
  754. package/server/authentication/interfaces/jwt-payload.interface.js.map +1 -1
  755. package/server/authentication/interfaces/token.interface.js +1 -5
  756. package/server/authentication/interfaces/token.interface.js.map +1 -1
  757. package/server/authentication/providers/auth-providers.constants.js +18 -0
  758. package/server/authentication/providers/auth-providers.constants.js.map +1 -0
  759. package/server/authentication/providers/auth-providers.models.js +14 -0
  760. package/server/authentication/providers/auth-providers.models.js.map +1 -0
  761. package/server/authentication/providers/auth-providers.utils.js +42 -0
  762. package/server/authentication/providers/auth-providers.utils.js.map +1 -0
  763. package/server/authentication/providers/ldap/auth-ldap.config.js +143 -0
  764. package/server/authentication/providers/ldap/auth-ldap.config.js.map +1 -0
  765. package/server/authentication/{constants/auth-ldap.js → providers/ldap/auth-ldap.constants.js} +12 -6
  766. package/server/authentication/providers/ldap/auth-ldap.constants.js.map +1 -0
  767. package/server/authentication/providers/ldap/auth-provider-ldap.service.js +506 -0
  768. package/server/authentication/providers/ldap/auth-provider-ldap.service.js.map +1 -0
  769. package/server/authentication/providers/ldap/auth-provider-ldap.service.spec.js +674 -0
  770. package/server/authentication/providers/ldap/auth-provider-ldap.service.spec.js.map +1 -0
  771. package/server/authentication/{services/auth-methods/auth-method-database.service.js → providers/mysql/auth-provider-mysql.service.js} +16 -14
  772. package/server/authentication/providers/mysql/auth-provider-mysql.service.js.map +1 -0
  773. package/server/authentication/{services/auth-methods/auth-method-database.service.spec.js → providers/mysql/auth-provider-mysql.service.spec.js} +15 -19
  774. package/server/authentication/providers/mysql/auth-provider-mysql.service.spec.js.map +1 -0
  775. package/server/authentication/providers/oidc/auth-oidc-desktop.constants.js +30 -0
  776. package/server/authentication/providers/oidc/auth-oidc-desktop.constants.js.map +1 -0
  777. package/server/authentication/providers/oidc/auth-oidc.config.js +149 -0
  778. package/server/authentication/providers/oidc/auth-oidc.config.js.map +1 -0
  779. package/server/authentication/providers/oidc/auth-oidc.constants.js +39 -0
  780. package/server/authentication/providers/oidc/auth-oidc.constants.js.map +1 -0
  781. package/server/authentication/providers/oidc/auth-oidc.controller.js +83 -0
  782. package/server/authentication/providers/oidc/auth-oidc.controller.js.map +1 -0
  783. package/server/authentication/providers/oidc/auth-oidc.interfaces.js +6 -0
  784. package/server/authentication/providers/oidc/auth-oidc.interfaces.js.map +1 -0
  785. package/server/authentication/providers/oidc/auth-provider-oidc.module.js +36 -0
  786. package/server/authentication/providers/oidc/auth-provider-oidc.module.js.map +1 -0
  787. package/server/authentication/providers/oidc/auth-provider-oidc.service.js +373 -0
  788. package/server/authentication/providers/oidc/auth-provider-oidc.service.js.map +1 -0
  789. package/server/authentication/providers/oidc/auth-provider-oidc.service.spec.js +270 -0
  790. package/server/authentication/providers/oidc/auth-provider-oidc.service.spec.js.map +1 -0
  791. package/server/authentication/{services/auth-methods/auth-method-two-fa.service.js → providers/two-fa/auth-provider-two-fa.service.js} +56 -38
  792. package/server/authentication/providers/two-fa/auth-provider-two-fa.service.js.map +1 -0
  793. package/server/authentication/{services/auth-methods/auth-method-two-fa.service.spec.js → providers/two-fa/auth-provider-two-fa.service.spec.js} +6 -10
  794. package/server/authentication/providers/two-fa/auth-provider-two-fa.service.spec.js.map +1 -0
  795. package/server/authentication/{guards → providers/two-fa}/auth-two-fa-guard.js +10 -14
  796. package/server/authentication/providers/two-fa/auth-two-fa-guard.js.map +1 -0
  797. package/server/authentication/providers/two-fa/auth-two-fa.config.js +57 -0
  798. package/server/authentication/providers/two-fa/auth-two-fa.config.js.map +1 -0
  799. package/server/authentication/{dto/two-fa-verify.dto.js → providers/two-fa/auth-two-fa.dtos.js} +8 -6
  800. package/server/authentication/providers/two-fa/auth-two-fa.dtos.js.map +1 -0
  801. package/server/authentication/providers/two-fa/auth-two-fa.interfaces.js +6 -0
  802. package/server/authentication/providers/two-fa/auth-two-fa.interfaces.js.map +1 -0
  803. package/server/authentication/utils/crypt-secret.js +1 -5
  804. package/server/authentication/utils/crypt-secret.js.map +1 -1
  805. package/server/common/constants.js +1 -5
  806. package/server/common/constants.js.map +1 -1
  807. package/server/common/decorators.js +1 -5
  808. package/server/common/decorators.js.map +1 -1
  809. package/server/common/functions.js +25 -9
  810. package/server/common/functions.js.map +1 -1
  811. package/server/common/i18n.js +1 -5
  812. package/server/common/i18n.js.map +1 -1
  813. package/server/common/image.js +1 -5
  814. package/server/common/image.js.map +1 -1
  815. package/server/common/interfaces.js +1 -5
  816. package/server/common/interfaces.js.map +1 -1
  817. package/server/common/qrcode.js +1 -5
  818. package/server/common/qrcode.js.map +1 -1
  819. package/server/common/shared.js +6 -6
  820. package/server/common/shared.js.map +1 -1
  821. package/server/configuration/config.constants.js +1 -5
  822. package/server/configuration/config.constants.js.map +1 -1
  823. package/server/configuration/config.environment.js +2 -6
  824. package/server/configuration/config.environment.js.map +1 -1
  825. package/server/configuration/config.interfaces.js +1 -5
  826. package/server/configuration/config.interfaces.js.map +1 -1
  827. package/server/configuration/config.loader.js +1 -5
  828. package/server/configuration/config.loader.js.map +1 -1
  829. package/server/configuration/config.logger.js +4 -8
  830. package/server/configuration/config.logger.js.map +1 -1
  831. package/server/configuration/config.validation.js +7 -5
  832. package/server/configuration/config.validation.js.map +1 -1
  833. package/server/infrastructure/cache/adapters/mysql-cache.adapter.js +9 -7
  834. package/server/infrastructure/cache/adapters/mysql-cache.adapter.js.map +1 -1
  835. package/server/infrastructure/cache/adapters/redis-cache.adapter.js +1 -5
  836. package/server/infrastructure/cache/adapters/redis-cache.adapter.js.map +1 -1
  837. package/server/infrastructure/cache/cache.config.js +1 -5
  838. package/server/infrastructure/cache/cache.config.js.map +1 -1
  839. package/server/infrastructure/cache/cache.decorator.js +9 -7
  840. package/server/infrastructure/cache/cache.decorator.js.map +1 -1
  841. package/server/infrastructure/cache/cache.e2e-spec.js +1 -5
  842. package/server/infrastructure/cache/cache.e2e-spec.js.map +1 -1
  843. package/server/infrastructure/cache/cache.module.js +1 -5
  844. package/server/infrastructure/cache/cache.module.js.map +1 -1
  845. package/server/infrastructure/cache/schemas/mysql-cache.interface.js +1 -5
  846. package/server/infrastructure/cache/schemas/mysql-cache.interface.js.map +1 -1
  847. package/server/infrastructure/cache/schemas/mysql-cache.schema.js +1 -5
  848. package/server/infrastructure/cache/schemas/mysql-cache.schema.js.map +1 -1
  849. package/server/infrastructure/cache/services/cache.service.js +1 -5
  850. package/server/infrastructure/cache/services/cache.service.js.map +1 -1
  851. package/server/infrastructure/context/context.module.js +1 -5
  852. package/server/infrastructure/context/context.module.js.map +1 -1
  853. package/server/infrastructure/context/interceptors/context.interceptor.js +1 -5
  854. package/server/infrastructure/context/interceptors/context.interceptor.js.map +1 -1
  855. package/server/infrastructure/context/interceptors/context.interceptor.spec.js +2 -6
  856. package/server/infrastructure/context/interceptors/context.interceptor.spec.js.map +1 -1
  857. package/server/infrastructure/context/interfaces/context-store.interface.js +1 -5
  858. package/server/infrastructure/context/interfaces/context-store.interface.js.map +1 -1
  859. package/server/infrastructure/context/services/context-manager.service.js +1 -5
  860. package/server/infrastructure/context/services/context-manager.service.js.map +1 -1
  861. package/server/infrastructure/context/services/context-manager.service.spec.js +1 -5
  862. package/server/infrastructure/context/services/context-manager.service.spec.js.map +1 -1
  863. package/server/infrastructure/database/columns.js +1 -5
  864. package/server/infrastructure/database/columns.js.map +1 -1
  865. package/server/infrastructure/database/configuration.js +1 -5
  866. package/server/infrastructure/database/configuration.js.map +1 -1
  867. package/server/infrastructure/database/constants.js +2 -6
  868. package/server/infrastructure/database/constants.js.map +1 -1
  869. package/server/infrastructure/database/database.config.js +1 -5
  870. package/server/infrastructure/database/database.config.js.map +1 -1
  871. package/server/infrastructure/database/database.logger.js +1 -5
  872. package/server/infrastructure/database/database.logger.js.map +1 -1
  873. package/server/infrastructure/database/database.module.js +1 -5
  874. package/server/infrastructure/database/database.module.js.map +1 -1
  875. package/server/infrastructure/database/interfaces/database.interface.js +1 -5
  876. package/server/infrastructure/database/interfaces/database.interface.js.map +1 -1
  877. package/server/infrastructure/database/schema.js +1 -5
  878. package/server/infrastructure/database/schema.js.map +1 -1
  879. package/server/infrastructure/database/scripts/create-user.js +1 -5
  880. package/server/infrastructure/database/scripts/create-user.js.map +1 -1
  881. package/server/infrastructure/database/scripts/db.js +1 -5
  882. package/server/infrastructure/database/scripts/db.js.map +1 -1
  883. package/server/infrastructure/database/scripts/seed/main.js +1 -5
  884. package/server/infrastructure/database/scripts/seed/main.js.map +1 -1
  885. package/server/infrastructure/database/scripts/seed/usersgroups.js +1 -5
  886. package/server/infrastructure/database/scripts/seed/usersgroups.js.map +1 -1
  887. package/server/infrastructure/database/utils.js +1 -5
  888. package/server/infrastructure/database/utils.js.map +1 -1
  889. package/server/infrastructure/mailer/interfaces/mail.interface.js +1 -5
  890. package/server/infrastructure/mailer/interfaces/mail.interface.js.map +1 -1
  891. package/server/infrastructure/mailer/mailer.config.js +1 -5
  892. package/server/infrastructure/mailer/mailer.config.js.map +1 -1
  893. package/server/infrastructure/mailer/mailer.module.js +1 -5
  894. package/server/infrastructure/mailer/mailer.module.js.map +1 -1
  895. package/server/infrastructure/mailer/mailer.service.js +1 -5
  896. package/server/infrastructure/mailer/mailer.service.js.map +1 -1
  897. package/server/infrastructure/mailer/mailer.service.spec.js +2 -6
  898. package/server/infrastructure/mailer/mailer.service.spec.js.map +1 -1
  899. package/server/infrastructure/scheduler/scheduler.constants.js +1 -5
  900. package/server/infrastructure/scheduler/scheduler.constants.js.map +1 -1
  901. package/server/infrastructure/scheduler/scheduler.module.js +1 -5
  902. package/server/infrastructure/scheduler/scheduler.module.js.map +1 -1
  903. package/server/infrastructure/websocket/adapters/cluster.adapter.js +1 -5
  904. package/server/infrastructure/websocket/adapters/cluster.adapter.js.map +1 -1
  905. package/server/infrastructure/websocket/adapters/redis.adapter.js +1 -5
  906. package/server/infrastructure/websocket/adapters/redis.adapter.js.map +1 -1
  907. package/server/infrastructure/websocket/adapters/web-socket.adapter.js +1 -5
  908. package/server/infrastructure/websocket/adapters/web-socket.adapter.js.map +1 -1
  909. package/server/infrastructure/websocket/decorators/web-socket-user.decorator.js +1 -5
  910. package/server/infrastructure/websocket/decorators/web-socket-user.decorator.js.map +1 -1
  911. package/server/infrastructure/websocket/interfaces/auth-socket-io.interface.js +1 -5
  912. package/server/infrastructure/websocket/interfaces/auth-socket-io.interface.js.map +1 -1
  913. package/server/infrastructure/websocket/utils.js +1 -5
  914. package/server/infrastructure/websocket/utils.js.map +1 -1
  915. package/server/infrastructure/websocket/web-socket.config.js +1 -5
  916. package/server/infrastructure/websocket/web-socket.config.js.map +1 -1
  917. package/server/main.js +5 -0
  918. package/server/main.js.map +1 -1
  919. package/static/assets/pdfjs/build/pdf.mjs +724 -745
  920. package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
  921. package/static/assets/pdfjs/build/pdf.sandbox.mjs +2 -2
  922. package/static/assets/pdfjs/build/pdf.worker.mjs +706 -193
  923. package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
  924. package/static/assets/pdfjs/version +1 -1
  925. package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +5 -5
  926. package/static/assets/pdfjs/web/locale/en-US/viewer.ftl +1 -0
  927. package/static/assets/pdfjs/web/locale/fur/viewer.ftl +5 -0
  928. package/static/assets/pdfjs/web/locale/kk/viewer.ftl +28 -0
  929. package/static/assets/pdfjs/web/locale/ml/viewer.ftl +4 -0
  930. package/static/assets/pdfjs/web/locale/ru/viewer.ftl +3 -3
  931. package/static/assets/pdfjs/web/viewer.css +207 -65
  932. package/static/assets/pdfjs/web/viewer.html +11 -10
  933. package/static/assets/pdfjs/web/viewer.mjs +850 -270
  934. package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
  935. package/static/assets/pdfjs/web/wasm/LICENSE_JBIG2 +196 -0
  936. package/static/assets/pdfjs/web/wasm/LICENSE_PDFJS_JBIG2 +13 -0
  937. package/static/assets/pdfjs/web/wasm/jbig2.wasm +0 -0
  938. package/static/chunk-22TZP6HW.js +1 -0
  939. package/static/{chunk-U5E5H2DD.js → chunk-27ATUHBH.js} +1 -1
  940. package/static/{chunk-HZAB6F4Q.js → chunk-2CKLZ3FM.js} +1 -1
  941. package/static/{chunk-XZHWESIY.js → chunk-2QZPX7LO.js} +1 -1
  942. package/static/{chunk-UOK3LKSX.js → chunk-2R6IBBPZ.js} +1 -1
  943. package/static/{chunk-DVCN3P7Q.js → chunk-4FIGEBNL.js} +1 -1
  944. package/static/chunk-4P3JABAP.js +13 -0
  945. package/static/chunk-5CZOSAMZ.js +1 -0
  946. package/static/{chunk-RBTLSPYJ.js → chunk-677WUBCT.js} +1 -1
  947. package/static/{chunk-KEZNIIFH.js → chunk-74CAHBFM.js} +1 -1
  948. package/static/{chunk-WRK2FTKU.js → chunk-7GWW6MJO.js} +1 -1
  949. package/static/{chunk-EKWB5W72.js → chunk-7WOPGQXB.js} +1 -1
  950. package/static/{chunk-IMFO2MI7.js → chunk-A4UGPSWX.js} +1 -1
  951. package/static/{chunk-KDUAB76O.js → chunk-AHO37FKW.js} +1 -1
  952. package/static/chunk-AQCXMKP3.js +1 -0
  953. package/static/chunk-B6PDYCRO.js +3 -0
  954. package/static/{chunk-PPJCVBJH.js → chunk-CU76ATCF.js} +1 -1
  955. package/static/{chunk-ARS47O5X.js → chunk-CWYHOPOP.js} +1 -1
  956. package/static/{chunk-CSVPAZHK.js → chunk-E5WI5725.js} +1 -1
  957. package/static/{chunk-XX3JPJUM.js → chunk-FC5HTKVM.js} +1 -1
  958. package/static/{chunk-QGHNJVJ6.js → chunk-FOSM7EYI.js} +1 -1
  959. package/static/{chunk-JAJ7VXMB.js → chunk-GAZO25PI.js} +1 -1
  960. package/static/{chunk-IHS5LSJJ.js → chunk-GB7ABR5N.js} +1 -1
  961. package/static/{chunk-27V66YJV.js → chunk-GEHFKZQ5.js} +2 -2
  962. package/static/{chunk-3QTROEHV.js → chunk-GQFMWVFD.js} +1 -1
  963. package/static/{chunk-FWQJ4ZCD.js → chunk-GVNTC564.js} +1 -1
  964. package/static/{chunk-4NIYCYRS.js → chunk-HGL3NYP2.js} +2 -2
  965. package/static/chunk-HLIWPWRA.js +1 -0
  966. package/static/{chunk-3VRUIWQG.js → chunk-HNYB3M4S.js} +1 -1
  967. package/static/{chunk-7HJFIMNF.js → chunk-HUXAUQMN.js} +1 -1
  968. package/static/chunk-I2XA6PPK.js +1 -0
  969. package/static/{chunk-RJULB733.js → chunk-ISV3BO6R.js} +1 -1
  970. package/static/{chunk-R4VYKZVJ.js → chunk-IWWBV6EM.js} +1 -1
  971. package/static/{chunk-TTWMFWEC.js → chunk-JV3AGU5B.js} +1 -1
  972. package/static/{chunk-X7NHX5C7.js → chunk-K25E7YGG.js} +1 -1
  973. package/static/chunk-K46PUTZB.js +1 -0
  974. package/static/{chunk-D2MLAO5N.js → chunk-KERFLJ56.js} +1 -7
  975. package/static/{chunk-LZUHREOF.js → chunk-KJD3KFF3.js} +1 -1
  976. package/static/chunk-KPKSI23S.js +1 -0
  977. package/static/{chunk-CMNMPG6Z.js → chunk-KZS7CTNR.js} +1 -1
  978. package/static/{chunk-RNVPQQKT.js → chunk-L5IHUVXL.js} +1 -1
  979. package/static/{chunk-2GXOVGTD.js → chunk-L7RRX2M3.js} +1 -1
  980. package/static/{chunk-WFMEUST4.js → chunk-LGWJ2WKU.js} +1 -1
  981. package/static/{chunk-ZOMRIN3G.js → chunk-MLC7JK2H.js} +2 -2
  982. package/static/{chunk-76REYAEA.js → chunk-MOHNYW2A.js} +1 -1
  983. package/static/{chunk-ZHUBWKA2.js → chunk-MTRXBVWZ.js} +1 -1
  984. package/static/{chunk-QJ22N76V.js → chunk-MZQK6LNV.js} +1 -1
  985. package/static/{chunk-SDJNZULP.js → chunk-NCDUOVMW.js} +1 -1
  986. package/static/chunk-NGUAJIGI.js +1 -0
  987. package/static/chunk-NIPP6JDI.js +1 -0
  988. package/static/{chunk-VD5JHSDS.js → chunk-NMTBMHUL.js} +1 -1
  989. package/static/chunk-O4XXMZFX.js +4 -0
  990. package/static/{chunk-WZPF4LS2.js → chunk-OANZITPM.js} +1 -1
  991. package/static/{chunk-JNTNMIUH.js → chunk-OGE4SAHU.js} +1 -1
  992. package/static/{chunk-S6H2ELRY.js → chunk-OI3ME22C.js} +1 -1
  993. package/static/{chunk-7KAYOR3A.js → chunk-Q3EGCMF5.js} +1 -1
  994. package/static/chunk-QF2NSHZA.js +1 -0
  995. package/static/{chunk-3ZBAQTHJ.js → chunk-QIGUDEZF.js} +1 -1
  996. package/static/{chunk-76M3BMK6.js → chunk-QJVC3SRJ.js} +11 -11
  997. package/static/{chunk-VBTZDHZ3.js → chunk-QKN6LAAA.js} +1 -1
  998. package/static/{chunk-JRXG43AA.js → chunk-QRFESU5O.js} +2 -2
  999. package/static/chunk-QVRVFYJH.js +1 -0
  1000. package/static/{chunk-BCN4T5DO.js → chunk-RFJIPIOK.js} +2 -2
  1001. package/static/{chunk-2RWLNKZH.js → chunk-RLL634K4.js} +1 -1
  1002. package/static/{chunk-D5FQ72R4.js → chunk-RS2OFKWP.js} +1 -1
  1003. package/static/{chunk-CN5YVRFT.js → chunk-RWAAC3A4.js} +1 -1
  1004. package/static/{chunk-LWSCODLD.js → chunk-RWCNTCU5.js} +1 -1
  1005. package/static/{chunk-FTFEQDWH.js → chunk-S5Y64DDS.js} +1 -1
  1006. package/static/{chunk-J7474P3L.js → chunk-SLG5KDU6.js} +1 -1
  1007. package/static/chunk-TJ4CVFEL.js +1 -0
  1008. package/static/{chunk-KAUCN24H.js → chunk-TWCGKSYE.js} +1 -1
  1009. package/static/{chunk-PDG7DOEF.js → chunk-UMDRE4S7.js} +1 -1
  1010. package/static/chunk-VRIOLRYR.js +5 -0
  1011. package/static/chunk-VS4O2XDP.js +1 -0
  1012. package/static/{chunk-ZEJLIGAY.js → chunk-VSBFNFOM.js} +1 -1
  1013. package/static/{chunk-XSURUW7C.js → chunk-WN4WXCVK.js} +1 -1
  1014. package/static/{chunk-S44QIK3G.js → chunk-WX7RXW7K.js} +1 -1
  1015. package/static/{chunk-3ZLBVUCX.js → chunk-XC4POKR3.js} +2 -2
  1016. package/static/{chunk-TNCKNU6I.js → chunk-Y4AUYQTG.js} +1 -1
  1017. package/static/{chunk-3MVPXC3U.js → chunk-Y67J3BOL.js} +1 -1
  1018. package/static/{chunk-QTPIEEZW.js → chunk-YMIXHRJQ.js} +1 -7
  1019. package/static/{chunk-VZFZUI6D.js → chunk-ZUNKFAKP.js} +1 -1
  1020. package/static/index.html +3 -3
  1021. package/static/main-QN4UCOC5.js +5 -0
  1022. package/static/{styles-XLLEY5Y3.css → styles-46GLIE7Y.css} +1 -1
  1023. package/server/authentication/constants/auth-ldap.js.map +0 -1
  1024. package/server/authentication/dto/two-fa-verify.dto.js.map +0 -1
  1025. package/server/authentication/guards/auth-two-fa-guard.js.map +0 -1
  1026. package/server/authentication/interfaces/two-fa-setup.interface.js +0 -10
  1027. package/server/authentication/interfaces/two-fa-setup.interface.js.map +0 -1
  1028. package/server/authentication/models/auth-method.js +0 -18
  1029. package/server/authentication/models/auth-method.js.map +0 -1
  1030. package/server/authentication/services/auth-manager.service.js.map +0 -1
  1031. package/server/authentication/services/auth-manager.service.spec.js.map +0 -1
  1032. package/server/authentication/services/auth-methods/auth-method-database.service.js.map +0 -1
  1033. package/server/authentication/services/auth-methods/auth-method-database.service.spec.js.map +0 -1
  1034. package/server/authentication/services/auth-methods/auth-method-ldap.service.js +0 -326
  1035. package/server/authentication/services/auth-methods/auth-method-ldap.service.js.map +0 -1
  1036. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js +0 -534
  1037. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js.map +0 -1
  1038. package/server/authentication/services/auth-methods/auth-method-two-fa.service.js.map +0 -1
  1039. package/server/authentication/services/auth-methods/auth-method-two-fa.service.spec.js.map +0 -1
  1040. package/static/chunk-2YQ4SX3A.js +0 -13
  1041. package/static/chunk-46TJLPJY.js +0 -1
  1042. package/static/chunk-6OEOADR6.js +0 -1
  1043. package/static/chunk-AALPWGPB.js +0 -3
  1044. package/static/chunk-CVXLHSO5.js +0 -1
  1045. package/static/chunk-G7RZN7HN.js +0 -1
  1046. package/static/chunk-LTJNLOX2.js +0 -1
  1047. package/static/chunk-NIKNG2FX.js +0 -1
  1048. package/static/chunk-NNZWSNAW.js +0 -1
  1049. package/static/chunk-NWKBB7J4.js +0 -1
  1050. package/static/chunk-PVYVY3GD.js +0 -1
  1051. package/static/chunk-Q5X5TPAG.js +0 -1
  1052. package/static/chunk-R4VMWCM5.js +0 -1
  1053. package/static/chunk-SNOOCDJD.js +0 -1
  1054. package/static/chunk-SPQH3ATC.js +0 -5
  1055. package/static/chunk-ZCSHU3D7.js +0 -1
  1056. package/static/chunk-ZU5MQTFN.js +0 -4
  1057. package/static/main-5O3KLGIR.js +0 -11
@@ -21,8 +21,8 @@
21
21
  */
22
22
 
23
23
  /**
24
- * pdfjsVersion = 5.4.530
25
- * pdfjsBuild = 50cc4adac
24
+ * pdfjsVersion = 5.4.624
25
+ * pdfjsBuild = 384c6208b
26
26
  */
27
27
  /******/ // The require scope
28
28
  /******/ var __webpack_require__ = {};
@@ -897,31 +897,6 @@ function _isValidExplicitDest(validRef, validName, dest) {
897
897
  function MathClamp(v, min, max) {
898
898
  return Math.min(Math.max(v, min), max);
899
899
  }
900
- function toHexUtil(arr) {
901
- if (Uint8Array.prototype.toHex) {
902
- return arr.toHex();
903
- }
904
- return Array.from(arr, num => hexNumbers[num]).join("");
905
- }
906
- function toBase64Util(arr) {
907
- if (Uint8Array.prototype.toBase64) {
908
- return arr.toBase64();
909
- }
910
- return btoa(bytesToString(arr));
911
- }
912
- function fromBase64Util(str) {
913
- if (Uint8Array.fromBase64) {
914
- return Uint8Array.fromBase64(str);
915
- }
916
- return stringToBytes(atob(str));
917
- }
918
- if (typeof Promise.try !== "function") {
919
- Promise.try = function (fn, ...args) {
920
- return new Promise(resolve => {
921
- resolve(fn(...args));
922
- });
923
- };
924
- }
925
900
  if (typeof Math.sumPrecise !== "function") {
926
901
  Math.sumPrecise = function (numbers) {
927
902
  return numbers.reduce((a, b) => a + b, 0);
@@ -1879,6 +1854,115 @@ function makePathFromDrawOPS(data) {
1879
1854
  }
1880
1855
  return path;
1881
1856
  }
1857
+ class PagesMapper {
1858
+ static #idToPageNumber = null;
1859
+ static #pageNumberToId = null;
1860
+ static #prevIdToPageNumber = null;
1861
+ static #pagesNumber = 0;
1862
+ static #listeners = [];
1863
+ get pagesNumber() {
1864
+ return PagesMapper.#pagesNumber;
1865
+ }
1866
+ set pagesNumber(n) {
1867
+ if (PagesMapper.#pagesNumber === n) {
1868
+ return;
1869
+ }
1870
+ PagesMapper.#pagesNumber = n;
1871
+ if (n === 0) {
1872
+ PagesMapper.#pageNumberToId = null;
1873
+ PagesMapper.#idToPageNumber = null;
1874
+ }
1875
+ }
1876
+ addListener(listener) {
1877
+ PagesMapper.#listeners.push(listener);
1878
+ }
1879
+ removeListener(listener) {
1880
+ const index = PagesMapper.#listeners.indexOf(listener);
1881
+ if (index >= 0) {
1882
+ PagesMapper.#listeners.splice(index, 1);
1883
+ }
1884
+ }
1885
+ #updateListeners() {
1886
+ for (const listener of PagesMapper.#listeners) {
1887
+ listener();
1888
+ }
1889
+ }
1890
+ #init(mustInit) {
1891
+ if (PagesMapper.#pageNumberToId) {
1892
+ return;
1893
+ }
1894
+ const n = PagesMapper.#pagesNumber;
1895
+ const array = new Uint32Array(3 * n);
1896
+ const pageNumberToId = PagesMapper.#pageNumberToId = array.subarray(0, n);
1897
+ const idToPageNumber = PagesMapper.#idToPageNumber = array.subarray(n, 2 * n);
1898
+ if (mustInit) {
1899
+ for (let i = 0; i < n; i++) {
1900
+ pageNumberToId[i] = idToPageNumber[i] = i + 1;
1901
+ }
1902
+ }
1903
+ PagesMapper.#prevIdToPageNumber = array.subarray(2 * n);
1904
+ }
1905
+ movePages(selectedPages, pagesToMove, index) {
1906
+ this.#init(true);
1907
+ const pageNumberToId = PagesMapper.#pageNumberToId;
1908
+ const idToPageNumber = PagesMapper.#idToPageNumber;
1909
+ PagesMapper.#prevIdToPageNumber.set(idToPageNumber);
1910
+ const movedCount = pagesToMove.length;
1911
+ const mappedPagesToMove = new Uint32Array(movedCount);
1912
+ let removedBeforeTarget = 0;
1913
+ for (let i = 0; i < movedCount; i++) {
1914
+ const pageIndex = pagesToMove[i] - 1;
1915
+ mappedPagesToMove[i] = pageNumberToId[pageIndex];
1916
+ if (pageIndex < index) {
1917
+ removedBeforeTarget += 1;
1918
+ }
1919
+ }
1920
+ const pagesNumber = PagesMapper.#pagesNumber;
1921
+ let adjustedTarget = index - removedBeforeTarget;
1922
+ const remainingLen = pagesNumber - movedCount;
1923
+ adjustedTarget = MathClamp(adjustedTarget, 0, remainingLen);
1924
+ for (let i = 0, r = 0; i < pagesNumber; i++) {
1925
+ if (!selectedPages.has(i + 1)) {
1926
+ pageNumberToId[r++] = pageNumberToId[i];
1927
+ }
1928
+ }
1929
+ pageNumberToId.copyWithin(adjustedTarget + movedCount, adjustedTarget, remainingLen);
1930
+ pageNumberToId.set(mappedPagesToMove, adjustedTarget);
1931
+ let hasChanged = false;
1932
+ for (let i = 0, ii = pagesNumber; i < ii; i++) {
1933
+ const id = pageNumberToId[i];
1934
+ hasChanged ||= id !== i + 1;
1935
+ idToPageNumber[id - 1] = i + 1;
1936
+ }
1937
+ this.#updateListeners();
1938
+ if (!hasChanged) {
1939
+ this.pagesNumber = 0;
1940
+ }
1941
+ }
1942
+ hasBeenAltered() {
1943
+ return PagesMapper.#pageNumberToId !== null;
1944
+ }
1945
+ getPageMappingForSaving() {
1946
+ return {
1947
+ pageIndices: PagesMapper.#idToPageNumber ? PagesMapper.#idToPageNumber.map(x => x - 1) : null
1948
+ };
1949
+ }
1950
+ getPrevPageNumber(pageNumber) {
1951
+ return PagesMapper.#prevIdToPageNumber[PagesMapper.#pageNumberToId[pageNumber - 1] - 1];
1952
+ }
1953
+ getPageNumber(id) {
1954
+ return PagesMapper.#idToPageNumber?.[id - 1] ?? id;
1955
+ }
1956
+ getPageId(pageNumber) {
1957
+ return PagesMapper.#pageNumberToId?.[pageNumber - 1] ?? pageNumber;
1958
+ }
1959
+ static get instance() {
1960
+ return shadow(this, "instance", new PagesMapper());
1961
+ }
1962
+ getMapping() {
1963
+ return PagesMapper.#pageNumberToId.subarray(0, this.pagesNumber);
1964
+ }
1965
+ }
1882
1966
 
1883
1967
  ;// ./src/display/editor/toolbar.js
1884
1968
 
@@ -2759,6 +2843,9 @@ class AnnotationEditorUIManager {
2759
2843
  eventBus._on("switchannotationeditorparams", evt => this.updateParams(evt.type, evt.value), {
2760
2844
  signal
2761
2845
  });
2846
+ eventBus._on("pagesedited", this.onPagesEdited.bind(this), {
2847
+ signal
2848
+ });
2762
2849
  window.addEventListener("pointerdown", () => {
2763
2850
  this.#isPointerDown = true;
2764
2851
  }, {
@@ -2920,6 +3007,21 @@ class AnnotationEditorUIManager {
2920
3007
  removeComment(editor) {
2921
3008
  this.#commentManager?.removeComments([editor.uid]);
2922
3009
  }
3010
+ deleteComment(editor, savedData) {
3011
+ const undo = () => {
3012
+ editor.comment = savedData;
3013
+ };
3014
+ const cmd = () => {
3015
+ this._editorUndoBar?.show(undo, "comment");
3016
+ this.toggleComment(null);
3017
+ editor.comment = null;
3018
+ };
3019
+ this.addCommands({
3020
+ cmd,
3021
+ undo,
3022
+ mustExec: true
3023
+ });
3024
+ }
2923
3025
  toggleComment(editor, isSelected, visibility = undefined) {
2924
3026
  this.#commentManager?.toggleCommentPopup(editor, isSelected, visibility);
2925
3027
  }
@@ -2982,6 +3084,24 @@ class AnnotationEditorUIManager {
2982
3084
  break;
2983
3085
  }
2984
3086
  }
3087
+ onPagesEdited({
3088
+ pagesMapper
3089
+ }) {
3090
+ for (const editor of this.#allEditors.values()) {
3091
+ editor.updatePageIndex(pagesMapper.getPrevPageNumber(editor.pageIndex + 1) - 1);
3092
+ }
3093
+ const allLayers = this.#allLayers;
3094
+ const newAllLayers = this.#allLayers = new Map();
3095
+ for (const [pageIndex, layer] of allLayers) {
3096
+ const prevPageIndex = pagesMapper.getPrevPageNumber(pageIndex + 1) - 1;
3097
+ if (prevPageIndex === -1) {
3098
+ layer.destroy();
3099
+ continue;
3100
+ }
3101
+ newAllLayers.set(prevPageIndex, layer);
3102
+ layer.updatePageIndex(prevPageIndex);
3103
+ }
3104
+ }
2985
3105
  onPageChanging({
2986
3106
  pageNumber
2987
3107
  }) {
@@ -4741,6 +4861,16 @@ class Comment {
4741
4861
  this.#date = new Date();
4742
4862
  this.#deleted = false;
4743
4863
  }
4864
+ restoreData({
4865
+ text,
4866
+ richText,
4867
+ date
4868
+ }) {
4869
+ this.#text = text;
4870
+ this.#richText = richText;
4871
+ this.#date = date;
4872
+ this.#deleted = false;
4873
+ }
4744
4874
  setInitialText(text, richText = null) {
4745
4875
  this.#initialText = text;
4746
4876
  this.data = text;
@@ -5044,6 +5174,9 @@ class AnnotationEditor {
5044
5174
  this.isAttachedToDOM = false;
5045
5175
  this.deleted = false;
5046
5176
  }
5177
+ updatePageIndex(newPageIndex) {
5178
+ this.pageIndex = newPageIndex;
5179
+ }
5047
5180
  get editorType() {
5048
5181
  return Object.getPrototypeOf(this).constructor._type;
5049
5182
  }
@@ -5730,6 +5863,9 @@ class AnnotationEditor {
5730
5863
  this.#commentStandaloneButton?.classList.add("hidden");
5731
5864
  }
5732
5865
  get comment() {
5866
+ if (!this.#comment) {
5867
+ return null;
5868
+ }
5733
5869
  const {
5734
5870
  data: {
5735
5871
  richText,
@@ -5747,9 +5883,13 @@ class AnnotationEditor {
5747
5883
  opacity: this.opacity ?? 1
5748
5884
  };
5749
5885
  }
5750
- set comment(text) {
5886
+ set comment(value) {
5751
5887
  this.#comment ||= new Comment(this);
5752
- this.#comment.data = text;
5888
+ if (typeof value === "object" && value !== null) {
5889
+ this.#comment.restoreData(value);
5890
+ } else {
5891
+ this.#comment.data = value;
5892
+ }
5753
5893
  if (this.hasComment) {
5754
5894
  this.removeCommentButtonFromToolbar();
5755
5895
  this.addStandaloneCommentButton();
@@ -6794,6 +6934,10 @@ class AnnotationStorage {
6794
6934
  let hasBitmap = false;
6795
6935
  for (const [key, val] of this.#storage) {
6796
6936
  const serialized = val instanceof AnnotationEditor ? val.serialize(false, context) : val;
6937
+ if (val.page) {
6938
+ val.pageIndex = val.page._pageIndex;
6939
+ delete val.page;
6940
+ }
6797
6941
  if (serialized) {
6798
6942
  map.set(key, serialized);
6799
6943
  hash.update(`${key}:${JSON.stringify(serialized)}`);
@@ -7180,7 +7324,7 @@ class FontFaceObject {
7180
7324
  if (!this.data || this.disableFontFace) {
7181
7325
  return null;
7182
7326
  }
7183
- const url = `url(data:${this.mimetype};base64,${toBase64Util(this.data)});`;
7327
+ const url = `url(data:${this.mimetype};base64,${this.data.toBase64()});`;
7184
7328
  let rule;
7185
7329
  if (!this.cssFontInfo) {
7186
7330
  rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`;
@@ -12643,148 +12787,199 @@ class OptionalContentConfig {
12643
12787
  }
12644
12788
  }
12645
12789
 
12790
+ ;// ./src/shared/base_pdf_stream.js
12791
+
12792
+ class BasePDFStream {
12793
+ #PDFStreamReader = null;
12794
+ #PDFStreamRangeReader = null;
12795
+ _fullReader = null;
12796
+ _rangeReaders = new Set();
12797
+ _source = null;
12798
+ constructor(source, PDFStreamReader, PDFStreamRangeReader) {
12799
+ this._source = source;
12800
+ this.#PDFStreamReader = PDFStreamReader;
12801
+ this.#PDFStreamRangeReader = PDFStreamRangeReader;
12802
+ }
12803
+ get _progressiveDataLength() {
12804
+ return this._fullReader?._loaded ?? 0;
12805
+ }
12806
+ getFullReader() {
12807
+ assert(!this._fullReader, "BasePDFStream.getFullReader can only be called once.");
12808
+ return this._fullReader = new this.#PDFStreamReader(this);
12809
+ }
12810
+ getRangeReader(begin, end) {
12811
+ if (end <= this._progressiveDataLength) {
12812
+ return null;
12813
+ }
12814
+ const reader = new this.#PDFStreamRangeReader(this, begin, end);
12815
+ this._rangeReaders.add(reader);
12816
+ return reader;
12817
+ }
12818
+ cancelAllRequests(reason) {
12819
+ this._fullReader?.cancel(reason);
12820
+ for (const reader of new Set(this._rangeReaders)) {
12821
+ reader.cancel(reason);
12822
+ }
12823
+ }
12824
+ }
12825
+ class BasePDFStreamReader {
12826
+ onProgress = null;
12827
+ _contentLength = 0;
12828
+ _filename = null;
12829
+ _headersCapability = Promise.withResolvers();
12830
+ _isRangeSupported = false;
12831
+ _isStreamingSupported = false;
12832
+ _loaded = 0;
12833
+ _stream = null;
12834
+ constructor(stream) {
12835
+ this._stream = stream;
12836
+ }
12837
+ get headersReady() {
12838
+ return this._headersCapability.promise;
12839
+ }
12840
+ get filename() {
12841
+ return this._filename;
12842
+ }
12843
+ get contentLength() {
12844
+ return this._contentLength;
12845
+ }
12846
+ get isRangeSupported() {
12847
+ return this._isRangeSupported;
12848
+ }
12849
+ get isStreamingSupported() {
12850
+ return this._isStreamingSupported;
12851
+ }
12852
+ async read() {
12853
+ unreachable("Abstract method `read` called");
12854
+ }
12855
+ cancel(reason) {
12856
+ unreachable("Abstract method `cancel` called");
12857
+ }
12858
+ }
12859
+ class BasePDFStreamRangeReader {
12860
+ _stream = null;
12861
+ constructor(stream, begin, end) {
12862
+ this._stream = stream;
12863
+ }
12864
+ async read() {
12865
+ unreachable("Abstract method `read` called");
12866
+ }
12867
+ cancel(reason) {
12868
+ unreachable("Abstract method `cancel` called");
12869
+ }
12870
+ }
12871
+
12646
12872
  ;// ./src/display/transport_stream.js
12647
12873
 
12648
12874
 
12649
- class PDFDataTransportStream {
12650
- constructor(pdfDataRangeTransport, {
12651
- disableRange = false,
12652
- disableStream = false
12653
- }) {
12654
- assert(pdfDataRangeTransport, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
12875
+
12876
+ function getArrayBuffer(val) {
12877
+ return val instanceof Uint8Array && val.byteLength === val.buffer.byteLength ? val.buffer : new Uint8Array(val).buffer;
12878
+ }
12879
+ class PDFDataTransportStream extends BasePDFStream {
12880
+ _progressiveDone = false;
12881
+ _queuedChunks = [];
12882
+ constructor(source) {
12883
+ super(source, PDFDataTransportStreamReader, PDFDataTransportStreamRangeReader);
12884
+ const {
12885
+ pdfDataRangeTransport
12886
+ } = source;
12655
12887
  const {
12656
- length,
12657
12888
  initialData,
12658
- progressiveDone,
12659
- contentDispositionFilename
12889
+ progressiveDone
12660
12890
  } = pdfDataRangeTransport;
12661
- this._queuedChunks = [];
12662
- this._progressiveDone = progressiveDone;
12663
- this._contentDispositionFilename = contentDispositionFilename;
12664
12891
  if (initialData?.length > 0) {
12665
- const buffer = initialData instanceof Uint8Array && initialData.byteLength === initialData.buffer.byteLength ? initialData.buffer : new Uint8Array(initialData).buffer;
12892
+ const buffer = getArrayBuffer(initialData);
12666
12893
  this._queuedChunks.push(buffer);
12667
12894
  }
12668
- this._pdfDataRangeTransport = pdfDataRangeTransport;
12669
- this._isStreamingSupported = !disableStream;
12670
- this._isRangeSupported = !disableRange;
12671
- this._contentLength = length;
12672
- this._fullRequestReader = null;
12673
- this._rangeReaders = [];
12895
+ this._progressiveDone = progressiveDone;
12674
12896
  pdfDataRangeTransport.addRangeListener((begin, chunk) => {
12675
- this._onReceiveData({
12676
- begin,
12677
- chunk
12678
- });
12897
+ this.#onReceiveData(begin, chunk);
12679
12898
  });
12680
12899
  pdfDataRangeTransport.addProgressListener((loaded, total) => {
12681
- this._onProgress({
12682
- loaded,
12683
- total
12684
- });
12900
+ if (total !== undefined) {
12901
+ this._fullReader?.onProgress?.({
12902
+ loaded,
12903
+ total
12904
+ });
12905
+ }
12685
12906
  });
12686
12907
  pdfDataRangeTransport.addProgressiveReadListener(chunk => {
12687
- this._onReceiveData({
12688
- chunk
12689
- });
12908
+ this.#onReceiveData(undefined, chunk);
12690
12909
  });
12691
12910
  pdfDataRangeTransport.addProgressiveDoneListener(() => {
12692
- this._onProgressiveDone();
12911
+ this._fullReader?.progressiveDone();
12912
+ this._progressiveDone = true;
12693
12913
  });
12694
12914
  pdfDataRangeTransport.transportReady();
12695
12915
  }
12696
- _onReceiveData({
12697
- begin,
12698
- chunk
12699
- }) {
12700
- const buffer = chunk instanceof Uint8Array && chunk.byteLength === chunk.buffer.byteLength ? chunk.buffer : new Uint8Array(chunk).buffer;
12916
+ #onReceiveData(begin, chunk) {
12917
+ const buffer = getArrayBuffer(chunk);
12701
12918
  if (begin === undefined) {
12702
- if (this._fullRequestReader) {
12703
- this._fullRequestReader._enqueue(buffer);
12919
+ if (this._fullReader) {
12920
+ this._fullReader._enqueue(buffer);
12704
12921
  } else {
12705
12922
  this._queuedChunks.push(buffer);
12706
12923
  }
12707
12924
  } else {
12708
- const found = this._rangeReaders.some(function (rangeReader) {
12709
- if (rangeReader._begin !== begin) {
12710
- return false;
12711
- }
12712
- rangeReader._enqueue(buffer);
12713
- return true;
12714
- });
12715
- assert(found, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
12716
- }
12717
- }
12718
- get _progressiveDataLength() {
12719
- return this._fullRequestReader?._loaded ?? 0;
12720
- }
12721
- _onProgress(evt) {
12722
- if (evt.total === undefined) {
12723
- this._rangeReaders[0]?.onProgress?.({
12724
- loaded: evt.loaded
12725
- });
12726
- } else {
12727
- this._fullRequestReader?.onProgress?.({
12728
- loaded: evt.loaded,
12729
- total: evt.total
12730
- });
12731
- }
12732
- }
12733
- _onProgressiveDone() {
12734
- this._fullRequestReader?.progressiveDone();
12735
- this._progressiveDone = true;
12736
- }
12737
- _removeRangeReader(reader) {
12738
- const i = this._rangeReaders.indexOf(reader);
12739
- if (i >= 0) {
12740
- this._rangeReaders.splice(i, 1);
12925
+ const rangeReader = this._rangeReaders.keys().find(r => r._begin === begin);
12926
+ assert(rangeReader, "#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
12927
+ rangeReader._enqueue(buffer);
12741
12928
  }
12742
12929
  }
12743
12930
  getFullReader() {
12744
- assert(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
12745
- const queuedChunks = this._queuedChunks;
12931
+ const reader = super.getFullReader();
12746
12932
  this._queuedChunks = null;
12747
- return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone, this._contentDispositionFilename);
12933
+ return reader;
12748
12934
  }
12749
12935
  getRangeReader(begin, end) {
12750
- if (end <= this._progressiveDataLength) {
12751
- return null;
12936
+ const reader = super.getRangeReader(begin, end);
12937
+ if (reader) {
12938
+ reader.onDone = () => this._rangeReaders.delete(reader);
12939
+ this._source.pdfDataRangeTransport.requestDataRange(begin, end);
12752
12940
  }
12753
- const reader = new PDFDataTransportStreamRangeReader(this, begin, end);
12754
- this._pdfDataRangeTransport.requestDataRange(begin, end);
12755
- this._rangeReaders.push(reader);
12756
12941
  return reader;
12757
12942
  }
12758
12943
  cancelAllRequests(reason) {
12759
- this._fullRequestReader?.cancel(reason);
12760
- for (const reader of this._rangeReaders.slice(0)) {
12761
- reader.cancel(reason);
12762
- }
12763
- this._pdfDataRangeTransport.abort();
12944
+ super.cancelAllRequests(reason);
12945
+ this._source.pdfDataRangeTransport.abort();
12764
12946
  }
12765
12947
  }
12766
- class PDFDataTransportStreamReader {
12767
- constructor(stream, queuedChunks, progressiveDone = false, contentDispositionFilename = null) {
12768
- this._stream = stream;
12769
- this._done = progressiveDone || false;
12770
- this._filename = isPdfFile(contentDispositionFilename) ? contentDispositionFilename : null;
12771
- this._queuedChunks = queuedChunks || [];
12772
- this._loaded = 0;
12948
+ class PDFDataTransportStreamReader extends BasePDFStreamReader {
12949
+ _done = false;
12950
+ _queuedChunks = null;
12951
+ _requests = [];
12952
+ constructor(stream) {
12953
+ super(stream);
12954
+ const {
12955
+ pdfDataRangeTransport,
12956
+ disableRange,
12957
+ disableStream
12958
+ } = stream._source;
12959
+ const {
12960
+ length,
12961
+ contentDispositionFilename
12962
+ } = pdfDataRangeTransport;
12963
+ this._queuedChunks = stream._queuedChunks || [];
12773
12964
  for (const chunk of this._queuedChunks) {
12774
12965
  this._loaded += chunk.byteLength;
12775
12966
  }
12776
- this._requests = [];
12777
- this._headersReady = Promise.resolve();
12778
- stream._fullRequestReader = this;
12779
- this.onProgress = null;
12967
+ this._done = stream._progressiveDone;
12968
+ this._contentLength = length;
12969
+ this._isStreamingSupported = !disableStream;
12970
+ this._isRangeSupported = !disableRange;
12971
+ if (isPdfFile(contentDispositionFilename)) {
12972
+ this._filename = contentDispositionFilename;
12973
+ }
12974
+ this._headersCapability.resolve();
12780
12975
  }
12781
12976
  _enqueue(chunk) {
12782
12977
  if (this._done) {
12783
12978
  return;
12784
12979
  }
12785
12980
  if (this._requests.length > 0) {
12786
- const requestCapability = this._requests.shift();
12787
- requestCapability.resolve({
12981
+ const capability = this._requests.shift();
12982
+ capability.resolve({
12788
12983
  value: chunk,
12789
12984
  done: false
12790
12985
  });
@@ -12793,21 +12988,6 @@ class PDFDataTransportStreamReader {
12793
12988
  }
12794
12989
  this._loaded += chunk.byteLength;
12795
12990
  }
12796
- get headersReady() {
12797
- return this._headersReady;
12798
- }
12799
- get filename() {
12800
- return this._filename;
12801
- }
12802
- get isRangeSupported() {
12803
- return this._stream._isRangeSupported;
12804
- }
12805
- get isStreamingSupported() {
12806
- return this._stream._isStreamingSupported;
12807
- }
12808
- get contentLength() {
12809
- return this._stream._contentLength;
12810
- }
12811
12991
  async read() {
12812
12992
  if (this._queuedChunks.length > 0) {
12813
12993
  const chunk = this._queuedChunks.shift();
@@ -12822,14 +13002,14 @@ class PDFDataTransportStreamReader {
12822
13002
  done: true
12823
13003
  };
12824
13004
  }
12825
- const requestCapability = Promise.withResolvers();
12826
- this._requests.push(requestCapability);
12827
- return requestCapability.promise;
13005
+ const capability = Promise.withResolvers();
13006
+ this._requests.push(capability);
13007
+ return capability.promise;
12828
13008
  }
12829
13009
  cancel(reason) {
12830
13010
  this._done = true;
12831
- for (const requestCapability of this._requests) {
12832
- requestCapability.resolve({
13011
+ for (const capability of this._requests) {
13012
+ capability.resolve({
12833
13013
  value: undefined,
12834
13014
  done: true
12835
13015
  });
@@ -12837,21 +13017,18 @@ class PDFDataTransportStreamReader {
12837
13017
  this._requests.length = 0;
12838
13018
  }
12839
13019
  progressiveDone() {
12840
- if (this._done) {
12841
- return;
12842
- }
12843
- this._done = true;
13020
+ this._done ||= true;
12844
13021
  }
12845
13022
  }
12846
- class PDFDataTransportStreamRangeReader {
13023
+ class PDFDataTransportStreamRangeReader extends BasePDFStreamRangeReader {
13024
+ onDone = null;
13025
+ _begin = -1;
13026
+ _done = false;
13027
+ _queuedChunk = null;
13028
+ _requests = [];
12847
13029
  constructor(stream, begin, end) {
12848
- this._stream = stream;
13030
+ super(stream, begin, end);
12849
13031
  this._begin = begin;
12850
- this._end = end;
12851
- this._queuedChunk = null;
12852
- this._requests = [];
12853
- this._done = false;
12854
- this.onProgress = null;
12855
13032
  }
12856
13033
  _enqueue(chunk) {
12857
13034
  if (this._done) {
@@ -12860,13 +13037,13 @@ class PDFDataTransportStreamRangeReader {
12860
13037
  if (this._requests.length === 0) {
12861
13038
  this._queuedChunk = chunk;
12862
13039
  } else {
12863
- const requestsCapability = this._requests.shift();
12864
- requestsCapability.resolve({
13040
+ const firstCapability = this._requests.shift();
13041
+ firstCapability.resolve({
12865
13042
  value: chunk,
12866
13043
  done: false
12867
13044
  });
12868
- for (const requestCapability of this._requests) {
12869
- requestCapability.resolve({
13045
+ for (const capability of this._requests) {
13046
+ capability.resolve({
12870
13047
  value: undefined,
12871
13048
  done: true
12872
13049
  });
@@ -12874,10 +13051,7 @@ class PDFDataTransportStreamRangeReader {
12874
13051
  this._requests.length = 0;
12875
13052
  }
12876
13053
  this._done = true;
12877
- this._stream._removeRangeReader(this);
12878
- }
12879
- get isStreamingSupported() {
12880
- return false;
13054
+ this.onDone?.();
12881
13055
  }
12882
13056
  async read() {
12883
13057
  if (this._queuedChunk) {
@@ -12894,20 +13068,20 @@ class PDFDataTransportStreamRangeReader {
12894
13068
  done: true
12895
13069
  };
12896
13070
  }
12897
- const requestCapability = Promise.withResolvers();
12898
- this._requests.push(requestCapability);
12899
- return requestCapability.promise;
13071
+ const capability = Promise.withResolvers();
13072
+ this._requests.push(capability);
13073
+ return capability.promise;
12900
13074
  }
12901
13075
  cancel(reason) {
12902
13076
  this._done = true;
12903
- for (const requestCapability of this._requests) {
12904
- requestCapability.resolve({
13077
+ for (const capability of this._requests) {
13078
+ capability.resolve({
12905
13079
  value: undefined,
12906
13080
  done: true
12907
13081
  });
12908
13082
  }
12909
13083
  this._requests.length = 0;
12910
- this._stream._removeRangeReader(this);
13084
+ this.onDone?.();
12911
13085
  }
12912
13086
  }
12913
13087
 
@@ -13111,24 +13285,32 @@ function extractFilenameFromHeader(responseHeaders) {
13111
13285
  function createResponseError(status, url) {
13112
13286
  return new ResponseException(`Unexpected server response (${status}) while retrieving PDF "${url}".`, status, status === 404 || status === 0 && url.startsWith("file:"));
13113
13287
  }
13114
- function validateResponseStatus(status) {
13115
- return status === 200 || status === 206;
13288
+ function ensureResponseOrigin(rangeOrigin, origin) {
13289
+ if (rangeOrigin !== origin) {
13290
+ throw new Error(`Expected range response-origin "${rangeOrigin}" to match "${origin}".`);
13291
+ }
13116
13292
  }
13117
13293
 
13118
13294
  ;// ./src/display/fetch_stream.js
13119
13295
 
13120
13296
 
13121
- function createFetchOptions(headers, withCredentials, abortController) {
13122
- return {
13297
+
13298
+ function fetchUrl(url, headers, withCredentials, abortController) {
13299
+ return fetch(url, {
13123
13300
  method: "GET",
13124
13301
  headers,
13125
13302
  signal: abortController.signal,
13126
13303
  mode: "cors",
13127
13304
  credentials: withCredentials ? "include" : "same-origin",
13128
13305
  redirect: "follow"
13129
- };
13306
+ });
13130
13307
  }
13131
- function getArrayBuffer(val) {
13308
+ function ensureResponseStatus(status, url) {
13309
+ if (status !== 200 && status !== 206) {
13310
+ throw createResponseError(status, url);
13311
+ }
13312
+ }
13313
+ function fetch_stream_getArrayBuffer(val) {
13132
13314
  if (val instanceof Uint8Array) {
13133
13315
  return val.buffer;
13134
13316
  }
@@ -13138,65 +13320,35 @@ function getArrayBuffer(val) {
13138
13320
  warn(`getArrayBuffer - unexpected data format: ${val}`);
13139
13321
  return new Uint8Array(val).buffer;
13140
13322
  }
13141
- class PDFFetchStream {
13323
+ class PDFFetchStream extends BasePDFStream {
13142
13324
  _responseOrigin = null;
13143
13325
  constructor(source) {
13144
- this.source = source;
13326
+ super(source, PDFFetchStreamReader, PDFFetchStreamRangeReader);
13145
13327
  this.isHttp = /^https?:/i.test(source.url);
13146
13328
  this.headers = createHeaders(this.isHttp, source.httpHeaders);
13147
- this._fullRequestReader = null;
13148
- this._rangeRequestReaders = [];
13149
- }
13150
- get _progressiveDataLength() {
13151
- return this._fullRequestReader?._loaded ?? 0;
13152
- }
13153
- getFullReader() {
13154
- assert(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once.");
13155
- this._fullRequestReader = new PDFFetchStreamReader(this);
13156
- return this._fullRequestReader;
13157
- }
13158
- getRangeReader(begin, end) {
13159
- if (end <= this._progressiveDataLength) {
13160
- return null;
13161
- }
13162
- const reader = new PDFFetchStreamRangeReader(this, begin, end);
13163
- this._rangeRequestReaders.push(reader);
13164
- return reader;
13165
- }
13166
- cancelAllRequests(reason) {
13167
- this._fullRequestReader?.cancel(reason);
13168
- for (const reader of this._rangeRequestReaders.slice(0)) {
13169
- reader.cancel(reason);
13170
- }
13171
13329
  }
13172
13330
  }
13173
- class PDFFetchStreamReader {
13331
+ class PDFFetchStreamReader extends BasePDFStreamReader {
13332
+ _abortController = new AbortController();
13333
+ _reader = null;
13174
13334
  constructor(stream) {
13175
- this._stream = stream;
13176
- this._reader = null;
13177
- this._loaded = 0;
13178
- this._filename = null;
13179
- const source = stream.source;
13180
- this._withCredentials = source.withCredentials || false;
13181
- this._contentLength = source.length;
13182
- this._headersCapability = Promise.withResolvers();
13183
- this._disableRange = source.disableRange || false;
13184
- this._rangeChunkSize = source.rangeChunkSize;
13185
- if (!this._rangeChunkSize && !this._disableRange) {
13186
- this._disableRange = true;
13187
- }
13188
- this._abortController = new AbortController();
13189
- this._isStreamingSupported = !source.disableStream;
13190
- this._isRangeSupported = !source.disableRange;
13335
+ super(stream);
13336
+ const {
13337
+ disableRange,
13338
+ disableStream,
13339
+ length,
13340
+ rangeChunkSize,
13341
+ url,
13342
+ withCredentials
13343
+ } = stream._source;
13344
+ this._contentLength = length;
13345
+ this._isStreamingSupported = !disableStream;
13346
+ this._isRangeSupported = !disableRange;
13191
13347
  const headers = new Headers(stream.headers);
13192
- const url = source.url;
13193
- fetch(url, createFetchOptions(headers, this._withCredentials, this._abortController)).then(response => {
13348
+ fetchUrl(url, headers, withCredentials, this._abortController).then(response => {
13194
13349
  stream._responseOrigin = getResponseOrigin(response.url);
13195
- if (!validateResponseStatus(response.status)) {
13196
- throw createResponseError(response.status, url);
13197
- }
13350
+ ensureResponseStatus(response.status, url);
13198
13351
  this._reader = response.body.getReader();
13199
- this._headersCapability.resolve();
13200
13352
  const responseHeaders = response.headers;
13201
13353
  const {
13202
13354
  allowRangeRequests,
@@ -13204,8 +13356,8 @@ class PDFFetchStreamReader {
13204
13356
  } = validateRangeRequestCapabilities({
13205
13357
  responseHeaders,
13206
13358
  isHttp: stream.isHttp,
13207
- rangeChunkSize: this._rangeChunkSize,
13208
- disableRange: this._disableRange
13359
+ rangeChunkSize,
13360
+ disableRange
13209
13361
  });
13210
13362
  this._isRangeSupported = allowRangeRequests;
13211
13363
  this._contentLength = suggestedLength || this._contentLength;
@@ -13213,23 +13365,8 @@ class PDFFetchStreamReader {
13213
13365
  if (!this._isStreamingSupported && this._isRangeSupported) {
13214
13366
  this.cancel(new AbortException("Streaming is disabled."));
13215
13367
  }
13368
+ this._headersCapability.resolve();
13216
13369
  }).catch(this._headersCapability.reject);
13217
- this.onProgress = null;
13218
- }
13219
- get headersReady() {
13220
- return this._headersCapability.promise;
13221
- }
13222
- get filename() {
13223
- return this._filename;
13224
- }
13225
- get contentLength() {
13226
- return this._contentLength;
13227
- }
13228
- get isRangeSupported() {
13229
- return this._isRangeSupported;
13230
- }
13231
- get isStreamingSupported() {
13232
- return this._isStreamingSupported;
13233
13370
  }
13234
13371
  async read() {
13235
13372
  await this._headersCapability.promise;
@@ -13249,7 +13386,7 @@ class PDFFetchStreamReader {
13249
13386
  total: this._contentLength
13250
13387
  });
13251
13388
  return {
13252
- value: getArrayBuffer(value),
13389
+ value: fetch_stream_getArrayBuffer(value),
13253
13390
  done: false
13254
13391
  };
13255
13392
  }
@@ -13258,34 +13395,25 @@ class PDFFetchStreamReader {
13258
13395
  this._abortController.abort();
13259
13396
  }
13260
13397
  }
13261
- class PDFFetchStreamRangeReader {
13398
+ class PDFFetchStreamRangeReader extends BasePDFStreamRangeReader {
13399
+ _abortController = new AbortController();
13400
+ _readCapability = Promise.withResolvers();
13401
+ _reader = null;
13262
13402
  constructor(stream, begin, end) {
13263
- this._stream = stream;
13264
- this._reader = null;
13265
- this._loaded = 0;
13266
- const source = stream.source;
13267
- this._withCredentials = source.withCredentials || false;
13268
- this._readCapability = Promise.withResolvers();
13269
- this._isStreamingSupported = !source.disableStream;
13270
- this._abortController = new AbortController();
13403
+ super(stream, begin, end);
13404
+ const {
13405
+ url,
13406
+ withCredentials
13407
+ } = stream._source;
13271
13408
  const headers = new Headers(stream.headers);
13272
13409
  headers.append("Range", `bytes=${begin}-${end - 1}`);
13273
- const url = source.url;
13274
- fetch(url, createFetchOptions(headers, this._withCredentials, this._abortController)).then(response => {
13410
+ fetchUrl(url, headers, withCredentials, this._abortController).then(response => {
13275
13411
  const responseOrigin = getResponseOrigin(response.url);
13276
- if (responseOrigin !== stream._responseOrigin) {
13277
- throw new Error(`Expected range response-origin "${responseOrigin}" to match "${stream._responseOrigin}".`);
13278
- }
13279
- if (!validateResponseStatus(response.status)) {
13280
- throw createResponseError(response.status, url);
13281
- }
13282
- this._readCapability.resolve();
13412
+ ensureResponseOrigin(responseOrigin, stream._responseOrigin);
13413
+ ensureResponseStatus(response.status, url);
13283
13414
  this._reader = response.body.getReader();
13415
+ this._readCapability.resolve();
13284
13416
  }).catch(this._readCapability.reject);
13285
- this.onProgress = null;
13286
- }
13287
- get isStreamingSupported() {
13288
- return this._isStreamingSupported;
13289
13417
  }
13290
13418
  async read() {
13291
13419
  await this._readCapability.promise;
@@ -13299,12 +13427,8 @@ class PDFFetchStreamRangeReader {
13299
13427
  done
13300
13428
  };
13301
13429
  }
13302
- this._loaded += value.byteLength;
13303
- this.onProgress?.({
13304
- loaded: this._loaded
13305
- });
13306
13430
  return {
13307
- value: getArrayBuffer(value),
13431
+ value: fetch_stream_getArrayBuffer(value),
13308
13432
  done: false
13309
13433
  };
13310
13434
  }
@@ -13317,73 +13441,59 @@ class PDFFetchStreamRangeReader {
13317
13441
  ;// ./src/display/network.js
13318
13442
 
13319
13443
 
13444
+
13320
13445
  const OK_RESPONSE = 200;
13321
13446
  const PARTIAL_CONTENT_RESPONSE = 206;
13322
- function network_getArrayBuffer(xhr) {
13323
- const data = xhr.response;
13324
- if (typeof data !== "string") {
13325
- return data;
13326
- }
13327
- return stringToBytes(data).buffer;
13447
+ function network_getArrayBuffer(val) {
13448
+ return typeof val !== "string" ? val : stringToBytes(val).buffer;
13328
13449
  }
13329
- class NetworkManager {
13450
+ class PDFNetworkStream extends BasePDFStream {
13451
+ #pendingRequests = new WeakMap();
13330
13452
  _responseOrigin = null;
13331
- constructor({
13332
- url,
13333
- httpHeaders,
13334
- withCredentials
13335
- }) {
13336
- this.url = url;
13337
- this.isHttp = /^https?:/i.test(url);
13338
- this.headers = createHeaders(this.isHttp, httpHeaders);
13339
- this.withCredentials = withCredentials || false;
13340
- this.currXhrId = 0;
13341
- this.pendingRequests = Object.create(null);
13342
- }
13343
- request(args) {
13453
+ constructor(source) {
13454
+ super(source, PDFNetworkStreamReader, PDFNetworkStreamRangeReader);
13455
+ this.url = source.url;
13456
+ this.isHttp = /^https?:/i.test(this.url);
13457
+ this.headers = createHeaders(this.isHttp, source.httpHeaders);
13458
+ }
13459
+ _request(args) {
13344
13460
  const xhr = new XMLHttpRequest();
13345
- const xhrId = this.currXhrId++;
13346
- const pendingRequest = this.pendingRequests[xhrId] = {
13347
- xhr
13461
+ const pendingRequest = {
13462
+ validateStatus: null,
13463
+ onHeadersReceived: args.onHeadersReceived,
13464
+ onDone: args.onDone,
13465
+ onError: args.onError,
13466
+ onProgress: args.onProgress
13348
13467
  };
13468
+ this.#pendingRequests.set(xhr, pendingRequest);
13349
13469
  xhr.open("GET", this.url);
13350
- xhr.withCredentials = this.withCredentials;
13470
+ xhr.withCredentials = this._source.withCredentials;
13351
13471
  for (const [key, val] of this.headers) {
13352
13472
  xhr.setRequestHeader(key, val);
13353
13473
  }
13354
13474
  if (this.isHttp && "begin" in args && "end" in args) {
13355
13475
  xhr.setRequestHeader("Range", `bytes=${args.begin}-${args.end - 1}`);
13356
- pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;
13476
+ pendingRequest.validateStatus = status => status === PARTIAL_CONTENT_RESPONSE || status === OK_RESPONSE;
13357
13477
  } else {
13358
- pendingRequest.expectedStatus = OK_RESPONSE;
13478
+ pendingRequest.validateStatus = status => status === OK_RESPONSE;
13359
13479
  }
13360
13480
  xhr.responseType = "arraybuffer";
13361
13481
  assert(args.onError, "Expected `onError` callback to be provided.");
13362
- xhr.onerror = () => {
13363
- args.onError(xhr.status);
13364
- };
13365
- xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);
13366
- xhr.onprogress = this.onProgress.bind(this, xhrId);
13367
- pendingRequest.onHeadersReceived = args.onHeadersReceived;
13368
- pendingRequest.onDone = args.onDone;
13369
- pendingRequest.onError = args.onError;
13370
- pendingRequest.onProgress = args.onProgress;
13482
+ xhr.onerror = () => args.onError(xhr.status);
13483
+ xhr.onreadystatechange = this.#onStateChange.bind(this, xhr);
13484
+ xhr.onprogress = this.#onProgress.bind(this, xhr);
13371
13485
  xhr.send(null);
13372
- return xhrId;
13486
+ return xhr;
13373
13487
  }
13374
- onProgress(xhrId, evt) {
13375
- const pendingRequest = this.pendingRequests[xhrId];
13376
- if (!pendingRequest) {
13377
- return;
13378
- }
13379
- pendingRequest.onProgress?.(evt);
13488
+ #onProgress(xhr, evt) {
13489
+ const pendingRequest = this.#pendingRequests.get(xhr);
13490
+ pendingRequest?.onProgress?.(evt);
13380
13491
  }
13381
- onStateChange(xhrId, evt) {
13382
- const pendingRequest = this.pendingRequests[xhrId];
13492
+ #onStateChange(xhr, evt) {
13493
+ const pendingRequest = this.#pendingRequests.get(xhr);
13383
13494
  if (!pendingRequest) {
13384
13495
  return;
13385
13496
  }
13386
- const xhr = pendingRequest.xhr;
13387
13497
  if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {
13388
13498
  pendingRequest.onHeadersReceived();
13389
13499
  delete pendingRequest.onHeadersReceived;
@@ -13391,116 +13501,74 @@ class NetworkManager {
13391
13501
  if (xhr.readyState !== 4) {
13392
13502
  return;
13393
13503
  }
13394
- if (!(xhrId in this.pendingRequests)) {
13504
+ if (!this.#pendingRequests.has(xhr)) {
13395
13505
  return;
13396
13506
  }
13397
- delete this.pendingRequests[xhrId];
13507
+ this.#pendingRequests.delete(xhr);
13398
13508
  if (xhr.status === 0 && this.isHttp) {
13399
13509
  pendingRequest.onError(xhr.status);
13400
13510
  return;
13401
13511
  }
13402
13512
  const xhrStatus = xhr.status || OK_RESPONSE;
13403
- const ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;
13404
- if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) {
13513
+ if (!pendingRequest.validateStatus(xhrStatus)) {
13405
13514
  pendingRequest.onError(xhr.status);
13406
13515
  return;
13407
13516
  }
13408
- const chunk = network_getArrayBuffer(xhr);
13517
+ const chunk = network_getArrayBuffer(xhr.response);
13409
13518
  if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {
13410
13519
  const rangeHeader = xhr.getResponseHeader("Content-Range");
13411
- const matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader);
13412
- if (matches) {
13413
- pendingRequest.onDone({
13414
- begin: parseInt(matches[1], 10),
13415
- chunk
13416
- });
13520
+ if (/bytes (\d+)-(\d+)\/(\d+)/.test(rangeHeader)) {
13521
+ pendingRequest.onDone(chunk);
13417
13522
  } else {
13418
13523
  warn(`Missing or invalid "Content-Range" header.`);
13419
13524
  pendingRequest.onError(0);
13420
13525
  }
13421
13526
  } else if (chunk) {
13422
- pendingRequest.onDone({
13423
- begin: 0,
13424
- chunk
13425
- });
13527
+ pendingRequest.onDone(chunk);
13426
13528
  } else {
13427
13529
  pendingRequest.onError(xhr.status);
13428
13530
  }
13429
13531
  }
13430
- getRequestXhr(xhrId) {
13431
- return this.pendingRequests[xhrId].xhr;
13432
- }
13433
- isPendingRequest(xhrId) {
13434
- return xhrId in this.pendingRequests;
13435
- }
13436
- abortRequest(xhrId) {
13437
- const xhr = this.pendingRequests[xhrId].xhr;
13438
- delete this.pendingRequests[xhrId];
13439
- xhr.abort();
13440
- }
13441
- }
13442
- class PDFNetworkStream {
13443
- constructor(source) {
13444
- this._source = source;
13445
- this._manager = new NetworkManager(source);
13446
- this._rangeChunkSize = source.rangeChunkSize;
13447
- this._fullRequestReader = null;
13448
- this._rangeRequestReaders = [];
13449
- }
13450
- _onRangeRequestReaderClosed(reader) {
13451
- const i = this._rangeRequestReaders.indexOf(reader);
13452
- if (i >= 0) {
13453
- this._rangeRequestReaders.splice(i, 1);
13532
+ _abortRequest(xhr) {
13533
+ if (this.#pendingRequests.has(xhr)) {
13534
+ this.#pendingRequests.delete(xhr);
13535
+ xhr.abort();
13454
13536
  }
13455
13537
  }
13456
- getFullReader() {
13457
- assert(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once.");
13458
- this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._source);
13459
- return this._fullRequestReader;
13460
- }
13461
13538
  getRangeReader(begin, end) {
13462
- const reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end);
13463
- reader.onClosed = this._onRangeRequestReaderClosed.bind(this);
13464
- this._rangeRequestReaders.push(reader);
13465
- return reader;
13466
- }
13467
- cancelAllRequests(reason) {
13468
- this._fullRequestReader?.cancel(reason);
13469
- for (const reader of this._rangeRequestReaders.slice(0)) {
13470
- reader.cancel(reason);
13539
+ const reader = super.getRangeReader(begin, end);
13540
+ if (reader) {
13541
+ reader.onClosed = () => this._rangeReaders.delete(reader);
13471
13542
  }
13543
+ return reader;
13472
13544
  }
13473
13545
  }
13474
- class PDFNetworkStreamFullRequestReader {
13475
- constructor(manager, source) {
13476
- this._manager = manager;
13477
- this._url = source.url;
13478
- this._fullRequestId = manager.request({
13479
- onHeadersReceived: this._onHeadersReceived.bind(this),
13480
- onDone: this._onDone.bind(this),
13481
- onError: this._onError.bind(this),
13482
- onProgress: this._onProgress.bind(this)
13483
- });
13484
- this._headersCapability = Promise.withResolvers();
13485
- this._disableRange = source.disableRange || false;
13486
- this._contentLength = source.length;
13487
- this._rangeChunkSize = source.rangeChunkSize;
13488
- if (!this._rangeChunkSize && !this._disableRange) {
13489
- this._disableRange = true;
13490
- }
13491
- this._isStreamingSupported = false;
13492
- this._isRangeSupported = false;
13493
- this._cachedChunks = [];
13494
- this._requests = [];
13495
- this._done = false;
13496
- this._storedError = undefined;
13497
- this._filename = null;
13498
- this.onProgress = null;
13499
- }
13500
- _onHeadersReceived() {
13501
- const fullRequestXhrId = this._fullRequestId;
13502
- const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);
13503
- this._manager._responseOrigin = getResponseOrigin(fullRequestXhr.responseURL);
13546
+ class PDFNetworkStreamReader extends BasePDFStreamReader {
13547
+ _cachedChunks = [];
13548
+ _done = false;
13549
+ _requests = [];
13550
+ _storedError = null;
13551
+ constructor(stream) {
13552
+ super(stream);
13553
+ const {
13554
+ length
13555
+ } = stream._source;
13556
+ this._contentLength = length;
13557
+ this._fullRequestXhr = stream._request({
13558
+ onHeadersReceived: this.#onHeadersReceived.bind(this),
13559
+ onDone: this.#onDone.bind(this),
13560
+ onError: this.#onError.bind(this),
13561
+ onProgress: this.#onProgress.bind(this)
13562
+ });
13563
+ }
13564
+ #onHeadersReceived() {
13565
+ const stream = this._stream;
13566
+ const {
13567
+ disableRange,
13568
+ rangeChunkSize
13569
+ } = stream._source;
13570
+ const fullRequestXhr = this._fullRequestXhr;
13571
+ stream._responseOrigin = getResponseOrigin(fullRequestXhr.responseURL);
13504
13572
  const rawResponseHeaders = fullRequestXhr.getAllResponseHeaders();
13505
13573
  const responseHeaders = new Headers(rawResponseHeaders ? rawResponseHeaders.trimStart().replace(/[^\S ]+$/, "").split(/[\r\n]+/).map(x => {
13506
13574
  const [key, ...val] = x.split(": ");
@@ -13511,9 +13579,9 @@ class PDFNetworkStreamFullRequestReader {
13511
13579
  suggestedLength
13512
13580
  } = validateRangeRequestCapabilities({
13513
13581
  responseHeaders,
13514
- isHttp: this._manager.isHttp,
13515
- rangeChunkSize: this._rangeChunkSize,
13516
- disableRange: this._disableRange
13582
+ isHttp: stream.isHttp,
13583
+ rangeChunkSize,
13584
+ disableRange
13517
13585
  });
13518
13586
  if (allowRangeRequests) {
13519
13587
  this._isRangeSupported = true;
@@ -13521,64 +13589,47 @@ class PDFNetworkStreamFullRequestReader {
13521
13589
  this._contentLength = suggestedLength || this._contentLength;
13522
13590
  this._filename = extractFilenameFromHeader(responseHeaders);
13523
13591
  if (this._isRangeSupported) {
13524
- this._manager.abortRequest(fullRequestXhrId);
13592
+ stream._abortRequest(fullRequestXhr);
13525
13593
  }
13526
13594
  this._headersCapability.resolve();
13527
13595
  }
13528
- _onDone(data) {
13529
- if (data) {
13530
- if (this._requests.length > 0) {
13531
- const requestCapability = this._requests.shift();
13532
- requestCapability.resolve({
13533
- value: data.chunk,
13534
- done: false
13535
- });
13536
- } else {
13537
- this._cachedChunks.push(data.chunk);
13538
- }
13596
+ #onDone(chunk) {
13597
+ if (this._requests.length > 0) {
13598
+ const capability = this._requests.shift();
13599
+ capability.resolve({
13600
+ value: chunk,
13601
+ done: false
13602
+ });
13603
+ } else {
13604
+ this._cachedChunks.push(chunk);
13539
13605
  }
13540
13606
  this._done = true;
13541
13607
  if (this._cachedChunks.length > 0) {
13542
13608
  return;
13543
13609
  }
13544
- for (const requestCapability of this._requests) {
13545
- requestCapability.resolve({
13610
+ for (const capability of this._requests) {
13611
+ capability.resolve({
13546
13612
  value: undefined,
13547
13613
  done: true
13548
13614
  });
13549
13615
  }
13550
13616
  this._requests.length = 0;
13551
13617
  }
13552
- _onError(status) {
13553
- this._storedError = createResponseError(status, this._url);
13618
+ #onError(status) {
13619
+ this._storedError = createResponseError(status, this._stream.url);
13554
13620
  this._headersCapability.reject(this._storedError);
13555
- for (const requestCapability of this._requests) {
13556
- requestCapability.reject(this._storedError);
13621
+ for (const capability of this._requests) {
13622
+ capability.reject(this._storedError);
13557
13623
  }
13558
13624
  this._requests.length = 0;
13559
13625
  this._cachedChunks.length = 0;
13560
13626
  }
13561
- _onProgress(evt) {
13627
+ #onProgress(evt) {
13562
13628
  this.onProgress?.({
13563
13629
  loaded: evt.loaded,
13564
13630
  total: evt.lengthComputable ? evt.total : this._contentLength
13565
13631
  });
13566
13632
  }
13567
- get filename() {
13568
- return this._filename;
13569
- }
13570
- get isRangeSupported() {
13571
- return this._isRangeSupported;
13572
- }
13573
- get isStreamingSupported() {
13574
- return this._isStreamingSupported;
13575
- }
13576
- get contentLength() {
13577
- return this._contentLength;
13578
- }
13579
- get headersReady() {
13580
- return this._headersCapability.promise;
13581
- }
13582
13633
  async read() {
13583
13634
  await this._headersCapability.promise;
13584
13635
  if (this._storedError) {
@@ -13597,60 +13648,54 @@ class PDFNetworkStreamFullRequestReader {
13597
13648
  done: true
13598
13649
  };
13599
13650
  }
13600
- const requestCapability = Promise.withResolvers();
13601
- this._requests.push(requestCapability);
13602
- return requestCapability.promise;
13651
+ const capability = Promise.withResolvers();
13652
+ this._requests.push(capability);
13653
+ return capability.promise;
13603
13654
  }
13604
13655
  cancel(reason) {
13605
13656
  this._done = true;
13606
13657
  this._headersCapability.reject(reason);
13607
- for (const requestCapability of this._requests) {
13608
- requestCapability.resolve({
13658
+ for (const capability of this._requests) {
13659
+ capability.resolve({
13609
13660
  value: undefined,
13610
13661
  done: true
13611
13662
  });
13612
13663
  }
13613
13664
  this._requests.length = 0;
13614
- if (this._manager.isPendingRequest(this._fullRequestId)) {
13615
- this._manager.abortRequest(this._fullRequestId);
13616
- }
13617
- this._fullRequestReader = null;
13665
+ this._stream._abortRequest(this._fullRequestXhr);
13666
+ this._fullRequestXhr = null;
13618
13667
  }
13619
13668
  }
13620
- class PDFNetworkStreamRangeRequestReader {
13621
- constructor(manager, begin, end) {
13622
- this._manager = manager;
13623
- this._url = manager.url;
13624
- this._requestId = manager.request({
13669
+ class PDFNetworkStreamRangeReader extends BasePDFStreamRangeReader {
13670
+ onClosed = null;
13671
+ _done = false;
13672
+ _queuedChunk = null;
13673
+ _requests = [];
13674
+ _storedError = null;
13675
+ constructor(stream, begin, end) {
13676
+ super(stream, begin, end);
13677
+ this._requestXhr = stream._request({
13625
13678
  begin,
13626
13679
  end,
13627
- onHeadersReceived: this._onHeadersReceived.bind(this),
13628
- onDone: this._onDone.bind(this),
13629
- onError: this._onError.bind(this),
13630
- onProgress: this._onProgress.bind(this)
13680
+ onHeadersReceived: this.#onHeadersReceived.bind(this),
13681
+ onDone: this.#onDone.bind(this),
13682
+ onError: this.#onError.bind(this),
13683
+ onProgress: null
13631
13684
  });
13632
- this._requests = [];
13633
- this._queuedChunk = null;
13634
- this._done = false;
13635
- this._storedError = undefined;
13636
- this.onProgress = null;
13637
- this.onClosed = null;
13638
13685
  }
13639
- _onHeadersReceived() {
13640
- const responseOrigin = getResponseOrigin(this._manager.getRequestXhr(this._requestId)?.responseURL);
13641
- if (responseOrigin !== this._manager._responseOrigin) {
13642
- this._storedError = new Error(`Expected range response-origin "${responseOrigin}" to match "${this._manager._responseOrigin}".`);
13643
- this._onError(0);
13686
+ #onHeadersReceived() {
13687
+ const responseOrigin = getResponseOrigin(this._requestXhr?.responseURL);
13688
+ try {
13689
+ ensureResponseOrigin(responseOrigin, this._stream._responseOrigin);
13690
+ } catch (ex) {
13691
+ this._storedError = ex;
13692
+ this.#onError(0);
13644
13693
  }
13645
13694
  }
13646
- _close() {
13647
- this.onClosed?.(this);
13648
- }
13649
- _onDone(data) {
13650
- const chunk = data.chunk;
13695
+ #onDone(chunk) {
13651
13696
  if (this._requests.length > 0) {
13652
- const requestCapability = this._requests.shift();
13653
- requestCapability.resolve({
13697
+ const capability = this._requests.shift();
13698
+ capability.resolve({
13654
13699
  value: chunk,
13655
13700
  done: false
13656
13701
  });
@@ -13658,33 +13703,23 @@ class PDFNetworkStreamRangeRequestReader {
13658
13703
  this._queuedChunk = chunk;
13659
13704
  }
13660
13705
  this._done = true;
13661
- for (const requestCapability of this._requests) {
13662
- requestCapability.resolve({
13706
+ for (const capability of this._requests) {
13707
+ capability.resolve({
13663
13708
  value: undefined,
13664
13709
  done: true
13665
13710
  });
13666
13711
  }
13667
13712
  this._requests.length = 0;
13668
- this._close();
13713
+ this.onClosed?.();
13669
13714
  }
13670
- _onError(status) {
13671
- this._storedError ??= createResponseError(status, this._url);
13672
- for (const requestCapability of this._requests) {
13673
- requestCapability.reject(this._storedError);
13715
+ #onError(status) {
13716
+ this._storedError ??= createResponseError(status, this._stream.url);
13717
+ for (const capability of this._requests) {
13718
+ capability.reject(this._storedError);
13674
13719
  }
13675
13720
  this._requests.length = 0;
13676
13721
  this._queuedChunk = null;
13677
13722
  }
13678
- _onProgress(evt) {
13679
- if (!this.isStreamingSupported) {
13680
- this.onProgress?.({
13681
- loaded: evt.loaded
13682
- });
13683
- }
13684
- }
13685
- get isStreamingSupported() {
13686
- return false;
13687
- }
13688
13723
  async read() {
13689
13724
  if (this._storedError) {
13690
13725
  throw this._storedError;
@@ -13703,29 +13738,28 @@ class PDFNetworkStreamRangeRequestReader {
13703
13738
  done: true
13704
13739
  };
13705
13740
  }
13706
- const requestCapability = Promise.withResolvers();
13707
- this._requests.push(requestCapability);
13708
- return requestCapability.promise;
13741
+ const capability = Promise.withResolvers();
13742
+ this._requests.push(capability);
13743
+ return capability.promise;
13709
13744
  }
13710
13745
  cancel(reason) {
13711
13746
  this._done = true;
13712
- for (const requestCapability of this._requests) {
13713
- requestCapability.resolve({
13747
+ for (const capability of this._requests) {
13748
+ capability.resolve({
13714
13749
  value: undefined,
13715
13750
  done: true
13716
13751
  });
13717
13752
  }
13718
13753
  this._requests.length = 0;
13719
- if (this._manager.isPendingRequest(this._requestId)) {
13720
- this._manager.abortRequest(this._requestId);
13721
- }
13722
- this._close();
13754
+ this._stream._abortRequest(this._requestXhr);
13755
+ this.onClosed?.();
13723
13756
  }
13724
13757
  }
13725
13758
 
13726
13759
  ;// ./src/display/node_stream.js
13727
13760
 
13728
13761
 
13762
+
13729
13763
  const urlRegex = /^[a-z][a-z0-9\-+.]+:/i;
13730
13764
  function parseUrlOrPath(sourceUrl) {
13731
13765
  if (urlRegex.test(sourceUrl)) {
@@ -13734,217 +13768,135 @@ function parseUrlOrPath(sourceUrl) {
13734
13768
  const url = process.getBuiltinModule("url");
13735
13769
  return new URL(url.pathToFileURL(sourceUrl));
13736
13770
  }
13737
- class PDFNodeStream {
13771
+ function getReadableStream(readStream) {
13772
+ const {
13773
+ Readable
13774
+ } = process.getBuiltinModule("stream");
13775
+ if (typeof Readable.toWeb === "function") {
13776
+ return Readable.toWeb(readStream);
13777
+ }
13778
+ const require = process.getBuiltinModule("module").createRequire(import.meta.url);
13779
+ const polyfill = require("node-readable-to-web-readable-stream");
13780
+ return polyfill.makeDefaultReadableStreamFromNodeReadable(readStream);
13781
+ }
13782
+ function node_stream_getArrayBuffer(val) {
13783
+ if (val instanceof Uint8Array) {
13784
+ return val.buffer;
13785
+ }
13786
+ if (val instanceof ArrayBuffer) {
13787
+ return val;
13788
+ }
13789
+ warn(`getArrayBuffer - unexpected data format: ${val}`);
13790
+ return new Uint8Array(val).buffer;
13791
+ }
13792
+ class PDFNodeStream extends BasePDFStream {
13738
13793
  constructor(source) {
13739
- this.source = source;
13794
+ super(source, PDFNodeStreamReader, PDFNodeStreamRangeReader);
13740
13795
  this.url = parseUrlOrPath(source.url);
13741
13796
  assert(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs.");
13742
- this._fullRequestReader = null;
13743
- this._rangeRequestReaders = [];
13744
- }
13745
- get _progressiveDataLength() {
13746
- return this._fullRequestReader?._loaded ?? 0;
13747
- }
13748
- getFullReader() {
13749
- assert(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once.");
13750
- this._fullRequestReader = new PDFNodeStreamFsFullReader(this);
13751
- return this._fullRequestReader;
13752
- }
13753
- getRangeReader(start, end) {
13754
- if (end <= this._progressiveDataLength) {
13755
- return null;
13756
- }
13757
- const rangeReader = new PDFNodeStreamFsRangeReader(this, start, end);
13758
- this._rangeRequestReaders.push(rangeReader);
13759
- return rangeReader;
13760
- }
13761
- cancelAllRequests(reason) {
13762
- this._fullRequestReader?.cancel(reason);
13763
- for (const reader of this._rangeRequestReaders.slice(0)) {
13764
- reader.cancel(reason);
13765
- }
13766
13797
  }
13767
13798
  }
13768
- class PDFNodeStreamFsFullReader {
13799
+ class PDFNodeStreamReader extends BasePDFStreamReader {
13800
+ _reader = null;
13769
13801
  constructor(stream) {
13770
- this._url = stream.url;
13771
- this._done = false;
13772
- this._storedError = null;
13773
- this.onProgress = null;
13774
- const source = stream.source;
13775
- this._contentLength = source.length;
13776
- this._loaded = 0;
13777
- this._filename = null;
13778
- this._disableRange = source.disableRange || false;
13779
- this._rangeChunkSize = source.rangeChunkSize;
13780
- if (!this._rangeChunkSize && !this._disableRange) {
13781
- this._disableRange = true;
13782
- }
13783
- this._isStreamingSupported = !source.disableStream;
13784
- this._isRangeSupported = !source.disableRange;
13785
- this._readableStream = null;
13786
- this._readCapability = Promise.withResolvers();
13787
- this._headersCapability = Promise.withResolvers();
13802
+ super(stream);
13803
+ const {
13804
+ disableRange,
13805
+ disableStream,
13806
+ length,
13807
+ rangeChunkSize
13808
+ } = stream._source;
13809
+ this._contentLength = length;
13810
+ this._isStreamingSupported = !disableStream;
13811
+ this._isRangeSupported = !disableRange;
13812
+ const url = stream.url;
13788
13813
  const fs = process.getBuiltinModule("fs");
13789
- fs.promises.lstat(this._url).then(stat => {
13790
- this._contentLength = stat.size;
13791
- this._setReadableStream(fs.createReadStream(this._url));
13814
+ fs.promises.lstat(url).then(stat => {
13815
+ const readStream = fs.createReadStream(url);
13816
+ const readableStream = getReadableStream(readStream);
13817
+ this._reader = readableStream.getReader();
13818
+ const {
13819
+ size
13820
+ } = stat;
13821
+ if (size <= 2 * rangeChunkSize) {
13822
+ this._isRangeSupported = false;
13823
+ }
13824
+ this._contentLength = size;
13825
+ if (!this._isStreamingSupported && this._isRangeSupported) {
13826
+ this.cancel(new AbortException("Streaming is disabled."));
13827
+ }
13792
13828
  this._headersCapability.resolve();
13793
- }, error => {
13829
+ }).catch(error => {
13794
13830
  if (error.code === "ENOENT") {
13795
- error = createResponseError(0, this._url.href);
13831
+ error = createResponseError(0, url.href);
13796
13832
  }
13797
- this._storedError = error;
13798
13833
  this._headersCapability.reject(error);
13799
13834
  });
13800
13835
  }
13801
- get headersReady() {
13802
- return this._headersCapability.promise;
13803
- }
13804
- get filename() {
13805
- return this._filename;
13806
- }
13807
- get contentLength() {
13808
- return this._contentLength;
13809
- }
13810
- get isRangeSupported() {
13811
- return this._isRangeSupported;
13812
- }
13813
- get isStreamingSupported() {
13814
- return this._isStreamingSupported;
13815
- }
13816
13836
  async read() {
13817
- await this._readCapability.promise;
13818
- if (this._done) {
13837
+ await this._headersCapability.promise;
13838
+ const {
13839
+ value,
13840
+ done
13841
+ } = await this._reader.read();
13842
+ if (done) {
13819
13843
  return {
13820
- value: undefined,
13821
- done: true
13844
+ value,
13845
+ done
13822
13846
  };
13823
13847
  }
13824
- if (this._storedError) {
13825
- throw this._storedError;
13826
- }
13827
- const chunk = this._readableStream.read();
13828
- if (chunk === null) {
13829
- this._readCapability = Promise.withResolvers();
13830
- return this.read();
13831
- }
13832
- this._loaded += chunk.length;
13848
+ this._loaded += value.length;
13833
13849
  this.onProgress?.({
13834
13850
  loaded: this._loaded,
13835
13851
  total: this._contentLength
13836
13852
  });
13837
- const buffer = new Uint8Array(chunk).buffer;
13838
13853
  return {
13839
- value: buffer,
13854
+ value: node_stream_getArrayBuffer(value),
13840
13855
  done: false
13841
13856
  };
13842
13857
  }
13843
13858
  cancel(reason) {
13844
- if (!this._readableStream) {
13845
- this._error(reason);
13846
- return;
13847
- }
13848
- this._readableStream.destroy(reason);
13849
- }
13850
- _error(reason) {
13851
- this._storedError = reason;
13852
- this._readCapability.resolve();
13853
- }
13854
- _setReadableStream(readableStream) {
13855
- this._readableStream = readableStream;
13856
- readableStream.on("readable", () => {
13857
- this._readCapability.resolve();
13858
- });
13859
- readableStream.on("end", () => {
13860
- readableStream.destroy();
13861
- this._done = true;
13862
- this._readCapability.resolve();
13863
- });
13864
- readableStream.on("error", reason => {
13865
- this._error(reason);
13866
- });
13867
- if (!this._isStreamingSupported && this._isRangeSupported) {
13868
- this._error(new AbortException("streaming is disabled"));
13869
- }
13870
- if (this._storedError) {
13871
- this._readableStream.destroy(this._storedError);
13872
- }
13859
+ this._reader?.cancel(reason);
13873
13860
  }
13874
13861
  }
13875
- class PDFNodeStreamFsRangeReader {
13876
- constructor(stream, start, end) {
13877
- this._url = stream.url;
13878
- this._done = false;
13879
- this._storedError = null;
13880
- this.onProgress = null;
13881
- this._loaded = 0;
13882
- this._readableStream = null;
13883
- this._readCapability = Promise.withResolvers();
13884
- const source = stream.source;
13885
- this._isStreamingSupported = !source.disableStream;
13862
+ class PDFNodeStreamRangeReader extends BasePDFStreamRangeReader {
13863
+ _readCapability = Promise.withResolvers();
13864
+ _reader = null;
13865
+ constructor(stream, begin, end) {
13866
+ super(stream, begin, end);
13867
+ const url = stream.url;
13886
13868
  const fs = process.getBuiltinModule("fs");
13887
- this._setReadableStream(fs.createReadStream(this._url, {
13888
- start,
13889
- end: end - 1
13890
- }));
13891
- }
13892
- get isStreamingSupported() {
13893
- return this._isStreamingSupported;
13869
+ try {
13870
+ const readStream = fs.createReadStream(url, {
13871
+ start: begin,
13872
+ end: end - 1
13873
+ });
13874
+ const readableStream = getReadableStream(readStream);
13875
+ this._reader = readableStream.getReader();
13876
+ this._readCapability.resolve();
13877
+ } catch (error) {
13878
+ this._readCapability.reject(error);
13879
+ }
13894
13880
  }
13895
13881
  async read() {
13896
13882
  await this._readCapability.promise;
13897
- if (this._done) {
13883
+ const {
13884
+ value,
13885
+ done
13886
+ } = await this._reader.read();
13887
+ if (done) {
13898
13888
  return {
13899
- value: undefined,
13900
- done: true
13889
+ value,
13890
+ done
13901
13891
  };
13902
13892
  }
13903
- if (this._storedError) {
13904
- throw this._storedError;
13905
- }
13906
- const chunk = this._readableStream.read();
13907
- if (chunk === null) {
13908
- this._readCapability = Promise.withResolvers();
13909
- return this.read();
13910
- }
13911
- this._loaded += chunk.length;
13912
- this.onProgress?.({
13913
- loaded: this._loaded
13914
- });
13915
- const buffer = new Uint8Array(chunk).buffer;
13916
13893
  return {
13917
- value: buffer,
13894
+ value: node_stream_getArrayBuffer(value),
13918
13895
  done: false
13919
13896
  };
13920
13897
  }
13921
13898
  cancel(reason) {
13922
- if (!this._readableStream) {
13923
- this._error(reason);
13924
- return;
13925
- }
13926
- this._readableStream.destroy(reason);
13927
- }
13928
- _error(reason) {
13929
- this._storedError = reason;
13930
- this._readCapability.resolve();
13931
- }
13932
- _setReadableStream(readableStream) {
13933
- this._readableStream = readableStream;
13934
- readableStream.on("readable", () => {
13935
- this._readCapability.resolve();
13936
- });
13937
- readableStream.on("end", () => {
13938
- readableStream.destroy();
13939
- this._done = true;
13940
- this._readCapability.resolve();
13941
- });
13942
- readableStream.on("error", reason => {
13943
- this._error(reason);
13944
- });
13945
- if (this._storedError) {
13946
- this._readableStream.destroy(this._storedError);
13947
- }
13899
+ this._reader?.cancel(reason);
13948
13900
  }
13949
13901
  }
13950
13902
 
@@ -14170,6 +14122,9 @@ class TextLayer {
14170
14122
  if (item.id) {
14171
14123
  this.#container.setAttribute("id", `${item.id}`);
14172
14124
  }
14125
+ if (item.tag === "Artifact") {
14126
+ this.#container.ariaHidden = true;
14127
+ }
14173
14128
  parent.append(this.#container);
14174
14129
  } else if (item.type === "endMarkedContent") {
14175
14130
  this.#container = this.#container.parentNode;
@@ -14473,7 +14428,7 @@ function getDocument(src = {}) {
14473
14428
  }
14474
14429
  const docParams = {
14475
14430
  docId,
14476
- apiVersion: "5.4.530",
14431
+ apiVersion: "5.4.624",
14477
14432
  data,
14478
14433
  password,
14479
14434
  disableAutoFetch,
@@ -14503,6 +14458,7 @@ function getDocument(src = {}) {
14503
14458
  ownerDocument,
14504
14459
  pdfBug,
14505
14460
  styleElement,
14461
+ enableHWA,
14506
14462
  loadingParams: {
14507
14463
  disableAutoFetch,
14508
14464
  enableXfa
@@ -14518,7 +14474,8 @@ function getDocument(src = {}) {
14518
14474
  const workerIdPromise = worker.messageHandler.sendWithPromise("GetDocRequest", docParams, data ? [data.buffer] : null);
14519
14475
  let networkStream;
14520
14476
  if (rangeTransport) {
14521
- networkStream = new PDFDataTransportStream(rangeTransport, {
14477
+ networkStream = new PDFDataTransportStream({
14478
+ pdfDataRangeTransport: rangeTransport,
14522
14479
  disableRange,
14523
14480
  disableStream
14524
14481
  });
@@ -14545,7 +14502,7 @@ function getDocument(src = {}) {
14545
14502
  throw new Error("Worker was destroyed");
14546
14503
  }
14547
14504
  const messageHandler = new MessageHandler(docId, workerId, worker.port);
14548
- const transport = new WorkerTransport(messageHandler, task, networkStream, transportParams, transportFactory, enableHWA);
14505
+ const transport = new WorkerTransport(messageHandler, task, networkStream, transportParams, transportFactory);
14549
14506
  task._transport = transport;
14550
14507
  messageHandler.send("Ready", null);
14551
14508
  });
@@ -14764,6 +14721,7 @@ class PDFDocumentProxy {
14764
14721
  }
14765
14722
  class PDFPageProxy {
14766
14723
  #pendingCleanup = false;
14724
+ #pagesMapper = PagesMapper.instance;
14767
14725
  constructor(pageIndex, pageInfo, transport, pdfBug = false) {
14768
14726
  this._pageIndex = pageIndex;
14769
14727
  this._pageInfo = pageInfo;
@@ -14779,6 +14737,9 @@ class PDFPageProxy {
14779
14737
  get pageNumber() {
14780
14738
  return this._pageIndex + 1;
14781
14739
  }
14740
+ set pageNumber(value) {
14741
+ this._pageIndex = value - 1;
14742
+ }
14782
14743
  get rotate() {
14783
14744
  return this._pageInfo.rotate;
14784
14745
  }
@@ -14992,6 +14953,7 @@ class PDFPageProxy {
14992
14953
  } = {}) {
14993
14954
  const TEXT_CONTENT_CHUNK_SIZE = 100;
14994
14955
  return this._transport.messageHandler.sendWithStream("GetTextContent", {
14956
+ pageId: this.#pagesMapper.getPageId(this._pageIndex + 1) - 1,
14995
14957
  pageIndex: this._pageIndex,
14996
14958
  includeMarkedContent: includeMarkedContent === true,
14997
14959
  disableNormalization: disableNormalization === true
@@ -15114,6 +15076,7 @@ class PDFPageProxy {
15114
15076
  transfer
15115
15077
  } = annotationStorageSerializable;
15116
15078
  const readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", {
15079
+ pageId: this.#pagesMapper.getPageId(this._pageIndex + 1) - 1,
15117
15080
  pageIndex: this._pageIndex,
15118
15081
  intent: renderingIntent,
15119
15082
  cacheKey,
@@ -15419,19 +15382,25 @@ class PDFWorker {
15419
15382
  }
15420
15383
  }
15421
15384
  class WorkerTransport {
15385
+ downloadInfoCapability = Promise.withResolvers();
15386
+ #fullReader = null;
15422
15387
  #methodPromises = new Map();
15388
+ #networkStream = null;
15423
15389
  #pageCache = new Map();
15424
15390
  #pagePromises = new Map();
15425
15391
  #pageRefCache = new Map();
15426
15392
  #passwordCapability = null;
15427
- constructor(messageHandler, loadingTask, networkStream, params, factory, enableHWA) {
15393
+ #pagesMapper = PagesMapper.instance;
15394
+ constructor(messageHandler, loadingTask, networkStream, params, factory) {
15428
15395
  this.messageHandler = messageHandler;
15429
15396
  this.loadingTask = loadingTask;
15397
+ this.#networkStream = networkStream;
15430
15398
  this.commonObjs = new PDFObjects();
15431
15399
  this.fontLoader = new FontLoader({
15432
15400
  ownerDocument: params.ownerDocument,
15433
15401
  styleElement: params.styleElement
15434
15402
  });
15403
+ this.enableHWA = params.enableHWA;
15435
15404
  this.loadingParams = params.loadingParams;
15436
15405
  this._params = params;
15437
15406
  this.canvasFactory = factory.canvasFactory;
@@ -15441,12 +15410,25 @@ class WorkerTransport {
15441
15410
  this.wasmFactory = factory.wasmFactory;
15442
15411
  this.destroyed = false;
15443
15412
  this.destroyCapability = null;
15444
- this._networkStream = networkStream;
15445
- this._fullReader = null;
15446
- this._lastProgress = null;
15447
- this.downloadInfoCapability = Promise.withResolvers();
15448
- this.enableHWA = enableHWA;
15449
15413
  this.setupMessageHandler();
15414
+ this.#pagesMapper.addListener(this.#updateCaches.bind(this));
15415
+ }
15416
+ #updateCaches() {
15417
+ const newPageCache = new Map();
15418
+ const newPromiseCache = new Map();
15419
+ for (let i = 0, ii = this.#pagesMapper.pagesNumber; i < ii; i++) {
15420
+ const prevPageIndex = this.#pagesMapper.getPrevPageNumber(i + 1) - 1;
15421
+ const page = this.#pageCache.get(prevPageIndex);
15422
+ if (page) {
15423
+ newPageCache.set(i, page);
15424
+ }
15425
+ const promise = this.#pagePromises.get(prevPageIndex);
15426
+ if (promise) {
15427
+ newPromiseCache.set(i, promise);
15428
+ }
15429
+ }
15430
+ this.#pageCache = newPageCache;
15431
+ this.#pagePromises = newPromiseCache;
15450
15432
  }
15451
15433
  #cacheSimpleMethod(name, data = null) {
15452
15434
  const cachedPromise = this.#methodPromises.get(name);
@@ -15457,6 +15439,16 @@ class WorkerTransport {
15457
15439
  this.#methodPromises.set(name, promise);
15458
15440
  return promise;
15459
15441
  }
15442
+ #onProgress({
15443
+ loaded,
15444
+ total
15445
+ }) {
15446
+ this.loadingTask.onProgress?.({
15447
+ loaded,
15448
+ total,
15449
+ percent: MathClamp(Math.round(loaded / total * 100), 0, 100)
15450
+ });
15451
+ }
15460
15452
  get annotationStorage() {
15461
15453
  return shadow(this, "annotationStorage", new AnnotationStorage());
15462
15454
  }
@@ -15535,7 +15527,7 @@ class WorkerTransport {
15535
15527
  this.#methodPromises.clear();
15536
15528
  this.filterFactory.destroy();
15537
15529
  TextLayer.cleanup();
15538
- this._networkStream?.cancelAllRequests(new AbortException("Worker was terminated."));
15530
+ this.#networkStream?.cancelAllRequests(new AbortException("Worker was terminated."));
15539
15531
  this.messageHandler?.destroy();
15540
15532
  this.messageHandler = null;
15541
15533
  this.destroyCapability.resolve();
@@ -15548,16 +15540,11 @@ class WorkerTransport {
15548
15540
  loadingTask
15549
15541
  } = this;
15550
15542
  messageHandler.on("GetReader", (data, sink) => {
15551
- assert(this._networkStream, "GetReader - no `IPDFStream` instance available.");
15552
- this._fullReader = this._networkStream.getFullReader();
15553
- this._fullReader.onProgress = evt => {
15554
- this._lastProgress = {
15555
- loaded: evt.loaded,
15556
- total: evt.total
15557
- };
15558
- };
15543
+ assert(this.#networkStream, "GetReader - no `BasePDFStream` instance available.");
15544
+ this.#fullReader = this.#networkStream.getFullReader();
15545
+ this.#fullReader.onProgress = evt => this.#onProgress(evt);
15559
15546
  sink.onPull = () => {
15560
- this._fullReader.read().then(function ({
15547
+ this.#fullReader.read().then(function ({
15561
15548
  value,
15562
15549
  done
15563
15550
  }) {
@@ -15572,7 +15559,7 @@ class WorkerTransport {
15572
15559
  });
15573
15560
  };
15574
15561
  sink.onCancel = reason => {
15575
- this._fullReader.cancel(reason);
15562
+ this.#fullReader.cancel(reason);
15576
15563
  sink.ready.catch(readyReason => {
15577
15564
  if (this.destroyed) {
15578
15565
  return;
@@ -15582,22 +15569,14 @@ class WorkerTransport {
15582
15569
  };
15583
15570
  });
15584
15571
  messageHandler.on("ReaderHeadersReady", async data => {
15585
- await this._fullReader.headersReady;
15572
+ await this.#fullReader.headersReady;
15586
15573
  const {
15587
15574
  isStreamingSupported,
15588
15575
  isRangeSupported,
15589
15576
  contentLength
15590
- } = this._fullReader;
15591
- if (!isStreamingSupported || !isRangeSupported) {
15592
- if (this._lastProgress) {
15593
- loadingTask.onProgress?.(this._lastProgress);
15594
- }
15595
- this._fullReader.onProgress = evt => {
15596
- loadingTask.onProgress?.({
15597
- loaded: evt.loaded,
15598
- total: evt.total
15599
- });
15600
- };
15577
+ } = this.#fullReader;
15578
+ if (isStreamingSupported && isRangeSupported) {
15579
+ this.#fullReader.onProgress = null;
15601
15580
  }
15602
15581
  return {
15603
15582
  isStreamingSupported,
@@ -15606,8 +15585,8 @@ class WorkerTransport {
15606
15585
  };
15607
15586
  });
15608
15587
  messageHandler.on("GetRangeReader", (data, sink) => {
15609
- assert(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
15610
- const rangeReader = this._networkStream.getRangeReader(data.begin, data.end);
15588
+ assert(this.#networkStream, "GetRangeReader - no `BasePDFStream` instance available.");
15589
+ const rangeReader = this.#networkStream.getRangeReader(data.begin, data.end);
15611
15590
  if (!rangeReader) {
15612
15591
  sink.close();
15613
15592
  return;
@@ -15640,6 +15619,7 @@ class WorkerTransport {
15640
15619
  messageHandler.on("GetDoc", ({
15641
15620
  pdfInfo
15642
15621
  }) => {
15622
+ this.#pagesMapper.pagesNumber = pdfInfo.numPages;
15643
15623
  this._numPages = pdfInfo.numPages;
15644
15624
  this._htmlForXfa = pdfInfo.htmlForXfa;
15645
15625
  delete pdfInfo.htmlForXfa;
@@ -15670,7 +15650,7 @@ class WorkerTransport {
15670
15650
  return this.#passwordCapability.promise;
15671
15651
  });
15672
15652
  messageHandler.on("DataLoaded", data => {
15673
- loadingTask.onProgress?.({
15653
+ this.#onProgress({
15674
15654
  loaded: data.length,
15675
15655
  total: data.length
15676
15656
  });
@@ -15768,10 +15748,7 @@ class WorkerTransport {
15768
15748
  if (this.destroyed) {
15769
15749
  return;
15770
15750
  }
15771
- loadingTask.onProgress?.({
15772
- loaded: data.loaded,
15773
- total: data.total
15774
- });
15751
+ this.#onProgress(data);
15775
15752
  });
15776
15753
  messageHandler.on("FetchBinaryData", async data => {
15777
15754
  if (this.destroyed) {
@@ -15799,7 +15776,7 @@ class WorkerTransport {
15799
15776
  isPureXfa: !!this._htmlForXfa,
15800
15777
  numPages: this._numPages,
15801
15778
  annotationStorage: map,
15802
- filename: this._fullReader?.filename ?? null
15779
+ filename: this.#fullReader?.filename ?? null
15803
15780
  }, transfer).finally(() => {
15804
15781
  this.annotationStorage.resetModified();
15805
15782
  });
@@ -15810,22 +15787,23 @@ class WorkerTransport {
15810
15787
  });
15811
15788
  }
15812
15789
  getPage(pageNumber) {
15813
- if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this._numPages) {
15790
+ if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this.#pagesMapper.pagesNumber) {
15814
15791
  return Promise.reject(new Error("Invalid page request."));
15815
15792
  }
15816
- const pageIndex = pageNumber - 1,
15817
- cachedPromise = this.#pagePromises.get(pageIndex);
15793
+ const pageIndex = pageNumber - 1;
15794
+ const newPageIndex = this.#pagesMapper.getPageId(pageNumber) - 1;
15795
+ const cachedPromise = this.#pagePromises.get(pageIndex);
15818
15796
  if (cachedPromise) {
15819
15797
  return cachedPromise;
15820
15798
  }
15821
15799
  const promise = this.messageHandler.sendWithPromise("GetPage", {
15822
- pageIndex
15800
+ pageIndex: newPageIndex
15823
15801
  }).then(pageInfo => {
15824
15802
  if (this.destroyed) {
15825
15803
  throw new Error("Transport destroyed");
15826
15804
  }
15827
15805
  if (pageInfo.refStr) {
15828
- this.#pageRefCache.set(pageInfo.refStr, pageNumber);
15806
+ this.#pageRefCache.set(pageInfo.refStr, newPageIndex);
15829
15807
  }
15830
15808
  const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.pdfBug);
15831
15809
  this.#pageCache.set(pageIndex, page);
@@ -15834,18 +15812,19 @@ class WorkerTransport {
15834
15812
  this.#pagePromises.set(pageIndex, promise);
15835
15813
  return promise;
15836
15814
  }
15837
- getPageIndex(ref) {
15815
+ async getPageIndex(ref) {
15838
15816
  if (!isRefProxy(ref)) {
15839
- return Promise.reject(new Error("Invalid pageIndex request."));
15817
+ throw new Error("Invalid pageIndex request.");
15840
15818
  }
15841
- return this.messageHandler.sendWithPromise("GetPageIndex", {
15819
+ const index = await this.messageHandler.sendWithPromise("GetPageIndex", {
15842
15820
  num: ref.num,
15843
15821
  gen: ref.gen
15844
15822
  });
15823
+ return this.#pagesMapper.getPageNumber(index + 1) - 1;
15845
15824
  }
15846
15825
  getAnnotations(pageIndex, intent) {
15847
15826
  return this.messageHandler.sendWithPromise("GetAnnotations", {
15848
- pageIndex,
15827
+ pageIndex: this.#pagesMapper.getPageId(pageIndex + 1) - 1,
15849
15828
  intent
15850
15829
  });
15851
15830
  }
@@ -15898,12 +15877,12 @@ class WorkerTransport {
15898
15877
  }
15899
15878
  getPageJSActions(pageIndex) {
15900
15879
  return this.messageHandler.sendWithPromise("GetPageJSActions", {
15901
- pageIndex
15880
+ pageIndex: this.#pagesMapper.getPageId(pageIndex + 1) - 1
15902
15881
  });
15903
15882
  }
15904
15883
  getStructTree(pageIndex) {
15905
15884
  return this.messageHandler.sendWithPromise("GetStructTree", {
15906
- pageIndex
15885
+ pageIndex: this.#pagesMapper.getPageId(pageIndex + 1) - 1
15907
15886
  });
15908
15887
  }
15909
15888
  getOutline() {
@@ -15924,8 +15903,8 @@ class WorkerTransport {
15924
15903
  const promise = this.messageHandler.sendWithPromise(name, null).then(results => ({
15925
15904
  info: results[0],
15926
15905
  metadata: results[1] ? new Metadata(results[1]) : null,
15927
- contentDispositionFilename: this._fullReader?.filename ?? null,
15928
- contentLength: this._fullReader?.contentLength ?? null,
15906
+ contentDispositionFilename: this.#fullReader?.filename ?? null,
15907
+ contentLength: this.#fullReader?.contentLength ?? null,
15929
15908
  hasStructTree: results[2]
15930
15909
  }));
15931
15910
  this.#methodPromises.set(name, promise);
@@ -15958,32 +15937,33 @@ class WorkerTransport {
15958
15937
  return null;
15959
15938
  }
15960
15939
  const refStr = ref.gen === 0 ? `${ref.num}R` : `${ref.num}R${ref.gen}`;
15961
- return this.#pageRefCache.get(refStr) ?? null;
15940
+ const pageIndex = this.#pageRefCache.get(refStr);
15941
+ return pageIndex >= 0 ? this.#pagesMapper.getPageNumber(pageIndex + 1) : null;
15962
15942
  }
15963
15943
  }
15964
15944
  class RenderTask {
15965
- #internalRenderTask = null;
15945
+ _internalRenderTask = null;
15966
15946
  onContinue = null;
15967
15947
  onError = null;
15968
15948
  constructor(internalRenderTask) {
15969
- this.#internalRenderTask = internalRenderTask;
15949
+ this._internalRenderTask = internalRenderTask;
15970
15950
  }
15971
15951
  get promise() {
15972
- return this.#internalRenderTask.capability.promise;
15952
+ return this._internalRenderTask.capability.promise;
15973
15953
  }
15974
15954
  cancel(extraDelay = 0) {
15975
- this.#internalRenderTask.cancel(null, extraDelay);
15955
+ this._internalRenderTask.cancel(null, extraDelay);
15976
15956
  }
15977
15957
  get separateAnnots() {
15978
15958
  const {
15979
15959
  separateAnnots
15980
- } = this.#internalRenderTask.operatorList;
15960
+ } = this._internalRenderTask.operatorList;
15981
15961
  if (!separateAnnots) {
15982
15962
  return false;
15983
15963
  }
15984
15964
  const {
15985
15965
  annotationCanvasMap
15986
- } = this.#internalRenderTask;
15966
+ } = this._internalRenderTask;
15987
15967
  return separateAnnots.form || separateAnnots.canvas && annotationCanvasMap?.size > 0;
15988
15968
  }
15989
15969
  }
@@ -16140,8 +16120,8 @@ class InternalRenderTask {
16140
16120
  }
16141
16121
  }
16142
16122
  }
16143
- const version = "5.4.530";
16144
- const build = "50cc4adac";
16123
+ const version = "5.4.624";
16124
+ const build = "384c6208b";
16145
16125
 
16146
16126
  ;// ./src/display/editor/color_picker.js
16147
16127
 
@@ -16728,7 +16708,7 @@ class AnnotationElement {
16728
16708
  this.annotationStorage.setValue(`${AnnotationEditorPrefix}${data.id}`, {
16729
16709
  id: data.id,
16730
16710
  annotationType: data.annotationType,
16731
- pageIndex: this.parent.page._pageIndex,
16711
+ page: this.parent.page,
16732
16712
  popup,
16733
16713
  popupRef: data.popupRef,
16734
16714
  modificationDate: new Date()
@@ -24210,11 +24190,11 @@ class SignatureExtractor {
24210
24190
  writer.close();
24211
24191
  const buf = await new Response(cs.readable).arrayBuffer();
24212
24192
  const bytes = new Uint8Array(buf);
24213
- return toBase64Util(bytes);
24193
+ return bytes.toBase64();
24214
24194
  }
24215
24195
  static async decompressSignature(signatureData) {
24216
24196
  try {
24217
- const bytes = fromBase64Util(signatureData);
24197
+ const bytes = Uint8Array.fromBase64(signatureData);
24218
24198
  const {
24219
24199
  readable,
24220
24200
  writable
@@ -25403,6 +25383,9 @@ class AnnotationEditorLayer {
25403
25383
  this._structTree = structTreeLayer;
25404
25384
  this.#uiManager.addLayer(this);
25405
25385
  }
25386
+ updatePageIndex(newPageIndex) {
25387
+ this.pageIndex = newPageIndex;
25388
+ }
25406
25389
  get isEmpty() {
25407
25390
  return this.#editors.size === 0;
25408
25391
  }
@@ -26110,11 +26093,6 @@ class DrawLayer {
26110
26093
  #mapping = new Map();
26111
26094
  #toUpdate = new Map();
26112
26095
  static #id = 0;
26113
- constructor({
26114
- pageIndex
26115
- }) {
26116
- this.pageIndex = pageIndex;
26117
- }
26118
26096
  setParent(parent) {
26119
26097
  if (!this.#parent) {
26120
26098
  this.#parent = parent;
@@ -26176,7 +26154,7 @@ class DrawLayer {
26176
26154
  root.append(defs);
26177
26155
  const path = DrawLayer._svgFactory.createElement("path");
26178
26156
  defs.append(path);
26179
- const pathId = `path_p${this.pageIndex}_${id}`;
26157
+ const pathId = `path_${id}`;
26180
26158
  path.setAttribute("id", pathId);
26181
26159
  path.setAttribute("vector-effect", "non-scaling-stroke");
26182
26160
  if (isPathUpdatable) {
@@ -26200,14 +26178,14 @@ class DrawLayer {
26200
26178
  root.append(defs);
26201
26179
  const path = DrawLayer._svgFactory.createElement("path");
26202
26180
  defs.append(path);
26203
- const pathId = `path_p${this.pageIndex}_${id}`;
26181
+ const pathId = `path_${id}`;
26204
26182
  path.setAttribute("id", pathId);
26205
26183
  path.setAttribute("vector-effect", "non-scaling-stroke");
26206
26184
  let maskId;
26207
26185
  if (mustRemoveSelfIntersections) {
26208
26186
  const mask = DrawLayer._svgFactory.createElement("mask");
26209
26187
  defs.append(mask);
26210
- maskId = `mask_p${this.pageIndex}_${id}`;
26188
+ maskId = `mask_${id}`;
26211
26189
  mask.setAttribute("id", maskId);
26212
26190
  mask.setAttribute("maskUnits", "objectBoundingBox");
26213
26191
  const rect = DrawLayer._svgFactory.createElement("rect");
@@ -26363,6 +26341,7 @@ globalThis.pdfjsLib = {
26363
26341
  normalizeUnicode: normalizeUnicode,
26364
26342
  OPS: OPS,
26365
26343
  OutputScale: OutputScale,
26344
+ PagesMapper: PagesMapper,
26366
26345
  PasswordResponses: PasswordResponses,
26367
26346
  PDFDataRangeTransport: PDFDataRangeTransport,
26368
26347
  PDFDateString: PDFDateString,
@@ -26386,6 +26365,6 @@ globalThis.pdfjsLib = {
26386
26365
  XfaLayer: XfaLayer
26387
26366
  };
26388
26367
 
26389
- export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, CSSConstants, ColorPicker, DOMSVGFactory, DrawLayer, util_FeatureTest as FeatureTest, GlobalWorkerOptions, util_ImageKind as ImageKind, InvalidPDFException, MathClamp, OPS, OutputScale, PDFDataRangeTransport, PDFDateString, PDFWorker, PasswordResponses, PermissionFlag, PixelsPerInch, RenderingCancelledException, ResponseException, SignatureExtractor, SupportedImageMimeTypes, TextLayer, TouchManager, Util, VerbosityLevel, XfaLayer, applyOpacity, build, createValidAbsoluteUrl, fetchData, findContrastColor, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getRGB, getUuid, getXfaPageViewport, isDataScheme, isPdfFile, isValidExplicitDest, noContextMenu, normalizeUnicode, renderRichText, setLayerDimensions, shadow, stopEvent, updateUrlHash, version };
26368
+ export { AbortException, AnnotationEditorLayer, AnnotationEditorParamsType, AnnotationEditorType, AnnotationEditorUIManager, AnnotationLayer, AnnotationMode, AnnotationType, CSSConstants, ColorPicker, DOMSVGFactory, DrawLayer, util_FeatureTest as FeatureTest, GlobalWorkerOptions, util_ImageKind as ImageKind, InvalidPDFException, MathClamp, OPS, OutputScale, PDFDataRangeTransport, PDFDateString, PDFWorker, PagesMapper, PasswordResponses, PermissionFlag, PixelsPerInch, RenderingCancelledException, ResponseException, SignatureExtractor, SupportedImageMimeTypes, TextLayer, TouchManager, Util, VerbosityLevel, XfaLayer, applyOpacity, build, createValidAbsoluteUrl, fetchData, findContrastColor, getDocument, getFilenameFromUrl, getPdfFilenameFromUrl, getRGB, getUuid, getXfaPageViewport, isDataScheme, isPdfFile, isValidExplicitDest, noContextMenu, normalizeUnicode, renderRichText, setLayerDimensions, shadow, stopEvent, updateUrlHash, version };
26390
26369
 
26391
26370
  //# sourceMappingURL=pdf.mjs.map