pdfjs-dist 2.6.347 → 2.7.570

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.

Potentially problematic release.


This version of pdfjs-dist might be problematic. Click here for more details.

Files changed (158) hide show
  1. package/README.md +3 -3
  2. package/bower.json +1 -1
  3. package/build/pdf.js +2050 -1087
  4. package/build/pdf.js.map +1 -1
  5. package/build/pdf.min.js +1 -1
  6. package/build/pdf.worker.js +18219 -10436
  7. package/build/pdf.worker.js.map +1 -1
  8. package/build/pdf.worker.min.js +1 -1
  9. package/es5/build/pdf.d.ts +1 -0
  10. package/es5/build/pdf.js +6623 -6654
  11. package/es5/build/pdf.js.map +1 -1
  12. package/es5/build/pdf.min.js +1 -1
  13. package/es5/build/pdf.worker.js +20815 -13888
  14. package/es5/build/pdf.worker.js.map +1 -1
  15. package/es5/build/pdf.worker.min.js +1 -1
  16. package/es5/image_decoders/pdf.image_decoders.js +3817 -4946
  17. package/es5/image_decoders/pdf.image_decoders.js.map +1 -1
  18. package/es5/image_decoders/pdf.image_decoders.min.js +1 -1
  19. package/es5/web/pdf_viewer.css +18 -15
  20. package/es5/web/pdf_viewer.js +1094 -514
  21. package/es5/web/pdf_viewer.js.map +1 -1
  22. package/image_decoders/pdf.image_decoders.js +774 -168
  23. package/image_decoders/pdf.image_decoders.js.map +1 -1
  24. package/image_decoders/pdf.image_decoders.min.js +1 -1
  25. package/lib/core/annotation.js +556 -108
  26. package/lib/core/cff_parser.js +7 -1
  27. package/lib/core/charsets.js +1 -1
  28. package/lib/core/cmap.js +20 -1
  29. package/lib/core/core_utils.js +162 -3
  30. package/lib/core/crypto.js +1 -1
  31. package/lib/core/default_appearance.js +132 -0
  32. package/lib/core/document.js +115 -9
  33. package/lib/core/encodings.js +1 -1
  34. package/lib/core/evaluator.js +168 -74
  35. package/lib/core/fonts.js +97 -11
  36. package/lib/core/function.js +5 -10
  37. package/lib/core/glyphlist.js +11 -4529
  38. package/lib/core/image_utils.js +30 -1
  39. package/lib/core/jpg.js +1 -1
  40. package/lib/core/jpx.js +5 -5
  41. package/lib/core/murmurhash3.js +1 -1
  42. package/lib/core/obj.js +123 -39
  43. package/lib/core/pattern.js +4 -4
  44. package/lib/core/primitives.js +24 -5
  45. package/lib/core/standard_fonts.js +1 -1
  46. package/lib/core/stream.js +5 -1
  47. package/lib/core/unicode.js +15 -1387
  48. package/lib/core/worker.js +58 -17
  49. package/lib/core/writer.js +68 -4
  50. package/lib/display/annotation_layer.js +712 -119
  51. package/lib/display/annotation_storage.js +21 -4
  52. package/lib/display/api.js +88 -18
  53. package/lib/display/canvas.js +414 -375
  54. package/lib/display/display_utils.js +11 -4
  55. package/lib/display/fetch_stream.js +3 -3
  56. package/lib/display/font_loader.js +2 -3
  57. package/lib/display/metadata.js +54 -20
  58. package/lib/display/node_stream.js +1 -1
  59. package/lib/display/optional_content_config.js +1 -1
  60. package/lib/display/pattern_helper.js +109 -113
  61. package/lib/display/svg.js +5 -5
  62. package/lib/display/text_layer.js +54 -54
  63. package/lib/display/transport_stream.js +4 -4
  64. package/lib/display/webgl.js +65 -68
  65. package/lib/examples/node/domstubs.js +9 -4
  66. package/lib/pdf.js +2 -2
  67. package/lib/pdf.sandbox.js +311 -0
  68. package/lib/pdf.worker.js +2 -2
  69. package/lib/shared/scripting_utils.js +84 -0
  70. package/lib/shared/util.js +129 -14
  71. package/lib/{display → shared}/xml_parser.js +112 -4
  72. package/lib/test/unit/annotation_spec.js +831 -109
  73. package/lib/test/unit/annotation_storage_spec.js +28 -10
  74. package/lib/test/unit/api_spec.js +190 -160
  75. package/lib/test/unit/bidi_spec.js +6 -6
  76. package/lib/test/unit/cff_parser_spec.js +73 -73
  77. package/lib/test/unit/clitests_helper.js +2 -0
  78. package/lib/test/unit/cmap_spec.js +48 -74
  79. package/lib/test/unit/core_utils_spec.js +34 -0
  80. package/lib/test/unit/crypto_spec.js +162 -199
  81. package/lib/test/unit/custom_spec.js +7 -18
  82. package/lib/test/unit/default_appearance_spec.js +54 -0
  83. package/lib/test/unit/display_svg_spec.js +24 -19
  84. package/lib/test/unit/display_utils_spec.js +1 -1
  85. package/lib/test/unit/document_spec.js +187 -20
  86. package/lib/test/unit/evaluator_spec.js +30 -30
  87. package/lib/test/unit/function_spec.js +165 -165
  88. package/lib/test/unit/jasmine-boot.js +52 -53
  89. package/lib/test/unit/metadata_spec.js +2 -2
  90. package/lib/test/unit/murmurhash3_spec.js +29 -16
  91. package/lib/test/unit/network_spec.js +21 -21
  92. package/lib/test/unit/pdf_find_controller_spec.js +131 -69
  93. package/lib/test/unit/pdf_find_utils_spec.js +10 -10
  94. package/lib/test/unit/scripting_spec.js +1104 -0
  95. package/lib/test/unit/stream_spec.js +8 -8
  96. package/lib/test/unit/test_utils.js +16 -19
  97. package/lib/test/unit/testreporter.js +11 -4
  98. package/lib/test/unit/type1_parser_spec.js +23 -23
  99. package/lib/test/unit/ui_utils_spec.js +78 -35
  100. package/lib/test/unit/unicode_spec.js +7 -7
  101. package/lib/test/unit/util_spec.js +26 -3
  102. package/lib/test/unit/writer_spec.js +16 -1
  103. package/lib/test/unit/xml_spec.js +117 -0
  104. package/lib/web/annotation_layer_builder.js +18 -6
  105. package/lib/web/app.js +579 -161
  106. package/lib/web/app_options.js +14 -0
  107. package/lib/web/base_tree_viewer.js +50 -0
  108. package/lib/web/base_viewer.js +350 -14
  109. package/lib/web/chromecom.js +9 -1
  110. package/lib/web/debugger.js +1 -2
  111. package/lib/web/download_manager.js +0 -15
  112. package/lib/web/firefox_print_service.js +6 -4
  113. package/lib/web/firefoxcom.js +84 -69
  114. package/lib/web/generic_scripting.js +55 -0
  115. package/lib/web/genericcom.js +9 -1
  116. package/lib/web/grab_to_pan.js +1 -1
  117. package/lib/web/interfaces.js +9 -3
  118. package/lib/web/pdf_attachment_viewer.js +1 -3
  119. package/lib/web/pdf_cursor_tools.js +20 -13
  120. package/lib/web/pdf_document_properties.js +48 -61
  121. package/lib/web/pdf_find_bar.js +1 -3
  122. package/lib/web/pdf_find_controller.js +58 -12
  123. package/lib/web/pdf_history.js +43 -21
  124. package/lib/web/pdf_layer_viewer.js +1 -9
  125. package/lib/web/pdf_link_service.js +108 -78
  126. package/lib/web/pdf_outline_viewer.js +166 -10
  127. package/lib/web/pdf_page_view.js +14 -14
  128. package/lib/web/pdf_presentation_mode.js +21 -31
  129. package/lib/web/pdf_rendering_queue.js +8 -1
  130. package/lib/web/pdf_sidebar.js +62 -107
  131. package/lib/web/pdf_sidebar_resizer.js +11 -21
  132. package/lib/web/pdf_single_page_viewer.js +8 -0
  133. package/lib/web/pdf_thumbnail_view.js +26 -26
  134. package/lib/web/pdf_thumbnail_viewer.js +13 -2
  135. package/lib/web/pdf_viewer.component.js +2 -2
  136. package/lib/web/pdf_viewer.js +3 -1
  137. package/lib/web/preferences.js +33 -44
  138. package/lib/web/text_layer_builder.js +2 -9
  139. package/lib/web/ui_utils.js +78 -46
  140. package/lib/web/viewer_compatibility.js +1 -2
  141. package/package.json +4 -1
  142. package/types/display/annotation_layer.d.ts +18 -3
  143. package/types/display/api.d.ts +110 -54
  144. package/types/display/canvas.d.ts +1 -1
  145. package/types/display/display_utils.d.ts +96 -95
  146. package/types/display/fetch_stream.d.ts +2 -2
  147. package/types/display/metadata.d.ts +4 -0
  148. package/types/display/pattern_helper.d.ts +1 -1
  149. package/types/display/text_layer.d.ts +7 -7
  150. package/types/display/transport_stream.d.ts +1 -1
  151. package/types/shared/scripting_utils.d.ts +12 -0
  152. package/types/shared/util.d.ts +281 -250
  153. package/types/shared/xml_parser.d.ts +64 -0
  154. package/web/pdf_viewer.css +18 -15
  155. package/web/pdf_viewer.js +809 -408
  156. package/web/pdf_viewer.js.map +1 -1
  157. package/webpack.js +1 -1
  158. package/types/display/xml_parser.d.ts +0 -35
@@ -30,181 +30,100 @@
30
30
  else
31
31
  root["pdfjs-dist/image_decoders/pdf.image_decoders"] = root.pdfjsImageDecoders = factory();
32
32
  })(this, function() {
33
- return /******/ (function(modules) { // webpackBootstrap
34
- /******/ // The module cache
35
- /******/ var installedModules = {};
36
- /******/
37
- /******/ // The require function
38
- /******/ function __w_pdfjs_require__(moduleId) {
39
- /******/
40
- /******/ // Check if module is in cache
41
- /******/ if(installedModules[moduleId]) {
42
- /******/ return installedModules[moduleId].exports;
43
- /******/ }
44
- /******/ // Create a new module (and put it into the cache)
45
- /******/ var module = installedModules[moduleId] = {
46
- /******/ i: moduleId,
47
- /******/ l: false,
48
- /******/ exports: {}
49
- /******/ };
50
- /******/
51
- /******/ // Execute the module function
52
- /******/ modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__);
53
- /******/
54
- /******/ // Flag the module as loaded
55
- /******/ module.l = true;
56
- /******/
57
- /******/ // Return the exports of the module
58
- /******/ return module.exports;
59
- /******/ }
60
- /******/
61
- /******/
62
- /******/ // expose the modules object (__webpack_modules__)
63
- /******/ __w_pdfjs_require__.m = modules;
64
- /******/
65
- /******/ // expose the module cache
66
- /******/ __w_pdfjs_require__.c = installedModules;
67
- /******/
68
- /******/ // define getter function for harmony exports
69
- /******/ __w_pdfjs_require__.d = function(exports, name, getter) {
70
- /******/ if(!__w_pdfjs_require__.o(exports, name)) {
71
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
72
- /******/ }
73
- /******/ };
74
- /******/
75
- /******/ // define __esModule on exports
76
- /******/ __w_pdfjs_require__.r = function(exports) {
77
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
78
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
79
- /******/ }
80
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
81
- /******/ };
82
- /******/
83
- /******/ // create a fake namespace object
84
- /******/ // mode & 1: value is a module id, require it
85
- /******/ // mode & 2: merge all properties of value into the ns
86
- /******/ // mode & 4: return value when already ns object
87
- /******/ // mode & 8|1: behave like require
88
- /******/ __w_pdfjs_require__.t = function(value, mode) {
89
- /******/ if(mode & 1) value = __w_pdfjs_require__(value);
90
- /******/ if(mode & 8) return value;
91
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
92
- /******/ var ns = Object.create(null);
93
- /******/ __w_pdfjs_require__.r(ns);
94
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
95
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __w_pdfjs_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
96
- /******/ return ns;
97
- /******/ };
98
- /******/
99
- /******/ // getDefaultExport function for compatibility with non-harmony modules
100
- /******/ __w_pdfjs_require__.n = function(module) {
101
- /******/ var getter = module && module.__esModule ?
102
- /******/ function getDefault() { return module['default']; } :
103
- /******/ function getModuleExports() { return module; };
104
- /******/ __w_pdfjs_require__.d(getter, 'a', getter);
105
- /******/ return getter;
106
- /******/ };
107
- /******/
108
- /******/ // Object.prototype.hasOwnProperty.call
109
- /******/ __w_pdfjs_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
110
- /******/
111
- /******/ // __webpack_public_path__
112
- /******/ __w_pdfjs_require__.p = "";
113
- /******/
114
- /******/
115
- /******/ // Load entry module and return exports
116
- /******/ return __w_pdfjs_require__(__w_pdfjs_require__.s = 0);
117
- /******/ })
118
- /************************************************************************/
119
- /******/ ([
33
+ return /******/ (() => { // webpackBootstrap
34
+ /******/ "use strict";
35
+ /******/ var __webpack_modules__ = ([
120
36
  /* 0 */
121
- /***/ (function(module, exports, __w_pdfjs_require__) {
37
+ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
122
38
 
123
- "use strict";
124
39
 
125
40
 
126
- Object.defineProperty(exports, "__esModule", {
41
+ Object.defineProperty(exports, "__esModule", ({
127
42
  value: true
128
- });
129
- Object.defineProperty(exports, "getVerbosityLevel", {
43
+ }));
44
+ Object.defineProperty(exports, "getVerbosityLevel", ({
130
45
  enumerable: true,
131
46
  get: function () {
132
47
  return _util.getVerbosityLevel;
133
48
  }
134
- });
135
- Object.defineProperty(exports, "setVerbosityLevel", {
49
+ }));
50
+ Object.defineProperty(exports, "setVerbosityLevel", ({
136
51
  enumerable: true,
137
52
  get: function () {
138
53
  return _util.setVerbosityLevel;
139
54
  }
140
- });
141
- Object.defineProperty(exports, "Jbig2mage", {
55
+ }));
56
+ Object.defineProperty(exports, "Jbig2mage", ({
142
57
  enumerable: true,
143
58
  get: function () {
144
59
  return _jbig.Jbig2mage;
145
60
  }
146
- });
147
- Object.defineProperty(exports, "JpegImage", {
61
+ }));
62
+ Object.defineProperty(exports, "JpegImage", ({
148
63
  enumerable: true,
149
64
  get: function () {
150
65
  return _jpg.JpegImage;
151
66
  }
152
- });
153
- Object.defineProperty(exports, "JpxImage", {
67
+ }));
68
+ Object.defineProperty(exports, "JpxImage", ({
154
69
  enumerable: true,
155
70
  get: function () {
156
71
  return _jpx.JpxImage;
157
72
  }
158
- });
73
+ }));
159
74
 
160
75
  var _util = __w_pdfjs_require__(1);
161
76
 
162
77
  var _jbig = __w_pdfjs_require__(4);
163
78
 
164
- var _jpg = __w_pdfjs_require__(8);
79
+ var _jpg = __w_pdfjs_require__(9);
165
80
 
166
- var _jpx = __w_pdfjs_require__(9);
81
+ var _jpx = __w_pdfjs_require__(10);
167
82
 
168
- const pdfjsVersion = '2.6.347';
169
- const pdfjsBuild = '3be9c65f';
83
+ const pdfjsVersion = '2.7.570';
84
+ const pdfjsBuild = 'f2c7338b0';
170
85
 
171
86
  /***/ }),
172
87
  /* 1 */
173
- /***/ (function(module, exports, __w_pdfjs_require__) {
88
+ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
174
89
 
175
- "use strict";
176
90
 
177
91
 
178
- Object.defineProperty(exports, "__esModule", {
92
+ Object.defineProperty(exports, "__esModule", ({
179
93
  value: true
180
- });
94
+ }));
181
95
  exports.arrayByteLength = arrayByteLength;
182
96
  exports.arraysToBytes = arraysToBytes;
183
97
  exports.assert = assert;
184
98
  exports.bytesToString = bytesToString;
185
99
  exports.createPromiseCapability = createPromiseCapability;
100
+ exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
101
+ exports.encodeToXmlString = encodeToXmlString;
186
102
  exports.escapeString = escapeString;
187
103
  exports.getModificationDate = getModificationDate;
188
104
  exports.getVerbosityLevel = getVerbosityLevel;
189
105
  exports.info = info;
190
106
  exports.isArrayBuffer = isArrayBuffer;
191
107
  exports.isArrayEqual = isArrayEqual;
108
+ exports.isAscii = isAscii;
192
109
  exports.isBool = isBool;
193
110
  exports.isNum = isNum;
194
- exports.isString = isString;
195
111
  exports.isSameOrigin = isSameOrigin;
196
- exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
112
+ exports.isString = isString;
113
+ exports.objectFromEntries = objectFromEntries;
114
+ exports.objectSize = objectSize;
197
115
  exports.removeNullCharacters = removeNullCharacters;
198
116
  exports.setVerbosityLevel = setVerbosityLevel;
199
117
  exports.shadow = shadow;
200
118
  exports.string32 = string32;
201
119
  exports.stringToBytes = stringToBytes;
202
120
  exports.stringToPDFString = stringToPDFString;
121
+ exports.stringToUTF16BEString = stringToUTF16BEString;
203
122
  exports.stringToUTF8String = stringToUTF8String;
123
+ exports.unreachable = unreachable;
204
124
  exports.utf8StringToString = utf8StringToString;
205
125
  exports.warn = warn;
206
- exports.unreachable = unreachable;
207
- exports.IsEvalSupportedCached = exports.IsLittleEndianCached = exports.createObjectURL = exports.FormatError = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.MissingPDFException = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exports.FontType = exports.AnnotationType = exports.AnnotationStateModelType = exports.AnnotationReviewState = exports.AnnotationReplyType = exports.AnnotationMarkedState = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VerbosityLevel = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = exports.BaseException = void 0;
126
+ exports.VerbosityLevel = exports.Util = exports.UNSUPPORTED_FEATURES = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.PageActionEventType = exports.OPS = exports.MissingPDFException = exports.IsLittleEndianCached = exports.IsEvalSupportedCached = exports.InvalidPDFException = exports.ImageKind = exports.IDENTITY_MATRIX = exports.FormatError = exports.FontType = exports.FONT_IDENTITY_MATRIX = exports.DocumentActionEventType = exports.createObjectURL = exports.CMapCompressionType = exports.BaseException = exports.AnnotationType = exports.AnnotationStateModelType = exports.AnnotationReviewState = exports.AnnotationReplyType = exports.AnnotationMarkedState = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.AnnotationActionEventType = exports.AbortException = void 0;
208
127
 
209
128
  __w_pdfjs_require__(2);
210
129
 
@@ -337,6 +256,36 @@ const AnnotationBorderStyleType = {
337
256
  UNDERLINE: 5
338
257
  };
339
258
  exports.AnnotationBorderStyleType = AnnotationBorderStyleType;
259
+ const AnnotationActionEventType = {
260
+ E: "Mouse Enter",
261
+ X: "Mouse Exit",
262
+ D: "Mouse Down",
263
+ U: "Mouse Up",
264
+ Fo: "Focus",
265
+ Bl: "Blur",
266
+ PO: "PageOpen",
267
+ PC: "PageClose",
268
+ PV: "PageVisible",
269
+ PI: "PageInvisible",
270
+ K: "Keystroke",
271
+ F: "Format",
272
+ V: "Validate",
273
+ C: "Calculate"
274
+ };
275
+ exports.AnnotationActionEventType = AnnotationActionEventType;
276
+ const DocumentActionEventType = {
277
+ WC: "WillClose",
278
+ WS: "WillSave",
279
+ DS: "DidSave",
280
+ WP: "WillPrint",
281
+ DP: "DidPrint"
282
+ };
283
+ exports.DocumentActionEventType = DocumentActionEventType;
284
+ const PageActionEventType = {
285
+ O: "PageOpen",
286
+ C: "PageClose"
287
+ };
288
+ exports.PageActionEventType = PageActionEventType;
340
289
  const StreamType = {
341
290
  UNKNOWN: "UNKNOWN",
342
291
  FLATE: "FLATE",
@@ -745,6 +694,14 @@ function string32(value) {
745
694
  return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff);
746
695
  }
747
696
 
697
+ function objectSize(obj) {
698
+ return Object.keys(obj).length;
699
+ }
700
+
701
+ function objectFromEntries(iterable) {
702
+ return Object.assign(Object.create(null), Object.fromEntries(iterable));
703
+ }
704
+
748
705
  function isLittleEndian() {
749
706
  const buffer8 = new Uint8Array(4);
750
707
  buffer8[0] = 1;
@@ -776,14 +733,11 @@ const IsEvalSupportedCached = {
776
733
 
777
734
  };
778
735
  exports.IsEvalSupportedCached = IsEvalSupportedCached;
779
- const rgbBuf = ["rgb(", 0, ",", 0, ",", 0, ")"];
736
+ const hexNumbers = [...Array(256).keys()].map(n => n.toString(16).padStart(2, "0"));
780
737
 
781
738
  class Util {
782
- static makeCssRgb(r, g, b) {
783
- rgbBuf[1] = r;
784
- rgbBuf[3] = g;
785
- rgbBuf[5] = b;
786
- return rgbBuf.join("");
739
+ static makeHexColor(r, g, b) {
740
+ return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;
787
741
  }
788
742
 
789
743
  static transform(m1, m2) {
@@ -905,7 +859,31 @@ function stringToPDFString(str) {
905
859
  }
906
860
 
907
861
  function escapeString(str) {
908
- return str.replace(/([\(\)\\])/g, "\\$1");
862
+ return str.replace(/([()\\\n\r])/g, match => {
863
+ if (match === "\n") {
864
+ return "\\n";
865
+ } else if (match === "\r") {
866
+ return "\\r";
867
+ }
868
+
869
+ return `\\${match}`;
870
+ });
871
+ }
872
+
873
+ function isAscii(str) {
874
+ return /^[\x00-\x7F]*$/.test(str);
875
+ }
876
+
877
+ function stringToUTF16BEString(str) {
878
+ const buf = ["\xFE\xFF"];
879
+
880
+ for (let i = 0, ii = str.length; i < ii; i++) {
881
+ const char = str.charCodeAt(i);
882
+ buf.push(String.fromCharCode(char >> 8 & 0xff));
883
+ buf.push(String.fromCharCode(char & 0xff));
884
+ }
885
+
886
+ return buf.join("");
909
887
  }
910
888
 
911
889
  function stringToUTF8String(str) {
@@ -942,8 +920,8 @@ function isArrayEqual(arr1, arr2) {
942
920
  });
943
921
  }
944
922
 
945
- function getModificationDate(date = new Date(Date.now())) {
946
- const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), (date.getUTCDate() + 1).toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")];
923
+ function getModificationDate(date = new Date()) {
924
+ const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")];
947
925
  return buffer.join("");
948
926
  }
949
927
 
@@ -998,12 +976,62 @@ const createObjectURL = function createObjectURLClosure() {
998
976
  }();
999
977
 
1000
978
  exports.createObjectURL = createObjectURL;
979
+ const XMLEntities = {
980
+ 0x3c: "&lt;",
981
+ 0x3e: "&gt;",
982
+ 0x26: "&amp;",
983
+ 0x22: "&quot;",
984
+ 0x27: "&apos;"
985
+ };
986
+
987
+ function encodeToXmlString(str) {
988
+ const buffer = [];
989
+ let start = 0;
990
+
991
+ for (let i = 0, ii = str.length; i < ii; i++) {
992
+ const char = str.codePointAt(i);
993
+
994
+ if (0x20 <= char && char <= 0x7e) {
995
+ const entity = XMLEntities[char];
996
+
997
+ if (entity) {
998
+ if (start < i) {
999
+ buffer.push(str.substring(start, i));
1000
+ }
1001
+
1002
+ buffer.push(entity);
1003
+ start = i + 1;
1004
+ }
1005
+ } else {
1006
+ if (start < i) {
1007
+ buffer.push(str.substring(start, i));
1008
+ }
1009
+
1010
+ buffer.push(`&#x${char.toString(16).toUpperCase()};`);
1011
+
1012
+ if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) {
1013
+ i++;
1014
+ }
1015
+
1016
+ start = i + 1;
1017
+ }
1018
+ }
1019
+
1020
+ if (buffer.length === 0) {
1021
+ return str;
1022
+ }
1023
+
1024
+ if (start < str.length) {
1025
+ buffer.push(str.substring(start, str.length));
1026
+ }
1027
+
1028
+ return buffer.join("");
1029
+ }
1001
1030
 
1002
1031
  /***/ }),
1003
1032
  /* 2 */
1004
- /***/ (function(module, exports, __w_pdfjs_require__) {
1033
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __w_pdfjs_require__) => {
1005
1034
 
1006
- "use strict";
1007
1035
 
1008
1036
 
1009
1037
  var _is_node = __w_pdfjs_require__(3);
@@ -1012,37 +1040,35 @@ var _is_node = __w_pdfjs_require__(3);
1012
1040
 
1013
1041
  /***/ }),
1014
1042
  /* 3 */
1015
- /***/ (function(module, exports, __w_pdfjs_require__) {
1043
+ /***/ ((__unused_webpack_module, exports) => {
1016
1044
 
1017
- "use strict";
1018
1045
 
1019
1046
 
1020
- Object.defineProperty(exports, "__esModule", {
1047
+ Object.defineProperty(exports, "__esModule", ({
1021
1048
  value: true
1022
- });
1049
+ }));
1023
1050
  exports.isNodeJS = void 0;
1024
1051
  const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
1025
1052
  exports.isNodeJS = isNodeJS;
1026
1053
 
1027
1054
  /***/ }),
1028
1055
  /* 4 */
1029
- /***/ (function(module, exports, __w_pdfjs_require__) {
1056
+ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
1030
1057
 
1031
- "use strict";
1032
1058
 
1033
1059
 
1034
- Object.defineProperty(exports, "__esModule", {
1060
+ Object.defineProperty(exports, "__esModule", ({
1035
1061
  value: true
1036
- });
1062
+ }));
1037
1063
  exports.Jbig2Image = void 0;
1038
1064
 
1039
1065
  var _util = __w_pdfjs_require__(1);
1040
1066
 
1041
1067
  var _core_utils = __w_pdfjs_require__(5);
1042
1068
 
1043
- var _arithmetic_decoder = __w_pdfjs_require__(6);
1069
+ var _arithmetic_decoder = __w_pdfjs_require__(7);
1044
1070
 
1045
- var _ccitt = __w_pdfjs_require__(7);
1071
+ var _ccitt = __w_pdfjs_require__(8);
1046
1072
 
1047
1073
  class Jbig2Error extends _util.BaseException {
1048
1074
  constructor(msg) {
@@ -3234,26 +3260,31 @@ exports.Jbig2Image = Jbig2Image;
3234
3260
 
3235
3261
  /***/ }),
3236
3262
  /* 5 */
3237
- /***/ (function(module, exports, __w_pdfjs_require__) {
3263
+ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
3238
3264
 
3239
- "use strict";
3240
3265
 
3241
3266
 
3242
- Object.defineProperty(exports, "__esModule", {
3267
+ Object.defineProperty(exports, "__esModule", ({
3243
3268
  value: true
3244
- });
3245
- exports.getLookupTableFactory = getLookupTableFactory;
3269
+ }));
3270
+ exports.collectActions = collectActions;
3271
+ exports.escapePDFName = escapePDFName;
3272
+ exports.getArrayLookupTableFactory = getArrayLookupTableFactory;
3246
3273
  exports.getInheritableProperty = getInheritableProperty;
3247
- exports.toRomanNumerals = toRomanNumerals;
3274
+ exports.getLookupTableFactory = getLookupTableFactory;
3275
+ exports.isWhiteSpace = isWhiteSpace;
3248
3276
  exports.log2 = log2;
3277
+ exports.parseXFAPath = parseXFAPath;
3249
3278
  exports.readInt8 = readInt8;
3250
3279
  exports.readUint16 = readUint16;
3251
3280
  exports.readUint32 = readUint32;
3252
- exports.isWhiteSpace = isWhiteSpace;
3281
+ exports.toRomanNumerals = toRomanNumerals;
3253
3282
  exports.XRefParseException = exports.XRefEntryException = exports.MissingDataException = void 0;
3254
3283
 
3255
3284
  var _util = __w_pdfjs_require__(1);
3256
3285
 
3286
+ var _primitives = __w_pdfjs_require__(6);
3287
+
3257
3288
  function getLookupTableFactory(initializer) {
3258
3289
  let lookup;
3259
3290
  return function () {
@@ -3267,6 +3298,25 @@ function getLookupTableFactory(initializer) {
3267
3298
  };
3268
3299
  }
3269
3300
 
3301
+ function getArrayLookupTableFactory(initializer) {
3302
+ let lookup;
3303
+ return function () {
3304
+ if (initializer) {
3305
+ let arr = initializer();
3306
+ initializer = null;
3307
+ lookup = Object.create(null);
3308
+
3309
+ for (let i = 0, ii = arr.length; i < ii; i += 2) {
3310
+ lookup[arr[i]] = arr[i + 1];
3311
+ }
3312
+
3313
+ arr = null;
3314
+ }
3315
+
3316
+ return lookup;
3317
+ };
3318
+ }
3319
+
3270
3320
  class MissingDataException extends _util.BaseException {
3271
3321
  constructor(begin, end) {
3272
3322
  super(`Missing data [${begin}, ${end})`);
@@ -3369,16 +3419,544 @@ function isWhiteSpace(ch) {
3369
3419
  return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;
3370
3420
  }
3371
3421
 
3422
+ function parseXFAPath(path) {
3423
+ const positionPattern = /(.+)\[([0-9]+)\]$/;
3424
+ return path.split(".").map(component => {
3425
+ const m = component.match(positionPattern);
3426
+
3427
+ if (m) {
3428
+ return {
3429
+ name: m[1],
3430
+ pos: parseInt(m[2], 10)
3431
+ };
3432
+ }
3433
+
3434
+ return {
3435
+ name: component,
3436
+ pos: 0
3437
+ };
3438
+ });
3439
+ }
3440
+
3441
+ function escapePDFName(str) {
3442
+ const buffer = [];
3443
+ let start = 0;
3444
+
3445
+ for (let i = 0, ii = str.length; i < ii; i++) {
3446
+ const char = str.charCodeAt(i);
3447
+
3448
+ if (char < 0x21 || char > 0x7e || char === 0x23 || char === 0x28 || char === 0x29 || char === 0x3c || char === 0x3e || char === 0x5b || char === 0x5d || char === 0x7b || char === 0x7d || char === 0x2f || char === 0x25) {
3449
+ if (start < i) {
3450
+ buffer.push(str.substring(start, i));
3451
+ }
3452
+
3453
+ buffer.push(`#${char.toString(16)}`);
3454
+ start = i + 1;
3455
+ }
3456
+ }
3457
+
3458
+ if (buffer.length === 0) {
3459
+ return str;
3460
+ }
3461
+
3462
+ if (start < str.length) {
3463
+ buffer.push(str.substring(start, str.length));
3464
+ }
3465
+
3466
+ return buffer.join("");
3467
+ }
3468
+
3469
+ function _collectJS(entry, xref, list, parents) {
3470
+ if (!entry) {
3471
+ return;
3472
+ }
3473
+
3474
+ let parent = null;
3475
+
3476
+ if ((0, _primitives.isRef)(entry)) {
3477
+ if (parents.has(entry)) {
3478
+ return;
3479
+ }
3480
+
3481
+ parent = entry;
3482
+ parents.put(parent);
3483
+ entry = xref.fetch(entry);
3484
+ }
3485
+
3486
+ if (Array.isArray(entry)) {
3487
+ for (const element of entry) {
3488
+ _collectJS(element, xref, list, parents);
3489
+ }
3490
+ } else if (entry instanceof _primitives.Dict) {
3491
+ if ((0, _primitives.isName)(entry.get("S"), "JavaScript") && entry.has("JS")) {
3492
+ const js = entry.get("JS");
3493
+ let code;
3494
+
3495
+ if ((0, _primitives.isStream)(js)) {
3496
+ code = (0, _util.bytesToString)(js.getBytes());
3497
+ } else {
3498
+ code = js;
3499
+ }
3500
+
3501
+ code = (0, _util.stringToPDFString)(code);
3502
+
3503
+ if (code) {
3504
+ list.push(code);
3505
+ }
3506
+ }
3507
+
3508
+ _collectJS(entry.getRaw("Next"), xref, list, parents);
3509
+ }
3510
+
3511
+ if (parent) {
3512
+ parents.remove(parent);
3513
+ }
3514
+ }
3515
+
3516
+ function collectActions(xref, dict, eventType) {
3517
+ const actions = Object.create(null);
3518
+
3519
+ if (dict.has("AA")) {
3520
+ const additionalActions = dict.get("AA");
3521
+
3522
+ for (const key of additionalActions.getKeys()) {
3523
+ const action = eventType[key];
3524
+
3525
+ if (!action) {
3526
+ continue;
3527
+ }
3528
+
3529
+ const actionDict = additionalActions.getRaw(key);
3530
+ const parents = new _primitives.RefSet();
3531
+ const list = [];
3532
+
3533
+ _collectJS(actionDict, xref, list, parents);
3534
+
3535
+ if (list.length > 0) {
3536
+ actions[action] = list;
3537
+ }
3538
+ }
3539
+ }
3540
+
3541
+ if (dict.has("A")) {
3542
+ const actionDict = dict.get("A");
3543
+ const parents = new _primitives.RefSet();
3544
+ const list = [];
3545
+
3546
+ _collectJS(actionDict, xref, list, parents);
3547
+
3548
+ if (list.length > 0) {
3549
+ actions.Action = list;
3550
+ }
3551
+ }
3552
+
3553
+ return (0, _util.objectSize)(actions) > 0 ? actions : null;
3554
+ }
3555
+
3372
3556
  /***/ }),
3373
3557
  /* 6 */
3374
- /***/ (function(module, exports, __w_pdfjs_require__) {
3558
+ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
3375
3559
 
3376
- "use strict";
3377
3560
 
3378
3561
 
3379
- Object.defineProperty(exports, "__esModule", {
3562
+ Object.defineProperty(exports, "__esModule", ({
3380
3563
  value: true
3381
- });
3564
+ }));
3565
+ exports.clearPrimitiveCaches = clearPrimitiveCaches;
3566
+ exports.isCmd = isCmd;
3567
+ exports.isDict = isDict;
3568
+ exports.isEOF = isEOF;
3569
+ exports.isName = isName;
3570
+ exports.isRef = isRef;
3571
+ exports.isRefsEqual = isRefsEqual;
3572
+ exports.isStream = isStream;
3573
+ exports.RefSetCache = exports.RefSet = exports.Ref = exports.Name = exports.EOF = exports.Dict = exports.Cmd = void 0;
3574
+
3575
+ var _util = __w_pdfjs_require__(1);
3576
+
3577
+ var EOF = {};
3578
+ exports.EOF = EOF;
3579
+
3580
+ var Name = function NameClosure() {
3581
+ let nameCache = Object.create(null);
3582
+
3583
+ function Name(name) {
3584
+ this.name = name;
3585
+ }
3586
+
3587
+ Name.prototype = {};
3588
+
3589
+ Name.get = function Name_get(name) {
3590
+ var nameValue = nameCache[name];
3591
+ return nameValue ? nameValue : nameCache[name] = new Name(name);
3592
+ };
3593
+
3594
+ Name._clearCache = function () {
3595
+ nameCache = Object.create(null);
3596
+ };
3597
+
3598
+ return Name;
3599
+ }();
3600
+
3601
+ exports.Name = Name;
3602
+
3603
+ var Cmd = function CmdClosure() {
3604
+ let cmdCache = Object.create(null);
3605
+
3606
+ function Cmd(cmd) {
3607
+ this.cmd = cmd;
3608
+ }
3609
+
3610
+ Cmd.prototype = {};
3611
+
3612
+ Cmd.get = function Cmd_get(cmd) {
3613
+ var cmdValue = cmdCache[cmd];
3614
+ return cmdValue ? cmdValue : cmdCache[cmd] = new Cmd(cmd);
3615
+ };
3616
+
3617
+ Cmd._clearCache = function () {
3618
+ cmdCache = Object.create(null);
3619
+ };
3620
+
3621
+ return Cmd;
3622
+ }();
3623
+
3624
+ exports.Cmd = Cmd;
3625
+
3626
+ var Dict = function DictClosure() {
3627
+ var nonSerializable = function nonSerializableClosure() {
3628
+ return nonSerializable;
3629
+ };
3630
+
3631
+ function Dict(xref) {
3632
+ this._map = Object.create(null);
3633
+ this.xref = xref;
3634
+ this.objId = null;
3635
+ this.suppressEncryption = false;
3636
+ this.__nonSerializable__ = nonSerializable;
3637
+ }
3638
+
3639
+ Dict.prototype = {
3640
+ assignXref: function Dict_assignXref(newXref) {
3641
+ this.xref = newXref;
3642
+ },
3643
+
3644
+ get size() {
3645
+ return Object.keys(this._map).length;
3646
+ },
3647
+
3648
+ get(key1, key2, key3) {
3649
+ let value = this._map[key1];
3650
+
3651
+ if (value === undefined && key2 !== undefined) {
3652
+ value = this._map[key2];
3653
+
3654
+ if (value === undefined && key3 !== undefined) {
3655
+ value = this._map[key3];
3656
+ }
3657
+ }
3658
+
3659
+ if (value instanceof Ref && this.xref) {
3660
+ return this.xref.fetch(value, this.suppressEncryption);
3661
+ }
3662
+
3663
+ return value;
3664
+ },
3665
+
3666
+ async getAsync(key1, key2, key3) {
3667
+ let value = this._map[key1];
3668
+
3669
+ if (value === undefined && key2 !== undefined) {
3670
+ value = this._map[key2];
3671
+
3672
+ if (value === undefined && key3 !== undefined) {
3673
+ value = this._map[key3];
3674
+ }
3675
+ }
3676
+
3677
+ if (value instanceof Ref && this.xref) {
3678
+ return this.xref.fetchAsync(value, this.suppressEncryption);
3679
+ }
3680
+
3681
+ return value;
3682
+ },
3683
+
3684
+ getArray(key1, key2, key3) {
3685
+ let value = this.get(key1, key2, key3);
3686
+
3687
+ if (!Array.isArray(value) || !this.xref) {
3688
+ return value;
3689
+ }
3690
+
3691
+ value = value.slice();
3692
+
3693
+ for (let i = 0, ii = value.length; i < ii; i++) {
3694
+ if (!(value[i] instanceof Ref)) {
3695
+ continue;
3696
+ }
3697
+
3698
+ value[i] = this.xref.fetch(value[i], this.suppressEncryption);
3699
+ }
3700
+
3701
+ return value;
3702
+ },
3703
+
3704
+ getRaw: function Dict_getRaw(key) {
3705
+ return this._map[key];
3706
+ },
3707
+ getKeys: function Dict_getKeys() {
3708
+ return Object.keys(this._map);
3709
+ },
3710
+ getRawValues: function Dict_getRawValues() {
3711
+ return Object.values(this._map);
3712
+ },
3713
+ set: function Dict_set(key, value) {
3714
+ this._map[key] = value;
3715
+ },
3716
+ has: function Dict_has(key) {
3717
+ return this._map[key] !== undefined;
3718
+ },
3719
+ forEach: function Dict_forEach(callback) {
3720
+ for (var key in this._map) {
3721
+ callback(key, this.get(key));
3722
+ }
3723
+ }
3724
+ };
3725
+
3726
+ Dict.empty = function () {
3727
+ const emptyDict = new Dict(null);
3728
+
3729
+ emptyDict.set = (key, value) => {
3730
+ (0, _util.unreachable)("Should not call `set` on the empty dictionary.");
3731
+ };
3732
+
3733
+ return emptyDict;
3734
+ }();
3735
+
3736
+ Dict.merge = function ({
3737
+ xref,
3738
+ dictArray,
3739
+ mergeSubDicts = false
3740
+ }) {
3741
+ const mergedDict = new Dict(xref);
3742
+
3743
+ if (!mergeSubDicts) {
3744
+ for (const dict of dictArray) {
3745
+ if (!(dict instanceof Dict)) {
3746
+ continue;
3747
+ }
3748
+
3749
+ for (const [key, value] of Object.entries(dict._map)) {
3750
+ if (mergedDict._map[key] === undefined) {
3751
+ mergedDict._map[key] = value;
3752
+ }
3753
+ }
3754
+ }
3755
+
3756
+ return mergedDict.size > 0 ? mergedDict : Dict.empty;
3757
+ }
3758
+
3759
+ const properties = new Map();
3760
+
3761
+ for (const dict of dictArray) {
3762
+ if (!(dict instanceof Dict)) {
3763
+ continue;
3764
+ }
3765
+
3766
+ for (const [key, value] of Object.entries(dict._map)) {
3767
+ let property = properties.get(key);
3768
+
3769
+ if (property === undefined) {
3770
+ property = [];
3771
+ properties.set(key, property);
3772
+ }
3773
+
3774
+ property.push(value);
3775
+ }
3776
+ }
3777
+
3778
+ for (const [name, values] of properties) {
3779
+ if (values.length === 1 || !(values[0] instanceof Dict)) {
3780
+ mergedDict._map[name] = values[0];
3781
+ continue;
3782
+ }
3783
+
3784
+ const subDict = new Dict(xref);
3785
+
3786
+ for (const dict of values) {
3787
+ if (!(dict instanceof Dict)) {
3788
+ continue;
3789
+ }
3790
+
3791
+ for (const [key, value] of Object.entries(dict._map)) {
3792
+ if (subDict._map[key] === undefined) {
3793
+ subDict._map[key] = value;
3794
+ }
3795
+ }
3796
+ }
3797
+
3798
+ if (subDict.size > 0) {
3799
+ mergedDict._map[name] = subDict;
3800
+ }
3801
+ }
3802
+
3803
+ properties.clear();
3804
+ return mergedDict.size > 0 ? mergedDict : Dict.empty;
3805
+ };
3806
+
3807
+ return Dict;
3808
+ }();
3809
+
3810
+ exports.Dict = Dict;
3811
+
3812
+ var Ref = function RefClosure() {
3813
+ let refCache = Object.create(null);
3814
+
3815
+ function Ref(num, gen) {
3816
+ this.num = num;
3817
+ this.gen = gen;
3818
+ }
3819
+
3820
+ Ref.prototype = {
3821
+ toString: function Ref_toString() {
3822
+ if (this.gen === 0) {
3823
+ return `${this.num}R`;
3824
+ }
3825
+
3826
+ return `${this.num}R${this.gen}`;
3827
+ }
3828
+ };
3829
+
3830
+ Ref.get = function (num, gen) {
3831
+ const key = gen === 0 ? `${num}R` : `${num}R${gen}`;
3832
+ const refValue = refCache[key];
3833
+ return refValue ? refValue : refCache[key] = new Ref(num, gen);
3834
+ };
3835
+
3836
+ Ref._clearCache = function () {
3837
+ refCache = Object.create(null);
3838
+ };
3839
+
3840
+ return Ref;
3841
+ }();
3842
+
3843
+ exports.Ref = Ref;
3844
+
3845
+ class RefSet {
3846
+ constructor(parent = null) {
3847
+ this._set = new Set(parent && parent._set);
3848
+ }
3849
+
3850
+ has(ref) {
3851
+ return this._set.has(ref.toString());
3852
+ }
3853
+
3854
+ put(ref) {
3855
+ this._set.add(ref.toString());
3856
+ }
3857
+
3858
+ remove(ref) {
3859
+ this._set.delete(ref.toString());
3860
+ }
3861
+
3862
+ forEach(callback) {
3863
+ for (const ref of this._set.values()) {
3864
+ callback(ref);
3865
+ }
3866
+ }
3867
+
3868
+ clear() {
3869
+ this._set.clear();
3870
+ }
3871
+
3872
+ }
3873
+
3874
+ exports.RefSet = RefSet;
3875
+
3876
+ class RefSetCache {
3877
+ constructor() {
3878
+ this._map = new Map();
3879
+ }
3880
+
3881
+ get size() {
3882
+ return this._map.size;
3883
+ }
3884
+
3885
+ get(ref) {
3886
+ return this._map.get(ref.toString());
3887
+ }
3888
+
3889
+ has(ref) {
3890
+ return this._map.has(ref.toString());
3891
+ }
3892
+
3893
+ put(ref, obj) {
3894
+ this._map.set(ref.toString(), obj);
3895
+ }
3896
+
3897
+ putAlias(ref, aliasRef) {
3898
+ this._map.set(ref.toString(), this.get(aliasRef));
3899
+ }
3900
+
3901
+ forEach(callback) {
3902
+ for (const value of this._map.values()) {
3903
+ callback(value);
3904
+ }
3905
+ }
3906
+
3907
+ clear() {
3908
+ this._map.clear();
3909
+ }
3910
+
3911
+ }
3912
+
3913
+ exports.RefSetCache = RefSetCache;
3914
+
3915
+ function isEOF(v) {
3916
+ return v === EOF;
3917
+ }
3918
+
3919
+ function isName(v, name) {
3920
+ return v instanceof Name && (name === undefined || v.name === name);
3921
+ }
3922
+
3923
+ function isCmd(v, cmd) {
3924
+ return v instanceof Cmd && (cmd === undefined || v.cmd === cmd);
3925
+ }
3926
+
3927
+ function isDict(v, type) {
3928
+ return v instanceof Dict && (type === undefined || isName(v.get("Type"), type));
3929
+ }
3930
+
3931
+ function isRef(v) {
3932
+ return v instanceof Ref;
3933
+ }
3934
+
3935
+ function isRefsEqual(v1, v2) {
3936
+ return v1.num === v2.num && v1.gen === v2.gen;
3937
+ }
3938
+
3939
+ function isStream(v) {
3940
+ return typeof v === "object" && v !== null && v.getBytes !== undefined;
3941
+ }
3942
+
3943
+ function clearPrimitiveCaches() {
3944
+ Cmd._clearCache();
3945
+
3946
+ Name._clearCache();
3947
+
3948
+ Ref._clearCache();
3949
+ }
3950
+
3951
+ /***/ }),
3952
+ /* 7 */
3953
+ /***/ ((__unused_webpack_module, exports) => {
3954
+
3955
+
3956
+
3957
+ Object.defineProperty(exports, "__esModule", ({
3958
+ value: true
3959
+ }));
3382
3960
  exports.ArithmeticDecoder = void 0;
3383
3961
  const QeTable = [{
3384
3962
  qe: 0x5601,
@@ -3724,15 +4302,14 @@ class ArithmeticDecoder {
3724
4302
  exports.ArithmeticDecoder = ArithmeticDecoder;
3725
4303
 
3726
4304
  /***/ }),
3727
- /* 7 */
3728
- /***/ (function(module, exports, __w_pdfjs_require__) {
4305
+ /* 8 */
4306
+ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
3729
4307
 
3730
- "use strict";
3731
4308
 
3732
4309
 
3733
- Object.defineProperty(exports, "__esModule", {
4310
+ Object.defineProperty(exports, "__esModule", ({
3734
4311
  value: true
3735
- });
4312
+ }));
3736
4313
  exports.CCITTFaxDecoder = void 0;
3737
4314
 
3738
4315
  var _util = __w_pdfjs_require__(1);
@@ -4429,15 +5006,14 @@ const CCITTFaxDecoder = function CCITTFaxDecoder() {
4429
5006
  exports.CCITTFaxDecoder = CCITTFaxDecoder;
4430
5007
 
4431
5008
  /***/ }),
4432
- /* 8 */
4433
- /***/ (function(module, exports, __w_pdfjs_require__) {
5009
+ /* 9 */
5010
+ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
4434
5011
 
4435
- "use strict";
4436
5012
 
4437
5013
 
4438
- Object.defineProperty(exports, "__esModule", {
5014
+ Object.defineProperty(exports, "__esModule", ({
4439
5015
  value: true
4440
- });
5016
+ }));
4441
5017
  exports.JpegImage = void 0;
4442
5018
 
4443
5019
  var _util = __w_pdfjs_require__(1);
@@ -5443,7 +6019,7 @@ var JpegImage = function JpegImageClosure() {
5443
6019
  break;
5444
6020
  }
5445
6021
 
5446
- if (offset >= data.length - 1) {
6022
+ if (!nextFileMarker || offset >= data.length - 1) {
5447
6023
  (0, _util.warn)("JpegImage.parse - reached the end of the image data " + "without finding an EOI marker (0xFFD9).");
5448
6024
  break markerLoop;
5449
6025
  }
@@ -5675,22 +6251,21 @@ var JpegImage = function JpegImageClosure() {
5675
6251
  exports.JpegImage = JpegImage;
5676
6252
 
5677
6253
  /***/ }),
5678
- /* 9 */
5679
- /***/ (function(module, exports, __w_pdfjs_require__) {
6254
+ /* 10 */
6255
+ /***/ ((__unused_webpack_module, exports, __w_pdfjs_require__) => {
5680
6256
 
5681
- "use strict";
5682
6257
 
5683
6258
 
5684
- Object.defineProperty(exports, "__esModule", {
6259
+ Object.defineProperty(exports, "__esModule", ({
5685
6260
  value: true
5686
- });
6261
+ }));
5687
6262
  exports.JpxImage = void 0;
5688
6263
 
5689
6264
  var _util = __w_pdfjs_require__(1);
5690
6265
 
5691
6266
  var _core_utils = __w_pdfjs_require__(5);
5692
6267
 
5693
- var _arithmetic_decoder = __w_pdfjs_require__(6);
6268
+ var _arithmetic_decoder = __w_pdfjs_require__(7);
5694
6269
 
5695
6270
  class JpxError extends _util.BaseException {
5696
6271
  constructor(msg) {
@@ -6073,7 +6648,7 @@ var JpxImage = function JpxImageClosure() {
6073
6648
 
6074
6649
  if (unsupported.length > 0) {
6075
6650
  doNotRecover = true;
6076
- throw new Error("Unsupported COD options (" + unsupported.join(", ") + ")");
6651
+ (0, _util.warn)(`JPX: Unsupported COD options (${unsupported.join(", ")}).`);
6077
6652
  }
6078
6653
 
6079
6654
  if (context.mainHeader) {
@@ -6117,6 +6692,9 @@ var JpxImage = function JpxImageClosure() {
6117
6692
  parseTilePackets(context, data, position, length);
6118
6693
  break;
6119
6694
 
6695
+ case 0xff53:
6696
+ (0, _util.warn)("JPX: Codestream code 0xFF53 (COC) is not implemented.");
6697
+
6120
6698
  case 0xff55:
6121
6699
  case 0xff57:
6122
6700
  case 0xff58:
@@ -6124,9 +6702,6 @@ var JpxImage = function JpxImageClosure() {
6124
6702
  length = (0, _core_utils.readUint16)(data, position);
6125
6703
  break;
6126
6704
 
6127
- case 0xff53:
6128
- throw new Error("Codestream code 0xFF53 (COC) is not implemented");
6129
-
6130
6705
  default:
6131
6706
  throw new Error("Unknown codestream code: " + code.toString(16));
6132
6707
  }
@@ -6137,7 +6712,7 @@ var JpxImage = function JpxImageClosure() {
6137
6712
  if (doNotRecover || this.failOnCorruptedImage) {
6138
6713
  throw new JpxError(e.message);
6139
6714
  } else {
6140
- (0, _util.warn)("JPX: Trying to recover from: " + e.message);
6715
+ (0, _util.warn)(`JPX: Trying to recover from: "${e.message}".`);
6141
6716
  }
6142
6717
  }
6143
6718
 
@@ -8011,6 +8586,37 @@ var JpxImage = function JpxImageClosure() {
8011
8586
  exports.JpxImage = JpxImage;
8012
8587
 
8013
8588
  /***/ })
8014
- /******/ ]);
8589
+ /******/ ]);
8590
+ /************************************************************************/
8591
+ /******/ // The module cache
8592
+ /******/ var __webpack_module_cache__ = {};
8593
+ /******/
8594
+ /******/ // The require function
8595
+ /******/ function __w_pdfjs_require__(moduleId) {
8596
+ /******/ // Check if module is in cache
8597
+ /******/ if(__webpack_module_cache__[moduleId]) {
8598
+ /******/ return __webpack_module_cache__[moduleId].exports;
8599
+ /******/ }
8600
+ /******/ // Create a new module (and put it into the cache)
8601
+ /******/ var module = __webpack_module_cache__[moduleId] = {
8602
+ /******/ // no module.id needed
8603
+ /******/ // no module.loaded needed
8604
+ /******/ exports: {}
8605
+ /******/ };
8606
+ /******/
8607
+ /******/ // Execute the module function
8608
+ /******/ __webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__);
8609
+ /******/
8610
+ /******/ // Return the exports of the module
8611
+ /******/ return module.exports;
8612
+ /******/ }
8613
+ /******/
8614
+ /************************************************************************/
8615
+ /******/ // module exports must be returned from runtime so entry inlining is disabled
8616
+ /******/ // startup
8617
+ /******/ // Load entry module and return exports
8618
+ /******/ return __w_pdfjs_require__(0);
8619
+ /******/ })()
8620
+ ;
8015
8621
  });
8016
8622
  //# sourceMappingURL=pdf.image_decoders.js.map