pdfjs-dist 2.3.200 → 2.4.456

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 (185) hide show
  1. package/README.md +4 -0
  2. package/bower.json +1 -1
  3. package/build/pdf.js +6499 -17971
  4. package/build/pdf.js.map +1 -1
  5. package/build/pdf.min.js +22 -1
  6. package/build/pdf.worker.entry.js +5 -3
  7. package/build/pdf.worker.js +19303 -29896
  8. package/build/pdf.worker.js.map +1 -1
  9. package/build/pdf.worker.min.js +22 -1
  10. package/es5/build/pdf.js +25473 -0
  11. package/es5/build/pdf.js.map +1 -0
  12. package/{lib/shared/global_scope.js → es5/build/pdf.worker.entry.js} +5 -10
  13. package/es5/build/pdf.worker.js +57878 -0
  14. package/es5/build/pdf.worker.js.map +1 -0
  15. package/es5/web/images/annotation-check.svg +11 -0
  16. package/es5/web/images/annotation-comment.svg +16 -0
  17. package/es5/web/images/annotation-help.svg +26 -0
  18. package/es5/web/images/annotation-insert.svg +10 -0
  19. package/es5/web/images/annotation-key.svg +11 -0
  20. package/es5/web/images/annotation-newparagraph.svg +11 -0
  21. package/es5/web/images/annotation-noicon.svg +7 -0
  22. package/es5/web/images/annotation-note.svg +42 -0
  23. package/es5/web/images/annotation-paragraph.svg +16 -0
  24. package/es5/web/images/loading-icon.gif +0 -0
  25. package/es5/web/images/shadow.png +0 -0
  26. package/es5/web/images/texture.png +0 -0
  27. package/es5/web/pdf_viewer.css +407 -0
  28. package/es5/web/pdf_viewer.js +7757 -0
  29. package/es5/web/pdf_viewer.js.map +1 -0
  30. package/image_decoders/pdf.image_decoders.js +1333 -4839
  31. package/image_decoders/pdf.image_decoders.js.map +1 -1
  32. package/image_decoders/pdf.image_decoders.min.js +22 -1
  33. package/lib/README.md +7 -0
  34. package/lib/core/annotation.js +683 -1066
  35. package/lib/core/arithmetic_decoder.js +81 -97
  36. package/lib/core/bidi.js +54 -46
  37. package/lib/core/ccitt.js +88 -81
  38. package/lib/core/ccitt_stream.js +15 -14
  39. package/lib/core/cff_parser.js +196 -193
  40. package/lib/core/charsets.js +4 -4
  41. package/lib/core/chunked_stream.js +441 -569
  42. package/lib/core/cmap.js +220 -279
  43. package/lib/core/colorspace.js +699 -863
  44. package/lib/core/core_utils.js +59 -80
  45. package/lib/core/crypto.js +379 -437
  46. package/lib/core/document.js +564 -673
  47. package/lib/core/encodings.js +15 -15
  48. package/lib/core/evaluator.js +983 -889
  49. package/lib/core/font_renderer.js +128 -171
  50. package/lib/core/fonts.js +451 -400
  51. package/lib/core/function.js +289 -285
  52. package/lib/core/glyphlist.js +4527 -4527
  53. package/lib/core/image.js +138 -117
  54. package/lib/core/image_utils.js +46 -63
  55. package/lib/core/jbig2.js +324 -332
  56. package/lib/core/jbig2_stream.js +18 -17
  57. package/lib/core/jpeg_stream.js +133 -24
  58. package/lib/core/jpg.js +238 -210
  59. package/lib/core/jpx.js +158 -157
  60. package/lib/core/jpx_stream.js +28 -28
  61. package/lib/core/metrics.js +2928 -2928
  62. package/lib/core/murmurhash3.js +87 -102
  63. package/lib/core/obj.js +1111 -1302
  64. package/lib/core/operator_list.js +55 -42
  65. package/lib/core/parser.js +956 -987
  66. package/lib/core/pattern.js +69 -69
  67. package/lib/core/pdf_manager.js +149 -316
  68. package/lib/core/primitives.js +45 -77
  69. package/lib/core/ps_parser.js +175 -214
  70. package/lib/core/standard_fonts.js +237 -236
  71. package/lib/core/stream.js +83 -77
  72. package/lib/core/type1_parser.js +78 -68
  73. package/lib/core/unicode.js +1654 -1654
  74. package/lib/core/worker.js +148 -196
  75. package/lib/core/worker_stream.js +101 -210
  76. package/lib/display/annotation_layer.js +733 -1155
  77. package/lib/display/api.js +1539 -1928
  78. package/lib/display/api_compatibility.js +10 -8
  79. package/lib/display/canvas.js +159 -158
  80. package/lib/display/content_disposition.js +36 -55
  81. package/lib/display/display_utils.js +298 -551
  82. package/lib/display/fetch_stream.js +181 -305
  83. package/lib/display/font_loader.js +273 -416
  84. package/lib/display/metadata.js +86 -98
  85. package/lib/display/network.js +376 -511
  86. package/lib/display/network_utils.js +20 -19
  87. package/lib/display/node_stream.js +276 -460
  88. package/lib/display/pattern_helper.js +76 -44
  89. package/lib/display/svg.js +1137 -1405
  90. package/lib/display/text_layer.js +75 -82
  91. package/lib/display/transport_stream.js +236 -374
  92. package/lib/display/webgl.js +70 -83
  93. package/lib/display/worker_options.js +3 -3
  94. package/lib/display/xml_parser.js +303 -392
  95. package/lib/examples/node/domstubs.js +37 -37
  96. package/lib/pdf.js +22 -21
  97. package/lib/pdf.worker.js +5 -5
  98. package/lib/shared/compatibility.js +2 -251
  99. package/lib/shared/is_node.js +7 -6
  100. package/lib/shared/message_handler.js +222 -194
  101. package/lib/shared/util.js +269 -405
  102. package/lib/test/unit/annotation_spec.js +1089 -1014
  103. package/lib/test/unit/api_spec.js +617 -544
  104. package/lib/test/unit/bidi_spec.js +7 -7
  105. package/lib/test/unit/cff_parser_spec.js +63 -62
  106. package/lib/test/unit/clitests_helper.js +7 -9
  107. package/lib/test/unit/cmap_spec.js +84 -86
  108. package/lib/test/unit/colorspace_spec.js +154 -154
  109. package/lib/test/unit/core_utils_spec.js +125 -105
  110. package/lib/test/unit/crypto_spec.js +181 -181
  111. package/lib/test/unit/custom_spec.js +22 -24
  112. package/lib/test/unit/display_svg_spec.js +35 -36
  113. package/lib/test/unit/display_utils_spec.js +139 -149
  114. package/lib/test/unit/document_spec.js +16 -16
  115. package/lib/test/unit/encodings_spec.js +12 -34
  116. package/lib/test/unit/evaluator_spec.js +81 -95
  117. package/lib/test/unit/fetch_stream_spec.js +30 -30
  118. package/lib/test/unit/function_spec.js +206 -204
  119. package/lib/test/unit/jasmine-boot.js +48 -32
  120. package/lib/test/unit/message_handler_spec.js +172 -162
  121. package/lib/test/unit/metadata_spec.js +69 -69
  122. package/lib/test/unit/murmurhash3_spec.js +12 -12
  123. package/lib/test/unit/network_spec.js +12 -12
  124. package/lib/test/unit/network_utils_spec.js +152 -152
  125. package/lib/test/unit/node_stream_spec.js +74 -90
  126. package/lib/test/unit/parser_spec.js +107 -113
  127. package/lib/test/unit/pdf_find_controller_spec.js +55 -86
  128. package/lib/test/unit/pdf_find_utils_spec.js +32 -32
  129. package/lib/test/unit/pdf_history_spec.js +32 -32
  130. package/lib/test/unit/primitives_spec.js +117 -115
  131. package/lib/test/unit/stream_spec.js +16 -14
  132. package/lib/test/unit/test_utils.js +119 -285
  133. package/lib/test/unit/testreporter.js +19 -19
  134. package/lib/test/unit/type1_parser_spec.js +41 -41
  135. package/lib/test/unit/ui_utils_spec.js +318 -426
  136. package/lib/test/unit/unicode_spec.js +42 -42
  137. package/lib/test/unit/util_spec.js +122 -143
  138. package/lib/web/annotation_layer_builder.js +66 -103
  139. package/lib/web/app.js +1166 -1196
  140. package/lib/web/app_options.js +61 -77
  141. package/lib/web/base_viewer.js +804 -850
  142. package/lib/web/chromecom.js +164 -249
  143. package/lib/web/debugger.js +149 -205
  144. package/lib/web/download_manager.js +38 -57
  145. package/lib/web/firefox_print_service.js +35 -30
  146. package/lib/web/firefoxcom.js +175 -374
  147. package/lib/web/genericcom.js +26 -108
  148. package/lib/web/genericl10n.js +24 -153
  149. package/lib/web/grab_to_pan.js +30 -30
  150. package/lib/web/interfaces.js +80 -258
  151. package/lib/web/overlay_manager.js +70 -246
  152. package/lib/web/password_prompt.js +38 -64
  153. package/lib/web/pdf_attachment_viewer.js +105 -130
  154. package/lib/web/pdf_cursor_tools.js +75 -102
  155. package/lib/web/pdf_document_properties.js +227 -376
  156. package/lib/web/pdf_find_bar.js +137 -171
  157. package/lib/web/pdf_find_controller.js +492 -549
  158. package/lib/web/pdf_find_utils.js +13 -13
  159. package/lib/web/pdf_history.js +395 -406
  160. package/lib/web/pdf_link_service.js +302 -349
  161. package/lib/web/pdf_outline_viewer.js +148 -209
  162. package/lib/web/pdf_page_view.js +449 -507
  163. package/lib/web/pdf_presentation_mode.js +304 -357
  164. package/lib/web/pdf_print_service.js +90 -104
  165. package/lib/web/pdf_rendering_queue.js +87 -108
  166. package/lib/web/pdf_sidebar.js +264 -304
  167. package/lib/web/pdf_sidebar_resizer.js +92 -119
  168. package/lib/web/pdf_single_page_viewer.js +77 -126
  169. package/lib/web/pdf_thumbnail_view.js +276 -297
  170. package/lib/web/pdf_thumbnail_viewer.js +186 -206
  171. package/lib/web/pdf_viewer.component.js +20 -21
  172. package/lib/web/pdf_viewer.js +55 -115
  173. package/lib/web/preferences.js +66 -273
  174. package/lib/web/secondary_toolbar.js +164 -196
  175. package/lib/web/text_layer_builder.js +284 -317
  176. package/lib/web/toolbar.js +216 -211
  177. package/lib/web/ui_utils.js +303 -404
  178. package/lib/web/view_history.js +49 -222
  179. package/lib/web/viewer_compatibility.js +7 -5
  180. package/package.json +2 -9
  181. package/web/pdf_viewer.css +25 -18
  182. package/web/pdf_viewer.js +3481 -4764
  183. package/web/pdf_viewer.js.map +1 -1
  184. package/webpack.js +14 -5
  185. package/lib/shared/streams_polyfill.js +0 -43
@@ -2,7 +2,7 @@
2
2
  * @licstart The following is the entire license notice for the
3
3
  * Javascript code in this page
4
4
  *
5
- * Copyright 2019 Mozilla Foundation
5
+ * Copyright 2020 Mozilla Foundation
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
8
8
  * you may not use this file except in compliance with the License.
@@ -27,199 +27,158 @@ Object.defineProperty(exports, "__esModule", {
27
27
  exports.getQuadPoints = getQuadPoints;
28
28
  exports.MarkupAnnotation = exports.AnnotationFactory = exports.AnnotationBorderStyle = exports.Annotation = void 0;
29
29
 
30
- var _util = require("../shared/util");
30
+ var _util = require("../shared/util.js");
31
31
 
32
- var _obj = require("./obj");
32
+ var _obj = require("./obj.js");
33
33
 
34
- var _primitives = require("./primitives");
34
+ var _primitives = require("./primitives.js");
35
35
 
36
- var _colorspace = require("./colorspace");
36
+ var _colorspace = require("./colorspace.js");
37
37
 
38
- var _core_utils = require("./core_utils");
38
+ var _core_utils = require("./core_utils.js");
39
39
 
40
- var _operator_list = require("./operator_list");
40
+ var _operator_list = require("./operator_list.js");
41
41
 
42
- var _stream = require("./stream");
42
+ var _stream = require("./stream.js");
43
43
 
44
- function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
45
-
46
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
47
-
48
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
49
-
50
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
51
-
52
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
53
-
54
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
55
-
56
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
57
-
58
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
59
-
60
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
61
-
62
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
63
-
64
- function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
65
-
66
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
67
-
68
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
69
-
70
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
71
-
72
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
73
-
74
- var AnnotationFactory =
75
- /*#__PURE__*/
76
- function () {
77
- function AnnotationFactory() {
78
- _classCallCheck(this, AnnotationFactory);
44
+ class AnnotationFactory {
45
+ static create(xref, ref, pdfManager, idFactory) {
46
+ return pdfManager.ensure(this, "_create", [xref, ref, pdfManager, idFactory]);
79
47
  }
80
48
 
81
- _createClass(AnnotationFactory, null, [{
82
- key: "create",
83
- value: function create(xref, ref, pdfManager, idFactory) {
84
- return pdfManager.ensure(this, '_create', [xref, ref, pdfManager, idFactory]);
85
- }
86
- }, {
87
- key: "_create",
88
- value: function _create(xref, ref, pdfManager, idFactory) {
89
- var dict = xref.fetchIfRef(ref);
49
+ static _create(xref, ref, pdfManager, idFactory) {
50
+ const dict = xref.fetchIfRef(ref);
90
51
 
91
- if (!(0, _primitives.isDict)(dict)) {
92
- return undefined;
93
- }
52
+ if (!(0, _primitives.isDict)(dict)) {
53
+ return undefined;
54
+ }
94
55
 
95
- var id = (0, _primitives.isRef)(ref) ? ref.toString() : "annot_".concat(idFactory.createObjId());
96
- var subtype = dict.get('Subtype');
97
- subtype = (0, _primitives.isName)(subtype) ? subtype.name : null;
98
- var parameters = {
99
- xref: xref,
100
- dict: dict,
101
- subtype: subtype,
102
- id: id,
103
- pdfManager: pdfManager
104
- };
56
+ const id = (0, _primitives.isRef)(ref) ? ref.toString() : `annot_${idFactory.createObjId()}`;
57
+ let subtype = dict.get("Subtype");
58
+ subtype = (0, _primitives.isName)(subtype) ? subtype.name : null;
59
+ const parameters = {
60
+ xref,
61
+ dict,
62
+ subtype,
63
+ id,
64
+ pdfManager
65
+ };
105
66
 
106
- switch (subtype) {
107
- case 'Link':
108
- return new LinkAnnotation(parameters);
67
+ switch (subtype) {
68
+ case "Link":
69
+ return new LinkAnnotation(parameters);
109
70
 
110
- case 'Text':
111
- return new TextAnnotation(parameters);
71
+ case "Text":
72
+ return new TextAnnotation(parameters);
112
73
 
113
- case 'Widget':
114
- var fieldType = (0, _core_utils.getInheritableProperty)({
115
- dict: dict,
116
- key: 'FT'
117
- });
118
- fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
74
+ case "Widget":
75
+ let fieldType = (0, _core_utils.getInheritableProperty)({
76
+ dict,
77
+ key: "FT"
78
+ });
79
+ fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
119
80
 
120
- switch (fieldType) {
121
- case 'Tx':
122
- return new TextWidgetAnnotation(parameters);
81
+ switch (fieldType) {
82
+ case "Tx":
83
+ return new TextWidgetAnnotation(parameters);
123
84
 
124
- case 'Btn':
125
- return new ButtonWidgetAnnotation(parameters);
85
+ case "Btn":
86
+ return new ButtonWidgetAnnotation(parameters);
126
87
 
127
- case 'Ch':
128
- return new ChoiceWidgetAnnotation(parameters);
129
- }
88
+ case "Ch":
89
+ return new ChoiceWidgetAnnotation(parameters);
90
+ }
130
91
 
131
- (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.');
132
- return new WidgetAnnotation(parameters);
92
+ (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + "falling back to base field type.");
93
+ return new WidgetAnnotation(parameters);
133
94
 
134
- case 'Popup':
135
- return new PopupAnnotation(parameters);
95
+ case "Popup":
96
+ return new PopupAnnotation(parameters);
136
97
 
137
- case 'FreeText':
138
- return new FreeTextAnnotation(parameters);
98
+ case "FreeText":
99
+ return new FreeTextAnnotation(parameters);
139
100
 
140
- case 'Line':
141
- return new LineAnnotation(parameters);
101
+ case "Line":
102
+ return new LineAnnotation(parameters);
142
103
 
143
- case 'Square':
144
- return new SquareAnnotation(parameters);
104
+ case "Square":
105
+ return new SquareAnnotation(parameters);
145
106
 
146
- case 'Circle':
147
- return new CircleAnnotation(parameters);
107
+ case "Circle":
108
+ return new CircleAnnotation(parameters);
148
109
 
149
- case 'PolyLine':
150
- return new PolylineAnnotation(parameters);
110
+ case "PolyLine":
111
+ return new PolylineAnnotation(parameters);
151
112
 
152
- case 'Polygon':
153
- return new PolygonAnnotation(parameters);
113
+ case "Polygon":
114
+ return new PolygonAnnotation(parameters);
154
115
 
155
- case 'Caret':
156
- return new CaretAnnotation(parameters);
116
+ case "Caret":
117
+ return new CaretAnnotation(parameters);
157
118
 
158
- case 'Ink':
159
- return new InkAnnotation(parameters);
119
+ case "Ink":
120
+ return new InkAnnotation(parameters);
160
121
 
161
- case 'Highlight':
162
- return new HighlightAnnotation(parameters);
122
+ case "Highlight":
123
+ return new HighlightAnnotation(parameters);
163
124
 
164
- case 'Underline':
165
- return new UnderlineAnnotation(parameters);
125
+ case "Underline":
126
+ return new UnderlineAnnotation(parameters);
166
127
 
167
- case 'Squiggly':
168
- return new SquigglyAnnotation(parameters);
128
+ case "Squiggly":
129
+ return new SquigglyAnnotation(parameters);
169
130
 
170
- case 'StrikeOut':
171
- return new StrikeOutAnnotation(parameters);
131
+ case "StrikeOut":
132
+ return new StrikeOutAnnotation(parameters);
172
133
 
173
- case 'Stamp':
174
- return new StampAnnotation(parameters);
134
+ case "Stamp":
135
+ return new StampAnnotation(parameters);
175
136
 
176
- case 'FileAttachment':
177
- return new FileAttachmentAnnotation(parameters);
137
+ case "FileAttachment":
138
+ return new FileAttachmentAnnotation(parameters);
178
139
 
179
- default:
180
- if (!subtype) {
181
- (0, _util.warn)('Annotation is missing the required /Subtype.');
182
- } else {
183
- (0, _util.warn)('Unimplemented annotation type "' + subtype + '", ' + 'falling back to base annotation.');
184
- }
140
+ default:
141
+ if (!subtype) {
142
+ (0, _util.warn)("Annotation is missing the required /Subtype.");
143
+ } else {
144
+ (0, _util.warn)('Unimplemented annotation type "' + subtype + '", ' + "falling back to base annotation.");
145
+ }
185
146
 
186
- return new Annotation(parameters);
187
- }
147
+ return new Annotation(parameters);
188
148
  }
189
- }]);
149
+ }
190
150
 
191
- return AnnotationFactory;
192
- }();
151
+ }
193
152
 
194
153
  exports.AnnotationFactory = AnnotationFactory;
195
154
 
196
155
  function getQuadPoints(dict, rect) {
197
- if (!dict.has('QuadPoints')) {
156
+ if (!dict.has("QuadPoints")) {
198
157
  return null;
199
158
  }
200
159
 
201
- var quadPoints = dict.getArray('QuadPoints');
160
+ const quadPoints = dict.getArray("QuadPoints");
202
161
 
203
162
  if (!Array.isArray(quadPoints) || quadPoints.length % 8 > 0) {
204
163
  return null;
205
164
  }
206
165
 
207
- var quadPointsLists = [];
166
+ const quadPointsLists = [];
208
167
 
209
- for (var i = 0, ii = quadPoints.length / 8; i < ii; i++) {
168
+ for (let i = 0, ii = quadPoints.length / 8; i < ii; i++) {
210
169
  quadPointsLists.push([]);
211
170
 
212
- for (var j = i * 8, jj = i * 8 + 8; j < jj; j += 2) {
213
- var x = quadPoints[j];
214
- var y = quadPoints[j + 1];
171
+ for (let j = i * 8, jj = i * 8 + 8; j < jj; j += 2) {
172
+ const x = quadPoints[j];
173
+ const y = quadPoints[j + 1];
215
174
 
216
175
  if (x < rect[0] || x > rect[2] || y < rect[1] || y > rect[3]) {
217
176
  return null;
218
177
  }
219
178
 
220
179
  quadPointsLists[i].push({
221
- x: x,
222
- y: y
180
+ x,
181
+ y
223
182
  });
224
183
  }
225
184
  }
@@ -228,34 +187,25 @@ function getQuadPoints(dict, rect) {
228
187
  }
229
188
 
230
189
  function getTransformMatrix(rect, bbox, matrix) {
231
- var _Util$getAxialAligned = _util.Util.getAxialAlignedBoundingBox(bbox, matrix),
232
- _Util$getAxialAligned2 = _slicedToArray(_Util$getAxialAligned, 4),
233
- minX = _Util$getAxialAligned2[0],
234
- minY = _Util$getAxialAligned2[1],
235
- maxX = _Util$getAxialAligned2[2],
236
- maxY = _Util$getAxialAligned2[3];
190
+ const [minX, minY, maxX, maxY] = _util.Util.getAxialAlignedBoundingBox(bbox, matrix);
237
191
 
238
192
  if (minX === maxX || minY === maxY) {
239
193
  return [1, 0, 0, 1, rect[0], rect[1]];
240
194
  }
241
195
 
242
- var xRatio = (rect[2] - rect[0]) / (maxX - minX);
243
- var yRatio = (rect[3] - rect[1]) / (maxY - minY);
196
+ const xRatio = (rect[2] - rect[0]) / (maxX - minX);
197
+ const yRatio = (rect[3] - rect[1]) / (maxY - minY);
244
198
  return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio];
245
199
  }
246
200
 
247
- var Annotation =
248
- /*#__PURE__*/
249
- function () {
250
- function Annotation(params) {
251
- _classCallCheck(this, Annotation);
252
-
253
- var dict = params.dict;
254
- this.setContents(dict.get('Contents'));
255
- this.setModificationDate(dict.get('M'));
256
- this.setFlags(dict.get('F'));
257
- this.setRectangle(dict.getArray('Rect'));
258
- this.setColor(dict.getArray('C'));
201
+ class Annotation {
202
+ constructor(params) {
203
+ const dict = params.dict;
204
+ this.setContents(dict.get("Contents"));
205
+ this.setModificationDate(dict.get("M"));
206
+ this.setFlags(dict.get("F"));
207
+ this.setRectangle(dict.getArray("Rect"));
208
+ this.setColor(dict.getArray("C"));
259
209
  this.setBorderStyle(dict);
260
210
  this.setAppearance(dict);
261
211
  this.data = {
@@ -271,228 +221,202 @@ function () {
271
221
  };
272
222
  }
273
223
 
274
- _createClass(Annotation, [{
275
- key: "_hasFlag",
276
- value: function _hasFlag(flags, flag) {
277
- return !!(flags & flag);
278
- }
279
- }, {
280
- key: "_isViewable",
281
- value: function _isViewable(flags) {
282
- return !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN) && !this._hasFlag(flags, _util.AnnotationFlag.NOVIEW);
283
- }
284
- }, {
285
- key: "_isPrintable",
286
- value: function _isPrintable(flags) {
287
- return this._hasFlag(flags, _util.AnnotationFlag.PRINT) && !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN);
288
- }
289
- }, {
290
- key: "setContents",
291
- value: function setContents(contents) {
292
- this.contents = (0, _util.stringToPDFString)(contents || '');
293
- }
294
- }, {
295
- key: "setModificationDate",
296
- value: function setModificationDate(modificationDate) {
297
- this.modificationDate = (0, _util.isString)(modificationDate) ? modificationDate : null;
298
- }
299
- }, {
300
- key: "setFlags",
301
- value: function setFlags(flags) {
302
- this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;
224
+ _hasFlag(flags, flag) {
225
+ return !!(flags & flag);
226
+ }
227
+
228
+ _isViewable(flags) {
229
+ return !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN) && !this._hasFlag(flags, _util.AnnotationFlag.NOVIEW);
230
+ }
231
+
232
+ _isPrintable(flags) {
233
+ return this._hasFlag(flags, _util.AnnotationFlag.PRINT) && !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN);
234
+ }
235
+
236
+ get viewable() {
237
+ if (this.flags === 0) {
238
+ return true;
303
239
  }
304
- }, {
305
- key: "hasFlag",
306
- value: function hasFlag(flag) {
307
- return this._hasFlag(this.flags, flag);
240
+
241
+ return this._isViewable(this.flags);
242
+ }
243
+
244
+ get printable() {
245
+ if (this.flags === 0) {
246
+ return false;
308
247
  }
309
- }, {
310
- key: "setRectangle",
311
- value: function setRectangle(rectangle) {
312
- if (Array.isArray(rectangle) && rectangle.length === 4) {
313
- this.rectangle = _util.Util.normalizeRect(rectangle);
314
- } else {
315
- this.rectangle = [0, 0, 0, 0];
316
- }
248
+
249
+ return this._isPrintable(this.flags);
250
+ }
251
+
252
+ setContents(contents) {
253
+ this.contents = (0, _util.stringToPDFString)(contents || "");
254
+ }
255
+
256
+ setModificationDate(modificationDate) {
257
+ this.modificationDate = (0, _util.isString)(modificationDate) ? modificationDate : null;
258
+ }
259
+
260
+ setFlags(flags) {
261
+ this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;
262
+ }
263
+
264
+ hasFlag(flag) {
265
+ return this._hasFlag(this.flags, flag);
266
+ }
267
+
268
+ setRectangle(rectangle) {
269
+ if (Array.isArray(rectangle) && rectangle.length === 4) {
270
+ this.rectangle = _util.Util.normalizeRect(rectangle);
271
+ } else {
272
+ this.rectangle = [0, 0, 0, 0];
317
273
  }
318
- }, {
319
- key: "setColor",
320
- value: function setColor(color) {
321
- var rgbColor = new Uint8ClampedArray(3);
274
+ }
322
275
 
323
- if (!Array.isArray(color)) {
324
- this.color = rgbColor;
325
- return;
326
- }
276
+ setColor(color) {
277
+ const rgbColor = new Uint8ClampedArray(3);
327
278
 
328
- switch (color.length) {
329
- case 0:
330
- this.color = null;
331
- break;
279
+ if (!Array.isArray(color)) {
280
+ this.color = rgbColor;
281
+ return;
282
+ }
332
283
 
333
- case 1:
334
- _colorspace.ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0);
284
+ switch (color.length) {
285
+ case 0:
286
+ this.color = null;
287
+ break;
335
288
 
336
- this.color = rgbColor;
337
- break;
289
+ case 1:
290
+ _colorspace.ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0);
338
291
 
339
- case 3:
340
- _colorspace.ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0);
292
+ this.color = rgbColor;
293
+ break;
341
294
 
342
- this.color = rgbColor;
343
- break;
295
+ case 3:
296
+ _colorspace.ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0);
344
297
 
345
- case 4:
346
- _colorspace.ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0);
298
+ this.color = rgbColor;
299
+ break;
347
300
 
348
- this.color = rgbColor;
349
- break;
301
+ case 4:
302
+ _colorspace.ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0);
350
303
 
351
- default:
352
- this.color = rgbColor;
353
- break;
354
- }
304
+ this.color = rgbColor;
305
+ break;
306
+
307
+ default:
308
+ this.color = rgbColor;
309
+ break;
355
310
  }
356
- }, {
357
- key: "setBorderStyle",
358
- value: function setBorderStyle(borderStyle) {
359
- this.borderStyle = new AnnotationBorderStyle();
311
+ }
360
312
 
361
- if (!(0, _primitives.isDict)(borderStyle)) {
362
- return;
363
- }
313
+ setBorderStyle(borderStyle) {
314
+ this.borderStyle = new AnnotationBorderStyle();
364
315
 
365
- if (borderStyle.has('BS')) {
366
- var dict = borderStyle.get('BS');
367
- var dictType = dict.get('Type');
316
+ if (!(0, _primitives.isDict)(borderStyle)) {
317
+ return;
318
+ }
368
319
 
369
- if (!dictType || (0, _primitives.isName)(dictType, 'Border')) {
370
- this.borderStyle.setWidth(dict.get('W'), this.rectangle);
371
- this.borderStyle.setStyle(dict.get('S'));
372
- this.borderStyle.setDashArray(dict.getArray('D'));
373
- }
374
- } else if (borderStyle.has('Border')) {
375
- var array = borderStyle.getArray('Border');
320
+ if (borderStyle.has("BS")) {
321
+ const dict = borderStyle.get("BS");
322
+ const dictType = dict.get("Type");
376
323
 
377
- if (Array.isArray(array) && array.length >= 3) {
378
- this.borderStyle.setHorizontalCornerRadius(array[0]);
379
- this.borderStyle.setVerticalCornerRadius(array[1]);
380
- this.borderStyle.setWidth(array[2], this.rectangle);
324
+ if (!dictType || (0, _primitives.isName)(dictType, "Border")) {
325
+ this.borderStyle.setWidth(dict.get("W"), this.rectangle);
326
+ this.borderStyle.setStyle(dict.get("S"));
327
+ this.borderStyle.setDashArray(dict.getArray("D"));
328
+ }
329
+ } else if (borderStyle.has("Border")) {
330
+ const array = borderStyle.getArray("Border");
381
331
 
382
- if (array.length === 4) {
383
- this.borderStyle.setDashArray(array[3]);
384
- }
332
+ if (Array.isArray(array) && array.length >= 3) {
333
+ this.borderStyle.setHorizontalCornerRadius(array[0]);
334
+ this.borderStyle.setVerticalCornerRadius(array[1]);
335
+ this.borderStyle.setWidth(array[2], this.rectangle);
336
+
337
+ if (array.length === 4) {
338
+ this.borderStyle.setDashArray(array[3]);
385
339
  }
386
- } else {
387
- this.borderStyle.setWidth(0);
388
340
  }
341
+ } else {
342
+ this.borderStyle.setWidth(0);
389
343
  }
390
- }, {
391
- key: "setAppearance",
392
- value: function setAppearance(dict) {
393
- this.appearance = null;
394
- var appearanceStates = dict.get('AP');
395
-
396
- if (!(0, _primitives.isDict)(appearanceStates)) {
397
- return;
398
- }
399
-
400
- var normalAppearanceState = appearanceStates.get('N');
344
+ }
401
345
 
402
- if ((0, _primitives.isStream)(normalAppearanceState)) {
403
- this.appearance = normalAppearanceState;
404
- return;
405
- }
346
+ setAppearance(dict) {
347
+ this.appearance = null;
348
+ const appearanceStates = dict.get("AP");
406
349
 
407
- if (!(0, _primitives.isDict)(normalAppearanceState)) {
408
- return;
409
- }
350
+ if (!(0, _primitives.isDict)(appearanceStates)) {
351
+ return;
352
+ }
410
353
 
411
- var as = dict.get('AS');
354
+ const normalAppearanceState = appearanceStates.get("N");
412
355
 
413
- if (!(0, _primitives.isName)(as) || !normalAppearanceState.has(as.name)) {
414
- return;
415
- }
356
+ if ((0, _primitives.isStream)(normalAppearanceState)) {
357
+ this.appearance = normalAppearanceState;
358
+ return;
359
+ }
416
360
 
417
- this.appearance = normalAppearanceState.get(as.name);
361
+ if (!(0, _primitives.isDict)(normalAppearanceState)) {
362
+ return;
418
363
  }
419
- }, {
420
- key: "loadResources",
421
- value: function loadResources(keys) {
422
- return this.appearance.dict.getAsync('Resources').then(function (resources) {
423
- if (!resources) {
424
- return undefined;
425
- }
426
364
 
427
- var objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref);
428
- return objectLoader.load().then(function () {
429
- return resources;
430
- });
431
- });
365
+ const as = dict.get("AS");
366
+
367
+ if (!(0, _primitives.isName)(as) || !normalAppearanceState.has(as.name)) {
368
+ return;
432
369
  }
433
- }, {
434
- key: "getOperatorList",
435
- value: function getOperatorList(evaluator, task, renderForms) {
436
- var _this = this;
437
370
 
438
- if (!this.appearance) {
439
- return Promise.resolve(new _operator_list.OperatorList());
371
+ this.appearance = normalAppearanceState.get(as.name);
372
+ }
373
+
374
+ loadResources(keys) {
375
+ return this.appearance.dict.getAsync("Resources").then(resources => {
376
+ if (!resources) {
377
+ return undefined;
440
378
  }
441
379
 
442
- var data = this.data;
443
- var appearanceDict = this.appearance.dict;
444
- var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']);
445
- var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1];
446
- var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0];
447
- var transform = getTransformMatrix(data.rect, bbox, matrix);
448
- return resourcesPromise.then(function (resources) {
449
- var opList = new _operator_list.OperatorList();
450
- opList.addOp(_util.OPS.beginAnnotation, [data.rect, transform, matrix]);
451
- return evaluator.getOperatorList({
452
- stream: _this.appearance,
453
- task: task,
454
- resources: resources,
455
- operatorList: opList
456
- }).then(function () {
457
- opList.addOp(_util.OPS.endAnnotation, []);
458
-
459
- _this.appearance.reset();
460
-
461
- return opList;
462
- });
380
+ const objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref);
381
+ return objectLoader.load().then(function () {
382
+ return resources;
463
383
  });
464
- }
465
- }, {
466
- key: "viewable",
467
- get: function get() {
468
- if (this.flags === 0) {
469
- return true;
470
- }
384
+ });
385
+ }
471
386
 
472
- return this._isViewable(this.flags);
387
+ getOperatorList(evaluator, task, renderForms) {
388
+ if (!this.appearance) {
389
+ return Promise.resolve(new _operator_list.OperatorList());
473
390
  }
474
- }, {
475
- key: "printable",
476
- get: function get() {
477
- if (this.flags === 0) {
478
- return false;
479
- }
480
391
 
481
- return this._isPrintable(this.flags);
482
- }
483
- }]);
392
+ const data = this.data;
393
+ const appearanceDict = this.appearance.dict;
394
+ const resourcesPromise = this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"]);
395
+ const bbox = appearanceDict.getArray("BBox") || [0, 0, 1, 1];
396
+ const matrix = appearanceDict.getArray("Matrix") || [1, 0, 0, 1, 0, 0];
397
+ const transform = getTransformMatrix(data.rect, bbox, matrix);
398
+ return resourcesPromise.then(resources => {
399
+ const opList = new _operator_list.OperatorList();
400
+ opList.addOp(_util.OPS.beginAnnotation, [data.rect, transform, matrix]);
401
+ return evaluator.getOperatorList({
402
+ stream: this.appearance,
403
+ task,
404
+ resources,
405
+ operatorList: opList
406
+ }).then(() => {
407
+ opList.addOp(_util.OPS.endAnnotation, []);
408
+ this.appearance.reset();
409
+ return opList;
410
+ });
411
+ });
412
+ }
484
413
 
485
- return Annotation;
486
- }();
414
+ }
487
415
 
488
416
  exports.Annotation = Annotation;
489
417
 
490
- var AnnotationBorderStyle =
491
- /*#__PURE__*/
492
- function () {
493
- function AnnotationBorderStyle() {
494
- _classCallCheck(this, AnnotationBorderStyle);
495
-
418
+ class AnnotationBorderStyle {
419
+ constructor() {
496
420
  this.width = 1;
497
421
  this.style = _util.AnnotationBorderStyleType.SOLID;
498
422
  this.dashArray = [3];
@@ -500,982 +424,675 @@ function () {
500
424
  this.verticalCornerRadius = 0;
501
425
  }
502
426
 
503
- _createClass(AnnotationBorderStyle, [{
504
- key: "setWidth",
505
- value: function setWidth(width) {
506
- var rect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0, 0];
507
-
508
- if ((0, _primitives.isName)(width)) {
509
- this.width = 0;
510
- return;
511
- }
427
+ setWidth(width, rect = [0, 0, 0, 0]) {
428
+ if ((0, _primitives.isName)(width)) {
429
+ this.width = 0;
430
+ return;
431
+ }
512
432
 
513
- if (Number.isInteger(width)) {
514
- if (width > 0) {
515
- var maxWidth = (rect[2] - rect[0]) / 2;
516
- var maxHeight = (rect[3] - rect[1]) / 2;
433
+ if (Number.isInteger(width)) {
434
+ if (width > 0) {
435
+ const maxWidth = (rect[2] - rect[0]) / 2;
436
+ const maxHeight = (rect[3] - rect[1]) / 2;
517
437
 
518
- if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) {
519
- (0, _util.warn)("AnnotationBorderStyle.setWidth - ignoring width: ".concat(width));
520
- width = 1;
521
- }
438
+ if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) {
439
+ (0, _util.warn)(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`);
440
+ width = 1;
522
441
  }
523
-
524
- this.width = width;
525
442
  }
443
+
444
+ this.width = width;
526
445
  }
527
- }, {
528
- key: "setStyle",
529
- value: function setStyle(style) {
530
- if (!(0, _primitives.isName)(style)) {
531
- return;
532
- }
446
+ }
533
447
 
534
- switch (style.name) {
535
- case 'S':
536
- this.style = _util.AnnotationBorderStyleType.SOLID;
537
- break;
448
+ setStyle(style) {
449
+ if (!(0, _primitives.isName)(style)) {
450
+ return;
451
+ }
538
452
 
539
- case 'D':
540
- this.style = _util.AnnotationBorderStyleType.DASHED;
541
- break;
453
+ switch (style.name) {
454
+ case "S":
455
+ this.style = _util.AnnotationBorderStyleType.SOLID;
456
+ break;
542
457
 
543
- case 'B':
544
- this.style = _util.AnnotationBorderStyleType.BEVELED;
545
- break;
458
+ case "D":
459
+ this.style = _util.AnnotationBorderStyleType.DASHED;
460
+ break;
546
461
 
547
- case 'I':
548
- this.style = _util.AnnotationBorderStyleType.INSET;
549
- break;
462
+ case "B":
463
+ this.style = _util.AnnotationBorderStyleType.BEVELED;
464
+ break;
550
465
 
551
- case 'U':
552
- this.style = _util.AnnotationBorderStyleType.UNDERLINE;
553
- break;
466
+ case "I":
467
+ this.style = _util.AnnotationBorderStyleType.INSET;
468
+ break;
554
469
 
555
- default:
556
- break;
557
- }
470
+ case "U":
471
+ this.style = _util.AnnotationBorderStyleType.UNDERLINE;
472
+ break;
473
+
474
+ default:
475
+ break;
558
476
  }
559
- }, {
560
- key: "setDashArray",
561
- value: function setDashArray(dashArray) {
562
- if (Array.isArray(dashArray) && dashArray.length > 0) {
563
- var isValid = true;
564
- var allZeros = true;
565
- var _iteratorNormalCompletion = true;
566
- var _didIteratorError = false;
567
- var _iteratorError = undefined;
568
-
569
- try {
570
- for (var _iterator = dashArray[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
571
- var element = _step.value;
572
- var validNumber = +element >= 0;
573
-
574
- if (!validNumber) {
575
- isValid = false;
576
- break;
577
- } else if (element > 0) {
578
- allZeros = false;
579
- }
580
- }
581
- } catch (err) {
582
- _didIteratorError = true;
583
- _iteratorError = err;
584
- } finally {
585
- try {
586
- if (!_iteratorNormalCompletion && _iterator["return"] != null) {
587
- _iterator["return"]();
588
- }
589
- } finally {
590
- if (_didIteratorError) {
591
- throw _iteratorError;
592
- }
593
- }
594
- }
477
+ }
595
478
 
596
- if (isValid && !allZeros) {
597
- this.dashArray = dashArray;
598
- } else {
599
- this.width = 0;
479
+ setDashArray(dashArray) {
480
+ if (Array.isArray(dashArray) && dashArray.length > 0) {
481
+ let isValid = true;
482
+ let allZeros = true;
483
+
484
+ for (const element of dashArray) {
485
+ const validNumber = +element >= 0;
486
+
487
+ if (!validNumber) {
488
+ isValid = false;
489
+ break;
490
+ } else if (element > 0) {
491
+ allZeros = false;
600
492
  }
601
- } else if (dashArray) {
493
+ }
494
+
495
+ if (isValid && !allZeros) {
496
+ this.dashArray = dashArray;
497
+ } else {
602
498
  this.width = 0;
603
499
  }
500
+ } else if (dashArray) {
501
+ this.width = 0;
604
502
  }
605
- }, {
606
- key: "setHorizontalCornerRadius",
607
- value: function setHorizontalCornerRadius(radius) {
608
- if (Number.isInteger(radius)) {
609
- this.horizontalCornerRadius = radius;
610
- }
503
+ }
504
+
505
+ setHorizontalCornerRadius(radius) {
506
+ if (Number.isInteger(radius)) {
507
+ this.horizontalCornerRadius = radius;
611
508
  }
612
- }, {
613
- key: "setVerticalCornerRadius",
614
- value: function setVerticalCornerRadius(radius) {
615
- if (Number.isInteger(radius)) {
616
- this.verticalCornerRadius = radius;
617
- }
509
+ }
510
+
511
+ setVerticalCornerRadius(radius) {
512
+ if (Number.isInteger(radius)) {
513
+ this.verticalCornerRadius = radius;
618
514
  }
619
- }]);
515
+ }
620
516
 
621
- return AnnotationBorderStyle;
622
- }();
517
+ }
623
518
 
624
519
  exports.AnnotationBorderStyle = AnnotationBorderStyle;
625
520
 
626
- var MarkupAnnotation =
627
- /*#__PURE__*/
628
- function (_Annotation) {
629
- _inherits(MarkupAnnotation, _Annotation);
521
+ class MarkupAnnotation extends Annotation {
522
+ constructor(parameters) {
523
+ super(parameters);
524
+ const dict = parameters.dict;
630
525
 
631
- function MarkupAnnotation(parameters) {
632
- var _this2;
633
-
634
- _classCallCheck(this, MarkupAnnotation);
635
-
636
- _this2 = _possibleConstructorReturn(this, _getPrototypeOf(MarkupAnnotation).call(this, parameters));
637
- var dict = parameters.dict;
638
-
639
- if (dict.has('IRT')) {
640
- var rawIRT = dict.getRaw('IRT');
641
- _this2.data.inReplyTo = (0, _primitives.isRef)(rawIRT) ? rawIRT.toString() : null;
642
- var rt = dict.get('RT');
643
- _this2.data.replyType = (0, _primitives.isName)(rt) ? rt.name : _util.AnnotationReplyType.REPLY;
526
+ if (dict.has("IRT")) {
527
+ const rawIRT = dict.getRaw("IRT");
528
+ this.data.inReplyTo = (0, _primitives.isRef)(rawIRT) ? rawIRT.toString() : null;
529
+ const rt = dict.get("RT");
530
+ this.data.replyType = (0, _primitives.isName)(rt) ? rt.name : _util.AnnotationReplyType.REPLY;
644
531
  }
645
532
 
646
- if (_this2.data.replyType === _util.AnnotationReplyType.GROUP) {
647
- var parent = dict.get('IRT');
648
- _this2.data.title = (0, _util.stringToPDFString)(parent.get('T') || '');
649
-
650
- _this2.setContents(parent.get('Contents'));
651
-
652
- _this2.data.contents = _this2.contents;
533
+ if (this.data.replyType === _util.AnnotationReplyType.GROUP) {
534
+ const parent = dict.get("IRT");
535
+ this.data.title = (0, _util.stringToPDFString)(parent.get("T") || "");
536
+ this.setContents(parent.get("Contents"));
537
+ this.data.contents = this.contents;
653
538
 
654
- if (!parent.has('CreationDate')) {
655
- _this2.data.creationDate = null;
539
+ if (!parent.has("CreationDate")) {
540
+ this.data.creationDate = null;
656
541
  } else {
657
- _this2.setCreationDate(parent.get('CreationDate'));
658
-
659
- _this2.data.creationDate = _this2.creationDate;
542
+ this.setCreationDate(parent.get("CreationDate"));
543
+ this.data.creationDate = this.creationDate;
660
544
  }
661
545
 
662
- if (!parent.has('M')) {
663
- _this2.data.modificationDate = null;
546
+ if (!parent.has("M")) {
547
+ this.data.modificationDate = null;
664
548
  } else {
665
- _this2.setModificationDate(parent.get('M'));
666
-
667
- _this2.data.modificationDate = _this2.modificationDate;
549
+ this.setModificationDate(parent.get("M"));
550
+ this.data.modificationDate = this.modificationDate;
668
551
  }
669
552
 
670
- _this2.data.hasPopup = parent.has('Popup');
553
+ this.data.hasPopup = parent.has("Popup");
671
554
 
672
- if (!parent.has('C')) {
673
- _this2.data.color = null;
555
+ if (!parent.has("C")) {
556
+ this.data.color = null;
674
557
  } else {
675
- _this2.setColor(parent.getArray('C'));
676
-
677
- _this2.data.color = _this2.color;
558
+ this.setColor(parent.getArray("C"));
559
+ this.data.color = this.color;
678
560
  }
679
561
  } else {
680
- _this2.data.title = (0, _util.stringToPDFString)(dict.get('T') || '');
681
-
682
- _this2.setCreationDate(dict.get('CreationDate'));
562
+ this.data.title = (0, _util.stringToPDFString)(dict.get("T") || "");
563
+ this.setCreationDate(dict.get("CreationDate"));
564
+ this.data.creationDate = this.creationDate;
565
+ this.data.hasPopup = dict.has("Popup");
683
566
 
684
- _this2.data.creationDate = _this2.creationDate;
685
- _this2.data.hasPopup = dict.has('Popup');
686
-
687
- if (!dict.has('C')) {
688
- _this2.data.color = null;
567
+ if (!dict.has("C")) {
568
+ this.data.color = null;
689
569
  }
690
570
  }
691
-
692
- return _this2;
693
571
  }
694
572
 
695
- _createClass(MarkupAnnotation, [{
696
- key: "setCreationDate",
697
- value: function setCreationDate(creationDate) {
698
- this.creationDate = (0, _util.isString)(creationDate) ? creationDate : null;
699
- }
700
- }]);
573
+ setCreationDate(creationDate) {
574
+ this.creationDate = (0, _util.isString)(creationDate) ? creationDate : null;
575
+ }
701
576
 
702
- return MarkupAnnotation;
703
- }(Annotation);
577
+ }
704
578
 
705
579
  exports.MarkupAnnotation = MarkupAnnotation;
706
580
 
707
- var WidgetAnnotation =
708
- /*#__PURE__*/
709
- function (_Annotation2) {
710
- _inherits(WidgetAnnotation, _Annotation2);
711
-
712
- function WidgetAnnotation(params) {
713
- var _this3;
714
-
715
- _classCallCheck(this, WidgetAnnotation);
716
-
717
- _this3 = _possibleConstructorReturn(this, _getPrototypeOf(WidgetAnnotation).call(this, params));
718
- var dict = params.dict;
719
- var data = _this3.data;
581
+ class WidgetAnnotation extends Annotation {
582
+ constructor(params) {
583
+ super(params);
584
+ const dict = params.dict;
585
+ const data = this.data;
720
586
  data.annotationType = _util.AnnotationType.WIDGET;
721
- data.fieldName = _this3._constructFieldName(dict);
587
+ data.fieldName = this._constructFieldName(dict);
722
588
  data.fieldValue = (0, _core_utils.getInheritableProperty)({
723
- dict: dict,
724
- key: 'V',
589
+ dict,
590
+ key: "V",
725
591
  getArray: true
726
592
  });
727
- data.alternativeText = (0, _util.stringToPDFString)(dict.get('TU') || '');
593
+ data.alternativeText = (0, _util.stringToPDFString)(dict.get("TU") || "");
728
594
  data.defaultAppearance = (0, _core_utils.getInheritableProperty)({
729
- dict: dict,
730
- key: 'DA'
731
- }) || '';
732
- var fieldType = (0, _core_utils.getInheritableProperty)({
733
- dict: dict,
734
- key: 'FT'
595
+ dict,
596
+ key: "DA"
597
+ }) || "";
598
+ const fieldType = (0, _core_utils.getInheritableProperty)({
599
+ dict,
600
+ key: "FT"
735
601
  });
736
602
  data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
737
- _this3.fieldResources = (0, _core_utils.getInheritableProperty)({
738
- dict: dict,
739
- key: 'DR'
603
+ this.fieldResources = (0, _core_utils.getInheritableProperty)({
604
+ dict,
605
+ key: "DR"
740
606
  }) || _primitives.Dict.empty;
741
607
  data.fieldFlags = (0, _core_utils.getInheritableProperty)({
742
- dict: dict,
743
- key: 'Ff'
608
+ dict,
609
+ key: "Ff"
744
610
  });
745
611
 
746
612
  if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) {
747
613
  data.fieldFlags = 0;
748
614
  }
749
615
 
750
- data.readOnly = _this3.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
616
+ data.readOnly = this.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
751
617
 
752
- if (data.fieldType === 'Sig') {
618
+ if (data.fieldType === "Sig") {
753
619
  data.fieldValue = null;
754
-
755
- _this3.setFlags(_util.AnnotationFlag.HIDDEN);
620
+ this.setFlags(_util.AnnotationFlag.HIDDEN);
756
621
  }
757
-
758
- return _this3;
759
622
  }
760
623
 
761
- _createClass(WidgetAnnotation, [{
762
- key: "_constructFieldName",
763
- value: function _constructFieldName(dict) {
764
- if (!dict.has('T') && !dict.has('Parent')) {
765
- (0, _util.warn)('Unknown field name, falling back to empty field name.');
766
- return '';
767
- }
624
+ _constructFieldName(dict) {
625
+ if (!dict.has("T") && !dict.has("Parent")) {
626
+ (0, _util.warn)("Unknown field name, falling back to empty field name.");
627
+ return "";
628
+ }
768
629
 
769
- if (!dict.has('Parent')) {
770
- return (0, _util.stringToPDFString)(dict.get('T'));
771
- }
630
+ if (!dict.has("Parent")) {
631
+ return (0, _util.stringToPDFString)(dict.get("T"));
632
+ }
772
633
 
773
- var fieldName = [];
634
+ const fieldName = [];
774
635
 
775
- if (dict.has('T')) {
776
- fieldName.unshift((0, _util.stringToPDFString)(dict.get('T')));
777
- }
778
-
779
- var loopDict = dict;
636
+ if (dict.has("T")) {
637
+ fieldName.unshift((0, _util.stringToPDFString)(dict.get("T")));
638
+ }
780
639
 
781
- while (loopDict.has('Parent')) {
782
- loopDict = loopDict.get('Parent');
640
+ let loopDict = dict;
783
641
 
784
- if (!(0, _primitives.isDict)(loopDict)) {
785
- break;
786
- }
642
+ while (loopDict.has("Parent")) {
643
+ loopDict = loopDict.get("Parent");
787
644
 
788
- if (loopDict.has('T')) {
789
- fieldName.unshift((0, _util.stringToPDFString)(loopDict.get('T')));
790
- }
645
+ if (!(0, _primitives.isDict)(loopDict)) {
646
+ break;
791
647
  }
792
648
 
793
- return fieldName.join('.');
794
- }
795
- }, {
796
- key: "hasFieldFlag",
797
- value: function hasFieldFlag(flag) {
798
- return !!(this.data.fieldFlags & flag);
799
- }
800
- }, {
801
- key: "getOperatorList",
802
- value: function getOperatorList(evaluator, task, renderForms) {
803
- if (renderForms) {
804
- return Promise.resolve(new _operator_list.OperatorList());
649
+ if (loopDict.has("T")) {
650
+ fieldName.unshift((0, _util.stringToPDFString)(loopDict.get("T")));
805
651
  }
806
-
807
- return _get(_getPrototypeOf(WidgetAnnotation.prototype), "getOperatorList", this).call(this, evaluator, task, renderForms);
808
652
  }
809
- }]);
810
653
 
811
- return WidgetAnnotation;
812
- }(Annotation);
654
+ return fieldName.join(".");
655
+ }
813
656
 
814
- var TextWidgetAnnotation =
815
- /*#__PURE__*/
816
- function (_WidgetAnnotation) {
817
- _inherits(TextWidgetAnnotation, _WidgetAnnotation);
657
+ hasFieldFlag(flag) {
658
+ return !!(this.data.fieldFlags & flag);
659
+ }
660
+
661
+ getOperatorList(evaluator, task, renderForms) {
662
+ if (renderForms) {
663
+ return Promise.resolve(new _operator_list.OperatorList());
664
+ }
818
665
 
819
- function TextWidgetAnnotation(params) {
820
- var _this4;
666
+ return super.getOperatorList(evaluator, task, renderForms);
667
+ }
821
668
 
822
- _classCallCheck(this, TextWidgetAnnotation);
669
+ }
823
670
 
824
- _this4 = _possibleConstructorReturn(this, _getPrototypeOf(TextWidgetAnnotation).call(this, params));
825
- var dict = params.dict;
826
- _this4.data.fieldValue = (0, _util.stringToPDFString)(_this4.data.fieldValue || '');
827
- var alignment = (0, _core_utils.getInheritableProperty)({
828
- dict: dict,
829
- key: 'Q'
671
+ class TextWidgetAnnotation extends WidgetAnnotation {
672
+ constructor(params) {
673
+ super(params);
674
+ const dict = params.dict;
675
+ this.data.fieldValue = (0, _util.stringToPDFString)(this.data.fieldValue || "");
676
+ let alignment = (0, _core_utils.getInheritableProperty)({
677
+ dict,
678
+ key: "Q"
830
679
  });
831
680
 
832
681
  if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) {
833
682
  alignment = null;
834
683
  }
835
684
 
836
- _this4.data.textAlignment = alignment;
837
- var maximumLength = (0, _core_utils.getInheritableProperty)({
838
- dict: dict,
839
- key: 'MaxLen'
685
+ this.data.textAlignment = alignment;
686
+ let maximumLength = (0, _core_utils.getInheritableProperty)({
687
+ dict,
688
+ key: "MaxLen"
840
689
  });
841
690
 
842
691
  if (!Number.isInteger(maximumLength) || maximumLength < 0) {
843
692
  maximumLength = null;
844
693
  }
845
694
 
846
- _this4.data.maxLen = maximumLength;
847
- _this4.data.multiLine = _this4.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE);
848
- _this4.data.comb = _this4.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && _this4.data.maxLen !== null;
849
- return _this4;
695
+ this.data.maxLen = maximumLength;
696
+ this.data.multiLine = this.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE);
697
+ this.data.comb = this.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !this.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== null;
850
698
  }
851
699
 
852
- _createClass(TextWidgetAnnotation, [{
853
- key: "getOperatorList",
854
- value: function getOperatorList(evaluator, task, renderForms) {
855
- if (renderForms || this.appearance) {
856
- return _get(_getPrototypeOf(TextWidgetAnnotation.prototype), "getOperatorList", this).call(this, evaluator, task, renderForms);
857
- }
858
-
859
- var operatorList = new _operator_list.OperatorList();
860
-
861
- if (!this.data.defaultAppearance) {
862
- return Promise.resolve(operatorList);
863
- }
864
-
865
- var stream = new _stream.Stream((0, _util.stringToBytes)(this.data.defaultAppearance));
866
- return evaluator.getOperatorList({
867
- stream: stream,
868
- task: task,
869
- resources: this.fieldResources,
870
- operatorList: operatorList
871
- }).then(function () {
872
- return operatorList;
873
- });
700
+ getOperatorList(evaluator, task, renderForms) {
701
+ if (renderForms || this.appearance) {
702
+ return super.getOperatorList(evaluator, task, renderForms);
874
703
  }
875
- }]);
876
-
877
- return TextWidgetAnnotation;
878
- }(WidgetAnnotation);
879
704
 
880
- var ButtonWidgetAnnotation =
881
- /*#__PURE__*/
882
- function (_WidgetAnnotation2) {
883
- _inherits(ButtonWidgetAnnotation, _WidgetAnnotation2);
705
+ const operatorList = new _operator_list.OperatorList();
884
706
 
885
- function ButtonWidgetAnnotation(params) {
886
- var _this5;
707
+ if (!this.data.defaultAppearance) {
708
+ return Promise.resolve(operatorList);
709
+ }
887
710
 
888
- _classCallCheck(this, ButtonWidgetAnnotation);
711
+ const stream = new _stream.Stream((0, _util.stringToBytes)(this.data.defaultAppearance));
712
+ return evaluator.getOperatorList({
713
+ stream,
714
+ task,
715
+ resources: this.fieldResources,
716
+ operatorList
717
+ }).then(function () {
718
+ return operatorList;
719
+ });
720
+ }
889
721
 
890
- _this5 = _possibleConstructorReturn(this, _getPrototypeOf(ButtonWidgetAnnotation).call(this, params));
891
- _this5.data.checkBox = !_this5.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
892
- _this5.data.radioButton = _this5.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
893
- _this5.data.pushButton = _this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
722
+ }
894
723
 
895
- if (_this5.data.checkBox) {
896
- _this5._processCheckBox(params);
897
- } else if (_this5.data.radioButton) {
898
- _this5._processRadioButton(params);
899
- } else if (_this5.data.pushButton) {
900
- _this5._processPushButton(params);
724
+ class ButtonWidgetAnnotation extends WidgetAnnotation {
725
+ constructor(params) {
726
+ super(params);
727
+ this.data.checkBox = !this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
728
+ this.data.radioButton = this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
729
+ this.data.pushButton = this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
730
+
731
+ if (this.data.checkBox) {
732
+ this._processCheckBox(params);
733
+ } else if (this.data.radioButton) {
734
+ this._processRadioButton(params);
735
+ } else if (this.data.pushButton) {
736
+ this._processPushButton(params);
901
737
  } else {
902
- (0, _util.warn)('Invalid field flags for button widget annotation');
738
+ (0, _util.warn)("Invalid field flags for button widget annotation");
903
739
  }
904
-
905
- return _this5;
906
740
  }
907
741
 
908
- _createClass(ButtonWidgetAnnotation, [{
909
- key: "_processCheckBox",
910
- value: function _processCheckBox(params) {
911
- if ((0, _primitives.isName)(this.data.fieldValue)) {
912
- this.data.fieldValue = this.data.fieldValue.name;
913
- }
742
+ _processCheckBox(params) {
743
+ if ((0, _primitives.isName)(this.data.fieldValue)) {
744
+ this.data.fieldValue = this.data.fieldValue.name;
745
+ }
914
746
 
915
- var customAppearance = params.dict.get('AP');
747
+ const customAppearance = params.dict.get("AP");
916
748
 
917
- if (!(0, _primitives.isDict)(customAppearance)) {
918
- return;
919
- }
749
+ if (!(0, _primitives.isDict)(customAppearance)) {
750
+ return;
751
+ }
920
752
 
921
- var exportValueOptionsDict = customAppearance.get('D');
753
+ const exportValueOptionsDict = customAppearance.get("D");
922
754
 
923
- if (!(0, _primitives.isDict)(exportValueOptionsDict)) {
924
- return;
925
- }
926
-
927
- var exportValues = exportValueOptionsDict.getKeys();
928
- var hasCorrectOptionCount = exportValues.length === 2;
755
+ if (!(0, _primitives.isDict)(exportValueOptionsDict)) {
756
+ return;
757
+ }
929
758
 
930
- if (!hasCorrectOptionCount) {
931
- return;
932
- }
759
+ const exportValues = exportValueOptionsDict.getKeys();
760
+ const hasCorrectOptionCount = exportValues.length === 2;
933
761
 
934
- this.data.exportValue = exportValues[0] === 'Off' ? exportValues[1] : exportValues[0];
762
+ if (!hasCorrectOptionCount) {
763
+ return;
935
764
  }
936
- }, {
937
- key: "_processRadioButton",
938
- value: function _processRadioButton(params) {
939
- this.data.fieldValue = this.data.buttonValue = null;
940
- var fieldParent = params.dict.get('Parent');
941
765
 
942
- if ((0, _primitives.isDict)(fieldParent) && fieldParent.has('V')) {
943
- var fieldParentValue = fieldParent.get('V');
766
+ this.data.exportValue = exportValues[0] === "Off" ? exportValues[1] : exportValues[0];
767
+ }
944
768
 
945
- if ((0, _primitives.isName)(fieldParentValue)) {
946
- this.data.fieldValue = fieldParentValue.name;
947
- }
948
- }
769
+ _processRadioButton(params) {
770
+ this.data.fieldValue = this.data.buttonValue = null;
771
+ const fieldParent = params.dict.get("Parent");
949
772
 
950
- var appearanceStates = params.dict.get('AP');
773
+ if ((0, _primitives.isDict)(fieldParent) && fieldParent.has("V")) {
774
+ const fieldParentValue = fieldParent.get("V");
951
775
 
952
- if (!(0, _primitives.isDict)(appearanceStates)) {
953
- return;
776
+ if ((0, _primitives.isName)(fieldParentValue)) {
777
+ this.data.fieldValue = fieldParentValue.name;
954
778
  }
779
+ }
955
780
 
956
- var normalAppearanceState = appearanceStates.get('N');
781
+ const appearanceStates = params.dict.get("AP");
957
782
 
958
- if (!(0, _primitives.isDict)(normalAppearanceState)) {
959
- return;
960
- }
783
+ if (!(0, _primitives.isDict)(appearanceStates)) {
784
+ return;
785
+ }
961
786
 
962
- var _iteratorNormalCompletion2 = true;
963
- var _didIteratorError2 = false;
964
- var _iteratorError2 = undefined;
787
+ const normalAppearanceState = appearanceStates.get("N");
965
788
 
966
- try {
967
- for (var _iterator2 = normalAppearanceState.getKeys()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
968
- var key = _step2.value;
789
+ if (!(0, _primitives.isDict)(normalAppearanceState)) {
790
+ return;
791
+ }
969
792
 
970
- if (key !== 'Off') {
971
- this.data.buttonValue = key;
972
- break;
973
- }
974
- }
975
- } catch (err) {
976
- _didIteratorError2 = true;
977
- _iteratorError2 = err;
978
- } finally {
979
- try {
980
- if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
981
- _iterator2["return"]();
982
- }
983
- } finally {
984
- if (_didIteratorError2) {
985
- throw _iteratorError2;
986
- }
987
- }
793
+ for (const key of normalAppearanceState.getKeys()) {
794
+ if (key !== "Off") {
795
+ this.data.buttonValue = key;
796
+ break;
988
797
  }
989
798
  }
990
- }, {
991
- key: "_processPushButton",
992
- value: function _processPushButton(params) {
993
- if (!params.dict.has('A')) {
994
- (0, _util.warn)('Push buttons without action dictionaries are not supported');
995
- return;
996
- }
799
+ }
997
800
 
998
- _obj.Catalog.parseDestDictionary({
999
- destDict: params.dict,
1000
- resultObj: this.data,
1001
- docBaseUrl: params.pdfManager.docBaseUrl
1002
- });
801
+ _processPushButton(params) {
802
+ if (!params.dict.has("A")) {
803
+ (0, _util.warn)("Push buttons without action dictionaries are not supported");
804
+ return;
1003
805
  }
1004
- }]);
1005
-
1006
- return ButtonWidgetAnnotation;
1007
- }(WidgetAnnotation);
1008
806
 
1009
- var ChoiceWidgetAnnotation =
1010
- /*#__PURE__*/
1011
- function (_WidgetAnnotation3) {
1012
- _inherits(ChoiceWidgetAnnotation, _WidgetAnnotation3);
1013
-
1014
- function ChoiceWidgetAnnotation(params) {
1015
- var _this6;
807
+ _obj.Catalog.parseDestDictionary({
808
+ destDict: params.dict,
809
+ resultObj: this.data,
810
+ docBaseUrl: params.pdfManager.docBaseUrl
811
+ });
812
+ }
1016
813
 
1017
- _classCallCheck(this, ChoiceWidgetAnnotation);
814
+ }
1018
815
 
1019
- _this6 = _possibleConstructorReturn(this, _getPrototypeOf(ChoiceWidgetAnnotation).call(this, params));
1020
- _this6.data.options = [];
1021
- var options = (0, _core_utils.getInheritableProperty)({
816
+ class ChoiceWidgetAnnotation extends WidgetAnnotation {
817
+ constructor(params) {
818
+ super(params);
819
+ this.data.options = [];
820
+ const options = (0, _core_utils.getInheritableProperty)({
1022
821
  dict: params.dict,
1023
- key: 'Opt'
822
+ key: "Opt"
1024
823
  });
1025
824
 
1026
825
  if (Array.isArray(options)) {
1027
- var xref = params.xref;
826
+ const xref = params.xref;
1028
827
 
1029
- for (var i = 0, ii = options.length; i < ii; i++) {
1030
- var option = xref.fetchIfRef(options[i]);
1031
- var isOptionArray = Array.isArray(option);
1032
- _this6.data.options[i] = {
828
+ for (let i = 0, ii = options.length; i < ii; i++) {
829
+ const option = xref.fetchIfRef(options[i]);
830
+ const isOptionArray = Array.isArray(option);
831
+ this.data.options[i] = {
1033
832
  exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option,
1034
833
  displayValue: (0, _util.stringToPDFString)(isOptionArray ? xref.fetchIfRef(option[1]) : option)
1035
834
  };
1036
835
  }
1037
836
  }
1038
837
 
1039
- if (!Array.isArray(_this6.data.fieldValue)) {
1040
- _this6.data.fieldValue = [_this6.data.fieldValue];
838
+ if (!Array.isArray(this.data.fieldValue)) {
839
+ this.data.fieldValue = [this.data.fieldValue];
1041
840
  }
1042
841
 
1043
- _this6.data.combo = _this6.hasFieldFlag(_util.AnnotationFieldFlag.COMBO);
1044
- _this6.data.multiSelect = _this6.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT);
1045
- return _this6;
842
+ this.data.combo = this.hasFieldFlag(_util.AnnotationFieldFlag.COMBO);
843
+ this.data.multiSelect = this.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT);
1046
844
  }
1047
845
 
1048
- return ChoiceWidgetAnnotation;
1049
- }(WidgetAnnotation);
1050
-
1051
- var TextAnnotation =
1052
- /*#__PURE__*/
1053
- function (_MarkupAnnotation) {
1054
- _inherits(TextAnnotation, _MarkupAnnotation);
1055
-
1056
- function TextAnnotation(parameters) {
1057
- var _this7;
1058
-
1059
- _classCallCheck(this, TextAnnotation);
846
+ }
1060
847
 
1061
- var DEFAULT_ICON_SIZE = 22;
1062
- _this7 = _possibleConstructorReturn(this, _getPrototypeOf(TextAnnotation).call(this, parameters));
1063
- var dict = parameters.dict;
1064
- _this7.data.annotationType = _util.AnnotationType.TEXT;
848
+ class TextAnnotation extends MarkupAnnotation {
849
+ constructor(parameters) {
850
+ const DEFAULT_ICON_SIZE = 22;
851
+ super(parameters);
852
+ const dict = parameters.dict;
853
+ this.data.annotationType = _util.AnnotationType.TEXT;
1065
854
 
1066
- if (_this7.data.hasAppearance) {
1067
- _this7.data.name = 'NoIcon';
855
+ if (this.data.hasAppearance) {
856
+ this.data.name = "NoIcon";
1068
857
  } else {
1069
- _this7.data.rect[1] = _this7.data.rect[3] - DEFAULT_ICON_SIZE;
1070
- _this7.data.rect[2] = _this7.data.rect[0] + DEFAULT_ICON_SIZE;
1071
- _this7.data.name = dict.has('Name') ? dict.get('Name').name : 'Note';
858
+ this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE;
859
+ this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE;
860
+ this.data.name = dict.has("Name") ? dict.get("Name").name : "Note";
1072
861
  }
1073
862
 
1074
- if (dict.has('State')) {
1075
- _this7.data.state = dict.get('State') || null;
1076
- _this7.data.stateModel = dict.get('StateModel') || null;
863
+ if (dict.has("State")) {
864
+ this.data.state = dict.get("State") || null;
865
+ this.data.stateModel = dict.get("StateModel") || null;
1077
866
  } else {
1078
- _this7.data.state = null;
1079
- _this7.data.stateModel = null;
867
+ this.data.state = null;
868
+ this.data.stateModel = null;
1080
869
  }
1081
-
1082
- return _this7;
1083
870
  }
1084
871
 
1085
- return TextAnnotation;
1086
- }(MarkupAnnotation);
1087
-
1088
- var LinkAnnotation =
1089
- /*#__PURE__*/
1090
- function (_Annotation3) {
1091
- _inherits(LinkAnnotation, _Annotation3);
1092
-
1093
- function LinkAnnotation(params) {
1094
- var _this8;
1095
-
1096
- _classCallCheck(this, LinkAnnotation);
872
+ }
1097
873
 
1098
- _this8 = _possibleConstructorReturn(this, _getPrototypeOf(LinkAnnotation).call(this, params));
1099
- _this8.data.annotationType = _util.AnnotationType.LINK;
1100
- var quadPoints = getQuadPoints(params.dict, _this8.rectangle);
874
+ class LinkAnnotation extends Annotation {
875
+ constructor(params) {
876
+ super(params);
877
+ this.data.annotationType = _util.AnnotationType.LINK;
878
+ const quadPoints = getQuadPoints(params.dict, this.rectangle);
1101
879
 
1102
880
  if (quadPoints) {
1103
- _this8.data.quadPoints = quadPoints;
881
+ this.data.quadPoints = quadPoints;
1104
882
  }
1105
883
 
1106
884
  _obj.Catalog.parseDestDictionary({
1107
885
  destDict: params.dict,
1108
- resultObj: _this8.data,
886
+ resultObj: this.data,
1109
887
  docBaseUrl: params.pdfManager.docBaseUrl
1110
888
  });
1111
-
1112
- return _this8;
1113
889
  }
1114
890
 
1115
- return LinkAnnotation;
1116
- }(Annotation);
1117
-
1118
- var PopupAnnotation =
1119
- /*#__PURE__*/
1120
- function (_Annotation4) {
1121
- _inherits(PopupAnnotation, _Annotation4);
1122
-
1123
- function PopupAnnotation(parameters) {
1124
- var _this9;
1125
-
1126
- _classCallCheck(this, PopupAnnotation);
891
+ }
1127
892
 
1128
- _this9 = _possibleConstructorReturn(this, _getPrototypeOf(PopupAnnotation).call(this, parameters));
1129
- _this9.data.annotationType = _util.AnnotationType.POPUP;
1130
- var parentItem = parameters.dict.get('Parent');
893
+ class PopupAnnotation extends Annotation {
894
+ constructor(parameters) {
895
+ super(parameters);
896
+ this.data.annotationType = _util.AnnotationType.POPUP;
897
+ let parentItem = parameters.dict.get("Parent");
1131
898
 
1132
899
  if (!parentItem) {
1133
- (0, _util.warn)('Popup annotation has a missing or invalid parent annotation.');
1134
- return _possibleConstructorReturn(_this9);
900
+ (0, _util.warn)("Popup annotation has a missing or invalid parent annotation.");
901
+ return;
1135
902
  }
1136
903
 
1137
- var parentSubtype = parentItem.get('Subtype');
1138
- _this9.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null;
1139
- var rawParent = parameters.dict.getRaw('Parent');
1140
- _this9.data.parentId = (0, _primitives.isRef)(rawParent) ? rawParent.toString() : null;
1141
- var rt = parentItem.get('RT');
904
+ const parentSubtype = parentItem.get("Subtype");
905
+ this.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null;
906
+ const rawParent = parameters.dict.getRaw("Parent");
907
+ this.data.parentId = (0, _primitives.isRef)(rawParent) ? rawParent.toString() : null;
908
+ const rt = parentItem.get("RT");
1142
909
 
1143
910
  if ((0, _primitives.isName)(rt, _util.AnnotationReplyType.GROUP)) {
1144
- parentItem = parentItem.get('IRT');
911
+ parentItem = parentItem.get("IRT");
1145
912
  }
1146
913
 
1147
- if (!parentItem.has('M')) {
1148
- _this9.data.modificationDate = null;
914
+ if (!parentItem.has("M")) {
915
+ this.data.modificationDate = null;
1149
916
  } else {
1150
- _this9.setModificationDate(parentItem.get('M'));
1151
-
1152
- _this9.data.modificationDate = _this9.modificationDate;
917
+ this.setModificationDate(parentItem.get("M"));
918
+ this.data.modificationDate = this.modificationDate;
1153
919
  }
1154
920
 
1155
- if (!parentItem.has('C')) {
1156
- _this9.data.color = null;
921
+ if (!parentItem.has("C")) {
922
+ this.data.color = null;
1157
923
  } else {
1158
- _this9.setColor(parentItem.getArray('C'));
1159
-
1160
- _this9.data.color = _this9.color;
924
+ this.setColor(parentItem.getArray("C"));
925
+ this.data.color = this.color;
1161
926
  }
1162
927
 
1163
- if (!_this9.viewable) {
1164
- var parentFlags = parentItem.get('F');
928
+ if (!this.viewable) {
929
+ const parentFlags = parentItem.get("F");
1165
930
 
1166
- if (_this9._isViewable(parentFlags)) {
1167
- _this9.setFlags(parentFlags);
931
+ if (this._isViewable(parentFlags)) {
932
+ this.setFlags(parentFlags);
1168
933
  }
1169
934
  }
1170
935
 
1171
- _this9.data.title = (0, _util.stringToPDFString)(parentItem.get('T') || '');
1172
- _this9.data.contents = (0, _util.stringToPDFString)(parentItem.get('Contents') || '');
1173
- return _this9;
936
+ this.data.title = (0, _util.stringToPDFString)(parentItem.get("T") || "");
937
+ this.data.contents = (0, _util.stringToPDFString)(parentItem.get("Contents") || "");
1174
938
  }
1175
939
 
1176
- return PopupAnnotation;
1177
- }(Annotation);
1178
-
1179
- var FreeTextAnnotation =
1180
- /*#__PURE__*/
1181
- function (_MarkupAnnotation2) {
1182
- _inherits(FreeTextAnnotation, _MarkupAnnotation2);
1183
-
1184
- function FreeTextAnnotation(parameters) {
1185
- var _this10;
1186
-
1187
- _classCallCheck(this, FreeTextAnnotation);
940
+ }
1188
941
 
1189
- _this10 = _possibleConstructorReturn(this, _getPrototypeOf(FreeTextAnnotation).call(this, parameters));
1190
- _this10.data.annotationType = _util.AnnotationType.FREETEXT;
1191
- return _this10;
942
+ class FreeTextAnnotation extends MarkupAnnotation {
943
+ constructor(parameters) {
944
+ super(parameters);
945
+ this.data.annotationType = _util.AnnotationType.FREETEXT;
1192
946
  }
1193
947
 
1194
- return FreeTextAnnotation;
1195
- }(MarkupAnnotation);
1196
-
1197
- var LineAnnotation =
1198
- /*#__PURE__*/
1199
- function (_MarkupAnnotation3) {
1200
- _inherits(LineAnnotation, _MarkupAnnotation3);
1201
-
1202
- function LineAnnotation(parameters) {
1203
- var _this11;
1204
-
1205
- _classCallCheck(this, LineAnnotation);
948
+ }
1206
949
 
1207
- _this11 = _possibleConstructorReturn(this, _getPrototypeOf(LineAnnotation).call(this, parameters));
1208
- _this11.data.annotationType = _util.AnnotationType.LINE;
1209
- _this11.data.lineCoordinates = _util.Util.normalizeRect(parameters.dict.getArray('L'));
1210
- return _this11;
950
+ class LineAnnotation extends MarkupAnnotation {
951
+ constructor(parameters) {
952
+ super(parameters);
953
+ this.data.annotationType = _util.AnnotationType.LINE;
954
+ this.data.lineCoordinates = _util.Util.normalizeRect(parameters.dict.getArray("L"));
1211
955
  }
1212
956
 
1213
- return LineAnnotation;
1214
- }(MarkupAnnotation);
1215
-
1216
- var SquareAnnotation =
1217
- /*#__PURE__*/
1218
- function (_MarkupAnnotation4) {
1219
- _inherits(SquareAnnotation, _MarkupAnnotation4);
1220
-
1221
- function SquareAnnotation(parameters) {
1222
- var _this12;
1223
-
1224
- _classCallCheck(this, SquareAnnotation);
957
+ }
1225
958
 
1226
- _this12 = _possibleConstructorReturn(this, _getPrototypeOf(SquareAnnotation).call(this, parameters));
1227
- _this12.data.annotationType = _util.AnnotationType.SQUARE;
1228
- return _this12;
959
+ class SquareAnnotation extends MarkupAnnotation {
960
+ constructor(parameters) {
961
+ super(parameters);
962
+ this.data.annotationType = _util.AnnotationType.SQUARE;
1229
963
  }
1230
964
 
1231
- return SquareAnnotation;
1232
- }(MarkupAnnotation);
1233
-
1234
- var CircleAnnotation =
1235
- /*#__PURE__*/
1236
- function (_MarkupAnnotation5) {
1237
- _inherits(CircleAnnotation, _MarkupAnnotation5);
1238
-
1239
- function CircleAnnotation(parameters) {
1240
- var _this13;
1241
-
1242
- _classCallCheck(this, CircleAnnotation);
965
+ }
1243
966
 
1244
- _this13 = _possibleConstructorReturn(this, _getPrototypeOf(CircleAnnotation).call(this, parameters));
1245
- _this13.data.annotationType = _util.AnnotationType.CIRCLE;
1246
- return _this13;
967
+ class CircleAnnotation extends MarkupAnnotation {
968
+ constructor(parameters) {
969
+ super(parameters);
970
+ this.data.annotationType = _util.AnnotationType.CIRCLE;
1247
971
  }
1248
972
 
1249
- return CircleAnnotation;
1250
- }(MarkupAnnotation);
1251
-
1252
- var PolylineAnnotation =
1253
- /*#__PURE__*/
1254
- function (_MarkupAnnotation6) {
1255
- _inherits(PolylineAnnotation, _MarkupAnnotation6);
1256
-
1257
- function PolylineAnnotation(parameters) {
1258
- var _this14;
1259
-
1260
- _classCallCheck(this, PolylineAnnotation);
973
+ }
1261
974
 
1262
- _this14 = _possibleConstructorReturn(this, _getPrototypeOf(PolylineAnnotation).call(this, parameters));
1263
- _this14.data.annotationType = _util.AnnotationType.POLYLINE;
1264
- var rawVertices = parameters.dict.getArray('Vertices');
1265
- _this14.data.vertices = [];
975
+ class PolylineAnnotation extends MarkupAnnotation {
976
+ constructor(parameters) {
977
+ super(parameters);
978
+ this.data.annotationType = _util.AnnotationType.POLYLINE;
979
+ const rawVertices = parameters.dict.getArray("Vertices");
980
+ this.data.vertices = [];
1266
981
 
1267
- for (var i = 0, ii = rawVertices.length; i < ii; i += 2) {
1268
- _this14.data.vertices.push({
982
+ for (let i = 0, ii = rawVertices.length; i < ii; i += 2) {
983
+ this.data.vertices.push({
1269
984
  x: rawVertices[i],
1270
985
  y: rawVertices[i + 1]
1271
986
  });
1272
987
  }
1273
-
1274
- return _this14;
1275
988
  }
1276
989
 
1277
- return PolylineAnnotation;
1278
- }(MarkupAnnotation);
1279
-
1280
- var PolygonAnnotation =
1281
- /*#__PURE__*/
1282
- function (_PolylineAnnotation) {
1283
- _inherits(PolygonAnnotation, _PolylineAnnotation);
1284
-
1285
- function PolygonAnnotation(parameters) {
1286
- var _this15;
1287
-
1288
- _classCallCheck(this, PolygonAnnotation);
990
+ }
1289
991
 
1290
- _this15 = _possibleConstructorReturn(this, _getPrototypeOf(PolygonAnnotation).call(this, parameters));
1291
- _this15.data.annotationType = _util.AnnotationType.POLYGON;
1292
- return _this15;
992
+ class PolygonAnnotation extends PolylineAnnotation {
993
+ constructor(parameters) {
994
+ super(parameters);
995
+ this.data.annotationType = _util.AnnotationType.POLYGON;
1293
996
  }
1294
997
 
1295
- return PolygonAnnotation;
1296
- }(PolylineAnnotation);
1297
-
1298
- var CaretAnnotation =
1299
- /*#__PURE__*/
1300
- function (_MarkupAnnotation7) {
1301
- _inherits(CaretAnnotation, _MarkupAnnotation7);
1302
-
1303
- function CaretAnnotation(parameters) {
1304
- var _this16;
1305
-
1306
- _classCallCheck(this, CaretAnnotation);
998
+ }
1307
999
 
1308
- _this16 = _possibleConstructorReturn(this, _getPrototypeOf(CaretAnnotation).call(this, parameters));
1309
- _this16.data.annotationType = _util.AnnotationType.CARET;
1310
- return _this16;
1000
+ class CaretAnnotation extends MarkupAnnotation {
1001
+ constructor(parameters) {
1002
+ super(parameters);
1003
+ this.data.annotationType = _util.AnnotationType.CARET;
1311
1004
  }
1312
1005
 
1313
- return CaretAnnotation;
1314
- }(MarkupAnnotation);
1315
-
1316
- var InkAnnotation =
1317
- /*#__PURE__*/
1318
- function (_MarkupAnnotation8) {
1319
- _inherits(InkAnnotation, _MarkupAnnotation8);
1320
-
1321
- function InkAnnotation(parameters) {
1322
- var _this17;
1323
-
1324
- _classCallCheck(this, InkAnnotation);
1006
+ }
1325
1007
 
1326
- _this17 = _possibleConstructorReturn(this, _getPrototypeOf(InkAnnotation).call(this, parameters));
1327
- _this17.data.annotationType = _util.AnnotationType.INK;
1328
- var xref = parameters.xref;
1329
- var originalInkLists = parameters.dict.getArray('InkList');
1330
- _this17.data.inkLists = [];
1008
+ class InkAnnotation extends MarkupAnnotation {
1009
+ constructor(parameters) {
1010
+ super(parameters);
1011
+ this.data.annotationType = _util.AnnotationType.INK;
1012
+ const xref = parameters.xref;
1013
+ const originalInkLists = parameters.dict.getArray("InkList");
1014
+ this.data.inkLists = [];
1331
1015
 
1332
- for (var i = 0, ii = originalInkLists.length; i < ii; ++i) {
1333
- _this17.data.inkLists.push([]);
1016
+ for (let i = 0, ii = originalInkLists.length; i < ii; ++i) {
1017
+ this.data.inkLists.push([]);
1334
1018
 
1335
- for (var j = 0, jj = originalInkLists[i].length; j < jj; j += 2) {
1336
- _this17.data.inkLists[i].push({
1019
+ for (let j = 0, jj = originalInkLists[i].length; j < jj; j += 2) {
1020
+ this.data.inkLists[i].push({
1337
1021
  x: xref.fetchIfRef(originalInkLists[i][j]),
1338
1022
  y: xref.fetchIfRef(originalInkLists[i][j + 1])
1339
1023
  });
1340
1024
  }
1341
1025
  }
1342
-
1343
- return _this17;
1344
1026
  }
1345
1027
 
1346
- return InkAnnotation;
1347
- }(MarkupAnnotation);
1348
-
1349
- var HighlightAnnotation =
1350
- /*#__PURE__*/
1351
- function (_MarkupAnnotation9) {
1352
- _inherits(HighlightAnnotation, _MarkupAnnotation9);
1353
-
1354
- function HighlightAnnotation(parameters) {
1355
- var _this18;
1356
-
1357
- _classCallCheck(this, HighlightAnnotation);
1028
+ }
1358
1029
 
1359
- _this18 = _possibleConstructorReturn(this, _getPrototypeOf(HighlightAnnotation).call(this, parameters));
1360
- _this18.data.annotationType = _util.AnnotationType.HIGHLIGHT;
1361
- var quadPoints = getQuadPoints(parameters.dict, _this18.rectangle);
1030
+ class HighlightAnnotation extends MarkupAnnotation {
1031
+ constructor(parameters) {
1032
+ super(parameters);
1033
+ this.data.annotationType = _util.AnnotationType.HIGHLIGHT;
1034
+ const quadPoints = getQuadPoints(parameters.dict, this.rectangle);
1362
1035
 
1363
1036
  if (quadPoints) {
1364
- _this18.data.quadPoints = quadPoints;
1037
+ this.data.quadPoints = quadPoints;
1365
1038
  }
1366
-
1367
- return _this18;
1368
1039
  }
1369
1040
 
1370
- return HighlightAnnotation;
1371
- }(MarkupAnnotation);
1372
-
1373
- var UnderlineAnnotation =
1374
- /*#__PURE__*/
1375
- function (_MarkupAnnotation10) {
1376
- _inherits(UnderlineAnnotation, _MarkupAnnotation10);
1377
-
1378
- function UnderlineAnnotation(parameters) {
1379
- var _this19;
1380
-
1381
- _classCallCheck(this, UnderlineAnnotation);
1041
+ }
1382
1042
 
1383
- _this19 = _possibleConstructorReturn(this, _getPrototypeOf(UnderlineAnnotation).call(this, parameters));
1384
- _this19.data.annotationType = _util.AnnotationType.UNDERLINE;
1385
- var quadPoints = getQuadPoints(parameters.dict, _this19.rectangle);
1043
+ class UnderlineAnnotation extends MarkupAnnotation {
1044
+ constructor(parameters) {
1045
+ super(parameters);
1046
+ this.data.annotationType = _util.AnnotationType.UNDERLINE;
1047
+ const quadPoints = getQuadPoints(parameters.dict, this.rectangle);
1386
1048
 
1387
1049
  if (quadPoints) {
1388
- _this19.data.quadPoints = quadPoints;
1050
+ this.data.quadPoints = quadPoints;
1389
1051
  }
1390
-
1391
- return _this19;
1392
1052
  }
1393
1053
 
1394
- return UnderlineAnnotation;
1395
- }(MarkupAnnotation);
1396
-
1397
- var SquigglyAnnotation =
1398
- /*#__PURE__*/
1399
- function (_MarkupAnnotation11) {
1400
- _inherits(SquigglyAnnotation, _MarkupAnnotation11);
1401
-
1402
- function SquigglyAnnotation(parameters) {
1403
- var _this20;
1404
-
1405
- _classCallCheck(this, SquigglyAnnotation);
1054
+ }
1406
1055
 
1407
- _this20 = _possibleConstructorReturn(this, _getPrototypeOf(SquigglyAnnotation).call(this, parameters));
1408
- _this20.data.annotationType = _util.AnnotationType.SQUIGGLY;
1409
- var quadPoints = getQuadPoints(parameters.dict, _this20.rectangle);
1056
+ class SquigglyAnnotation extends MarkupAnnotation {
1057
+ constructor(parameters) {
1058
+ super(parameters);
1059
+ this.data.annotationType = _util.AnnotationType.SQUIGGLY;
1060
+ const quadPoints = getQuadPoints(parameters.dict, this.rectangle);
1410
1061
 
1411
1062
  if (quadPoints) {
1412
- _this20.data.quadPoints = quadPoints;
1063
+ this.data.quadPoints = quadPoints;
1413
1064
  }
1414
-
1415
- return _this20;
1416
1065
  }
1417
1066
 
1418
- return SquigglyAnnotation;
1419
- }(MarkupAnnotation);
1420
-
1421
- var StrikeOutAnnotation =
1422
- /*#__PURE__*/
1423
- function (_MarkupAnnotation12) {
1424
- _inherits(StrikeOutAnnotation, _MarkupAnnotation12);
1425
-
1426
- function StrikeOutAnnotation(parameters) {
1427
- var _this21;
1428
-
1429
- _classCallCheck(this, StrikeOutAnnotation);
1067
+ }
1430
1068
 
1431
- _this21 = _possibleConstructorReturn(this, _getPrototypeOf(StrikeOutAnnotation).call(this, parameters));
1432
- _this21.data.annotationType = _util.AnnotationType.STRIKEOUT;
1433
- var quadPoints = getQuadPoints(parameters.dict, _this21.rectangle);
1069
+ class StrikeOutAnnotation extends MarkupAnnotation {
1070
+ constructor(parameters) {
1071
+ super(parameters);
1072
+ this.data.annotationType = _util.AnnotationType.STRIKEOUT;
1073
+ const quadPoints = getQuadPoints(parameters.dict, this.rectangle);
1434
1074
 
1435
1075
  if (quadPoints) {
1436
- _this21.data.quadPoints = quadPoints;
1076
+ this.data.quadPoints = quadPoints;
1437
1077
  }
1438
-
1439
- return _this21;
1440
1078
  }
1441
1079
 
1442
- return StrikeOutAnnotation;
1443
- }(MarkupAnnotation);
1444
-
1445
- var StampAnnotation =
1446
- /*#__PURE__*/
1447
- function (_MarkupAnnotation13) {
1448
- _inherits(StampAnnotation, _MarkupAnnotation13);
1449
-
1450
- function StampAnnotation(parameters) {
1451
- var _this22;
1452
-
1453
- _classCallCheck(this, StampAnnotation);
1080
+ }
1454
1081
 
1455
- _this22 = _possibleConstructorReturn(this, _getPrototypeOf(StampAnnotation).call(this, parameters));
1456
- _this22.data.annotationType = _util.AnnotationType.STAMP;
1457
- return _this22;
1082
+ class StampAnnotation extends MarkupAnnotation {
1083
+ constructor(parameters) {
1084
+ super(parameters);
1085
+ this.data.annotationType = _util.AnnotationType.STAMP;
1458
1086
  }
1459
1087
 
1460
- return StampAnnotation;
1461
- }(MarkupAnnotation);
1462
-
1463
- var FileAttachmentAnnotation =
1464
- /*#__PURE__*/
1465
- function (_MarkupAnnotation14) {
1466
- _inherits(FileAttachmentAnnotation, _MarkupAnnotation14);
1467
-
1468
- function FileAttachmentAnnotation(parameters) {
1469
- var _this23;
1470
-
1471
- _classCallCheck(this, FileAttachmentAnnotation);
1088
+ }
1472
1089
 
1473
- _this23 = _possibleConstructorReturn(this, _getPrototypeOf(FileAttachmentAnnotation).call(this, parameters));
1474
- var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref);
1475
- _this23.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
1476
- _this23.data.file = file.serializable;
1477
- return _this23;
1090
+ class FileAttachmentAnnotation extends MarkupAnnotation {
1091
+ constructor(parameters) {
1092
+ super(parameters);
1093
+ const file = new _obj.FileSpec(parameters.dict.get("FS"), parameters.xref);
1094
+ this.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
1095
+ this.data.file = file.serializable;
1478
1096
  }
1479
1097
 
1480
- return FileAttachmentAnnotation;
1481
- }(MarkupAnnotation);
1098
+ }