@4tw/vue-cli-plugin-pdfjs-viewer 1.4.0 → 1.5.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 (60) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/assets/build/pdf.mjs +973 -220
  3. package/assets/build/pdf.mjs.map +1 -1
  4. package/assets/build/pdf.sandbox.mjs +3 -3
  5. package/assets/build/pdf.sandbox.mjs.map +1 -1
  6. package/assets/build/pdf.worker.mjs +66 -19
  7. package/assets/build/pdf.worker.mjs.map +1 -1
  8. package/assets/web/images/toolbarButton-editorHighlight.svg +6 -0
  9. package/assets/web/locale/be/viewer.ftl +35 -0
  10. package/assets/web/locale/br/viewer.ftl +30 -0
  11. package/assets/web/locale/cs/viewer.ftl +35 -0
  12. package/assets/web/locale/cy/viewer.ftl +33 -0
  13. package/assets/web/locale/da/viewer.ftl +14 -0
  14. package/assets/web/locale/de/viewer.ftl +35 -0
  15. package/assets/web/locale/dsb/viewer.ftl +33 -0
  16. package/assets/web/locale/el/viewer.ftl +33 -0
  17. package/assets/web/locale/en-GB/viewer.ftl +33 -0
  18. package/assets/web/locale/en-US/viewer.ftl +36 -2
  19. package/assets/web/locale/es-AR/viewer.ftl +35 -0
  20. package/assets/web/locale/es-CL/viewer.ftl +33 -0
  21. package/assets/web/locale/es-ES/viewer.ftl +35 -0
  22. package/assets/web/locale/fi/viewer.ftl +33 -0
  23. package/assets/web/locale/fr/viewer.ftl +33 -0
  24. package/assets/web/locale/fur/viewer.ftl +14 -0
  25. package/assets/web/locale/fy-NL/viewer.ftl +35 -0
  26. package/assets/web/locale/gn/viewer.ftl +33 -0
  27. package/assets/web/locale/he/viewer.ftl +33 -0
  28. package/assets/web/locale/hsb/viewer.ftl +33 -0
  29. package/assets/web/locale/hu/viewer.ftl +35 -0
  30. package/assets/web/locale/ia/viewer.ftl +33 -0
  31. package/assets/web/locale/is/viewer.ftl +33 -0
  32. package/assets/web/locale/it/viewer.ftl +33 -0
  33. package/assets/web/locale/ja/viewer.ftl +14 -0
  34. package/assets/web/locale/ka/viewer.ftl +2 -0
  35. package/assets/web/locale/kab/viewer.ftl +12 -0
  36. package/assets/web/locale/kk/viewer.ftl +33 -0
  37. package/assets/web/locale/ko/viewer.ftl +33 -0
  38. package/assets/web/locale/nb-NO/viewer.ftl +33 -0
  39. package/assets/web/locale/nl/viewer.ftl +35 -0
  40. package/assets/web/locale/nn-NO/viewer.ftl +2 -0
  41. package/assets/web/locale/pa-IN/viewer.ftl +14 -0
  42. package/assets/web/locale/pl/viewer.ftl +35 -0
  43. package/assets/web/locale/pt-BR/viewer.ftl +33 -0
  44. package/assets/web/locale/rm/viewer.ftl +35 -0
  45. package/assets/web/locale/ru/viewer.ftl +33 -0
  46. package/assets/web/locale/sk/viewer.ftl +33 -0
  47. package/assets/web/locale/sl/viewer.ftl +35 -0
  48. package/assets/web/locale/sq/viewer.ftl +35 -0
  49. package/assets/web/locale/sv-SE/viewer.ftl +33 -0
  50. package/assets/web/locale/tg/viewer.ftl +35 -0
  51. package/assets/web/locale/tr/viewer.ftl +33 -0
  52. package/assets/web/locale/uk/viewer.ftl +35 -0
  53. package/assets/web/locale/vi/viewer.ftl +33 -0
  54. package/assets/web/locale/zh-CN/viewer.ftl +35 -0
  55. package/assets/web/locale/zh-TW/viewer.ftl +33 -0
  56. package/assets/web/viewer.css +524 -360
  57. package/assets/web/viewer.html +22 -11
  58. package/assets/web/viewer.mjs +343 -238
  59. package/assets/web/viewer.mjs.map +1 -1
  60. package/package.json +1 -1
@@ -1655,6 +1655,8 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfj
1655
1655
 
1656
1656
  class AnnotationEditorLayerBuilder {
1657
1657
  #annotationLayer = null;
1658
+ #drawLayer = null;
1659
+ #textLayer = null;
1658
1660
  #uiManager;
1659
1661
  constructor(options) {
1660
1662
  this.pageDiv = options.pageDiv;
@@ -1666,6 +1668,8 @@ class AnnotationEditorLayerBuilder {
1666
1668
  this._cancelled = false;
1667
1669
  this.#uiManager = options.uiManager;
1668
1670
  this.#annotationLayer = options.annotationLayer || null;
1671
+ this.#textLayer = options.textLayer || null;
1672
+ this.#drawLayer = options.drawLayer || null;
1669
1673
  }
1670
1674
  async render(viewport, intent = "display") {
1671
1675
  if (intent !== "display") {
@@ -1697,7 +1701,9 @@ class AnnotationEditorLayerBuilder {
1697
1701
  pageIndex: this.pdfPage.pageNumber - 1,
1698
1702
  l10n: this.l10n,
1699
1703
  viewport: clonedViewport,
1700
- annotationLayer: this.#annotationLayer
1704
+ annotationLayer: this.#annotationLayer,
1705
+ textLayer: this.#textLayer,
1706
+ drawLayer: this.#drawLayer
1701
1707
  });
1702
1708
  const parameters = {
1703
1709
  viewport: clonedViewport,
@@ -2043,7 +2049,7 @@ class DefaultExternalServices {
2043
2049
  static async createL10n() {
2044
2050
  throw new Error("Not implemented: createL10n");
2045
2051
  }
2046
- static createScripting(options) {
2052
+ static createScripting() {
2047
2053
  throw new Error("Not implemented: createScripting");
2048
2054
  }
2049
2055
  static updateEditorStates(data) {
@@ -2238,7 +2244,6 @@ const PDFViewerApplication = {
2238
2244
  this.findController = findController;
2239
2245
  const pdfScriptingManager = new _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_18__.PDFScriptingManager({
2240
2246
  eventBus,
2241
- sandboxBundleSrc: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("sandboxBundleSrc"),
2242
2247
  externalServices,
2243
2248
  docProperties: this._scriptingDocProperties.bind(this)
2244
2249
  });
@@ -2266,6 +2271,7 @@ const PDFViewerApplication = {
2266
2271
  textLayerMode: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("textLayerMode"),
2267
2272
  annotationMode: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("annotationMode"),
2268
2273
  annotationEditorMode,
2274
+ annotationEditorHighlightColors: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("highlightEditorColors"),
2269
2275
  imageResourcesPath: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("imageResourcesPath"),
2270
2276
  enablePrintAutoRotate: _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("enablePrintAutoRotate"),
2271
2277
  isOffscreenCanvasSupported,
@@ -2302,6 +2308,10 @@ const PDFViewerApplication = {
2302
2308
  if (!isOffscreenCanvasSupported) {
2303
2309
  appConfig.toolbar?.editorStampButton?.classList.add("hidden");
2304
2310
  }
2311
+ const editorHighlightButton = appConfig.toolbar?.editorHighlightButton;
2312
+ if (editorHighlightButton && _app_options_js__WEBPACK_IMPORTED_MODULE_2__.AppOptions.get("enableHighlightEditor")) {
2313
+ editorHighlightButton.hidden = false;
2314
+ }
2305
2315
  this.annotationEditorParams = new web_annotation_editor_params__WEBPACK_IMPORTED_MODULE_6__.AnnotationEditorParams(appConfig.annotationEditorParams, eventBus);
2306
2316
  } else {
2307
2317
  for (const id of ["editorModeButtons", "editorModeSeparator"]) {
@@ -2435,13 +2445,6 @@ const PDFViewerApplication = {
2435
2445
  if (this.supportsIntegratedFind) {
2436
2446
  appConfig.toolbar?.viewFind?.classList.add("hidden");
2437
2447
  }
2438
- appConfig.mainContainer.addEventListener("transitionend", function (evt) {
2439
- if (evt.target === this) {
2440
- eventBus.dispatch("resize", {
2441
- source: this
2442
- });
2443
- }
2444
- }, true);
2445
2448
  if (file) {
2446
2449
  this.open({
2447
2450
  url: file
@@ -4360,6 +4363,10 @@ const defaultOptions = {
4360
4363
  value: false,
4361
4364
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4362
4365
  },
4366
+ enableHighlightEditor: {
4367
+ value: false,
4368
+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4369
+ },
4363
4370
  enablePermissions: {
4364
4371
  value: false,
4365
4372
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
@@ -4380,6 +4387,10 @@ const defaultOptions = {
4380
4387
  value: 0,
4381
4388
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4382
4389
  },
4390
+ highlightEditorColors: {
4391
+ value: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
4392
+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4393
+ },
4383
4394
  historyUpdateUrl: {
4384
4395
  value: false,
4385
4396
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
@@ -4506,16 +4517,20 @@ const defaultOptions = {
4506
4517
  }
4507
4518
  };
4508
4519
  {
4520
+ defaultOptions.defaultUrl = {
4521
+ value: "compressed.tracemonkey-pldi-09.pdf",
4522
+ kind: OptionKind.VIEWER
4523
+ };
4524
+ defaultOptions.sandboxBundleSrc = {
4525
+ value: "../build/pdf.sandbox.mjs",
4526
+ kind: OptionKind.VIEWER
4527
+ };
4509
4528
  defaultOptions.viewerCssTheme = {
4510
4529
  value: 0,
4511
4530
  kind: OptionKind.VIEWER + OptionKind.PREFERENCE
4512
4531
  };
4513
4532
  }
4514
4533
  {
4515
- defaultOptions.defaultUrl = {
4516
- value: "compressed.tracemonkey-pldi-09.pdf",
4517
- kind: OptionKind.VIEWER
4518
- };
4519
4534
  defaultOptions.disablePreferences = {
4520
4535
  value: false,
4521
4536
  kind: OptionKind.VIEWER
@@ -4524,10 +4539,6 @@ const defaultOptions = {
4524
4539
  value: navigator.language || "en-US",
4525
4540
  kind: OptionKind.VIEWER
4526
4541
  };
4527
- defaultOptions.sandboxBundleSrc = {
4528
- value: "../build/pdf.sandbox.mjs",
4529
- kind: OptionKind.VIEWER
4530
- };
4531
4542
  }
4532
4543
  const userOptions = Object.create(null);
4533
4544
  class AppOptions {
@@ -4771,6 +4782,51 @@ __webpack_async_result__();
4771
4782
 
4772
4783
  /***/ }),
4773
4784
 
4785
+ /***/ 758:
4786
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
4787
+
4788
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
4789
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4790
+ /* harmony export */ DrawLayerBuilder: () => (/* binding */ DrawLayerBuilder)
4791
+ /* harmony export */ });
4792
+ /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1869);
4793
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
4794
+ pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
4795
+
4796
+ class DrawLayerBuilder {
4797
+ #drawLayer = null;
4798
+ constructor(options) {
4799
+ this.pageIndex = options.pageIndex;
4800
+ }
4801
+ async render(intent = "display") {
4802
+ if (intent !== "display" || this.#drawLayer || this._cancelled) {
4803
+ return;
4804
+ }
4805
+ this.#drawLayer = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.DrawLayer({
4806
+ pageIndex: this.pageIndex
4807
+ });
4808
+ }
4809
+ cancel() {
4810
+ this._cancelled = true;
4811
+ if (!this.#drawLayer) {
4812
+ return;
4813
+ }
4814
+ this.#drawLayer.destroy();
4815
+ this.#drawLayer = null;
4816
+ }
4817
+ setParent(parent) {
4818
+ this.#drawLayer?.setParent(parent);
4819
+ }
4820
+ getDrawLayer() {
4821
+ return this.#drawLayer;
4822
+ }
4823
+ }
4824
+
4825
+ __webpack_async_result__();
4826
+ } catch(e) { __webpack_async_result__(e); } });
4827
+
4828
+ /***/ }),
4829
+
4774
4830
  /***/ 6554:
4775
4831
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
4776
4832
 
@@ -4992,10 +5048,8 @@ class GenericExternalServices extends _app_js__WEBPACK_IMPORTED_MODULE_0__.Defau
4992
5048
  static async createL10n() {
4993
5049
  return new _genericl10n_js__WEBPACK_IMPORTED_MODULE_4__.GenericL10n(_app_options_js__WEBPACK_IMPORTED_MODULE_1__.AppOptions.get("locale"));
4994
5050
  }
4995
- static createScripting({
4996
- sandboxBundleSrc
4997
- }) {
4998
- return new _generic_scripting_js__WEBPACK_IMPORTED_MODULE_5__.GenericScripting(sandboxBundleSrc);
5051
+ static createScripting() {
5052
+ return new _generic_scripting_js__WEBPACK_IMPORTED_MODULE_5__.GenericScripting(_app_options_js__WEBPACK_IMPORTED_MODULE_1__.AppOptions.get("sandboxBundleSrc"));
4999
5053
  }
5000
5054
  }
5001
5055
  _app_js__WEBPACK_IMPORTED_MODULE_0__.PDFViewerApplication.externalServices = GenericExternalServices;
@@ -5288,7 +5342,7 @@ class ConstL10n extends _l10n_js__WEBPACK_IMPORTED_MODULE_3__.L10n {
5288
5342
  this._setL10n(new fluent_dom__WEBPACK_IMPORTED_MODULE_2__.DOMLocalization([], ConstL10n.#generateBundles.bind(ConstL10n, lang)));
5289
5343
  }
5290
5344
  static async *#generateBundles(lang) {
5291
- 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-open-in-app-button =\n .title = Open in app\npdfjs-open-in-app-button-label = Open in app\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-kb = { $size_kb } KB ({ $size_b } bytes)\npdfjs-document-properties-mb = { $size_mb } MB ({ $size_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-string = { $date }, { $time }\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-string = { $date }, { $time }\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-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\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-remove-button =\n .title = Remove\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-free-text =\n .aria-label = Text Editor\npdfjs-free-text-default-content = Start typing\u2026\npdfjs-ink =\n .aria-label = Draw Editor\npdfjs-ink-canvas =\n .aria-label = User-created image\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button-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-label-top-left = Top left corner \u2014 resize\npdfjs-editor-resizer-label-top-middle = Top middle \u2014 resize\npdfjs-editor-resizer-label-top-right = Top right corner \u2014 resize\npdfjs-editor-resizer-label-middle-right = Middle right \u2014 resize\npdfjs-editor-resizer-label-bottom-right = Bottom right corner \u2014 resize\npdfjs-editor-resizer-label-bottom-middle = Bottom middle \u2014 resize\npdfjs-editor-resizer-label-bottom-left = Bottom left corner \u2014 resize\npdfjs-editor-resizer-label-middle-left = Middle left \u2014 resize';
5345
+ 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-open-in-app-button =\n .title = Open in app\npdfjs-open-in-app-button-label = Open in app\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-kb = { $size_kb } KB ({ $size_b } bytes)\npdfjs-document-properties-mb = { $size_mb } MB ({ $size_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-string = { $date }, { $time }\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-string = { $date }, { $time }\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-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\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-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-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-free-text =\n .aria-label = Text Editor\npdfjs-free-text-default-content = Start typing\u2026\npdfjs-ink =\n .aria-label = Draw Editor\npdfjs-ink-canvas =\n .aria-label = User-created image\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button-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-label-top-left = Top left corner \u2014 resize\npdfjs-editor-resizer-label-top-middle = Top middle \u2014 resize\npdfjs-editor-resizer-label-top-right = Top right corner \u2014 resize\npdfjs-editor-resizer-label-middle-right = Middle right \u2014 resize\npdfjs-editor-resizer-label-bottom-right = Bottom right corner \u2014 resize\npdfjs-editor-resizer-label-bottom-middle = Bottom middle \u2014 resize\npdfjs-editor-resizer-label-bottom-left = Bottom left corner \u2014 resize\npdfjs-editor-resizer-label-middle-left = 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';
5292
5346
  const resource = new fluent_bundle__WEBPACK_IMPORTED_MODULE_1__.FluentResource(text);
5293
5347
  const bundle = new fluent_bundle__WEBPACK_IMPORTED_MODULE_1__.FluentBundle(lang);
5294
5348
  const errors = bundle.addResource(resource);
@@ -7843,20 +7897,20 @@ class PDFLinkService {
7843
7897
  if (params.has("nameddest")) {
7844
7898
  this.goToDestination(params.get("nameddest"));
7845
7899
  }
7846
- } else {
7847
- dest = unescape(hash);
7848
- try {
7849
- dest = JSON.parse(dest);
7850
- if (!Array.isArray(dest)) {
7851
- dest = dest.toString();
7852
- }
7853
- } catch {}
7854
- if (typeof dest === "string" || PDFLinkService.#isValidExplicitDestination(dest)) {
7855
- this.goToDestination(dest);
7856
- return;
7900
+ return;
7901
+ }
7902
+ dest = unescape(hash);
7903
+ try {
7904
+ dest = JSON.parse(dest);
7905
+ if (!Array.isArray(dest)) {
7906
+ dest = dest.toString();
7857
7907
  }
7858
- console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`);
7908
+ } catch {}
7909
+ if (typeof dest === "string" || PDFLinkService.#isValidExplicitDestination(dest)) {
7910
+ this.goToDestination(dest);
7911
+ return;
7859
7912
  }
7913
+ console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`);
7860
7914
  }
7861
7915
  executeNamedAction(action) {
7862
7916
  switch (action) {
@@ -8329,15 +8383,17 @@ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
8329
8383
  /* harmony import */ var _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2640);
8330
8384
  /* harmony import */ var _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6735);
8331
8385
  /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8961);
8332
- /* harmony import */ var web_l10n_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7910);
8333
- /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3234);
8334
- /* harmony import */ var _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7498);
8335
- /* harmony import */ var _text_accessibility_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4630);
8336
- /* harmony import */ var _text_highlighter_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4274);
8337
- /* harmony import */ var _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1013);
8338
- /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8012);
8339
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_5__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_9__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__]);
8340
- ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_5__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_9__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
8386
+ /* harmony import */ var _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(758);
8387
+ /* harmony import */ var web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7910);
8388
+ /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3234);
8389
+ /* harmony import */ var _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7498);
8390
+ /* harmony import */ var _text_accessibility_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4630);
8391
+ /* harmony import */ var _text_highlighter_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4274);
8392
+ /* harmony import */ var _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1013);
8393
+ /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8012);
8394
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__]);
8395
+ ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__, web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
8396
+
8341
8397
 
8342
8398
 
8343
8399
 
@@ -8388,7 +8444,7 @@ class PDFPageView {
8388
8444
  this.pageColors = options.pageColors || null;
8389
8445
  this.eventBus = options.eventBus;
8390
8446
  this.renderingQueue = options.renderingQueue;
8391
- this.l10n = options.l10n || web_l10n_utils__WEBPACK_IMPORTED_MODULE_5__.NullL10n;
8447
+ this.l10n = options.l10n || web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__.NullL10n;
8392
8448
  this.renderTask = null;
8393
8449
  this.resume = null;
8394
8450
  this._isStandalone = !this.renderingQueue?.hasViewer();
@@ -8400,6 +8456,7 @@ class PDFPageView {
8400
8456
  this.zoomLayer = null;
8401
8457
  this.xfaLayer = null;
8402
8458
  this.structTreeLayer = null;
8459
+ this.drawLayer = null;
8403
8460
  const div = document.createElement("div");
8404
8461
  div.className = "page";
8405
8462
  div.setAttribute("data-page-number", this.id);
@@ -8424,7 +8481,7 @@ class PDFPageView {
8424
8481
  this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;
8425
8482
  });
8426
8483
  }
8427
- if (this.l10n === web_l10n_utils__WEBPACK_IMPORTED_MODULE_5__.NullL10n) {
8484
+ if (this.l10n === web_l10n_utils__WEBPACK_IMPORTED_MODULE_6__.NullL10n) {
8428
8485
  this.l10n.translate(this.div);
8429
8486
  }
8430
8487
  }
@@ -8489,7 +8546,7 @@ class PDFPageView {
8489
8546
  this.pdfPage?.cleanup();
8490
8547
  }
8491
8548
  get _textHighlighter() {
8492
- return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "_textHighlighter", new _text_highlighter_js__WEBPACK_IMPORTED_MODULE_11__.TextHighlighter({
8549
+ return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "_textHighlighter", new _text_highlighter_js__WEBPACK_IMPORTED_MODULE_12__.TextHighlighter({
8493
8550
  pageIndex: this.id - 1,
8494
8551
  eventBus: this.eventBus,
8495
8552
  findController: this.#layerProperties.findController
@@ -8525,6 +8582,13 @@ class PDFPageView {
8525
8582
  });
8526
8583
  }
8527
8584
  }
8585
+ async #renderDrawLayer() {
8586
+ try {
8587
+ await this.drawLayer.render("display");
8588
+ } catch (ex) {
8589
+ console.error(`#renderDrawLayer: "${ex}".`);
8590
+ }
8591
+ }
8528
8592
  async #renderXfaLayer() {
8529
8593
  let error = null;
8530
8594
  try {
@@ -8586,7 +8650,7 @@ class PDFPageView {
8586
8650
  if (!this.textLayer) {
8587
8651
  return;
8588
8652
  }
8589
- this.structTreeLayer ||= new _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_7__.StructTreeLayerBuilder();
8653
+ this.structTreeLayer ||= new _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_8__.StructTreeLayerBuilder();
8590
8654
  const tree = await (!this.structTreeLayer.renderingDone ? this.pdfPage.getStructTree() : null);
8591
8655
  const treeDom = this.structTreeLayer?.render(tree);
8592
8656
  if (treeDom) {
@@ -8798,6 +8862,10 @@ class PDFPageView {
8798
8862
  this._annotationCanvasMap = null;
8799
8863
  }
8800
8864
  if (this.annotationEditorLayer && (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)) {
8865
+ if (this.drawLayer) {
8866
+ this.drawLayer.cancel();
8867
+ this.drawLayer = null;
8868
+ }
8801
8869
  this.annotationEditorLayer.cancel();
8802
8870
  this.annotationEditorLayer = null;
8803
8871
  }
@@ -8842,6 +8910,9 @@ class PDFPageView {
8842
8910
  this.#renderAnnotationLayer();
8843
8911
  }
8844
8912
  if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {
8913
+ if (this.drawLayer) {
8914
+ this.#renderDrawLayer();
8915
+ }
8845
8916
  this.#renderAnnotationEditorLayer();
8846
8917
  }
8847
8918
  if (redrawXfaLayer && this.xfaLayer) {
@@ -8909,8 +8980,8 @@ class PDFPageView {
8909
8980
  canvasWrapper.classList.add("canvasWrapper");
8910
8981
  div.append(canvasWrapper);
8911
8982
  if (!this.textLayer && this.#textLayerMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.TextLayerMode.DISABLE && !pdfPage.isPureXfa) {
8912
- this._accessibilityManager ||= new _text_accessibility_js__WEBPACK_IMPORTED_MODULE_8__.TextAccessibilityManager();
8913
- this.textLayer = new _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_9__.TextLayerBuilder({
8983
+ this._accessibilityManager ||= new _text_accessibility_js__WEBPACK_IMPORTED_MODULE_9__.TextAccessibilityManager();
8984
+ this.textLayer = new _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__.TextLayerBuilder({
8914
8985
  highlighter: this._textHighlighter,
8915
8986
  accessibilityManager: this._accessibilityManager,
8916
8987
  isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,
@@ -9024,20 +9095,27 @@ class PDFPageView {
9024
9095
  if (this.annotationLayer) {
9025
9096
  await this.#renderAnnotationLayer();
9026
9097
  }
9098
+ const {
9099
+ annotationEditorUIManager
9100
+ } = this.#layerProperties;
9101
+ if (!annotationEditorUIManager) {
9102
+ return;
9103
+ }
9104
+ this.drawLayer ||= new _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_5__.DrawLayerBuilder({
9105
+ pageIndex: this.id
9106
+ });
9107
+ await this.#renderDrawLayer();
9108
+ this.drawLayer.setParent(canvasWrapper);
9027
9109
  if (!this.annotationEditorLayer) {
9028
- const {
9029
- annotationEditorUIManager
9030
- } = this.#layerProperties;
9031
- if (!annotationEditorUIManager) {
9032
- return;
9033
- }
9034
9110
  this.annotationEditorLayer = new _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_2__.AnnotationEditorLayerBuilder({
9035
9111
  uiManager: annotationEditorUIManager,
9036
9112
  pageDiv: div,
9037
9113
  pdfPage,
9038
9114
  l10n,
9039
9115
  accessibilityManager: this._accessibilityManager,
9040
- annotationLayer: this.annotationLayer?.annotationLayer
9116
+ annotationLayer: this.annotationLayer?.annotationLayer,
9117
+ textLayer: this.textLayer,
9118
+ drawLayer: this.drawLayer.getDrawLayer()
9041
9119
  });
9042
9120
  }
9043
9121
  this.#renderAnnotationEditorLayer();
@@ -9053,7 +9131,7 @@ class PDFPageView {
9053
9131
  annotationStorage,
9054
9132
  linkService
9055
9133
  } = this.#layerProperties;
9056
- this.xfaLayer = new _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_10__.XfaLayerBuilder({
9134
+ this.xfaLayer = new _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_11__.XfaLayerBuilder({
9057
9135
  pdfPage,
9058
9136
  annotationStorage,
9059
9137
  linkService
@@ -9800,17 +9878,14 @@ class PDFScriptingManager {
9800
9878
  #pdfDocument = null;
9801
9879
  #pdfViewer = null;
9802
9880
  #ready = false;
9803
- #sandboxBundleSrc = null;
9804
9881
  #scripting = null;
9805
9882
  #willPrintCapability = null;
9806
9883
  constructor({
9807
9884
  eventBus,
9808
- sandboxBundleSrc = null,
9809
9885
  externalServices = null,
9810
9886
  docProperties = null
9811
9887
  }) {
9812
9888
  this.#eventBus = eventBus;
9813
- this.#sandboxBundleSrc = sandboxBundleSrc;
9814
9889
  this.#externalServices = externalServices;
9815
9890
  this.#docProperties = docProperties;
9816
9891
  }
@@ -10116,9 +10191,7 @@ class PDFScriptingManager {
10116
10191
  if (this.#scripting) {
10117
10192
  throw new Error("#initScripting: Scripting already exists.");
10118
10193
  }
10119
- return this.#externalServices.createScripting({
10120
- sandboxBundleSrc: this.#sandboxBundleSrc
10121
- });
10194
+ return this.#externalServices.createScripting();
10122
10195
  }
10123
10196
  async #destroyScripting() {
10124
10197
  if (!this.#scripting) {
@@ -10196,7 +10269,6 @@ class PDFSidebar {
10196
10269
  this.outlineView = elements.outlineView;
10197
10270
  this.attachmentsView = elements.attachmentsView;
10198
10271
  this.layersView = elements.layersView;
10199
- this._outlineOptionsContainer = elements.outlineOptionsContainer;
10200
10272
  this._currentOutlineItemButton = elements.currentOutlineItemButton;
10201
10273
  this.eventBus = eventBus;
10202
10274
  this.#isRTL = l10n.getDirection() === "rtl";
@@ -10267,7 +10339,6 @@ class PDFSidebar {
10267
10339
  (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(this.outlineButton, view === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SidebarView.OUTLINE, this.outlineView);
10268
10340
  (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(this.attachmentsButton, view === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SidebarView.ATTACHMENTS, this.attachmentsView);
10269
10341
  (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(this.layersButton, view === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SidebarView.LAYERS, this.layersView);
10270
- this._outlineOptionsContainer.classList.toggle("hidden", view !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SidebarView.OUTLINE);
10271
10342
  if (forceOpen && !this.isOpen) {
10272
10343
  this.open();
10273
10344
  return;
@@ -10294,7 +10365,7 @@ class PDFSidebar {
10294
10365
  this.#dispatchEvent();
10295
10366
  this.#hideUINotification();
10296
10367
  }
10297
- close() {
10368
+ close(evt = null) {
10298
10369
  if (!this.isOpen) {
10299
10370
  return;
10300
10371
  }
@@ -10304,10 +10375,13 @@ class PDFSidebar {
10304
10375
  this.outerContainer.classList.remove("sidebarOpen");
10305
10376
  this.onToggled();
10306
10377
  this.#dispatchEvent();
10378
+ if (evt?.detail > 0) {
10379
+ this.toggleButton.blur();
10380
+ }
10307
10381
  }
10308
- toggle() {
10382
+ toggle(evt = null) {
10309
10383
  if (this.isOpen) {
10310
- this.close();
10384
+ this.close(evt);
10311
10385
  } else {
10312
10386
  this.open();
10313
10387
  }
@@ -10339,10 +10413,13 @@ class PDFSidebar {
10339
10413
  this.sidebarContainer.addEventListener("transitionend", evt => {
10340
10414
  if (evt.target === this.sidebarContainer) {
10341
10415
  this.outerContainer.classList.remove("sidebarMoving");
10416
+ this.eventBus.dispatch("resize", {
10417
+ source: this
10418
+ });
10342
10419
  }
10343
10420
  });
10344
- this.toggleButton.addEventListener("click", () => {
10345
- this.toggle();
10421
+ this.toggleButton.addEventListener("click", evt => {
10422
+ this.toggle(evt);
10346
10423
  });
10347
10424
  this.thumbnailButton.addEventListener("click", () => {
10348
10425
  this.switchView(_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SidebarView.THUMBS);
@@ -11080,6 +11157,7 @@ class PDFPageViewBuffer {
11080
11157
  class PDFViewer {
11081
11158
  #buffer = null;
11082
11159
  #altTextManager = null;
11160
+ #annotationEditorHighlightColors = null;
11083
11161
  #annotationEditorMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE;
11084
11162
  #annotationEditorUIManager = null;
11085
11163
  #annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_FORMS;
@@ -11096,7 +11174,7 @@ class PDFViewer {
11096
11174
  #scaleTimeoutId = null;
11097
11175
  #textLayerMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.TextLayerMode.ENABLE;
11098
11176
  constructor(options) {
11099
- const viewerVersion = '4.0.269';
11177
+ const viewerVersion = '4.0.379';
11100
11178
  if (pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.version !== viewerVersion) {
11101
11179
  throw new Error(`The API version "${pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.version}" does not match the Viewer version "${viewerVersion}".`);
11102
11180
  }
@@ -11121,6 +11199,7 @@ class PDFViewer {
11121
11199
  this.#textLayerMode = options.textLayerMode ?? _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.TextLayerMode.ENABLE;
11122
11200
  this.#annotationMode = options.annotationMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_FORMS;
11123
11201
  this.#annotationEditorMode = options.annotationEditorMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE;
11202
+ this.#annotationEditorHighlightColors = options.annotationEditorHighlightColors || null;
11124
11203
  this.imageResourcesPath = options.imageResourcesPath || "";
11125
11204
  this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
11126
11205
  this.removePageBorders = options.removePageBorders || false;
@@ -11503,7 +11582,11 @@ class PDFViewer {
11503
11582
  if (pdfDocument.isPureXfa) {
11504
11583
  console.warn("Warning: XFA-editing is not implemented.");
11505
11584
  } else if (isValidAnnotationEditorMode(mode)) {
11506
- this.#annotationEditorUIManager = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorUIManager(this.container, this.viewer, this.#altTextManager, this.eventBus, pdfDocument, this.pageColors);
11585
+ this.#annotationEditorUIManager = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorUIManager(this.container, this.viewer, this.#altTextManager, this.eventBus, pdfDocument, this.pageColors, this.#annotationEditorHighlightColors);
11586
+ this.eventBus.dispatch("annotationeditoruimanager", {
11587
+ source: this,
11588
+ uiManager: this.#annotationEditorUIManager
11589
+ });
11507
11590
  if (mode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE) {
11508
11591
  this.#annotationEditorUIManager.updateMode(mode);
11509
11592
  }
@@ -12541,7 +12624,9 @@ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
12541
12624
  /* harmony export */ AnnotationEditorUIManager: () => (/* binding */ AnnotationEditorUIManager),
12542
12625
  /* harmony export */ AnnotationLayer: () => (/* binding */ AnnotationLayer),
12543
12626
  /* harmony export */ AnnotationMode: () => (/* binding */ AnnotationMode),
12627
+ /* harmony export */ ColorPicker: () => (/* binding */ ColorPicker),
12544
12628
  /* harmony export */ DOMSVGFactory: () => (/* binding */ DOMSVGFactory),
12629
+ /* harmony export */ DrawLayer: () => (/* binding */ DrawLayer),
12545
12630
  /* harmony export */ FeatureTest: () => (/* binding */ FeatureTest),
12546
12631
  /* harmony export */ GlobalWorkerOptions: () => (/* binding */ GlobalWorkerOptions),
12547
12632
  /* harmony export */ InvalidPDFException: () => (/* binding */ InvalidPDFException),
@@ -12572,7 +12657,7 @@ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
12572
12657
  /* harmony export */ updateTextLayer: () => (/* binding */ updateTextLayer),
12573
12658
  /* harmony export */ version: () => (/* binding */ version)
12574
12659
  /* harmony export */ });
12575
- /* unused harmony exports CMapCompressionType, DrawLayer, ImageKind, OPS, Outliner, PDFDataRangeTransport, Util, VerbosityLevel */
12660
+ /* unused harmony exports CMapCompressionType, ImageKind, OPS, Outliner, PDFDataRangeTransport, Util, VerbosityLevel */
12576
12661
  if (!globalThis.pdfjsLib) {
12577
12662
  await globalThis.pdfjsLibPromise;
12578
12663
  }
@@ -12586,6 +12671,7 @@ const {
12586
12671
  AnnotationMode,
12587
12672
  build,
12588
12673
  CMapCompressionType,
12674
+ ColorPicker,
12589
12675
  createValidAbsoluteUrl,
12590
12676
  DOMSVGFactory,
12591
12677
  DrawLayer,
@@ -12645,10 +12731,12 @@ class BasePreferences {
12645
12731
  "defaultZoomDelay": 400,
12646
12732
  "defaultZoomValue": "",
12647
12733
  "disablePageLabels": false,
12734
+ "enableHighlightEditor": false,
12648
12735
  "enablePermissions": false,
12649
12736
  "enablePrintAutoRotate": true,
12650
12737
  "enableScripting": true,
12651
12738
  "externalLinkTarget": 0,
12739
+ "highlightEditorColors": "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
12652
12740
  "historyUpdateUrl": false,
12653
12741
  "ignoreDestinationZoom": false,
12654
12742
  "forcePageColors": false,
@@ -12811,10 +12899,10 @@ _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.th
12811
12899
 
12812
12900
 
12813
12901
  class SecondaryToolbar {
12902
+ #opts;
12814
12903
  constructor(options, eventBus) {
12815
- this.toolbar = options.toolbar;
12816
- this.toggleButton = options.toggleButton;
12817
- this.buttons = [{
12904
+ this.#opts = options;
12905
+ const buttons = [{
12818
12906
  element: options.presentationModeButton,
12819
12907
  eventName: "presentationmode",
12820
12908
  close: true
@@ -12914,23 +13002,14 @@ class SecondaryToolbar {
12914
13002
  eventName: "documentproperties",
12915
13003
  close: true
12916
13004
  }];
12917
- this.buttons.push({
13005
+ buttons.push({
12918
13006
  element: options.openFileButton,
12919
13007
  eventName: "openfile",
12920
13008
  close: true
12921
13009
  });
12922
- this.items = {
12923
- firstPage: options.firstPageButton,
12924
- lastPage: options.lastPageButton,
12925
- pageRotateCw: options.pageRotateCwButton,
12926
- pageRotateCcw: options.pageRotateCcwButton
12927
- };
12928
13010
  this.eventBus = eventBus;
12929
13011
  this.opened = false;
12930
- this.#bindClickListeners();
12931
- this.#bindCursorToolsListener(options);
12932
- this.#bindScrollModeListener(options);
12933
- this.#bindSpreadModeListener(options);
13012
+ this.#bindListeners(buttons);
12934
13013
  this.reset();
12935
13014
  }
12936
13015
  get isOpen() {
@@ -12948,27 +13027,42 @@ class SecondaryToolbar {
12948
13027
  this.pageNumber = 0;
12949
13028
  this.pagesCount = 0;
12950
13029
  this.#updateUIState();
12951
- this.eventBus.dispatch("secondarytoolbarreset", {
12952
- source: this
13030
+ this.#scrollModeChanged({
13031
+ mode: _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.VERTICAL
13032
+ });
13033
+ this.#spreadModeChanged({
13034
+ mode: _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.NONE
12953
13035
  });
12954
13036
  }
12955
13037
  #updateUIState() {
12956
- this.items.firstPage.disabled = this.pageNumber <= 1;
12957
- this.items.lastPage.disabled = this.pageNumber >= this.pagesCount;
12958
- this.items.pageRotateCw.disabled = this.pagesCount === 0;
12959
- this.items.pageRotateCcw.disabled = this.pagesCount === 0;
12960
- }
12961
- #bindClickListeners() {
12962
- this.toggleButton.addEventListener("click", this.toggle.bind(this));
13038
+ const {
13039
+ firstPageButton,
13040
+ lastPageButton,
13041
+ pageRotateCwButton,
13042
+ pageRotateCcwButton
13043
+ } = this.#opts;
13044
+ firstPageButton.disabled = this.pageNumber <= 1;
13045
+ lastPageButton.disabled = this.pageNumber >= this.pagesCount;
13046
+ pageRotateCwButton.disabled = this.pagesCount === 0;
13047
+ pageRotateCcwButton.disabled = this.pagesCount === 0;
13048
+ }
13049
+ #bindListeners(buttons) {
13050
+ const {
13051
+ eventBus
13052
+ } = this;
13053
+ const {
13054
+ toggleButton
13055
+ } = this.#opts;
13056
+ toggleButton.addEventListener("click", this.toggle.bind(this));
12963
13057
  for (const {
12964
13058
  element,
12965
13059
  eventName,
12966
13060
  close,
12967
13061
  eventDetails
12968
- } of this.buttons) {
13062
+ } of buttons) {
12969
13063
  element.addEventListener("click", evt => {
12970
13064
  if (eventName !== null) {
12971
- this.eventBus.dispatch(eventName, {
13065
+ eventBus.dispatch(eventName, {
12972
13066
  source: this,
12973
13067
  ...eventDetails
12974
13068
  });
@@ -12976,7 +13070,7 @@ class SecondaryToolbar {
12976
13070
  if (close) {
12977
13071
  this.close();
12978
13072
  }
12979
- this.eventBus.dispatch("reporttelemetry", {
13073
+ eventBus.dispatch("reporttelemetry", {
12980
13074
  source: this,
12981
13075
  details: {
12982
13076
  type: "buttons",
@@ -12987,87 +13081,79 @@ class SecondaryToolbar {
12987
13081
  });
12988
13082
  });
12989
13083
  }
13084
+ eventBus._on("cursortoolchanged", this.#cursorToolChanged.bind(this));
13085
+ eventBus._on("scrollmodechanged", this.#scrollModeChanged.bind(this));
13086
+ eventBus._on("spreadmodechanged", this.#spreadModeChanged.bind(this));
12990
13087
  }
12991
- #bindCursorToolsListener({
12992
- cursorSelectToolButton,
12993
- cursorHandToolButton
13088
+ #cursorToolChanged({
13089
+ tool
12994
13090
  }) {
12995
- this.eventBus._on("cursortoolchanged", ({
12996
- tool
12997
- }) => {
12998
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(cursorSelectToolButton, tool === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.CursorTool.SELECT);
12999
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(cursorHandToolButton, tool === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.CursorTool.HAND);
13000
- });
13001
- }
13002
- #bindScrollModeListener({
13003
- scrollPageButton,
13004
- scrollVerticalButton,
13005
- scrollHorizontalButton,
13006
- scrollWrappedButton,
13007
- spreadNoneButton,
13008
- spreadOddButton,
13009
- spreadEvenButton
13091
+ const {
13092
+ cursorSelectToolButton,
13093
+ cursorHandToolButton
13094
+ } = this.#opts;
13095
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(cursorSelectToolButton, tool === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.CursorTool.SELECT);
13096
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(cursorHandToolButton, tool === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.CursorTool.HAND);
13097
+ }
13098
+ #scrollModeChanged({
13099
+ mode
13010
13100
  }) {
13011
- const scrollModeChanged = ({
13012
- mode
13013
- }) => {
13014
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(scrollPageButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.PAGE);
13015
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(scrollVerticalButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.VERTICAL);
13016
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(scrollHorizontalButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.HORIZONTAL);
13017
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(scrollWrappedButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.WRAPPED);
13018
- const forceScrollModePage = this.pagesCount > _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__.PagesCountLimit.FORCE_SCROLL_MODE_PAGE;
13019
- scrollPageButton.disabled = forceScrollModePage;
13020
- scrollVerticalButton.disabled = forceScrollModePage;
13021
- scrollHorizontalButton.disabled = forceScrollModePage;
13022
- scrollWrappedButton.disabled = forceScrollModePage;
13023
- const isHorizontal = mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.HORIZONTAL;
13024
- spreadNoneButton.disabled = isHorizontal;
13025
- spreadOddButton.disabled = isHorizontal;
13026
- spreadEvenButton.disabled = isHorizontal;
13027
- };
13028
- this.eventBus._on("scrollmodechanged", scrollModeChanged);
13029
- this.eventBus._on("secondarytoolbarreset", evt => {
13030
- if (evt.source === this) {
13031
- scrollModeChanged({
13032
- mode: _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.VERTICAL
13033
- });
13034
- }
13035
- });
13036
- }
13037
- #bindSpreadModeListener({
13038
- spreadNoneButton,
13039
- spreadOddButton,
13040
- spreadEvenButton
13101
+ const {
13102
+ scrollPageButton,
13103
+ scrollVerticalButton,
13104
+ scrollHorizontalButton,
13105
+ scrollWrappedButton,
13106
+ spreadNoneButton,
13107
+ spreadOddButton,
13108
+ spreadEvenButton
13109
+ } = this.#opts;
13110
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(scrollPageButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.PAGE);
13111
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(scrollVerticalButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.VERTICAL);
13112
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(scrollHorizontalButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.HORIZONTAL);
13113
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(scrollWrappedButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.WRAPPED);
13114
+ const forceScrollModePage = this.pagesCount > _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__.PagesCountLimit.FORCE_SCROLL_MODE_PAGE;
13115
+ scrollPageButton.disabled = forceScrollModePage;
13116
+ scrollVerticalButton.disabled = forceScrollModePage;
13117
+ scrollHorizontalButton.disabled = forceScrollModePage;
13118
+ scrollWrappedButton.disabled = forceScrollModePage;
13119
+ const isHorizontal = mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.HORIZONTAL;
13120
+ spreadNoneButton.disabled = isHorizontal;
13121
+ spreadOddButton.disabled = isHorizontal;
13122
+ spreadEvenButton.disabled = isHorizontal;
13123
+ }
13124
+ #spreadModeChanged({
13125
+ mode
13041
13126
  }) {
13042
- const spreadModeChanged = ({
13043
- mode
13044
- }) => {
13045
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(spreadNoneButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.NONE);
13046
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(spreadOddButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.ODD);
13047
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(spreadEvenButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.EVEN);
13048
- };
13049
- this.eventBus._on("spreadmodechanged", spreadModeChanged);
13050
- this.eventBus._on("secondarytoolbarreset", evt => {
13051
- if (evt.source === this) {
13052
- spreadModeChanged({
13053
- mode: _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.NONE
13054
- });
13055
- }
13056
- });
13127
+ const {
13128
+ spreadNoneButton,
13129
+ spreadOddButton,
13130
+ spreadEvenButton
13131
+ } = this.#opts;
13132
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(spreadNoneButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.NONE);
13133
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(spreadOddButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.ODD);
13134
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleCheckedBtn)(spreadEvenButton, mode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.EVEN);
13057
13135
  }
13058
13136
  open() {
13059
13137
  if (this.opened) {
13060
13138
  return;
13061
13139
  }
13062
13140
  this.opened = true;
13063
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleExpandedBtn)(this.toggleButton, true, this.toolbar);
13141
+ const {
13142
+ toggleButton,
13143
+ toolbar
13144
+ } = this.#opts;
13145
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleExpandedBtn)(toggleButton, true, toolbar);
13064
13146
  }
13065
13147
  close() {
13066
13148
  if (!this.opened) {
13067
13149
  return;
13068
13150
  }
13069
13151
  this.opened = false;
13070
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleExpandedBtn)(this.toggleButton, false, this.toolbar);
13152
+ const {
13153
+ toggleButton,
13154
+ toolbar
13155
+ } = this.#opts;
13156
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.toggleExpandedBtn)(toggleButton, false, toolbar);
13071
13157
  }
13072
13158
  toggle() {
13073
13159
  if (this.opened) {
@@ -13774,10 +13860,11 @@ pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ?
13774
13860
 
13775
13861
 
13776
13862
  class Toolbar {
13863
+ #opts;
13777
13864
  constructor(options, eventBus) {
13778
- this.toolbar = options.container;
13865
+ this.#opts = options;
13779
13866
  this.eventBus = eventBus;
13780
- this.buttons = [{
13867
+ const buttons = [{
13781
13868
  element: options.previous,
13782
13869
  eventName: "previouspage"
13783
13870
  }, {
@@ -13806,6 +13893,17 @@ class Toolbar {
13806
13893
  return classList.contains("toggled") ? pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE : pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.FREETEXT;
13807
13894
  }
13808
13895
  }
13896
+ }, {
13897
+ element: options.editorHighlightButton,
13898
+ eventName: "switchannotationeditormode",
13899
+ eventDetails: {
13900
+ get mode() {
13901
+ const {
13902
+ classList
13903
+ } = options.editorHighlightButton;
13904
+ return classList.contains("toggled") ? pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE : pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.HIGHLIGHT;
13905
+ }
13906
+ }
13809
13907
  }, {
13810
13908
  element: options.editorInkButton,
13811
13909
  eventName: "switchannotationeditormode",
@@ -13829,19 +13927,25 @@ class Toolbar {
13829
13927
  }
13830
13928
  }
13831
13929
  }];
13832
- this.items = {
13833
- numPages: options.numPages,
13834
- pageNumber: options.pageNumber,
13835
- scaleSelect: options.scaleSelect,
13836
- customScaleOption: options.customScaleOption,
13837
- previous: options.previous,
13838
- next: options.next,
13839
- zoomIn: options.zoomIn,
13840
- zoomOut: options.zoomOut
13841
- };
13842
- this.#bindListeners(options);
13930
+ this.#bindListeners(buttons);
13931
+ if (options.editorHighlightColorPicker) {
13932
+ eventBus._on("annotationeditoruimanager", ({
13933
+ uiManager
13934
+ }) => {
13935
+ this.#setAnnotationEditorUIManager(uiManager, options.editorHighlightColorPicker);
13936
+ }, {
13937
+ once: true
13938
+ });
13939
+ }
13843
13940
  this.reset();
13844
13941
  }
13942
+ #setAnnotationEditorUIManager(uiManager, parentContainer) {
13943
+ const colorPicker = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.ColorPicker({
13944
+ uiManager
13945
+ });
13946
+ uiManager.setMainHighlightColorPicker(colorPicker);
13947
+ parentContainer.append(colorPicker.renderMainDropdown());
13948
+ }
13845
13949
  setPageNumber(pageNumber, pageLabel) {
13846
13950
  this.pageNumber = pageNumber;
13847
13951
  this.pageLabel = pageLabel;
@@ -13866,24 +13970,27 @@ class Toolbar {
13866
13970
  this.pageScale = _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_SCALE;
13867
13971
  this.#updateUIState(true);
13868
13972
  this.updateLoadingIndicatorState();
13869
- this.eventBus.dispatch("toolbarreset", {
13870
- source: this
13973
+ this.#editorModeChanged({
13974
+ mode: pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.DISABLE
13871
13975
  });
13872
13976
  }
13873
- #bindListeners(options) {
13977
+ #bindListeners(buttons) {
13978
+ const {
13979
+ eventBus
13980
+ } = this;
13874
13981
  const {
13875
13982
  pageNumber,
13876
13983
  scaleSelect
13877
- } = this.items;
13984
+ } = this.#opts;
13878
13985
  const self = this;
13879
13986
  for (const {
13880
13987
  element,
13881
13988
  eventName,
13882
13989
  eventDetails
13883
- } of this.buttons) {
13990
+ } of buttons) {
13884
13991
  element.addEventListener("click", evt => {
13885
13992
  if (eventName !== null) {
13886
- this.eventBus.dispatch(eventName, {
13993
+ eventBus.dispatch(eventName, {
13887
13994
  source: this,
13888
13995
  ...eventDetails,
13889
13996
  isFromKeyboard: evt.detail === 0
@@ -13895,7 +14002,7 @@ class Toolbar {
13895
14002
  this.select();
13896
14003
  });
13897
14004
  pageNumber.addEventListener("change", function () {
13898
- self.eventBus.dispatch("pagenumberchanged", {
14005
+ eventBus.dispatch("pagenumberchanged", {
13899
14006
  source: self,
13900
14007
  value: this.value
13901
14008
  });
@@ -13904,84 +14011,80 @@ class Toolbar {
13904
14011
  if (this.value === "custom") {
13905
14012
  return;
13906
14013
  }
13907
- self.eventBus.dispatch("scalechanged", {
14014
+ eventBus.dispatch("scalechanged", {
13908
14015
  source: self,
13909
14016
  value: this.value
13910
14017
  });
13911
14018
  });
13912
- scaleSelect.addEventListener("click", function (evt) {
13913
- const target = evt.target;
14019
+ scaleSelect.addEventListener("click", function ({
14020
+ target
14021
+ }) {
13914
14022
  if (this.value === self.pageScaleValue && target.tagName.toUpperCase() === "OPTION") {
13915
14023
  this.blur();
13916
14024
  }
13917
14025
  });
13918
14026
  scaleSelect.oncontextmenu = pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.noContextMenu;
13919
- this.#bindEditorToolsListener(options);
13920
- }
13921
- #bindEditorToolsListener({
13922
- editorFreeTextButton,
13923
- editorFreeTextParamsToolbar,
13924
- editorInkButton,
13925
- editorInkParamsToolbar,
13926
- editorStampButton,
13927
- editorStampParamsToolbar
14027
+ eventBus._on("annotationeditormodechanged", this.#editorModeChanged.bind(this));
14028
+ }
14029
+ #editorModeChanged({
14030
+ mode
13928
14031
  }) {
13929
- const editorModeChanged = ({
13930
- mode
13931
- }) => {
13932
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.toggleCheckedBtn)(editorFreeTextButton, mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.FREETEXT, editorFreeTextParamsToolbar);
13933
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.toggleCheckedBtn)(editorInkButton, mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.INK, editorInkParamsToolbar);
13934
- (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.toggleCheckedBtn)(editorStampButton, mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.STAMP, editorStampParamsToolbar);
13935
- const isDisable = mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.DISABLE;
13936
- editorFreeTextButton.disabled = isDisable;
13937
- editorInkButton.disabled = isDisable;
13938
- editorStampButton.disabled = isDisable;
13939
- };
13940
- this.eventBus._on("annotationeditormodechanged", editorModeChanged);
13941
- this.eventBus._on("toolbarreset", evt => {
13942
- if (evt.source === this) {
13943
- editorModeChanged({
13944
- mode: pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.DISABLE
13945
- });
13946
- }
13947
- });
14032
+ const {
14033
+ editorFreeTextButton,
14034
+ editorFreeTextParamsToolbar,
14035
+ editorHighlightButton,
14036
+ editorHighlightParamsToolbar,
14037
+ editorInkButton,
14038
+ editorInkParamsToolbar,
14039
+ editorStampButton,
14040
+ editorStampParamsToolbar
14041
+ } = this.#opts;
14042
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.toggleCheckedBtn)(editorFreeTextButton, mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.FREETEXT, editorFreeTextParamsToolbar);
14043
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.toggleCheckedBtn)(editorHighlightButton, mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.HIGHLIGHT, editorHighlightParamsToolbar);
14044
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.toggleCheckedBtn)(editorInkButton, mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.INK, editorInkParamsToolbar);
14045
+ (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.toggleCheckedBtn)(editorStampButton, mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.STAMP, editorStampParamsToolbar);
14046
+ const isDisable = mode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.DISABLE;
14047
+ editorFreeTextButton.disabled = isDisable;
14048
+ editorHighlightButton.disabled = isDisable;
14049
+ editorInkButton.disabled = isDisable;
14050
+ editorStampButton.disabled = isDisable;
13948
14051
  }
13949
14052
  #updateUIState(resetNumPages = false) {
13950
14053
  const {
13951
14054
  pageNumber,
13952
14055
  pagesCount,
13953
14056
  pageScaleValue,
13954
- pageScale,
13955
- items
14057
+ pageScale
13956
14058
  } = this;
14059
+ const opts = this.#opts;
13957
14060
  if (resetNumPages) {
13958
14061
  if (this.hasPageLabels) {
13959
- items.pageNumber.type = "text";
13960
- items.numPages.setAttribute("data-l10n-id", "pdfjs-page-of-pages");
14062
+ opts.pageNumber.type = "text";
14063
+ opts.numPages.setAttribute("data-l10n-id", "pdfjs-page-of-pages");
13961
14064
  } else {
13962
- items.pageNumber.type = "number";
13963
- items.numPages.setAttribute("data-l10n-id", "pdfjs-of-pages");
13964
- items.numPages.setAttribute("data-l10n-args", JSON.stringify({
14065
+ opts.pageNumber.type = "number";
14066
+ opts.numPages.setAttribute("data-l10n-id", "pdfjs-of-pages");
14067
+ opts.numPages.setAttribute("data-l10n-args", JSON.stringify({
13965
14068
  pagesCount
13966
14069
  }));
13967
14070
  }
13968
- items.pageNumber.max = pagesCount;
14071
+ opts.pageNumber.max = pagesCount;
13969
14072
  }
13970
14073
  if (this.hasPageLabels) {
13971
- items.pageNumber.value = this.pageLabel;
13972
- items.numPages.setAttribute("data-l10n-args", JSON.stringify({
14074
+ opts.pageNumber.value = this.pageLabel;
14075
+ opts.numPages.setAttribute("data-l10n-args", JSON.stringify({
13973
14076
  pageNumber,
13974
14077
  pagesCount
13975
14078
  }));
13976
14079
  } else {
13977
- items.pageNumber.value = pageNumber;
14080
+ opts.pageNumber.value = pageNumber;
13978
14081
  }
13979
- items.previous.disabled = pageNumber <= 1;
13980
- items.next.disabled = pageNumber >= pagesCount;
13981
- items.zoomOut.disabled = pageScale <= _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.MIN_SCALE;
13982
- items.zoomIn.disabled = pageScale >= _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.MAX_SCALE;
14082
+ opts.previous.disabled = pageNumber <= 1;
14083
+ opts.next.disabled = pageNumber >= pagesCount;
14084
+ opts.zoomOut.disabled = pageScale <= _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.MIN_SCALE;
14085
+ opts.zoomIn.disabled = pageScale >= _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.MAX_SCALE;
13983
14086
  let predefinedValueFound = false;
13984
- for (const option of items.scaleSelect.options) {
14087
+ for (const option of opts.scaleSelect.options) {
13985
14088
  if (option.value !== pageScaleValue) {
13986
14089
  option.selected = false;
13987
14090
  continue;
@@ -13990,8 +14093,8 @@ class Toolbar {
13990
14093
  predefinedValueFound = true;
13991
14094
  }
13992
14095
  if (!predefinedValueFound) {
13993
- items.customScaleOption.selected = true;
13994
- items.customScaleOption.setAttribute("data-l10n-args", JSON.stringify({
14096
+ opts.customScaleOption.selected = true;
14097
+ opts.customScaleOption.setAttribute("data-l10n-args", JSON.stringify({
13995
14098
  scale: Math.round(pageScale * 10000) / 100
13996
14099
  }));
13997
14100
  }
@@ -13999,7 +14102,7 @@ class Toolbar {
13999
14102
  updateLoadingIndicatorState(loading = false) {
14000
14103
  const {
14001
14104
  pageNumber
14002
- } = this.items;
14105
+ } = this.#opts;
14003
14106
  pageNumber.classList.toggle("loading", loading);
14004
14107
  }
14005
14108
  }
@@ -14635,8 +14738,8 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([web_
14635
14738
 
14636
14739
 
14637
14740
 
14638
- const pdfjsVersion = '4.0.269';
14639
- const pdfjsBuild = 'f4b396f6c';
14741
+ const pdfjsVersion = '4.0.379';
14742
+ const pdfjsBuild = '9e14d04fd';
14640
14743
  const AppConstants = {
14641
14744
  LinkTarget: _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_4__.LinkTarget,
14642
14745
  RenderingStates: _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates,
@@ -14665,6 +14768,9 @@ function getViewerConfiguration() {
14665
14768
  print: document.getElementById("print"),
14666
14769
  editorFreeTextButton: document.getElementById("editorFreeText"),
14667
14770
  editorFreeTextParamsToolbar: document.getElementById("editorFreeTextParamsToolbar"),
14771
+ editorHighlightButton: document.getElementById("editorHighlight"),
14772
+ editorHighlightParamsToolbar: document.getElementById("editorHighlightParamsToolbar"),
14773
+ editorHighlightColorPicker: document.getElementById("editorHighlightColorPicker"),
14668
14774
  editorInkButton: document.getElementById("editorInk"),
14669
14775
  editorInkParamsToolbar: document.getElementById("editorInkParamsToolbar"),
14670
14776
  editorStampButton: document.getElementById("editorStamp"),
@@ -14707,7 +14813,6 @@ function getViewerConfiguration() {
14707
14813
  outlineView: document.getElementById("outlineView"),
14708
14814
  attachmentsView: document.getElementById("attachmentsView"),
14709
14815
  layersView: document.getElementById("layersView"),
14710
- outlineOptionsContainer: document.getElementById("outlineOptionsContainer"),
14711
14816
  currentOutlineItemButton: document.getElementById("currentOutlineItem")
14712
14817
  },
14713
14818
  findBar: {