@sync-in/server 1.9.3 → 1.10.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 (349) hide show
  1. package/CHANGELOG.md +41 -4
  2. package/environment/environment.dist.yaml +15 -5
  3. package/package.json +18 -19
  4. package/server/app.bootstrap.js +1 -1
  5. package/server/app.bootstrap.js.map +1 -1
  6. package/server/app.constants.js +3 -2
  7. package/server/app.constants.js.map +1 -1
  8. package/server/applications/files/constants/cache.js +2 -5
  9. package/server/applications/files/constants/cache.js.map +1 -1
  10. package/server/applications/files/constants/files.js +4 -0
  11. package/server/applications/files/constants/files.js.map +1 -1
  12. package/server/applications/files/constants/operations.js +4 -0
  13. package/server/applications/files/constants/operations.js.map +1 -1
  14. package/server/applications/files/constants/routes.js +1 -26
  15. package/server/applications/files/constants/routes.js.map +1 -1
  16. package/server/applications/files/files.config.js +15 -39
  17. package/server/applications/files/files.config.js.map +1 -1
  18. package/server/applications/files/files.controller.js +4 -4
  19. package/server/applications/files/files.controller.js.map +1 -1
  20. package/server/applications/files/files.module.js +12 -9
  21. package/server/applications/files/files.module.js.map +1 -1
  22. package/server/applications/files/interfaces/file-lock.interface.js.map +1 -1
  23. package/server/applications/files/interfaces/file-props.interface.js.map +1 -1
  24. package/server/applications/files/modules/collabora-online/collabora-online-environment.decorator.js +32 -0
  25. package/server/applications/files/modules/collabora-online/collabora-online-environment.decorator.js.map +1 -0
  26. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.js +280 -0
  27. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.js.map +1 -0
  28. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.spec.js +552 -0
  29. package/server/applications/files/modules/collabora-online/collabora-online-manager.service.spec.js.map +1 -0
  30. package/server/applications/files/modules/collabora-online/collabora-online.config.js +40 -0
  31. package/server/applications/files/modules/collabora-online/collabora-online.config.js.map +1 -0
  32. package/server/applications/files/modules/collabora-online/collabora-online.constants.js +110 -0
  33. package/server/applications/files/modules/collabora-online/collabora-online.constants.js.map +1 -0
  34. package/server/applications/files/modules/collabora-online/collabora-online.controller.js +128 -0
  35. package/server/applications/files/modules/collabora-online/collabora-online.controller.js.map +1 -0
  36. package/server/applications/files/modules/collabora-online/collabora-online.controller.spec.js +47 -0
  37. package/server/applications/files/modules/collabora-online/collabora-online.controller.spec.js.map +1 -0
  38. package/server/applications/files/{interfaces/only-office-config.interface.js → modules/collabora-online/collabora-online.dtos.js} +1 -1
  39. package/server/applications/files/modules/collabora-online/collabora-online.dtos.js.map +1 -0
  40. package/server/applications/files/{guards/files-only-office.guard.js → modules/collabora-online/collabora-online.guard.js} +7 -21
  41. package/server/applications/files/modules/collabora-online/collabora-online.guard.js.map +1 -0
  42. package/server/applications/files/modules/collabora-online/collabora-online.guard.spec.js +86 -0
  43. package/server/applications/files/modules/collabora-online/collabora-online.guard.spec.js.map +1 -0
  44. package/server/applications/files/modules/collabora-online/collabora-online.interface.js +10 -0
  45. package/server/applications/files/modules/collabora-online/collabora-online.interface.js.map +1 -0
  46. package/server/applications/files/modules/collabora-online/collabora-online.module.js +41 -0
  47. package/server/applications/files/modules/collabora-online/collabora-online.module.js.map +1 -0
  48. package/server/applications/files/modules/collabora-online/collabora-online.routes.js +35 -0
  49. package/server/applications/files/modules/collabora-online/collabora-online.routes.js.map +1 -0
  50. package/server/applications/files/modules/collabora-online/collabora-online.strategy.js +59 -0
  51. package/server/applications/files/modules/collabora-online/collabora-online.strategy.js.map +1 -0
  52. package/server/applications/files/modules/collabora-online/collabora-online.utils.js +28 -0
  53. package/server/applications/files/modules/collabora-online/collabora-online.utils.js.map +1 -0
  54. package/server/applications/files/{decorators → modules/only-office}/only-office-environment.decorator.js +5 -5
  55. package/server/applications/files/modules/only-office/only-office-environment.decorator.js.map +1 -0
  56. package/server/applications/files/{services/files-only-office-manager.service.js → modules/only-office/only-office-manager.service.js} +101 -97
  57. package/server/applications/files/modules/only-office/only-office-manager.service.js.map +1 -0
  58. package/server/applications/files/modules/only-office/only-office-manager.service.spec.js +477 -0
  59. package/server/applications/files/modules/only-office/only-office-manager.service.spec.js.map +1 -0
  60. package/server/applications/files/modules/only-office/only-office.config.js +51 -0
  61. package/server/applications/files/modules/only-office/only-office.config.js.map +1 -0
  62. package/server/applications/files/modules/only-office/only-office.constants.js +417 -0
  63. package/server/applications/files/modules/only-office/only-office.constants.js.map +1 -0
  64. package/server/applications/files/{files-only-office.controller.js → modules/only-office/only-office.controller.js} +35 -52
  65. package/server/applications/files/modules/only-office/only-office.controller.js.map +1 -0
  66. package/server/applications/files/{files-only-office.controller.spec.js → modules/only-office/only-office.controller.spec.js} +24 -21
  67. package/server/applications/files/modules/only-office/only-office.controller.spec.js.map +1 -0
  68. package/server/applications/files/modules/only-office/only-office.dtos.js +10 -0
  69. package/server/applications/files/modules/only-office/only-office.dtos.js.map +1 -0
  70. package/server/applications/files/modules/only-office/only-office.guard.js +40 -0
  71. package/server/applications/files/modules/only-office/only-office.guard.js.map +1 -0
  72. package/server/applications/files/{guards/files-only-office.guard.spec.js → modules/only-office/only-office.guard.spec.js} +15 -21
  73. package/server/applications/files/modules/only-office/only-office.guard.spec.js.map +1 -0
  74. package/server/applications/files/modules/only-office/only-office.interface.js +10 -0
  75. package/server/applications/files/modules/only-office/only-office.interface.js.map +1 -0
  76. package/server/applications/files/modules/only-office/only-office.module.js +41 -0
  77. package/server/applications/files/modules/only-office/only-office.module.js.map +1 -0
  78. package/server/applications/files/modules/only-office/only-office.routes.js +45 -0
  79. package/server/applications/files/modules/only-office/only-office.routes.js.map +1 -0
  80. package/server/applications/files/{guards/files-only-office.strategy.js → modules/only-office/only-office.strategy.js} +11 -11
  81. package/server/applications/files/modules/only-office/only-office.strategy.js.map +1 -0
  82. package/server/applications/files/services/files-lock-manager.service.js +25 -33
  83. package/server/applications/files/services/files-lock-manager.service.js.map +1 -1
  84. package/server/applications/files/services/files-manager.service.js +17 -16
  85. package/server/applications/files/services/files-manager.service.js.map +1 -1
  86. package/server/applications/files/services/files-methods.service.js +2 -2
  87. package/server/applications/files/services/files-methods.service.js.map +1 -1
  88. package/server/applications/files/services/files-methods.service.spec.js +5 -5
  89. package/server/applications/files/services/files-methods.service.spec.js.map +1 -1
  90. package/server/applications/files/services/files-recents.service.js +4 -0
  91. package/server/applications/files/services/files-recents.service.js.map +1 -1
  92. package/server/applications/files/services/files-scheduler.service.js +24 -5
  93. package/server/applications/files/services/files-scheduler.service.js.map +1 -1
  94. package/server/applications/files/utils/files.js +10 -2
  95. package/server/applications/files/utils/files.js.map +1 -1
  96. package/server/applications/links/constants/routes.js +5 -0
  97. package/server/applications/links/constants/routes.js.map +1 -1
  98. package/server/applications/links/interfaces/link-space.interface.js.map +1 -1
  99. package/server/applications/links/links.controller.js +25 -5
  100. package/server/applications/links/links.controller.js.map +1 -1
  101. package/server/applications/links/services/links-manager.service.js +43 -21
  102. package/server/applications/links/services/links-manager.service.js.map +1 -1
  103. package/server/applications/links/services/links-manager.service.spec.js +4 -3
  104. package/server/applications/links/services/links-manager.service.spec.js.map +1 -1
  105. package/server/applications/links/services/links-queries.service.js +9 -2
  106. package/server/applications/links/services/links-queries.service.js.map +1 -1
  107. package/server/applications/shares/interfaces/share-link.interface.js.map +1 -1
  108. package/server/applications/shares/services/shares-manager.service.js +3 -0
  109. package/server/applications/shares/services/shares-manager.service.js.map +1 -1
  110. package/server/applications/shares/services/shares-manager.service.spec.js +2 -1
  111. package/server/applications/shares/services/shares-manager.service.spec.js.map +1 -1
  112. package/server/applications/shares/services/shares-queries.service.js +1 -0
  113. package/server/applications/shares/services/shares-queries.service.js.map +1 -1
  114. package/server/applications/spaces/constants/spaces.js +2 -2
  115. package/server/applications/spaces/constants/spaces.js.map +1 -1
  116. package/server/applications/spaces/decorators/space-override-permission.decorator.js +18 -0
  117. package/server/applications/spaces/decorators/space-override-permission.decorator.js.map +1 -0
  118. package/server/applications/spaces/guards/space.guard.js +40 -33
  119. package/server/applications/spaces/guards/space.guard.js.map +1 -1
  120. package/server/applications/spaces/guards/space.guard.spec.js +10 -15
  121. package/server/applications/spaces/guards/space.guard.spec.js.map +1 -1
  122. package/server/applications/spaces/services/spaces-scheduler.service.js +9 -1
  123. package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
  124. package/server/applications/webdav/constants/webdav.js +4 -0
  125. package/server/applications/webdav/constants/webdav.js.map +1 -1
  126. package/server/applications/webdav/guards/webdav-protocol.guard.js +9 -8
  127. package/server/applications/webdav/guards/webdav-protocol.guard.js.map +1 -1
  128. package/server/applications/webdav/guards/webdav-protocol.guard.spec.js +1 -1
  129. package/server/applications/webdav/guards/webdav-protocol.guard.spec.js.map +1 -1
  130. package/server/applications/webdav/interfaces/webdav.interface.js.map +1 -1
  131. package/server/applications/webdav/services/webdav-methods.service.js +40 -17
  132. package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
  133. package/server/applications/webdav/services/webdav-methods.service.spec.js +2157 -1289
  134. package/server/applications/webdav/services/webdav-methods.service.spec.js.map +1 -1
  135. package/server/applications/webdav/utils/webdav.js +8 -4
  136. package/server/applications/webdav/utils/webdav.js.map +1 -1
  137. package/server/applications/webdav/webdav.controller.js +4 -4
  138. package/server/applications/webdav/webdav.controller.js.map +1 -1
  139. package/server/authentication/guards/auth-token-access.guard.js +8 -3
  140. package/server/authentication/guards/auth-token-access.guard.js.map +1 -1
  141. package/server/authentication/services/auth-methods/auth-method-two-fa.service.js +1 -1
  142. package/server/authentication/services/auth-methods/auth-method-two-fa.service.js.map +1 -1
  143. package/server/authentication/services/auth-methods/auth-method-two-fa.service.spec.js +350 -4
  144. package/server/authentication/services/auth-methods/auth-method-two-fa.service.spec.js.map +1 -1
  145. package/server/configuration/config.environment.js +5 -1
  146. package/server/configuration/config.environment.js.map +1 -1
  147. package/server/configuration/config.interfaces.js.map +1 -1
  148. package/static/3rdpartylicenses.txt +507 -507
  149. package/static/assets/pdfjs/build/pdf.mjs +93 -33
  150. package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
  151. package/static/assets/pdfjs/build/pdf.sandbox.mjs +3 -3
  152. package/static/assets/pdfjs/build/pdf.sandbox.mjs.map +1 -1
  153. package/static/assets/pdfjs/build/pdf.worker.mjs +166 -54
  154. package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
  155. package/static/assets/pdfjs/version +1 -1
  156. package/static/assets/pdfjs/web/images/checkmark.svg +5 -0
  157. package/static/assets/pdfjs/web/images/pages_closeButton.svg +3 -0
  158. package/static/assets/pdfjs/web/images/pages_selected.svg +7 -0
  159. package/static/assets/pdfjs/web/images/pages_viewArrow.svg +3 -0
  160. package/static/assets/pdfjs/web/images/pages_viewButton.svg +3 -0
  161. package/static/assets/pdfjs/web/locale/be/viewer.ftl +0 -2
  162. package/static/assets/pdfjs/web/locale/bs/viewer.ftl +0 -5
  163. package/static/assets/pdfjs/web/locale/cs/viewer.ftl +4 -6
  164. package/static/assets/pdfjs/web/locale/cy/viewer.ftl +0 -2
  165. package/static/assets/pdfjs/web/locale/da/viewer.ftl +0 -2
  166. package/static/assets/pdfjs/web/locale/de/viewer.ftl +0 -2
  167. package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +0 -2
  168. package/static/assets/pdfjs/web/locale/el/viewer.ftl +0 -2
  169. package/static/assets/pdfjs/web/locale/en-CA/viewer.ftl +6 -2
  170. package/static/assets/pdfjs/web/locale/en-GB/viewer.ftl +0 -2
  171. package/static/assets/pdfjs/web/locale/en-US/viewer.ftl +82 -17
  172. package/static/assets/pdfjs/web/locale/eo/viewer.ftl +0 -2
  173. package/static/assets/pdfjs/web/locale/es-AR/viewer.ftl +0 -2
  174. package/static/assets/pdfjs/web/locale/es-CL/viewer.ftl +0 -2
  175. package/static/assets/pdfjs/web/locale/es-ES/viewer.ftl +0 -2
  176. package/static/assets/pdfjs/web/locale/es-MX/viewer.ftl +0 -2
  177. package/static/assets/pdfjs/web/locale/eu/viewer.ftl +0 -2
  178. package/static/assets/pdfjs/web/locale/fi/viewer.ftl +0 -2
  179. package/static/assets/pdfjs/web/locale/fr/viewer.ftl +0 -2
  180. package/static/assets/pdfjs/web/locale/fur/viewer.ftl +0 -5
  181. package/static/assets/pdfjs/web/locale/fy-NL/viewer.ftl +3 -5
  182. package/static/assets/pdfjs/web/locale/gn/viewer.ftl +0 -2
  183. package/static/assets/pdfjs/web/locale/he/viewer.ftl +0 -2
  184. package/static/assets/pdfjs/web/locale/hr/viewer.ftl +66 -0
  185. package/static/assets/pdfjs/web/locale/hsb/viewer.ftl +0 -2
  186. package/static/assets/pdfjs/web/locale/hu/viewer.ftl +0 -2
  187. package/static/assets/pdfjs/web/locale/hy-AM/viewer.ftl +3 -8
  188. package/static/assets/pdfjs/web/locale/ia/viewer.ftl +0 -2
  189. package/static/assets/pdfjs/web/locale/id/viewer.ftl +0 -5
  190. package/static/assets/pdfjs/web/locale/is/viewer.ftl +0 -5
  191. package/static/assets/pdfjs/web/locale/it/viewer.ftl +0 -2
  192. package/static/assets/pdfjs/web/locale/ja/viewer.ftl +0 -14
  193. package/static/assets/pdfjs/web/locale/ka/viewer.ftl +4 -6
  194. package/static/assets/pdfjs/web/locale/kab/viewer.ftl +0 -5
  195. package/static/assets/pdfjs/web/locale/kk/viewer.ftl +0 -2
  196. package/static/assets/pdfjs/web/locale/ko/viewer.ftl +0 -2
  197. package/static/assets/pdfjs/web/locale/nb-NO/viewer.ftl +1 -3
  198. package/static/assets/pdfjs/web/locale/nl/viewer.ftl +0 -2
  199. package/static/assets/pdfjs/web/locale/nn-NO/viewer.ftl +4 -2
  200. package/static/assets/pdfjs/web/locale/pa-IN/viewer.ftl +0 -2
  201. package/static/assets/pdfjs/web/locale/pl/viewer.ftl +0 -2
  202. package/static/assets/pdfjs/web/locale/pt-BR/viewer.ftl +0 -2
  203. package/static/assets/pdfjs/web/locale/pt-PT/viewer.ftl +35 -0
  204. package/static/assets/pdfjs/web/locale/rm/viewer.ftl +0 -5
  205. package/static/assets/pdfjs/web/locale/ro/viewer.ftl +4 -6
  206. package/static/assets/pdfjs/web/locale/ru/viewer.ftl +3 -5
  207. package/static/assets/pdfjs/web/locale/sk/viewer.ftl +0 -2
  208. package/static/assets/pdfjs/web/locale/sl/viewer.ftl +0 -2
  209. package/static/assets/pdfjs/web/locale/sq/viewer.ftl +0 -2
  210. package/static/assets/pdfjs/web/locale/sv-SE/viewer.ftl +0 -2
  211. package/static/assets/pdfjs/web/locale/tg/viewer.ftl +0 -2
  212. package/static/assets/pdfjs/web/locale/th/viewer.ftl +2 -2
  213. package/static/assets/pdfjs/web/locale/tr/viewer.ftl +0 -2
  214. package/static/assets/pdfjs/web/locale/vi/viewer.ftl +0 -2
  215. package/static/assets/pdfjs/web/locale/zh-CN/viewer.ftl +0 -2
  216. package/static/assets/pdfjs/web/locale/zh-TW/viewer.ftl +0 -2
  217. package/static/assets/pdfjs/web/viewer.css +1778 -835
  218. package/static/assets/pdfjs/web/viewer.html +167 -86
  219. package/static/assets/pdfjs/web/viewer.mjs +1106 -801
  220. package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
  221. package/static/chunk-27V66YJV.js +2 -0
  222. package/static/{chunk-WJYVS27M.js → chunk-27Z3SYRL.js} +1 -1
  223. package/static/{chunk-NFIES7BC.js → chunk-2RWLNKZH.js} +1 -1
  224. package/static/chunk-2YQ4SX3A.js +13 -0
  225. package/static/{chunk-GENTF6JM.js → chunk-3JYMJQYT.js} +1 -1
  226. package/static/chunk-3QTROEHV.js +1 -0
  227. package/static/{chunk-ZPI7RQ2S.js → chunk-3RPUQ22U.js} +1 -1
  228. package/static/{chunk-R6VB3INJ.js → chunk-3WZ6F3LC.js} +1 -1
  229. package/static/chunk-3ZLBVUCX.js +2 -0
  230. package/static/{chunk-5HCVWZMA.js → chunk-45AZ6ZML.js} +1 -1
  231. package/static/chunk-46TJLPJY.js +1 -0
  232. package/static/chunk-4NIYCYRS.js +2 -0
  233. package/static/{chunk-XXYMVRSH.js → chunk-4TPFERL6.js} +1 -1
  234. package/static/{chunk-CAZSNVMS.js → chunk-5O66CLTD.js} +1 -1
  235. package/static/chunk-6OEOADR6.js +1 -0
  236. package/static/chunk-6WMXMIE4.js +1 -0
  237. package/static/{chunk-NK2NMAJI.js → chunk-7VRYTDX4.js} +1 -1
  238. package/static/{chunk-ASBPYTLT.js → chunk-ARS47O5X.js} +1 -1
  239. package/static/chunk-B6HQYQYG.js +1 -0
  240. package/static/chunk-BCN4T5DO.js +2 -0
  241. package/static/{chunk-PKU4IIIR.js → chunk-CCZWPM7Q.js} +1 -1
  242. package/static/{chunk-QUSS6SUC.js → chunk-CMNMPG6Z.js} +1 -1
  243. package/static/{chunk-GDPJRUVU.js → chunk-CSVPAZHK.js} +1 -1
  244. package/static/{chunk-BJARRIS6.js → chunk-D55YR5X7.js} +4 -4
  245. package/static/{chunk-Z6RJZIDG.js → chunk-D5FQ72R4.js} +1 -1
  246. package/static/{chunk-4DF2SQD4.js → chunk-DGCVA6BM.js} +1 -1
  247. package/static/{chunk-TVJQXN73.js → chunk-DVCN3P7Q.js} +1 -1
  248. package/static/chunk-E32J777S.js +5 -0
  249. package/static/{chunk-5NHB7SV3.js → chunk-FIUF2JM4.js} +1 -1
  250. package/static/{chunk-RJOHDAPM.js → chunk-G3PL6YX3.js} +1 -1
  251. package/static/chunk-G7RZN7HN.js +1 -0
  252. package/static/{chunk-DDRGLHOP.js → chunk-GQHXYX6Z.js} +1 -1
  253. package/static/{chunk-5HYSNQR4.js → chunk-GWRAGN3M.js} +1 -1
  254. package/static/{chunk-ZC5ZDCDC.js → chunk-GXWGB7WO.js} +1 -1
  255. package/static/{chunk-25PWAXTJ.js → chunk-HGODIZTV.js} +1 -1
  256. package/static/{chunk-4KXJ6C4N.js → chunk-HZAB6F4Q.js} +1 -1
  257. package/static/chunk-I3FR3A45.js +1 -0
  258. package/static/{chunk-A6J6SOM6.js → chunk-I5SPA4G2.js} +1 -1
  259. package/static/{chunk-TGHBDJZA.js → chunk-IMFO2MI7.js} +1 -1
  260. package/static/{chunk-CURVLK7L.js → chunk-JNTNMIUH.js} +1 -1
  261. package/static/chunk-JRXG43AA.js +2 -0
  262. package/static/{chunk-XAIOGRBO.js → chunk-KAUCN24H.js} +1 -1
  263. package/static/chunk-KDUAB76O.js +1 -0
  264. package/static/chunk-KPOQLDWF.js +1 -0
  265. package/static/{chunk-HE6EDXWI.js → chunk-KWFELZTM.js} +1 -1
  266. package/static/{chunk-2CAAJBRO.js → chunk-L3BIP4AA.js} +1 -1
  267. package/static/{chunk-U75PLYIJ.js → chunk-LGIVVJDD.js} +1 -1
  268. package/static/{chunk-JEVBUJQ4.js → chunk-LNLBIJZD.js} +1 -1
  269. package/static/chunk-LTJNLOX2.js +1 -0
  270. package/static/{chunk-SDR3UG2F.js → chunk-LZUHREOF.js} +1 -1
  271. package/static/{chunk-VO4WVT6K.js → chunk-NIR4YE2E.js} +1 -1
  272. package/static/{chunk-S6YKBWJE.js → chunk-NJJURHX4.js} +1 -1
  273. package/static/chunk-NNZWSNAW.js +1 -0
  274. package/static/chunk-NWKBB7J4.js +1 -0
  275. package/static/chunk-O3YLAEVE.js +3 -0
  276. package/static/chunk-OUHCDDT6.js +1 -0
  277. package/static/{chunk-ZRBLCAOK.js → chunk-PDG7DOEF.js} +1 -1
  278. package/static/chunk-POUWUMC4.js +1 -0
  279. package/static/{chunk-YTBSB2GE.js → chunk-PPJCVBJH.js} +1 -1
  280. package/static/{chunk-K3MOXDU5.js → chunk-PQZLR4P3.js} +1 -1
  281. package/static/chunk-PVYVY3GD.js +1 -0
  282. package/static/chunk-Q5X5TPAG.js +1 -0
  283. package/static/{chunk-LFAQLJZK.js → chunk-QHJT5H4M.js} +1 -1
  284. package/static/{chunk-A7DSX7VP.js → chunk-R4VMWCM5.js} +1 -1
  285. package/static/{chunk-27XEAHMV.js → chunk-R7PLNX75.js} +1 -1
  286. package/static/chunk-RJULB733.js +1 -0
  287. package/static/{chunk-MBFMTBVJ.js → chunk-RNVPQQKT.js} +5 -5
  288. package/static/chunk-RTNEBRKJ.js +1 -0
  289. package/static/{chunk-FXM7XXWA.js → chunk-S3TTWPQA.js} +1 -1
  290. package/static/{chunk-6VJI4X2A.js → chunk-SDJNZULP.js} +1 -1
  291. package/static/chunk-SNOOCDJD.js +1 -0
  292. package/static/chunk-T42BV6TR.js +1 -0
  293. package/static/{chunk-4OV3SAUS.js → chunk-TNCKNU6I.js} +1 -1
  294. package/static/{chunk-2LHHXDD5.js → chunk-ULSPQ3HP.js} +1 -1
  295. package/static/{chunk-4EUHBTWV.js → chunk-UOK3LKSX.js} +1 -1
  296. package/static/{chunk-7NI353LS.js → chunk-VD5JHSDS.js} +1 -1
  297. package/static/{chunk-YXWF2DGF.js → chunk-XBKCQCBI.js} +1 -1
  298. package/static/{chunk-KBWK65KM.js → chunk-XEWLBWFF.js} +1 -1
  299. package/static/{chunk-FLPZB3OX.js → chunk-XTVNHFKX.js} +1 -1
  300. package/static/chunk-ZCSHU3D7.js +1 -0
  301. package/static/{chunk-FRBTL2ER.js → chunk-ZEJLIGAY.js} +1 -1
  302. package/static/{chunk-7H5O4BLV.js → chunk-ZHOE5VEY.js} +1 -1
  303. package/static/chunk-ZOMRIN3G.js +2 -0
  304. package/static/index.html +2 -2
  305. package/static/main-YKDNJ7LK.js +11 -0
  306. package/static/{styles-S5HVK4H5.css → styles-XLLEY5Y3.css} +1 -1
  307. package/server/applications/files/constants/only-office.js +0 -531
  308. package/server/applications/files/constants/only-office.js.map +0 -1
  309. package/server/applications/files/decorators/only-office-environment.decorator.js.map +0 -1
  310. package/server/applications/files/files-only-office.controller.js.map +0 -1
  311. package/server/applications/files/files-only-office.controller.spec.js.map +0 -1
  312. package/server/applications/files/guards/files-only-office.guard.js.map +0 -1
  313. package/server/applications/files/guards/files-only-office.guard.spec.js.map +0 -1
  314. package/server/applications/files/guards/files-only-office.strategy.js.map +0 -1
  315. package/server/applications/files/interfaces/only-office-config.interface.js.map +0 -1
  316. package/server/applications/files/services/files-only-office-manager.service.js.map +0 -1
  317. package/server/applications/files/services/files-only-office-manager.service.spec.js +0 -58
  318. package/server/applications/files/services/files-only-office-manager.service.spec.js.map +0 -1
  319. package/static/chunk-2XY4PMI5.js +0 -1
  320. package/static/chunk-33WFRCUP.js +0 -1
  321. package/static/chunk-3LVFDMTN.js +0 -1
  322. package/static/chunk-42L6C5MT.js +0 -1
  323. package/static/chunk-5WCQBTXW.js +0 -1
  324. package/static/chunk-A7R246NW.js +0 -1
  325. package/static/chunk-BSB4VROD.js +0 -2
  326. package/static/chunk-DHFQIFOF.js +0 -1
  327. package/static/chunk-DRHPEERW.js +0 -2
  328. package/static/chunk-FCGTI42I.js +0 -1
  329. package/static/chunk-H4RLHI3Y.js +0 -1
  330. package/static/chunk-ITVA26X2.js +0 -2
  331. package/static/chunk-IUJ4IK26.js +0 -1
  332. package/static/chunk-L3PDWJZ3.js +0 -3
  333. package/static/chunk-LBXOAKBD.js +0 -1
  334. package/static/chunk-LZKI5P5T.js +0 -1
  335. package/static/chunk-MYM43ENO.js +0 -1
  336. package/static/chunk-MZBO5PAR.js +0 -1
  337. package/static/chunk-NAH4V2R6.js +0 -2
  338. package/static/chunk-O7UXVNR2.js +0 -1
  339. package/static/chunk-PCFH5HCI.js +0 -2
  340. package/static/chunk-SRBOO7AO.js +0 -1
  341. package/static/chunk-UUX3M6DC.js +0 -1
  342. package/static/chunk-VJ2HWQRJ.js +0 -5
  343. package/static/chunk-VZPCXSRG.js +0 -2
  344. package/static/chunk-W72JYHOH.js +0 -1
  345. package/static/chunk-XHQEF2IX.js +0 -1
  346. package/static/chunk-XKEBQNQJ.js +0 -1
  347. package/static/chunk-ZERBTNFW.js +0 -13
  348. package/static/main-FE6GWZXU.js +0 -11
  349. /package/static/assets/pdfjs/web/images/{toolbarButton-sidebarToggle.svg → toolbarButton-viewsManagerToggle.svg} +0 -0
@@ -21,8 +21,8 @@
21
21
  */
22
22
 
23
23
  /**
24
- * pdfjsVersion = 5.4.449
25
- * pdfjsBuild = f44e5f0e6
24
+ * pdfjsVersion = 5.4.530
25
+ * pdfjsBuild = 50cc4adac
26
26
  */
27
27
  /******/ // The require scope
28
28
  /******/ var __webpack_require__ = {};
@@ -586,6 +586,11 @@ function toggleCheckedBtn(button, toggle, view = null) {
586
586
  button.setAttribute("aria-checked", toggle);
587
587
  view?.classList.toggle("hidden", !toggle);
588
588
  }
589
+ function toggleSelectedBtn(button, toggle, view = null) {
590
+ button.classList.toggle("selected", toggle);
591
+ button.setAttribute("aria-selected", toggle);
592
+ view?.classList.toggle("hidden", !toggle);
593
+ }
589
594
  function toggleExpandedBtn(button, toggle, view = null) {
590
595
  button.classList.toggle("toggled", toggle);
591
596
  button.setAttribute("aria-expanded", toggle);
@@ -3155,7 +3160,7 @@ class genericl10n_GenericL10n extends L10n {
3155
3160
  yield this.#createBundleFallback(lang);
3156
3161
  }
3157
3162
  static async #createBundleFallback(lang) {
3158
- const text = "pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties\u2026\npdfjs-document-properties-button-label = Document Properties\u2026\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)\npdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: \"short\", timeStyle: \"medium\") }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing\u2026\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document\u2026\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: \"short\", timeStyle: \"medium\") }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-color-picker-free-text-input =\n .title = Change text color\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-color-picker-ink-input =\n .title = Change drawing color\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-comment-floating-button =\n .title = Comment\n .aria-label = Comment\npdfjs-comment-floating-button-label = Comment\npdfjs-editor-comment-button =\n .title = Comment\n .aria-label = Comment\npdfjs-editor-comment-button-label = Comment\npdfjs-editor-signature-button =\n .title = Add signature\npdfjs-editor-signature-button-label = Add signature\npdfjs-editor-highlight-editor =\n .aria-label = Highlight editor\npdfjs-editor-ink-editor =\n .aria-label = Drawing editor\npdfjs-editor-signature-editor1 =\n .aria-description = Signature editor: { $description }\npdfjs-editor-stamp-editor =\n .aria-label = Image editor\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-remove-signature-button =\n .title = Remove signature\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-editor-add-signature-container =\n .aria-label = Signature controls and saved signatures\npdfjs-editor-signature-add-signature-button =\n .title = Add new signature\npdfjs-editor-signature-add-signature-button-label = Add new signature\npdfjs-editor-add-saved-signature-button =\n .title = Saved signature: { $description }\npdfjs-free-text2 =\n .aria-label = Text Editor\n .default-content = Start typing\u2026\npdfjs-editor-comments-sidebar-title =\n { $count ->\n [one] Comment\n *[other] Comments\n }\npdfjs-editor-comments-sidebar-close-button =\n .title = Close the sidebar\n .aria-label = Close the sidebar\npdfjs-editor-comments-sidebar-close-button-label = Close the sidebar\npdfjs-editor-comments-sidebar-no-comments1 = See something noteworthy? Highlight it and leave a comment.\npdfjs-editor-comments-sidebar-no-comments-link = Learn more\npdfjs-editor-alt-text-button =\n .aria-label = Alt text\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button =\n .aria-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D\npdfjs-editor-resizer-top-left =\n .aria-label = Top left corner \u2014 resize\npdfjs-editor-resizer-top-middle =\n .aria-label = Top middle \u2014 resize\npdfjs-editor-resizer-top-right =\n .aria-label = Top right corner \u2014 resize\npdfjs-editor-resizer-middle-right =\n .aria-label = Middle right \u2014 resize\npdfjs-editor-resizer-bottom-right =\n .aria-label = Bottom right corner \u2014 resize\npdfjs-editor-resizer-bottom-middle =\n .aria-label = Bottom middle \u2014 resize\npdfjs-editor-resizer-bottom-left =\n .aria-label = Bottom left corner \u2014 resize\npdfjs-editor-resizer-middle-left =\n .aria-label = Middle left \u2014 resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all\npdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)\npdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)\npdfjs-editor-new-alt-text-textarea =\n .placeholder = Write your description here\u2026\npdfjs-editor-new-alt-text-description = Short description for people who can\u2019t see the image or when the image doesn\u2019t load.\npdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.\npdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more\npdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically\npdfjs-editor-new-alt-text-not-now-button = Not now\npdfjs-editor-new-alt-text-error-title = Couldn\u2019t create alt text automatically\npdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.\npdfjs-editor-new-alt-text-error-close-button = Close\npdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\n .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\npdfjs-editor-new-alt-text-added-button =\n .aria-label = Alt text added\npdfjs-editor-new-alt-text-added-button-label = Alt text added\npdfjs-editor-new-alt-text-missing-button =\n .aria-label = Missing alt text\npdfjs-editor-new-alt-text-missing-button-label = Missing alt text\npdfjs-editor-new-alt-text-to-review-button =\n .aria-label = Review alt text\npdfjs-editor-new-alt-text-to-review-button-label = Review alt text\npdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }\npdfjs-image-alt-text-settings-button =\n .title = Image alt text settings\npdfjs-image-alt-text-settings-button-label = Image alt text settings\npdfjs-editor-alt-text-settings-dialog-label = Image alt text settings\npdfjs-editor-alt-text-settings-automatic-title = Automatic alt text\npdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically\npdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can\u2019t see the image or when the image doesn\u2019t load.\npdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB)\npdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text.\npdfjs-editor-alt-text-settings-delete-model-button = Delete\npdfjs-editor-alt-text-settings-download-model-button = Download\npdfjs-editor-alt-text-settings-downloading-model-button = Downloading\u2026\npdfjs-editor-alt-text-settings-editor-title = Alt text editor\npdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image\npdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.\npdfjs-editor-alt-text-settings-close-button = Close\npdfjs-editor-highlight-added-alert = Highlight added\npdfjs-editor-freetext-added-alert = Text added\npdfjs-editor-ink-added-alert = Drawing added\npdfjs-editor-stamp-added-alert = Image added\npdfjs-editor-signature-added-alert = Signature added\npdfjs-editor-undo-bar-message-highlight = Highlight removed\npdfjs-editor-undo-bar-message-freetext = Text removed\npdfjs-editor-undo-bar-message-ink = Drawing removed\npdfjs-editor-undo-bar-message-stamp = Image removed\npdfjs-editor-undo-bar-message-signature = Signature removed\npdfjs-editor-undo-bar-message-multiple =\n { $count ->\n [one] { $count } annotation removed\n *[other] { $count } annotations removed\n }\npdfjs-editor-undo-bar-undo-button =\n .title = Undo\npdfjs-editor-undo-bar-undo-button-label = Undo\npdfjs-editor-undo-bar-close-button =\n .title = Close\npdfjs-editor-undo-bar-close-button-label = Close\npdfjs-editor-add-signature-dialog-label = This modal allows the user to create a signature to add to a PDF document. The user can edit the name (which also serves as the alt text), and optionally save the signature for repeated use.\npdfjs-editor-add-signature-dialog-title = Add a signature\npdfjs-editor-add-signature-type-button = Type\n .title = Type\npdfjs-editor-add-signature-draw-button = Draw\n .title = Draw\npdfjs-editor-add-signature-image-button = Image\n .title = Image\npdfjs-editor-add-signature-type-input =\n .aria-label = Type your signature\n .placeholder = Type your signature\npdfjs-editor-add-signature-draw-placeholder = Draw your signature\npdfjs-editor-add-signature-draw-thickness-range-label = Thickness\npdfjs-editor-add-signature-draw-thickness-range =\n .title = Drawing thickness: { $thickness }\npdfjs-editor-add-signature-image-placeholder = Drag a file here to upload\npdfjs-editor-add-signature-image-browse-link =\n { PLATFORM() ->\n [macos] Or choose image files\n *[other] Or browse image files\n }\npdfjs-editor-add-signature-description-label = Description (alt text)\npdfjs-editor-add-signature-description-input =\n .title = Description (alt text)\npdfjs-editor-add-signature-description-default-when-drawing = Signature\npdfjs-editor-add-signature-clear-button-label = Clear signature\npdfjs-editor-add-signature-clear-button =\n .title = Clear signature\npdfjs-editor-add-signature-save-checkbox = Save signature\npdfjs-editor-add-signature-save-warning-message = You\u2019ve reached the limit of 5 saved signatures. Remove one to save more.\npdfjs-editor-add-signature-image-upload-error-title = Couldn\u2019t upload image\npdfjs-editor-add-signature-image-upload-error-description = Check your network connection or try another image.\npdfjs-editor-add-signature-image-no-data-error-title = Can\u2019t convert this image into a signature\npdfjs-editor-add-signature-image-no-data-error-description = Please try uploading a different image.\npdfjs-editor-add-signature-error-close-button = Close\npdfjs-editor-add-signature-cancel-button = Cancel\npdfjs-editor-add-signature-add-button = Add\npdfjs-editor-delete-signature-button1 =\n .title = Remove saved signature\npdfjs-editor-delete-signature-button-label1 = Remove saved signature\npdfjs-editor-add-signature-edit-button-label = Edit description\npdfjs-editor-edit-signature-dialog-title = Edit description\npdfjs-editor-edit-signature-update-button = Update\npdfjs-show-comment-button =\n .title = Show comment\npdfjs-editor-edit-comment-popup-button-label = Edit comment\npdfjs-editor-edit-comment-popup-button =\n .title = Edit comment\npdfjs-editor-delete-comment-popup-button-label = Remove comment\npdfjs-editor-delete-comment-popup-button =\n .title = Remove comment\npdfjs-editor-edit-comment-dialog-title-when-editing = Edit comment\npdfjs-editor-edit-comment-dialog-save-button-when-editing = Update\npdfjs-editor-edit-comment-dialog-title-when-adding = Add comment\npdfjs-editor-edit-comment-dialog-save-button-when-adding = Add\npdfjs-editor-edit-comment-dialog-text-input =\n .placeholder = Start typing\u2026\npdfjs-editor-edit-comment-dialog-cancel-button = Cancel\npdfjs-editor-add-comment-button =\n .title = Add comment";
3163
+ const text = "pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties\u2026\npdfjs-document-properties-button-label = Document Properties\u2026\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)\npdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: \"short\", timeStyle: \"medium\") }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing\u2026\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document\u2026\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: \"short\", timeStyle: \"medium\") }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-color-picker-free-text-input =\n .title = Change text color\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-color-picker-ink-input =\n .title = Change drawing color\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-comment-floating-button =\n .title = Comment\n .aria-label = Comment\npdfjs-comment-floating-button-label = Comment\npdfjs-editor-comment-button =\n .title = Comment\n .aria-label = Comment\npdfjs-editor-comment-button-label = Comment\npdfjs-editor-signature-button =\n .title = Add signature\npdfjs-editor-signature-button-label = Add signature\npdfjs-editor-highlight-editor =\n .aria-label = Highlight editor\npdfjs-editor-ink-editor =\n .aria-label = Drawing editor\npdfjs-editor-signature-editor1 =\n .aria-description = Signature editor: { $description }\npdfjs-editor-stamp-editor =\n .aria-label = Image editor\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-remove-signature-button =\n .title = Remove signature\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-editor-add-signature-container =\n .aria-label = Signature controls and saved signatures\npdfjs-editor-signature-add-signature-button =\n .title = Add new signature\npdfjs-editor-signature-add-signature-button-label = Add new signature\npdfjs-editor-add-saved-signature-button =\n .title = Saved signature: { $description }\npdfjs-free-text2 =\n .aria-label = Text Editor\n .default-content = Start typing\u2026\npdfjs-editor-comments-sidebar-title =\n { $count ->\n [one] Comment\n *[other] Comments\n }\npdfjs-editor-comments-sidebar-close-button =\n .title = Close the sidebar\n .aria-label = Close the sidebar\npdfjs-editor-comments-sidebar-close-button-label = Close the sidebar\npdfjs-editor-comments-sidebar-no-comments1 = See something noteworthy? Highlight it and leave a comment.\npdfjs-editor-comments-sidebar-no-comments-link = Learn more\npdfjs-editor-alt-text-button =\n .aria-label = Alt text\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button =\n .aria-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D\npdfjs-editor-resizer-top-left =\n .aria-label = Top left corner \u2014 resize\npdfjs-editor-resizer-top-middle =\n .aria-label = Top middle \u2014 resize\npdfjs-editor-resizer-top-right =\n .aria-label = Top right corner \u2014 resize\npdfjs-editor-resizer-middle-right =\n .aria-label = Middle right \u2014 resize\npdfjs-editor-resizer-bottom-right =\n .aria-label = Bottom right corner \u2014 resize\npdfjs-editor-resizer-bottom-middle =\n .aria-label = Bottom middle \u2014 resize\npdfjs-editor-resizer-bottom-left =\n .aria-label = Bottom left corner \u2014 resize\npdfjs-editor-resizer-middle-left =\n .aria-label = Middle left \u2014 resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all\npdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)\npdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)\npdfjs-editor-new-alt-text-textarea =\n .placeholder = Write your description here\u2026\npdfjs-editor-new-alt-text-description = Short description for people who can\u2019t see the image or when the image doesn\u2019t load.\npdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.\npdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more\npdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically\npdfjs-editor-new-alt-text-not-now-button = Not now\npdfjs-editor-new-alt-text-error-title = Couldn\u2019t create alt text automatically\npdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.\npdfjs-editor-new-alt-text-error-close-button = Close\npdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\n .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\npdfjs-editor-new-alt-text-added-button =\n .aria-label = Alt text added\npdfjs-editor-new-alt-text-added-button-label = Alt text added\npdfjs-editor-new-alt-text-missing-button =\n .aria-label = Missing alt text\npdfjs-editor-new-alt-text-missing-button-label = Missing alt text\npdfjs-editor-new-alt-text-to-review-button =\n .aria-label = Review alt text\npdfjs-editor-new-alt-text-to-review-button-label = Review alt text\npdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }\npdfjs-image-alt-text-settings-button =\n .title = Image alt text settings\npdfjs-image-alt-text-settings-button-label = Image alt text settings\npdfjs-editor-alt-text-settings-dialog-label = Image alt text settings\npdfjs-editor-alt-text-settings-automatic-title = Automatic alt text\npdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically\npdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can\u2019t see the image or when the image doesn\u2019t load.\npdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB)\npdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text.\npdfjs-editor-alt-text-settings-delete-model-button = Delete\npdfjs-editor-alt-text-settings-download-model-button = Download\npdfjs-editor-alt-text-settings-downloading-model-button = Downloading\u2026\npdfjs-editor-alt-text-settings-editor-title = Alt text editor\npdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image\npdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.\npdfjs-editor-alt-text-settings-close-button = Close\npdfjs-editor-highlight-added-alert = Highlight added\npdfjs-editor-freetext-added-alert = Text added\npdfjs-editor-ink-added-alert = Drawing added\npdfjs-editor-stamp-added-alert = Image added\npdfjs-editor-signature-added-alert = Signature added\npdfjs-editor-undo-bar-message-highlight = Highlight removed\npdfjs-editor-undo-bar-message-freetext = Text removed\npdfjs-editor-undo-bar-message-ink = Drawing removed\npdfjs-editor-undo-bar-message-stamp = Image removed\npdfjs-editor-undo-bar-message-signature = Signature removed\npdfjs-editor-undo-bar-message-multiple =\n { $count ->\n [one] { $count } annotation removed\n *[other] { $count } annotations removed\n }\npdfjs-editor-undo-bar-undo-button =\n .title = Undo\npdfjs-editor-undo-bar-undo-button-label = Undo\npdfjs-editor-undo-bar-close-button =\n .title = Close\npdfjs-editor-undo-bar-close-button-label = Close\npdfjs-editor-add-signature-dialog-label = This modal allows the user to create a signature to add to a PDF document. The user can edit the name (which also serves as the alt text), and optionally save the signature for repeated use.\npdfjs-editor-add-signature-dialog-title = Add a signature\npdfjs-editor-add-signature-type-button = Type\n .title = Type\npdfjs-editor-add-signature-draw-button = Draw\n .title = Draw\npdfjs-editor-add-signature-image-button = Image\n .title = Image\npdfjs-editor-add-signature-type-input =\n .aria-label = Type your signature\n .placeholder = Type your signature\npdfjs-editor-add-signature-draw-placeholder = Draw your signature\npdfjs-editor-add-signature-draw-thickness-range-label = Thickness\npdfjs-editor-add-signature-draw-thickness-range =\n .title = Drawing thickness: { $thickness }\npdfjs-editor-add-signature-image-placeholder = Drag a file here to upload\npdfjs-editor-add-signature-image-browse-link =\n { PLATFORM() ->\n [macos] Or choose image files\n *[other] Or browse image files\n }\npdfjs-editor-add-signature-description-label = Description (alt text)\npdfjs-editor-add-signature-description-input =\n .title = Description (alt text)\npdfjs-editor-add-signature-description-default-when-drawing = Signature\npdfjs-editor-add-signature-clear-button-label = Clear signature\npdfjs-editor-add-signature-clear-button =\n .title = Clear signature\npdfjs-editor-add-signature-save-checkbox = Save signature\npdfjs-editor-add-signature-save-warning-message = You\u2019ve reached the limit of 5 saved signatures. Remove one to save more.\npdfjs-editor-add-signature-image-upload-error-title = Couldn\u2019t upload image\npdfjs-editor-add-signature-image-upload-error-description = Check your network connection or try another image.\npdfjs-editor-add-signature-image-no-data-error-title = Can\u2019t convert this image into a signature\npdfjs-editor-add-signature-image-no-data-error-description = Please try uploading a different image.\npdfjs-editor-add-signature-error-close-button = Close\npdfjs-editor-add-signature-cancel-button = Cancel\npdfjs-editor-add-signature-add-button = Add\npdfjs-editor-delete-signature-button1 =\n .title = Remove saved signature\npdfjs-editor-delete-signature-button-label1 = Remove saved signature\npdfjs-editor-add-signature-edit-button-label = Edit description\npdfjs-editor-edit-signature-dialog-title = Edit description\npdfjs-editor-edit-signature-update-button = Update\npdfjs-show-comment-button =\n .title = Show comment\npdfjs-editor-edit-comment-popup-button-label = Edit comment\npdfjs-editor-edit-comment-popup-button =\n .title = Edit comment\npdfjs-editor-delete-comment-popup-button-label = Remove comment\npdfjs-editor-delete-comment-popup-button =\n .title = Remove comment\npdfjs-editor-edit-comment-dialog-title-when-editing = Edit comment\npdfjs-editor-edit-comment-dialog-save-button-when-editing = Update\npdfjs-editor-edit-comment-dialog-title-when-adding = Add comment\npdfjs-editor-edit-comment-dialog-save-button-when-adding = Add\npdfjs-editor-edit-comment-dialog-text-input =\n .placeholder = Start typing\u2026\npdfjs-editor-edit-comment-dialog-cancel-button = Cancel\npdfjs-editor-add-comment-button =\n .title = Add comment\npdfjs-toggle-views-manager-button =\n .title = Toggle Sidebar\npdfjs-toggle-views-manager-notification-button =\n .title = Toggle Sidebar (document contains thumbnails/outline/attachments/layers)\npdfjs-toggle-views-manager-button-label = Toggle Sidebar\npdfjs-views-manager-sidebar =\n .aria-label = Sidebar\npdfjs-views-manager-view-selector-button =\n .title = Views\npdfjs-views-manager-view-selector-button-label = Views\npdfjs-views-manager-pages-title = Pages\npdfjs-views-manager-outlines-title = Document outline\npdfjs-views-manager-attachments-title = Attachments\npdfjs-views-manager-layers-title = Layers\npdfjs-views-manager-pages-option-label = Pages\npdfjs-views-manager-outlines-option-label = Document outline\npdfjs-views-manager-attachments-option-label = Attachments\npdfjs-views-manager-layers-option-label = Layers\npdfjs-views-manager-add-file-button =\n .title = Add file\npdfjs-views-manager-add-file-button-label = Add file\npdfjs-views-manager-pages-status-action-label =\n { $count ->\n [one] { $count } selected\n *[other] { $count } selected\n }\npdfjs-views-manager-pages-status-none-action-label = Select pages\npdfjs-views-manager-pages-status-action-button-label = Manage\npdfjs-views-manager-pages-status-copy-button-label = Copy\npdfjs-views-manager-pages-status-cut-button-label = Cut\npdfjs-views-manager-pages-status-delete-button-label = Delete\npdfjs-views-manager-pages-status-save-as-button-label = Save as\u2026\npdfjs-views-manager-status-undo-cut-label =\n { $count ->\n [one] 1 page cut\n *[other] { $count } pages cut\n }\npdfjs-views-manager-pages-status-undo-copy-label =\n { $count ->\n [one] 1 page copied\n *[other] { $count } pages copied\n }\npdfjs-views-manager-pages-status-undo-delete-label =\n { $count ->\n [one] 1 page deleted\n *[other] { $count } pages deleted\n }\npdfjs-views-manager-pages-status-waiting-ready-label = Getting your file ready\u2026\npdfjs-views-manager-pages-status-waiting-uploading-label = Uploading file\u2026\npdfjs-views-manager-status-warning-cut-label = Couldn\u2019t cut. Refresh page and try again.\npdfjs-views-manager-status-warning-copy-label = Couldn\u2019t copy. Refresh page and try again.\npdfjs-views-manager-status-warning-delete-label = Couldn\u2019t delete. Refresh page and try again.\npdfjs-views-manager-status-warning-save-label = Couldn\u2019t save. Refresh page and try again.\npdfjs-views-manager-status-undo-button-label = Undo\npdfjs-views-manager-status-close-button =\n .title = Close\npdfjs-views-manager-status-close-button-label = Close";
3159
3164
  return createBundle(lang, text);
3160
3165
  }
3161
3166
  }
@@ -4445,13 +4450,17 @@ class CaretBrowsingMode {
4445
4450
 
4446
4451
  ;// ./web/sidebar.js
4447
4452
 
4453
+ const RESIZE_TIMEOUT = 400;
4448
4454
  class Sidebar {
4449
- #minWidth = 0;
4450
- #maxWidth = 0;
4451
4455
  #initialWidth = 0;
4452
4456
  #width = 0;
4453
4457
  #coefficient;
4454
- #visible = false;
4458
+ #resizeTimeout = null;
4459
+ #resizer;
4460
+ #isResizerOnTheLeft;
4461
+ #isKeyboardResizing = false;
4462
+ #resizeObserver;
4463
+ #prevX = 0;
4455
4464
  constructor({
4456
4465
  sidebar,
4457
4466
  resizer,
@@ -4459,41 +4468,57 @@ class Sidebar {
4459
4468
  }, ltr, isResizerOnTheLeft) {
4460
4469
  this._sidebar = sidebar;
4461
4470
  this.#coefficient = ltr === isResizerOnTheLeft ? -1 : 1;
4471
+ this.#resizer = resizer;
4472
+ this.#isResizerOnTheLeft = isResizerOnTheLeft;
4462
4473
  const style = window.getComputedStyle(sidebar);
4463
- this.#minWidth = parseFloat(style.getPropertyValue("--sidebar-min-width"));
4464
- this.#maxWidth = parseFloat(style.getPropertyValue("--sidebar-max-width"));
4465
4474
  this.#initialWidth = this.#width = parseFloat(style.getPropertyValue("--sidebar-width"));
4466
- this.#makeSidebarResizable(resizer, isResizerOnTheLeft);
4475
+ resizer.ariaValueMin = parseFloat(style.getPropertyValue("--sidebar-min-width"));
4476
+ resizer.ariaValueMax = parseFloat(style.getPropertyValue("--sidebar-max-width"));
4477
+ resizer.ariaValueNow = this.#width;
4478
+ this.#makeSidebarResizable();
4467
4479
  toggleButton.addEventListener("click", this.toggle.bind(this));
4480
+ this._isOpen = false;
4468
4481
  sidebar.hidden = true;
4482
+ this.#resizeObserver = new ResizeObserver(([{
4483
+ borderBoxSize: [{
4484
+ inlineSize
4485
+ }]
4486
+ }]) => {
4487
+ if (!isNaN(this.#prevX)) {
4488
+ this.#prevX += this.#coefficient * (inlineSize - this.#width);
4489
+ }
4490
+ this.#setWidth(inlineSize);
4491
+ });
4492
+ this.#resizeObserver.observe(sidebar);
4469
4493
  }
4470
- #makeSidebarResizable(resizer, isResizerOnTheLeft) {
4471
- resizer.ariaValueMin = this.#minWidth;
4472
- resizer.ariaValueMax = this.#maxWidth;
4473
- resizer.ariaValueNow = this.#width;
4494
+ #makeSidebarResizable() {
4495
+ const sidebarStyle = this._sidebar.style;
4474
4496
  let pointerMoveAC;
4475
4497
  const cancelResize = () => {
4476
- this.#width = MathClamp(this.#width, this.#minWidth, this.#maxWidth);
4498
+ this.#resizeTimeout = null;
4477
4499
  this._sidebar.classList.remove("resizing");
4478
4500
  pointerMoveAC?.abort();
4479
4501
  pointerMoveAC = null;
4502
+ this.#isKeyboardResizing = false;
4503
+ this.onStopResizing();
4504
+ this.#prevX = NaN;
4480
4505
  };
4481
- resizer.addEventListener("pointerdown", e => {
4506
+ this.#resizer.addEventListener("pointerdown", e => {
4482
4507
  if (pointerMoveAC) {
4483
4508
  cancelResize();
4484
4509
  return;
4485
4510
  }
4511
+ this.onStartResizing();
4486
4512
  const {
4487
4513
  clientX
4488
4514
  } = e;
4489
4515
  stopEvent(e);
4490
- let prevX = clientX;
4516
+ this.#prevX = clientX;
4491
4517
  pointerMoveAC = new AbortController();
4492
4518
  const {
4493
4519
  signal
4494
4520
  } = pointerMoveAC;
4495
4521
  const sidebar = this._sidebar;
4496
- const sidebarStyle = sidebar.style;
4497
4522
  sidebar.classList.add("resizing");
4498
4523
  const parentStyle = sidebar.parentElement.style;
4499
4524
  parentStyle.minWidth = 0;
@@ -4505,11 +4530,7 @@ class Sidebar {
4505
4530
  return;
4506
4531
  }
4507
4532
  stopEvent(ev);
4508
- const {
4509
- clientX: x
4510
- } = ev;
4511
- this.#setNewWidth(x - prevX, parentStyle, resizer, sidebarStyle, isResizerOnTheLeft, false);
4512
- prevX = x;
4533
+ sidebarStyle.width = `${Math.round(this.#width + this.#coefficient * (ev.clientX - this.#prevX))}px`;
4513
4534
  }, {
4514
4535
  signal,
4515
4536
  capture: true
@@ -4526,39 +4547,49 @@ class Sidebar {
4526
4547
  signal
4527
4548
  });
4528
4549
  });
4529
- resizer.addEventListener("keydown", e => {
4550
+ this.#resizer.addEventListener("keydown", e => {
4530
4551
  const {
4531
4552
  key
4532
4553
  } = e;
4533
4554
  const isArrowLeft = key === "ArrowLeft";
4534
4555
  if (isArrowLeft || key === "ArrowRight") {
4556
+ if (!this.#isKeyboardResizing) {
4557
+ this._sidebar.classList.add("resizing");
4558
+ this.#isKeyboardResizing = true;
4559
+ this.onStartResizing();
4560
+ }
4535
4561
  const base = e.ctrlKey || e.metaKey ? 10 : 1;
4536
4562
  const dx = base * (isArrowLeft ? -1 : 1);
4537
- this.#setNewWidth(dx, this._sidebar.parentElement.style, resizer, this._sidebar.style, isResizerOnTheLeft, true);
4563
+ clearTimeout(this.#resizeTimeout);
4564
+ this.#resizeTimeout = setTimeout(cancelResize, RESIZE_TIMEOUT);
4565
+ sidebarStyle.width = `${Math.round(this.#width + this.#coefficient * dx)}px`;
4538
4566
  stopEvent(e);
4539
4567
  }
4540
4568
  });
4541
4569
  }
4542
- #setNewWidth(dx, parentStyle, resizer, sidebarStyle, isResizerOnTheLeft, isFromKeyboard) {
4543
- let newWidth = this.#width + this.#coefficient * dx;
4544
- if (!isFromKeyboard) {
4545
- this.#width = newWidth;
4546
- }
4547
- if ((newWidth > this.#maxWidth || newWidth < this.#minWidth) && (this.#width === this.#maxWidth || this.#width === this.#minWidth)) {
4548
- return;
4549
- }
4550
- newWidth = MathClamp(newWidth, this.#minWidth, this.#maxWidth);
4551
- if (isFromKeyboard) {
4552
- this.#width = newWidth;
4553
- }
4554
- resizer.ariaValueNow = Math.round(newWidth);
4555
- sidebarStyle.width = `${newWidth.toFixed(3)}px`;
4556
- if (isResizerOnTheLeft) {
4557
- parentStyle.insetInlineStart = `${(this.#initialWidth - newWidth).toFixed(3)}px`;
4570
+ #setWidth(newWidth) {
4571
+ this.#width = newWidth;
4572
+ this.#resizer.ariaValueNow = Math.round(newWidth);
4573
+ if (this.#isResizerOnTheLeft) {
4574
+ this._sidebar.parentElement.style.insetInlineStart = `${(this.#initialWidth - newWidth).toFixed(3)}px`;
4558
4575
  }
4576
+ this.onResizing(newWidth);
4559
4577
  }
4560
- toggle() {
4561
- this._sidebar.hidden = !(this.#visible = !this.#visible);
4578
+ get width() {
4579
+ return this.#width;
4580
+ }
4581
+ set width(newWidth) {
4582
+ this._sidebar.style.width = `${newWidth}px`;
4583
+ }
4584
+ onStartResizing() {}
4585
+ onStopResizing() {}
4586
+ onResizing(_newWidth) {}
4587
+ toggle(visibility = !this._isOpen) {
4588
+ this._sidebar.hidden = !(this._isOpen = visibility);
4589
+ }
4590
+ destroy() {
4591
+ this.#resizeObserver?.disconnect();
4592
+ this.#resizeObserver = null;
4562
4593
  }
4563
4594
  }
4564
4595
 
@@ -5816,6 +5847,7 @@ class PasswordPrompt {
5816
5847
 
5817
5848
  ;// ./web/base_tree_viewer.js
5818
5849
 
5850
+
5819
5851
  const TREEITEM_OFFSET_TOP = -100;
5820
5852
  const TREEITEM_SELECTED_CLASS = "selected";
5821
5853
  class BaseTreeViewer {
@@ -5829,8 +5861,8 @@ class BaseTreeViewer {
5829
5861
  this._pdfDocument = null;
5830
5862
  this._lastToggleIsShow = true;
5831
5863
  this._currentTreeItem = null;
5832
- this.container.textContent = "";
5833
- this.container.classList.remove("treeWithDeepNesting");
5864
+ this.container.replaceChildren();
5865
+ this.container.classList.remove("withNesting");
5834
5866
  }
5835
5867
  _dispatchEvent(count) {
5836
5868
  throw new Error("Not implemented: _dispatchEvent");
@@ -5847,14 +5879,6 @@ class BaseTreeViewer {
5847
5879
  if (hidden) {
5848
5880
  toggler.classList.add("treeItemsHidden");
5849
5881
  }
5850
- toggler.onclick = evt => {
5851
- evt.stopPropagation();
5852
- toggler.classList.toggle("treeItemsHidden");
5853
- if (evt.shiftKey) {
5854
- const shouldShowAll = !toggler.classList.contains("treeItemsHidden");
5855
- this._toggleTreeItem(div, shouldShowAll);
5856
- }
5857
- };
5858
5882
  div.prepend(toggler);
5859
5883
  }
5860
5884
  _toggleTreeItem(root, show = false) {
@@ -5870,8 +5894,22 @@ class BaseTreeViewer {
5870
5894
  }
5871
5895
  _finishRendering(fragment, count, hasAnyNesting = false) {
5872
5896
  if (hasAnyNesting) {
5873
- this.container.classList.add("treeWithDeepNesting");
5897
+ this.container.classList.add("withNesting");
5874
5898
  this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden");
5899
+ this.container.addEventListener("click", e => {
5900
+ const {
5901
+ target
5902
+ } = e;
5903
+ if (!target.classList.contains("treeItemToggler")) {
5904
+ return;
5905
+ }
5906
+ stopEvent(e);
5907
+ target.classList.toggle("treeItemsHidden");
5908
+ if (e.shiftKey) {
5909
+ const shouldShowAll = !target.classList.contains("treeItemsHidden");
5910
+ this._toggleTreeItem(this.container, shouldShowAll);
5911
+ }
5912
+ });
5875
5913
  }
5876
5914
  this._l10n.pause();
5877
5915
  this.container.append(fragment);
@@ -5972,16 +6010,17 @@ class PDFAttachmentViewer extends BaseTreeViewer {
5972
6010
  return;
5973
6011
  }
5974
6012
  const fragment = document.createDocumentFragment();
6013
+ const ul = document.createElement("ul");
6014
+ fragment.append(ul);
5975
6015
  let attachmentsCount = 0;
5976
6016
  for (const name in attachments) {
5977
6017
  const item = attachments[name];
5978
- const div = document.createElement("div");
5979
- div.className = "treeItem";
6018
+ const li = document.createElement("li");
6019
+ ul.append(li);
5980
6020
  const element = document.createElement("a");
6021
+ li.append(element);
5981
6022
  this._bindLink(element, item);
5982
6023
  element.textContent = this._normalizeTextContent(item.filename);
5983
- div.append(element);
5984
- fragment.append(div);
5985
6024
  attachmentsCount++;
5986
6025
  }
5987
6026
  this._finishRendering(fragment, attachmentsCount);
@@ -6519,7 +6558,7 @@ const CHARACTERS_TO_NORMALIZE = {
6519
6558
  const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]);
6520
6559
  let DIACRITICS_EXCEPTION_STR;
6521
6560
  const DIACRITICS_REG_EXP = /\p{M}+/gu;
6522
- const SPECIAL_CHARS_REG_EXP = /([*+^${}()|[\]\\])|(\p{P}+)|(\s+)|(\p{M})|(\p{L})/gu;
6561
+ const SPECIAL_CHARS_REG_EXP = /([+^$|])|(\p{P}+)|(\s+)|(\p{M})|(\p{L})/gu;
6523
6562
  const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u;
6524
6563
  const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u;
6525
6564
  const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g;
@@ -6929,10 +6968,10 @@ class PDFFindController {
6929
6968
  };
6930
6969
  query = query.replaceAll(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => {
6931
6970
  if (p1) {
6932
- return addExtraWhitespaces(p1, `\\${p1}`);
6971
+ return addExtraWhitespaces(p1, RegExp.escape(p1));
6933
6972
  }
6934
6973
  if (p2) {
6935
- return addExtraWhitespaces(p2, p2.replaceAll(/[.?]/g, "\\$&"));
6974
+ return addExtraWhitespaces(p2, RegExp.escape(p2));
6936
6975
  }
6937
6976
  if (p3) {
6938
6977
  return "[ ]+";
@@ -8020,7 +8059,9 @@ class PDFLayerViewer extends BaseTreeViewer {
8020
8059
  });
8021
8060
  } else {
8022
8061
  const group = optionalContentConfig.getGroup(groupId);
8062
+ const label = document.createElement("label");
8023
8063
  const input = document.createElement("input");
8064
+ label.append(input, document.createTextNode(this._normalizeTextContent(group.name)));
8024
8065
  this._bindLink(element, {
8025
8066
  groupId,
8026
8067
  input
@@ -8031,9 +8072,6 @@ class PDFLayerViewer extends BaseTreeViewer {
8031
8072
  input,
8032
8073
  visible: input.checked
8033
8074
  });
8034
- const label = document.createElement("label");
8035
- label.textContent = this._normalizeTextContent(group.name);
8036
- label.append(input);
8037
8075
  element.append(label);
8038
8076
  layersCount++;
8039
8077
  }
@@ -9473,771 +9511,467 @@ class PDFScriptingManager {
9473
9511
  }
9474
9512
  }
9475
9513
 
9476
- ;// ./web/pdf_sidebar.js
9514
+ ;// ./web/pdf_text_extractor.js
9515
+ class PdfTextExtractor {
9516
+ #pdfViewer;
9517
+ #externalServices;
9518
+ #textPromise;
9519
+ #pendingRequests = new Set();
9520
+ constructor(externalServices) {
9521
+ this.#externalServices = externalServices;
9522
+ window.addEventListener("requestTextContent", ({
9523
+ detail
9524
+ }) => {
9525
+ this.extractTextContent(detail.requestId);
9526
+ });
9527
+ }
9528
+ setViewer(pdfViewer) {
9529
+ this.#pdfViewer = pdfViewer;
9530
+ if (this.#pdfViewer && this.#pendingRequests.size) {
9531
+ for (const pendingRequest of this.#pendingRequests) {
9532
+ this.extractTextContent(pendingRequest);
9533
+ }
9534
+ this.#pendingRequests.clear();
9535
+ }
9536
+ }
9537
+ async extractTextContent(requestId) {
9538
+ if (!this.#pdfViewer) {
9539
+ this.#pendingRequests.add(requestId);
9540
+ return;
9541
+ }
9542
+ if (!this.#textPromise) {
9543
+ const textPromise = this.#textPromise = this.#pdfViewer.getAllText();
9544
+ textPromise.then(() => {
9545
+ setTimeout(() => {
9546
+ if (this.#textPromise === textPromise) {
9547
+ this.#textPromise = null;
9548
+ }
9549
+ }, 5000);
9550
+ });
9551
+ }
9552
+ this.#externalServices.reportText({
9553
+ text: await this.#textPromise,
9554
+ requestId
9555
+ });
9556
+ }
9557
+ }
9558
+
9559
+ ;// ./web/pdf_thumbnail_view.js
9560
+
9477
9561
 
9478
- const SIDEBAR_WIDTH_VAR = "--sidebar-width";
9479
- const SIDEBAR_MIN_WIDTH = 200;
9480
- const SIDEBAR_RESIZING_CLASS = "sidebarResizing";
9481
- const UI_NOTIFICATION_CLASS = "pdfSidebarNotification";
9482
- class PDFSidebar {
9483
- #isRTL = false;
9484
- #mouseAC = null;
9485
- #outerContainerWidth = null;
9486
- #width = null;
9562
+
9563
+ const DRAW_UPSCALE_FACTOR = 2;
9564
+ const MAX_NUM_SCALING_STEPS = 3;
9565
+ const THUMBNAIL_WIDTH = 126;
9566
+ class TempImageFactory {
9567
+ static getCanvas(width, height) {
9568
+ let tempCanvas;
9569
+ if (FeatureTest.isOffscreenCanvasSupported) {
9570
+ tempCanvas = new OffscreenCanvas(width, height);
9571
+ } else {
9572
+ tempCanvas = document.createElement("canvas");
9573
+ tempCanvas.width = width;
9574
+ tempCanvas.height = height;
9575
+ }
9576
+ const ctx = tempCanvas.getContext("2d", {
9577
+ alpha: false
9578
+ });
9579
+ ctx.save();
9580
+ ctx.fillStyle = "rgb(255, 255, 255)";
9581
+ ctx.fillRect(0, 0, width, height);
9582
+ ctx.restore();
9583
+ return [tempCanvas, ctx];
9584
+ }
9585
+ }
9586
+ class PDFThumbnailView {
9487
9587
  constructor({
9488
- elements,
9588
+ container,
9489
9589
  eventBus,
9490
- l10n
9590
+ id,
9591
+ defaultViewport,
9592
+ optionalContentConfigPromise,
9593
+ linkService,
9594
+ renderingQueue,
9595
+ maxCanvasPixels,
9596
+ maxCanvasDim,
9597
+ pageColors
9491
9598
  }) {
9492
- this.isOpen = false;
9493
- this.active = SidebarView.THUMBS;
9494
- this.isInitialViewSet = false;
9495
- this.isInitialEventDispatched = false;
9496
- this.onToggled = null;
9497
- this.onUpdateThumbnails = null;
9498
- this.outerContainer = elements.outerContainer;
9499
- this.sidebarContainer = elements.sidebarContainer;
9500
- this.toggleButton = elements.toggleButton;
9501
- this.resizer = elements.resizer;
9502
- this.thumbnailButton = elements.thumbnailButton;
9503
- this.outlineButton = elements.outlineButton;
9504
- this.attachmentsButton = elements.attachmentsButton;
9505
- this.layersButton = elements.layersButton;
9506
- this.thumbnailView = elements.thumbnailView;
9507
- this.outlineView = elements.outlineView;
9508
- this.attachmentsView = elements.attachmentsView;
9509
- this.layersView = elements.layersView;
9510
- this._currentOutlineItemButton = elements.currentOutlineItemButton;
9599
+ this.id = id;
9600
+ this.renderingId = "thumbnail" + id;
9601
+ this.pageLabel = null;
9602
+ this.pdfPage = null;
9603
+ this.rotation = 0;
9604
+ this.viewport = defaultViewport;
9605
+ this.pdfPageRotate = defaultViewport.rotation;
9606
+ this._optionalContentConfigPromise = optionalContentConfigPromise || null;
9607
+ this.maxCanvasPixels = maxCanvasPixels ?? AppOptions.get("maxCanvasPixels");
9608
+ this.maxCanvasDim = maxCanvasDim || AppOptions.get("maxCanvasDim");
9609
+ this.pageColors = pageColors || null;
9511
9610
  this.eventBus = eventBus;
9512
- this.#isRTL = l10n.getDirection() === "rtl";
9513
- this.#addEventListeners();
9611
+ this.linkService = linkService;
9612
+ this.renderingQueue = renderingQueue;
9613
+ this.renderTask = null;
9614
+ this.renderingState = RenderingStates.INITIAL;
9615
+ this.resume = null;
9616
+ const imageContainer = this.div = document.createElement("div");
9617
+ imageContainer.className = "thumbnail";
9618
+ imageContainer.setAttribute("page-number", this.#pageNumber);
9619
+ const checkbox = this.checkbox = document.createElement("input");
9620
+ checkbox.type = "checkbox";
9621
+ checkbox.tabIndex = -1;
9622
+ const image = this.image = document.createElement("img");
9623
+ image.classList.add("thumbnailImage", "missingThumbnailImage");
9624
+ image.role = "button";
9625
+ image.tabIndex = -1;
9626
+ this.#updateDims();
9627
+ imageContainer.append(checkbox, image);
9628
+ container.append(imageContainer);
9514
9629
  }
9515
- reset() {
9516
- this.isInitialViewSet = false;
9517
- this.isInitialEventDispatched = false;
9518
- this.#hideUINotification(true);
9519
- this.switchView(SidebarView.THUMBS);
9520
- this.outlineButton.disabled = false;
9521
- this.attachmentsButton.disabled = false;
9522
- this.layersButton.disabled = false;
9523
- this._currentOutlineItemButton.disabled = true;
9630
+ #updateDims() {
9631
+ const {
9632
+ width,
9633
+ height
9634
+ } = this.viewport;
9635
+ const ratio = width / height;
9636
+ const canvasWidth = this.canvasWidth = THUMBNAIL_WIDTH;
9637
+ const canvasHeight = this.canvasHeight = canvasWidth / ratio | 0;
9638
+ this.scale = canvasWidth / width;
9639
+ this.image.style.height = `${canvasHeight}px`;
9524
9640
  }
9525
- get visibleView() {
9526
- return this.isOpen ? this.active : SidebarView.NONE;
9641
+ setPdfPage(pdfPage) {
9642
+ this.pdfPage = pdfPage;
9643
+ this.pdfPageRotate = pdfPage.rotate;
9644
+ const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
9645
+ this.viewport = pdfPage.getViewport({
9646
+ scale: 1,
9647
+ rotation: totalRotation
9648
+ });
9649
+ this.reset();
9527
9650
  }
9528
- setInitialView(view = SidebarView.NONE) {
9529
- if (this.isInitialViewSet) {
9530
- return;
9531
- }
9532
- this.isInitialViewSet = true;
9533
- if (view === SidebarView.NONE || view === SidebarView.UNKNOWN) {
9534
- this.#dispatchEvent();
9535
- return;
9536
- }
9537
- this.switchView(view, true);
9538
- if (!this.isInitialEventDispatched) {
9539
- this.#dispatchEvent();
9651
+ reset() {
9652
+ this.cancelRendering();
9653
+ this.renderingState = RenderingStates.INITIAL;
9654
+ this.#updateDims();
9655
+ const {
9656
+ image
9657
+ } = this;
9658
+ const url = image.src;
9659
+ if (url) {
9660
+ URL.revokeObjectURL(url);
9661
+ image.removeAttribute("data-l10n-id");
9662
+ image.removeAttribute("data-l10n-args");
9663
+ image.src = "";
9664
+ this.image.classList.add("missingThumbnailImage");
9540
9665
  }
9541
9666
  }
9542
- switchView(view, forceOpen = false) {
9543
- const isViewChanged = view !== this.active;
9544
- let forceRendering = false;
9545
- switch (view) {
9546
- case SidebarView.NONE:
9547
- if (this.isOpen) {
9548
- this.close();
9549
- }
9550
- return;
9551
- case SidebarView.THUMBS:
9552
- if (this.isOpen && isViewChanged) {
9553
- forceRendering = true;
9554
- }
9555
- break;
9556
- case SidebarView.OUTLINE:
9557
- if (this.outlineButton.disabled) {
9558
- return;
9559
- }
9560
- break;
9561
- case SidebarView.ATTACHMENTS:
9562
- if (this.attachmentsButton.disabled) {
9563
- return;
9564
- }
9565
- break;
9566
- case SidebarView.LAYERS:
9567
- if (this.layersButton.disabled) {
9568
- return;
9569
- }
9570
- break;
9571
- default:
9572
- console.error(`PDFSidebar.switchView: "${view}" is not a valid view.`);
9573
- return;
9574
- }
9575
- this.active = view;
9576
- toggleCheckedBtn(this.thumbnailButton, view === SidebarView.THUMBS, this.thumbnailView);
9577
- toggleCheckedBtn(this.outlineButton, view === SidebarView.OUTLINE, this.outlineView);
9578
- toggleCheckedBtn(this.attachmentsButton, view === SidebarView.ATTACHMENTS, this.attachmentsView);
9579
- toggleCheckedBtn(this.layersButton, view === SidebarView.LAYERS, this.layersView);
9580
- if (forceOpen && !this.isOpen) {
9581
- this.open();
9582
- return;
9583
- }
9584
- if (forceRendering) {
9585
- this.onUpdateThumbnails();
9586
- this.onToggled();
9587
- }
9588
- if (isViewChanged) {
9589
- this.#dispatchEvent();
9667
+ update({
9668
+ rotation = null
9669
+ }) {
9670
+ if (typeof rotation === "number") {
9671
+ this.rotation = rotation;
9590
9672
  }
9673
+ const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
9674
+ this.viewport = this.viewport.clone({
9675
+ scale: 1,
9676
+ rotation: totalRotation
9677
+ });
9678
+ this.reset();
9591
9679
  }
9592
- open() {
9593
- if (this.isOpen) {
9594
- return;
9595
- }
9596
- this.isOpen = true;
9597
- toggleExpandedBtn(this.toggleButton, true);
9598
- this.outerContainer.classList.add("sidebarMoving", "sidebarOpen");
9599
- if (this.active === SidebarView.THUMBS) {
9600
- this.onUpdateThumbnails();
9680
+ toggleCurrent(isCurrent) {
9681
+ if (isCurrent) {
9682
+ this.image.ariaCurrent = "page";
9683
+ this.image.tabIndex = 0;
9684
+ } else {
9685
+ this.image.ariaCurrent = false;
9686
+ this.image.tabIndex = -1;
9601
9687
  }
9602
- this.onToggled();
9603
- this.#dispatchEvent();
9604
- this.#hideUINotification();
9605
9688
  }
9606
- close(evt = null) {
9607
- if (!this.isOpen) {
9608
- return;
9609
- }
9610
- this.isOpen = false;
9611
- toggleExpandedBtn(this.toggleButton, false);
9612
- this.outerContainer.classList.add("sidebarMoving");
9613
- this.outerContainer.classList.remove("sidebarOpen");
9614
- this.onToggled();
9615
- this.#dispatchEvent();
9616
- if (evt?.detail > 0) {
9617
- this.toggleButton.blur();
9689
+ cancelRendering() {
9690
+ if (this.renderTask) {
9691
+ this.renderTask.cancel();
9692
+ this.renderTask = null;
9618
9693
  }
9694
+ this.resume = null;
9619
9695
  }
9620
- toggle(evt = null) {
9621
- if (this.isOpen) {
9622
- this.close(evt);
9623
- } else {
9624
- this.open();
9625
- }
9696
+ #getPageDrawContext(upscaleFactor = 1) {
9697
+ const outputScale = new OutputScale();
9698
+ const width = upscaleFactor * this.canvasWidth,
9699
+ height = upscaleFactor * this.canvasHeight;
9700
+ outputScale.limitCanvas(width, height, this.maxCanvasPixels, this.maxCanvasDim);
9701
+ const canvas = document.createElement("canvas");
9702
+ canvas.width = width * outputScale.sx | 0;
9703
+ canvas.height = height * outputScale.sy | 0;
9704
+ const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;
9705
+ return {
9706
+ canvas,
9707
+ transform
9708
+ };
9626
9709
  }
9627
- #dispatchEvent() {
9628
- if (this.isInitialViewSet) {
9629
- this.isInitialEventDispatched ||= true;
9710
+ async #convertCanvasToImage(canvas) {
9711
+ if (this.renderingState !== RenderingStates.FINISHED) {
9712
+ throw new Error("#convertCanvasToImage: Rendering has not finished.");
9630
9713
  }
9631
- this.eventBus.dispatch("sidebarviewchanged", {
9632
- source: this,
9633
- view: this.visibleView
9634
- });
9635
- }
9636
- #showUINotification() {
9637
- this.toggleButton.setAttribute("data-l10n-id", "pdfjs-toggle-sidebar-notification-button");
9638
- if (!this.isOpen) {
9639
- this.toggleButton.classList.add(UI_NOTIFICATION_CLASS);
9714
+ const reducedCanvas = this.#reduceImage(canvas);
9715
+ const {
9716
+ image
9717
+ } = this;
9718
+ const {
9719
+ promise,
9720
+ resolve
9721
+ } = Promise.withResolvers();
9722
+ reducedCanvas.toBlob(resolve);
9723
+ const blob = await promise;
9724
+ image.src = URL.createObjectURL(blob);
9725
+ image.setAttribute("data-l10n-id", "pdfjs-thumb-page-canvas");
9726
+ image.setAttribute("data-l10n-args", this.#pageL10nArgs);
9727
+ image.classList.remove("missingThumbnailImage");
9728
+ if (!FeatureTest.isOffscreenCanvasSupported) {
9729
+ reducedCanvas.width = reducedCanvas.height = 0;
9640
9730
  }
9641
9731
  }
9642
- #hideUINotification(reset = false) {
9643
- if (this.isOpen || reset) {
9644
- this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS);
9645
- }
9646
- if (reset) {
9647
- this.toggleButton.setAttribute("data-l10n-id", "pdfjs-toggle-sidebar-button");
9732
+ async draw() {
9733
+ if (this.renderingState !== RenderingStates.INITIAL) {
9734
+ console.error("Must be in new state before drawing");
9735
+ return;
9648
9736
  }
9649
- }
9650
- #addEventListeners() {
9651
9737
  const {
9652
- eventBus,
9653
- outerContainer
9738
+ pageColors,
9739
+ pdfPage
9654
9740
  } = this;
9655
- this.sidebarContainer.addEventListener("transitionend", evt => {
9656
- if (evt.target === this.sidebarContainer) {
9657
- outerContainer.classList.remove("sidebarMoving");
9658
- eventBus.dispatch("resize", {
9659
- source: this
9660
- });
9661
- }
9662
- });
9663
- this.toggleButton.addEventListener("click", evt => {
9664
- this.toggle(evt);
9665
- });
9666
- this.thumbnailButton.addEventListener("click", () => {
9667
- this.switchView(SidebarView.THUMBS);
9668
- });
9669
- this.outlineButton.addEventListener("click", () => {
9670
- this.switchView(SidebarView.OUTLINE);
9671
- });
9672
- this.outlineButton.addEventListener("dblclick", () => {
9673
- eventBus.dispatch("toggleoutlinetree", {
9674
- source: this
9675
- });
9676
- });
9677
- this.attachmentsButton.addEventListener("click", () => {
9678
- this.switchView(SidebarView.ATTACHMENTS);
9679
- });
9680
- this.layersButton.addEventListener("click", () => {
9681
- this.switchView(SidebarView.LAYERS);
9682
- });
9683
- this.layersButton.addEventListener("dblclick", () => {
9684
- eventBus.dispatch("resetlayers", {
9685
- source: this
9686
- });
9687
- });
9688
- this._currentOutlineItemButton.addEventListener("click", () => {
9689
- eventBus.dispatch("currentoutlineitem", {
9690
- source: this
9691
- });
9692
- });
9693
- const onTreeLoaded = (count, button, view) => {
9694
- button.disabled = !count;
9695
- if (count) {
9696
- this.#showUINotification();
9697
- } else if (this.active === view) {
9698
- this.switchView(SidebarView.THUMBS);
9699
- }
9700
- };
9701
- eventBus._on("outlineloaded", evt => {
9702
- onTreeLoaded(evt.outlineCount, this.outlineButton, SidebarView.OUTLINE);
9703
- evt.currentOutlineItemPromise.then(enabled => {
9704
- if (!this.isInitialViewSet) {
9705
- return;
9706
- }
9707
- this._currentOutlineItemButton.disabled = !enabled;
9708
- });
9709
- });
9710
- eventBus._on("attachmentsloaded", evt => {
9711
- onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, SidebarView.ATTACHMENTS);
9712
- });
9713
- eventBus._on("layersloaded", evt => {
9714
- onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS);
9715
- });
9716
- eventBus._on("presentationmodechanged", evt => {
9717
- if (evt.state === PresentationModeState.NORMAL && this.visibleView === SidebarView.THUMBS) {
9718
- this.onUpdateThumbnails();
9719
- }
9720
- });
9721
- this.resizer.addEventListener("mousedown", evt => {
9722
- if (evt.button !== 0) {
9723
- return;
9724
- }
9725
- outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
9726
- this.#mouseAC = new AbortController();
9727
- const opts = {
9728
- signal: this.#mouseAC.signal
9729
- };
9730
- window.addEventListener("mousemove", this.#mouseMove.bind(this), opts);
9731
- window.addEventListener("mouseup", this.#mouseUp.bind(this), opts);
9732
- window.addEventListener("blur", this.#mouseUp.bind(this), opts);
9741
+ if (!pdfPage) {
9742
+ this.renderingState = RenderingStates.FINISHED;
9743
+ throw new Error("pdfPage is not loaded");
9744
+ }
9745
+ this.renderingState = RenderingStates.RUNNING;
9746
+ const {
9747
+ canvas,
9748
+ transform
9749
+ } = this.#getPageDrawContext(DRAW_UPSCALE_FACTOR);
9750
+ const drawViewport = this.viewport.clone({
9751
+ scale: DRAW_UPSCALE_FACTOR * this.scale
9733
9752
  });
9734
- eventBus._on("resize", evt => {
9735
- if (evt.source !== window) {
9753
+ const renderContinueCallback = cont => {
9754
+ if (!this.renderingQueue.isHighestPriority(this)) {
9755
+ this.renderingState = RenderingStates.PAUSED;
9756
+ this.resume = () => {
9757
+ this.renderingState = RenderingStates.RUNNING;
9758
+ cont();
9759
+ };
9736
9760
  return;
9737
9761
  }
9738
- this.#outerContainerWidth = null;
9739
- if (!this.#width) {
9762
+ cont();
9763
+ };
9764
+ const renderContext = {
9765
+ canvas,
9766
+ transform,
9767
+ viewport: drawViewport,
9768
+ optionalContentConfigPromise: this._optionalContentConfigPromise,
9769
+ pageColors
9770
+ };
9771
+ const renderTask = this.renderTask = pdfPage.render(renderContext);
9772
+ renderTask.onContinue = renderContinueCallback;
9773
+ let error = null;
9774
+ try {
9775
+ await renderTask.promise;
9776
+ } catch (e) {
9777
+ if (e instanceof RenderingCancelledException) {
9740
9778
  return;
9741
9779
  }
9742
- if (!this.isOpen) {
9743
- this.#updateWidth(this.#width);
9744
- return;
9780
+ error = e;
9781
+ } finally {
9782
+ if (renderTask === this.renderTask) {
9783
+ this.renderTask = null;
9745
9784
  }
9746
- outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
9747
- const updated = this.#updateWidth(this.#width);
9748
- Promise.resolve().then(() => {
9749
- outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);
9750
- if (updated) {
9751
- eventBus.dispatch("resize", {
9752
- source: this
9753
- });
9754
- }
9755
- });
9785
+ }
9786
+ this.renderingState = RenderingStates.FINISHED;
9787
+ await this.#convertCanvasToImage(canvas);
9788
+ this.eventBus.dispatch("thumbnailrendered", {
9789
+ source: this,
9790
+ pageNumber: this.id,
9791
+ pdfPage
9756
9792
  });
9793
+ if (error) {
9794
+ throw error;
9795
+ }
9757
9796
  }
9758
- get outerContainerWidth() {
9759
- return this.#outerContainerWidth ||= this.outerContainer.clientWidth;
9760
- }
9761
- #updateWidth(width = 0) {
9762
- const maxWidth = Math.floor(this.outerContainerWidth / 2);
9763
- if (width > maxWidth) {
9764
- width = maxWidth;
9797
+ setImage(pageView) {
9798
+ if (this.renderingState !== RenderingStates.INITIAL) {
9799
+ return;
9800
+ }
9801
+ const {
9802
+ thumbnailCanvas: canvas,
9803
+ pdfPage,
9804
+ scale
9805
+ } = pageView;
9806
+ if (!canvas) {
9807
+ return;
9765
9808
  }
9766
- if (width < SIDEBAR_MIN_WIDTH) {
9767
- width = SIDEBAR_MIN_WIDTH;
9809
+ if (!this.pdfPage) {
9810
+ this.setPdfPage(pdfPage);
9768
9811
  }
9769
- if (width === this.#width) {
9770
- return false;
9812
+ if (scale < this.scale) {
9813
+ return;
9771
9814
  }
9772
- this.#width = width;
9773
- docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`);
9774
- return true;
9815
+ this.renderingState = RenderingStates.FINISHED;
9816
+ this.#convertCanvasToImage(canvas);
9817
+ }
9818
+ #getReducedImageDims(canvas) {
9819
+ const width = canvas.width << MAX_NUM_SCALING_STEPS,
9820
+ height = canvas.height << MAX_NUM_SCALING_STEPS;
9821
+ const outputScale = new OutputScale();
9822
+ outputScale.sx = outputScale.sy = 1;
9823
+ outputScale.limitCanvas(width, height, this.maxCanvasPixels, this.maxCanvasDim);
9824
+ return [width * outputScale.sx | 0, height * outputScale.sy | 0];
9775
9825
  }
9776
- #mouseMove(evt) {
9777
- let width = evt.clientX;
9778
- if (this.#isRTL) {
9779
- width = this.outerContainerWidth - width;
9826
+ #reduceImage(img) {
9827
+ const {
9828
+ canvas
9829
+ } = this.#getPageDrawContext(1);
9830
+ const ctx = canvas.getContext("2d", {
9831
+ alpha: false,
9832
+ willReadFrequently: false
9833
+ });
9834
+ if (img.width <= 2 * canvas.width) {
9835
+ ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);
9836
+ return canvas;
9837
+ }
9838
+ let [reducedWidth, reducedHeight] = this.#getReducedImageDims(canvas);
9839
+ const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(reducedWidth, reducedHeight);
9840
+ while (reducedWidth > img.width || reducedHeight > img.height) {
9841
+ reducedWidth >>= 1;
9842
+ reducedHeight >>= 1;
9843
+ }
9844
+ reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight);
9845
+ while (reducedWidth > 2 * canvas.width) {
9846
+ reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1);
9847
+ reducedWidth >>= 1;
9848
+ reducedHeight >>= 1;
9780
9849
  }
9781
- this.#updateWidth(width);
9850
+ ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height);
9851
+ return canvas;
9782
9852
  }
9783
- #mouseUp(evt) {
9784
- this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);
9785
- this.eventBus.dispatch("resize", {
9786
- source: this
9853
+ get #pageL10nArgs() {
9854
+ return JSON.stringify({
9855
+ page: this.pageLabel ?? this.id
9787
9856
  });
9788
- this.#mouseAC?.abort();
9789
- this.#mouseAC = null;
9790
9857
  }
9791
- }
9792
-
9793
- ;// ./web/pdf_text_extractor.js
9794
- class PdfTextExtractor {
9795
- #pdfViewer;
9796
- #externalServices;
9797
- #textPromise;
9798
- #pendingRequests = new Set();
9799
- constructor(externalServices) {
9800
- this.#externalServices = externalServices;
9801
- window.addEventListener("requestTextContent", ({
9802
- detail
9803
- }) => {
9804
- this.extractTextContent(detail.requestId);
9805
- });
9806
- }
9807
- setViewer(pdfViewer) {
9808
- this.#pdfViewer = pdfViewer;
9809
- if (this.#pdfViewer && this.#pendingRequests.size) {
9810
- for (const pendingRequest of this.#pendingRequests) {
9811
- this.extractTextContent(pendingRequest);
9812
- }
9813
- this.#pendingRequests.clear();
9814
- }
9858
+ get #pageNumber() {
9859
+ return this.pageLabel ?? this.id;
9815
9860
  }
9816
- async extractTextContent(requestId) {
9817
- if (!this.#pdfViewer) {
9818
- this.#pendingRequests.add(requestId);
9819
- return;
9820
- }
9821
- if (!this.#textPromise) {
9822
- const textPromise = this.#textPromise = this.#pdfViewer.getAllText();
9823
- textPromise.then(() => {
9824
- setTimeout(() => {
9825
- if (this.#textPromise === textPromise) {
9826
- this.#textPromise = null;
9827
- }
9828
- }, 5000);
9829
- });
9830
- }
9831
- this.#externalServices.reportText({
9832
- text: await this.#textPromise,
9833
- requestId
9834
- });
9861
+ setPageLabel(label) {
9862
+ this.pageLabel = typeof label === "string" ? label : null;
9863
+ this.image.setAttribute("data-l10n-args", this.#pageL10nArgs);
9835
9864
  }
9836
9865
  }
9837
9866
 
9838
- ;// ./web/pdf_thumbnail_view.js
9867
+ ;// ./web/pdf_thumbnail_viewer.js
9839
9868
 
9840
9869
 
9841
9870
 
9842
- const DRAW_UPSCALE_FACTOR = 2;
9843
- const MAX_NUM_SCALING_STEPS = 3;
9844
- const THUMBNAIL_WIDTH = 98;
9845
- class TempImageFactory {
9846
- static getCanvas(width, height) {
9847
- let tempCanvas;
9848
- if (FeatureTest.isOffscreenCanvasSupported) {
9849
- tempCanvas = new OffscreenCanvas(width, height);
9850
- } else {
9851
- tempCanvas = document.createElement("canvas");
9852
- tempCanvas.width = width;
9853
- tempCanvas.height = height;
9854
- }
9855
- const ctx = tempCanvas.getContext("2d", {
9856
- alpha: false
9857
- });
9858
- ctx.save();
9859
- ctx.fillStyle = "rgb(255, 255, 255)";
9860
- ctx.fillRect(0, 0, width, height);
9861
- ctx.restore();
9862
- return [tempCanvas, ctx];
9863
- }
9864
- }
9865
- class PDFThumbnailView {
9871
+ const SCROLL_OPTIONS = {
9872
+ behavior: "instant",
9873
+ block: "nearest",
9874
+ inline: "nearest",
9875
+ container: "nearest"
9876
+ };
9877
+ class PDFThumbnailViewer {
9866
9878
  constructor({
9867
9879
  container,
9868
9880
  eventBus,
9869
- id,
9870
- defaultViewport,
9871
- optionalContentConfigPromise,
9872
9881
  linkService,
9873
9882
  renderingQueue,
9874
9883
  maxCanvasPixels,
9875
9884
  maxCanvasDim,
9876
- pageColors
9885
+ pageColors,
9886
+ abortSignal,
9887
+ enableHWA
9877
9888
  }) {
9878
- this.id = id;
9879
- this.renderingId = "thumbnail" + id;
9880
- this.pageLabel = null;
9881
- this.pdfPage = null;
9882
- this.rotation = 0;
9883
- this.viewport = defaultViewport;
9884
- this.pdfPageRotate = defaultViewport.rotation;
9885
- this._optionalContentConfigPromise = optionalContentConfigPromise || null;
9886
- this.maxCanvasPixels = maxCanvasPixels ?? AppOptions.get("maxCanvasPixels");
9887
- this.maxCanvasDim = maxCanvasDim || AppOptions.get("maxCanvasDim");
9888
- this.pageColors = pageColors || null;
9889
+ this.scrollableContainer = container.parentElement;
9890
+ this.container = container;
9889
9891
  this.eventBus = eventBus;
9890
9892
  this.linkService = linkService;
9891
9893
  this.renderingQueue = renderingQueue;
9892
- this.renderTask = null;
9893
- this.renderingState = RenderingStates.INITIAL;
9894
- this.resume = null;
9895
- const anchor = this.anchor = document.createElement("a");
9896
- anchor.href = linkService.getAnchorUrl(`#page=${id}`);
9897
- anchor.setAttribute("data-l10n-id", "pdfjs-thumb-page-title");
9898
- anchor.setAttribute("data-l10n-args", this.#pageL10nArgs);
9899
- anchor.onclick = () => {
9900
- linkService.goToPage(id);
9901
- return false;
9902
- };
9903
- const div = this.div = document.createElement("div");
9904
- div.classList.add("thumbnail", "missingThumbnailImage");
9905
- div.setAttribute("data-page-number", this.id);
9906
- this.#updateDims();
9907
- const image = this.image = document.createElement("img");
9908
- image.className = "thumbnailImage";
9909
- div.append(image);
9910
- anchor.append(div);
9911
- container.append(anchor);
9894
+ this.maxCanvasPixels = maxCanvasPixels;
9895
+ this.maxCanvasDim = maxCanvasDim;
9896
+ this.pageColors = pageColors || null;
9897
+ this.enableHWA = enableHWA || false;
9898
+ this.scroll = watchScroll(this.scrollableContainer, this.#scrollUpdated.bind(this), abortSignal);
9899
+ this.#resetView();
9900
+ this.#addEventListeners();
9912
9901
  }
9913
- #updateDims() {
9914
- const {
9915
- width,
9916
- height
9917
- } = this.viewport;
9918
- const ratio = width / height;
9919
- const canvasWidth = this.canvasWidth = THUMBNAIL_WIDTH;
9920
- const canvasHeight = this.canvasHeight = canvasWidth / ratio | 0;
9921
- this.scale = canvasWidth / width;
9922
- this.div.style.height = `${canvasHeight}px`;
9902
+ #scrollUpdated() {
9903
+ this.renderingQueue.renderHighestPriority();
9923
9904
  }
9924
- setPdfPage(pdfPage) {
9925
- this.pdfPage = pdfPage;
9926
- this.pdfPageRotate = pdfPage.rotate;
9927
- const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
9928
- this.viewport = pdfPage.getViewport({
9929
- scale: 1,
9930
- rotation: totalRotation
9905
+ getThumbnail(index) {
9906
+ return this._thumbnails[index];
9907
+ }
9908
+ #getVisibleThumbs() {
9909
+ return getVisibleElements({
9910
+ scrollEl: this.scrollableContainer,
9911
+ views: this._thumbnails
9931
9912
  });
9932
- this.reset();
9933
9913
  }
9934
- reset() {
9935
- this.cancelRendering();
9936
- this.renderingState = RenderingStates.INITIAL;
9937
- this.#updateDims();
9938
- const {
9939
- image
9940
- } = this;
9941
- const url = image.src;
9942
- if (url) {
9943
- URL.revokeObjectURL(url);
9944
- image.removeAttribute("data-l10n-id");
9945
- image.removeAttribute("data-l10n-args");
9946
- image.src = "";
9947
- this.div.classList.add("missingThumbnailImage");
9914
+ scrollThumbnailIntoView(pageNumber) {
9915
+ if (!this.pdfDocument) {
9916
+ return;
9948
9917
  }
9949
- }
9950
- update({
9951
- rotation = null
9952
- }) {
9953
- if (typeof rotation === "number") {
9954
- this.rotation = rotation;
9918
+ const thumbnailView = this._thumbnails[pageNumber - 1];
9919
+ if (!thumbnailView) {
9920
+ console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');
9921
+ return;
9955
9922
  }
9956
- const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
9957
- this.viewport = this.viewport.clone({
9958
- scale: 1,
9959
- rotation: totalRotation
9960
- });
9961
- this.reset();
9962
- }
9963
- cancelRendering() {
9964
- if (this.renderTask) {
9965
- this.renderTask.cancel();
9966
- this.renderTask = null;
9923
+ if (pageNumber !== this._currentPageNumber) {
9924
+ const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1];
9925
+ prevThumbnailView.toggleCurrent(false);
9926
+ thumbnailView.toggleCurrent(true);
9927
+ this._currentPageNumber = pageNumber;
9967
9928
  }
9968
- this.resume = null;
9929
+ const {
9930
+ first,
9931
+ last,
9932
+ views
9933
+ } = this.#getVisibleThumbs();
9934
+ if (views.length > 0) {
9935
+ let shouldScroll = false;
9936
+ if (pageNumber <= first.id || pageNumber >= last.id) {
9937
+ shouldScroll = true;
9938
+ } else {
9939
+ for (const {
9940
+ id,
9941
+ percent
9942
+ } of views) {
9943
+ if (id !== pageNumber) {
9944
+ continue;
9945
+ }
9946
+ shouldScroll = percent < 100;
9947
+ break;
9948
+ }
9949
+ }
9950
+ if (shouldScroll) {
9951
+ thumbnailView.div.scrollIntoView(SCROLL_OPTIONS);
9952
+ }
9953
+ }
9954
+ this._currentPageNumber = pageNumber;
9969
9955
  }
9970
- #getPageDrawContext(upscaleFactor = 1) {
9971
- const outputScale = new OutputScale();
9972
- const width = upscaleFactor * this.canvasWidth,
9973
- height = upscaleFactor * this.canvasHeight;
9974
- outputScale.limitCanvas(width, height, this.maxCanvasPixels, this.maxCanvasDim);
9975
- const canvas = document.createElement("canvas");
9976
- canvas.width = width * outputScale.sx | 0;
9977
- canvas.height = height * outputScale.sy | 0;
9978
- const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;
9979
- return {
9980
- canvas,
9981
- transform
9982
- };
9956
+ get pagesRotation() {
9957
+ return this._pagesRotation;
9983
9958
  }
9984
- async #convertCanvasToImage(canvas) {
9985
- if (this.renderingState !== RenderingStates.FINISHED) {
9986
- throw new Error("#convertCanvasToImage: Rendering has not finished.");
9959
+ set pagesRotation(rotation) {
9960
+ if (!isValidRotation(rotation)) {
9961
+ throw new Error("Invalid thumbnails rotation angle.");
9987
9962
  }
9988
- const reducedCanvas = this.#reduceImage(canvas);
9989
- const {
9990
- image
9991
- } = this;
9992
- const {
9993
- promise,
9994
- resolve
9995
- } = Promise.withResolvers();
9996
- reducedCanvas.toBlob(resolve);
9997
- const blob = await promise;
9998
- image.src = URL.createObjectURL(blob);
9999
- image.setAttribute("data-l10n-id", "pdfjs-thumb-page-canvas");
10000
- image.setAttribute("data-l10n-args", this.#pageL10nArgs);
10001
- this.div.classList.remove("missingThumbnailImage");
10002
- if (!FeatureTest.isOffscreenCanvasSupported) {
10003
- reducedCanvas.width = reducedCanvas.height = 0;
9963
+ if (!this.pdfDocument) {
9964
+ return;
10004
9965
  }
10005
- }
10006
- async draw() {
10007
- if (this.renderingState !== RenderingStates.INITIAL) {
10008
- console.error("Must be in new state before drawing");
9966
+ if (this._pagesRotation === rotation) {
10009
9967
  return;
10010
9968
  }
10011
- const {
10012
- pageColors,
10013
- pdfPage
10014
- } = this;
10015
- if (!pdfPage) {
10016
- this.renderingState = RenderingStates.FINISHED;
10017
- throw new Error("pdfPage is not loaded");
10018
- }
10019
- this.renderingState = RenderingStates.RUNNING;
10020
- const {
10021
- canvas,
10022
- transform
10023
- } = this.#getPageDrawContext(DRAW_UPSCALE_FACTOR);
10024
- const drawViewport = this.viewport.clone({
10025
- scale: DRAW_UPSCALE_FACTOR * this.scale
10026
- });
10027
- const renderContinueCallback = cont => {
10028
- if (!this.renderingQueue.isHighestPriority(this)) {
10029
- this.renderingState = RenderingStates.PAUSED;
10030
- this.resume = () => {
10031
- this.renderingState = RenderingStates.RUNNING;
10032
- cont();
10033
- };
10034
- return;
10035
- }
10036
- cont();
10037
- };
10038
- const renderContext = {
10039
- canvas,
10040
- transform,
10041
- viewport: drawViewport,
10042
- optionalContentConfigPromise: this._optionalContentConfigPromise,
10043
- pageColors
10044
- };
10045
- const renderTask = this.renderTask = pdfPage.render(renderContext);
10046
- renderTask.onContinue = renderContinueCallback;
10047
- let error = null;
10048
- try {
10049
- await renderTask.promise;
10050
- } catch (e) {
10051
- if (e instanceof RenderingCancelledException) {
10052
- return;
10053
- }
10054
- error = e;
10055
- } finally {
10056
- if (renderTask === this.renderTask) {
10057
- this.renderTask = null;
10058
- }
10059
- }
10060
- this.renderingState = RenderingStates.FINISHED;
10061
- await this.#convertCanvasToImage(canvas);
10062
- this.eventBus.dispatch("thumbnailrendered", {
10063
- source: this,
10064
- pageNumber: this.id,
10065
- pdfPage
10066
- });
10067
- if (error) {
10068
- throw error;
10069
- }
10070
- }
10071
- setImage(pageView) {
10072
- if (this.renderingState !== RenderingStates.INITIAL) {
10073
- return;
10074
- }
10075
- const {
10076
- thumbnailCanvas: canvas,
10077
- pdfPage,
10078
- scale
10079
- } = pageView;
10080
- if (!canvas) {
10081
- return;
10082
- }
10083
- if (!this.pdfPage) {
10084
- this.setPdfPage(pdfPage);
10085
- }
10086
- if (scale < this.scale) {
10087
- return;
10088
- }
10089
- this.renderingState = RenderingStates.FINISHED;
10090
- this.#convertCanvasToImage(canvas);
10091
- }
10092
- #getReducedImageDims(canvas) {
10093
- const width = canvas.width << MAX_NUM_SCALING_STEPS,
10094
- height = canvas.height << MAX_NUM_SCALING_STEPS;
10095
- const outputScale = new OutputScale();
10096
- outputScale.sx = outputScale.sy = 1;
10097
- outputScale.limitCanvas(width, height, this.maxCanvasPixels, this.maxCanvasDim);
10098
- return [width * outputScale.sx | 0, height * outputScale.sy | 0];
10099
- }
10100
- #reduceImage(img) {
10101
- const {
10102
- canvas
10103
- } = this.#getPageDrawContext(1);
10104
- const ctx = canvas.getContext("2d", {
10105
- alpha: false,
10106
- willReadFrequently: false
10107
- });
10108
- if (img.width <= 2 * canvas.width) {
10109
- ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);
10110
- return canvas;
10111
- }
10112
- let [reducedWidth, reducedHeight] = this.#getReducedImageDims(canvas);
10113
- const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(reducedWidth, reducedHeight);
10114
- while (reducedWidth > img.width || reducedHeight > img.height) {
10115
- reducedWidth >>= 1;
10116
- reducedHeight >>= 1;
10117
- }
10118
- reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight);
10119
- while (reducedWidth > 2 * canvas.width) {
10120
- reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1);
10121
- reducedWidth >>= 1;
10122
- reducedHeight >>= 1;
10123
- }
10124
- ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height);
10125
- return canvas;
10126
- }
10127
- get #pageL10nArgs() {
10128
- return JSON.stringify({
10129
- page: this.pageLabel ?? this.id
10130
- });
10131
- }
10132
- setPageLabel(label) {
10133
- this.pageLabel = typeof label === "string" ? label : null;
10134
- this.anchor.setAttribute("data-l10n-args", this.#pageL10nArgs);
10135
- this.image.setAttribute("data-l10n-args", this.#pageL10nArgs);
10136
- }
10137
- }
10138
-
10139
- ;// ./web/pdf_thumbnail_viewer.js
10140
-
10141
-
10142
- const THUMBNAIL_SCROLL_MARGIN = -19;
10143
- const THUMBNAIL_SELECTED_CLASS = "selected";
10144
- class PDFThumbnailViewer {
10145
- constructor({
10146
- container,
10147
- eventBus,
10148
- linkService,
10149
- renderingQueue,
10150
- maxCanvasPixels,
10151
- maxCanvasDim,
10152
- pageColors,
10153
- abortSignal,
10154
- enableHWA
10155
- }) {
10156
- this.container = container;
10157
- this.eventBus = eventBus;
10158
- this.linkService = linkService;
10159
- this.renderingQueue = renderingQueue;
10160
- this.maxCanvasPixels = maxCanvasPixels;
10161
- this.maxCanvasDim = maxCanvasDim;
10162
- this.pageColors = pageColors || null;
10163
- this.enableHWA = enableHWA || false;
10164
- this.scroll = watchScroll(this.container, this.#scrollUpdated.bind(this), abortSignal);
10165
- this.#resetView();
10166
- }
10167
- #scrollUpdated() {
10168
- this.renderingQueue.renderHighestPriority();
10169
- }
10170
- getThumbnail(index) {
10171
- return this._thumbnails[index];
10172
- }
10173
- #getVisibleThumbs() {
10174
- return getVisibleElements({
10175
- scrollEl: this.container,
10176
- views: this._thumbnails
10177
- });
10178
- }
10179
- scrollThumbnailIntoView(pageNumber) {
10180
- if (!this.pdfDocument) {
10181
- return;
10182
- }
10183
- const thumbnailView = this._thumbnails[pageNumber - 1];
10184
- if (!thumbnailView) {
10185
- console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');
10186
- return;
10187
- }
10188
- if (pageNumber !== this._currentPageNumber) {
10189
- const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1];
10190
- prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS);
10191
- thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
10192
- }
10193
- const {
10194
- first,
10195
- last,
10196
- views
10197
- } = this.#getVisibleThumbs();
10198
- if (views.length > 0) {
10199
- let shouldScroll = false;
10200
- if (pageNumber <= first.id || pageNumber >= last.id) {
10201
- shouldScroll = true;
10202
- } else {
10203
- for (const {
10204
- id,
10205
- percent
10206
- } of views) {
10207
- if (id !== pageNumber) {
10208
- continue;
10209
- }
10210
- shouldScroll = percent < 100;
10211
- break;
10212
- }
10213
- }
10214
- if (shouldScroll) {
10215
- scrollIntoView(thumbnailView.div, {
10216
- top: THUMBNAIL_SCROLL_MARGIN
10217
- });
10218
- }
10219
- }
10220
- this._currentPageNumber = pageNumber;
10221
- }
10222
- get pagesRotation() {
10223
- return this._pagesRotation;
10224
- }
10225
- set pagesRotation(rotation) {
10226
- if (!isValidRotation(rotation)) {
10227
- throw new Error("Invalid thumbnails rotation angle.");
10228
- }
10229
- if (!this.pdfDocument) {
10230
- return;
10231
- }
10232
- if (this._pagesRotation === rotation) {
10233
- return;
10234
- }
10235
- this._pagesRotation = rotation;
10236
- const updateArgs = {
10237
- rotation
10238
- };
10239
- for (const thumbnail of this._thumbnails) {
10240
- thumbnail.update(updateArgs);
9969
+ this._pagesRotation = rotation;
9970
+ const updateArgs = {
9971
+ rotation
9972
+ };
9973
+ for (const thumbnail of this._thumbnails) {
9974
+ thumbnail.update(updateArgs);
10241
9975
  }
10242
9976
  }
10243
9977
  cleanup() {
@@ -10291,7 +10025,7 @@ class PDFThumbnailViewer {
10291
10025
  }
10292
10026
  this._thumbnails[0]?.setPdfPage(firstPdfPage);
10293
10027
  const thumbnailView = this._thumbnails[this._currentPageNumber - 1];
10294
- thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
10028
+ thumbnailView.toggleCurrent(true);
10295
10029
  this.container.append(fragment);
10296
10030
  }).catch(reason => {
10297
10031
  console.error("Unable to initialize thumbnail viewer", reason);
@@ -10353,6 +10087,90 @@ class PDFThumbnailViewer {
10353
10087
  }
10354
10088
  return false;
10355
10089
  }
10090
+ #addEventListeners() {
10091
+ this.container.addEventListener("keydown", e => {
10092
+ switch (e.key) {
10093
+ case "ArrowLeft":
10094
+ this.#goToNextItem(e.target, false, true);
10095
+ stopEvent(e);
10096
+ break;
10097
+ case "ArrowRight":
10098
+ this.#goToNextItem(e.target, true, true);
10099
+ stopEvent(e);
10100
+ break;
10101
+ case "ArrowDown":
10102
+ this.#goToNextItem(e.target, true, false);
10103
+ stopEvent(e);
10104
+ break;
10105
+ case "ArrowUp":
10106
+ this.#goToNextItem(e.target, false, false);
10107
+ stopEvent(e);
10108
+ break;
10109
+ case "Home":
10110
+ this._thumbnails[0].image.focus();
10111
+ stopEvent(e);
10112
+ break;
10113
+ case "End":
10114
+ this._thumbnails.at(-1).image.focus();
10115
+ stopEvent(e);
10116
+ break;
10117
+ case "Enter":
10118
+ case " ":
10119
+ this.#goToPage(e);
10120
+ break;
10121
+ }
10122
+ });
10123
+ this.container.addEventListener("click", this.#goToPage.bind(this));
10124
+ }
10125
+ #goToPage(e) {
10126
+ const {
10127
+ target
10128
+ } = e;
10129
+ if (target.classList.contains("thumbnailImage")) {
10130
+ const pageNumber = parseInt(target.parentElement.getAttribute("page-number"), 10);
10131
+ this.linkService.goToPage(pageNumber);
10132
+ stopEvent(e);
10133
+ }
10134
+ }
10135
+ #goToNextItem(element, forward, horizontal) {
10136
+ let currentPageNumber = parseInt(element.parentElement.getAttribute("page-number"), 10);
10137
+ if (isNaN(currentPageNumber)) {
10138
+ currentPageNumber = this._currentPageNumber;
10139
+ }
10140
+ const increment = forward ? 1 : -1;
10141
+ let nextThumbnail;
10142
+ if (horizontal) {
10143
+ const nextPageNumber = MathClamp(currentPageNumber + increment, 1, this._thumbnails.length + 1);
10144
+ nextThumbnail = this._thumbnails[nextPageNumber - 1];
10145
+ } else {
10146
+ const currentThumbnail = this._thumbnails[currentPageNumber - 1];
10147
+ const {
10148
+ x: currentX,
10149
+ y: currentY
10150
+ } = currentThumbnail.div.getBoundingClientRect();
10151
+ let firstWithDifferentY;
10152
+ for (let i = currentPageNumber - 1 + increment; i >= 0 && i < this._thumbnails.length; i += increment) {
10153
+ const thumbnail = this._thumbnails[i];
10154
+ const {
10155
+ x,
10156
+ y
10157
+ } = thumbnail.div.getBoundingClientRect();
10158
+ if (!firstWithDifferentY && y !== currentY) {
10159
+ firstWithDifferentY = thumbnail;
10160
+ }
10161
+ if (x === currentX) {
10162
+ nextThumbnail = thumbnail;
10163
+ break;
10164
+ }
10165
+ }
10166
+ if (!nextThumbnail) {
10167
+ nextThumbnail = firstWithDifferentY;
10168
+ }
10169
+ }
10170
+ if (nextThumbnail) {
10171
+ nextThumbnail.image.focus();
10172
+ }
10173
+ }
10356
10174
  }
10357
10175
 
10358
10176
  ;// ./web/annotation_editor_layer_builder.js
@@ -10767,8 +10585,9 @@ function createLinkAnnotation({
10767
10585
  class Autolinker {
10768
10586
  static #index = 0;
10769
10587
  static #regex;
10588
+ static #numericTLDRegex;
10770
10589
  static findLinks(text) {
10771
- this.#regex ??= /\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv;
10590
+ this.#regex ??= /\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|(?=\p{L})[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv;
10772
10591
  const [normalizedText, diffs] = normalize(text, {
10773
10592
  ignoreDashEOL: true
10774
10593
  });
@@ -10779,11 +10598,17 @@ class Autolinker {
10779
10598
  let raw;
10780
10599
  if (url.startsWith("www.") || url.startsWith("http://") || url.startsWith("https://")) {
10781
10600
  raw = url;
10782
- } else if (URL.canParse(`http://${emailDomain}`)) {
10783
- raw = url.startsWith("mailto:") ? url : `mailto:${url}`;
10784
- } else {
10785
- continue;
10601
+ } else if (emailDomain) {
10602
+ const hostname = URL.parse(`http://${emailDomain}`)?.hostname;
10603
+ if (!hostname) {
10604
+ continue;
10605
+ }
10606
+ this.#numericTLDRegex ??= /\.\d+$/;
10607
+ if (this.#numericTLDRegex.test(hostname)) {
10608
+ continue;
10609
+ }
10786
10610
  }
10611
+ raw ??= url.startsWith("mailto:") ? url : `mailto:${url}`;
10787
10612
  const absoluteURL = createValidAbsoluteUrl(raw, null, {
10788
10613
  addDefaultProtocol: true
10789
10614
  });
@@ -11449,7 +11274,27 @@ class StructTreeLayerBuilder {
11449
11274
  const {
11450
11275
  role
11451
11276
  } = node;
11452
- element = MathMLElements.has(role) ? document.createElementNS(MathMLNamespace, role) : document.createElement("span");
11277
+ if (MathMLElements.has(role)) {
11278
+ element = document.createElementNS(MathMLNamespace, role);
11279
+ let text = "";
11280
+ for (const {
11281
+ type,
11282
+ id
11283
+ } of node.children || []) {
11284
+ if (type !== "content" || !id) {
11285
+ continue;
11286
+ }
11287
+ const elem = document.getElementById(id);
11288
+ if (!elem) {
11289
+ continue;
11290
+ }
11291
+ text += elem.textContent.trim() || "";
11292
+ elem.ariaHidden = "true";
11293
+ }
11294
+ element.textContent = text;
11295
+ } else {
11296
+ element = document.createElement("span");
11297
+ }
11453
11298
  const match = role.match(HEADING_PATTERN);
11454
11299
  if (match) {
11455
11300
  element.setAttribute("role", "heading");
@@ -11465,7 +11310,18 @@ class StructTreeLayerBuilder {
11465
11310
  element.setHTML(node.mathML, {
11466
11311
  sanitizer: MathMLSanitizer.sanitizer
11467
11312
  });
11468
- }
11313
+ for (const {
11314
+ id
11315
+ } of node.children || []) {
11316
+ if (!id) {
11317
+ continue;
11318
+ }
11319
+ const elem = document.getElementById(id);
11320
+ if (elem) {
11321
+ elem.ariaHidden = true;
11322
+ }
11323
+ }
11324
+ }
11469
11325
  if (!node.mathML && node.children.length === 1 && node.children[0].role !== "math") {
11470
11326
  element = document.createElementNS(MathMLNamespace, "math");
11471
11327
  }
@@ -12055,6 +11911,7 @@ class TextLayerBuilder {
12055
11911
  if (endDiv) {
12056
11912
  endDiv.style.width = parentTextLayer.style.width;
12057
11913
  endDiv.style.height = parentTextLayer.style.height;
11914
+ endDiv.style.userSelect = "text";
12058
11915
  anchor.parentElement.insertBefore(endDiv, modifyStart ? anchor : anchor.nextSibling);
12059
11916
  }
12060
11917
  prevRange = range.cloneRange();
@@ -12956,7 +12813,7 @@ class PDFViewer {
12956
12813
  #textLayerMode = TextLayerMode.ENABLE;
12957
12814
  #viewerAlert = null;
12958
12815
  constructor(options) {
12959
- const viewerVersion = "5.4.449";
12816
+ const viewerVersion = "5.4.530";
12960
12817
  if (version !== viewerVersion) {
12961
12818
  throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`);
12962
12819
  }
@@ -14509,7 +14366,7 @@ class PDFViewer {
14509
14366
  const updater = async () => {
14510
14367
  this.#cleanupSwitchAnnotationEditorMode();
14511
14368
  this.#annotationEditorMode = mode;
14512
- await this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard, mustEnterInEditMode, editComment);
14369
+ await this.#annotationEditorUIManager.updateMode(mode, editId, true, isFromKeyboard, mustEnterInEditMode, editComment);
14513
14370
  if (mode !== this.#annotationEditorMode || pdfDocument !== this.pdfDocument) {
14514
14371
  return;
14515
14372
  }
@@ -16119,6 +15976,450 @@ class ViewHistory {
16119
15976
  }
16120
15977
  }
16121
15978
 
15979
+ ;// ./web/menu.js
15980
+
15981
+ class Menu {
15982
+ #triggeringButton;
15983
+ #menu;
15984
+ #menuItems;
15985
+ #openMenuAC = null;
15986
+ #menuAC = new AbortController();
15987
+ #lastIndex = -1;
15988
+ constructor(menuContainer, triggeringButton, menuItems) {
15989
+ this.#menu = menuContainer;
15990
+ this.#triggeringButton = triggeringButton;
15991
+ if (Array.isArray(menuItems)) {
15992
+ this.#menuItems = menuItems;
15993
+ } else {
15994
+ this.#menuItems = [];
15995
+ for (const button of this.#menu.querySelectorAll("button")) {
15996
+ this.#menuItems.push(button);
15997
+ }
15998
+ }
15999
+ this.#setUpMenu();
16000
+ }
16001
+ #closeMenu() {
16002
+ if (!this.#openMenuAC) {
16003
+ return;
16004
+ }
16005
+ const menu = this.#menu;
16006
+ menu.classList.toggle("hidden", true);
16007
+ this.#triggeringButton.ariaExpanded = "false";
16008
+ this.#openMenuAC.abort();
16009
+ this.#openMenuAC = null;
16010
+ if (menu.contains(document.activeElement)) {
16011
+ setTimeout(() => {
16012
+ if (!menu.contains(document.activeElement)) {
16013
+ this.#triggeringButton.focus();
16014
+ }
16015
+ }, 0);
16016
+ }
16017
+ this.#lastIndex = -1;
16018
+ }
16019
+ #setUpMenu() {
16020
+ this.#triggeringButton.addEventListener("click", e => {
16021
+ if (this.#openMenuAC) {
16022
+ this.#closeMenu();
16023
+ return;
16024
+ }
16025
+ const menu = this.#menu;
16026
+ menu.classList.toggle("hidden", false);
16027
+ this.#triggeringButton.ariaExpanded = "true";
16028
+ this.#openMenuAC = new AbortController();
16029
+ const signal = AbortSignal.any([this.#menuAC.signal, this.#openMenuAC.signal]);
16030
+ window.addEventListener("pointerdown", ({
16031
+ target
16032
+ }) => {
16033
+ if (target !== this.#triggeringButton && !menu.contains(target)) {
16034
+ this.#closeMenu();
16035
+ }
16036
+ }, {
16037
+ signal
16038
+ });
16039
+ window.addEventListener("blur", this.#closeMenu.bind(this), {
16040
+ signal
16041
+ });
16042
+ });
16043
+ const {
16044
+ signal
16045
+ } = this.#menuAC;
16046
+ this.#menu.addEventListener("keydown", e => {
16047
+ switch (e.key) {
16048
+ case "Escape":
16049
+ this.#closeMenu();
16050
+ stopEvent(e);
16051
+ break;
16052
+ case "ArrowDown":
16053
+ case "Tab":
16054
+ this.#goToNextItem(e.target, true);
16055
+ stopEvent(e);
16056
+ break;
16057
+ case "ArrowUp":
16058
+ case "ShiftTab":
16059
+ this.#goToNextItem(e.target, false);
16060
+ stopEvent(e);
16061
+ break;
16062
+ case "Home":
16063
+ this.#menuItems.find(item => !item.disabled && !item.classList.contains("hidden")).focus();
16064
+ stopEvent(e);
16065
+ break;
16066
+ case "End":
16067
+ this.#menuItems.findLast(item => !item.disabled && !item.classList.contains("hidden")).focus();
16068
+ stopEvent(e);
16069
+ break;
16070
+ }
16071
+ }, {
16072
+ signal,
16073
+ capture: true
16074
+ });
16075
+ this.#menu.addEventListener("contextmenu", noContextMenu, {
16076
+ signal
16077
+ });
16078
+ this.#menu.addEventListener("click", this.#closeMenu.bind(this), {
16079
+ signal,
16080
+ capture: true
16081
+ });
16082
+ this.#triggeringButton.addEventListener("keydown", ev => {
16083
+ if (!this.#openMenuAC) {
16084
+ return;
16085
+ }
16086
+ switch (ev.key) {
16087
+ case "ArrowDown":
16088
+ case "Home":
16089
+ this.#menuItems.find(item => !item.disabled && !item.classList.contains("hidden")).focus();
16090
+ stopEvent(ev);
16091
+ break;
16092
+ case "ArrowUp":
16093
+ case "End":
16094
+ this.#menuItems.findLast(item => !item.disabled && !item.classList.contains("hidden")).focus();
16095
+ stopEvent(ev);
16096
+ break;
16097
+ case "Escape":
16098
+ this.#closeMenu();
16099
+ stopEvent(ev);
16100
+ }
16101
+ }, {
16102
+ signal
16103
+ });
16104
+ }
16105
+ #goToNextItem(element, forward) {
16106
+ const index = this.#lastIndex === -1 ? this.#menuItems.indexOf(element) : this.#lastIndex;
16107
+ const len = this.#menuItems.length;
16108
+ const increment = forward ? 1 : len - 1;
16109
+ for (let i = (index + increment) % len; i !== index; i = (i + increment) % len) {
16110
+ const menuItem = this.#menuItems[i];
16111
+ if (!menuItem.disabled && !menuItem.classList.contains("hidden")) {
16112
+ menuItem.focus();
16113
+ this.#lastIndex = i;
16114
+ break;
16115
+ }
16116
+ }
16117
+ }
16118
+ destroy() {
16119
+ this.#closeMenu();
16120
+ this.#menuAC?.abort();
16121
+ this.#menuAC = null;
16122
+ }
16123
+ }
16124
+
16125
+ ;// ./web/views_manager.js
16126
+
16127
+
16128
+
16129
+ const SIDEBAR_WIDTH_VAR = "--viewsManager-width";
16130
+ const SIDEBAR_RESIZING_CLASS = "viewsManagerResizing";
16131
+ const UI_NOTIFICATION_CLASS = "pdfSidebarNotification";
16132
+ class ViewsManager extends Sidebar {
16133
+ static #l10nDescription = null;
16134
+ constructor({
16135
+ elements: {
16136
+ outerContainer,
16137
+ sidebarContainer,
16138
+ toggleButton,
16139
+ resizer,
16140
+ thumbnailButton,
16141
+ outlineButton,
16142
+ attachmentsButton,
16143
+ layersButton,
16144
+ thumbnailsView,
16145
+ outlinesView,
16146
+ attachmentsView,
16147
+ layersView,
16148
+ viewsManagerCurrentOutlineButton,
16149
+ viewsManagerSelectorButton,
16150
+ viewsManagerSelectorOptions,
16151
+ viewsManagerHeaderLabel
16152
+ },
16153
+ eventBus,
16154
+ l10n
16155
+ }) {
16156
+ super({
16157
+ sidebar: sidebarContainer,
16158
+ resizer,
16159
+ toggleButton
16160
+ }, l10n.getDirection() === "ltr", false);
16161
+ this.isOpen = false;
16162
+ this.active = SidebarView.THUMBS;
16163
+ this.isInitialViewSet = false;
16164
+ this.isInitialEventDispatched = false;
16165
+ this.onToggled = null;
16166
+ this.onUpdateThumbnails = null;
16167
+ this.outerContainer = outerContainer;
16168
+ this.sidebarContainer = sidebarContainer;
16169
+ this.toggleButton = toggleButton;
16170
+ this.resizer = resizer;
16171
+ this.thumbnailButton = thumbnailButton;
16172
+ this.outlineButton = outlineButton;
16173
+ this.attachmentsButton = attachmentsButton;
16174
+ this.layersButton = layersButton;
16175
+ this.thumbnailsView = thumbnailsView;
16176
+ this.outlinesView = outlinesView;
16177
+ this.attachmentsView = attachmentsView;
16178
+ this.layersView = layersView;
16179
+ this.viewsManagerCurrentOutlineButton = viewsManagerCurrentOutlineButton;
16180
+ this.viewsManagerHeaderLabel = viewsManagerHeaderLabel;
16181
+ this.eventBus = eventBus;
16182
+ this.menu = new Menu(viewsManagerSelectorOptions, viewsManagerSelectorButton, [thumbnailButton, outlineButton, attachmentsButton, layersButton]);
16183
+ ViewsManager.#l10nDescription ||= Object.freeze({
16184
+ pagesTitle: "pdfjs-views-manager-pages-title",
16185
+ outlinesTitle: "pdfjs-views-manager-outlines-title",
16186
+ attachmentsTitle: "pdfjs-views-manager-attachments-title",
16187
+ layersTitle: "pdfjs-views-manager-layers-title",
16188
+ notificationButton: "pdfjs-toggle-views-manager-notification-button",
16189
+ toggleButton: "pdfjs-toggle-views-manager-button"
16190
+ });
16191
+ this.#addEventListeners();
16192
+ }
16193
+ reset() {
16194
+ this.isInitialViewSet = false;
16195
+ this.isInitialEventDispatched = false;
16196
+ this.#hideUINotification(true);
16197
+ this.switchView(SidebarView.THUMBS);
16198
+ this.outlineButton.disabled = this.attachmentsButton.disabled = this.layersButton.disabled = false;
16199
+ this.viewsManagerCurrentOutlineButton.disabled = true;
16200
+ }
16201
+ get visibleView() {
16202
+ return this.isOpen ? this.active : SidebarView.NONE;
16203
+ }
16204
+ setInitialView(view = SidebarView.NONE) {
16205
+ if (this.isInitialViewSet) {
16206
+ return;
16207
+ }
16208
+ this.isInitialViewSet = true;
16209
+ if (view === SidebarView.NONE || view === SidebarView.UNKNOWN) {
16210
+ this.#dispatchEvent();
16211
+ return;
16212
+ }
16213
+ this.switchView(view, true);
16214
+ if (!this.isInitialEventDispatched) {
16215
+ this.#dispatchEvent();
16216
+ }
16217
+ }
16218
+ switchView(view, forceOpen = false) {
16219
+ const isViewChanged = view !== this.active;
16220
+ let forceRendering = false;
16221
+ let titleL10nId = null;
16222
+ switch (view) {
16223
+ case SidebarView.NONE:
16224
+ if (this.isOpen) {
16225
+ this.close();
16226
+ }
16227
+ return;
16228
+ case SidebarView.THUMBS:
16229
+ titleL10nId = "pagesTitle";
16230
+ if (this.isOpen && isViewChanged) {
16231
+ forceRendering = true;
16232
+ }
16233
+ break;
16234
+ case SidebarView.OUTLINE:
16235
+ titleL10nId = "outlinesTitle";
16236
+ if (this.outlineButton.disabled) {
16237
+ return;
16238
+ }
16239
+ break;
16240
+ case SidebarView.ATTACHMENTS:
16241
+ titleL10nId = "attachmentsTitle";
16242
+ if (this.attachmentsButton.disabled) {
16243
+ return;
16244
+ }
16245
+ break;
16246
+ case SidebarView.LAYERS:
16247
+ titleL10nId = "layersTitle";
16248
+ if (this.layersButton.disabled) {
16249
+ return;
16250
+ }
16251
+ break;
16252
+ default:
16253
+ console.error(`PDFSidebar.switchView: "${view}" is not a valid view.`);
16254
+ return;
16255
+ }
16256
+ this.viewsManagerCurrentOutlineButton.hidden = view !== SidebarView.OUTLINE;
16257
+ this.viewsManagerHeaderLabel.setAttribute("data-l10n-id", ViewsManager.#l10nDescription[titleL10nId] || "");
16258
+ this.active = view;
16259
+ toggleSelectedBtn(this.thumbnailButton, view === SidebarView.THUMBS, this.thumbnailsView);
16260
+ toggleSelectedBtn(this.outlineButton, view === SidebarView.OUTLINE, this.outlinesView);
16261
+ toggleSelectedBtn(this.attachmentsButton, view === SidebarView.ATTACHMENTS, this.attachmentsView);
16262
+ toggleSelectedBtn(this.layersButton, view === SidebarView.LAYERS, this.layersView);
16263
+ if (forceOpen && !this.isOpen) {
16264
+ this.open();
16265
+ return;
16266
+ }
16267
+ if (forceRendering) {
16268
+ this.onUpdateThumbnails();
16269
+ this.onToggled();
16270
+ }
16271
+ if (isViewChanged) {
16272
+ this.#dispatchEvent();
16273
+ }
16274
+ }
16275
+ open() {
16276
+ if (this.isOpen) {
16277
+ return;
16278
+ }
16279
+ this.isOpen = true;
16280
+ this.onResizing(this.width);
16281
+ this._sidebar.hidden = false;
16282
+ toggleExpandedBtn(this.toggleButton, true);
16283
+ this.switchView(this.active);
16284
+ queueMicrotask(() => {
16285
+ this.outerContainer.classList.add("viewsManagerMoving", "viewsManagerOpen");
16286
+ });
16287
+ if (this.active === SidebarView.THUMBS) {
16288
+ this.onUpdateThumbnails();
16289
+ }
16290
+ this.onToggled();
16291
+ this.#dispatchEvent();
16292
+ this.#hideUINotification();
16293
+ }
16294
+ close(evt = null) {
16295
+ if (!this.isOpen) {
16296
+ return;
16297
+ }
16298
+ this.isOpen = false;
16299
+ this._sidebar.hidden = true;
16300
+ toggleExpandedBtn(this.toggleButton, false);
16301
+ this.outerContainer.classList.add("viewsManagerMoving");
16302
+ this.outerContainer.classList.remove("viewsManagerOpen");
16303
+ this.onToggled();
16304
+ this.#dispatchEvent();
16305
+ if (evt?.detail > 0) {
16306
+ this.toggleButton.blur();
16307
+ }
16308
+ }
16309
+ toggle(evt = null) {
16310
+ super.toggle();
16311
+ if (this.isOpen) {
16312
+ this.close(evt);
16313
+ } else {
16314
+ this.open();
16315
+ }
16316
+ }
16317
+ #dispatchEvent() {
16318
+ if (this.isInitialViewSet) {
16319
+ this.isInitialEventDispatched ||= true;
16320
+ }
16321
+ this.eventBus.dispatch("sidebarviewchanged", {
16322
+ source: this,
16323
+ view: this.visibleView
16324
+ });
16325
+ }
16326
+ #showUINotification() {
16327
+ this.toggleButton.setAttribute("data-l10n-id", ViewsManager.#l10nDescription.notificationButton);
16328
+ if (!this.isOpen) {
16329
+ this.toggleButton.classList.add(UI_NOTIFICATION_CLASS);
16330
+ }
16331
+ }
16332
+ #hideUINotification(reset = false) {
16333
+ if (this.isOpen || reset) {
16334
+ this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS);
16335
+ }
16336
+ if (reset) {
16337
+ this.toggleButton.setAttribute("data-l10n-id", ViewsManager.#l10nDescription.toggleButton);
16338
+ }
16339
+ }
16340
+ #addEventListeners() {
16341
+ const {
16342
+ eventBus,
16343
+ outerContainer
16344
+ } = this;
16345
+ this.sidebarContainer.addEventListener("transitionend", evt => {
16346
+ if (evt.target === this.sidebarContainer) {
16347
+ outerContainer.classList.remove("viewsManagerMoving");
16348
+ eventBus.dispatch("resize", {
16349
+ source: this
16350
+ });
16351
+ }
16352
+ });
16353
+ this.thumbnailButton.addEventListener("click", () => {
16354
+ this.switchView(SidebarView.THUMBS);
16355
+ });
16356
+ this.outlineButton.addEventListener("click", () => {
16357
+ this.switchView(SidebarView.OUTLINE);
16358
+ });
16359
+ this.outlineButton.addEventListener("dblclick", () => {
16360
+ eventBus.dispatch("toggleoutlinetree", {
16361
+ source: this
16362
+ });
16363
+ });
16364
+ this.attachmentsButton.addEventListener("click", () => {
16365
+ this.switchView(SidebarView.ATTACHMENTS);
16366
+ });
16367
+ this.layersButton.addEventListener("click", () => {
16368
+ this.switchView(SidebarView.LAYERS);
16369
+ });
16370
+ this.layersButton.addEventListener("dblclick", () => {
16371
+ eventBus.dispatch("resetlayers", {
16372
+ source: this
16373
+ });
16374
+ });
16375
+ this.viewsManagerCurrentOutlineButton.addEventListener("click", () => {
16376
+ eventBus.dispatch("currentoutlineitem", {
16377
+ source: this
16378
+ });
16379
+ });
16380
+ const onTreeLoaded = (count, button, view) => {
16381
+ button.disabled = !count;
16382
+ if (count) {
16383
+ this.#showUINotification();
16384
+ } else if (this.active === view) {
16385
+ this.switchView(SidebarView.THUMBS);
16386
+ }
16387
+ };
16388
+ eventBus._on("outlineloaded", evt => {
16389
+ onTreeLoaded(evt.outlineCount, this.outlineButton, SidebarView.OUTLINE);
16390
+ evt.currentOutlineItemPromise.then(enabled => {
16391
+ if (!this.isInitialViewSet) {
16392
+ return;
16393
+ }
16394
+ this.viewsManagerCurrentOutlineButton.disabled = !enabled;
16395
+ });
16396
+ });
16397
+ eventBus._on("attachmentsloaded", evt => {
16398
+ onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, SidebarView.ATTACHMENTS);
16399
+ });
16400
+ eventBus._on("layersloaded", evt => {
16401
+ onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS);
16402
+ });
16403
+ eventBus._on("presentationmodechanged", evt => {
16404
+ if (evt.state === PresentationModeState.NORMAL && this.visibleView === SidebarView.THUMBS) {
16405
+ this.onUpdateThumbnails();
16406
+ }
16407
+ });
16408
+ }
16409
+ onStartResizing() {
16410
+ this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);
16411
+ }
16412
+ onStopResizing() {
16413
+ this.eventBus.dispatch("resize", {
16414
+ source: this
16415
+ });
16416
+ this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);
16417
+ }
16418
+ onResizing(newWidth) {
16419
+ docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${newWidth}px`);
16420
+ }
16421
+ }
16422
+
16122
16423
  ;// ./web/app.js
16123
16424
 
16124
16425
 
@@ -16180,7 +16481,7 @@ const PDFViewerApplication = {
16180
16481
  pdfLinkService: null,
16181
16482
  pdfTextExtractor: null,
16182
16483
  pdfHistory: null,
16183
- pdfSidebar: null,
16484
+ viewsManager: null,
16184
16485
  pdfOutlineViewer: null,
16185
16486
  pdfAttachmentViewer: null,
16186
16487
  pdfLayerViewer: null,
@@ -16454,9 +16755,9 @@ const PDFViewerApplication = {
16454
16755
  renderingQueue.setViewer(pdfViewer);
16455
16756
  linkService.setViewer(pdfViewer);
16456
16757
  pdfScriptingManager.setViewer(pdfViewer);
16457
- if (appConfig.sidebar?.thumbnailView) {
16758
+ if (appConfig.viewsManager?.thumbnailsView) {
16458
16759
  this.pdfThumbnailViewer = new PDFThumbnailViewer({
16459
- container: appConfig.sidebar.thumbnailView,
16760
+ container: appConfig.viewsManager.thumbnailsView,
16460
16761
  eventBus,
16461
16762
  renderingQueue,
16462
16763
  linkService,
@@ -16528,38 +16829,38 @@ const PDFViewerApplication = {
16528
16829
  if (appConfig.passwordOverlay) {
16529
16830
  this.passwordPrompt = new PasswordPrompt(appConfig.passwordOverlay, overlayManager, this.isViewerEmbedded);
16530
16831
  }
16531
- if (appConfig.sidebar?.outlineView) {
16832
+ if (appConfig.viewsManager?.outlinesView) {
16532
16833
  this.pdfOutlineViewer = new PDFOutlineViewer({
16533
- container: appConfig.sidebar.outlineView,
16834
+ container: appConfig.viewsManager.outlinesView,
16534
16835
  eventBus,
16535
16836
  l10n,
16536
16837
  linkService,
16537
16838
  downloadManager
16538
16839
  });
16539
16840
  }
16540
- if (appConfig.sidebar?.attachmentsView) {
16841
+ if (appConfig.viewsManager?.attachmentsView) {
16541
16842
  this.pdfAttachmentViewer = new PDFAttachmentViewer({
16542
- container: appConfig.sidebar.attachmentsView,
16843
+ container: appConfig.viewsManager.attachmentsView,
16543
16844
  eventBus,
16544
16845
  l10n,
16545
16846
  downloadManager
16546
16847
  });
16547
16848
  }
16548
- if (appConfig.sidebar?.layersView) {
16849
+ if (appConfig.viewsManager?.layersView) {
16549
16850
  this.pdfLayerViewer = new PDFLayerViewer({
16550
- container: appConfig.sidebar.layersView,
16851
+ container: appConfig.viewsManager.layersView,
16551
16852
  eventBus,
16552
16853
  l10n
16553
16854
  });
16554
16855
  }
16555
- if (appConfig.sidebar) {
16556
- this.pdfSidebar = new PDFSidebar({
16557
- elements: appConfig.sidebar,
16856
+ if (appConfig.viewsManager) {
16857
+ this.viewsManager = new ViewsManager({
16858
+ elements: appConfig.viewsManager,
16558
16859
  eventBus,
16559
16860
  l10n
16560
16861
  });
16561
- this.pdfSidebar.onToggled = this.forceRendering.bind(this);
16562
- this.pdfSidebar.onUpdateThumbnails = () => {
16862
+ this.viewsManager.onToggled = this.forceRendering.bind(this);
16863
+ this.viewsManager.onUpdateThumbnails = () => {
16563
16864
  for (const pageView of pdfViewer.getCachedPageViews()) {
16564
16865
  if (pageView.renderingState === RenderingStates.FINISHED) {
16565
16866
  this.pdfThumbnailViewer.getThumbnail(pageView.id - 1)?.setImage(pageView);
@@ -16580,7 +16881,7 @@ const PDFViewerApplication = {
16580
16881
  const params = parseQueryString(queryString);
16581
16882
  file = params.get("file") ?? AppOptions.get("defaultUrl");
16582
16883
  try {
16583
- file = new URL(decodeURIComponent(file)).href;
16884
+ file = new URL(file).href;
16584
16885
  } catch {
16585
16886
  file = encodeURIComponent(file).replaceAll("%2F", "/");
16586
16887
  }
@@ -16824,7 +17125,7 @@ const PDFViewerApplication = {
16824
17125
  this._hasAnnotationEditors = false;
16825
17126
  promises.push(this.pdfScriptingManager.destroyPromise, this.passwordPrompt.close());
16826
17127
  this.setTitle();
16827
- this.pdfSidebar?.reset();
17128
+ this.viewsManager?.reset();
16828
17129
  this.pdfOutlineViewer?.reset();
16829
17130
  this.pdfAttachmentViewer?.reset();
16830
17131
  this.pdfLayerViewer?.reset();
@@ -17324,7 +17625,7 @@ const PDFViewerApplication = {
17324
17625
  }
17325
17626
  };
17326
17627
  this.isInitialViewSet = true;
17327
- this.pdfSidebar?.setInitialView(sidebarView);
17628
+ this.viewsManager?.setInitialView(sidebarView);
17328
17629
  setViewerModes(scrollMode, spreadMode);
17329
17630
  if (this.initialBookmark) {
17330
17631
  setRotation(this.initialRotation);
@@ -17351,7 +17652,7 @@ const PDFViewerApplication = {
17351
17652
  },
17352
17653
  forceRendering() {
17353
17654
  this.pdfRenderingQueue.printing = !!this.printService;
17354
- this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar?.visibleView === SidebarView.THUMBS;
17655
+ this.pdfRenderingQueue.isThumbnailViewEnabled = this.viewsManager?.visibleView === SidebarView.THUMBS;
17355
17656
  this.pdfRenderingQueue.renderHighestPriority();
17356
17657
  },
17357
17658
  beforePrint() {
@@ -17694,7 +17995,7 @@ function onPageRendered({
17694
17995
  if (pageNumber === this.page) {
17695
17996
  this.toolbar?.updateLoadingIndicatorState(false);
17696
17997
  }
17697
- if (!isDetailView && this.pdfSidebar?.visibleView === SidebarView.THUMBS) {
17998
+ if (!isDetailView && this.viewsManager?.visibleView === SidebarView.THUMBS) {
17698
17999
  const pageView = this.pdfViewer.getPageView(pageNumber - 1);
17699
18000
  const thumbnailView = this.pdfThumbnailViewer?.getThumbnail(pageNumber - 1);
17700
18001
  if (pageView) {
@@ -17730,7 +18031,7 @@ function onPageMode({
17730
18031
  console.error('Invalid "pagemode" hash parameter: ' + mode);
17731
18032
  return;
17732
18033
  }
17733
- this.pdfSidebar?.switchView(view, true);
18034
+ this.viewsManager?.switchView(view, true);
17734
18035
  }
17735
18036
  function onNamedAction(evt) {
17736
18037
  switch (evt.action) {
@@ -17882,7 +18183,7 @@ function onPageChanging({
17882
18183
  }) {
17883
18184
  this.toolbar?.setPageNumber(pageNumber, pageLabel);
17884
18185
  this.secondaryToolbar?.setPageNumber(pageNumber);
17885
- if (this.pdfSidebar?.visibleView === SidebarView.THUMBS) {
18186
+ if (this.viewsManager?.visibleView === SidebarView.THUMBS) {
17886
18187
  this.pdfThumbnailViewer?.scrollThumbnailIntoView(pageNumber);
17887
18188
  }
17888
18189
  const currentPage = this.pdfViewer.getPageView(pageNumber - 1);
@@ -18184,7 +18485,7 @@ function onKeyDown(evt) {
18184
18485
  this.rotatePages(90);
18185
18486
  break;
18186
18487
  case 115:
18187
- this.pdfSidebar?.toggle();
18488
+ this.viewsManager?.toggle();
18188
18489
  break;
18189
18490
  }
18190
18491
  if (turnPage !== 0 && (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === "page-fit")) {
@@ -18308,20 +18609,24 @@ function getViewerConfiguration() {
18308
18609
  imageAltTextSettingsSeparator: document.getElementById("imageAltTextSettingsSeparator"),
18309
18610
  documentPropertiesButton: document.getElementById("documentProperties")
18310
18611
  },
18311
- sidebar: {
18612
+ viewsManager: {
18312
18613
  outerContainer: document.getElementById("outerContainer"),
18313
- sidebarContainer: document.getElementById("sidebarContainer"),
18314
- toggleButton: document.getElementById("sidebarToggleButton"),
18315
- resizer: document.getElementById("sidebarResizer"),
18316
- thumbnailButton: document.getElementById("viewThumbnail"),
18317
- outlineButton: document.getElementById("viewOutline"),
18318
- attachmentsButton: document.getElementById("viewAttachments"),
18319
- layersButton: document.getElementById("viewLayers"),
18320
- thumbnailView: document.getElementById("thumbnailView"),
18321
- outlineView: document.getElementById("outlineView"),
18614
+ toggleButton: document.getElementById("viewsManagerToggleButton"),
18615
+ sidebarContainer: document.getElementById("viewsManager"),
18616
+ resizer: document.getElementById("viewsManagerResizer"),
18617
+ thumbnailButton: document.getElementById("thumbnailsViewMenu"),
18618
+ outlineButton: document.getElementById("outlinesViewMenu"),
18619
+ attachmentsButton: document.getElementById("attachmentsViewMenu"),
18620
+ layersButton: document.getElementById("layersViewMenu"),
18621
+ viewsManagerSelectorButton: document.getElementById("viewsManagerSelectorButton"),
18622
+ viewsManagerSelectorOptions: document.getElementById("viewsManagerSelectorOptions"),
18623
+ thumbnailsView: document.getElementById("thumbnailsView"),
18624
+ outlinesView: document.getElementById("outlinesView"),
18322
18625
  attachmentsView: document.getElementById("attachmentsView"),
18323
18626
  layersView: document.getElementById("layersView"),
18324
- currentOutlineItemButton: document.getElementById("currentOutlineItem")
18627
+ viewsManagerAddFileButton: document.getElementById("viewsManagerAddFileButton"),
18628
+ viewsManagerCurrentOutlineButton: document.getElementById("viewsManagerCurrentOutlineButton"),
18629
+ viewsManagerHeaderLabel: document.getElementById("viewsManagerHeaderLabel")
18325
18630
  },
18326
18631
  findBar: {
18327
18632
  bar: document.getElementById("findbar"),