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,EAAgB9oB,QAAA,CAAS0W,cAAT,CAAwB,gBAAxB,CAxIX;IAyIL0C,aAAA,EAEMpZ,QAAA,CAAS0W,cAAT,CAAwB,WAAxB,CA3ID;IA6IL0Y,kBAAA,EAAoB;EA7If,CAAP;AADgC;AAkJlC,SAASq8D,aAATA,CAAA,EAAyB;EACvB,MAAM3yE,MAAA,GAAS0yE,sBAAA,EAAf;EAME,MAAM5+D,KAAA,GAAQ,IAAImqC,WAAJ,CAAgB,iBAAhB,EAAmC;IAC/CuzB,OAAA,EAAS,IADsC;IAE/CC,UAAA,EAAY,IAFmC;IAG/C19D,MAAA,EAAQ;MACN/0B,MAAA,EAAQ8E;IADF;EAHuC,CAAnC,CAAd;EAOA,IAAI;IAIF8R,MAAA,CAAO1O,QAAP,CAAgBi1C,aAAhB,CAA8BroB,KAA9B;EAJE,CAAJ,CAKE,OAAO/a,EAAP,EAAW;IAGXX,OAAA,CAAQ5T,KAAR,CAAe,oBAAmBuU,EAApB,EAAd;IACA7R,QAAA,CAASi1C,aAAT,CAAuBroB,KAAvB;EAJW;EAOfl3B,yBAAA,CAAqBmjB,GAArB,CAAyBC,MAAzB;AA1BuB;AA+BzB9Y,QAAA,CAASyuB,kBAAT,GAA8B,IAA9B;AAEA,IACEzuB,QAAA,CAASqiF,UAAT,KAAwB,aAAxB,IACAriF,QAAA,CAASqiF,UAAT,KAAwB,UAF1B,EAGE;EACAoJ,aAAA;AADA,CAHF,MAKO;EACLzrF,QAAA,CAASqZ,gBAAT,CAA0B,kBAA1B,EAA8CoyE,aAA9C,EAA6D,IAA7D;AADK","sources":["webpack://pdf.js/web/genericcom.js","webpack://pdf.js/node_modules/core-js/modules/esnext.json.parse.js","webpack://pdf.js/node_modules/core-js/internals/export.js","webpack://pdf.js/node_modules/core-js/internals/global.js","webpack://pdf.js/node_modules/core-js/internals/object-get-own-property-descriptor.js","webpack://pdf.js/node_modules/core-js/internals/descriptors.js","webpack://pdf.js/node_modules/core-js/internals/fails.js","webpack://pdf.js/node_modules/core-js/internals/function-call.js","webpack://pdf.js/node_modules/core-js/internals/function-bind-native.js","webpack://pdf.js/node_modules/core-js/internals/object-property-is-enumerable.js","webpack://pdf.js/node_modules/core-js/internals/create-property-descriptor.js","webpack://pdf.js/node_modules/core-js/internals/to-indexed-object.js","webpack://pdf.js/node_modules/core-js/internals/indexed-object.js","webpack://pdf.js/node_modules/core-js/internals/function-uncurry-this.js","webpack://pdf.js/node_modules/core-js/internals/classof-raw.js","webpack://pdf.js/node_modules/core-js/internals/require-object-coercible.js","webpack://pdf.js/node_modules/core-js/internals/is-null-or-undefined.js","webpack://pdf.js/node_modules/core-js/internals/to-property-key.js","webpack://pdf.js/node_modules/core-js/internals/to-primitive.js","webpack://pdf.js/node_modules/core-js/internals/is-object.js","webpack://pdf.js/node_modules/core-js/internals/is-callable.js","webpack://pdf.js/node_modules/core-js/internals/document-all.js","webpack://pdf.js/node_modules/core-js/internals/is-symbol.js","webpack://pdf.js/node_modules/core-js/internals/get-built-in.js","webpack://pdf.js/node_modules/core-js/internals/object-is-prototype-of.js","webpack://pdf.js/node_modules/core-js/internals/use-symbol-as-uid.js","webpack://pdf.js/node_modules/core-js/internals/symbol-constructor-detection.js","webpack://pdf.js/node_modules/core-js/internals/engine-v8-version.js","webpack://pdf.js/node_modules/core-js/internals/engine-user-agent.js","webpack://pdf.js/node_modules/core-js/internals/get-method.js","webpack://pdf.js/node_modules/core-js/internals/a-callable.js","webpack://pdf.js/node_modules/core-js/internals/try-to-string.js","webpack://pdf.js/node_modules/core-js/internals/ordinary-to-primitive.js","webpack://pdf.js/node_modules/core-js/internals/well-known-symbol.js","webpack://pdf.js/node_modules/core-js/internals/shared.js","webpack://pdf.js/node_modules/core-js/internals/is-pure.js","webpack://pdf.js/node_modules/core-js/internals/shared-store.js","webpack://pdf.js/node_modules/core-js/internals/define-global-property.js","webpack://pdf.js/node_modules/core-js/internals/has-own-property.js","webpack://pdf.js/node_modules/core-js/internals/to-object.js","webpack://pdf.js/node_modules/core-js/internals/uid.js","webpack://pdf.js/node_modules/core-js/internals/ie8-dom-define.js","webpack://pdf.js/node_modules/core-js/internals/document-create-element.js","webpack://pdf.js/node_modules/core-js/internals/create-non-enumerable-property.js","webpack://pdf.js/node_modules/core-js/internals/object-define-property.js","webpack://pdf.js/node_modules/core-js/internals/v8-prototype-define-bug.js","webpack://pdf.js/node_modules/core-js/internals/an-object.js","webpack://pdf.js/node_modules/core-js/internals/define-built-in.js","webpack://pdf.js/node_modules/core-js/internals/make-built-in.js","webpack://pdf.js/node_modules/core-js/internals/function-name.js","webpack://pdf.js/node_modules/core-js/internals/inspect-source.js","webpack://pdf.js/node_modules/core-js/internals/internal-state.js","webpack://pdf.js/node_modules/core-js/internals/weak-map-basic-detection.js","webpack://pdf.js/node_modules/core-js/internals/shared-key.js","webpack://pdf.js/node_modules/core-js/internals/hidden-keys.js","webpack://pdf.js/node_modules/core-js/internals/copy-constructor-properties.js","webpack://pdf.js/node_modules/core-js/internals/own-keys.js","webpack://pdf.js/node_modules/core-js/internals/object-get-own-property-names.js","webpack://pdf.js/node_modules/core-js/internals/object-keys-internal.js","webpack://pdf.js/node_modules/core-js/internals/array-includes.js","webpack://pdf.js/node_modules/core-js/internals/to-absolute-index.js","webpack://pdf.js/node_modules/core-js/internals/to-integer-or-infinity.js","webpack://pdf.js/node_modules/core-js/internals/math-trunc.js","webpack://pdf.js/node_modules/core-js/internals/length-of-array-like.js","webpack://pdf.js/node_modules/core-js/internals/to-length.js","webpack://pdf.js/node_modules/core-js/internals/enum-bug-keys.js","webpack://pdf.js/node_modules/core-js/internals/object-get-own-property-symbols.js","webpack://pdf.js/node_modules/core-js/internals/is-forced.js","webpack://pdf.js/node_modules/core-js/internals/is-array.js","webpack://pdf.js/node_modules/core-js/internals/to-string.js","webpack://pdf.js/node_modules/core-js/internals/classof.js","webpack://pdf.js/node_modules/core-js/internals/to-string-tag-support.js","webpack://pdf.js/node_modules/core-js/internals/create-property.js","webpack://pdf.js/node_modules/core-js/internals/parse-json-string.js","webpack://pdf.js/web/app.js","webpack://pdf.js/node_modules/core-js/modules/es.error.cause.js","webpack://pdf.js/node_modules/core-js/internals/function-apply.js","webpack://pdf.js/node_modules/core-js/internals/wrap-error-constructor-with-cause.js","webpack://pdf.js/node_modules/core-js/internals/object-set-prototype-of.js","webpack://pdf.js/node_modules/core-js/internals/function-uncurry-this-accessor.js","webpack://pdf.js/node_modules/core-js/internals/a-possible-prototype.js","webpack://pdf.js/node_modules/core-js/internals/proxy-accessor.js","webpack://pdf.js/node_modules/core-js/internals/inherit-if-required.js","webpack://pdf.js/node_modules/core-js/internals/normalize-string-argument.js","webpack://pdf.js/node_modules/core-js/internals/install-error-cause.js","webpack://pdf.js/node_modules/core-js/internals/error-stack-install.js","webpack://pdf.js/node_modules/core-js/internals/error-stack-clear.js","webpack://pdf.js/node_modules/core-js/internals/error-stack-installable.js","webpack://pdf.js/node_modules/core-js/modules/es.array.push.js","webpack://pdf.js/node_modules/core-js/internals/array-set-length.js","webpack://pdf.js/node_modules/core-js/internals/does-not-exceed-safe-integer.js","webpack://pdf.js/node_modules/core-js/modules/web.url-search-params.delete.js","webpack://pdf.js/node_modules/core-js/internals/validate-arguments-length.js","webpack://pdf.js/node_modules/core-js/modules/web.url-search-params.has.js","webpack://pdf.js/node_modules/core-js/modules/web.url-search-params.size.js","webpack://pdf.js/node_modules/core-js/internals/define-built-in-accessor.js","webpack://pdf.js/web/ui_utils.js","webpack://pdf.js/node_modules/core-js/modules/esnext.set.difference.v2.js","webpack://pdf.js/node_modules/core-js/internals/set-difference.js","webpack://pdf.js/node_modules/core-js/internals/a-set.js","webpack://pdf.js/node_modules/core-js/internals/set-helpers.js","webpack://pdf.js/node_modules/core-js/internals/set-clone.js","webpack://pdf.js/node_modules/core-js/internals/set-iterate.js","webpack://pdf.js/node_modules/core-js/internals/iterate-simple.js","webpack://pdf.js/node_modules/core-js/internals/set-size.js","webpack://pdf.js/node_modules/core-js/internals/get-set-record.js","webpack://pdf.js/node_modules/core-js/internals/get-iterator-direct.js","webpack://pdf.js/node_modules/core-js/internals/set-method-accept-set-like.js","webpack://pdf.js/node_modules/core-js/modules/esnext.set.intersection.v2.js","webpack://pdf.js/node_modules/core-js/internals/set-intersection.js","webpack://pdf.js/node_modules/core-js/modules/esnext.set.is-disjoint-from.v2.js","webpack://pdf.js/node_modules/core-js/internals/set-is-disjoint-from.js","webpack://pdf.js/node_modules/core-js/internals/iterator-close.js","webpack://pdf.js/node_modules/core-js/modules/esnext.set.is-subset-of.v2.js","webpack://pdf.js/node_modules/core-js/internals/set-is-subset-of.js","webpack://pdf.js/node_modules/core-js/modules/esnext.set.is-superset-of.v2.js","webpack://pdf.js/node_modules/core-js/internals/set-is-superset-of.js","webpack://pdf.js/node_modules/core-js/modules/esnext.set.symmetric-difference.v2.js","webpack://pdf.js/node_modules/core-js/internals/set-symmetric-difference.js","webpack://pdf.js/node_modules/core-js/modules/esnext.set.union.v2.js","webpack://pdf.js/node_modules/core-js/internals/set-union.js","webpack://pdf.js/web/pdfjs.js","webpack://pdf.js/web/app_options.js","webpack://pdf.js/web/event_utils.js","webpack://pdf.js/web/pdf_link_service.js","webpack://pdf.js/web/alt_text_manager.js","webpack://pdf.js/web/annotation_editor_params.js","webpack://pdf.js/web/overlay_manager.js","webpack://pdf.js/web/password_prompt.js","webpack://pdf.js/web/pdf_attachment_viewer.js","webpack://pdf.js/web/base_tree_viewer.js","webpack://pdf.js/web/pdf_cursor_tools.js","webpack://pdf.js/web/grab_to_pan.js","webpack://pdf.js/web/pdf_document_properties.js","webpack://pdf.js/web/pdf_find_bar.js","webpack://pdf.js/web/pdf_find_controller.js","webpack://pdf.js/web/pdf_find_utils.js","webpack://pdf.js/web/pdf_history.js","webpack://pdf.js/web/pdf_layer_viewer.js","webpack://pdf.js/web/pdf_outline_viewer.js","webpack://pdf.js/web/pdf_presentation_mode.js","webpack://pdf.js/web/pdf_rendering_queue.js","webpack://pdf.js/web/pdf_scripting_manager.js","webpack://pdf.js/web/pdf_sidebar.js","webpack://pdf.js/web/pdf_thumbnail_viewer.js","webpack://pdf.js/web/pdf_thumbnail_view.js","webpack://pdf.js/web/pdf_viewer.js","webpack://pdf.js/web/l10n_utils.js","webpack://pdf.js/web/pdf_page_view.js","webpack://pdf.js/web/annotation_editor_layer_builder.js","webpack://pdf.js/web/annotation_layer_builder.js","webpack://pdf.js/web/struct_tree_layer_builder.js","webpack://pdf.js/web/text_accessibility.js","webpack://pdf.js/web/text_highlighter.js","webpack://pdf.js/web/text_layer_builder.js","webpack://pdf.js/web/xfa_layer_builder.js","webpack://pdf.js/web/secondary_toolbar.js","webpack://pdf.js/web/toolbar.js","webpack://pdf.js/web/view_history.js","webpack://pdf.js/web/preferences.js","webpack://pdf.js/web/download_manager.js","webpack://pdf.js/web/genericl10n.js","webpack://pdf.js/external/webL10n/l10n.js","webpack://pdf.js/web/generic_scripting.js","webpack://pdf.js/web/pdf_print_service.js","webpack://pdf.js/web/print_utils.js","webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/web/viewer.js"],"sourcesContent":["/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DefaultExternalServices, PDFViewerApplication } from \"./app.js\";\nimport { BasePreferences } from \"./preferences.js\";\nimport { DownloadManager } from \"./download_manager.js\";\nimport { GenericL10n } from \"./genericl10n.js\";\nimport { GenericScripting } from \"./generic_scripting.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\n 'Module \"pdfjs-web/genericcom\" shall not be used outside GENERIC build.'\n );\n}\n\nconst GenericCom = {};\n\nclass GenericPreferences extends BasePreferences {\n async _writeToStorage(prefObj) {\n localStorage.setItem(\"pdfjs.preferences\", JSON.stringify(prefObj));\n }\n\n async _readFromStorage(prefObj) {\n return JSON.parse(localStorage.getItem(\"pdfjs.preferences\"));\n }\n}\n\nclass GenericExternalServices extends DefaultExternalServices {\n static createDownloadManager() {\n return new DownloadManager();\n }\n\n static createPreferences() {\n return new GenericPreferences();\n }\n\n static createL10n({ locale = \"en-US\" }) {\n return new GenericL10n(locale);\n }\n\n static createScripting({ sandboxBundleSrc }) {\n return new GenericScripting(sandboxBundleSrc);\n }\n}\nPDFViewerApplication.externalServices = GenericExternalServices;\n\nexport { GenericCom };\n","'use strict';\nvar $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar global = require('../internals/global');\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar hasOwn = require('../internals/has-own-property');\nvar toString = require('../internals/to-string');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar createProperty = require('../internals/create-property');\nvar fails = require('../internals/fails');\nvar parseJSONString = require('../internals/parse-json-string');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nvar JSON = global.JSON;\nvar Number = global.Number;\nvar SyntaxError = global.SyntaxError;\nvar nativeParse = JSON && JSON.parse;\nvar enumerableOwnProperties = getBuiltIn('Object', 'keys');\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar at = uncurryThis(''.charAt);\nvar slice = uncurryThis(''.slice);\nvar exec = uncurryThis(/./.exec);\nvar push = uncurryThis([].push);\n\nvar IS_DIGIT = /^\\d$/;\nvar IS_NON_ZERO_DIGIT = /^[1-9]$/;\nvar IS_NUMBER_START = /^(?:-|\\d)$/;\nvar IS_WHITESPACE = /^[\\t\\n\\r ]$/;\n\nvar PRIMITIVE = 0;\nvar OBJECT = 1;\n\nvar $parse = function (source, reviver) {\n source = toString(source);\n var context = new Context(source, 0, '');\n var root = context.parse();\n var value = root.value;\n var endIndex = context.skip(IS_WHITESPACE, root.end);\n if (endIndex < source.length) {\n throw SyntaxError('Unexpected extra character: \"' + at(source, endIndex) + '\" after the parsed data at: ' + endIndex);\n }\n return isCallable(reviver) ? internalize({ '': value }, '', reviver, root) : value;\n};\n\nvar internalize = function (holder, name, reviver, node) {\n var val = holder[name];\n var unmodified = node && val === node.value;\n var context = unmodified && typeof node.source == 'string' ? { source: node.source } : {};\n var elementRecordsLen, keys, len, i, P;\n if (isObject(val)) {\n var nodeIsArray = isArray(val);\n var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {};\n if (nodeIsArray) {\n elementRecordsLen = nodes.length;\n len = lengthOfArrayLike(val);\n for (i = 0; i < len; i++) {\n internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined));\n }\n } else {\n keys = enumerableOwnProperties(val);\n len = lengthOfArrayLike(keys);\n for (i = 0; i < len; i++) {\n P = keys[i];\n internalizeProperty(val, P, internalize(val, P, reviver, hasOwn(nodes, P) ? nodes[P] : undefined));\n }\n }\n }\n return call(reviver, holder, name, val, context);\n};\n\nvar internalizeProperty = function (object, key, value) {\n if (DESCRIPTORS) {\n var descriptor = getOwnPropertyDescriptor(object, key);\n if (descriptor && !descriptor.configurable) return;\n }\n if (value === undefined) delete object[key];\n else createProperty(object, key, value);\n};\n\nvar Node = function (value, end, source, nodes) {\n this.value = value;\n this.end = end;\n this.source = source;\n this.nodes = nodes;\n};\n\nvar Context = function (source, index) {\n this.source = source;\n this.index = index;\n};\n\n// https://www.json.org/json-en.html\nContext.prototype = {\n fork: function (nextIndex) {\n return new Context(this.source, nextIndex);\n },\n parse: function () {\n var source = this.source;\n var i = this.skip(IS_WHITESPACE, this.index);\n var fork = this.fork(i);\n var chr = at(source, i);\n if (exec(IS_NUMBER_START, chr)) return fork.number();\n switch (chr) {\n case '{':\n return fork.object();\n case '[':\n return fork.array();\n case '\"':\n return fork.string();\n case 't':\n return fork.keyword(true);\n case 'f':\n return fork.keyword(false);\n case 'n':\n return fork.keyword(null);\n } throw SyntaxError('Unexpected character: \"' + chr + '\" at: ' + i);\n },\n node: function (type, value, start, end, nodes) {\n return new Node(value, end, type ? null : slice(this.source, start, end), nodes);\n },\n object: function () {\n var source = this.source;\n var i = this.index + 1;\n var expectKeypair = false;\n var object = {};\n var nodes = {};\n while (i < source.length) {\n i = this.until(['\"', '}'], i);\n if (at(source, i) === '}' && !expectKeypair) {\n i++;\n break;\n }\n // Parsing the key\n var result = this.fork(i).string();\n var key = result.value;\n i = result.end;\n i = this.until([':'], i) + 1;\n // Parsing value\n i = this.skip(IS_WHITESPACE, i);\n result = this.fork(i).parse();\n createProperty(nodes, key, result);\n createProperty(object, key, result.value);\n i = this.until([',', '}'], result.end);\n var chr = at(source, i);\n if (chr === ',') {\n expectKeypair = true;\n i++;\n } else if (chr === '}') {\n i++;\n break;\n }\n }\n return this.node(OBJECT, object, this.index, i, nodes);\n },\n array: function () {\n var source = this.source;\n var i = this.index + 1;\n var expectElement = false;\n var array = [];\n var nodes = [];\n while (i < source.length) {\n i = this.skip(IS_WHITESPACE, i);\n if (at(source, i) === ']' && !expectElement) {\n i++;\n break;\n }\n var result = this.fork(i).parse();\n push(nodes, result);\n push(array, result.value);\n i = this.until([',', ']'], result.end);\n if (at(source, i) === ',') {\n expectElement = true;\n i++;\n } else if (at(source, i) === ']') {\n i++;\n break;\n }\n }\n return this.node(OBJECT, array, this.index, i, nodes);\n },\n string: function () {\n var index = this.index;\n var parsed = parseJSONString(this.source, this.index + 1);\n return this.node(PRIMITIVE, parsed.value, index, parsed.end);\n },\n number: function () {\n var source = this.source;\n var startIndex = this.index;\n var i = startIndex;\n if (at(source, i) === '-') i++;\n if (at(source, i) === '0') i++;\n else if (exec(IS_NON_ZERO_DIGIT, at(source, i))) i = this.skip(IS_DIGIT, ++i);\n else throw SyntaxError('Failed to parse number at: ' + i);\n if (at(source, i) === '.') i = this.skip(IS_DIGIT, ++i);\n if (at(source, i) === 'e' || at(source, i) === 'E') {\n i++;\n if (at(source, i) === '+' || at(source, i) === '-') i++;\n var exponentStartIndex = i;\n i = this.skip(IS_DIGIT, i);\n if (exponentStartIndex === i) throw SyntaxError(\"Failed to parse number's exponent value at: \" + i);\n }\n return this.node(PRIMITIVE, Number(slice(source, startIndex, i)), startIndex, i);\n },\n keyword: function (value) {\n var keyword = '' + value;\n var index = this.index;\n var endIndex = index + keyword.length;\n if (slice(this.source, index, endIndex) !== keyword) throw SyntaxError('Failed to parse value at: ' + index);\n return this.node(PRIMITIVE, value, index, endIndex);\n },\n skip: function (regex, i) {\n var source = this.source;\n for (; i < source.length; i++) if (!exec(regex, at(source, i))) break;\n return i;\n },\n until: function (array, i) {\n i = this.skip(IS_WHITESPACE, i);\n var chr = at(this.source, i);\n for (var j = 0; j < array.length; j++) if (array[j] === chr) return i;\n throw SyntaxError('Unexpected character: \"' + chr + '\" at: ' + i);\n }\n};\n\nvar NO_SOURCE_SUPPORT = fails(function () {\n var unsafeInt = '9007199254740993';\n var source;\n nativeParse(unsafeInt, function (key, value, context) {\n source = context.source;\n });\n return source !== unsafeInt;\n});\n\nvar PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails(function () {\n // Safari 9 bug\n return 1 / nativeParse('-0 \\t') !== -Infinity;\n});\n\n// `JSON.parse` method\n// https://tc39.es/ecma262/#sec-json.parse\n// https://github.com/tc39/proposal-json-parse-with-source\n$({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {\n parse: function parse(text, reviver) {\n return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text) : $parse(text, reviver);\n }\n});\n","'use strict';\nvar global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","'use strict';\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || this || Function('return this')();\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n","'use strict';\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","'use strict';\nvar fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","'use strict';\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","'use strict';\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","'use strict';\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","'use strict';\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n","'use strict';\nvar toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\nmodule.exports = $documentAll.IS_HTMLDDA ? function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll;\n} : function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","'use strict';\nvar $documentAll = require('../internals/document-all');\n\nvar documentAll = $documentAll.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = $documentAll.IS_HTMLDDA ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n","'use strict';\nvar documentAll = typeof document == 'object' && document.all;\n\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nvar IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;\n\nmodule.exports = {\n all: documentAll,\n IS_HTMLDDA: IS_HTMLDDA\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","'use strict';\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","'use strict';\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\nvar global = require('../internals/global');\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","'use strict';\nvar global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","'use strict';\nmodule.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","'use strict';\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nvar global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n","'use strict';\nvar IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.32.2',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","'use strict';\nmodule.exports = false;\n","'use strict';\nvar global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","'use strict';\nvar global = require('../internals/global');\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","'use strict';\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n","'use strict';\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n","'use strict';\nvar isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\nvar $String = String;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\nvar stringSlice = uncurryThis(''.slice);\nvar replace = uncurryThis(''.replace);\nvar join = uncurryThis([].join);\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (stringSlice($String(name), 0, 7) === 'Symbol(') {\n name = '[' + replace($String(name), /^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = join(TEMPLATE, typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","'use strict';\nvar NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');\nvar global = require('../internals/global');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n /* eslint-disable no-self-assign -- prototype methods protection */\n store.get = store.get;\n store.has = store.has;\n store.set = store.set;\n /* eslint-enable no-self-assign -- prototype methods protection */\n set = function (it, metadata) {\n if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n store.set(it, metadata);\n return metadata;\n };\n get = function (it) {\n return store.get(it) || {};\n };\n has = function (it) {\n return store.has(it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","'use strict';\nvar global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));\n","'use strict';\nvar shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","'use strict';\nmodule.exports = {};\n","'use strict';\nvar hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","'use strict';\nvar internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el !== el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value !== value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","'use strict';\nvar trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","'use strict';\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","'use strict';\nvar toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","'use strict';\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","'use strict';\n// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","'use strict';\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","'use strict';\nvar classof = require('../internals/classof-raw');\n\n// `IsArray` abstract operation\n// https://tc39.es/ecma262/#sec-isarray\n// eslint-disable-next-line es/no-array-isarray -- safe\nmodule.exports = Array.isArray || function isArray(argument) {\n return classof(argument) === 'Array';\n};\n","'use strict';\nvar classof = require('../internals/classof');\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n","'use strict';\nvar TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');\nvar isCallable = require('../internals/is-callable');\nvar classofRaw = require('../internals/classof-raw');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n","'use strict';\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n","'use strict';\nvar toPropertyKey = require('../internals/to-property-key');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\n\nvar $SyntaxError = SyntaxError;\nvar $parseInt = parseInt;\nvar fromCharCode = String.fromCharCode;\nvar at = uncurryThis(''.charAt);\nvar slice = uncurryThis(''.slice);\nvar exec = uncurryThis(/./.exec);\n\nvar codePoints = {\n '\\\\\"': '\"',\n '\\\\\\\\': '\\\\',\n '\\\\/': '/',\n '\\\\b': '\\b',\n '\\\\f': '\\f',\n '\\\\n': '\\n',\n '\\\\r': '\\r',\n '\\\\t': '\\t'\n};\n\nvar IS_4_HEX_DIGITS = /^[\\da-f]{4}$/i;\n// eslint-disable-next-line regexp/no-control-character -- safe\nvar IS_C0_CONTROL_CODE = /^[\\u0000-\\u001F]$/;\n\nmodule.exports = function (source, i) {\n var unterminated = true;\n var value = '';\n while (i < source.length) {\n var chr = at(source, i);\n if (chr === '\\\\') {\n var twoChars = slice(source, i, i + 2);\n if (hasOwn(codePoints, twoChars)) {\n value += codePoints[twoChars];\n i += 2;\n } else if (twoChars === '\\\\u') {\n i += 2;\n var fourHexDigits = slice(source, i, i + 4);\n if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw $SyntaxError('Bad Unicode escape at: ' + i);\n value += fromCharCode($parseInt(fourHexDigits, 16));\n i += 4;\n } else throw $SyntaxError('Unknown escape sequence: \"' + twoChars + '\"');\n } else if (chr === '\"') {\n unterminated = false;\n i++;\n break;\n } else {\n if (exec(IS_C0_CONTROL_CODE, chr)) throw $SyntaxError('Bad control character in string literal at: ' + i);\n value += chr;\n i++;\n }\n }\n if (unterminated) throw $SyntaxError('Unterminated string at: ' + i);\n return { value: value, end: i };\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n AutoPrintRegExp,\n CursorTool,\n DEFAULT_SCALE_VALUE,\n getActiveOrFocusedElement,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n normalizeWheelEventDirection,\n parseQueryString,\n ProgressBar,\n RenderingStates,\n ScrollMode,\n SidebarView,\n SpreadMode,\n TextLayerMode,\n} from \"./ui_utils.js\";\nimport {\n AnnotationEditorType,\n build,\n FeatureTest,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n GlobalWorkerOptions,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n loadScript,\n MissingPDFException,\n PDFWorker,\n PromiseCapability,\n shadow,\n UnexpectedResponseException,\n version,\n} from \"pdfjs-lib\";\nimport { AppOptions, OptionKind } from \"./app_options.js\";\nimport { AutomationEventBus, EventBus } from \"./event_utils.js\";\nimport { LinkTarget, PDFLinkService } from \"./pdf_link_service.js\";\nimport { AltTextManager } from \"web-alt_text_manager\";\nimport { AnnotationEditorParams } from \"web-annotation_editor_params\";\nimport { OverlayManager } from \"./overlay_manager.js\";\nimport { PasswordPrompt } from \"./password_prompt.js\";\nimport { PDFAttachmentViewer } from \"web-pdf_attachment_viewer\";\nimport { PDFCursorTools } from \"web-pdf_cursor_tools\";\nimport { PDFDocumentProperties } from \"web-pdf_document_properties\";\nimport { PDFFindBar } from \"web-pdf_find_bar\";\nimport { PDFFindController } from \"./pdf_find_controller.js\";\nimport { PDFHistory } from \"./pdf_history.js\";\nimport { PDFLayerViewer } from \"web-pdf_layer_viewer\";\nimport { PDFOutlineViewer } from \"web-pdf_outline_viewer\";\nimport { PDFPresentationMode } from \"web-pdf_presentation_mode\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { PDFScriptingManager } from \"./pdf_scripting_manager.js\";\nimport { PDFSidebar } from \"web-pdf_sidebar\";\nimport { PDFThumbnailViewer } from \"web-pdf_thumbnail_viewer\";\nimport { PDFViewer } from \"./pdf_viewer.js\";\nimport { SecondaryToolbar } from \"web-secondary_toolbar\";\nimport { Toolbar } from \"web-toolbar\";\nimport { ViewHistory } from \"./view_history.js\";\n\nconst FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms\nconst WHEEL_ZOOM_DISABLED_TIMEOUT = 1000; // ms\n\nconst ViewOnLoad = {\n UNKNOWN: -1,\n PREVIOUS: 0, // Default value.\n INITIAL: 1,\n};\n\nconst ViewerCssTheme = {\n AUTOMATIC: 0, // Default value.\n LIGHT: 1,\n DARK: 2,\n};\n\nclass DefaultExternalServices {\n constructor() {\n throw new Error(\"Cannot initialize DefaultExternalServices.\");\n }\n\n static updateFindControlState(data) {}\n\n static updateFindMatchesCount(data) {}\n\n static initPassiveLoading(callbacks) {}\n\n static reportTelemetry(data) {}\n\n static createDownloadManager() {\n throw new Error(\"Not implemented: createDownloadManager\");\n }\n\n static createPreferences() {\n throw new Error(\"Not implemented: createPreferences\");\n }\n\n static createL10n(options) {\n throw new Error(\"Not implemented: createL10n\");\n }\n\n static createScripting(options) {\n throw new Error(\"Not implemented: createScripting\");\n }\n\n static get supportsPinchToZoom() {\n return shadow(this, \"supportsPinchToZoom\", true);\n }\n\n static get supportsIntegratedFind() {\n return shadow(this, \"supportsIntegratedFind\", false);\n }\n\n static get supportsDocumentFonts() {\n return shadow(this, \"supportsDocumentFonts\", true);\n }\n\n static get supportedMouseWheelZoomModifierKeys() {\n return shadow(this, \"supportedMouseWheelZoomModifierKeys\", {\n ctrlKey: true,\n metaKey: true,\n });\n }\n\n static get isInAutomation() {\n return shadow(this, \"isInAutomation\", false);\n }\n\n static updateEditorStates(data) {\n throw new Error(\"Not implemented: updateEditorStates\");\n }\n\n static get canvasMaxAreaInBytes() {\n return shadow(this, \"canvasMaxAreaInBytes\", -1);\n }\n\n static getNimbusExperimentData() {\n return shadow(this, \"getNimbusExperimentData\", Promise.resolve(null));\n }\n}\n\nconst PDFViewerApplication = {\n initialBookmark: document.location.hash.substring(1),\n _initializedCapability: new PromiseCapability(),\n appConfig: null,\n pdfDocument: null,\n pdfLoadingTask: null,\n printService: null,\n /** @type {PDFViewer} */\n pdfViewer: null,\n /** @type {PDFThumbnailViewer} */\n pdfThumbnailViewer: null,\n /** @type {PDFRenderingQueue} */\n pdfRenderingQueue: null,\n /** @type {PDFPresentationMode} */\n pdfPresentationMode: null,\n /** @type {PDFDocumentProperties} */\n pdfDocumentProperties: null,\n /** @type {PDFLinkService} */\n pdfLinkService: null,\n /** @type {PDFHistory} */\n pdfHistory: null,\n /** @type {PDFSidebar} */\n pdfSidebar: null,\n /** @type {PDFOutlineViewer} */\n pdfOutlineViewer: null,\n /** @type {PDFAttachmentViewer} */\n pdfAttachmentViewer: null,\n /** @type {PDFLayerViewer} */\n pdfLayerViewer: null,\n /** @type {PDFCursorTools} */\n pdfCursorTools: null,\n /** @type {PDFScriptingManager} */\n pdfScriptingManager: null,\n /** @type {ViewHistory} */\n store: null,\n /** @type {DownloadManager} */\n downloadManager: null,\n /** @type {OverlayManager} */\n overlayManager: null,\n /** @type {Preferences} */\n preferences: null,\n /** @type {Toolbar} */\n toolbar: null,\n /** @type {SecondaryToolbar} */\n secondaryToolbar: null,\n /** @type {EventBus} */\n eventBus: null,\n /** @type {IL10n} */\n l10n: null,\n /** @type {AnnotationEditorParams} */\n annotationEditorParams: null,\n isInitialViewSet: false,\n downloadComplete: false,\n isViewerEmbedded: window.parent !== window,\n url: \"\",\n baseUrl: \"\",\n _downloadUrl: \"\",\n externalServices: DefaultExternalServices,\n _boundEvents: Object.create(null),\n documentInfo: null,\n metadata: null,\n _contentDispositionFilename: null,\n _contentLength: null,\n _saveInProgress: false,\n _wheelUnusedTicks: 0,\n _wheelUnusedFactor: 1,\n _touchUnusedTicks: 0,\n _touchUnusedFactor: 1,\n _PDFBug: null,\n _hasAnnotationEditors: false,\n _title: document.title,\n _printAnnotationStoragePromise: null,\n _touchInfo: null,\n _isCtrlKeyDown: false,\n _nimbusDataPromise: null,\n\n // Called once when the document is loaded.\n async initialize(appConfig) {\n this.preferences = this.externalServices.createPreferences();\n this.appConfig = appConfig;\n\n if (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n ) {\n this._nimbusDataPromise = this.externalServices.getNimbusExperimentData();\n }\n\n await this._initializeOptions();\n this._forceCssTheme();\n await this._initializeL10n();\n\n if (\n this.isViewerEmbedded &&\n AppOptions.get(\"externalLinkTarget\") === LinkTarget.NONE\n ) {\n // Prevent external links from \"replacing\" the viewer,\n // when it's embedded in e.g. an <iframe> or an <object>.\n AppOptions.set(\"externalLinkTarget\", LinkTarget.TOP);\n }\n await this._initializeViewerComponents();\n\n // Bind the various event handlers *after* the viewer has been\n // initialized, to prevent errors if an event arrives too soon.\n this.bindEvents();\n this.bindWindowEvents();\n\n // We can start UI localization now.\n const appContainer = appConfig.appContainer || document.documentElement;\n this.l10n.translate(appContainer).then(() => {\n // Dispatch the 'localized' event on the `eventBus` once the viewer\n // has been fully initialized and translated.\n this.eventBus.dispatch(\"localized\", { source: this });\n });\n\n this._initializedCapability.resolve();\n },\n\n /**\n * @private\n */\n async _initializeOptions() {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (AppOptions.get(\"disablePreferences\")) {\n if (AppOptions.get(\"pdfBugEnabled\")) {\n await this._parseHashParams();\n }\n // Give custom implementations of the default viewer a simpler way to\n // opt-out of having the `Preferences` override existing `AppOptions`.\n return;\n }\n if (AppOptions._hasUserOptions()) {\n console.warn(\n \"_initializeOptions: The Preferences may override manually set AppOptions; \" +\n 'please use the \"disablePreferences\"-option in order to prevent that.'\n );\n }\n }\n try {\n AppOptions.setAll(await this.preferences.getAll());\n } catch (reason) {\n console.error(`_initializeOptions: \"${reason.message}\".`);\n }\n\n if (AppOptions.get(\"pdfBugEnabled\")) {\n await this._parseHashParams();\n }\n },\n\n /**\n * Potentially parse special debugging flags in the hash section of the URL.\n * @private\n */\n async _parseHashParams() {\n const hash = document.location.hash.substring(1);\n if (!hash) {\n return;\n }\n const { mainContainer, viewerContainer } = this.appConfig,\n params = parseQueryString(hash);\n\n if (params.get(\"disableworker\") === \"true\") {\n try {\n await loadFakeWorker();\n } catch (ex) {\n console.error(`_parseHashParams: \"${ex.message}\".`);\n }\n }\n if (params.has(\"disablerange\")) {\n AppOptions.set(\"disableRange\", params.get(\"disablerange\") === \"true\");\n }\n if (params.has(\"disablestream\")) {\n AppOptions.set(\"disableStream\", params.get(\"disablestream\") === \"true\");\n }\n if (params.has(\"disableautofetch\")) {\n AppOptions.set(\n \"disableAutoFetch\",\n params.get(\"disableautofetch\") === \"true\"\n );\n }\n if (params.has(\"disablefontface\")) {\n AppOptions.set(\n \"disableFontFace\",\n params.get(\"disablefontface\") === \"true\"\n );\n }\n if (params.has(\"disablehistory\")) {\n AppOptions.set(\"disableHistory\", params.get(\"disablehistory\") === \"true\");\n }\n if (params.has(\"verbosity\")) {\n AppOptions.set(\"verbosity\", params.get(\"verbosity\") | 0);\n }\n if (params.has(\"textlayer\")) {\n switch (params.get(\"textlayer\")) {\n case \"off\":\n AppOptions.set(\"textLayerMode\", TextLayerMode.DISABLE);\n break;\n case \"visible\":\n case \"shadow\":\n case \"hover\":\n viewerContainer.classList.add(`textLayer-${params.get(\"textlayer\")}`);\n try {\n await loadPDFBug(this);\n this._PDFBug.loadCSS();\n } catch (ex) {\n console.error(`_parseHashParams: \"${ex.message}\".`);\n }\n break;\n }\n }\n if (params.has(\"pdfbug\")) {\n AppOptions.set(\"pdfBug\", true);\n AppOptions.set(\"fontExtraProperties\", true);\n\n const enabled = params.get(\"pdfbug\").split(\",\");\n try {\n await loadPDFBug(this);\n this._PDFBug.init(mainContainer, enabled);\n } catch (ex) {\n console.error(`_parseHashParams: \"${ex.message}\".`);\n }\n }\n // It is not possible to change locale for the (various) extension builds.\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n params.has(\"locale\")\n ) {\n AppOptions.set(\"locale\", params.get(\"locale\"));\n }\n },\n\n /**\n * @private\n */\n async _initializeL10n() {\n this.l10n = this.externalServices.createL10n(\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? { locale: AppOptions.get(\"locale\") }\n : null\n );\n const dir = await this.l10n.getDirection();\n document.getElementsByTagName(\"html\")[0].dir = dir;\n },\n\n /**\n * @private\n */\n _forceCssTheme() {\n const cssTheme = AppOptions.get(\"viewerCssTheme\");\n if (\n cssTheme === ViewerCssTheme.AUTOMATIC ||\n !Object.values(ViewerCssTheme).includes(cssTheme)\n ) {\n return;\n }\n try {\n const styleSheet = document.styleSheets[0];\n const cssRules = styleSheet?.cssRules || [];\n for (let i = 0, ii = cssRules.length; i < ii; i++) {\n const rule = cssRules[i];\n if (\n rule instanceof CSSMediaRule &&\n rule.media?.[0] === \"(prefers-color-scheme: dark)\"\n ) {\n if (cssTheme === ViewerCssTheme.LIGHT) {\n styleSheet.deleteRule(i);\n return;\n }\n // cssTheme === ViewerCssTheme.DARK\n const darkRules =\n /^@media \\(prefers-color-scheme: dark\\) {\\n\\s*([\\w\\s-.,:;/\\\\{}()]+)\\n}$/.exec(\n rule.cssText\n );\n if (darkRules?.[1]) {\n styleSheet.deleteRule(i);\n styleSheet.insertRule(darkRules[1], i);\n }\n return;\n }\n }\n } catch (reason) {\n console.error(`_forceCssTheme: \"${reason?.message}\".`);\n }\n },\n\n /**\n * @private\n */\n async _initializeViewerComponents() {\n const { appConfig, externalServices, l10n } = this;\n\n const eventBus = externalServices.isInAutomation\n ? new AutomationEventBus()\n : new EventBus();\n this.eventBus = eventBus;\n\n this.overlayManager = new OverlayManager();\n\n const pdfRenderingQueue = new PDFRenderingQueue();\n pdfRenderingQueue.onIdle = this._cleanup.bind(this);\n this.pdfRenderingQueue = pdfRenderingQueue;\n\n const pdfLinkService = new PDFLinkService({\n eventBus,\n externalLinkTarget: AppOptions.get(\"externalLinkTarget\"),\n externalLinkRel: AppOptions.get(\"externalLinkRel\"),\n ignoreDestinationZoom: AppOptions.get(\"ignoreDestinationZoom\"),\n });\n this.pdfLinkService = pdfLinkService;\n\n const downloadManager = externalServices.createDownloadManager();\n this.downloadManager = downloadManager;\n\n const findController = new PDFFindController({\n linkService: pdfLinkService,\n eventBus,\n updateMatchesCountOnProgress:\n typeof PDFJSDev === \"undefined\"\n ? !window.isGECKOVIEW\n : !PDFJSDev.test(\"GECKOVIEW\"),\n });\n this.findController = findController;\n\n const pdfScriptingManager = new PDFScriptingManager({\n eventBus,\n sandboxBundleSrc:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC || CHROME\")\n ? AppOptions.get(\"sandboxBundleSrc\")\n : null,\n externalServices,\n docProperties: this._scriptingDocProperties.bind(this),\n });\n this.pdfScriptingManager = pdfScriptingManager;\n\n const container = appConfig.mainContainer,\n viewer = appConfig.viewerContainer;\n const annotationEditorMode = AppOptions.get(\"annotationEditorMode\");\n const isOffscreenCanvasSupported =\n AppOptions.get(\"isOffscreenCanvasSupported\") &&\n FeatureTest.isOffscreenCanvasSupported;\n const pageColors =\n AppOptions.get(\"forcePageColors\") ||\n window.matchMedia(\"(forced-colors: active)\").matches\n ? {\n background: AppOptions.get(\"pageColorsBackground\"),\n foreground: AppOptions.get(\"pageColorsForeground\"),\n }\n : null;\n const altTextManager = appConfig.altTextDialog\n ? new AltTextManager(\n appConfig.altTextDialog,\n container,\n this.overlayManager,\n eventBus\n )\n : null;\n\n const pdfViewer = new PDFViewer({\n container,\n viewer,\n eventBus,\n renderingQueue: pdfRenderingQueue,\n linkService: pdfLinkService,\n downloadManager,\n altTextManager,\n findController,\n scriptingManager:\n AppOptions.get(\"enableScripting\") && pdfScriptingManager,\n l10n,\n textLayerMode: AppOptions.get(\"textLayerMode\"),\n annotationMode: AppOptions.get(\"annotationMode\"),\n annotationEditorMode,\n imageResourcesPath: AppOptions.get(\"imageResourcesPath\"),\n enablePrintAutoRotate: AppOptions.get(\"enablePrintAutoRotate\"),\n isOffscreenCanvasSupported,\n maxCanvasPixels: AppOptions.get(\"maxCanvasPixels\"),\n enablePermissions: AppOptions.get(\"enablePermissions\"),\n pageColors,\n });\n this.pdfViewer = pdfViewer;\n\n pdfRenderingQueue.setViewer(pdfViewer);\n pdfLinkService.setViewer(pdfViewer);\n pdfScriptingManager.setViewer(pdfViewer);\n\n if (appConfig.sidebar?.thumbnailView) {\n this.pdfThumbnailViewer = new PDFThumbnailViewer({\n container: appConfig.sidebar.thumbnailView,\n eventBus,\n renderingQueue: pdfRenderingQueue,\n linkService: pdfLinkService,\n l10n,\n pageColors,\n });\n pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);\n }\n\n // The browsing history is only enabled when the viewer is standalone,\n // i.e. not when it is embedded in a web page.\n if (!this.isViewerEmbedded && !AppOptions.get(\"disableHistory\")) {\n this.pdfHistory = new PDFHistory({\n linkService: pdfLinkService,\n eventBus,\n });\n pdfLinkService.setHistory(this.pdfHistory);\n }\n\n if (!this.supportsIntegratedFind && appConfig.findBar) {\n this.findBar = new PDFFindBar(appConfig.findBar, eventBus, l10n);\n }\n\n if (appConfig.annotationEditorParams) {\n if (annotationEditorMode !== AnnotationEditorType.DISABLE) {\n if (AppOptions.get(\"enableStampEditor\") && isOffscreenCanvasSupported) {\n appConfig.toolbar?.editorStampButton?.classList.remove(\"hidden\");\n }\n\n this.annotationEditorParams = new AnnotationEditorParams(\n appConfig.annotationEditorParams,\n eventBus\n );\n } else {\n for (const id of [\"editorModeButtons\", \"editorModeSeparator\"]) {\n document.getElementById(id)?.classList.add(\"hidden\");\n }\n }\n }\n\n if (appConfig.documentProperties) {\n this.pdfDocumentProperties = new PDFDocumentProperties(\n appConfig.documentProperties,\n this.overlayManager,\n eventBus,\n l10n,\n /* fileNameLookup = */ () => this._docFilename\n );\n }\n\n // NOTE: The cursor-tools are unlikely to be helpful/useful in GeckoView,\n // in particular the `HandTool` which basically simulates touch scrolling.\n if (appConfig.secondaryToolbar?.cursorHandToolButton) {\n this.pdfCursorTools = new PDFCursorTools({\n container,\n eventBus,\n cursorToolOnLoad: AppOptions.get(\"cursorToolOnLoad\"),\n });\n }\n\n if (appConfig.toolbar) {\n if (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n ) {\n this.toolbar = new Toolbar(\n appConfig.toolbar,\n eventBus,\n l10n,\n await this._nimbusDataPromise\n );\n } else {\n this.toolbar = new Toolbar(appConfig.toolbar, eventBus, l10n);\n }\n }\n\n if (appConfig.secondaryToolbar) {\n this.secondaryToolbar = new SecondaryToolbar(\n appConfig.secondaryToolbar,\n eventBus\n );\n }\n\n if (\n this.supportsFullscreen &&\n appConfig.secondaryToolbar?.presentationModeButton\n ) {\n this.pdfPresentationMode = new PDFPresentationMode({\n container,\n pdfViewer,\n eventBus,\n });\n }\n\n if (appConfig.passwordOverlay) {\n this.passwordPrompt = new PasswordPrompt(\n appConfig.passwordOverlay,\n this.overlayManager,\n l10n,\n this.isViewerEmbedded\n );\n }\n\n if (appConfig.sidebar?.outlineView) {\n this.pdfOutlineViewer = new PDFOutlineViewer({\n container: appConfig.sidebar.outlineView,\n eventBus,\n linkService: pdfLinkService,\n downloadManager,\n });\n }\n\n if (appConfig.sidebar?.attachmentsView) {\n this.pdfAttachmentViewer = new PDFAttachmentViewer({\n container: appConfig.sidebar.attachmentsView,\n eventBus,\n downloadManager,\n });\n }\n\n if (appConfig.sidebar?.layersView) {\n this.pdfLayerViewer = new PDFLayerViewer({\n container: appConfig.sidebar.layersView,\n eventBus,\n l10n,\n });\n }\n\n if (appConfig.sidebar) {\n this.pdfSidebar = new PDFSidebar({\n elements: appConfig.sidebar,\n eventBus,\n l10n,\n });\n this.pdfSidebar.onToggled = this.forceRendering.bind(this);\n this.pdfSidebar.onUpdateThumbnails = () => {\n // Use the rendered pages to set the corresponding thumbnail images.\n for (const pageView of pdfViewer.getCachedPageViews()) {\n if (pageView.renderingState === RenderingStates.FINISHED) {\n this.pdfThumbnailViewer\n .getThumbnail(pageView.id - 1)\n ?.setImage(pageView);\n }\n }\n this.pdfThumbnailViewer.scrollThumbnailIntoView(\n pdfViewer.currentPageNumber\n );\n };\n }\n },\n\n async run(config) {\n await this.initialize(config);\n\n const { appConfig, eventBus } = this;\n let file;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n const queryString = document.location.search.substring(1);\n const params = parseQueryString(queryString);\n file = params.get(\"file\") ?? AppOptions.get(\"defaultUrl\");\n validateFileURL(file);\n } else if (PDFJSDev.test(\"MOZCENTRAL\")) {\n file = window.location.href;\n } else if (PDFJSDev.test(\"CHROME\")) {\n file = AppOptions.get(\"defaultUrl\");\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n const fileInput = appConfig.openFileInput;\n fileInput.value = null;\n\n fileInput.addEventListener(\"change\", function (evt) {\n const { files } = evt.target;\n if (!files || files.length === 0) {\n return;\n }\n eventBus.dispatch(\"fileinputchange\", {\n source: this,\n fileInput: evt.target,\n });\n });\n\n // Enable dragging-and-dropping a new PDF file onto the viewerContainer.\n appConfig.mainContainer.addEventListener(\"dragover\", function (evt) {\n evt.preventDefault();\n\n evt.dataTransfer.dropEffect =\n evt.dataTransfer.effectAllowed === \"copy\" ? \"copy\" : \"move\";\n });\n appConfig.mainContainer.addEventListener(\"drop\", function (evt) {\n evt.preventDefault();\n\n const { files } = evt.dataTransfer;\n if (!files || files.length === 0) {\n return;\n }\n eventBus.dispatch(\"fileinputchange\", {\n source: this,\n fileInput: evt.dataTransfer,\n });\n });\n }\n\n if (!this.supportsDocumentFonts) {\n AppOptions.set(\"disableFontFace\", true);\n this.l10n.get(\"web_fonts_disabled\").then(msg => {\n console.warn(msg);\n });\n }\n\n if (!this.supportsPrinting) {\n appConfig.toolbar?.print?.classList.add(\"hidden\");\n appConfig.secondaryToolbar?.printButton.classList.add(\"hidden\");\n }\n\n if (!this.supportsFullscreen) {\n appConfig.secondaryToolbar?.presentationModeButton.classList.add(\n \"hidden\"\n );\n }\n\n if (this.supportsIntegratedFind) {\n appConfig.toolbar?.viewFind?.classList.add(\"hidden\");\n }\n\n appConfig.mainContainer.addEventListener(\n \"transitionend\",\n function (evt) {\n if (evt.target === /* mainContainer */ this) {\n eventBus.dispatch(\"resize\", { source: this });\n }\n },\n true\n );\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (file) {\n this.open({ url: file });\n } else {\n this._hideViewBookmark();\n }\n } else if (PDFJSDev.test(\"MOZCENTRAL || CHROME\")) {\n this.initPassiveLoading(file);\n } else {\n throw new Error(\"Not implemented: run\");\n }\n },\n\n get initialized() {\n return this._initializedCapability.settled;\n },\n\n get initializedPromise() {\n return this._initializedCapability.promise;\n },\n\n zoomIn(steps, scaleFactor) {\n if (this.pdfViewer.isInPresentationMode) {\n return;\n }\n this.pdfViewer.increaseScale({\n drawingDelay: AppOptions.get(\"defaultZoomDelay\"),\n steps,\n scaleFactor,\n });\n },\n\n zoomOut(steps, scaleFactor) {\n if (this.pdfViewer.isInPresentationMode) {\n return;\n }\n this.pdfViewer.decreaseScale({\n drawingDelay: AppOptions.get(\"defaultZoomDelay\"),\n steps,\n scaleFactor,\n });\n },\n\n zoomReset() {\n if (this.pdfViewer.isInPresentationMode) {\n return;\n }\n this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;\n },\n\n get pagesCount() {\n return this.pdfDocument ? this.pdfDocument.numPages : 0;\n },\n\n get page() {\n return this.pdfViewer.currentPageNumber;\n },\n\n set page(val) {\n this.pdfViewer.currentPageNumber = val;\n },\n\n get supportsPrinting() {\n return PDFPrintServiceFactory.instance.supportsPrinting;\n },\n\n get supportsFullscreen() {\n return shadow(this, \"supportsFullscreen\", document.fullscreenEnabled);\n },\n\n get supportsPinchToZoom() {\n return this.externalServices.supportsPinchToZoom;\n },\n\n get supportsIntegratedFind() {\n return this.externalServices.supportsIntegratedFind;\n },\n\n get supportsDocumentFonts() {\n return this.externalServices.supportsDocumentFonts;\n },\n\n get loadingBar() {\n const barElement = document.getElementById(\"loadingBar\");\n const bar = barElement ? new ProgressBar(barElement) : null;\n return shadow(this, \"loadingBar\", bar);\n },\n\n get supportedMouseWheelZoomModifierKeys() {\n return this.externalServices.supportedMouseWheelZoomModifierKeys;\n },\n\n initPassiveLoading(file) {\n if (\n typeof PDFJSDev === \"undefined\" ||\n !PDFJSDev.test(\"MOZCENTRAL || CHROME\")\n ) {\n throw new Error(\"Not implemented: initPassiveLoading\");\n }\n this.setTitleUsingUrl(file, /* downloadUrl = */ file);\n\n this.externalServices.initPassiveLoading({\n onOpenWithTransport: range => {\n this.open({ range });\n },\n onOpenWithData: (data, contentDispositionFilename) => {\n if (isPdfFile(contentDispositionFilename)) {\n this._contentDispositionFilename = contentDispositionFilename;\n }\n this.open({ data });\n },\n onOpenWithURL: (url, length, originalUrl) => {\n this.open({ url, length, originalUrl });\n },\n onError: err => {\n this.l10n.get(\"loading_error\").then(msg => {\n this._documentError(msg, err);\n });\n },\n onProgress: (loaded, total) => {\n this.progress(loaded / total);\n },\n });\n },\n\n setTitleUsingUrl(url = \"\", downloadUrl = null) {\n this.url = url;\n this.baseUrl = url.split(\"#\")[0];\n if (downloadUrl) {\n this._downloadUrl =\n downloadUrl === url ? this.baseUrl : downloadUrl.split(\"#\")[0];\n }\n if (isDataScheme(url)) {\n this._hideViewBookmark();\n }\n let title = getPdfFilenameFromUrl(url, \"\");\n if (!title) {\n try {\n title = decodeURIComponent(getFilenameFromUrl(url)) || url;\n } catch {\n // decodeURIComponent may throw URIError,\n // fall back to using the unprocessed url in that case\n title = url;\n }\n }\n this.setTitle(title);\n },\n\n setTitle(title = this._title) {\n this._title = title;\n\n if (this.isViewerEmbedded) {\n // Embedded PDF viewers should not be changing their parent page's title.\n return;\n }\n const editorIndicator =\n this._hasAnnotationEditors && !this.pdfRenderingQueue.printing;\n document.title = `${editorIndicator ? \"* \" : \"\"}${title}`;\n },\n\n get _docFilename() {\n // Use `this.url` instead of `this.baseUrl` to perform filename detection\n // based on the reference fragment as ultimate fallback if needed.\n return this._contentDispositionFilename || getPdfFilenameFromUrl(this.url);\n },\n\n /**\n * @private\n */\n _hideViewBookmark() {\n const { secondaryToolbar } = this.appConfig;\n // URL does not reflect proper document location - hiding some buttons.\n secondaryToolbar?.viewBookmarkButton.classList.add(\"hidden\");\n\n // Avoid displaying multiple consecutive separators in the secondaryToolbar.\n if (secondaryToolbar?.presentationModeButton.classList.contains(\"hidden\")) {\n document.getElementById(\"viewBookmarkSeparator\")?.classList.add(\"hidden\");\n }\n },\n\n /**\n * Closes opened PDF document.\n * @returns {Promise} - Returns the promise, which is resolved when all\n * destruction is completed.\n */\n async close() {\n this._unblockDocumentLoadEvent();\n this._hideViewBookmark();\n\n if (!this.pdfLoadingTask) {\n return;\n }\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.pdfDocument?.annotationStorage.size > 0 &&\n this._annotationStorageModified\n ) {\n try {\n // Trigger saving, to prevent data loss in forms; see issue 12257.\n await this.save();\n } catch {\n // Ignoring errors, to ensure that document closing won't break.\n }\n }\n const promises = [];\n\n promises.push(this.pdfLoadingTask.destroy());\n this.pdfLoadingTask = null;\n\n if (this.pdfDocument) {\n this.pdfDocument = null;\n\n this.pdfThumbnailViewer?.setDocument(null);\n this.pdfViewer.setDocument(null);\n this.pdfLinkService.setDocument(null);\n this.pdfDocumentProperties?.setDocument(null);\n }\n this.pdfLinkService.externalLinkEnabled = true;\n this.store = null;\n this.isInitialViewSet = false;\n this.downloadComplete = false;\n this.url = \"\";\n this.baseUrl = \"\";\n this._downloadUrl = \"\";\n this.documentInfo = null;\n this.metadata = null;\n this._contentDispositionFilename = null;\n this._contentLength = null;\n this._saveInProgress = false;\n this._hasAnnotationEditors = false;\n\n promises.push(\n this.pdfScriptingManager.destroyPromise,\n this.passwordPrompt.close()\n );\n\n this.setTitle();\n this.pdfSidebar?.reset();\n this.pdfOutlineViewer?.reset();\n this.pdfAttachmentViewer?.reset();\n this.pdfLayerViewer?.reset();\n\n this.pdfHistory?.reset();\n this.findBar?.reset();\n this.toolbar?.reset();\n this.secondaryToolbar?.reset();\n this._PDFBug?.cleanup();\n\n await Promise.all(promises);\n },\n\n /**\n * Opens a new PDF document.\n * @param {Object} args - Accepts any/all of the properties from\n * {@link DocumentInitParameters}, and also a `originalUrl` string.\n * @returns {Promise} - Promise that is resolved when the document is opened.\n */\n async open(args) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n let deprecatedArgs = false;\n if (typeof args === \"string\") {\n args = { url: args }; // URL\n deprecatedArgs = true;\n } else if (args?.byteLength) {\n args = { data: args }; // ArrayBuffer\n deprecatedArgs = true;\n }\n if (deprecatedArgs) {\n console.error(\n \"The `PDFViewerApplication.open` signature was updated, please use an object instead.\"\n );\n }\n }\n\n if (this.pdfLoadingTask) {\n // We need to destroy already opened document.\n await this.close();\n }\n // Set the necessary global worker parameters, using the available options.\n const workerParams = AppOptions.getAll(OptionKind.WORKER);\n Object.assign(GlobalWorkerOptions, workerParams);\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n args.url\n ) {\n // The Firefox built-in viewer always calls `setTitleUsingUrl`, before\n // `initPassiveLoading`, and it never provides an `originalUrl` here.\n this.setTitleUsingUrl(\n args.originalUrl || args.url,\n /* downloadUrl = */ args.url\n );\n }\n // Set the necessary API parameters, using all the available options.\n const apiParams = AppOptions.getAll(OptionKind.API);\n const params = {\n canvasMaxAreaInBytes: this.externalServices.canvasMaxAreaInBytes,\n ...apiParams,\n ...args,\n };\n\n if (typeof PDFJSDev === \"undefined\") {\n params.docBaseUrl ||= document.URL.split(\"#\")[0];\n } else if (PDFJSDev.test(\"MOZCENTRAL || CHROME\")) {\n params.docBaseUrl ||= this.baseUrl;\n }\n const loadingTask = getDocument(params);\n this.pdfLoadingTask = loadingTask;\n\n loadingTask.onPassword = (updateCallback, reason) => {\n if (this.isViewerEmbedded) {\n // The load event can't be triggered until the password is entered, so\n // if the viewer is in an iframe and its visibility depends on the\n // onload callback then the viewer never shows (bug 1801341).\n this._unblockDocumentLoadEvent();\n }\n\n this.pdfLinkService.externalLinkEnabled = false;\n this.passwordPrompt.setUpdateCallback(updateCallback, reason);\n this.passwordPrompt.open();\n };\n\n loadingTask.onProgress = ({ loaded, total }) => {\n this.progress(loaded / total);\n };\n\n return loadingTask.promise.then(\n pdfDocument => {\n this.load(pdfDocument);\n },\n reason => {\n if (loadingTask !== this.pdfLoadingTask) {\n return undefined; // Ignore errors for previously opened PDF files.\n }\n\n let key = \"loading_error\";\n if (reason instanceof InvalidPDFException) {\n key = \"invalid_file_error\";\n } else if (reason instanceof MissingPDFException) {\n key = \"missing_file_error\";\n } else if (reason instanceof UnexpectedResponseException) {\n key = \"unexpected_response_error\";\n }\n return this.l10n.get(key).then(msg => {\n this._documentError(msg, { message: reason?.message });\n throw reason;\n });\n }\n );\n },\n\n /**\n * @private\n */\n _ensureDownloadComplete() {\n if (this.pdfDocument && this.downloadComplete) {\n return;\n }\n throw new Error(\"PDF document not downloaded.\");\n },\n\n async download(options = {}) {\n const url = this._downloadUrl,\n filename = this._docFilename;\n try {\n this._ensureDownloadComplete();\n\n const data = await this.pdfDocument.getData();\n const blob = new Blob([data], { type: \"application/pdf\" });\n\n await this.downloadManager.download(blob, url, filename, options);\n } catch {\n // When the PDF document isn't ready, or the PDF file is still\n // downloading, simply download using the URL.\n await this.downloadManager.downloadUrl(url, filename, options);\n }\n },\n\n async save(options = {}) {\n if (this._saveInProgress) {\n return;\n }\n this._saveInProgress = true;\n await this.pdfScriptingManager.dispatchWillSave();\n\n const url = this._downloadUrl,\n filename = this._docFilename;\n try {\n this._ensureDownloadComplete();\n\n const data = await this.pdfDocument.saveDocument();\n const blob = new Blob([data], { type: \"application/pdf\" });\n\n await this.downloadManager.download(blob, url, filename, options);\n } catch (reason) {\n // When the PDF document isn't ready, or the PDF file is still\n // downloading, simply fallback to a \"regular\" download.\n console.error(`Error when saving the document: ${reason.message}`);\n await this.download(options);\n } finally {\n await this.pdfScriptingManager.dispatchDidSave();\n this._saveInProgress = false;\n }\n\n if (this._hasAnnotationEditors) {\n this.externalServices.reportTelemetry({\n type: \"editing\",\n data: { type: \"save\" },\n });\n }\n },\n\n downloadOrSave(options = {}) {\n if (this.pdfDocument?.annotationStorage.size > 0) {\n this.save(options);\n } else {\n this.download(options);\n }\n },\n\n openInExternalApp() {\n this.downloadOrSave({ openInExternalApp: true });\n },\n\n /**\n * Report the error; used for errors affecting loading and/or parsing of\n * the entire PDF document.\n */\n _documentError(message, moreInfo = null) {\n this._unblockDocumentLoadEvent();\n\n this._otherError(message, moreInfo);\n\n this.eventBus.dispatch(\"documenterror\", {\n source: this,\n message,\n reason: moreInfo?.message ?? null,\n });\n },\n\n /**\n * Report the error; used for errors affecting e.g. only a single page.\n * @param {string} message - A message that is human readable.\n * @param {Object} [moreInfo] - Further information about the error that is\n * more technical. Should have a 'message' and\n * optionally a 'stack' property.\n */\n _otherError(message, moreInfo = null) {\n const moreInfoText = [`PDF.js v${version || \"?\"} (build: ${build || \"?\"})`];\n if (moreInfo) {\n moreInfoText.push(`Message: ${moreInfo.message}`);\n\n if (moreInfo.stack) {\n moreInfoText.push(`Stack: ${moreInfo.stack}`);\n } else {\n if (moreInfo.filename) {\n moreInfoText.push(`File: ${moreInfo.filename}`);\n }\n if (moreInfo.lineNumber) {\n moreInfoText.push(`Line: ${moreInfo.lineNumber}`);\n }\n }\n }\n\n console.error(`${message}\\n\\n${moreInfoText.join(\"\\n\")}`);\n },\n\n progress(level) {\n if (!this.loadingBar || this.downloadComplete) {\n // Don't accidentally show the loading bar again when the entire file has\n // already been fetched (only an issue when disableAutoFetch is enabled).\n return;\n }\n const percent = Math.round(level * 100);\n // When we transition from full request to range requests, it's possible\n // that we discard some of the loaded data. This can cause the loading\n // bar to move backwards. So prevent this by only updating the bar if it\n // increases.\n if (percent <= this.loadingBar.percent) {\n return;\n }\n this.loadingBar.percent = percent;\n\n // When disableAutoFetch is enabled, it's not uncommon for the entire file\n // to never be fetched (depends on e.g. the file structure). In this case\n // the loading bar will not be completely filled, nor will it be hidden.\n // To prevent displaying a partially filled loading bar permanently, we\n // hide it when no data has been loaded during a certain amount of time.\n if (\n this.pdfDocument?.loadingParams.disableAutoFetch ??\n AppOptions.get(\"disableAutoFetch\")\n ) {\n this.loadingBar.setDisableAutoFetch();\n }\n },\n\n load(pdfDocument) {\n this.pdfDocument = pdfDocument;\n\n pdfDocument.getDownloadInfo().then(({ length }) => {\n this._contentLength = length; // Ensure that the correct length is used.\n this.downloadComplete = true;\n this.loadingBar?.hide();\n\n firstPagePromise.then(() => {\n this.eventBus.dispatch(\"documentloaded\", { source: this });\n });\n });\n\n // Since the `setInitialView` call below depends on this being resolved,\n // fetch it early to avoid delaying initial rendering of the PDF document.\n const pageLayoutPromise = pdfDocument.getPageLayout().catch(() => {\n /* Avoid breaking initial rendering; ignoring errors. */\n });\n const pageModePromise = pdfDocument.getPageMode().catch(() => {\n /* Avoid breaking initial rendering; ignoring errors. */\n });\n const openActionPromise = pdfDocument.getOpenAction().catch(() => {\n /* Avoid breaking initial rendering; ignoring errors. */\n });\n\n this.toolbar?.setPagesCount(pdfDocument.numPages, false);\n this.secondaryToolbar?.setPagesCount(pdfDocument.numPages);\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\")) {\n const baseUrl = location.href.split(\"#\")[0];\n // Ignore \"data:\"-URLs for performance reasons, even though it may cause\n // internal links to not work perfectly in all cases (see bug 1803050).\n this.pdfLinkService.setDocument(\n pdfDocument,\n isDataScheme(baseUrl) ? null : baseUrl\n );\n } else {\n this.pdfLinkService.setDocument(pdfDocument);\n }\n this.pdfDocumentProperties?.setDocument(pdfDocument);\n\n const pdfViewer = this.pdfViewer;\n pdfViewer.setDocument(pdfDocument);\n const { firstPagePromise, onePageRendered, pagesPromise } = pdfViewer;\n\n this.pdfThumbnailViewer?.setDocument(pdfDocument);\n\n const storedPromise = (this.store = new ViewHistory(\n pdfDocument.fingerprints[0]\n ))\n .getMultiple({\n page: null,\n zoom: DEFAULT_SCALE_VALUE,\n scrollLeft: \"0\",\n scrollTop: \"0\",\n rotation: null,\n sidebarView: SidebarView.UNKNOWN,\n scrollMode: ScrollMode.UNKNOWN,\n spreadMode: SpreadMode.UNKNOWN,\n })\n .catch(() => {\n /* Unable to read from storage; ignoring errors. */\n });\n\n firstPagePromise.then(pdfPage => {\n this.loadingBar?.setWidth(this.appConfig.viewerContainer);\n this._initializeAnnotationStorageCallbacks(pdfDocument);\n\n Promise.all([\n animationStarted,\n storedPromise,\n pageLayoutPromise,\n pageModePromise,\n openActionPromise,\n ])\n .then(async ([timeStamp, stored, pageLayout, pageMode, openAction]) => {\n const viewOnLoad = AppOptions.get(\"viewOnLoad\");\n\n this._initializePdfHistory({\n fingerprint: pdfDocument.fingerprints[0],\n viewOnLoad,\n initialDest: openAction?.dest,\n });\n const initialBookmark = this.initialBookmark;\n\n // Initialize the default values, from user preferences.\n const zoom = AppOptions.get(\"defaultZoomValue\");\n let hash = zoom ? `zoom=${zoom}` : null;\n\n let rotation = null;\n let sidebarView = AppOptions.get(\"sidebarViewOnLoad\");\n let scrollMode = AppOptions.get(\"scrollModeOnLoad\");\n let spreadMode = AppOptions.get(\"spreadModeOnLoad\");\n\n if (stored?.page && viewOnLoad !== ViewOnLoad.INITIAL) {\n hash =\n `page=${stored.page}&zoom=${zoom || stored.zoom},` +\n `${stored.scrollLeft},${stored.scrollTop}`;\n\n rotation = parseInt(stored.rotation, 10);\n // Always let user preference take precedence over the view history.\n if (sidebarView === SidebarView.UNKNOWN) {\n sidebarView = stored.sidebarView | 0;\n }\n if (scrollMode === ScrollMode.UNKNOWN) {\n scrollMode = stored.scrollMode | 0;\n }\n if (spreadMode === SpreadMode.UNKNOWN) {\n spreadMode = stored.spreadMode | 0;\n }\n }\n // Always let the user preference/view history take precedence.\n if (pageMode && sidebarView === SidebarView.UNKNOWN) {\n sidebarView = apiPageModeToSidebarView(pageMode);\n }\n if (\n pageLayout &&\n scrollMode === ScrollMode.UNKNOWN &&\n spreadMode === SpreadMode.UNKNOWN\n ) {\n const modes = apiPageLayoutToViewerModes(pageLayout);\n // TODO: Try to improve page-switching when using the mouse-wheel\n // and/or arrow-keys before allowing the document to control this.\n // scrollMode = modes.scrollMode;\n spreadMode = modes.spreadMode;\n }\n\n this.setInitialView(hash, {\n rotation,\n sidebarView,\n scrollMode,\n spreadMode,\n });\n this.eventBus.dispatch(\"documentinit\", { source: this });\n // Make all navigation keys work on document load,\n // unless the viewer is embedded in a web page.\n if (!this.isViewerEmbedded) {\n pdfViewer.focus();\n }\n\n // For documents with different page sizes, once all pages are\n // resolved, ensure that the correct location becomes visible on load.\n // (To reduce the risk, in very large and/or slow loading documents,\n // that the location changes *after* the user has started interacting\n // with the viewer, wait for either `pagesPromise` or a timeout.)\n await Promise.race([\n pagesPromise,\n new Promise(resolve => {\n setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT);\n }),\n ]);\n if (!initialBookmark && !hash) {\n return;\n }\n if (pdfViewer.hasEqualPageSizes) {\n return;\n }\n this.initialBookmark = initialBookmark;\n\n // eslint-disable-next-line no-self-assign\n pdfViewer.currentScaleValue = pdfViewer.currentScaleValue;\n // Re-apply the initial document location.\n this.setInitialView(hash);\n })\n .catch(() => {\n // Ensure that the document is always completely initialized,\n // even if there are any errors thrown above.\n this.setInitialView();\n })\n .then(function () {\n // At this point, rendering of the initial page(s) should always have\n // started (and may even have completed).\n // To prevent any future issues, e.g. the document being completely\n // blank on load, always trigger rendering here.\n pdfViewer.update();\n });\n });\n\n pagesPromise.then(\n () => {\n this._unblockDocumentLoadEvent();\n\n this._initializeAutoPrint(pdfDocument, openActionPromise);\n },\n reason => {\n this.l10n.get(\"loading_error\").then(msg => {\n this._documentError(msg, { message: reason?.message });\n });\n }\n );\n\n onePageRendered.then(data => {\n this.externalServices.reportTelemetry({\n type: \"pageInfo\",\n timestamp: data.timestamp,\n });\n\n if (this.pdfOutlineViewer) {\n pdfDocument.getOutline().then(outline => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the outline resolved.\n }\n this.pdfOutlineViewer.render({ outline, pdfDocument });\n });\n }\n if (this.pdfAttachmentViewer) {\n pdfDocument.getAttachments().then(attachments => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the attachments resolved.\n }\n this.pdfAttachmentViewer.render({ attachments });\n });\n }\n if (this.pdfLayerViewer) {\n // Ensure that the layers accurately reflects the current state in the\n // viewer itself, rather than the default state provided by the API.\n pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the layers resolved.\n }\n this.pdfLayerViewer.render({ optionalContentConfig, pdfDocument });\n });\n }\n });\n\n this._initializePageLabels(pdfDocument);\n this._initializeMetadata(pdfDocument);\n },\n\n /**\n * @private\n */\n async _scriptingDocProperties(pdfDocument) {\n if (!this.documentInfo) {\n // It should be *extremely* rare for metadata to not have been resolved\n // when this code runs, but ensure that we handle that case here.\n await new Promise(resolve => {\n this.eventBus._on(\"metadataloaded\", resolve, { once: true });\n });\n if (pdfDocument !== this.pdfDocument) {\n return null; // The document was closed while the metadata resolved.\n }\n }\n if (!this._contentLength) {\n // Always waiting for the entire PDF document to be loaded will, most\n // likely, delay sandbox-creation too much in the general case for all\n // PDF documents which are not provided as binary data to the API.\n // Hence we'll simply have to trust that the `contentLength` (as provided\n // by the server), when it exists, is accurate enough here.\n await new Promise(resolve => {\n this.eventBus._on(\"documentloaded\", resolve, { once: true });\n });\n if (pdfDocument !== this.pdfDocument) {\n return null; // The document was closed while the downloadInfo resolved.\n }\n }\n\n return {\n ...this.documentInfo,\n baseURL: this.baseUrl,\n filesize: this._contentLength,\n filename: this._docFilename,\n metadata: this.metadata?.getRaw(),\n authors: this.metadata?.get(\"dc:creator\"),\n numPages: this.pagesCount,\n URL: this.url,\n };\n },\n\n /**\n * @private\n */\n async _initializeAutoPrint(pdfDocument, openActionPromise) {\n const [openAction, jsActions] = await Promise.all([\n openActionPromise,\n this.pdfViewer.enableScripting ? null : pdfDocument.getJSActions(),\n ]);\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the auto print data resolved.\n }\n let triggerAutoPrint = openAction?.action === \"Print\";\n\n if (jsActions) {\n console.warn(\"Warning: JavaScript support is not enabled\");\n\n // Hack to support auto printing.\n for (const name in jsActions) {\n if (triggerAutoPrint) {\n break;\n }\n switch (name) {\n case \"WillClose\":\n case \"WillSave\":\n case \"DidSave\":\n case \"WillPrint\":\n case \"DidPrint\":\n continue;\n }\n triggerAutoPrint = jsActions[name].some(js => AutoPrintRegExp.test(js));\n }\n }\n\n if (triggerAutoPrint) {\n this.triggerPrinting();\n }\n },\n\n /**\n * @private\n */\n async _initializeMetadata(pdfDocument) {\n const { info, metadata, contentDispositionFilename, contentLength } =\n await pdfDocument.getMetadata();\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the metadata resolved.\n }\n this.documentInfo = info;\n this.metadata = metadata;\n this._contentDispositionFilename ??= contentDispositionFilename;\n this._contentLength ??= contentLength; // See `getDownloadInfo`-call above.\n\n // Provides some basic debug information\n console.log(\n `PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` +\n `${(info.Producer || \"-\").trim()} / ${(info.Creator || \"-\").trim()}] ` +\n `(PDF.js: ${version || \"?\"} [${build || \"?\"}])`\n );\n let pdfTitle = info.Title;\n\n const metadataTitle = metadata?.get(\"dc:title\");\n if (metadataTitle) {\n // Ghostscript can produce invalid 'dc:title' Metadata entries:\n // - The title may be \"Untitled\" (fixes bug 1031612).\n // - The title may contain incorrectly encoded characters, which thus\n // looks broken, hence we ignore the Metadata entry when it contains\n // characters from the Specials Unicode block (fixes bug 1605526).\n if (\n metadataTitle !== \"Untitled\" &&\n !/[\\uFFF0-\\uFFFF]/g.test(metadataTitle)\n ) {\n pdfTitle = metadataTitle;\n }\n }\n if (pdfTitle) {\n this.setTitle(\n `${pdfTitle} - ${this._contentDispositionFilename || this._title}`\n );\n } else if (this._contentDispositionFilename) {\n this.setTitle(this._contentDispositionFilename);\n }\n\n if (\n info.IsXFAPresent &&\n !info.IsAcroFormPresent &&\n !pdfDocument.isPureXfa\n ) {\n if (pdfDocument.loadingParams.enableXfa) {\n console.warn(\"Warning: XFA Foreground documents are not supported\");\n } else {\n console.warn(\"Warning: XFA support is not enabled\");\n }\n } else if (\n (info.IsAcroFormPresent || info.IsXFAPresent) &&\n !this.pdfViewer.renderForms\n ) {\n console.warn(\"Warning: Interactive form support is not enabled\");\n }\n\n if (info.IsSignaturesPresent) {\n console.warn(\"Warning: Digital signatures validation is not supported\");\n }\n\n this.eventBus.dispatch(\"metadataloaded\", { source: this });\n },\n\n /**\n * @private\n */\n async _initializePageLabels(pdfDocument) {\n if (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n ) {\n return;\n }\n const labels = await pdfDocument.getPageLabels();\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the page labels resolved.\n }\n if (!labels || AppOptions.get(\"disablePageLabels\")) {\n return;\n }\n const numLabels = labels.length;\n // Ignore page labels that correspond to standard page numbering,\n // or page labels that are all empty.\n let standardLabels = 0,\n emptyLabels = 0;\n for (let i = 0; i < numLabels; i++) {\n const label = labels[i];\n if (label === (i + 1).toString()) {\n standardLabels++;\n } else if (label === \"\") {\n emptyLabels++;\n } else {\n break;\n }\n }\n if (standardLabels >= numLabels || emptyLabels >= numLabels) {\n return;\n }\n const { pdfViewer, pdfThumbnailViewer, toolbar } = this;\n\n pdfViewer.setPageLabels(labels);\n pdfThumbnailViewer?.setPageLabels(labels);\n\n // Changing toolbar page display to use labels and we need to set\n // the label of the current page.\n toolbar?.setPagesCount(numLabels, true);\n toolbar?.setPageNumber(\n pdfViewer.currentPageNumber,\n pdfViewer.currentPageLabel\n );\n },\n\n /**\n * @private\n */\n _initializePdfHistory({ fingerprint, viewOnLoad, initialDest = null }) {\n if (!this.pdfHistory) {\n return;\n }\n this.pdfHistory.initialize({\n fingerprint,\n resetHistory: viewOnLoad === ViewOnLoad.INITIAL,\n updateUrl: AppOptions.get(\"historyUpdateUrl\"),\n });\n\n if (this.pdfHistory.initialBookmark) {\n this.initialBookmark = this.pdfHistory.initialBookmark;\n\n this.initialRotation = this.pdfHistory.initialRotation;\n }\n\n // Always let the browser history/document hash take precedence.\n if (\n initialDest &&\n !this.initialBookmark &&\n viewOnLoad === ViewOnLoad.UNKNOWN\n ) {\n this.initialBookmark = JSON.stringify(initialDest);\n // TODO: Re-factor the `PDFHistory` initialization to remove this hack\n // that's currently necessary to prevent weird initial history state.\n this.pdfHistory.push({ explicitDest: initialDest, pageNumber: null });\n }\n },\n\n /**\n * @private\n */\n _initializeAnnotationStorageCallbacks(pdfDocument) {\n if (pdfDocument !== this.pdfDocument) {\n return;\n }\n const { annotationStorage } = pdfDocument;\n\n annotationStorage.onSetModified = () => {\n window.addEventListener(\"beforeunload\", beforeUnload);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this._annotationStorageModified = true;\n }\n };\n annotationStorage.onResetModified = () => {\n window.removeEventListener(\"beforeunload\", beforeUnload);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n delete this._annotationStorageModified;\n }\n };\n annotationStorage.onAnnotationEditor = typeStr => {\n this._hasAnnotationEditors = !!typeStr;\n this.setTitle();\n\n if (typeStr) {\n this.externalServices.reportTelemetry({\n type: \"editing\",\n data: { type: typeStr },\n });\n }\n };\n },\n\n setInitialView(\n storedHash,\n { rotation, sidebarView, scrollMode, spreadMode } = {}\n ) {\n const setRotation = angle => {\n if (isValidRotation(angle)) {\n this.pdfViewer.pagesRotation = angle;\n }\n };\n const setViewerModes = (scroll, spread) => {\n if (isValidScrollMode(scroll)) {\n this.pdfViewer.scrollMode = scroll;\n }\n if (isValidSpreadMode(spread)) {\n this.pdfViewer.spreadMode = spread;\n }\n };\n this.isInitialViewSet = true;\n this.pdfSidebar?.setInitialView(sidebarView);\n\n setViewerModes(scrollMode, spreadMode);\n\n if (this.initialBookmark) {\n setRotation(this.initialRotation);\n delete this.initialRotation;\n\n this.pdfLinkService.setHash(this.initialBookmark);\n this.initialBookmark = null;\n } else if (storedHash) {\n setRotation(rotation);\n\n this.pdfLinkService.setHash(storedHash);\n }\n\n // Ensure that the correct page number is displayed in the UI,\n // even if the active page didn't change during document load.\n this.toolbar?.setPageNumber(\n this.pdfViewer.currentPageNumber,\n this.pdfViewer.currentPageLabel\n );\n this.secondaryToolbar?.setPageNumber(this.pdfViewer.currentPageNumber);\n\n if (!this.pdfViewer.currentScaleValue) {\n // Scale was not initialized: invalid bookmark or scale was not specified.\n // Setting the default one.\n this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;\n }\n },\n\n /**\n * @private\n */\n _cleanup() {\n if (!this.pdfDocument) {\n return; // run cleanup when document is loaded\n }\n this.pdfViewer.cleanup();\n this.pdfThumbnailViewer?.cleanup();\n\n this.pdfDocument.cleanup();\n },\n\n forceRendering() {\n this.pdfRenderingQueue.printing = !!this.printService;\n this.pdfRenderingQueue.isThumbnailViewEnabled =\n this.pdfSidebar?.visibleView === SidebarView.THUMBS;\n this.pdfRenderingQueue.renderHighestPriority();\n },\n\n beforePrint() {\n this._printAnnotationStoragePromise = this.pdfScriptingManager\n .dispatchWillPrint()\n .catch(() => {\n /* Avoid breaking printing; ignoring errors. */\n })\n .then(() => {\n return this.pdfDocument?.annotationStorage.print;\n });\n\n if (this.printService) {\n // There is no way to suppress beforePrint/afterPrint events,\n // but PDFPrintService may generate double events -- this will ignore\n // the second event that will be coming from native window.print().\n return;\n }\n\n if (!this.supportsPrinting) {\n this.l10n.get(\"printing_not_supported\").then(msg => {\n this._otherError(msg);\n });\n return;\n }\n\n // The beforePrint is a sync method and we need to know layout before\n // returning from this method. Ensure that we can get sizes of the pages.\n if (!this.pdfViewer.pageViewsReady) {\n this.l10n.get(\"printing_not_ready\").then(msg => {\n // eslint-disable-next-line no-alert\n window.alert(msg);\n });\n return;\n }\n\n const pagesOverview = this.pdfViewer.getPagesOverview();\n const printContainer = this.appConfig.printContainer;\n const printResolution = AppOptions.get(\"printResolution\");\n const optionalContentConfigPromise =\n this.pdfViewer.optionalContentConfigPromise;\n\n const printService = PDFPrintServiceFactory.instance.createPrintService(\n this.pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n optionalContentConfigPromise,\n this._printAnnotationStoragePromise,\n this.l10n\n );\n this.printService = printService;\n this.forceRendering();\n // Disable the editor-indicator during printing (fixes bug 1790552).\n this.setTitle();\n\n printService.layout();\n\n if (this._hasAnnotationEditors) {\n this.externalServices.reportTelemetry({\n type: \"editing\",\n data: { type: \"print\" },\n });\n }\n },\n\n afterPrint() {\n if (this._printAnnotationStoragePromise) {\n this._printAnnotationStoragePromise.then(() => {\n this.pdfScriptingManager.dispatchDidPrint();\n });\n this._printAnnotationStoragePromise = null;\n }\n\n if (this.printService) {\n this.printService.destroy();\n this.printService = null;\n\n this.pdfDocument?.annotationStorage.resetModified();\n }\n this.forceRendering();\n // Re-enable the editor-indicator after printing (fixes bug 1790552).\n this.setTitle();\n },\n\n rotatePages(delta) {\n this.pdfViewer.pagesRotation += delta;\n // Note that the thumbnail viewer is updated, and rendering is triggered,\n // in the 'rotationchanging' event handler.\n },\n\n requestPresentationMode() {\n this.pdfPresentationMode?.request();\n },\n\n triggerPrinting() {\n if (!this.supportsPrinting) {\n return;\n }\n window.print();\n },\n\n bindEvents() {\n const { eventBus, _boundEvents } = this;\n\n _boundEvents.beforePrint = this.beforePrint.bind(this);\n _boundEvents.afterPrint = this.afterPrint.bind(this);\n\n eventBus._on(\"resize\", webViewerResize);\n eventBus._on(\"hashchange\", webViewerHashchange);\n eventBus._on(\"beforeprint\", _boundEvents.beforePrint);\n eventBus._on(\"afterprint\", _boundEvents.afterPrint);\n eventBus._on(\"pagerender\", webViewerPageRender);\n eventBus._on(\"pagerendered\", webViewerPageRendered);\n eventBus._on(\"updateviewarea\", webViewerUpdateViewarea);\n eventBus._on(\"pagechanging\", webViewerPageChanging);\n eventBus._on(\"scalechanging\", webViewerScaleChanging);\n eventBus._on(\"rotationchanging\", webViewerRotationChanging);\n eventBus._on(\"sidebarviewchanged\", webViewerSidebarViewChanged);\n eventBus._on(\"pagemode\", webViewerPageMode);\n eventBus._on(\"namedaction\", webViewerNamedAction);\n eventBus._on(\"presentationmodechanged\", webViewerPresentationModeChanged);\n eventBus._on(\"presentationmode\", webViewerPresentationMode);\n eventBus._on(\n \"switchannotationeditormode\",\n webViewerSwitchAnnotationEditorMode\n );\n eventBus._on(\n \"switchannotationeditorparams\",\n webViewerSwitchAnnotationEditorParams\n );\n eventBus._on(\"print\", webViewerPrint);\n eventBus._on(\"download\", webViewerDownload);\n eventBus._on(\"openinexternalapp\", webViewerOpenInExternalApp);\n eventBus._on(\"firstpage\", webViewerFirstPage);\n eventBus._on(\"lastpage\", webViewerLastPage);\n eventBus._on(\"nextpage\", webViewerNextPage);\n eventBus._on(\"previouspage\", webViewerPreviousPage);\n eventBus._on(\"zoomin\", webViewerZoomIn);\n eventBus._on(\"zoomout\", webViewerZoomOut);\n eventBus._on(\"zoomreset\", webViewerZoomReset);\n eventBus._on(\"pagenumberchanged\", webViewerPageNumberChanged);\n eventBus._on(\"scalechanged\", webViewerScaleChanged);\n eventBus._on(\"rotatecw\", webViewerRotateCw);\n eventBus._on(\"rotateccw\", webViewerRotateCcw);\n eventBus._on(\"optionalcontentconfig\", webViewerOptionalContentConfig);\n eventBus._on(\"switchscrollmode\", webViewerSwitchScrollMode);\n eventBus._on(\"scrollmodechanged\", webViewerScrollModeChanged);\n eventBus._on(\"switchspreadmode\", webViewerSwitchSpreadMode);\n eventBus._on(\"spreadmodechanged\", webViewerSpreadModeChanged);\n eventBus._on(\"documentproperties\", webViewerDocumentProperties);\n eventBus._on(\"findfromurlhash\", webViewerFindFromUrlHash);\n eventBus._on(\"updatefindmatchescount\", webViewerUpdateFindMatchesCount);\n eventBus._on(\"updatefindcontrolstate\", webViewerUpdateFindControlState);\n\n if (AppOptions.get(\"pdfBug\")) {\n _boundEvents.reportPageStatsPDFBug = reportPageStatsPDFBug;\n\n eventBus._on(\"pagerendered\", _boundEvents.reportPageStatsPDFBug);\n eventBus._on(\"pagechanging\", _boundEvents.reportPageStatsPDFBug);\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n eventBus._on(\"fileinputchange\", webViewerFileInputChange);\n eventBus._on(\"openfile\", webViewerOpenFile);\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n // The `unbindEvents` method is unused in MOZCENTRAL builds,\n // hence we don't need to unregister these event listeners.\n eventBus._on(\n \"annotationeditorstateschanged\",\n webViewerAnnotationEditorStatesChanged\n );\n eventBus._on(\"reporttelemetry\", webViewerReportTelemetry);\n }\n },\n\n bindWindowEvents() {\n const { eventBus, _boundEvents } = this;\n\n function addWindowResolutionChange(evt = null) {\n if (evt) {\n webViewerResolutionChange(evt);\n }\n const mediaQueryList = window.matchMedia(\n `(resolution: ${window.devicePixelRatio || 1}dppx)`\n );\n mediaQueryList.addEventListener(\"change\", addWindowResolutionChange, {\n once: true,\n });\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return;\n }\n _boundEvents.removeWindowResolutionChange ||= function () {\n mediaQueryList.removeEventListener(\"change\", addWindowResolutionChange);\n _boundEvents.removeWindowResolutionChange = null;\n };\n }\n addWindowResolutionChange();\n\n _boundEvents.windowResize = () => {\n eventBus.dispatch(\"resize\", { source: window });\n };\n _boundEvents.windowHashChange = () => {\n eventBus.dispatch(\"hashchange\", {\n source: window,\n hash: document.location.hash.substring(1),\n });\n };\n _boundEvents.windowBeforePrint = () => {\n eventBus.dispatch(\"beforeprint\", { source: window });\n };\n _boundEvents.windowAfterPrint = () => {\n eventBus.dispatch(\"afterprint\", { source: window });\n };\n _boundEvents.windowUpdateFromSandbox = event => {\n eventBus.dispatch(\"updatefromsandbox\", {\n source: window,\n detail: event.detail,\n });\n };\n\n window.addEventListener(\"visibilitychange\", webViewerVisibilityChange);\n window.addEventListener(\"wheel\", webViewerWheel, { passive: false });\n window.addEventListener(\"touchstart\", webViewerTouchStart, {\n passive: false,\n });\n window.addEventListener(\"touchmove\", webViewerTouchMove, {\n passive: false,\n });\n window.addEventListener(\"touchend\", webViewerTouchEnd, {\n passive: false,\n });\n window.addEventListener(\"click\", webViewerClick);\n window.addEventListener(\"keydown\", webViewerKeyDown);\n window.addEventListener(\"keyup\", webViewerKeyUp);\n window.addEventListener(\"resize\", _boundEvents.windowResize);\n window.addEventListener(\"hashchange\", _boundEvents.windowHashChange);\n window.addEventListener(\"beforeprint\", _boundEvents.windowBeforePrint);\n window.addEventListener(\"afterprint\", _boundEvents.windowAfterPrint);\n window.addEventListener(\n \"updatefromsandbox\",\n _boundEvents.windowUpdateFromSandbox\n );\n },\n\n unbindEvents() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: unbindEvents\");\n }\n const { eventBus, _boundEvents } = this;\n\n eventBus._off(\"resize\", webViewerResize);\n eventBus._off(\"hashchange\", webViewerHashchange);\n eventBus._off(\"beforeprint\", _boundEvents.beforePrint);\n eventBus._off(\"afterprint\", _boundEvents.afterPrint);\n eventBus._off(\"pagerender\", webViewerPageRender);\n eventBus._off(\"pagerendered\", webViewerPageRendered);\n eventBus._off(\"updateviewarea\", webViewerUpdateViewarea);\n eventBus._off(\"pagechanging\", webViewerPageChanging);\n eventBus._off(\"scalechanging\", webViewerScaleChanging);\n eventBus._off(\"rotationchanging\", webViewerRotationChanging);\n eventBus._off(\"sidebarviewchanged\", webViewerSidebarViewChanged);\n eventBus._off(\"pagemode\", webViewerPageMode);\n eventBus._off(\"namedaction\", webViewerNamedAction);\n eventBus._off(\"presentationmodechanged\", webViewerPresentationModeChanged);\n eventBus._off(\"presentationmode\", webViewerPresentationMode);\n eventBus._off(\"print\", webViewerPrint);\n eventBus._off(\"download\", webViewerDownload);\n eventBus._off(\"openinexternalapp\", webViewerOpenInExternalApp);\n eventBus._off(\"firstpage\", webViewerFirstPage);\n eventBus._off(\"lastpage\", webViewerLastPage);\n eventBus._off(\"nextpage\", webViewerNextPage);\n eventBus._off(\"previouspage\", webViewerPreviousPage);\n eventBus._off(\"zoomin\", webViewerZoomIn);\n eventBus._off(\"zoomout\", webViewerZoomOut);\n eventBus._off(\"zoomreset\", webViewerZoomReset);\n eventBus._off(\"pagenumberchanged\", webViewerPageNumberChanged);\n eventBus._off(\"scalechanged\", webViewerScaleChanged);\n eventBus._off(\"rotatecw\", webViewerRotateCw);\n eventBus._off(\"rotateccw\", webViewerRotateCcw);\n eventBus._off(\"optionalcontentconfig\", webViewerOptionalContentConfig);\n eventBus._off(\"switchscrollmode\", webViewerSwitchScrollMode);\n eventBus._off(\"scrollmodechanged\", webViewerScrollModeChanged);\n eventBus._off(\"switchspreadmode\", webViewerSwitchSpreadMode);\n eventBus._off(\"spreadmodechanged\", webViewerSpreadModeChanged);\n eventBus._off(\"documentproperties\", webViewerDocumentProperties);\n eventBus._off(\"findfromurlhash\", webViewerFindFromUrlHash);\n eventBus._off(\"updatefindmatchescount\", webViewerUpdateFindMatchesCount);\n eventBus._off(\"updatefindcontrolstate\", webViewerUpdateFindControlState);\n\n if (_boundEvents.reportPageStatsPDFBug) {\n eventBus._off(\"pagerendered\", _boundEvents.reportPageStatsPDFBug);\n eventBus._off(\"pagechanging\", _boundEvents.reportPageStatsPDFBug);\n\n _boundEvents.reportPageStatsPDFBug = null;\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n eventBus._off(\"fileinputchange\", webViewerFileInputChange);\n eventBus._off(\"openfile\", webViewerOpenFile);\n }\n\n _boundEvents.beforePrint = null;\n _boundEvents.afterPrint = null;\n },\n\n unbindWindowEvents() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: unbindWindowEvents\");\n }\n const { _boundEvents } = this;\n\n window.removeEventListener(\"visibilitychange\", webViewerVisibilityChange);\n window.removeEventListener(\"wheel\", webViewerWheel, { passive: false });\n window.removeEventListener(\"touchstart\", webViewerTouchStart, {\n passive: false,\n });\n window.removeEventListener(\"touchmove\", webViewerTouchMove, {\n passive: false,\n });\n window.removeEventListener(\"touchend\", webViewerTouchEnd, {\n passive: false,\n });\n window.removeEventListener(\"click\", webViewerClick);\n window.removeEventListener(\"keydown\", webViewerKeyDown);\n window.removeEventListener(\"keyup\", webViewerKeyUp);\n window.removeEventListener(\"resize\", _boundEvents.windowResize);\n window.removeEventListener(\"hashchange\", _boundEvents.windowHashChange);\n window.removeEventListener(\"beforeprint\", _boundEvents.windowBeforePrint);\n window.removeEventListener(\"afterprint\", _boundEvents.windowAfterPrint);\n window.removeEventListener(\n \"updatefromsandbox\",\n _boundEvents.windowUpdateFromSandbox\n );\n\n _boundEvents.removeWindowResolutionChange?.();\n _boundEvents.windowResize = null;\n _boundEvents.windowHashChange = null;\n _boundEvents.windowBeforePrint = null;\n _boundEvents.windowAfterPrint = null;\n _boundEvents.windowUpdateFromSandbox = null;\n },\n\n _accumulateTicks(ticks, prop) {\n // If the direction changed, reset the accumulated ticks.\n if ((this[prop] > 0 && ticks < 0) || (this[prop] < 0 && ticks > 0)) {\n this[prop] = 0;\n }\n this[prop] += ticks;\n const wholeTicks = Math.trunc(this[prop]);\n this[prop] -= wholeTicks;\n return wholeTicks;\n },\n\n _accumulateFactor(previousScale, factor, prop) {\n if (factor === 1) {\n return 1;\n }\n // If the direction changed, reset the accumulated factor.\n if ((this[prop] > 1 && factor < 1) || (this[prop] < 1 && factor > 1)) {\n this[prop] = 1;\n }\n\n const newFactor =\n Math.floor(previousScale * factor * this[prop] * 100) /\n (100 * previousScale);\n this[prop] = factor / newFactor;\n\n return newFactor;\n },\n\n _centerAtPos(previousScale, x, y) {\n const { pdfViewer } = this;\n const scaleDiff = pdfViewer.currentScale / previousScale - 1;\n if (scaleDiff !== 0) {\n const [top, left] = pdfViewer.containerTopLeft;\n pdfViewer.container.scrollLeft += (x - left) * scaleDiff;\n pdfViewer.container.scrollTop += (y - top) * scaleDiff;\n }\n },\n\n /**\n * Should be called *after* all pages have loaded, or if an error occurred,\n * to unblock the \"load\" event; see https://bugzilla.mozilla.org/show_bug.cgi?id=1618553\n * @private\n */\n _unblockDocumentLoadEvent() {\n document.blockUnblockOnload?.(false);\n\n // Ensure that this method is only ever run once.\n this._unblockDocumentLoadEvent = () => {};\n },\n\n /**\n * Used together with the integration-tests, to enable awaiting full\n * initialization of the scripting/sandbox.\n */\n get scriptingReady() {\n return this.pdfScriptingManager.ready;\n },\n};\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n const HOSTED_VIEWER_ORIGINS = [\n \"null\",\n \"http://mozilla.github.io\",\n \"https://mozilla.github.io\",\n ];\n // eslint-disable-next-line no-var\n var validateFileURL = function (file) {\n if (!file) {\n return;\n }\n try {\n const viewerOrigin = new URL(window.location.href).origin || \"null\";\n if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) {\n // Hosted or local viewer, allow for any file locations\n return;\n }\n const fileOrigin = new URL(file, window.location.href).origin;\n // Removing of the following line will not guarantee that the viewer will\n // start accepting URLs from foreign origin -- CORS headers on the remote\n // server must be properly configured.\n if (fileOrigin !== viewerOrigin) {\n throw new Error(\"file origin does not match viewer's\");\n }\n } catch (ex) {\n PDFViewerApplication.l10n.get(\"loading_error\").then(msg => {\n PDFViewerApplication._documentError(msg, { message: ex?.message });\n });\n throw ex;\n }\n };\n}\n\nasync function loadFakeWorker() {\n GlobalWorkerOptions.workerSrc ||= AppOptions.get(\"workerSrc\");\n\n if (typeof PDFJSDev === \"undefined\") {\n window.pdfjsWorker = await import(\"pdfjs/pdf.worker.js\");\n return;\n }\n await loadScript(PDFWorker.workerSrc);\n}\n\nasync function loadPDFBug(self) {\n const { debuggerScriptPath } = self.appConfig;\n const { PDFBug } =\n typeof PDFJSDev === \"undefined\"\n ? await import(debuggerScriptPath) // eslint-disable-line no-unsanitized/method\n : await import(debuggerScriptPath); // eslint-disable-line no-undef\n\n self._PDFBug = PDFBug;\n}\n\nfunction reportPageStatsPDFBug({ pageNumber }) {\n if (!globalThis.Stats?.enabled) {\n return;\n }\n const pageView = PDFViewerApplication.pdfViewer.getPageView(\n /* index = */ pageNumber - 1\n );\n globalThis.Stats.add(pageNumber, pageView?.pdfPage?.stats);\n}\n\nfunction webViewerPageRender({ pageNumber }) {\n // If the page is (the most) visible when it starts rendering,\n // ensure that the page number input loading indicator is displayed.\n if (pageNumber === PDFViewerApplication.page) {\n PDFViewerApplication.toolbar?.updateLoadingIndicatorState(true);\n }\n}\n\nfunction webViewerPageRendered({ pageNumber, error }) {\n // If the page is still visible when it has finished rendering,\n // ensure that the page number input loading indicator is hidden.\n if (pageNumber === PDFViewerApplication.page) {\n PDFViewerApplication.toolbar?.updateLoadingIndicatorState(false);\n }\n\n // Use the rendered page to set the corresponding thumbnail image.\n if (PDFViewerApplication.pdfSidebar?.visibleView === SidebarView.THUMBS) {\n const pageView = PDFViewerApplication.pdfViewer.getPageView(\n /* index = */ pageNumber - 1\n );\n const thumbnailView = PDFViewerApplication.pdfThumbnailViewer?.getThumbnail(\n /* index = */ pageNumber - 1\n );\n if (pageView) {\n thumbnailView?.setImage(pageView);\n }\n }\n\n if (error) {\n PDFViewerApplication.l10n.get(\"rendering_error\").then(msg => {\n PDFViewerApplication._otherError(msg, error);\n });\n }\n}\n\nfunction webViewerPageMode({ mode }) {\n // Handle the 'pagemode' hash parameter, see also `PDFLinkService_setHash`.\n let view;\n switch (mode) {\n case \"thumbs\":\n view = SidebarView.THUMBS;\n break;\n case \"bookmarks\":\n case \"outline\": // non-standard\n view = SidebarView.OUTLINE;\n break;\n case \"attachments\": // non-standard\n view = SidebarView.ATTACHMENTS;\n break;\n case \"layers\": // non-standard\n view = SidebarView.LAYERS;\n break;\n case \"none\":\n view = SidebarView.NONE;\n break;\n default:\n console.error('Invalid \"pagemode\" hash parameter: ' + mode);\n return;\n }\n PDFViewerApplication.pdfSidebar?.switchView(view, /* forceOpen = */ true);\n}\n\nfunction webViewerNamedAction(evt) {\n // Processing a couple of named actions that might be useful, see also\n // `PDFLinkService.executeNamedAction`.\n switch (evt.action) {\n case \"GoToPage\":\n PDFViewerApplication.appConfig.toolbar?.pageNumber.select();\n break;\n\n case \"Find\":\n if (!PDFViewerApplication.supportsIntegratedFind) {\n PDFViewerApplication?.findBar.toggle();\n }\n break;\n\n case \"Print\":\n PDFViewerApplication.triggerPrinting();\n break;\n\n case \"SaveAs\":\n PDFViewerApplication.downloadOrSave();\n break;\n }\n}\n\nfunction webViewerPresentationModeChanged(evt) {\n PDFViewerApplication.pdfViewer.presentationModeState = evt.state;\n}\n\nfunction webViewerSidebarViewChanged({ view }) {\n PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled =\n view === SidebarView.THUMBS;\n\n if (PDFViewerApplication.isInitialViewSet) {\n // Only update the storage when the document has been loaded *and* rendered.\n PDFViewerApplication.store?.set(\"sidebarView\", view).catch(() => {\n // Unable to write to storage.\n });\n }\n}\n\nfunction webViewerUpdateViewarea({ location }) {\n if (PDFViewerApplication.isInitialViewSet) {\n // Only update the storage when the document has been loaded *and* rendered.\n PDFViewerApplication.store\n ?.setMultiple({\n page: location.pageNumber,\n zoom: location.scale,\n scrollLeft: location.left,\n scrollTop: location.top,\n rotation: location.rotation,\n })\n .catch(() => {\n // Unable to write to storage.\n });\n }\n if (PDFViewerApplication.appConfig.secondaryToolbar) {\n const href = PDFViewerApplication.pdfLinkService.getAnchorUrl(\n location.pdfOpenParams\n );\n PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href =\n href;\n }\n}\n\nfunction webViewerScrollModeChanged(evt) {\n if (\n PDFViewerApplication.isInitialViewSet &&\n !PDFViewerApplication.pdfViewer.isInPresentationMode\n ) {\n // Only update the storage when the document has been loaded *and* rendered.\n PDFViewerApplication.store?.set(\"scrollMode\", evt.mode).catch(() => {\n // Unable to write to storage.\n });\n }\n}\n\nfunction webViewerSpreadModeChanged(evt) {\n if (\n PDFViewerApplication.isInitialViewSet &&\n !PDFViewerApplication.pdfViewer.isInPresentationMode\n ) {\n // Only update the storage when the document has been loaded *and* rendered.\n PDFViewerApplication.store?.set(\"spreadMode\", evt.mode).catch(() => {\n // Unable to write to storage.\n });\n }\n}\n\nfunction webViewerResize() {\n const { pdfDocument, pdfViewer, pdfRenderingQueue } = PDFViewerApplication;\n\n if (pdfRenderingQueue.printing && window.matchMedia(\"print\").matches) {\n // Work-around issue 15324 by ignoring \"resize\" events during printing.\n return;\n }\n\n if (!pdfDocument) {\n return;\n }\n const currentScaleValue = pdfViewer.currentScaleValue;\n if (\n currentScaleValue === \"auto\" ||\n currentScaleValue === \"page-fit\" ||\n currentScaleValue === \"page-width\"\n ) {\n // Note: the scale is constant for 'page-actual'.\n pdfViewer.currentScaleValue = currentScaleValue;\n }\n pdfViewer.update();\n}\n\nfunction webViewerHashchange(evt) {\n const hash = evt.hash;\n if (!hash) {\n return;\n }\n if (!PDFViewerApplication.isInitialViewSet) {\n PDFViewerApplication.initialBookmark = hash;\n } else if (!PDFViewerApplication.pdfHistory?.popStateInProgress) {\n PDFViewerApplication.pdfLinkService.setHash(hash);\n }\n}\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // eslint-disable-next-line no-var\n var webViewerFileInputChange = function (evt) {\n if (PDFViewerApplication.pdfViewer?.isInPresentationMode) {\n return; // Opening a new PDF file isn't supported in Presentation Mode.\n }\n const file = evt.fileInput.files[0];\n\n PDFViewerApplication.open({\n url: URL.createObjectURL(file),\n originalUrl: file.name,\n });\n };\n\n // eslint-disable-next-line no-var\n var webViewerOpenFile = function (evt) {\n const fileInput = PDFViewerApplication.appConfig.openFileInput;\n fileInput.click();\n };\n}\n\nfunction webViewerPresentationMode() {\n PDFViewerApplication.requestPresentationMode();\n}\nfunction webViewerSwitchAnnotationEditorMode(evt) {\n PDFViewerApplication.pdfViewer.annotationEditorMode = evt;\n}\nfunction webViewerSwitchAnnotationEditorParams(evt) {\n PDFViewerApplication.pdfViewer.annotationEditorParams = evt;\n}\nfunction webViewerPrint() {\n PDFViewerApplication.triggerPrinting();\n}\nfunction webViewerDownload() {\n PDFViewerApplication.downloadOrSave();\n}\nfunction webViewerOpenInExternalApp() {\n PDFViewerApplication.openInExternalApp();\n}\nfunction webViewerFirstPage() {\n PDFViewerApplication.page = 1;\n}\nfunction webViewerLastPage() {\n PDFViewerApplication.page = PDFViewerApplication.pagesCount;\n}\nfunction webViewerNextPage() {\n PDFViewerApplication.pdfViewer.nextPage();\n}\nfunction webViewerPreviousPage() {\n PDFViewerApplication.pdfViewer.previousPage();\n}\nfunction webViewerZoomIn() {\n PDFViewerApplication.zoomIn();\n}\nfunction webViewerZoomOut() {\n PDFViewerApplication.zoomOut();\n}\nfunction webViewerZoomReset() {\n PDFViewerApplication.zoomReset();\n}\nfunction webViewerPageNumberChanged(evt) {\n const pdfViewer = PDFViewerApplication.pdfViewer;\n // Note that for `<input type=\"number\">` HTML elements, an empty string will\n // be returned for non-number inputs; hence we simply do nothing in that case.\n if (evt.value !== \"\") {\n PDFViewerApplication.pdfLinkService.goToPage(evt.value);\n }\n\n // Ensure that the page number input displays the correct value, even if the\n // value entered by the user was invalid (e.g. a floating point number).\n if (\n evt.value !== pdfViewer.currentPageNumber.toString() &&\n evt.value !== pdfViewer.currentPageLabel\n ) {\n PDFViewerApplication.toolbar?.setPageNumber(\n pdfViewer.currentPageNumber,\n pdfViewer.currentPageLabel\n );\n }\n}\nfunction webViewerScaleChanged(evt) {\n PDFViewerApplication.pdfViewer.currentScaleValue = evt.value;\n}\nfunction webViewerRotateCw() {\n PDFViewerApplication.rotatePages(90);\n}\nfunction webViewerRotateCcw() {\n PDFViewerApplication.rotatePages(-90);\n}\nfunction webViewerOptionalContentConfig(evt) {\n PDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise;\n}\nfunction webViewerSwitchScrollMode(evt) {\n PDFViewerApplication.pdfViewer.scrollMode = evt.mode;\n}\nfunction webViewerSwitchSpreadMode(evt) {\n PDFViewerApplication.pdfViewer.spreadMode = evt.mode;\n}\nfunction webViewerDocumentProperties() {\n PDFViewerApplication.pdfDocumentProperties?.open();\n}\n\nfunction webViewerFindFromUrlHash(evt) {\n PDFViewerApplication.eventBus.dispatch(\"find\", {\n source: evt.source,\n type: \"\",\n query: evt.query,\n caseSensitive: false,\n entireWord: false,\n highlightAll: true,\n findPrevious: false,\n matchDiacritics: true,\n });\n}\n\nfunction webViewerUpdateFindMatchesCount({ matchesCount }) {\n if (PDFViewerApplication.supportsIntegratedFind) {\n PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount);\n } else {\n PDFViewerApplication.findBar.updateResultsCount(matchesCount);\n }\n}\n\nfunction webViewerUpdateFindControlState({\n state,\n previous,\n matchesCount,\n rawQuery,\n}) {\n if (PDFViewerApplication.supportsIntegratedFind) {\n PDFViewerApplication.externalServices.updateFindControlState({\n result: state,\n findPrevious: previous,\n matchesCount,\n rawQuery,\n });\n } else {\n PDFViewerApplication.findBar?.updateUIState(state, previous, matchesCount);\n }\n}\n\nfunction webViewerScaleChanging(evt) {\n PDFViewerApplication.toolbar?.setPageScale(evt.presetValue, evt.scale);\n\n PDFViewerApplication.pdfViewer.update();\n}\n\nfunction webViewerRotationChanging(evt) {\n if (PDFViewerApplication.pdfThumbnailViewer) {\n PDFViewerApplication.pdfThumbnailViewer.pagesRotation = evt.pagesRotation;\n }\n\n PDFViewerApplication.forceRendering();\n // Ensure that the active page doesn't change during rotation.\n PDFViewerApplication.pdfViewer.currentPageNumber = evt.pageNumber;\n}\n\nfunction webViewerPageChanging({ pageNumber, pageLabel }) {\n PDFViewerApplication.toolbar?.setPageNumber(pageNumber, pageLabel);\n PDFViewerApplication.secondaryToolbar?.setPageNumber(pageNumber);\n\n if (PDFViewerApplication.pdfSidebar?.visibleView === SidebarView.THUMBS) {\n PDFViewerApplication.pdfThumbnailViewer?.scrollThumbnailIntoView(\n pageNumber\n );\n }\n\n // Show/hide the loading indicator in the page number input element.\n const currentPage = PDFViewerApplication.pdfViewer.getPageView(\n /* index = */ pageNumber - 1\n );\n PDFViewerApplication.toolbar?.updateLoadingIndicatorState(\n currentPage?.renderingState === RenderingStates.RUNNING\n );\n}\n\nfunction webViewerResolutionChange(evt) {\n PDFViewerApplication.pdfViewer.refresh();\n}\n\nfunction webViewerVisibilityChange(evt) {\n if (document.visibilityState === \"visible\") {\n // Ignore mouse wheel zooming during tab switches (bug 1503412).\n setZoomDisabledTimeout();\n }\n}\n\nlet zoomDisabledTimeout = null;\nfunction setZoomDisabledTimeout() {\n if (zoomDisabledTimeout) {\n clearTimeout(zoomDisabledTimeout);\n }\n zoomDisabledTimeout = setTimeout(function () {\n zoomDisabledTimeout = null;\n }, WHEEL_ZOOM_DISABLED_TIMEOUT);\n}\n\nfunction webViewerWheel(evt) {\n const {\n pdfViewer,\n supportedMouseWheelZoomModifierKeys,\n supportsPinchToZoom,\n } = PDFViewerApplication;\n\n if (pdfViewer.isInPresentationMode) {\n return;\n }\n\n // Pinch-to-zoom on a trackpad maps to a wheel event with ctrlKey set to true\n // https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent#browser_compatibility\n // Hence if ctrlKey is true but ctrl key hasn't been pressed then we can\n // infer that we have a pinch-to-zoom.\n // But the ctrlKey could have been pressed outside of the browser window,\n // hence we try to do some magic to guess if the scaleFactor is likely coming\n // from a pinch-to-zoom or not.\n\n // It is important that we query deltaMode before delta{X,Y}, so that\n // Firefox doesn't switch to DOM_DELTA_PIXEL mode for compat with other\n // browsers, see https://bugzilla.mozilla.org/show_bug.cgi?id=1392460.\n const deltaMode = evt.deltaMode;\n\n // The following formula is a bit strange but it comes from:\n // https://searchfox.org/mozilla-central/rev/d62c4c4d5547064487006a1506287da394b64724/widget/InputData.cpp#618-626\n let scaleFactor = Math.exp(-evt.deltaY / 100);\n\n const isBuiltInMac =\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"MOZCENTRAL\") &&\n FeatureTest.platform.isMac;\n const isPinchToZoom =\n evt.ctrlKey &&\n !PDFViewerApplication._isCtrlKeyDown &&\n deltaMode === WheelEvent.DOM_DELTA_PIXEL &&\n evt.deltaX === 0 &&\n (Math.abs(scaleFactor - 1) < 0.05 || isBuiltInMac) &&\n evt.deltaZ === 0;\n\n if (\n isPinchToZoom ||\n (evt.ctrlKey && supportedMouseWheelZoomModifierKeys.ctrlKey) ||\n (evt.metaKey && supportedMouseWheelZoomModifierKeys.metaKey)\n ) {\n // Only zoom the pages, not the entire viewer.\n evt.preventDefault();\n // NOTE: this check must be placed *after* preventDefault.\n if (\n zoomDisabledTimeout ||\n document.visibilityState === \"hidden\" ||\n PDFViewerApplication.overlayManager.active\n ) {\n return;\n }\n\n const previousScale = pdfViewer.currentScale;\n if (isPinchToZoom && supportsPinchToZoom) {\n scaleFactor = PDFViewerApplication._accumulateFactor(\n previousScale,\n scaleFactor,\n \"_wheelUnusedFactor\"\n );\n if (scaleFactor < 1) {\n PDFViewerApplication.zoomOut(null, scaleFactor);\n } else if (scaleFactor > 1) {\n PDFViewerApplication.zoomIn(null, scaleFactor);\n } else {\n return;\n }\n } else {\n const delta = normalizeWheelEventDirection(evt);\n\n let ticks = 0;\n if (\n deltaMode === WheelEvent.DOM_DELTA_LINE ||\n deltaMode === WheelEvent.DOM_DELTA_PAGE\n ) {\n // For line-based devices, use one tick per event, because different\n // OSs have different defaults for the number lines. But we generally\n // want one \"clicky\" roll of the wheel (which produces one event) to\n // adjust the zoom by one step.\n if (Math.abs(delta) >= 1) {\n ticks = Math.sign(delta);\n } else {\n // If we're getting fractional lines (I can't think of a scenario\n // this might actually happen), be safe and use the accumulator.\n ticks = PDFViewerApplication._accumulateTicks(\n delta,\n \"_wheelUnusedTicks\"\n );\n }\n } else {\n // pixel-based devices\n const PIXELS_PER_LINE_SCALE = 30;\n ticks = PDFViewerApplication._accumulateTicks(\n delta / PIXELS_PER_LINE_SCALE,\n \"_wheelUnusedTicks\"\n );\n }\n\n if (ticks < 0) {\n PDFViewerApplication.zoomOut(-ticks);\n } else if (ticks > 0) {\n PDFViewerApplication.zoomIn(ticks);\n } else {\n return;\n }\n }\n\n // After scaling the page via zoomIn/zoomOut, the position of the upper-\n // left corner is restored. When the mouse wheel is used, the position\n // under the cursor should be restored instead.\n PDFViewerApplication._centerAtPos(previousScale, evt.clientX, evt.clientY);\n } else {\n setZoomDisabledTimeout();\n }\n}\n\nfunction webViewerTouchStart(evt) {\n if (\n PDFViewerApplication.pdfViewer.isInPresentationMode ||\n evt.touches.length < 2\n ) {\n return;\n }\n evt.preventDefault();\n\n if (evt.touches.length !== 2 || PDFViewerApplication.overlayManager.active) {\n PDFViewerApplication._touchInfo = null;\n return;\n }\n\n let [touch0, touch1] = evt.touches;\n if (touch0.identifier > touch1.identifier) {\n [touch0, touch1] = [touch1, touch0];\n }\n PDFViewerApplication._touchInfo = {\n touch0X: touch0.pageX,\n touch0Y: touch0.pageY,\n touch1X: touch1.pageX,\n touch1Y: touch1.pageY,\n };\n}\n\nfunction webViewerTouchMove(evt) {\n if (!PDFViewerApplication._touchInfo || evt.touches.length !== 2) {\n return;\n }\n\n const { pdfViewer, _touchInfo, supportsPinchToZoom } = PDFViewerApplication;\n let [touch0, touch1] = evt.touches;\n if (touch0.identifier > touch1.identifier) {\n [touch0, touch1] = [touch1, touch0];\n }\n const { pageX: page0X, pageY: page0Y } = touch0;\n const { pageX: page1X, pageY: page1Y } = touch1;\n const {\n touch0X: pTouch0X,\n touch0Y: pTouch0Y,\n touch1X: pTouch1X,\n touch1Y: pTouch1Y,\n } = _touchInfo;\n\n if (\n Math.abs(pTouch0X - page0X) <= 1 &&\n Math.abs(pTouch0Y - page0Y) <= 1 &&\n Math.abs(pTouch1X - page1X) <= 1 &&\n Math.abs(pTouch1Y - page1Y) <= 1\n ) {\n // Touches are really too close and it's hard do some basic\n // geometry in order to guess something.\n return;\n }\n\n _touchInfo.touch0X = page0X;\n _touchInfo.touch0Y = page0Y;\n _touchInfo.touch1X = page1X;\n _touchInfo.touch1Y = page1Y;\n\n if (pTouch0X === page0X && pTouch0Y === page0Y) {\n // First touch is fixed, if the vectors are collinear then we've a pinch.\n const v1X = pTouch1X - page0X;\n const v1Y = pTouch1Y - page0Y;\n const v2X = page1X - page0X;\n const v2Y = page1Y - page0Y;\n const det = v1X * v2Y - v1Y * v2X;\n // 0.02 is approximatively sin(0.15deg).\n if (Math.abs(det) > 0.02 * Math.hypot(v1X, v1Y) * Math.hypot(v2X, v2Y)) {\n return;\n }\n } else if (pTouch1X === page1X && pTouch1Y === page1Y) {\n // Second touch is fixed, if the vectors are collinear then we've a pinch.\n const v1X = pTouch0X - page1X;\n const v1Y = pTouch0Y - page1Y;\n const v2X = page0X - page1X;\n const v2Y = page0Y - page1Y;\n const det = v1X * v2Y - v1Y * v2X;\n if (Math.abs(det) > 0.02 * Math.hypot(v1X, v1Y) * Math.hypot(v2X, v2Y)) {\n return;\n }\n } else {\n const diff0X = page0X - pTouch0X;\n const diff1X = page1X - pTouch1X;\n const diff0Y = page0Y - pTouch0Y;\n const diff1Y = page1Y - pTouch1Y;\n const dotProduct = diff0X * diff1X + diff0Y * diff1Y;\n if (dotProduct >= 0) {\n // The two touches go in almost the same direction.\n return;\n }\n }\n\n evt.preventDefault();\n\n const distance = Math.hypot(page0X - page1X, page0Y - page1Y) || 1;\n const pDistance = Math.hypot(pTouch0X - pTouch1X, pTouch0Y - pTouch1Y) || 1;\n const previousScale = pdfViewer.currentScale;\n if (supportsPinchToZoom) {\n const newScaleFactor = PDFViewerApplication._accumulateFactor(\n previousScale,\n distance / pDistance,\n \"_touchUnusedFactor\"\n );\n if (newScaleFactor < 1) {\n PDFViewerApplication.zoomOut(null, newScaleFactor);\n } else if (newScaleFactor > 1) {\n PDFViewerApplication.zoomIn(null, newScaleFactor);\n } else {\n return;\n }\n } else {\n const PIXELS_PER_LINE_SCALE = 30;\n const ticks = PDFViewerApplication._accumulateTicks(\n (distance - pDistance) / PIXELS_PER_LINE_SCALE,\n \"_touchUnusedTicks\"\n );\n if (ticks < 0) {\n PDFViewerApplication.zoomOut(-ticks);\n } else if (ticks > 0) {\n PDFViewerApplication.zoomIn(ticks);\n } else {\n return;\n }\n }\n\n PDFViewerApplication._centerAtPos(\n previousScale,\n (page0X + page1X) / 2,\n (page0Y + page1Y) / 2\n );\n}\n\nfunction webViewerTouchEnd(evt) {\n if (!PDFViewerApplication._touchInfo) {\n return;\n }\n\n evt.preventDefault();\n PDFViewerApplication._touchInfo = null;\n PDFViewerApplication._touchUnusedTicks = 0;\n PDFViewerApplication._touchUnusedFactor = 1;\n}\n\nfunction webViewerClick(evt) {\n if (!PDFViewerApplication.secondaryToolbar?.isOpen) {\n return;\n }\n const appConfig = PDFViewerApplication.appConfig;\n if (\n PDFViewerApplication.pdfViewer.containsElement(evt.target) ||\n (appConfig.toolbar?.container.contains(evt.target) &&\n evt.target !== appConfig.secondaryToolbar?.toggleButton)\n ) {\n PDFViewerApplication.secondaryToolbar.close();\n }\n}\n\nfunction webViewerKeyUp(evt) {\n // evt.ctrlKey is false hence we use evt.key.\n if (evt.key === \"Control\") {\n PDFViewerApplication._isCtrlKeyDown = false;\n }\n}\n\nfunction webViewerKeyDown(evt) {\n PDFViewerApplication._isCtrlKeyDown = evt.key === \"Control\";\n\n if (PDFViewerApplication.overlayManager.active) {\n return;\n }\n const { eventBus, pdfViewer } = PDFViewerApplication;\n const isViewerInPresentationMode = pdfViewer.isInPresentationMode;\n\n let handled = false,\n ensureViewerFocused = false;\n const cmd =\n (evt.ctrlKey ? 1 : 0) |\n (evt.altKey ? 2 : 0) |\n (evt.shiftKey ? 4 : 0) |\n (evt.metaKey ? 8 : 0);\n\n // First, handle the key bindings that are independent whether an input\n // control is selected or not.\n if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) {\n // either CTRL or META key with optional SHIFT.\n switch (evt.keyCode) {\n case 70: // f\n if (!PDFViewerApplication.supportsIntegratedFind && !evt.shiftKey) {\n PDFViewerApplication.findBar?.open();\n handled = true;\n }\n break;\n case 71: // g\n if (!PDFViewerApplication.supportsIntegratedFind) {\n const { state } = PDFViewerApplication.findController;\n if (state) {\n const newState = {\n source: window,\n type: \"again\",\n findPrevious: cmd === 5 || cmd === 12,\n };\n eventBus.dispatch(\"find\", { ...state, ...newState });\n }\n handled = true;\n }\n break;\n case 61: // FF/Mac '='\n case 107: // FF '+' and '='\n case 187: // Chrome '+'\n case 171: // FF with German keyboard\n PDFViewerApplication.zoomIn();\n handled = true;\n break;\n case 173: // FF/Mac '-'\n case 109: // FF '-'\n case 189: // Chrome '-'\n PDFViewerApplication.zoomOut();\n handled = true;\n break;\n case 48: // '0'\n case 96: // '0' on Numpad of Swedish keyboard\n if (!isViewerInPresentationMode) {\n // keeping it unhandled (to restore page zoom to 100%)\n setTimeout(function () {\n // ... and resetting the scale after browser adjusts its scale\n PDFViewerApplication.zoomReset();\n });\n handled = false;\n }\n break;\n\n case 38: // up arrow\n if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {\n PDFViewerApplication.page = 1;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n case 40: // down arrow\n if (\n isViewerInPresentationMode ||\n PDFViewerApplication.page < PDFViewerApplication.pagesCount\n ) {\n PDFViewerApplication.page = PDFViewerApplication.pagesCount;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n }\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC || CHROME\")) {\n // CTRL or META without shift\n if (cmd === 1 || cmd === 8) {\n switch (evt.keyCode) {\n case 83: // s\n eventBus.dispatch(\"download\", { source: window });\n handled = true;\n break;\n\n case 79: // o\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n eventBus.dispatch(\"openfile\", { source: window });\n handled = true;\n }\n break;\n }\n }\n }\n\n // CTRL+ALT or Option+Command\n if (cmd === 3 || cmd === 10) {\n switch (evt.keyCode) {\n case 80: // p\n PDFViewerApplication.requestPresentationMode();\n handled = true;\n PDFViewerApplication.externalServices.reportTelemetry({\n type: \"buttons\",\n data: { id: \"presentationModeKeyboard\" },\n });\n break;\n case 71: // g\n // focuses input#pageNumber field\n if (PDFViewerApplication.appConfig.toolbar) {\n PDFViewerApplication.appConfig.toolbar.pageNumber.select();\n handled = true;\n }\n break;\n }\n }\n\n if (handled) {\n if (ensureViewerFocused && !isViewerInPresentationMode) {\n pdfViewer.focus();\n }\n evt.preventDefault();\n return;\n }\n\n // Some shortcuts should not get handled if a control/input element\n // is selected.\n const curElement = getActiveOrFocusedElement();\n const curElementTagName = curElement?.tagName.toUpperCase();\n if (\n curElementTagName === \"INPUT\" ||\n curElementTagName === \"TEXTAREA\" ||\n curElementTagName === \"SELECT\" ||\n curElement?.isContentEditable\n ) {\n // Make sure that the secondary toolbar is closed when Escape is pressed.\n if (evt.keyCode !== /* Esc = */ 27) {\n return;\n }\n }\n\n // No control key pressed at all.\n if (cmd === 0) {\n let turnPage = 0,\n turnOnlyIfPageFit = false;\n switch (evt.keyCode) {\n case 38: // up arrow\n case 33: // pg up\n // vertical scrolling using arrow/pg keys\n if (pdfViewer.isVerticalScrollbarEnabled) {\n turnOnlyIfPageFit = true;\n }\n turnPage = -1;\n break;\n case 8: // backspace\n if (!isViewerInPresentationMode) {\n turnOnlyIfPageFit = true;\n }\n turnPage = -1;\n break;\n case 37: // left arrow\n // horizontal scrolling using arrow keys\n if (pdfViewer.isHorizontalScrollbarEnabled) {\n turnOnlyIfPageFit = true;\n }\n /* falls through */\n case 75: // 'k'\n case 80: // 'p'\n turnPage = -1;\n break;\n case 27: // esc key\n if (PDFViewerApplication.secondaryToolbar?.isOpen) {\n PDFViewerApplication.secondaryToolbar.close();\n handled = true;\n }\n if (\n !PDFViewerApplication.supportsIntegratedFind &&\n PDFViewerApplication.findBar?.opened\n ) {\n PDFViewerApplication.findBar.close();\n handled = true;\n }\n break;\n case 40: // down arrow\n case 34: // pg down\n // vertical scrolling using arrow/pg keys\n if (pdfViewer.isVerticalScrollbarEnabled) {\n turnOnlyIfPageFit = true;\n }\n turnPage = 1;\n break;\n case 13: // enter key\n case 32: // spacebar\n if (!isViewerInPresentationMode) {\n turnOnlyIfPageFit = true;\n }\n turnPage = 1;\n break;\n case 39: // right arrow\n // horizontal scrolling using arrow keys\n if (pdfViewer.isHorizontalScrollbarEnabled) {\n turnOnlyIfPageFit = true;\n }\n /* falls through */\n case 74: // 'j'\n case 78: // 'n'\n turnPage = 1;\n break;\n\n case 36: // home\n if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {\n PDFViewerApplication.page = 1;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n case 35: // end\n if (\n isViewerInPresentationMode ||\n PDFViewerApplication.page < PDFViewerApplication.pagesCount\n ) {\n PDFViewerApplication.page = PDFViewerApplication.pagesCount;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n\n case 83: // 's'\n PDFViewerApplication.pdfCursorTools?.switchTool(CursorTool.SELECT);\n break;\n case 72: // 'h'\n PDFViewerApplication.pdfCursorTools?.switchTool(CursorTool.HAND);\n break;\n\n case 82: // 'r'\n PDFViewerApplication.rotatePages(90);\n break;\n\n case 115: // F4\n PDFViewerApplication.pdfSidebar?.toggle();\n break;\n }\n\n if (\n turnPage !== 0 &&\n (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === \"page-fit\")\n ) {\n if (turnPage > 0) {\n pdfViewer.nextPage();\n } else {\n pdfViewer.previousPage();\n }\n handled = true;\n }\n }\n\n // shift-key\n if (cmd === 4) {\n switch (evt.keyCode) {\n case 13: // enter key\n case 32: // spacebar\n if (\n !isViewerInPresentationMode &&\n pdfViewer.currentScaleValue !== \"page-fit\"\n ) {\n break;\n }\n pdfViewer.previousPage();\n\n handled = true;\n break;\n\n case 82: // 'r'\n PDFViewerApplication.rotatePages(-90);\n break;\n }\n }\n\n if (!handled && !isViewerInPresentationMode) {\n // 33=Page Up 34=Page Down 35=End 36=Home\n // 37=Left 38=Up 39=Right 40=Down\n // 32=Spacebar\n if (\n (evt.keyCode >= 33 && evt.keyCode <= 40) ||\n (evt.keyCode === 32 && curElementTagName !== \"BUTTON\")\n ) {\n ensureViewerFocused = true;\n }\n }\n\n if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) {\n // The page container is not focused, but a page navigation key has been\n // pressed. Change the focus to the viewer container to make sure that\n // navigation by keyboard works as expected.\n pdfViewer.focus();\n }\n\n if (handled) {\n evt.preventDefault();\n }\n}\n\nfunction beforeUnload(evt) {\n evt.preventDefault();\n evt.returnValue = \"\";\n return false;\n}\n\nfunction webViewerAnnotationEditorStatesChanged(data) {\n PDFViewerApplication.externalServices.updateEditorStates(data);\n}\n\nfunction webViewerReportTelemetry({ details }) {\n PDFViewerApplication.externalServices.reportTelemetry(details);\n}\n\n/* Abstract factory for the print service. */\nconst PDFPrintServiceFactory = {\n instance: {\n supportsPrinting: false,\n createPrintService() {\n throw new Error(\"Not implemented: createPrintService\");\n },\n },\n};\n\nexport {\n DefaultExternalServices,\n PDFPrintServiceFactory,\n PDFViewerApplication,\n};\n","'use strict';\n/* eslint-disable no-unused-vars -- required for functions `.length` */\nvar $ = require('../internals/export');\nvar global = require('../internals/global');\nvar apply = require('../internals/function-apply');\nvar wrapErrorConstructorWithCause = require('../internals/wrap-error-constructor-with-cause');\n\nvar WEB_ASSEMBLY = 'WebAssembly';\nvar WebAssembly = global[WEB_ASSEMBLY];\n\nvar FORCED = Error('e', { cause: 7 }).cause !== 7;\n\nvar exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);\n $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);\n};\n\nvar exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n if (WebAssembly && WebAssembly[ERROR_NAME]) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);\n $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);\n }\n};\n\n// https://tc39.es/ecma262/#sec-nativeerror\nexportGlobalErrorCauseWrapper('Error', function (init) {\n return function Error(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('EvalError', function (init) {\n return function EvalError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('RangeError', function (init) {\n return function RangeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('ReferenceError', function (init) {\n return function ReferenceError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('SyntaxError', function (init) {\n return function SyntaxError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('TypeError', function (init) {\n return function TypeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('URIError', function (init) {\n return function URIError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('CompileError', function (init) {\n return function CompileError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('LinkError', function (init) {\n return function LinkError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {\n return function RuntimeError(message) { return apply(init, this, arguments); };\n});\n","'use strict';\nvar NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\nvar hasOwn = require('../internals/has-own-property');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar proxyAccessor = require('../internals/proxy-accessor');\nvar inheritIfRequired = require('../internals/inherit-if-required');\nvar normalizeStringArgument = require('../internals/normalize-string-argument');\nvar installErrorCause = require('../internals/install-error-cause');\nvar installErrorStack = require('../internals/error-stack-install');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar IS_PURE = require('../internals/is-pure');\n\nmodule.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {\n var STACK_TRACE_LIMIT = 'stackTraceLimit';\n var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;\n var path = FULL_NAME.split('.');\n var ERROR_NAME = path[path.length - 1];\n var OriginalError = getBuiltIn.apply(null, path);\n\n if (!OriginalError) return;\n\n var OriginalErrorPrototype = OriginalError.prototype;\n\n // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006\n if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;\n\n if (!FORCED) return OriginalError;\n\n var BaseError = getBuiltIn('Error');\n\n var WrappedError = wrapper(function (a, b) {\n var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);\n var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();\n if (message !== undefined) createNonEnumerableProperty(result, 'message', message);\n installErrorStack(result, WrappedError, result.stack, 2);\n if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);\n if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);\n return result;\n });\n\n WrappedError.prototype = OriginalErrorPrototype;\n\n if (ERROR_NAME !== 'Error') {\n if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);\n else copyConstructorProperties(WrappedError, BaseError, { name: true });\n } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {\n proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);\n proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');\n }\n\n copyConstructorProperties(WrappedError, OriginalError);\n\n if (!IS_PURE) try {\n // Safari 13- bug: WebAssembly errors does not have a proper `.name`\n if (OriginalErrorPrototype.name !== ERROR_NAME) {\n createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);\n }\n OriginalErrorPrototype.constructor = WrappedError;\n } catch (error) { /* empty */ }\n\n return WrappedError;\n};\n","'use strict';\n/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar aCallable = require('../internals/a-callable');\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","'use strict';\nvar defineProperty = require('../internals/object-define-property').f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n","'use strict';\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n","'use strict';\nvar toString = require('../internals/to-string');\n\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n","'use strict';\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n","'use strict';\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar clearErrorStack = require('../internals/error-stack-clear');\nvar ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');\n\n// non-standard V8\nvar captureStackTrace = Error.captureStackTrace;\n\nmodule.exports = function (error, C, stack, dropEntries) {\n if (ERROR_STACK_INSTALLABLE) {\n if (captureStackTrace) captureStackTrace(error, C);\n else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));\n }\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\nvar $Error = Error;\nvar replace = uncurryThis(''.replace);\n\nvar TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');\n// eslint-disable-next-line redos/no-vulnerable -- safe\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\n\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {\n while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n } return stack;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = !fails(function () {\n var error = Error('a');\n if (!('stack' in error)) return true;\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));\n return error.stack !== 7;\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar setArrayLength = require('../internals/array-set-length');\nvar doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');\nvar fails = require('../internals/fails');\n\nvar INCORRECT_TO_LENGTH = fails(function () {\n return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;\n});\n\n// V8 and Safari <= 15.4, FF < 23 throws InternalError\n// https://bugs.chromium.org/p/v8/issues/detail?id=12681\nvar properErrorOnNonWritableLength = function () {\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty([], 'length', { writable: false }).push();\n } catch (error) {\n return error instanceof TypeError;\n }\n};\n\nvar FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();\n\n// `Array.prototype.push` method\n// https://tc39.es/ecma262/#sec-array.prototype.push\n$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n push: function push(item) {\n var O = toObject(this);\n var len = lengthOfArrayLike(O);\n var argCount = arguments.length;\n doesNotExceedSafeInteger(len + argCount);\n for (var i = 0; i < argCount; i++) {\n O[len] = arguments[i];\n len++;\n }\n setArrayLength(O, len);\n return len;\n }\n});\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar isArray = require('../internals/is-array');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Safari < 13 does not throw an error in this case\nvar SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {\n // makes no sense without proper strict mode support\n if (this !== undefined) return true;\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty([], 'length', { writable: false }).length = 1;\n } catch (error) {\n return error instanceof TypeError;\n }\n}();\n\nmodule.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {\n if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {\n throw $TypeError('Cannot set read only .length');\n } return O.length = length;\n} : function (O, length) {\n return O.length = length;\n};\n","'use strict';\nvar $TypeError = TypeError;\nvar MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991\n\nmodule.exports = function (it) {\n if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');\n return it;\n};\n","'use strict';\nvar defineBuiltIn = require('../internals/define-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\n\nvar $URLSearchParams = URLSearchParams;\nvar URLSearchParamsPrototype = $URLSearchParams.prototype;\nvar append = uncurryThis(URLSearchParamsPrototype.append);\nvar $delete = uncurryThis(URLSearchParamsPrototype['delete']);\nvar forEach = uncurryThis(URLSearchParamsPrototype.forEach);\nvar push = uncurryThis([].push);\nvar params = new $URLSearchParams('a=1&a=2&b=3');\n\nparams['delete']('a', 1);\n// `undefined` case is a Chromium 117 bug\n// https://bugs.chromium.org/p/v8/issues/detail?id=14222\nparams['delete']('b', undefined);\n\nif (params + '' !== 'a=2') {\n defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) {\n var length = arguments.length;\n var $value = length < 2 ? undefined : arguments[1];\n if (length && $value === undefined) return $delete(this, name);\n var entries = [];\n forEach(this, function (v, k) { // also validates `this`\n push(entries, { key: k, value: v });\n });\n validateArgumentsLength(length, 1);\n var key = toString(name);\n var value = toString($value);\n var index = 0;\n var dindex = 0;\n var found = false;\n var entriesLength = entries.length;\n var entry;\n while (index < entriesLength) {\n entry = entries[index++];\n if (found || entry.key === key) {\n found = true;\n $delete(this, entry.key);\n } else dindex++;\n }\n while (dindex < entriesLength) {\n entry = entries[dindex++];\n if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);\n }\n }, { enumerable: true, unsafe: true });\n}\n","'use strict';\nvar $TypeError = TypeError;\n\nmodule.exports = function (passed, required) {\n if (passed < required) throw $TypeError('Not enough arguments');\n return passed;\n};\n","'use strict';\nvar defineBuiltIn = require('../internals/define-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar toString = require('../internals/to-string');\nvar validateArgumentsLength = require('../internals/validate-arguments-length');\n\nvar $URLSearchParams = URLSearchParams;\nvar URLSearchParamsPrototype = $URLSearchParams.prototype;\nvar getAll = uncurryThis(URLSearchParamsPrototype.getAll);\nvar $has = uncurryThis(URLSearchParamsPrototype.has);\nvar params = new $URLSearchParams('a=1');\n\n// `undefined` case is a Chromium 117 bug\n// https://bugs.chromium.org/p/v8/issues/detail?id=14222\nif (params.has('a', 2) || !params.has('a', undefined)) {\n defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) {\n var length = arguments.length;\n var $value = length < 2 ? undefined : arguments[1];\n if (length && $value === undefined) return $has(this, name);\n var values = getAll(this, name); // also validates `this`\n validateArgumentsLength(length, 1);\n var value = toString($value);\n var index = 0;\n while (index < values.length) {\n if (values[index++] === value) return true;\n } return false;\n }, { enumerable: true, unsafe: true });\n}\n","'use strict';\nvar DESCRIPTORS = require('../internals/descriptors');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar defineBuiltInAccessor = require('../internals/define-built-in-accessor');\n\nvar URLSearchParamsPrototype = URLSearchParams.prototype;\nvar forEach = uncurryThis(URLSearchParamsPrototype.forEach);\n\n// `URLSearchParams.prototype.size` getter\n// https://github.com/whatwg/url/pull/734\nif (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {\n defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {\n get: function size() {\n var count = 0;\n forEach(this, function () { count++; });\n return count;\n },\n configurable: true,\n enumerable: true\n });\n}\n","'use strict';\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineProperty = require('../internals/object-define-property');\n\nmodule.exports = function (target, name, descriptor) {\n if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });\n if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });\n return defineProperty.f(target, name, descriptor);\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst DEFAULT_SCALE_VALUE = \"auto\";\nconst DEFAULT_SCALE = 1.0;\nconst DEFAULT_SCALE_DELTA = 1.1;\nconst MIN_SCALE = 0.1;\nconst MAX_SCALE = 10.0;\nconst UNKNOWN_SCALE = 0;\nconst MAX_AUTO_SCALE = 1.25;\nconst SCROLLBAR_PADDING = 40;\nconst VERTICAL_PADDING = 5;\n\nconst RenderingStates = {\n INITIAL: 0,\n RUNNING: 1,\n PAUSED: 2,\n FINISHED: 3,\n};\n\nconst PresentationModeState = {\n UNKNOWN: 0,\n NORMAL: 1,\n CHANGING: 2,\n FULLSCREEN: 3,\n};\n\nconst SidebarView = {\n UNKNOWN: -1,\n NONE: 0,\n THUMBS: 1, // Default value.\n OUTLINE: 2,\n ATTACHMENTS: 3,\n LAYERS: 4,\n};\n\nconst TextLayerMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_PERMISSIONS: 2,\n};\n\nconst ScrollMode = {\n UNKNOWN: -1,\n VERTICAL: 0, // Default value.\n HORIZONTAL: 1,\n WRAPPED: 2,\n PAGE: 3,\n};\n\nconst SpreadMode = {\n UNKNOWN: -1,\n NONE: 0, // Default value.\n ODD: 1,\n EVEN: 2,\n};\n\nconst CursorTool = {\n SELECT: 0, // The default value.\n HAND: 1,\n ZOOM: 2,\n};\n\n// Used by `PDFViewerApplication`, and by the API unit-tests.\nconst AutoPrintRegExp = /\\bprint\\s*\\(/;\n\n/**\n * Scale factors for the canvas, necessary with HiDPI displays.\n */\nclass OutputScale {\n constructor() {\n const pixelRatio = window.devicePixelRatio || 1;\n\n /**\n * @type {number} Horizontal scale.\n */\n this.sx = pixelRatio;\n\n /**\n * @type {number} Vertical scale.\n */\n this.sy = pixelRatio;\n }\n\n /**\n * @type {boolean} Returns `true` when scaling is required, `false` otherwise.\n */\n get scaled() {\n return this.sx !== 1 || this.sy !== 1;\n }\n}\n\n/**\n * Scrolls specified element into view of its parent.\n * @param {HTMLElement} element - The element to be visible.\n * @param {Object} [spot] - An object with optional top and left properties,\n * specifying the offset from the top left edge.\n * @param {number} [spot.left]\n * @param {number} [spot.top]\n * @param {boolean} [scrollMatches] - When scrolling search results into view,\n * ignore elements that either: Contains marked content identifiers,\n * or have the CSS-rule `overflow: hidden;` set. The default value is `false`.\n */\nfunction scrollIntoView(element, spot, scrollMatches = false) {\n // Assuming offsetParent is available (it's not available when viewer is in\n // hidden iframe or object). We have to scroll: if the offsetParent is not set\n // producing the error. See also animationStarted.\n let parent = element.offsetParent;\n if (!parent) {\n console.error(\"offsetParent is not set -- cannot scroll\");\n return;\n }\n let offsetY = element.offsetTop + element.clientTop;\n let offsetX = element.offsetLeft + element.clientLeft;\n while (\n (parent.clientHeight === parent.scrollHeight &&\n parent.clientWidth === parent.scrollWidth) ||\n (scrollMatches &&\n (parent.classList.contains(\"markedContent\") ||\n getComputedStyle(parent).overflow === \"hidden\"))\n ) {\n offsetY += parent.offsetTop;\n offsetX += parent.offsetLeft;\n\n parent = parent.offsetParent;\n if (!parent) {\n return; // no need to scroll\n }\n }\n if (spot) {\n if (spot.top !== undefined) {\n offsetY += spot.top;\n }\n if (spot.left !== undefined) {\n offsetX += spot.left;\n parent.scrollLeft = offsetX;\n }\n }\n parent.scrollTop = offsetY;\n}\n\n/**\n * Helper function to start monitoring the scroll event and converting them into\n * PDF.js friendly one: with scroll debounce and scroll direction.\n */\nfunction watchScroll(viewAreaElement, callback) {\n const debounceScroll = function (evt) {\n if (rAF) {\n return;\n }\n // schedule an invocation of scroll for next animation frame.\n rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {\n rAF = null;\n\n const currentX = viewAreaElement.scrollLeft;\n const lastX = state.lastX;\n if (currentX !== lastX) {\n state.right = currentX > lastX;\n }\n state.lastX = currentX;\n const currentY = viewAreaElement.scrollTop;\n const lastY = state.lastY;\n if (currentY !== lastY) {\n state.down = currentY > lastY;\n }\n state.lastY = currentY;\n callback(state);\n });\n };\n\n const state = {\n right: true,\n down: true,\n lastX: viewAreaElement.scrollLeft,\n lastY: viewAreaElement.scrollTop,\n _eventHandler: debounceScroll,\n };\n\n let rAF = null;\n viewAreaElement.addEventListener(\"scroll\", debounceScroll, true);\n return state;\n}\n\n/**\n * Helper function to parse query string (e.g. ?param1=value¶m2=...).\n * @param {string} query\n * @returns {Map}\n */\nfunction parseQueryString(query) {\n const params = new Map();\n for (const [key, value] of new URLSearchParams(query)) {\n params.set(key.toLowerCase(), value);\n }\n return params;\n}\n\nconst InvisibleCharactersRegExp = /[\\x01-\\x1F]/g;\n\n/**\n * @param {string} str\n * @param {boolean} [replaceInvisible]\n */\nfunction removeNullCharacters(str, replaceInvisible = false) {\n if (typeof str !== \"string\") {\n console.error(`The argument must be a string.`);\n return str;\n }\n if (replaceInvisible) {\n str = str.replaceAll(InvisibleCharactersRegExp, \" \");\n }\n return str.replaceAll(\"\\x00\", \"\");\n}\n\n/**\n * Use binary search to find the index of the first item in a given array which\n * passes a given condition. The items are expected to be sorted in the sense\n * that if the condition is true for one item in the array, then it is also true\n * for all following items.\n *\n * @returns {number} Index of the first array element to pass the test,\n * or |items.length| if no such element exists.\n */\nfunction binarySearchFirstItem(items, condition, start = 0) {\n let minIndex = start;\n let maxIndex = items.length - 1;\n\n if (maxIndex < 0 || !condition(items[maxIndex])) {\n return items.length;\n }\n if (condition(items[minIndex])) {\n return minIndex;\n }\n\n while (minIndex < maxIndex) {\n const currentIndex = (minIndex + maxIndex) >> 1;\n const currentItem = items[currentIndex];\n if (condition(currentItem)) {\n maxIndex = currentIndex;\n } else {\n minIndex = currentIndex + 1;\n }\n }\n return minIndex; /* === maxIndex */\n}\n\n/**\n * Approximates float number as a fraction using Farey sequence (max order\n * of 8).\n * @param {number} x - Positive float number.\n * @returns {Array} Estimated fraction: the first array item is a numerator,\n * the second one is a denominator.\n */\nfunction approximateFraction(x) {\n // Fast paths for int numbers or their inversions.\n if (Math.floor(x) === x) {\n return [x, 1];\n }\n const xinv = 1 / x;\n const limit = 8;\n if (xinv > limit) {\n return [1, limit];\n } else if (Math.floor(xinv) === xinv) {\n return [1, xinv];\n }\n\n const x_ = x > 1 ? xinv : x;\n // a/b and c/d are neighbours in Farey sequence.\n let a = 0,\n b = 1,\n c = 1,\n d = 1;\n // Limiting search to order 8.\n while (true) {\n // Generating next term in sequence (order of q).\n const p = a + c,\n q = b + d;\n if (q > limit) {\n break;\n }\n if (x_ <= p / q) {\n c = p;\n d = q;\n } else {\n a = p;\n b = q;\n }\n }\n let result;\n // Select closest of the neighbours to x.\n if (x_ - a / b < c / d - x_) {\n result = x_ === x ? [a, b] : [b, a];\n } else {\n result = x_ === x ? [c, d] : [d, c];\n }\n return result;\n}\n\nfunction roundToDivide(x, div) {\n const r = x % div;\n return r === 0 ? x : Math.round(x - r + div);\n}\n\n/**\n * @typedef {Object} GetPageSizeInchesParameters\n * @property {number[]} view\n * @property {number} userUnit\n * @property {number} rotate\n */\n\n/**\n * @typedef {Object} PageSize\n * @property {number} width - In inches.\n * @property {number} height - In inches.\n */\n\n/**\n * Gets the size of the specified page, converted from PDF units to inches.\n * @param {GetPageSizeInchesParameters} params\n * @returns {PageSize}\n */\nfunction getPageSizeInches({ view, userUnit, rotate }) {\n const [x1, y1, x2, y2] = view;\n // We need to take the page rotation into account as well.\n const changeOrientation = rotate % 180 !== 0;\n\n const width = ((x2 - x1) / 72) * userUnit;\n const height = ((y2 - y1) / 72) * userUnit;\n\n return {\n width: changeOrientation ? height : width,\n height: changeOrientation ? width : height,\n };\n}\n\n/**\n * Helper function for getVisibleElements.\n *\n * @param {number} index - initial guess at the first visible element\n * @param {Array} views - array of pages, into which `index` is an index\n * @param {number} top - the top of the scroll pane\n * @returns {number} less than or equal to `index` that is definitely at or\n * before the first visible element in `views`, but not by too much. (Usually,\n * this will be the first element in the first partially visible row in\n * `views`, although sometimes it goes back one row further.)\n */\nfunction backtrackBeforeAllVisibleElements(index, views, top) {\n // binarySearchFirstItem's assumption is that the input is ordered, with only\n // one index where the conditions flips from false to true: [false ...,\n // true...]. With vertical scrolling and spreads, it is possible to have\n // [false ..., true, false, true ...]. With wrapped scrolling we can have a\n // similar sequence, with many more mixed true and false in the middle.\n //\n // So there is no guarantee that the binary search yields the index of the\n // first visible element. It could have been any of the other visible elements\n // that were preceded by a hidden element.\n\n // Of course, if either this element or the previous (hidden) element is also\n // the first element, there's nothing to worry about.\n if (index < 2) {\n return index;\n }\n\n // That aside, the possible cases are represented below.\n //\n // **** = fully hidden\n // A*B* = mix of partially visible and/or hidden pages\n // CDEF = fully visible\n //\n // (1) Binary search could have returned A, in which case we can stop.\n // (2) Binary search could also have returned B, in which case we need to\n // check the whole row.\n // (3) Binary search could also have returned C, in which case we need to\n // check the whole previous row.\n //\n // There's one other possibility:\n //\n // **** = fully hidden\n // ABCD = mix of fully and/or partially visible pages\n //\n // (4) Binary search could only have returned A.\n\n // Initially assume that we need to find the beginning of the current row\n // (case 1, 2, or 4), which means finding a page that is above the current\n // page's top. If the found page is partially visible, we're definitely not in\n // case 3, and this assumption is correct.\n let elt = views[index].div;\n let pageTop = elt.offsetTop + elt.clientTop;\n\n if (pageTop >= top) {\n // The found page is fully visible, so we're actually either in case 3 or 4,\n // and unfortunately we can't tell the difference between them without\n // scanning the entire previous row, so we just conservatively assume that\n // we do need to backtrack to that row. In both cases, the previous page is\n // in the previous row, so use its top instead.\n elt = views[index - 1].div;\n pageTop = elt.offsetTop + elt.clientTop;\n }\n\n // Now we backtrack to the first page that still has its bottom below\n // `pageTop`, which is the top of a page in the first visible row (unless\n // we're in case 4, in which case it's the row before that).\n // `index` is found by binary search, so the page at `index - 1` is\n // invisible and we can start looking for potentially visible pages from\n // `index - 2`. (However, if this loop terminates on its first iteration,\n // which is the case when pages are stacked vertically, `index` should remain\n // unchanged, so we use a distinct loop variable.)\n for (let i = index - 2; i >= 0; --i) {\n elt = views[i].div;\n if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {\n // We have reached the previous row, so stop now.\n // This loop is expected to terminate relatively quickly because the\n // number of pages per row is expected to be small.\n break;\n }\n index = i;\n }\n return index;\n}\n\n/**\n * @typedef {Object} GetVisibleElementsParameters\n * @property {HTMLElement} scrollEl - A container that can possibly scroll.\n * @property {Array} views - Objects with a `div` property that contains an\n * HTMLElement, which should all be descendants of `scrollEl` satisfying the\n * relevant layout assumptions.\n * @property {boolean} sortByVisibility - If `true`, the returned elements are\n * sorted in descending order of the percent of their padding box that is\n * visible. The default value is `false`.\n * @property {boolean} horizontal - If `true`, the elements are assumed to be\n * laid out horizontally instead of vertically. The default value is `false`.\n * @property {boolean} rtl - If `true`, the `scrollEl` container is assumed to\n * be in right-to-left mode. The default value is `false`.\n */\n\n/**\n * Generic helper to find out what elements are visible within a scroll pane.\n *\n * Well, pretty generic. There are some assumptions placed on the elements\n * referenced by `views`:\n * - If `horizontal`, no left of any earlier element is to the right of the\n * left of any later element.\n * - Otherwise, `views` can be split into contiguous rows where, within a row,\n * no top of any element is below the bottom of any other element, and\n * between rows, no bottom of any element in an earlier row is below the\n * top of any element in a later row.\n *\n * (Here, top, left, etc. all refer to the padding edge of the element in\n * question. For pages, that ends up being equivalent to the bounding box of the\n * rendering canvas. Earlier and later refer to index in `views`, not page\n * layout.)\n *\n * @param {GetVisibleElementsParameters} params\n * @returns {Object} `{ first, last, views: [{ id, x, y, view, percent }] }`\n */\nfunction getVisibleElements({\n scrollEl,\n views,\n sortByVisibility = false,\n horizontal = false,\n rtl = false,\n}) {\n const top = scrollEl.scrollTop,\n bottom = top + scrollEl.clientHeight;\n const left = scrollEl.scrollLeft,\n right = left + scrollEl.clientWidth;\n\n // Throughout this \"generic\" function, comments will assume we're working with\n // PDF document pages, which is the most important and complex case. In this\n // case, the visible elements we're actually interested is the page canvas,\n // which is contained in a wrapper which adds no padding/border/margin, which\n // is itself contained in `view.div` which adds no padding (but does add a\n // border). So, as specified in this function's doc comment, this function\n // does all of its work on the padding edge of the provided views, starting at\n // offsetLeft/Top (which includes margin) and adding clientLeft/Top (which is\n // the border). Adding clientWidth/Height gets us the bottom-right corner of\n // the padding edge.\n function isElementBottomAfterViewTop(view) {\n const element = view.div;\n const elementBottom =\n element.offsetTop + element.clientTop + element.clientHeight;\n return elementBottom > top;\n }\n function isElementNextAfterViewHorizontally(view) {\n const element = view.div;\n const elementLeft = element.offsetLeft + element.clientLeft;\n const elementRight = elementLeft + element.clientWidth;\n return rtl ? elementLeft < right : elementRight > left;\n }\n\n const visible = [],\n ids = new Set(),\n numViews = views.length;\n let firstVisibleElementInd = binarySearchFirstItem(\n views,\n horizontal\n ? isElementNextAfterViewHorizontally\n : isElementBottomAfterViewTop\n );\n\n // Please note the return value of the `binarySearchFirstItem` function when\n // no valid element is found (hence the `firstVisibleElementInd` check below).\n if (\n firstVisibleElementInd > 0 &&\n firstVisibleElementInd < numViews &&\n !horizontal\n ) {\n // In wrapped scrolling (or vertical scrolling with spreads), with some page\n // sizes, isElementBottomAfterViewTop doesn't satisfy the binary search\n // condition: there can be pages with bottoms above the view top between\n // pages with bottoms below. This function detects and corrects that error;\n // see it for more comments.\n firstVisibleElementInd = backtrackBeforeAllVisibleElements(\n firstVisibleElementInd,\n views,\n top\n );\n }\n\n // lastEdge acts as a cutoff for us to stop looping, because we know all\n // subsequent pages will be hidden.\n //\n // When using wrapped scrolling or vertical scrolling with spreads, we can't\n // simply stop the first time we reach a page below the bottom of the view;\n // the tops of subsequent pages on the same row could still be visible. In\n // horizontal scrolling, we don't have that issue, so we can stop as soon as\n // we pass `right`, without needing the code below that handles the -1 case.\n let lastEdge = horizontal ? right : -1;\n\n for (let i = firstVisibleElementInd; i < numViews; i++) {\n const view = views[i],\n element = view.div;\n const currentWidth = element.offsetLeft + element.clientLeft;\n const currentHeight = element.offsetTop + element.clientTop;\n const viewWidth = element.clientWidth,\n viewHeight = element.clientHeight;\n const viewRight = currentWidth + viewWidth;\n const viewBottom = currentHeight + viewHeight;\n\n if (lastEdge === -1) {\n // As commented above, this is only needed in non-horizontal cases.\n // Setting lastEdge to the bottom of the first page that is partially\n // visible ensures that the next page fully below lastEdge is on the\n // next row, which has to be fully hidden along with all subsequent rows.\n if (viewBottom >= bottom) {\n lastEdge = viewBottom;\n }\n } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {\n break;\n }\n\n if (\n viewBottom <= top ||\n currentHeight >= bottom ||\n viewRight <= left ||\n currentWidth >= right\n ) {\n continue;\n }\n\n const hiddenHeight =\n Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);\n const hiddenWidth =\n Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);\n\n const fractionHeight = (viewHeight - hiddenHeight) / viewHeight,\n fractionWidth = (viewWidth - hiddenWidth) / viewWidth;\n const percent = (fractionHeight * fractionWidth * 100) | 0;\n\n visible.push({\n id: view.id,\n x: currentWidth,\n y: currentHeight,\n view,\n percent,\n widthPercent: (fractionWidth * 100) | 0,\n });\n ids.add(view.id);\n }\n\n const first = visible[0],\n last = visible.at(-1);\n\n if (sortByVisibility) {\n visible.sort(function (a, b) {\n const pc = a.percent - b.percent;\n if (Math.abs(pc) > 0.001) {\n return -pc;\n }\n return a.id - b.id; // ensure stability\n });\n }\n return { first, last, views: visible, ids };\n}\n\nfunction normalizeWheelEventDirection(evt) {\n let delta = Math.hypot(evt.deltaX, evt.deltaY);\n const angle = Math.atan2(evt.deltaY, evt.deltaX);\n if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {\n // All that is left-up oriented has to change the sign.\n delta = -delta;\n }\n return delta;\n}\n\nfunction normalizeWheelEventDelta(evt) {\n const deltaMode = evt.deltaMode; // Avoid being affected by bug 1392460.\n let delta = normalizeWheelEventDirection(evt);\n\n const MOUSE_PIXELS_PER_LINE = 30;\n const MOUSE_LINES_PER_PAGE = 30;\n\n // Converts delta to per-page units\n if (deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;\n } else if (deltaMode === WheelEvent.DOM_DELTA_LINE) {\n delta /= MOUSE_LINES_PER_PAGE;\n }\n return delta;\n}\n\nfunction isValidRotation(angle) {\n return Number.isInteger(angle) && angle % 90 === 0;\n}\n\nfunction isValidScrollMode(mode) {\n return (\n Number.isInteger(mode) &&\n Object.values(ScrollMode).includes(mode) &&\n mode !== ScrollMode.UNKNOWN\n );\n}\n\nfunction isValidSpreadMode(mode) {\n return (\n Number.isInteger(mode) &&\n Object.values(SpreadMode).includes(mode) &&\n mode !== SpreadMode.UNKNOWN\n );\n}\n\nfunction isPortraitOrientation(size) {\n return size.width <= size.height;\n}\n\n/**\n * Promise that is resolved when DOM window becomes visible.\n */\nconst animationStarted = new Promise(function (resolve) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof window === \"undefined\"\n ) {\n // Prevent \"ReferenceError: window is not defined\" errors when running the\n // unit-tests in Node.js environments.\n setTimeout(resolve, 20);\n return;\n }\n window.requestAnimationFrame(resolve);\n});\n\nconst docStyle =\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ? null\n : document.documentElement.style;\n\nfunction clamp(v, min, max) {\n return Math.min(Math.max(v, min), max);\n}\n\nclass ProgressBar {\n #classList = null;\n\n #disableAutoFetchTimeout = null;\n\n #percent = 0;\n\n #style = null;\n\n #visible = true;\n\n constructor(bar) {\n this.#classList = bar.classList;\n this.#style = bar.style;\n }\n\n get percent() {\n return this.#percent;\n }\n\n set percent(val) {\n this.#percent = clamp(val, 0, 100);\n\n if (isNaN(val)) {\n this.#classList.add(\"indeterminate\");\n return;\n }\n this.#classList.remove(\"indeterminate\");\n\n this.#style.setProperty(\"--progressBar-percent\", `${this.#percent}%`);\n }\n\n setWidth(viewer) {\n if (!viewer) {\n return;\n }\n const container = viewer.parentNode;\n const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;\n if (scrollbarWidth > 0) {\n this.#style.setProperty(\n \"--progressBar-end-offset\",\n `${scrollbarWidth}px`\n );\n }\n }\n\n setDisableAutoFetch(delay = /* ms = */ 5000) {\n if (isNaN(this.#percent)) {\n return;\n }\n if (this.#disableAutoFetchTimeout) {\n clearTimeout(this.#disableAutoFetchTimeout);\n }\n this.show();\n\n this.#disableAutoFetchTimeout = setTimeout(() => {\n this.#disableAutoFetchTimeout = null;\n this.hide();\n }, delay);\n }\n\n hide() {\n if (!this.#visible) {\n return;\n }\n this.#visible = false;\n this.#classList.add(\"hidden\");\n }\n\n show() {\n if (this.#visible) {\n return;\n }\n this.#visible = true;\n this.#classList.remove(\"hidden\");\n }\n}\n\n/**\n * Get the active or focused element in current DOM.\n *\n * Recursively search for the truly active or focused element in case there are\n * shadow DOMs.\n *\n * @returns {Element} the truly active or focused element.\n */\nfunction getActiveOrFocusedElement() {\n let curRoot = document;\n let curActiveOrFocused =\n curRoot.activeElement || curRoot.querySelector(\":focus\");\n\n while (curActiveOrFocused?.shadowRoot) {\n curRoot = curActiveOrFocused.shadowRoot;\n curActiveOrFocused =\n curRoot.activeElement || curRoot.querySelector(\":focus\");\n }\n\n return curActiveOrFocused;\n}\n\n/**\n * Converts API PageLayout values to the format used by `BaseViewer`.\n * @param {string} layout - The API PageLayout value.\n * @returns {Object}\n */\nfunction apiPageLayoutToViewerModes(layout) {\n let scrollMode = ScrollMode.VERTICAL,\n spreadMode = SpreadMode.NONE;\n\n switch (layout) {\n case \"SinglePage\":\n scrollMode = ScrollMode.PAGE;\n break;\n case \"OneColumn\":\n break;\n case \"TwoPageLeft\":\n scrollMode = ScrollMode.PAGE;\n /* falls through */\n case \"TwoColumnLeft\":\n spreadMode = SpreadMode.ODD;\n break;\n case \"TwoPageRight\":\n scrollMode = ScrollMode.PAGE;\n /* falls through */\n case \"TwoColumnRight\":\n spreadMode = SpreadMode.EVEN;\n break;\n }\n return { scrollMode, spreadMode };\n}\n\n/**\n * Converts API PageMode values to the format used by `PDFSidebar`.\n * NOTE: There's also a \"FullScreen\" parameter which is not possible to support,\n * since the Fullscreen API used in browsers requires that entering\n * fullscreen mode only occurs as a result of a user-initiated event.\n * @param {string} mode - The API PageMode value.\n * @returns {number} A value from {SidebarView}.\n */\nfunction apiPageModeToSidebarView(mode) {\n switch (mode) {\n case \"UseNone\":\n return SidebarView.NONE;\n case \"UseThumbs\":\n return SidebarView.THUMBS;\n case \"UseOutlines\":\n return SidebarView.OUTLINE;\n case \"UseAttachments\":\n return SidebarView.ATTACHMENTS;\n case \"UseOC\":\n return SidebarView.LAYERS;\n }\n return SidebarView.NONE; // Default value.\n}\n\nfunction toggleCheckedBtn(button, toggle, view = null) {\n button.classList.toggle(\"toggled\", toggle);\n button.setAttribute(\"aria-checked\", toggle);\n\n view?.classList.toggle(\"hidden\", !toggle);\n}\n\nfunction toggleExpandedBtn(button, toggle, view = null) {\n button.classList.toggle(\"toggled\", toggle);\n button.setAttribute(\"aria-expanded\", toggle);\n\n view?.classList.toggle(\"hidden\", !toggle);\n}\n\nexport {\n animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n approximateFraction,\n AutoPrintRegExp,\n backtrackBeforeAllVisibleElements, // only exported for testing\n binarySearchFirstItem,\n CursorTool,\n DEFAULT_SCALE,\n DEFAULT_SCALE_DELTA,\n DEFAULT_SCALE_VALUE,\n docStyle,\n getActiveOrFocusedElement,\n getPageSizeInches,\n getVisibleElements,\n isPortraitOrientation,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n MAX_AUTO_SCALE,\n MAX_SCALE,\n MIN_SCALE,\n normalizeWheelEventDelta,\n normalizeWheelEventDirection,\n OutputScale,\n parseQueryString,\n PresentationModeState,\n ProgressBar,\n removeNullCharacters,\n RenderingStates,\n roundToDivide,\n SCROLLBAR_PADDING,\n scrollIntoView,\n ScrollMode,\n SidebarView,\n SpreadMode,\n TextLayerMode,\n toggleCheckedBtn,\n toggleExpandedBtn,\n UNKNOWN_SCALE,\n VERTICAL_PADDING,\n watchScroll,\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar difference = require('../internals/set-difference');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\n// `Set.prototype.difference` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('difference') }, {\n difference: difference\n});\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar SetHelpers = require('../internals/set-helpers');\nvar clone = require('../internals/set-clone');\nvar size = require('../internals/set-size');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSet = require('../internals/set-iterate');\nvar iterateSimple = require('../internals/iterate-simple');\n\nvar has = SetHelpers.has;\nvar remove = SetHelpers.remove;\n\n// `Set.prototype.difference` method\n// https://github.com/tc39/proposal-set-methods\nmodule.exports = function difference(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n var result = clone(O);\n if (size(O) <= otherRec.size) iterateSet(O, function (e) {\n if (otherRec.includes(e)) remove(result, e);\n });\n else iterateSimple(otherRec.getIterator(), function (e) {\n if (has(O, e)) remove(result, e);\n });\n return result;\n};\n","'use strict';\nvar has = require('../internals/set-helpers').has;\n\n// Perform ? RequireInternalSlot(M, [[SetData]])\nmodule.exports = function (it) {\n has(it);\n return it;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\n\n// eslint-disable-next-line es/no-set -- safe\nvar SetPrototype = Set.prototype;\n\nmodule.exports = {\n // eslint-disable-next-line es/no-set -- safe\n Set: Set,\n add: uncurryThis(SetPrototype.add),\n has: uncurryThis(SetPrototype.has),\n remove: uncurryThis(SetPrototype['delete']),\n proto: SetPrototype\n};\n","'use strict';\nvar SetHelpers = require('../internals/set-helpers');\nvar iterate = require('../internals/set-iterate');\n\nvar Set = SetHelpers.Set;\nvar add = SetHelpers.add;\n\nmodule.exports = function (set) {\n var result = new Set();\n iterate(set, function (it) {\n add(result, it);\n });\n return result;\n};\n","'use strict';\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar iterateSimple = require('../internals/iterate-simple');\nvar SetHelpers = require('../internals/set-helpers');\n\nvar Set = SetHelpers.Set;\nvar SetPrototype = SetHelpers.proto;\nvar forEach = uncurryThis(SetPrototype.forEach);\nvar keys = uncurryThis(SetPrototype.keys);\nvar next = keys(new Set()).next;\n\nmodule.exports = function (set, fn, interruptible) {\n return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn);\n};\n","'use strict';\nvar call = require('../internals/function-call');\n\nmodule.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {\n var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;\n var next = record.next;\n var step, result;\n while (!(step = call(next, iterator)).done) {\n result = fn(step.value);\n if (result !== undefined) return result;\n }\n};\n","'use strict';\nvar uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');\nvar SetHelpers = require('../internals/set-helpers');\n\nmodule.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) {\n return set.size;\n};\n","'use strict';\nvar aCallable = require('../internals/a-callable');\nvar anObject = require('../internals/an-object');\nvar call = require('../internals/function-call');\nvar toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\nvar getIteratorDirect = require('../internals/get-iterator-direct');\n\nvar INVALID_SIZE = 'Invalid size';\nvar $RangeError = RangeError;\nvar $TypeError = TypeError;\nvar max = Math.max;\n\nvar SetRecord = function (set, size, has, keys) {\n this.set = set;\n this.size = size;\n this.has = has;\n this.keys = keys;\n};\n\nSetRecord.prototype = {\n getIterator: function () {\n return getIteratorDirect(anObject(call(this.keys, this.set)));\n },\n includes: function (it) {\n return call(this.has, this.set, it);\n }\n};\n\n// `GetSetRecord` abstract operation\n// https://tc39.es/proposal-set-methods/#sec-getsetrecord\nmodule.exports = function (obj) {\n anObject(obj);\n var numSize = +obj.size;\n // NOTE: If size is undefined, then numSize will be NaN\n // eslint-disable-next-line no-self-compare -- NaN check\n if (numSize !== numSize) throw $TypeError(INVALID_SIZE);\n var intSize = toIntegerOrInfinity(numSize);\n if (intSize < 0) throw $RangeError(INVALID_SIZE);\n return new SetRecord(\n obj,\n max(intSize, 0),\n aCallable(obj.has),\n aCallable(obj.keys)\n );\n};\n","'use strict';\n// `GetIteratorDirect(obj)` abstract operation\n// https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect\nmodule.exports = function (obj) {\n return {\n iterator: obj,\n next: obj.next,\n done: false\n };\n};\n","'use strict';\nvar getBuiltIn = require('../internals/get-built-in');\n\nvar createSetLike = function (size) {\n return {\n size: size,\n has: function () {\n return false;\n },\n keys: function () {\n return {\n next: function () {\n return { done: true };\n }\n };\n }\n };\n};\n\nmodule.exports = function (name) {\n var Set = getBuiltIn('Set');\n try {\n new Set()[name](createSetLike(0));\n try {\n // late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it\n // https://github.com/tc39/proposal-set-methods/pull/88\n new Set()[name](createSetLike(-1));\n return false;\n } catch (error2) {\n return true;\n }\n } catch (error) {\n return false;\n }\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar intersection = require('../internals/set-intersection');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\nvar INCORRECT = !setMethodAcceptSetLike('intersection') || fails(function () {\n // eslint-disable-next-line es/no-array-from, es/no-set -- testing\n return Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2]))) !== '3,2';\n});\n\n// `Set.prototype.intersection` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {\n intersection: intersection\n});\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar SetHelpers = require('../internals/set-helpers');\nvar size = require('../internals/set-size');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSet = require('../internals/set-iterate');\nvar iterateSimple = require('../internals/iterate-simple');\n\nvar Set = SetHelpers.Set;\nvar add = SetHelpers.add;\nvar has = SetHelpers.has;\n\n// `Set.prototype.intersection` method\n// https://github.com/tc39/proposal-set-methods\nmodule.exports = function intersection(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n var result = new Set();\n\n if (size(O) > otherRec.size) {\n iterateSimple(otherRec.getIterator(), function (e) {\n if (has(O, e)) add(result, e);\n });\n } else {\n iterateSet(O, function (e) {\n if (otherRec.includes(e)) add(result, e);\n });\n }\n\n return result;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar isDisjointFrom = require('../internals/set-is-disjoint-from');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\n// `Set.prototype.isDisjointFrom` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isDisjointFrom') }, {\n isDisjointFrom: isDisjointFrom\n});\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar has = require('../internals/set-helpers').has;\nvar size = require('../internals/set-size');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSet = require('../internals/set-iterate');\nvar iterateSimple = require('../internals/iterate-simple');\nvar iteratorClose = require('../internals/iterator-close');\n\n// `Set.prototype.isDisjointFrom` method\n// https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom\nmodule.exports = function isDisjointFrom(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n if (size(O) <= otherRec.size) return iterateSet(O, function (e) {\n if (otherRec.includes(e)) return false;\n }, true) !== false;\n var iterator = otherRec.getIterator();\n return iterateSimple(iterator, function (e) {\n if (has(O, e)) return iteratorClose(iterator, 'normal', false);\n }) !== false;\n};\n","'use strict';\nvar call = require('../internals/function-call');\nvar anObject = require('../internals/an-object');\nvar getMethod = require('../internals/get-method');\n\nmodule.exports = function (iterator, kind, value) {\n var innerResult, innerError;\n anObject(iterator);\n try {\n innerResult = getMethod(iterator, 'return');\n if (!innerResult) {\n if (kind === 'throw') throw value;\n return value;\n }\n innerResult = call(innerResult, iterator);\n } catch (error) {\n innerError = true;\n innerResult = error;\n }\n if (kind === 'throw') throw value;\n if (innerError) throw innerResult;\n anObject(innerResult);\n return value;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar isSubsetOf = require('../internals/set-is-subset-of');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\n// `Set.prototype.isSubsetOf` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSubsetOf') }, {\n isSubsetOf: isSubsetOf\n});\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar size = require('../internals/set-size');\nvar iterate = require('../internals/set-iterate');\nvar getSetRecord = require('../internals/get-set-record');\n\n// `Set.prototype.isSubsetOf` method\n// https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf\nmodule.exports = function isSubsetOf(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n if (size(O) > otherRec.size) return false;\n return iterate(O, function (e) {\n if (!otherRec.includes(e)) return false;\n }, true) !== false;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar isSupersetOf = require('../internals/set-is-superset-of');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\n// `Set.prototype.isSupersetOf` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSupersetOf') }, {\n isSupersetOf: isSupersetOf\n});\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar has = require('../internals/set-helpers').has;\nvar size = require('../internals/set-size');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSimple = require('../internals/iterate-simple');\nvar iteratorClose = require('../internals/iterator-close');\n\n// `Set.prototype.isSupersetOf` method\n// https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf\nmodule.exports = function isSupersetOf(other) {\n var O = aSet(this);\n var otherRec = getSetRecord(other);\n if (size(O) < otherRec.size) return false;\n var iterator = otherRec.getIterator();\n return iterateSimple(iterator, function (e) {\n if (!has(O, e)) return iteratorClose(iterator, 'normal', false);\n }) !== false;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar symmetricDifference = require('../internals/set-symmetric-difference');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\n// `Set.prototype.symmetricDifference` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('symmetricDifference') }, {\n symmetricDifference: symmetricDifference\n});\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar SetHelpers = require('../internals/set-helpers');\nvar clone = require('../internals/set-clone');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSimple = require('../internals/iterate-simple');\n\nvar add = SetHelpers.add;\nvar has = SetHelpers.has;\nvar remove = SetHelpers.remove;\n\n// `Set.prototype.symmetricDifference` method\n// https://github.com/tc39/proposal-set-methods\nmodule.exports = function symmetricDifference(other) {\n var O = aSet(this);\n var keysIter = getSetRecord(other).getIterator();\n var result = clone(O);\n iterateSimple(keysIter, function (e) {\n if (has(O, e)) remove(result, e);\n else add(result, e);\n });\n return result;\n};\n","'use strict';\nvar $ = require('../internals/export');\nvar union = require('../internals/set-union');\nvar setMethodAcceptSetLike = require('../internals/set-method-accept-set-like');\n\n// `Set.prototype.union` method\n// https://github.com/tc39/proposal-set-methods\n$({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {\n union: union\n});\n","'use strict';\nvar aSet = require('../internals/a-set');\nvar add = require('../internals/set-helpers').add;\nvar clone = require('../internals/set-clone');\nvar getSetRecord = require('../internals/get-set-record');\nvar iterateSimple = require('../internals/iterate-simple');\n\n// `Set.prototype.union` method\n// https://github.com/tc39/proposal-set-methods\nmodule.exports = function union(other) {\n var O = aSet(this);\n var keysIter = getSetRecord(other).getIterator();\n var result = clone(O);\n iterateSimple(keysIter, function (it) {\n add(result, it);\n });\n return result;\n};\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals module */\n\n\"use strict\";\n\nmodule.exports = globalThis.pdfjsLib;\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst compatibilityParams = Object.create(null);\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof navigator === \"undefined\"\n ) {\n globalThis.navigator = Object.create(null);\n }\n const userAgent = navigator.userAgent || \"\";\n const platform = navigator.platform || \"\";\n const maxTouchPoints = navigator.maxTouchPoints || 1;\n\n const isAndroid = /Android/.test(userAgent);\n const isIOS =\n /\\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) ||\n (platform === \"MacIntel\" && maxTouchPoints > 1);\n\n // Limit canvas size to 5 mega-pixels on mobile.\n // Support: Android, iOS\n (function checkCanvasSizeLimitation() {\n if (isIOS || isAndroid) {\n compatibilityParams.maxCanvasPixels = 5242880;\n }\n })();\n}\n\nconst OptionKind = {\n VIEWER: 0x02,\n API: 0x04,\n WORKER: 0x08,\n PREFERENCE: 0x80,\n};\n\n/**\n * NOTE: These options are used to generate the `default_preferences.json` file,\n * see `OptionKind.PREFERENCE`, hence the values below must use only\n * primitive types and cannot rely on any imported types.\n */\nconst defaultOptions = {\n annotationEditorMode: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n annotationMode: {\n /** @type {number} */\n value: 2,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n cursorToolOnLoad: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n defaultZoomDelay: {\n /** @type {number} */\n value: 400,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n defaultZoomValue: {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n disableHistory: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER,\n },\n disablePageLabels: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enablePermissions: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enablePrintAutoRotate: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enableScripting: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enableStampEditor: {\n // We'll probably want to make some experiments before enabling this\n // in Firefox release, but it has to be temporary.\n // TODO: remove it when unnecessary.\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n externalLinkRel: {\n /** @type {string} */\n value: \"noopener noreferrer nofollow\",\n kind: OptionKind.VIEWER,\n },\n externalLinkTarget: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n historyUpdateUrl: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ignoreDestinationZoom: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n imageResourcesPath: {\n /** @type {string} */\n value:\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/images/\"\n : \"./images/\",\n kind: OptionKind.VIEWER,\n },\n maxCanvasPixels: {\n /** @type {number} */\n value: 16777216,\n kind: OptionKind.VIEWER,\n },\n forcePageColors: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pageColorsBackground: {\n /** @type {string} */\n value: \"Canvas\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pageColorsForeground: {\n /** @type {string} */\n value: \"CanvasText\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pdfBugEnabled: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n printResolution: {\n /** @type {number} */\n value: 150,\n kind: OptionKind.VIEWER,\n },\n sidebarViewOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n scrollModeOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n spreadModeOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n textLayerMode: {\n /** @type {number} */\n value: 1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n viewerCssTheme: {\n /** @type {number} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\") ? 2 : 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n viewOnLoad: {\n /** @type {boolean} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n\n cMapPacked: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n cMapUrl: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../external/bcmaps/\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/cmaps/\"\n : \"../web/cmaps/\",\n kind: OptionKind.API,\n },\n disableAutoFetch: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableFontFace: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableRange: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableStream: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n docBaseUrl: {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.API,\n },\n enableXfa: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n fontExtraProperties: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n isEvalSupported: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n isOffscreenCanvasSupported: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n maxImageSize: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.API,\n },\n pdfBug: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n standardFontDataUrl: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../external/standard_fonts/\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/standard_fonts/\"\n : \"../web/standard_fonts/\",\n kind: OptionKind.API,\n },\n verbosity: {\n /** @type {number} */\n value: 1,\n kind: OptionKind.API,\n },\n\n workerPort: {\n /** @type {Object} */\n value: null,\n kind: OptionKind.WORKER,\n },\n workerSrc: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../src/pdf.worker.js\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/build/pdf.worker.js\"\n : \"../build/pdf.worker.js\",\n kind: OptionKind.WORKER,\n },\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n defaultOptions.defaultUrl = {\n /** @type {string} */\n value: \"compressed.tracemonkey-pldi-09.pdf\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.disablePreferences = {\n /** @type {boolean} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER,\n };\n defaultOptions.locale = {\n /** @type {string} */\n value: navigator.language || \"en-US\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.sandboxBundleSrc = {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\"\n ? \"../build/dev-sandbox/pdf.sandbox.js\"\n : \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER,\n };\n} else if (PDFJSDev.test(\"CHROME\")) {\n defaultOptions.defaultUrl = {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.disableTelemetry = {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n };\n defaultOptions.sandboxBundleSrc = {\n /** @type {string} */\n value: \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER,\n };\n}\n\nconst userOptions = Object.create(null);\n\nclass AppOptions {\n constructor() {\n throw new Error(\"Cannot initialize AppOptions.\");\n }\n\n static get(name) {\n const userOption = userOptions[name];\n if (userOption !== undefined) {\n return userOption;\n }\n const defaultOption = defaultOptions[name];\n if (defaultOption !== undefined) {\n return compatibilityParams[name] ?? defaultOption.value;\n }\n return undefined;\n }\n\n static getAll(kind = null) {\n const options = Object.create(null);\n for (const name in defaultOptions) {\n const defaultOption = defaultOptions[name];\n if (kind) {\n if ((kind & defaultOption.kind) === 0) {\n continue;\n }\n if (kind === OptionKind.PREFERENCE) {\n const value = defaultOption.value,\n valueType = typeof value;\n\n if (\n valueType === \"boolean\" ||\n valueType === \"string\" ||\n (valueType === \"number\" && Number.isInteger(value))\n ) {\n options[name] = value;\n continue;\n }\n throw new Error(`Invalid type for preference: ${name}`);\n }\n }\n const userOption = userOptions[name];\n options[name] =\n userOption !== undefined\n ? userOption\n : compatibilityParams[name] ?? defaultOption.value;\n }\n return options;\n }\n\n static set(name, value) {\n userOptions[name] = value;\n }\n\n static setAll(options) {\n for (const name in options) {\n userOptions[name] = options[name];\n }\n }\n\n static remove(name) {\n delete userOptions[name];\n }\n}\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n AppOptions._hasUserOptions = function () {\n return Object.keys(userOptions).length > 0;\n };\n}\n\nexport { AppOptions, compatibilityParams, OptionKind };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst WaitOnType = {\n EVENT: \"event\",\n TIMEOUT: \"timeout\",\n};\n\n/**\n * @typedef {Object} WaitOnEventOrTimeoutParameters\n * @property {Object} target - The event target, can for example be:\n * `window`, `document`, a DOM element, or an {EventBus} instance.\n * @property {string} name - The name of the event.\n * @property {number} delay - The delay, in milliseconds, after which the\n * timeout occurs (if the event wasn't already dispatched).\n */\n\n/**\n * Allows waiting for an event or a timeout, whichever occurs first.\n * Can be used to ensure that an action always occurs, even when an event\n * arrives late or not at all.\n *\n * @param {WaitOnEventOrTimeoutParameters}\n * @returns {Promise} A promise that is resolved with a {WaitOnType} value.\n */\nfunction waitOnEventOrTimeout({ target, name, delay = 0 }) {\n return new Promise(function (resolve, reject) {\n if (\n typeof target !== \"object\" ||\n !(name && typeof name === \"string\") ||\n !(Number.isInteger(delay) && delay >= 0)\n ) {\n throw new Error(\"waitOnEventOrTimeout - invalid parameters.\");\n }\n\n function handler(type) {\n if (target instanceof EventBus) {\n target._off(name, eventHandler);\n } else {\n target.removeEventListener(name, eventHandler);\n }\n\n if (timeout) {\n clearTimeout(timeout);\n }\n resolve(type);\n }\n\n const eventHandler = handler.bind(null, WaitOnType.EVENT);\n if (target instanceof EventBus) {\n target._on(name, eventHandler);\n } else {\n target.addEventListener(name, eventHandler);\n }\n\n const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);\n const timeout = setTimeout(timeoutHandler, delay);\n });\n}\n\n/**\n * Simple event bus for an application. Listeners are attached using the `on`\n * and `off` methods. To raise an event, the `dispatch` method shall be used.\n */\nclass EventBus {\n #listeners = Object.create(null);\n\n /**\n * @param {string} eventName\n * @param {function} listener\n * @param {Object} [options]\n */\n on(eventName, listener, options = null) {\n this._on(eventName, listener, {\n external: true,\n once: options?.once,\n });\n }\n\n /**\n * @param {string} eventName\n * @param {function} listener\n * @param {Object} [options]\n */\n off(eventName, listener, options = null) {\n this._off(eventName, listener, {\n external: true,\n once: options?.once,\n });\n }\n\n /**\n * @param {string} eventName\n * @param {Object} data\n */\n dispatch(eventName, data) {\n const eventListeners = this.#listeners[eventName];\n if (!eventListeners || eventListeners.length === 0) {\n return;\n }\n let externalListeners;\n // Making copy of the listeners array in case if it will be modified\n // during dispatch.\n for (const { listener, external, once } of eventListeners.slice(0)) {\n if (once) {\n this._off(eventName, listener);\n }\n if (external) {\n (externalListeners ||= []).push(listener);\n continue;\n }\n listener(data);\n }\n // Dispatch any \"external\" listeners *after* the internal ones, to give the\n // viewer components time to handle events and update their state first.\n if (externalListeners) {\n for (const listener of externalListeners) {\n listener(data);\n }\n externalListeners = null;\n }\n }\n\n /**\n * @ignore\n */\n _on(eventName, listener, options = null) {\n const eventListeners = (this.#listeners[eventName] ||= []);\n eventListeners.push({\n listener,\n external: options?.external === true,\n once: options?.once === true,\n });\n }\n\n /**\n * @ignore\n */\n _off(eventName, listener, options = null) {\n const eventListeners = this.#listeners[eventName];\n if (!eventListeners) {\n return;\n }\n for (let i = 0, ii = eventListeners.length; i < ii; i++) {\n if (eventListeners[i].listener === listener) {\n eventListeners.splice(i, 1);\n return;\n }\n }\n }\n}\n\n/**\n * NOTE: Only used to support various PDF viewer tests in `mozilla-central`.\n */\nclass AutomationEventBus extends EventBus {\n dispatch(eventName, data) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: AutomationEventBus.dispatch\");\n }\n super.dispatch(eventName, data);\n\n const detail = Object.create(null);\n if (data) {\n for (const key in data) {\n const value = data[key];\n if (key === \"source\") {\n if (value === window || value === document) {\n return; // No need to re-dispatch (already) global events.\n }\n continue; // Ignore the `source` property.\n }\n detail[key] = value;\n }\n }\n const event = new CustomEvent(eventName, {\n bubbles: true,\n cancelable: true,\n detail,\n });\n document.dispatchEvent(event);\n }\n}\n\nexport { AutomationEventBus, EventBus, waitOnEventOrTimeout, WaitOnType };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { parseQueryString } from \"./ui_utils.js\";\n\nconst DEFAULT_LINK_REL = \"noopener noreferrer nofollow\";\n\nconst LinkTarget = {\n NONE: 0, // Default value.\n SELF: 1,\n BLANK: 2,\n PARENT: 3,\n TOP: 4,\n};\n\n/**\n * @typedef {Object} ExternalLinkParameters\n * @property {string} url - An absolute URL.\n * @property {LinkTarget} [target] - The link target. The default value is\n * `LinkTarget.NONE`.\n * @property {string} [rel] - The link relationship. The default value is\n * `DEFAULT_LINK_REL`.\n * @property {boolean} [enabled] - Whether the link should be enabled. The\n * default value is true.\n */\n\n/**\n * Adds various attributes (href, title, target, rel) to hyperlinks.\n * @param {HTMLAnchorElement} link - The link element.\n * @param {ExternalLinkParameters} params\n */\nfunction addLinkAttributes(link, { url, target, rel, enabled = true } = {}) {\n if (!url || typeof url !== \"string\") {\n throw new Error('A valid \"url\" parameter must provided.');\n }\n\n if (enabled) {\n link.href = link.title = url;\n } else {\n link.href = \"\";\n link.title = `Disabled: ${url}`;\n link.onclick = () => {\n return false;\n };\n }\n\n let targetStr = \"\"; // LinkTarget.NONE\n switch (target) {\n case LinkTarget.NONE:\n break;\n case LinkTarget.SELF:\n targetStr = \"_self\";\n break;\n case LinkTarget.BLANK:\n targetStr = \"_blank\";\n break;\n case LinkTarget.PARENT:\n targetStr = \"_parent\";\n break;\n case LinkTarget.TOP:\n targetStr = \"_top\";\n break;\n }\n link.target = targetStr;\n\n link.rel = typeof rel === \"string\" ? rel : DEFAULT_LINK_REL;\n}\n\n/**\n * @typedef {Object} PDFLinkServiceOptions\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} [externalLinkTarget] - Specifies the `target` attribute\n * for external links. Must use one of the values from {LinkTarget}.\n * Defaults to using no target.\n * @property {string} [externalLinkRel] - Specifies the `rel` attribute for\n * external links. Defaults to stripping the referrer.\n * @property {boolean} [ignoreDestinationZoom] - Ignores the zoom argument,\n * thus preserving the current zoom level in the viewer, when navigating\n * to internal destinations. The default value is `false`.\n */\n\n/**\n * Performs navigation functions inside PDF, such as opening specified page,\n * or destination.\n * @implements {IPDFLinkService}\n */\nclass PDFLinkService {\n #pagesRefCache = new Map();\n\n /**\n * @param {PDFLinkServiceOptions} options\n */\n constructor({\n eventBus,\n externalLinkTarget = null,\n externalLinkRel = null,\n ignoreDestinationZoom = false,\n } = {}) {\n this.eventBus = eventBus;\n this.externalLinkTarget = externalLinkTarget;\n this.externalLinkRel = externalLinkRel;\n this.externalLinkEnabled = true;\n this._ignoreDestinationZoom = ignoreDestinationZoom;\n\n this.baseUrl = null;\n this.pdfDocument = null;\n this.pdfViewer = null;\n this.pdfHistory = null;\n }\n\n setDocument(pdfDocument, baseUrl = null) {\n this.baseUrl = baseUrl;\n this.pdfDocument = pdfDocument;\n this.#pagesRefCache.clear();\n }\n\n setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n\n setHistory(pdfHistory) {\n this.pdfHistory = pdfHistory;\n }\n\n /**\n * @type {number}\n */\n get pagesCount() {\n return this.pdfDocument ? this.pdfDocument.numPages : 0;\n }\n\n /**\n * @type {number}\n */\n get page() {\n return this.pdfViewer.currentPageNumber;\n }\n\n /**\n * @param {number} value\n */\n set page(value) {\n this.pdfViewer.currentPageNumber = value;\n }\n\n /**\n * @type {number}\n */\n get rotation() {\n return this.pdfViewer.pagesRotation;\n }\n\n /**\n * @param {number} value\n */\n set rotation(value) {\n this.pdfViewer.pagesRotation = value;\n }\n\n /**\n * @type {boolean}\n */\n get isInPresentationMode() {\n return this.pdfViewer.isInPresentationMode;\n }\n\n #goToDestinationHelper(rawDest, namedDest = null, explicitDest) {\n // Dest array looks like that: <page-ref> </XYZ|/FitXXX> <args..>\n const destRef = explicitDest[0];\n let pageNumber;\n\n if (typeof destRef === \"object\" && destRef !== null) {\n pageNumber = this._cachedPageNumber(destRef);\n\n if (!pageNumber) {\n // Fetch the page reference if it's not yet available. This could\n // only occur during loading, before all pages have been resolved.\n this.pdfDocument\n .getPageIndex(destRef)\n .then(pageIndex => {\n this.cachePageRef(pageIndex + 1, destRef);\n this.#goToDestinationHelper(rawDest, namedDest, explicitDest);\n })\n .catch(() => {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${destRef}\" is not ` +\n `a valid page reference, for dest=\"${rawDest}\".`\n );\n });\n return;\n }\n } else if (Number.isInteger(destRef)) {\n pageNumber = destRef + 1;\n } else {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${destRef}\" is not ` +\n `a valid destination reference, for dest=\"${rawDest}\".`\n );\n return;\n }\n if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${pageNumber}\" is not ` +\n `a valid page number, for dest=\"${rawDest}\".`\n );\n return;\n }\n\n if (this.pdfHistory) {\n // Update the browser history before scrolling the new destination into\n // view, to be able to accurately capture the current document position.\n this.pdfHistory.pushCurrentPosition();\n this.pdfHistory.push({ namedDest, explicitDest, pageNumber });\n }\n\n this.pdfViewer.scrollPageIntoView({\n pageNumber,\n destArray: explicitDest,\n ignoreDestinationZoom: this._ignoreDestinationZoom,\n });\n }\n\n /**\n * This method will, when available, also update the browser history.\n *\n * @param {string|Array} dest - The named, or explicit, PDF destination.\n */\n async goToDestination(dest) {\n if (!this.pdfDocument) {\n return;\n }\n let namedDest, explicitDest;\n if (typeof dest === \"string\") {\n namedDest = dest;\n explicitDest = await this.pdfDocument.getDestination(dest);\n } else {\n namedDest = null;\n explicitDest = await dest;\n }\n if (!Array.isArray(explicitDest)) {\n console.error(\n `PDFLinkService.goToDestination: \"${explicitDest}\" is not ` +\n `a valid destination array, for dest=\"${dest}\".`\n );\n return;\n }\n this.#goToDestinationHelper(dest, namedDest, explicitDest);\n }\n\n /**\n * This method will, when available, also update the browser history.\n *\n * @param {number|string} val - The page number, or page label.\n */\n goToPage(val) {\n if (!this.pdfDocument) {\n return;\n }\n const pageNumber =\n (typeof val === \"string\" && this.pdfViewer.pageLabelToPageNumber(val)) ||\n val | 0;\n if (\n !(\n Number.isInteger(pageNumber) &&\n pageNumber > 0 &&\n pageNumber <= this.pagesCount\n )\n ) {\n console.error(`PDFLinkService.goToPage: \"${val}\" is not a valid page.`);\n return;\n }\n\n if (this.pdfHistory) {\n // Update the browser history before scrolling the new page into view,\n // to be able to accurately capture the current document position.\n this.pdfHistory.pushCurrentPosition();\n this.pdfHistory.pushPage(pageNumber);\n }\n\n this.pdfViewer.scrollPageIntoView({ pageNumber });\n }\n\n /**\n * Wrapper around the `addLinkAttributes` helper function.\n * @param {HTMLAnchorElement} link\n * @param {string} url\n * @param {boolean} [newWindow]\n */\n addLinkAttributes(link, url, newWindow = false) {\n addLinkAttributes(link, {\n url,\n target: newWindow ? LinkTarget.BLANK : this.externalLinkTarget,\n rel: this.externalLinkRel,\n enabled: this.externalLinkEnabled,\n });\n }\n\n /**\n * @param {string|Array} dest - The PDF destination object.\n * @returns {string} The hyperlink to the PDF object.\n */\n getDestinationHash(dest) {\n if (typeof dest === \"string\") {\n if (dest.length > 0) {\n return this.getAnchorUrl(\"#\" + escape(dest));\n }\n } else if (Array.isArray(dest)) {\n const str = JSON.stringify(dest);\n if (str.length > 0) {\n return this.getAnchorUrl(\"#\" + escape(str));\n }\n }\n return this.getAnchorUrl(\"\");\n }\n\n /**\n * Prefix the full url on anchor links to make sure that links are resolved\n * relative to the current URL instead of the one defined in <base href>.\n * @param {string} anchor - The anchor hash, including the #.\n * @returns {string} The hyperlink to the PDF object.\n */\n getAnchorUrl(anchor) {\n return this.baseUrl ? this.baseUrl + anchor : anchor;\n }\n\n /**\n * @param {string} hash\n */\n setHash(hash) {\n if (!this.pdfDocument) {\n return;\n }\n let pageNumber, dest;\n if (hash.includes(\"=\")) {\n const params = parseQueryString(hash);\n if (params.has(\"search\")) {\n const query = params.get(\"search\").replaceAll('\"', \"\"),\n phrase = params.get(\"phrase\") === \"true\";\n\n this.eventBus.dispatch(\"findfromurlhash\", {\n source: this,\n query: phrase ? query : query.match(/\\S+/g),\n });\n }\n // borrowing syntax from \"Parameters for Opening PDF Files\"\n if (params.has(\"page\")) {\n pageNumber = params.get(\"page\") | 0 || 1;\n }\n if (params.has(\"zoom\")) {\n // Build the destination array.\n const zoomArgs = params.get(\"zoom\").split(\",\"); // scale,left,top\n const zoomArg = zoomArgs[0];\n const zoomArgNumber = parseFloat(zoomArg);\n\n if (!zoomArg.includes(\"Fit\")) {\n // If the zoomArg is a number, it has to get divided by 100. If it's\n // a string, it should stay as it is.\n dest = [\n null,\n { name: \"XYZ\" },\n zoomArgs.length > 1 ? zoomArgs[1] | 0 : null,\n zoomArgs.length > 2 ? zoomArgs[2] | 0 : null,\n zoomArgNumber ? zoomArgNumber / 100 : zoomArg,\n ];\n } else if (zoomArg === \"Fit\" || zoomArg === \"FitB\") {\n dest = [null, { name: zoomArg }];\n } else if (\n zoomArg === \"FitH\" ||\n zoomArg === \"FitBH\" ||\n zoomArg === \"FitV\" ||\n zoomArg === \"FitBV\"\n ) {\n dest = [\n null,\n { name: zoomArg },\n zoomArgs.length > 1 ? zoomArgs[1] | 0 : null,\n ];\n } else if (zoomArg === \"FitR\") {\n if (zoomArgs.length !== 5) {\n console.error(\n 'PDFLinkService.setHash: Not enough parameters for \"FitR\".'\n );\n } else {\n dest = [\n null,\n { name: zoomArg },\n zoomArgs[1] | 0,\n zoomArgs[2] | 0,\n zoomArgs[3] | 0,\n zoomArgs[4] | 0,\n ];\n }\n } else {\n console.error(\n `PDFLinkService.setHash: \"${zoomArg}\" is not a valid zoom value.`\n );\n }\n }\n if (dest) {\n this.pdfViewer.scrollPageIntoView({\n pageNumber: pageNumber || this.page,\n destArray: dest,\n allowNegativeOffset: true,\n });\n } else if (pageNumber) {\n this.page = pageNumber; // simple page\n }\n if (params.has(\"pagemode\")) {\n this.eventBus.dispatch(\"pagemode\", {\n source: this,\n mode: params.get(\"pagemode\"),\n });\n }\n // Ensure that this parameter is *always* handled last, in order to\n // guarantee that it won't be overridden (e.g. by the \"page\" parameter).\n if (params.has(\"nameddest\")) {\n this.goToDestination(params.get(\"nameddest\"));\n }\n } else {\n // Named (or explicit) destination.\n dest = unescape(hash);\n try {\n dest = JSON.parse(dest);\n\n if (!Array.isArray(dest)) {\n // Avoid incorrectly rejecting a valid named destination, such as\n // e.g. \"4.3\" or \"true\", because `JSON.parse` converted its type.\n dest = dest.toString();\n }\n } catch {}\n\n if (\n typeof dest === \"string\" ||\n PDFLinkService.#isValidExplicitDestination(dest)\n ) {\n this.goToDestination(dest);\n return;\n }\n console.error(\n `PDFLinkService.setHash: \"${unescape(\n hash\n )}\" is not a valid destination.`\n );\n }\n }\n\n /**\n * @param {string} action\n */\n executeNamedAction(action) {\n // See PDF reference, table 8.45 - Named action\n switch (action) {\n case \"GoBack\":\n this.pdfHistory?.back();\n break;\n\n case \"GoForward\":\n this.pdfHistory?.forward();\n break;\n\n case \"NextPage\":\n this.pdfViewer.nextPage();\n break;\n\n case \"PrevPage\":\n this.pdfViewer.previousPage();\n break;\n\n case \"LastPage\":\n this.page = this.pagesCount;\n break;\n\n case \"FirstPage\":\n this.page = 1;\n break;\n\n default:\n break; // No action according to spec\n }\n\n this.eventBus.dispatch(\"namedaction\", {\n source: this,\n action,\n });\n }\n\n /**\n * @param {Object} action\n */\n async executeSetOCGState(action) {\n const pdfDocument = this.pdfDocument;\n const optionalContentConfig =\n await this.pdfViewer.optionalContentConfigPromise;\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the optional content resolved.\n }\n let operator;\n\n for (const elem of action.state) {\n switch (elem) {\n case \"ON\":\n case \"OFF\":\n case \"Toggle\":\n operator = elem;\n continue;\n }\n switch (operator) {\n case \"ON\":\n optionalContentConfig.setVisibility(elem, true);\n break;\n case \"OFF\":\n optionalContentConfig.setVisibility(elem, false);\n break;\n case \"Toggle\":\n const group = optionalContentConfig.getGroup(elem);\n if (group) {\n optionalContentConfig.setVisibility(elem, !group.visible);\n }\n break;\n }\n }\n\n this.pdfViewer.optionalContentConfigPromise = Promise.resolve(\n optionalContentConfig\n );\n }\n\n /**\n * @param {number} pageNum - page number.\n * @param {Object} pageRef - reference to the page.\n */\n cachePageRef(pageNum, pageRef) {\n if (!pageRef) {\n return;\n }\n const refStr =\n pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;\n this.#pagesRefCache.set(refStr, pageNum);\n }\n\n /**\n * @ignore\n */\n _cachedPageNumber(pageRef) {\n if (!pageRef) {\n return null;\n }\n const refStr =\n pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;\n return this.#pagesRefCache.get(refStr) || null;\n }\n\n static #isValidExplicitDestination(dest) {\n if (!Array.isArray(dest)) {\n return false;\n }\n const destLength = dest.length;\n if (destLength < 2) {\n return false;\n }\n const page = dest[0];\n if (\n !(\n typeof page === \"object\" &&\n Number.isInteger(page.num) &&\n Number.isInteger(page.gen)\n ) &&\n !(Number.isInteger(page) && page >= 0)\n ) {\n return false;\n }\n const zoom = dest[1];\n if (!(typeof zoom === \"object\" && typeof zoom.name === \"string\")) {\n return false;\n }\n let allowNull = true;\n switch (zoom.name) {\n case \"XYZ\":\n if (destLength !== 5) {\n return false;\n }\n break;\n case \"Fit\":\n case \"FitB\":\n return destLength === 2;\n case \"FitH\":\n case \"FitBH\":\n case \"FitV\":\n case \"FitBV\":\n if (destLength !== 3) {\n return false;\n }\n break;\n case \"FitR\":\n if (destLength !== 6) {\n return false;\n }\n allowNull = false;\n break;\n default:\n return false;\n }\n for (let i = 2; i < destLength; i++) {\n const param = dest[i];\n if (!(typeof param === \"number\" || (allowNull && param === null))) {\n return false;\n }\n }\n return true;\n }\n}\n\n/**\n * @implements {IPDFLinkService}\n */\nclass SimpleLinkService {\n constructor() {\n this.externalLinkEnabled = true;\n }\n\n /**\n * @type {number}\n */\n get pagesCount() {\n return 0;\n }\n\n /**\n * @type {number}\n */\n get page() {\n return 0;\n }\n\n /**\n * @param {number} value\n */\n set page(value) {}\n\n /**\n * @type {number}\n */\n get rotation() {\n return 0;\n }\n\n /**\n * @param {number} value\n */\n set rotation(value) {}\n\n /**\n * @type {boolean}\n */\n get isInPresentationMode() {\n return false;\n }\n\n /**\n * @param {string|Array} dest - The named, or explicit, PDF destination.\n */\n async goToDestination(dest) {}\n\n /**\n * @param {number|string} val - The page number, or page label.\n */\n goToPage(val) {}\n\n /**\n * @param {HTMLAnchorElement} link\n * @param {string} url\n * @param {boolean} [newWindow]\n */\n addLinkAttributes(link, url, newWindow = false) {\n addLinkAttributes(link, { url, enabled: this.externalLinkEnabled });\n }\n\n /**\n * @param dest - The PDF destination object.\n * @returns {string} The hyperlink to the PDF object.\n */\n getDestinationHash(dest) {\n return \"#\";\n }\n\n /**\n * @param hash - The PDF parameters/hash.\n * @returns {string} The hyperlink to the PDF object.\n */\n getAnchorUrl(hash) {\n return \"#\";\n }\n\n /**\n * @param {string} hash\n */\n setHash(hash) {}\n\n /**\n * @param {string} action\n */\n executeNamedAction(action) {}\n\n /**\n * @param {Object} action\n */\n executeSetOCGState(action) {}\n\n /**\n * @param {number} pageNum - page number.\n * @param {Object} pageRef - reference to the page.\n */\n cachePageRef(pageNum, pageRef) {}\n}\n\nexport { LinkTarget, PDFLinkService, SimpleLinkService };\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DOMSVGFactory, shadow } from \"pdfjs-lib\";\n\nclass AltTextManager {\n #boundUpdateUIState = this.#updateUIState.bind(this);\n\n #boundSetPosition = this.#setPosition.bind(this);\n\n #boundOnClick = this.#onClick.bind(this);\n\n #currentEditor = null;\n\n #cancelButton;\n\n #dialog;\n\n #eventBus;\n\n #hasUsedPointer = false;\n\n #optionDescription;\n\n #optionDecorative;\n\n #overlayManager;\n\n #saveButton;\n\n #textarea;\n\n #uiManager;\n\n #previousAltText = null;\n\n #svgElement = null;\n\n #rectElement = null;\n\n #container;\n\n #telemetryData = null;\n\n constructor(\n {\n dialog,\n optionDescription,\n optionDecorative,\n textarea,\n cancelButton,\n saveButton,\n },\n container,\n overlayManager,\n eventBus\n ) {\n this.#dialog = dialog;\n this.#optionDescription = optionDescription;\n this.#optionDecorative = optionDecorative;\n this.#textarea = textarea;\n this.#cancelButton = cancelButton;\n this.#saveButton = saveButton;\n this.#overlayManager = overlayManager;\n this.#eventBus = eventBus;\n this.#container = container;\n\n dialog.addEventListener(\"close\", this.#close.bind(this));\n dialog.addEventListener(\"contextmenu\", event => {\n if (event.target !== this.#textarea) {\n event.preventDefault();\n }\n });\n cancelButton.addEventListener(\"click\", this.#finish.bind(this));\n saveButton.addEventListener(\"click\", this.#save.bind(this));\n optionDescription.addEventListener(\"change\", this.#boundUpdateUIState);\n optionDecorative.addEventListener(\"change\", this.#boundUpdateUIState);\n\n this.#overlayManager.register(dialog);\n }\n\n get _elements() {\n return shadow(this, \"_elements\", [\n this.#optionDescription,\n this.#optionDecorative,\n this.#textarea,\n this.#saveButton,\n this.#cancelButton,\n ]);\n }\n\n #createSVGElement() {\n if (this.#svgElement) {\n return;\n }\n\n // We create a mask to add to the dialog backdrop: the idea is to have a\n // darken background everywhere except on the editor to clearly see the\n // picture to describe.\n\n const svgFactory = new DOMSVGFactory();\n const svg = (this.#svgElement = svgFactory.createElement(\"svg\"));\n svg.setAttribute(\"width\", \"0\");\n svg.setAttribute(\"height\", \"0\");\n const defs = svgFactory.createElement(\"defs\");\n svg.append(defs);\n const mask = svgFactory.createElement(\"mask\");\n defs.append(mask);\n mask.setAttribute(\"id\", \"alttext-manager-mask\");\n mask.setAttribute(\"maskContentUnits\", \"objectBoundingBox\");\n let rect = svgFactory.createElement(\"rect\");\n mask.append(rect);\n rect.setAttribute(\"fill\", \"white\");\n rect.setAttribute(\"width\", \"1\");\n rect.setAttribute(\"height\", \"1\");\n rect.setAttribute(\"x\", \"0\");\n rect.setAttribute(\"y\", \"0\");\n\n rect = this.#rectElement = svgFactory.createElement(\"rect\");\n mask.append(rect);\n rect.setAttribute(\"fill\", \"black\");\n this.#dialog.append(svg);\n }\n\n async editAltText(uiManager, editor) {\n if (this.#currentEditor || !editor) {\n return;\n }\n\n this.#createSVGElement();\n\n this.#hasUsedPointer = false;\n for (const element of this._elements) {\n element.addEventListener(\"click\", this.#boundOnClick);\n }\n\n const { altText, decorative } = editor.altTextData;\n if (decorative === true) {\n this.#optionDecorative.checked = true;\n this.#optionDescription.checked = false;\n } else {\n this.#optionDecorative.checked = false;\n this.#optionDescription.checked = true;\n }\n this.#previousAltText = this.#textarea.value = altText?.trim() || \"\";\n this.#updateUIState();\n\n this.#currentEditor = editor;\n this.#uiManager = uiManager;\n this.#uiManager.removeEditListeners();\n this.#eventBus._on(\"resize\", this.#boundSetPosition);\n\n try {\n await this.#overlayManager.open(this.#dialog);\n this.#setPosition();\n } catch (ex) {\n this.#close();\n throw ex;\n }\n }\n\n #setPosition() {\n if (!this.#currentEditor) {\n return;\n }\n const dialog = this.#dialog;\n const { style } = dialog;\n const {\n x: containerX,\n y: containerY,\n width: containerW,\n height: containerH,\n } = this.#container.getBoundingClientRect();\n const { innerWidth: windowW, innerHeight: windowH } = window;\n const { width: dialogW, height: dialogH } = dialog.getBoundingClientRect();\n const { x, y, width, height } = this.#currentEditor.getClientDimensions();\n const MARGIN = 10;\n const isLTR = this.#uiManager.direction === \"ltr\";\n\n const xs = Math.max(x, containerX);\n const xe = Math.min(x + width, containerX + containerW);\n const ys = Math.max(y, containerY);\n const ye = Math.min(y + height, containerY + containerH);\n this.#rectElement.setAttribute(\"width\", `${(xe - xs) / windowW}`);\n this.#rectElement.setAttribute(\"height\", `${(ye - ys) / windowH}`);\n this.#rectElement.setAttribute(\"x\", `${xs / windowW}`);\n this.#rectElement.setAttribute(\"y\", `${ys / windowH}`);\n\n let left = null;\n let top = Math.max(y, 0);\n top += Math.min(windowH - (top + dialogH), 0);\n\n if (isLTR) {\n // Prefer to position the dialog \"after\" (so on the right) the editor.\n if (x + width + MARGIN + dialogW < windowW) {\n left = x + width + MARGIN;\n } else if (x > dialogW + MARGIN) {\n left = x - dialogW - MARGIN;\n }\n } else if (x > dialogW + MARGIN) {\n left = x - dialogW - MARGIN;\n } else if (x + width + MARGIN + dialogW < windowW) {\n left = x + width + MARGIN;\n }\n\n if (left === null) {\n top = null;\n left = Math.max(x, 0);\n left += Math.min(windowW - (left + dialogW), 0);\n if (y > dialogH + MARGIN) {\n top = y - dialogH - MARGIN;\n } else if (y + height + MARGIN + dialogH < windowH) {\n top = y + height + MARGIN;\n }\n }\n\n if (top !== null) {\n dialog.classList.add(\"positioned\");\n if (isLTR) {\n style.left = `${left}px`;\n } else {\n style.right = `${windowW - left - dialogW}px`;\n }\n style.top = `${top}px`;\n } else {\n dialog.classList.remove(\"positioned\");\n style.left = \"\";\n style.top = \"\";\n }\n }\n\n #finish() {\n if (this.#overlayManager.active === this.#dialog) {\n this.#overlayManager.close(this.#dialog);\n }\n }\n\n #close() {\n this.#eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n subtype: this.#currentEditor.editorType,\n data: this.#telemetryData || {\n action: \"alt_text_cancel\",\n alt_text_keyboard: !this.#hasUsedPointer,\n },\n },\n });\n this.#telemetryData = null;\n\n this.#removeOnClickListeners();\n this.#uiManager?.addEditListeners();\n this.#eventBus._off(\"resize\", this.#boundSetPosition);\n this.#currentEditor = null;\n this.#uiManager = null;\n }\n\n #updateUIState() {\n this.#textarea.disabled = this.#optionDecorative.checked;\n }\n\n #save() {\n const altText = this.#textarea.value.trim();\n const decorative = this.#optionDecorative.checked;\n this.#currentEditor.altTextData = {\n altText,\n decorative,\n };\n this.#telemetryData = {\n action: \"alt_text_save\",\n alt_text_description: !!altText,\n alt_text_edit:\n !!this.#previousAltText && this.#previousAltText !== altText,\n alt_text_decorative: decorative,\n alt_text_keyboard: !this.#hasUsedPointer,\n };\n this.#finish();\n }\n\n #onClick(evt) {\n if (evt.detail === 0) {\n return; // The keyboard was used.\n }\n this.#hasUsedPointer = true;\n this.#removeOnClickListeners();\n }\n\n #removeOnClickListeners() {\n for (const element of this._elements) {\n element.removeEventListener(\"click\", this.#boundOnClick);\n }\n }\n\n destroy() {\n this.#uiManager = null; // Avoid re-adding the edit listeners.\n this.#finish();\n this.#svgElement?.remove();\n this.#svgElement = this.#rectElement = null;\n }\n}\n\nexport { AltTextManager };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationEditorParamsType } from \"pdfjs-lib\";\n\nclass AnnotationEditorParams {\n /**\n * @param {AnnotationEditorParamsOptions} options\n * @param {EventBus} eventBus\n */\n constructor(options, eventBus) {\n this.eventBus = eventBus;\n this.#bindListeners(options);\n }\n\n #bindListeners({\n editorFreeTextFontSize,\n editorFreeTextColor,\n editorInkColor,\n editorInkThickness,\n editorInkOpacity,\n editorStampAddImage,\n }) {\n const dispatchEvent = (typeStr, value) => {\n this.eventBus.dispatch(\"switchannotationeditorparams\", {\n source: this,\n type: AnnotationEditorParamsType[typeStr],\n value,\n });\n };\n editorFreeTextFontSize.addEventListener(\"input\", function () {\n dispatchEvent(\"FREETEXT_SIZE\", this.valueAsNumber);\n });\n editorFreeTextColor.addEventListener(\"input\", function () {\n dispatchEvent(\"FREETEXT_COLOR\", this.value);\n });\n editorInkColor.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_COLOR\", this.value);\n });\n editorInkThickness.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_THICKNESS\", this.valueAsNumber);\n });\n editorInkOpacity.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_OPACITY\", this.valueAsNumber);\n });\n editorStampAddImage.addEventListener(\"click\", () => {\n dispatchEvent(\"CREATE\");\n });\n\n this.eventBus._on(\"annotationeditorparamschanged\", evt => {\n for (const [type, value] of evt.details) {\n switch (type) {\n case AnnotationEditorParamsType.FREETEXT_SIZE:\n editorFreeTextFontSize.value = value;\n break;\n case AnnotationEditorParamsType.FREETEXT_COLOR:\n editorFreeTextColor.value = value;\n break;\n case AnnotationEditorParamsType.INK_COLOR:\n editorInkColor.value = value;\n break;\n case AnnotationEditorParamsType.INK_THICKNESS:\n editorInkThickness.value = value;\n break;\n case AnnotationEditorParamsType.INK_OPACITY:\n editorInkOpacity.value = value;\n break;\n }\n }\n });\n }\n}\n\nexport { AnnotationEditorParams };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass OverlayManager {\n #overlays = new WeakMap();\n\n #active = null;\n\n get active() {\n return this.#active;\n }\n\n /**\n * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n * @param {boolean} [canForceClose] - Indicates if opening the overlay closes\n * an active overlay. The default is `false`.\n * @returns {Promise} A promise that is resolved when the overlay has been\n * registered.\n */\n async register(dialog, canForceClose = false) {\n if (typeof dialog !== \"object\") {\n throw new Error(\"Not enough parameters.\");\n } else if (this.#overlays.has(dialog)) {\n throw new Error(\"The overlay is already registered.\");\n }\n this.#overlays.set(dialog, { canForceClose });\n\n dialog.addEventListener(\"cancel\", evt => {\n this.#active = null;\n });\n }\n\n /**\n * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n * @returns {Promise} A promise that is resolved when the overlay has been\n * opened.\n */\n async open(dialog) {\n if (!this.#overlays.has(dialog)) {\n throw new Error(\"The overlay does not exist.\");\n } else if (this.#active) {\n if (this.#active === dialog) {\n throw new Error(\"The overlay is already active.\");\n } else if (this.#overlays.get(dialog).canForceClose) {\n await this.close();\n } else {\n throw new Error(\"Another overlay is currently active.\");\n }\n }\n this.#active = dialog;\n dialog.showModal();\n }\n\n /**\n * @param {HTMLDialogElement} dialog - The overlay's DOM element.\n * @returns {Promise} A promise that is resolved when the overlay has been\n * closed.\n */\n async close(dialog = this.#active) {\n if (!this.#overlays.has(dialog)) {\n throw new Error(\"The overlay does not exist.\");\n } else if (!this.#active) {\n throw new Error(\"The overlay is currently not active.\");\n } else if (this.#active !== dialog) {\n throw new Error(\"Another overlay is currently active.\");\n }\n dialog.close();\n this.#active = null;\n }\n}\n\nexport { OverlayManager };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { PasswordResponses, PromiseCapability } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} PasswordPromptOptions\n * @property {HTMLDialogElement} dialog - The overlay's DOM element.\n * @property {HTMLParagraphElement} label - Label containing instructions for\n * entering the password.\n * @property {HTMLInputElement} input - Input field for entering the password.\n * @property {HTMLButtonElement} submitButton - Button for submitting the\n * password.\n * @property {HTMLButtonElement} cancelButton - Button for cancelling password\n * entry.\n */\n\nclass PasswordPrompt {\n #activeCapability = null;\n\n #updateCallback = null;\n\n #reason = null;\n\n /**\n * @param {PasswordPromptOptions} options\n * @param {OverlayManager} overlayManager - Manager for the viewer overlays.\n * @param {IL10n} l10n - Localization service.\n * @param {boolean} [isViewerEmbedded] - If the viewer is embedded, in e.g.\n * an <iframe> or an <object>. The default value is `false`.\n */\n constructor(options, overlayManager, l10n, isViewerEmbedded = false) {\n this.dialog = options.dialog;\n this.label = options.label;\n this.input = options.input;\n this.submitButton = options.submitButton;\n this.cancelButton = options.cancelButton;\n this.overlayManager = overlayManager;\n this.l10n = l10n;\n this._isViewerEmbedded = isViewerEmbedded;\n\n // Attach the event listeners.\n this.submitButton.addEventListener(\"click\", this.#verify.bind(this));\n this.cancelButton.addEventListener(\"click\", this.close.bind(this));\n this.input.addEventListener(\"keydown\", e => {\n if (e.keyCode === /* Enter = */ 13) {\n this.#verify();\n }\n });\n\n this.overlayManager.register(this.dialog, /* canForceClose = */ true);\n\n this.dialog.addEventListener(\"close\", this.#cancel.bind(this));\n }\n\n async open() {\n if (this.#activeCapability) {\n await this.#activeCapability.promise;\n }\n this.#activeCapability = new PromiseCapability();\n\n try {\n await this.overlayManager.open(this.dialog);\n } catch (ex) {\n this.#activeCapability.resolve();\n throw ex;\n }\n\n const passwordIncorrect =\n this.#reason === PasswordResponses.INCORRECT_PASSWORD;\n\n if (!this._isViewerEmbedded || passwordIncorrect) {\n this.input.focus();\n }\n this.label.textContent = await this.l10n.get(\n `password_${passwordIncorrect ? \"invalid\" : \"label\"}`\n );\n }\n\n async close() {\n if (this.overlayManager.active === this.dialog) {\n this.overlayManager.close(this.dialog);\n }\n }\n\n #verify() {\n const password = this.input.value;\n if (password?.length > 0) {\n this.#invokeCallback(password);\n }\n }\n\n #cancel() {\n this.#invokeCallback(new Error(\"PasswordPrompt cancelled.\"));\n this.#activeCapability.resolve();\n }\n\n #invokeCallback(password) {\n if (!this.#updateCallback) {\n return; // Ensure that the callback is only invoked once.\n }\n this.close();\n this.input.value = \"\";\n\n this.#updateCallback(password);\n this.#updateCallback = null;\n }\n\n async setUpdateCallback(updateCallback, reason) {\n if (this.#activeCapability) {\n await this.#activeCapability.promise;\n }\n this.#updateCallback = updateCallback;\n this.#reason = reason;\n }\n}\n\nexport { PasswordPrompt };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getFilenameFromUrl, PromiseCapability } from \"pdfjs-lib\";\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\nimport { waitOnEventOrTimeout } from \"./event_utils.js\";\n\n/**\n * @typedef {Object} PDFAttachmentViewerOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {DownloadManager} downloadManager - The download manager.\n */\n\n/**\n * @typedef {Object} PDFAttachmentViewerRenderParameters\n * @property {Object|null} attachments - A lookup table of attachment objects.\n */\n\nclass PDFAttachmentViewer extends BaseTreeViewer {\n /**\n * @param {PDFAttachmentViewerOptions} options\n */\n constructor(options) {\n super(options);\n this.downloadManager = options.downloadManager;\n\n this.eventBus._on(\n \"fileattachmentannotation\",\n this.#appendAttachment.bind(this)\n );\n }\n\n reset(keepRenderedCapability = false) {\n super.reset();\n this._attachments = null;\n\n if (!keepRenderedCapability) {\n // The only situation in which the `_renderedCapability` should *not* be\n // replaced is when appending FileAttachment annotations.\n this._renderedCapability = new PromiseCapability();\n }\n this._pendingDispatchEvent = false;\n }\n\n /**\n * @private\n */\n async _dispatchEvent(attachmentsCount) {\n this._renderedCapability.resolve();\n\n if (attachmentsCount === 0 && !this._pendingDispatchEvent) {\n // Delay the event when no \"regular\" attachments exist, to allow time for\n // parsing of any FileAttachment annotations that may be present on the\n // *initially* rendered page; this reduces the likelihood of temporarily\n // disabling the attachmentsView when the `PDFSidebar` handles the event.\n this._pendingDispatchEvent = true;\n\n await waitOnEventOrTimeout({\n target: this.eventBus,\n name: \"annotationlayerrendered\",\n delay: 1000,\n });\n\n if (!this._pendingDispatchEvent) {\n return; // There was already another `_dispatchEvent`-call`.\n }\n }\n this._pendingDispatchEvent = false;\n\n this.eventBus.dispatch(\"attachmentsloaded\", {\n source: this,\n attachmentsCount,\n });\n }\n\n /**\n * @private\n */\n _bindLink(element, { content, filename }) {\n element.onclick = () => {\n this.downloadManager.openOrDownloadData(element, content, filename);\n return false;\n };\n }\n\n /**\n * @param {PDFAttachmentViewerRenderParameters} params\n */\n render({ attachments, keepRenderedCapability = false }) {\n if (this._attachments) {\n this.reset(keepRenderedCapability);\n }\n this._attachments = attachments || null;\n\n if (!attachments) {\n this._dispatchEvent(/* attachmentsCount = */ 0);\n return;\n }\n\n const fragment = document.createDocumentFragment();\n let attachmentsCount = 0;\n for (const name in attachments) {\n const item = attachments[name];\n const content = item.content,\n filename = getFilenameFromUrl(\n item.filename,\n /* onlyStripPath = */ true\n );\n\n const div = document.createElement(\"div\");\n div.className = \"treeItem\";\n\n const element = document.createElement(\"a\");\n this._bindLink(element, { content, filename });\n element.textContent = this._normalizeTextContent(filename);\n\n div.append(element);\n\n fragment.append(div);\n attachmentsCount++;\n }\n\n this._finishRendering(fragment, attachmentsCount);\n }\n\n /**\n * Used to append FileAttachment annotations to the sidebar.\n */\n #appendAttachment({ filename, content }) {\n const renderedPromise = this._renderedCapability.promise;\n\n renderedPromise.then(() => {\n if (renderedPromise !== this._renderedCapability.promise) {\n return; // The FileAttachment annotation belongs to a previous document.\n }\n const attachments = this._attachments || Object.create(null);\n\n for (const name in attachments) {\n if (filename === name) {\n return; // Ignore the new attachment if it already exists.\n }\n }\n attachments[filename] = {\n filename,\n content,\n };\n this.render({\n attachments,\n keepRenderedCapability: true,\n });\n });\n }\n}\n\nexport { PDFAttachmentViewer };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { removeNullCharacters } from \"./ui_utils.js\";\n\nconst TREEITEM_OFFSET_TOP = -100; // px\nconst TREEITEM_SELECTED_CLASS = \"selected\";\n\nclass BaseTreeViewer {\n constructor(options) {\n if (this.constructor === BaseTreeViewer) {\n throw new Error(\"Cannot initialize BaseTreeViewer.\");\n }\n this.container = options.container;\n this.eventBus = options.eventBus;\n\n this.reset();\n }\n\n reset() {\n this._pdfDocument = null;\n this._lastToggleIsShow = true;\n this._currentTreeItem = null;\n\n // Remove the tree from the DOM.\n this.container.textContent = \"\";\n // Ensure that the left (right in RTL locales) margin is always reset,\n // to prevent incorrect tree alignment if a new document is opened.\n this.container.classList.remove(\"treeWithDeepNesting\");\n }\n\n /**\n * @private\n */\n _dispatchEvent(count) {\n throw new Error(\"Not implemented: _dispatchEvent\");\n }\n\n /**\n * @private\n */\n _bindLink(element, params) {\n throw new Error(\"Not implemented: _bindLink\");\n }\n\n /**\n * @private\n */\n _normalizeTextContent(str) {\n // Chars in range [0x01-0x1F] will be replaced with a white space\n // and 0x00 by \"\".\n return (\n removeNullCharacters(str, /* replaceInvisible */ true) ||\n /* en dash = */ \"\\u2013\"\n );\n }\n\n /**\n * Prepend a button before a tree item which allows the user to collapse or\n * expand all tree items at that level; see `_toggleTreeItem`.\n * @private\n */\n _addToggleButton(div, hidden = false) {\n const toggler = document.createElement(\"div\");\n toggler.className = \"treeItemToggler\";\n if (hidden) {\n toggler.classList.add(\"treeItemsHidden\");\n }\n toggler.onclick = evt => {\n evt.stopPropagation();\n toggler.classList.toggle(\"treeItemsHidden\");\n\n if (evt.shiftKey) {\n const shouldShowAll = !toggler.classList.contains(\"treeItemsHidden\");\n this._toggleTreeItem(div, shouldShowAll);\n }\n };\n div.prepend(toggler);\n }\n\n /**\n * Collapse or expand the subtree of a tree item.\n *\n * @param {Element} root - the root of the item (sub)tree.\n * @param {boolean} show - whether to show the item (sub)tree. If false,\n * the item subtree rooted at `root` will be collapsed.\n * @private\n */\n _toggleTreeItem(root, show = false) {\n this._lastToggleIsShow = show;\n for (const toggler of root.querySelectorAll(\".treeItemToggler\")) {\n toggler.classList.toggle(\"treeItemsHidden\", !show);\n }\n }\n\n /**\n * Collapse or expand all subtrees of the `container`.\n * @private\n */\n _toggleAllTreeItems() {\n this._toggleTreeItem(this.container, !this._lastToggleIsShow);\n }\n\n /**\n * @private\n */\n _finishRendering(fragment, count, hasAnyNesting = false) {\n if (hasAnyNesting) {\n this.container.classList.add(\"treeWithDeepNesting\");\n\n this._lastToggleIsShow = !fragment.querySelector(\".treeItemsHidden\");\n }\n this.container.append(fragment);\n\n this._dispatchEvent(count);\n }\n\n render(params) {\n throw new Error(\"Not implemented: render\");\n }\n\n /**\n * @private\n */\n _updateCurrentTreeItem(treeItem = null) {\n if (this._currentTreeItem) {\n // Ensure that the current treeItem-selection is always removed.\n this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS);\n this._currentTreeItem = null;\n }\n if (treeItem) {\n treeItem.classList.add(TREEITEM_SELECTED_CLASS);\n this._currentTreeItem = treeItem;\n }\n }\n\n /**\n * @private\n */\n _scrollToCurrentTreeItem(treeItem) {\n if (!treeItem) {\n return;\n }\n // Ensure that the treeItem is *fully* expanded, such that it will first of\n // all be visible and secondly that scrolling it into view works correctly.\n let currentNode = treeItem.parentNode;\n while (currentNode && currentNode !== this.container) {\n if (currentNode.classList.contains(\"treeItem\")) {\n const toggler = currentNode.firstElementChild;\n toggler?.classList.remove(\"treeItemsHidden\");\n }\n currentNode = currentNode.parentNode;\n }\n this._updateCurrentTreeItem(treeItem);\n\n this.container.scrollTo(\n treeItem.offsetLeft,\n treeItem.offsetTop + TREEITEM_OFFSET_TOP\n );\n }\n}\n\nexport { BaseTreeViewer };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationEditorType, shadow } from \"pdfjs-lib\";\nimport { CursorTool, PresentationModeState } from \"./ui_utils.js\";\nimport { GrabToPan } from \"./grab_to_pan.js\";\n\n/**\n * @typedef {Object} PDFCursorToolsOptions\n * @property {HTMLDivElement} container - The document container.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} [cursorToolOnLoad] - The cursor tool that will be enabled\n * on load; the constants from {CursorTool} should be used. The default value\n * is `CursorTool.SELECT`.\n */\n\nclass PDFCursorTools {\n #active = CursorTool.SELECT;\n\n #prevActive = null;\n\n /**\n * @param {PDFCursorToolsOptions} options\n */\n constructor({ container, eventBus, cursorToolOnLoad = CursorTool.SELECT }) {\n this.container = container;\n this.eventBus = eventBus;\n\n this.#addEventListeners();\n\n // Defer the initial `switchTool` call, to give other viewer components\n // time to initialize *and* register 'cursortoolchanged' event listeners.\n Promise.resolve().then(() => {\n this.switchTool(cursorToolOnLoad);\n });\n }\n\n /**\n * @type {number} One of the values in {CursorTool}.\n */\n get activeTool() {\n return this.#active;\n }\n\n /**\n * @param {number} tool - The cursor mode that should be switched to,\n * must be one of the values in {CursorTool}.\n */\n switchTool(tool) {\n if (this.#prevActive !== null) {\n // Cursor tools cannot be used in PresentationMode/AnnotationEditor.\n return;\n }\n if (tool === this.#active) {\n return; // The requested tool is already active.\n }\n\n const disableActiveTool = () => {\n switch (this.#active) {\n case CursorTool.SELECT:\n break;\n case CursorTool.HAND:\n this._handTool.deactivate();\n break;\n case CursorTool.ZOOM:\n /* falls through */\n }\n };\n\n // Enable the new cursor tool.\n switch (tool) {\n case CursorTool.SELECT:\n disableActiveTool();\n break;\n case CursorTool.HAND:\n disableActiveTool();\n this._handTool.activate();\n break;\n case CursorTool.ZOOM:\n /* falls through */\n default:\n console.error(`switchTool: \"${tool}\" is an unsupported value.`);\n return;\n }\n // Update the active tool *after* it has been validated above,\n // in order to prevent setting it to an invalid state.\n this.#active = tool;\n\n this.eventBus.dispatch(\"cursortoolchanged\", {\n source: this,\n tool,\n });\n }\n\n #addEventListeners() {\n this.eventBus._on(\"switchcursortool\", evt => {\n this.switchTool(evt.tool);\n });\n\n let annotationEditorMode = AnnotationEditorType.NONE,\n presentationModeState = PresentationModeState.NORMAL;\n\n const disableActive = () => {\n const prevActive = this.#active;\n\n this.switchTool(CursorTool.SELECT);\n this.#prevActive ??= prevActive; // Keep track of the first one.\n };\n const enableActive = () => {\n const prevActive = this.#prevActive;\n\n if (\n prevActive !== null &&\n annotationEditorMode === AnnotationEditorType.NONE &&\n presentationModeState === PresentationModeState.NORMAL\n ) {\n this.#prevActive = null;\n this.switchTool(prevActive);\n }\n };\n\n this.eventBus._on(\"secondarytoolbarreset\", evt => {\n if (this.#prevActive !== null) {\n annotationEditorMode = AnnotationEditorType.NONE;\n presentationModeState = PresentationModeState.NORMAL;\n\n enableActive();\n }\n });\n\n this.eventBus._on(\"annotationeditormodechanged\", ({ mode }) => {\n annotationEditorMode = mode;\n\n if (mode === AnnotationEditorType.NONE) {\n enableActive();\n } else {\n disableActive();\n }\n });\n\n this.eventBus._on(\"presentationmodechanged\", ({ state }) => {\n presentationModeState = state;\n\n if (state === PresentationModeState.NORMAL) {\n enableActive();\n } else if (state === PresentationModeState.FULLSCREEN) {\n disableActive();\n }\n });\n }\n\n /**\n * @private\n */\n get _handTool() {\n return shadow(\n this,\n \"_handTool\",\n new GrabToPan({\n element: this.container,\n })\n );\n }\n}\n\nexport { PDFCursorTools };\n","/* Copyright 2013 Rob Wu <rob@robwu.nl>\n * https://github.com/Rob--W/grab-to-pan.js\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Class name of element which can be grabbed.\nconst CSS_CLASS_GRAB = \"grab-to-pan-grab\";\n\nclass GrabToPan {\n /**\n * Construct a GrabToPan instance for a given HTML element.\n * @param {Element} options.element\n */\n constructor({ element }) {\n this.element = element;\n this.document = element.ownerDocument;\n\n // Bind the contexts to ensure that `this` always points to\n // the GrabToPan instance.\n this.activate = this.activate.bind(this);\n this.deactivate = this.deactivate.bind(this);\n this.toggle = this.toggle.bind(this);\n this._onMouseDown = this.#onMouseDown.bind(this);\n this._onMouseMove = this.#onMouseMove.bind(this);\n this._endPan = this.#endPan.bind(this);\n\n // This overlay will be inserted in the document when the mouse moves during\n // a grab operation, to ensure that the cursor has the desired appearance.\n const overlay = (this.overlay = document.createElement(\"div\"));\n overlay.className = \"grab-to-pan-grabbing\";\n }\n\n /**\n * Bind a mousedown event to the element to enable grab-detection.\n */\n activate() {\n if (!this.active) {\n this.active = true;\n this.element.addEventListener(\"mousedown\", this._onMouseDown, true);\n this.element.classList.add(CSS_CLASS_GRAB);\n }\n }\n\n /**\n * Removes all events. Any pending pan session is immediately stopped.\n */\n deactivate() {\n if (this.active) {\n this.active = false;\n this.element.removeEventListener(\"mousedown\", this._onMouseDown, true);\n this._endPan();\n this.element.classList.remove(CSS_CLASS_GRAB);\n }\n }\n\n toggle() {\n if (this.active) {\n this.deactivate();\n } else {\n this.activate();\n }\n }\n\n /**\n * Whether to not pan if the target element is clicked.\n * Override this method to change the default behaviour.\n *\n * @param {Element} node - The target of the event.\n * @returns {boolean} Whether to not react to the click event.\n */\n ignoreTarget(node) {\n // Check whether the clicked element is, a child of, an input element/link.\n return node.matches(\n \"a[href], a[href] *, input, textarea, button, button *, select, option\"\n );\n }\n\n #onMouseDown(event) {\n if (event.button !== 0 || this.ignoreTarget(event.target)) {\n return;\n }\n if (event.originalTarget) {\n try {\n // eslint-disable-next-line no-unused-expressions\n event.originalTarget.tagName;\n } catch {\n // Mozilla-specific: element is a scrollbar (XUL element)\n return;\n }\n }\n\n this.scrollLeftStart = this.element.scrollLeft;\n this.scrollTopStart = this.element.scrollTop;\n this.clientXStart = event.clientX;\n this.clientYStart = event.clientY;\n this.document.addEventListener(\"mousemove\", this._onMouseMove, true);\n this.document.addEventListener(\"mouseup\", this._endPan, true);\n // When a scroll event occurs before a mousemove, assume that the user\n // dragged a scrollbar (necessary for Opera Presto, Safari and IE)\n // (not needed for Chrome/Firefox)\n this.element.addEventListener(\"scroll\", this._endPan, true);\n event.preventDefault();\n event.stopPropagation();\n\n const focusedElement = document.activeElement;\n if (focusedElement && !focusedElement.contains(event.target)) {\n focusedElement.blur();\n }\n }\n\n #onMouseMove(event) {\n this.element.removeEventListener(\"scroll\", this._endPan, true);\n if (!(event.buttons & 1)) {\n // The left mouse button is released.\n this._endPan();\n return;\n }\n const xDiff = event.clientX - this.clientXStart;\n const yDiff = event.clientY - this.clientYStart;\n this.element.scrollTo({\n top: this.scrollTopStart - yDiff,\n left: this.scrollLeftStart - xDiff,\n behavior: \"instant\",\n });\n\n if (!this.overlay.parentNode) {\n document.body.append(this.overlay);\n }\n }\n\n #endPan() {\n this.element.removeEventListener(\"scroll\", this._endPan, true);\n this.document.removeEventListener(\"mousemove\", this._onMouseMove, true);\n this.document.removeEventListener(\"mouseup\", this._endPan, true);\n // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n this.overlay.remove();\n }\n}\n\nexport { GrabToPan };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getPageSizeInches, isPortraitOrientation } from \"./ui_utils.js\";\nimport { PDFDateString, PromiseCapability } from \"pdfjs-lib\";\n\nconst DEFAULT_FIELD_CONTENT = \"-\";\n\n// See https://en.wikibooks.org/wiki/Lentis/Conversion_to_the_Metric_Standard_in_the_United_States\nconst NON_METRIC_LOCALES = [\"en-us\", \"en-lr\", \"my\"];\n\n// Should use the format: `width x height`, in portrait orientation.\n// See https://en.wikipedia.org/wiki/Paper_size\nconst US_PAGE_NAMES = {\n \"8.5x11\": \"Letter\",\n \"8.5x14\": \"Legal\",\n};\nconst METRIC_PAGE_NAMES = {\n \"297x420\": \"A3\",\n \"210x297\": \"A4\",\n};\n\nfunction getPageName(size, isPortrait, pageNames) {\n const width = isPortrait ? size.width : size.height;\n const height = isPortrait ? size.height : size.width;\n\n return pageNames[`${width}x${height}`];\n}\n\n/**\n * @typedef {Object} PDFDocumentPropertiesOptions\n * @property {HTMLDialogElement} dialog - The overlay's DOM element.\n * @property {Object} fields - Names and elements of the overlay's fields.\n * @property {HTMLButtonElement} closeButton - Button for closing the overlay.\n */\n\nclass PDFDocumentProperties {\n #fieldData = null;\n\n /**\n * @param {PDFDocumentPropertiesOptions} options\n * @param {OverlayManager} overlayManager - Manager for the viewer overlays.\n * @param {EventBus} eventBus - The application event bus.\n * @param {IL10n} l10n - Localization service.\n * @param {function} fileNameLookup - The function that is used to lookup\n * the document fileName.\n */\n constructor(\n { dialog, fields, closeButton },\n overlayManager,\n eventBus,\n l10n,\n fileNameLookup\n ) {\n this.dialog = dialog;\n this.fields = fields;\n this.overlayManager = overlayManager;\n this.l10n = l10n;\n this._fileNameLookup = fileNameLookup;\n\n this.#reset();\n // Bind the event listener for the Close button.\n closeButton.addEventListener(\"click\", this.close.bind(this));\n\n this.overlayManager.register(this.dialog);\n\n eventBus._on(\"pagechanging\", evt => {\n this._currentPageNumber = evt.pageNumber;\n });\n eventBus._on(\"rotationchanging\", evt => {\n this._pagesRotation = evt.pagesRotation;\n });\n\n this._isNonMetricLocale = true; // The default viewer locale is 'en-us'.\n l10n.getLanguage().then(locale => {\n this._isNonMetricLocale = NON_METRIC_LOCALES.includes(locale);\n });\n }\n\n /**\n * Open the document properties overlay.\n */\n async open() {\n await Promise.all([\n this.overlayManager.open(this.dialog),\n this._dataAvailableCapability.promise,\n ]);\n const currentPageNumber = this._currentPageNumber;\n const pagesRotation = this._pagesRotation;\n\n // If the document properties were previously fetched (for this PDF file),\n // just update the dialog immediately to avoid redundant lookups.\n if (\n this.#fieldData &&\n currentPageNumber === this.#fieldData._currentPageNumber &&\n pagesRotation === this.#fieldData._pagesRotation\n ) {\n this.#updateUI();\n return;\n }\n\n // Get the document properties.\n const {\n info,\n /* metadata, */\n /* contentDispositionFilename, */\n contentLength,\n } = await this.pdfDocument.getMetadata();\n\n const [\n fileName,\n fileSize,\n creationDate,\n modificationDate,\n pageSize,\n isLinearized,\n ] = await Promise.all([\n this._fileNameLookup(),\n this.#parseFileSize(contentLength),\n this.#parseDate(info.CreationDate),\n this.#parseDate(info.ModDate),\n this.pdfDocument.getPage(currentPageNumber).then(pdfPage => {\n return this.#parsePageSize(getPageSizeInches(pdfPage), pagesRotation);\n }),\n this.#parseLinearization(info.IsLinearized),\n ]);\n\n this.#fieldData = Object.freeze({\n fileName,\n fileSize,\n title: info.Title,\n author: info.Author,\n subject: info.Subject,\n keywords: info.Keywords,\n creationDate,\n modificationDate,\n creator: info.Creator,\n producer: info.Producer,\n version: info.PDFFormatVersion,\n pageCount: this.pdfDocument.numPages,\n pageSize,\n linearized: isLinearized,\n _currentPageNumber: currentPageNumber,\n _pagesRotation: pagesRotation,\n });\n this.#updateUI();\n\n // Get the correct fileSize, since it may not have been available\n // or could potentially be wrong.\n const { length } = await this.pdfDocument.getDownloadInfo();\n if (contentLength === length) {\n return; // The fileSize has already been correctly set.\n }\n const data = Object.assign(Object.create(null), this.#fieldData);\n data.fileSize = await this.#parseFileSize(length);\n\n this.#fieldData = Object.freeze(data);\n this.#updateUI();\n }\n\n /**\n * Close the document properties overlay.\n */\n async close() {\n this.overlayManager.close(this.dialog);\n }\n\n /**\n * Set a reference to the PDF document in order to populate the dialog fields\n * with the document properties. Note that the dialog will contain no\n * information if this method is not called.\n *\n * @param {PDFDocumentProxy} pdfDocument - A reference to the PDF document.\n */\n setDocument(pdfDocument) {\n if (this.pdfDocument) {\n this.#reset();\n this.#updateUI(true);\n }\n if (!pdfDocument) {\n return;\n }\n this.pdfDocument = pdfDocument;\n\n this._dataAvailableCapability.resolve();\n }\n\n #reset() {\n this.pdfDocument = null;\n\n this.#fieldData = null;\n this._dataAvailableCapability = new PromiseCapability();\n this._currentPageNumber = 1;\n this._pagesRotation = 0;\n }\n\n /**\n * Always updates all of the dialog fields, to prevent inconsistent UI state.\n * NOTE: If the contents of a particular field is neither a non-empty string,\n * nor a number, it will fall back to `DEFAULT_FIELD_CONTENT`.\n */\n #updateUI(reset = false) {\n if (reset || !this.#fieldData) {\n for (const id in this.fields) {\n this.fields[id].textContent = DEFAULT_FIELD_CONTENT;\n }\n return;\n }\n if (this.overlayManager.active !== this.dialog) {\n // Don't bother updating the dialog if has already been closed,\n // since it will be updated the next time `this.open` is called.\n return;\n }\n for (const id in this.fields) {\n const content = this.#fieldData[id];\n this.fields[id].textContent =\n content || content === 0 ? content : DEFAULT_FIELD_CONTENT;\n }\n }\n\n async #parseFileSize(fileSize = 0) {\n const kb = fileSize / 1024,\n mb = kb / 1024;\n if (!kb) {\n return undefined;\n }\n return this.l10n.get(`document_properties_${mb >= 1 ? \"mb\" : \"kb\"}`, {\n size_mb: mb >= 1 && (+mb.toPrecision(3)).toLocaleString(),\n size_kb: mb < 1 && (+kb.toPrecision(3)).toLocaleString(),\n size_b: fileSize.toLocaleString(),\n });\n }\n\n async #parsePageSize(pageSizeInches, pagesRotation) {\n if (!pageSizeInches) {\n return undefined;\n }\n // Take the viewer rotation into account as well; compare with Adobe Reader.\n if (pagesRotation % 180 !== 0) {\n pageSizeInches = {\n width: pageSizeInches.height,\n height: pageSizeInches.width,\n };\n }\n const isPortrait = isPortraitOrientation(pageSizeInches);\n\n let sizeInches = {\n width: Math.round(pageSizeInches.width * 100) / 100,\n height: Math.round(pageSizeInches.height * 100) / 100,\n };\n // 1in == 25.4mm; no need to round to 2 decimals for millimeters.\n let sizeMillimeters = {\n width: Math.round(pageSizeInches.width * 25.4 * 10) / 10,\n height: Math.round(pageSizeInches.height * 25.4 * 10) / 10,\n };\n\n let rawName =\n getPageName(sizeInches, isPortrait, US_PAGE_NAMES) ||\n getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES);\n\n if (\n !rawName &&\n !(\n Number.isInteger(sizeMillimeters.width) &&\n Number.isInteger(sizeMillimeters.height)\n )\n ) {\n // Attempt to improve the page name detection by falling back to fuzzy\n // matching of the metric dimensions, to account for e.g. rounding errors\n // and/or PDF files that define the page sizes in an imprecise manner.\n const exactMillimeters = {\n width: pageSizeInches.width * 25.4,\n height: pageSizeInches.height * 25.4,\n };\n const intMillimeters = {\n width: Math.round(sizeMillimeters.width),\n height: Math.round(sizeMillimeters.height),\n };\n\n // Try to avoid false positives, by only considering \"small\" differences.\n if (\n Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 &&\n Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1\n ) {\n rawName = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);\n if (rawName) {\n // Update *both* sizes, computed above, to ensure that the displayed\n // dimensions always correspond to the detected page name.\n sizeInches = {\n width: Math.round((intMillimeters.width / 25.4) * 100) / 100,\n height: Math.round((intMillimeters.height / 25.4) * 100) / 100,\n };\n sizeMillimeters = intMillimeters;\n }\n }\n }\n\n const [{ width, height }, unit, name, orientation] = await Promise.all([\n this._isNonMetricLocale ? sizeInches : sizeMillimeters,\n this.l10n.get(\n `document_properties_page_size_unit_${\n this._isNonMetricLocale ? \"inches\" : \"millimeters\"\n }`\n ),\n rawName &&\n this.l10n.get(\n `document_properties_page_size_name_${rawName.toLowerCase()}`\n ),\n this.l10n.get(\n `document_properties_page_size_orientation_${\n isPortrait ? \"portrait\" : \"landscape\"\n }`\n ),\n ]);\n\n return this.l10n.get(\n `document_properties_page_size_dimension_${name ? \"name_\" : \"\"}string`,\n {\n width: width.toLocaleString(),\n height: height.toLocaleString(),\n unit,\n name,\n orientation,\n }\n );\n }\n\n async #parseDate(inputDate) {\n const dateObject = PDFDateString.toDateObject(inputDate);\n if (!dateObject) {\n return undefined;\n }\n return this.l10n.get(\"document_properties_date_string\", {\n date: dateObject.toLocaleDateString(),\n time: dateObject.toLocaleTimeString(),\n });\n }\n\n #parseLinearization(isLinearized) {\n return this.l10n.get(\n `document_properties_linearized_${isLinearized ? \"yes\" : \"no\"}`\n );\n }\n}\n\nexport { PDFDocumentProperties };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FindState } from \"./pdf_find_controller.js\";\nimport { toggleExpandedBtn } from \"./ui_utils.js\";\n\nconst MATCHES_COUNT_LIMIT = 1000;\n\n/**\n * Creates a \"search bar\" given a set of DOM elements that act as controls\n * for searching or for setting search preferences in the UI. This object\n * also sets up the appropriate events for the controls. Actual searching\n * is done by PDFFindController.\n */\nclass PDFFindBar {\n constructor(options, eventBus, l10n) {\n this.opened = false;\n\n this.bar = options.bar;\n this.toggleButton = options.toggleButton;\n this.findField = options.findField;\n this.highlightAll = options.highlightAllCheckbox;\n this.caseSensitive = options.caseSensitiveCheckbox;\n this.matchDiacritics = options.matchDiacriticsCheckbox;\n this.entireWord = options.entireWordCheckbox;\n this.findMsg = options.findMsg;\n this.findResultsCount = options.findResultsCount;\n this.findPreviousButton = options.findPreviousButton;\n this.findNextButton = options.findNextButton;\n this.eventBus = eventBus;\n this.l10n = l10n;\n\n // Add event listeners to the DOM elements.\n this.toggleButton.addEventListener(\"click\", () => {\n this.toggle();\n });\n\n this.findField.addEventListener(\"input\", () => {\n this.dispatchEvent(\"\");\n });\n\n this.bar.addEventListener(\"keydown\", e => {\n switch (e.keyCode) {\n case 13: // Enter\n if (e.target === this.findField) {\n this.dispatchEvent(\"again\", e.shiftKey);\n }\n break;\n case 27: // Escape\n this.close();\n break;\n }\n });\n\n this.findPreviousButton.addEventListener(\"click\", () => {\n this.dispatchEvent(\"again\", true);\n });\n\n this.findNextButton.addEventListener(\"click\", () => {\n this.dispatchEvent(\"again\", false);\n });\n\n this.highlightAll.addEventListener(\"click\", () => {\n this.dispatchEvent(\"highlightallchange\");\n });\n\n this.caseSensitive.addEventListener(\"click\", () => {\n this.dispatchEvent(\"casesensitivitychange\");\n });\n\n this.entireWord.addEventListener(\"click\", () => {\n this.dispatchEvent(\"entirewordchange\");\n });\n\n this.matchDiacritics.addEventListener(\"click\", () => {\n this.dispatchEvent(\"diacriticmatchingchange\");\n });\n\n this.eventBus._on(\"resize\", this.#adjustWidth.bind(this));\n }\n\n reset() {\n this.updateUIState();\n }\n\n dispatchEvent(type, findPrev = false) {\n this.eventBus.dispatch(\"find\", {\n source: this,\n type,\n query: this.findField.value,\n caseSensitive: this.caseSensitive.checked,\n entireWord: this.entireWord.checked,\n highlightAll: this.highlightAll.checked,\n findPrevious: findPrev,\n matchDiacritics: this.matchDiacritics.checked,\n });\n }\n\n updateUIState(state, previous, matchesCount) {\n let findMsg = Promise.resolve(\"\");\n let status = \"\";\n\n switch (state) {\n case FindState.FOUND:\n break;\n case FindState.PENDING:\n status = \"pending\";\n break;\n case FindState.NOT_FOUND:\n findMsg = this.l10n.get(\"find_not_found\");\n status = \"notFound\";\n break;\n case FindState.WRAPPED:\n findMsg = this.l10n.get(`find_reached_${previous ? \"top\" : \"bottom\"}`);\n break;\n }\n this.findField.setAttribute(\"data-status\", status);\n this.findField.setAttribute(\"aria-invalid\", state === FindState.NOT_FOUND);\n\n findMsg.then(msg => {\n this.findMsg.setAttribute(\"data-status\", status);\n this.findMsg.textContent = msg;\n this.#adjustWidth();\n });\n\n this.updateResultsCount(matchesCount);\n }\n\n updateResultsCount({ current = 0, total = 0 } = {}) {\n const limit = MATCHES_COUNT_LIMIT;\n let matchCountMsg = Promise.resolve(\"\");\n\n if (total > 0) {\n if (total > limit) {\n let key = \"find_match_count_limit\";\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n // TODO: Remove this hard-coded `[other]` form once plural support has\n // been implemented in the mozilla-central specific `l10n.js` file.\n key += \"[other]\";\n }\n matchCountMsg = this.l10n.get(key, { limit });\n } else {\n let key = \"find_match_count\";\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n // TODO: Remove this hard-coded `[other]` form once plural support has\n // been implemented in the mozilla-central specific `l10n.js` file.\n key += \"[other]\";\n }\n matchCountMsg = this.l10n.get(key, { current, total });\n }\n }\n matchCountMsg.then(msg => {\n this.findResultsCount.textContent = msg;\n // Since `updateResultsCount` may be called from `PDFFindController`,\n // ensure that the width of the findbar is always updated correctly.\n this.#adjustWidth();\n });\n }\n\n open() {\n if (!this.opened) {\n this.opened = true;\n toggleExpandedBtn(this.toggleButton, true, this.bar);\n }\n this.findField.select();\n this.findField.focus();\n\n this.#adjustWidth();\n }\n\n close() {\n if (!this.opened) {\n return;\n }\n this.opened = false;\n toggleExpandedBtn(this.toggleButton, false, this.bar);\n\n this.eventBus.dispatch(\"findbarclose\", { source: this });\n }\n\n toggle() {\n if (this.opened) {\n this.close();\n } else {\n this.open();\n }\n }\n\n #adjustWidth() {\n if (!this.opened) {\n return;\n }\n\n // The find bar has an absolute position and thus the browser extends\n // its width to the maximum possible width once the find bar does not fit\n // entirely within the window anymore (and its elements are automatically\n // wrapped). Here we detect and fix that.\n this.bar.classList.remove(\"wrapContainers\");\n\n const findbarHeight = this.bar.clientHeight;\n const inputContainerHeight = this.bar.firstElementChild.clientHeight;\n\n if (findbarHeight > inputContainerHeight) {\n // The findbar is taller than the input container, which means that\n // the browser wrapped some of the elements. For a consistent look,\n // wrap all of them to adjust the width of the find bar.\n this.bar.classList.add(\"wrapContainers\");\n }\n }\n}\n\nexport { PDFFindBar };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { binarySearchFirstItem, scrollIntoView } from \"./ui_utils.js\";\nimport { getCharacterType, getNormalizeWithNFKC } from \"./pdf_find_utils.js\";\nimport { PromiseCapability } from \"pdfjs-lib\";\n\nconst FindState = {\n FOUND: 0,\n NOT_FOUND: 1,\n WRAPPED: 2,\n PENDING: 3,\n};\n\nconst FIND_TIMEOUT = 250; // ms\nconst MATCH_SCROLL_OFFSET_TOP = -50; // px\nconst MATCH_SCROLL_OFFSET_LEFT = -400; // px\n\nconst CHARACTERS_TO_NORMALIZE = {\n \"\\u2010\": \"-\", // Hyphen\n \"\\u2018\": \"'\", // Left single quotation mark\n \"\\u2019\": \"'\", // Right single quotation mark\n \"\\u201A\": \"'\", // Single low-9 quotation mark\n \"\\u201B\": \"'\", // Single high-reversed-9 quotation mark\n \"\\u201C\": '\"', // Left double quotation mark\n \"\\u201D\": '\"', // Right double quotation mark\n \"\\u201E\": '\"', // Double low-9 quotation mark\n \"\\u201F\": '\"', // Double high-reversed-9 quotation mark\n \"\\u00BC\": \"1/4\", // Vulgar fraction one quarter\n \"\\u00BD\": \"1/2\", // Vulgar fraction one half\n \"\\u00BE\": \"3/4\", // Vulgar fraction three quarters\n};\n\n// These diacritics aren't considered as combining diacritics\n// when searching in a document:\n// https://searchfox.org/mozilla-central/source/intl/unicharutil/util/is_combining_diacritic.py.\n// The combining class definitions can be found:\n// https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values\n// Category 0 corresponds to [^\\p{Mn}].\nconst DIACRITICS_EXCEPTION = new Set([\n // UNICODE_COMBINING_CLASS_KANA_VOICING\n // https://www.compart.com/fr/unicode/combining/8\n 0x3099, 0x309a,\n // UNICODE_COMBINING_CLASS_VIRAMA (under 0xFFFF)\n // https://www.compart.com/fr/unicode/combining/9\n 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b,\n 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714,\n 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f,\n 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed,\n // 91\n // https://www.compart.com/fr/unicode/combining/91\n 0x0c56,\n // 129\n // https://www.compart.com/fr/unicode/combining/129\n 0x0f71,\n // 130\n // https://www.compart.com/fr/unicode/combining/130\n 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80,\n // 132\n // https://www.compart.com/fr/unicode/combining/132\n 0x0f74,\n]);\nlet DIACRITICS_EXCEPTION_STR; // Lazily initialized, see below.\n\nconst DIACRITICS_REG_EXP = /\\p{M}+/gu;\nconst SPECIAL_CHARS_REG_EXP =\n /([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})/gu;\nconst NOT_DIACRITIC_FROM_END_REG_EXP = /([^\\p{M}])\\p{M}*$/u;\nconst NOT_DIACRITIC_FROM_START_REG_EXP = /^\\p{M}*([^\\p{M}])/u;\n\n// The range [AC00-D7AF] corresponds to the Hangul syllables.\n// The few other chars are some CJK Compatibility Ideographs.\nconst SYLLABLES_REG_EXP = /[\\uAC00-\\uD7AF\\uFA6C\\uFACF-\\uFAD1\\uFAD5-\\uFAD7]+/g;\nconst SYLLABLES_LENGTHS = new Map();\n// When decomposed (in using NFD) the above syllables will start\n// with one of the chars in this regexp.\nconst FIRST_CHAR_SYLLABLES_REG_EXP =\n \"[\\\\u1100-\\\\u1112\\\\ud7a4-\\\\ud7af\\\\ud84a\\\\ud84c\\\\ud850\\\\ud854\\\\ud857\\\\ud85f]\";\n\nconst NFKC_CHARS_TO_NORMALIZE = new Map();\n\nlet noSyllablesRegExp = null;\nlet withSyllablesRegExp = null;\n\nfunction normalize(text) {\n // The diacritics in the text or in the query can be composed or not.\n // So we use a decomposed text using NFD (and the same for the query)\n // in order to be sure that diacritics are in the same order.\n\n // Collect syllables length and positions.\n const syllablePositions = [];\n let m;\n while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {\n let { index } = m;\n for (const char of m[0]) {\n let len = SYLLABLES_LENGTHS.get(char);\n if (!len) {\n len = char.normalize(\"NFD\").length;\n SYLLABLES_LENGTHS.set(char, len);\n }\n syllablePositions.push([len, index++]);\n }\n }\n\n let normalizationRegex;\n if (syllablePositions.length === 0 && noSyllablesRegExp) {\n normalizationRegex = noSyllablesRegExp;\n } else if (syllablePositions.length > 0 && withSyllablesRegExp) {\n normalizationRegex = withSyllablesRegExp;\n } else {\n // Compile the regular expression for text normalization once.\n const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(\"\");\n const toNormalizeWithNFKC = getNormalizeWithNFKC();\n\n // 3040-309F: Hiragana\n // 30A0-30FF: Katakana\n const CJK = \"(?:\\\\p{Ideographic}|[\\u3040-\\u30FF])\";\n const HKDiacritics = \"(?:\\u3099|\\u309A)\";\n const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\\\n)|(\\\\p{M}+(?:-\\\\n)?)|(\\\\S-\\\\n)|(${CJK}\\\\n)|(\\\\n)`;\n\n if (syllablePositions.length === 0) {\n // Most of the syllables belong to Hangul so there are no need\n // to search for them in a non-Hangul document.\n // We use the \\0 in order to have the same number of groups.\n normalizationRegex = noSyllablesRegExp = new RegExp(\n regexp + \"|(\\\\u0000)\",\n \"gum\"\n );\n } else {\n normalizationRegex = withSyllablesRegExp = new RegExp(\n regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`,\n \"gum\"\n );\n }\n }\n\n // The goal of this function is to normalize the string and\n // be able to get from an index in the new string the\n // corresponding index in the old string.\n // For example if we have: abCd12ef456gh where C is replaced by ccc\n // and numbers replaced by nothing (it's the case for diacritics), then\n // we'll obtain the normalized string: abcccdefgh.\n // So here the reverse map is: [0,1,2,2,2,3,6,7,11,12].\n\n // The goal is to obtain the array: [[0, 0], [3, -1], [4, -2],\n // [6, 0], [8, 3]].\n // which can be used like this:\n // - let say that i is the index in new string and j the index\n // the old string.\n // - if i is in [0; 3[ then j = i + 0\n // - if i is in [3; 4[ then j = i - 1\n // - if i is in [4; 6[ then j = i - 2\n // ...\n // Thanks to a binary search it's easy to know where is i and what's the\n // shift.\n // Let say that the last entry in the array is [x, s] and we have a\n // substitution at index y (old string) which will replace o chars by n chars.\n // Firstly, if o === n, then no need to add a new entry: the shift is\n // the same.\n // Secondly, if o < n, then we push the n - o elements:\n // [y - (s - 1), s - 1], [y - (s - 2), s - 2], ...\n // Thirdly, if o > n, then we push the element: [y - (s - n), o + s - n]\n\n // Collect diacritics length and positions.\n const rawDiacriticsPositions = [];\n while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {\n rawDiacriticsPositions.push([m[0].length, m.index]);\n }\n\n let normalized = text.normalize(\"NFD\");\n const positions = [[0, 0]];\n let rawDiacriticsIndex = 0;\n let syllableIndex = 0;\n let shift = 0;\n let shiftOrigin = 0;\n let eol = 0;\n let hasDiacritics = false;\n\n normalized = normalized.replace(\n normalizationRegex,\n (match, p1, p2, p3, p4, p5, p6, p7, p8, i) => {\n i -= shiftOrigin;\n if (p1) {\n // Maybe fractions or quotations mark...\n const replacement = CHARACTERS_TO_NORMALIZE[p1];\n const jj = replacement.length;\n for (let j = 1; j < jj; j++) {\n positions.push([i - shift + j, shift - j]);\n }\n shift -= jj - 1;\n return replacement;\n }\n\n if (p2) {\n // Use the NFKC representation to normalize the char.\n let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2);\n if (!replacement) {\n replacement = p2.normalize(\"NFKC\");\n NFKC_CHARS_TO_NORMALIZE.set(p2, replacement);\n }\n const jj = replacement.length;\n for (let j = 1; j < jj; j++) {\n positions.push([i - shift + j, shift - j]);\n }\n shift -= jj - 1;\n return replacement;\n }\n\n if (p3) {\n // We've a Katakana-Hiragana diacritic followed by a \\n so don't replace\n // the \\n by a whitespace.\n hasDiacritics = true;\n\n // Diacritic.\n if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {\n ++rawDiacriticsIndex;\n } else {\n // i is the position of the first diacritic\n // so (i - 1) is the position for the letter before.\n positions.push([i - 1 - shift + 1, shift - 1]);\n shift -= 1;\n shiftOrigin += 1;\n }\n\n // End-of-line.\n positions.push([i - shift + 1, shift]);\n shiftOrigin += 1;\n eol += 1;\n\n return p3.charAt(0);\n }\n\n if (p4) {\n const hasTrailingDashEOL = p4.endsWith(\"\\n\");\n const len = hasTrailingDashEOL ? p4.length - 2 : p4.length;\n\n // Diacritics.\n hasDiacritics = true;\n let jj = len;\n if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {\n jj -= rawDiacriticsPositions[rawDiacriticsIndex][0];\n ++rawDiacriticsIndex;\n }\n\n for (let j = 1; j <= jj; j++) {\n // i is the position of the first diacritic\n // so (i - 1) is the position for the letter before.\n positions.push([i - 1 - shift + j, shift - j]);\n }\n shift -= jj;\n shiftOrigin += jj;\n\n if (hasTrailingDashEOL) {\n // Diacritics are followed by a -\\n.\n // See comments in `if (p5)` block.\n i += len - 1;\n positions.push([i - shift + 1, 1 + shift]);\n shift += 1;\n shiftOrigin += 1;\n eol += 1;\n return p4.slice(0, len);\n }\n\n return p4;\n }\n\n if (p5) {\n // \"X-\\n\" is removed because an hyphen at the end of a line\n // with not a space before is likely here to mark a break\n // in a word.\n // If X is encoded with UTF-32 then it can have a length greater than 1.\n // The \\n isn't in the original text so here y = i, n = X.len - 2 and\n // o = X.len - 1.\n const len = p5.length - 2;\n positions.push([i - shift + len, 1 + shift]);\n shift += 1;\n shiftOrigin += 1;\n eol += 1;\n return p5.slice(0, -2);\n }\n\n if (p6) {\n // An ideographic at the end of a line doesn't imply adding an extra\n // white space.\n // A CJK can be encoded in UTF-32, hence their length isn't always 1.\n const len = p6.length - 1;\n positions.push([i - shift + len, shift]);\n shiftOrigin += 1;\n eol += 1;\n return p6.slice(0, -1);\n }\n\n if (p7) {\n // eol is replaced by space: \"foo\\nbar\" is likely equivalent to\n // \"foo bar\".\n positions.push([i - shift + 1, shift - 1]);\n shift -= 1;\n shiftOrigin += 1;\n eol += 1;\n return \" \";\n }\n\n // p8\n if (i + eol === syllablePositions[syllableIndex]?.[1]) {\n // A syllable (1 char) is replaced with several chars (n) so\n // newCharsLen = n - 1.\n const newCharLen = syllablePositions[syllableIndex][0] - 1;\n ++syllableIndex;\n for (let j = 1; j <= newCharLen; j++) {\n positions.push([i - (shift - j), shift - j]);\n }\n shift -= newCharLen;\n shiftOrigin += newCharLen;\n }\n return p8;\n }\n );\n\n positions.push([normalized.length, shift]);\n\n return [normalized, positions, hasDiacritics];\n}\n\n// Determine the original, non-normalized, match index such that highlighting of\n// search results is correct in the `textLayer` for strings containing e.g. \"½\"\n// characters; essentially \"inverting\" the result of the `normalize` function.\nfunction getOriginalIndex(diffs, pos, len) {\n if (!diffs) {\n return [pos, len];\n }\n\n // First char in the new string.\n const start = pos;\n // Last char in the new string.\n const end = pos + len - 1;\n let i = binarySearchFirstItem(diffs, x => x[0] >= start);\n if (diffs[i][0] > start) {\n --i;\n }\n\n let j = binarySearchFirstItem(diffs, x => x[0] >= end, i);\n if (diffs[j][0] > end) {\n --j;\n }\n\n // First char in the old string.\n const oldStart = start + diffs[i][1];\n\n // Last char in the old string.\n const oldEnd = end + diffs[j][1];\n const oldLen = oldEnd + 1 - oldStart;\n\n return [oldStart, oldLen];\n}\n\n/**\n * @typedef {Object} PDFFindControllerOptions\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {EventBus} eventBus - The application event bus.\n * @property {boolean} [updateMatchesCountOnProgress] - True if the matches\n * count must be updated on progress or only when the last page is reached.\n * The default value is `true`.\n */\n\n/**\n * Provides search functionality to find a given string in a PDF document.\n */\nclass PDFFindController {\n #state = null;\n\n #updateMatchesCountOnProgress = true;\n\n #visitedPagesCount = 0;\n\n /**\n * @param {PDFFindControllerOptions} options\n */\n constructor({ linkService, eventBus, updateMatchesCountOnProgress = true }) {\n this._linkService = linkService;\n this._eventBus = eventBus;\n this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress;\n\n /**\n * Callback used to check if a `pageNumber` is currently visible.\n * @type {function}\n */\n this.onIsPageVisible = null;\n\n this.#reset();\n eventBus._on(\"find\", this.#onFind.bind(this));\n eventBus._on(\"findbarclose\", this.#onFindBarClose.bind(this));\n }\n\n get highlightMatches() {\n return this._highlightMatches;\n }\n\n get pageMatches() {\n return this._pageMatches;\n }\n\n get pageMatchesLength() {\n return this._pageMatchesLength;\n }\n\n get selected() {\n return this._selected;\n }\n\n get state() {\n return this.#state;\n }\n\n /**\n * Set a reference to the PDF document in order to search it.\n * Note that searching is not possible if this method is not called.\n *\n * @param {PDFDocumentProxy} pdfDocument - The PDF document to search.\n */\n setDocument(pdfDocument) {\n if (this._pdfDocument) {\n this.#reset();\n }\n if (!pdfDocument) {\n return;\n }\n this._pdfDocument = pdfDocument;\n this._firstPageCapability.resolve();\n }\n\n #onFind(state) {\n if (!state) {\n return;\n }\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n state.phraseSearch === false\n ) {\n console.error(\n \"The `phraseSearch`-parameter was removed, please provide \" +\n \"an Array of strings in the `query`-parameter instead.\"\n );\n if (typeof state.query === \"string\") {\n state.query = state.query.match(/\\S+/g);\n }\n }\n const pdfDocument = this._pdfDocument;\n const { type } = state;\n\n if (this.#state === null || this.#shouldDirtyMatch(state)) {\n this._dirtyMatch = true;\n }\n this.#state = state;\n if (type !== \"highlightallchange\") {\n this.#updateUIState(FindState.PENDING);\n }\n\n this._firstPageCapability.promise.then(() => {\n // If the document was closed before searching began, or if the search\n // operation was relevant for a previously opened document, do nothing.\n if (\n !this._pdfDocument ||\n (pdfDocument && this._pdfDocument !== pdfDocument)\n ) {\n return;\n }\n this.#extractText();\n\n const findbarClosed = !this._highlightMatches;\n const pendingTimeout = !!this._findTimeout;\n\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n if (!type) {\n // Trigger the find action with a small delay to avoid starting the\n // search when the user is still typing (saving resources).\n this._findTimeout = setTimeout(() => {\n this.#nextMatch();\n this._findTimeout = null;\n }, FIND_TIMEOUT);\n } else if (this._dirtyMatch) {\n // Immediately trigger searching for non-'find' operations, when the\n // current state needs to be reset and matches re-calculated.\n this.#nextMatch();\n } else if (type === \"again\") {\n this.#nextMatch();\n\n // When the findbar was previously closed, and `highlightAll` is set,\n // ensure that the matches on all active pages are highlighted again.\n if (findbarClosed && this.#state.highlightAll) {\n this.#updateAllPages();\n }\n } else if (type === \"highlightallchange\") {\n // If there was a pending search operation, synchronously trigger a new\n // search *first* to ensure that the correct matches are highlighted.\n if (pendingTimeout) {\n this.#nextMatch();\n } else {\n this._highlightMatches = true;\n }\n this.#updateAllPages(); // Update the highlighting on all active pages.\n } else {\n this.#nextMatch();\n }\n });\n }\n\n /**\n * @typedef {Object} PDFFindControllerScrollMatchIntoViewParams\n * @property {HTMLElement} element\n * @property {number} selectedLeft\n * @property {number} pageIndex\n * @property {number} matchIndex\n */\n\n /**\n * Scroll the current match into view.\n * @param {PDFFindControllerScrollMatchIntoViewParams}\n */\n scrollMatchIntoView({\n element = null,\n selectedLeft = 0,\n pageIndex = -1,\n matchIndex = -1,\n }) {\n if (!this._scrollMatches || !element) {\n return;\n } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {\n return;\n } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {\n return;\n }\n this._scrollMatches = false; // Ensure that scrolling only happens once.\n\n const spot = {\n top: MATCH_SCROLL_OFFSET_TOP,\n left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT,\n };\n scrollIntoView(element, spot, /* scrollMatches = */ true);\n }\n\n #reset() {\n this._highlightMatches = false;\n this._scrollMatches = false;\n this._pdfDocument = null;\n this._pageMatches = [];\n this._pageMatchesLength = [];\n this.#visitedPagesCount = 0;\n this.#state = null;\n // Currently selected match.\n this._selected = {\n pageIdx: -1,\n matchIdx: -1,\n };\n // Where the find algorithm currently is in the document.\n this._offset = {\n pageIdx: null,\n matchIdx: null,\n wrapped: false,\n };\n this._extractTextPromises = [];\n this._pageContents = []; // Stores the normalized text for each page.\n this._pageDiffs = [];\n this._hasDiacritics = [];\n this._matchesCountTotal = 0;\n this._pagesToSearch = null;\n this._pendingFindMatches = new Set();\n this._resumePageIdx = null;\n this._dirtyMatch = false;\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n\n this._firstPageCapability = new PromiseCapability();\n }\n\n /**\n * @type {string|Array} The (current) normalized search query.\n */\n get #query() {\n const { query } = this.#state;\n if (typeof query === \"string\") {\n if (query !== this._rawQuery) {\n this._rawQuery = query;\n [this._normalizedQuery] = normalize(query);\n }\n return this._normalizedQuery;\n }\n // We don't bother caching the normalized search query in the Array-case,\n // since this code-path is *essentially* unused in the default viewer.\n return (query || []).filter(q => !!q).map(q => normalize(q)[0]);\n }\n\n #shouldDirtyMatch(state) {\n // When the search query changes, regardless of the actual search command\n // used, always re-calculate matches to avoid errors (fixes bug 1030622).\n const newQuery = state.query,\n prevQuery = this.#state.query;\n const newType = typeof newQuery,\n prevType = typeof prevQuery;\n\n if (newType !== prevType) {\n return true;\n }\n if (newType === \"string\") {\n if (newQuery !== prevQuery) {\n return true;\n }\n } else if (\n /* isArray && */ JSON.stringify(newQuery) !== JSON.stringify(prevQuery)\n ) {\n return true;\n }\n\n switch (state.type) {\n case \"again\":\n const pageNumber = this._selected.pageIdx + 1;\n const linkService = this._linkService;\n // Only treat a 'findagain' event as a new search operation when it's\n // *absolutely* certain that the currently selected match is no longer\n // visible, e.g. as a result of the user scrolling in the document.\n //\n // NOTE: If only a simple `this._linkService.page` check was used here,\n // there's a risk that consecutive 'findagain' operations could \"skip\"\n // over matches at the top/bottom of pages thus making them completely\n // inaccessible when there's multiple pages visible in the viewer.\n return (\n pageNumber >= 1 &&\n pageNumber <= linkService.pagesCount &&\n pageNumber !== linkService.page &&\n !(this.onIsPageVisible?.(pageNumber) ?? true)\n );\n case \"highlightallchange\":\n return false;\n }\n return true;\n }\n\n /**\n * Determine if the search query constitutes a \"whole word\", by comparing the\n * first/last character type with the preceding/following character type.\n */\n #isEntireWord(content, startIdx, length) {\n let match = content\n .slice(0, startIdx)\n .match(NOT_DIACRITIC_FROM_END_REG_EXP);\n if (match) {\n const first = content.charCodeAt(startIdx);\n const limit = match[1].charCodeAt(0);\n if (getCharacterType(first) === getCharacterType(limit)) {\n return false;\n }\n }\n\n match = content\n .slice(startIdx + length)\n .match(NOT_DIACRITIC_FROM_START_REG_EXP);\n if (match) {\n const last = content.charCodeAt(startIdx + length - 1);\n const limit = match[1].charCodeAt(0);\n if (getCharacterType(last) === getCharacterType(limit)) {\n return false;\n }\n }\n\n return true;\n }\n\n #calculateRegExpMatch(query, entireWord, pageIndex, pageContent) {\n const matches = (this._pageMatches[pageIndex] = []);\n const matchesLength = (this._pageMatchesLength[pageIndex] = []);\n if (!query) {\n // The query can be empty because some chars like diacritics could have\n // been stripped out.\n return;\n }\n const diffs = this._pageDiffs[pageIndex];\n let match;\n while ((match = query.exec(pageContent)) !== null) {\n if (\n entireWord &&\n !this.#isEntireWord(pageContent, match.index, match[0].length)\n ) {\n continue;\n }\n\n const [matchPos, matchLen] = getOriginalIndex(\n diffs,\n match.index,\n match[0].length\n );\n\n if (matchLen) {\n matches.push(matchPos);\n matchesLength.push(matchLen);\n }\n }\n }\n\n #convertToRegExpString(query, hasDiacritics) {\n const { matchDiacritics } = this.#state;\n let isUnicode = false;\n query = query.replaceAll(\n SPECIAL_CHARS_REG_EXP,\n (\n match,\n p1 /* to escape */,\n p2 /* punctuation */,\n p3 /* whitespaces */,\n p4 /* diacritics */,\n p5 /* letters */\n ) => {\n // We don't need to use a \\s for whitespaces since all the different\n // kind of whitespaces are replaced by a single \" \".\n\n if (p1) {\n // Escape characters like *+?... to not interfer with regexp syntax.\n return `[ ]*\\\\${p1}[ ]*`;\n }\n if (p2) {\n // Allow whitespaces around punctuation signs.\n return `[ ]*${p2}[ ]*`;\n }\n if (p3) {\n // Replace spaces by \\s+ to be sure to match any spaces.\n return \"[ ]+\";\n }\n if (matchDiacritics) {\n return p4 || p5;\n }\n\n if (p4) {\n // Diacritics are removed with few exceptions.\n return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : \"\";\n }\n\n // A letter has been matched and it can be followed by any diacritics\n // in normalized text.\n if (hasDiacritics) {\n isUnicode = true;\n return `${p5}\\\\p{M}*`;\n }\n return p5;\n }\n );\n\n const trailingSpaces = \"[ ]*\";\n if (query.endsWith(trailingSpaces)) {\n // The [ ]* has been added in order to help to match \"foo . bar\" but\n // it doesn't make sense to match some whitespaces after the dot\n // when it's the last character.\n query = query.slice(0, query.length - trailingSpaces.length);\n }\n\n if (matchDiacritics) {\n // aX must not match aXY.\n if (hasDiacritics) {\n DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(\n ...DIACRITICS_EXCEPTION\n );\n\n isUnicode = true;\n query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\\\p{M}]|$)`;\n }\n }\n\n return [isUnicode, query];\n }\n\n #calculateMatch(pageIndex) {\n let query = this.#query;\n if (query.length === 0) {\n return; // Do nothing: the matches should be wiped out already.\n }\n const { caseSensitive, entireWord } = this.#state;\n const pageContent = this._pageContents[pageIndex];\n const hasDiacritics = this._hasDiacritics[pageIndex];\n\n let isUnicode = false;\n if (typeof query === \"string\") {\n [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics);\n } else {\n // Words are sorted in reverse order to be sure that \"foobar\" is matched\n // before \"foo\" in case the query is \"foobar foo\".\n query = query\n .sort()\n .reverse()\n .map(q => {\n const [isUnicodePart, queryPart] = this.#convertToRegExpString(\n q,\n hasDiacritics\n );\n isUnicode ||= isUnicodePart;\n return `(${queryPart})`;\n })\n .join(\"|\");\n }\n\n const flags = `g${isUnicode ? \"u\" : \"\"}${caseSensitive ? \"\" : \"i\"}`;\n query = query ? new RegExp(query, flags) : null;\n\n this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent);\n\n // When `highlightAll` is set, ensure that the matches on previously\n // rendered (and still active) pages are correctly highlighted.\n if (this.#state.highlightAll) {\n this.#updatePage(pageIndex);\n }\n if (this._resumePageIdx === pageIndex) {\n this._resumePageIdx = null;\n this.#nextPageMatch();\n }\n\n // Update the match count.\n const pageMatchesCount = this._pageMatches[pageIndex].length;\n this._matchesCountTotal += pageMatchesCount;\n if (this.#updateMatchesCountOnProgress) {\n if (pageMatchesCount > 0) {\n this.#updateUIResultsCount();\n }\n } else if (++this.#visitedPagesCount === this._linkService.pagesCount) {\n // For example, in GeckoView we want to have only the final update because\n // the Java side provides only one object to update the counts.\n this.#updateUIResultsCount();\n }\n }\n\n #extractText() {\n // Perform text extraction once if this method is called multiple times.\n if (this._extractTextPromises.length > 0) {\n return;\n }\n\n let promise = Promise.resolve();\n const textOptions = { disableNormalization: true };\n for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {\n const extractTextCapability = new PromiseCapability();\n this._extractTextPromises[i] = extractTextCapability.promise;\n\n promise = promise.then(() => {\n return this._pdfDocument\n .getPage(i + 1)\n .then(pdfPage => {\n return pdfPage.getTextContent(textOptions);\n })\n .then(\n textContent => {\n const strBuf = [];\n\n for (const textItem of textContent.items) {\n strBuf.push(textItem.str);\n if (textItem.hasEOL) {\n strBuf.push(\"\\n\");\n }\n }\n\n // Store the normalized page content (text items) as one string.\n [\n this._pageContents[i],\n this._pageDiffs[i],\n this._hasDiacritics[i],\n ] = normalize(strBuf.join(\"\"));\n extractTextCapability.resolve();\n },\n reason => {\n console.error(\n `Unable to get text content for page ${i + 1}`,\n reason\n );\n // Page error -- assuming no text content.\n this._pageContents[i] = \"\";\n this._pageDiffs[i] = null;\n this._hasDiacritics[i] = false;\n extractTextCapability.resolve();\n }\n );\n });\n }\n }\n\n #updatePage(index) {\n if (this._scrollMatches && this._selected.pageIdx === index) {\n // If the page is selected, scroll the page into view, which triggers\n // rendering the page, which adds the text layer. Once the text layer\n // is built, it will attempt to scroll the selected match into view.\n this._linkService.page = index + 1;\n }\n\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: index,\n });\n }\n\n #updateAllPages() {\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: -1,\n });\n }\n\n #nextMatch() {\n const previous = this.#state.findPrevious;\n const currentPageIndex = this._linkService.page - 1;\n const numPages = this._linkService.pagesCount;\n\n this._highlightMatches = true;\n\n if (this._dirtyMatch) {\n // Need to recalculate the matches, reset everything.\n this._dirtyMatch = false;\n this._selected.pageIdx = this._selected.matchIdx = -1;\n this._offset.pageIdx = currentPageIndex;\n this._offset.matchIdx = null;\n this._offset.wrapped = false;\n this._resumePageIdx = null;\n this._pageMatches.length = 0;\n this._pageMatchesLength.length = 0;\n this.#visitedPagesCount = 0;\n this._matchesCountTotal = 0;\n\n this.#updateAllPages(); // Wipe out any previously highlighted matches.\n\n for (let i = 0; i < numPages; i++) {\n // Start finding the matches as soon as the text is extracted.\n if (this._pendingFindMatches.has(i)) {\n continue;\n }\n this._pendingFindMatches.add(i);\n this._extractTextPromises[i].then(() => {\n this._pendingFindMatches.delete(i);\n this.#calculateMatch(i);\n });\n }\n }\n\n // If there's no query there's no point in searching.\n const query = this.#query;\n if (query.length === 0) {\n this.#updateUIState(FindState.FOUND);\n return;\n }\n // If we're waiting on a page, we return since we can't do anything else.\n if (this._resumePageIdx) {\n return;\n }\n\n const offset = this._offset;\n // Keep track of how many pages we should maximally iterate through.\n this._pagesToSearch = numPages;\n // If there's already a `matchIdx` that means we are iterating through a\n // page's matches.\n if (offset.matchIdx !== null) {\n const numPageMatches = this._pageMatches[offset.pageIdx].length;\n if (\n (!previous && offset.matchIdx + 1 < numPageMatches) ||\n (previous && offset.matchIdx > 0)\n ) {\n // The simple case; we just have advance the matchIdx to select\n // the next match on the page.\n offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;\n this.#updateMatch(/* found = */ true);\n return;\n }\n // We went beyond the current page's matches, so we advance to\n // the next page.\n this.#advanceOffsetPage(previous);\n }\n // Start searching through the page.\n this.#nextPageMatch();\n }\n\n #matchesReady(matches) {\n const offset = this._offset;\n const numMatches = matches.length;\n const previous = this.#state.findPrevious;\n\n if (numMatches) {\n // There were matches for the page, so initialize `matchIdx`.\n offset.matchIdx = previous ? numMatches - 1 : 0;\n this.#updateMatch(/* found = */ true);\n return true;\n }\n // No matches, so attempt to search the next page.\n this.#advanceOffsetPage(previous);\n if (offset.wrapped) {\n offset.matchIdx = null;\n if (this._pagesToSearch < 0) {\n // No point in wrapping again, there were no matches.\n this.#updateMatch(/* found = */ false);\n // While matches were not found, searching for a page\n // with matches should nevertheless halt.\n return true;\n }\n }\n // Matches were not found (and searching is not done).\n return false;\n }\n\n #nextPageMatch() {\n if (this._resumePageIdx !== null) {\n console.error(\"There can only be one pending page.\");\n }\n\n let matches = null;\n do {\n const pageIdx = this._offset.pageIdx;\n matches = this._pageMatches[pageIdx];\n if (!matches) {\n // The matches don't exist yet for processing by `_matchesReady`,\n // so set a resume point for when they do exist.\n this._resumePageIdx = pageIdx;\n break;\n }\n } while (!this.#matchesReady(matches));\n }\n\n #advanceOffsetPage(previous) {\n const offset = this._offset;\n const numPages = this._linkService.pagesCount;\n offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;\n offset.matchIdx = null;\n\n this._pagesToSearch--;\n\n if (offset.pageIdx >= numPages || offset.pageIdx < 0) {\n offset.pageIdx = previous ? numPages - 1 : 0;\n offset.wrapped = true;\n }\n }\n\n #updateMatch(found = false) {\n let state = FindState.NOT_FOUND;\n const wrapped = this._offset.wrapped;\n this._offset.wrapped = false;\n\n if (found) {\n const previousPage = this._selected.pageIdx;\n this._selected.pageIdx = this._offset.pageIdx;\n this._selected.matchIdx = this._offset.matchIdx;\n state = wrapped ? FindState.WRAPPED : FindState.FOUND;\n\n // Update the currently selected page to wipe out any selected matches.\n if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {\n this.#updatePage(previousPage);\n }\n }\n\n this.#updateUIState(state, this.#state.findPrevious);\n if (this._selected.pageIdx !== -1) {\n // Ensure that the match will be scrolled into view.\n this._scrollMatches = true;\n\n this.#updatePage(this._selected.pageIdx);\n }\n }\n\n #onFindBarClose(evt) {\n const pdfDocument = this._pdfDocument;\n // Since searching is asynchronous, ensure that the removal of highlighted\n // matches (from the UI) is async too such that the 'updatetextlayermatches'\n // events will always be dispatched in the expected order.\n this._firstPageCapability.promise.then(() => {\n // Only update the UI if the document is open, and is the current one.\n if (\n !this._pdfDocument ||\n (pdfDocument && this._pdfDocument !== pdfDocument)\n ) {\n return;\n }\n // Ensure that a pending, not yet started, search operation is aborted.\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n // Abort any long running searches, to avoid a match being scrolled into\n // view *after* the findbar has been closed. In this case `this._offset`\n // will most likely differ from `this._selected`, hence we also ensure\n // that any new search operation will always start with a clean slate.\n if (this._resumePageIdx) {\n this._resumePageIdx = null;\n this._dirtyMatch = true;\n }\n // Avoid the UI being in a pending state when the findbar is re-opened.\n this.#updateUIState(FindState.FOUND);\n\n this._highlightMatches = false;\n this.#updateAllPages(); // Wipe out any previously highlighted matches.\n });\n }\n\n #requestMatchesCount() {\n const { pageIdx, matchIdx } = this._selected;\n let current = 0,\n total = this._matchesCountTotal;\n if (matchIdx !== -1) {\n for (let i = 0; i < pageIdx; i++) {\n current += this._pageMatches[i]?.length || 0;\n }\n current += matchIdx + 1;\n }\n // When searching starts, this method may be called before the `pageMatches`\n // have been counted (in `_calculateMatch`). Ensure that the UI won't show\n // temporarily broken state when the active find result doesn't make sense.\n if (current < 1 || current > total) {\n current = total = 0;\n }\n return { current, total };\n }\n\n #updateUIResultsCount() {\n this._eventBus.dispatch(\"updatefindmatchescount\", {\n source: this,\n matchesCount: this.#requestMatchesCount(),\n });\n }\n\n #updateUIState(state, previous = false) {\n if (\n !this.#updateMatchesCountOnProgress &&\n (this.#visitedPagesCount !== this._linkService.pagesCount ||\n state === FindState.PENDING)\n ) {\n // When this.#updateMatchesCountOnProgress is false we only send an update\n // when everything is ready.\n return;\n }\n\n this._eventBus.dispatch(\"updatefindcontrolstate\", {\n source: this,\n state,\n previous,\n matchesCount: this.#requestMatchesCount(),\n rawQuery: this.#state?.query ?? null,\n });\n }\n}\n\nexport { FindState, PDFFindController };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst CharacterType = {\n SPACE: 0,\n ALPHA_LETTER: 1,\n PUNCT: 2,\n HAN_LETTER: 3,\n KATAKANA_LETTER: 4,\n HIRAGANA_LETTER: 5,\n HALFWIDTH_KATAKANA_LETTER: 6,\n THAI_LETTER: 7,\n};\n\nfunction isAlphabeticalScript(charCode) {\n return charCode < 0x2e80;\n}\n\nfunction isAscii(charCode) {\n return (charCode & 0xff80) === 0;\n}\n\nfunction isAsciiAlpha(charCode) {\n return (\n (charCode >= /* a = */ 0x61 && charCode <= /* z = */ 0x7a) ||\n (charCode >= /* A = */ 0x41 && charCode <= /* Z = */ 0x5a)\n );\n}\n\nfunction isAsciiDigit(charCode) {\n return charCode >= /* 0 = */ 0x30 && charCode <= /* 9 = */ 0x39;\n}\n\nfunction isAsciiSpace(charCode) {\n return (\n charCode === /* SPACE = */ 0x20 ||\n charCode === /* TAB = */ 0x09 ||\n charCode === /* CR = */ 0x0d ||\n charCode === /* LF = */ 0x0a\n );\n}\n\nfunction isHan(charCode) {\n return (\n (charCode >= 0x3400 && charCode <= 0x9fff) ||\n (charCode >= 0xf900 && charCode <= 0xfaff)\n );\n}\n\nfunction isKatakana(charCode) {\n return charCode >= 0x30a0 && charCode <= 0x30ff;\n}\n\nfunction isHiragana(charCode) {\n return charCode >= 0x3040 && charCode <= 0x309f;\n}\n\nfunction isHalfwidthKatakana(charCode) {\n return charCode >= 0xff60 && charCode <= 0xff9f;\n}\n\nfunction isThai(charCode) {\n return (charCode & 0xff80) === 0x0e00;\n}\n\n/**\n * This function is based on the word-break detection implemented in:\n * https://hg.mozilla.org/mozilla-central/file/tip/intl/lwbrk/WordBreaker.cpp\n */\nfunction getCharacterType(charCode) {\n if (isAlphabeticalScript(charCode)) {\n if (isAscii(charCode)) {\n if (isAsciiSpace(charCode)) {\n return CharacterType.SPACE;\n } else if (\n isAsciiAlpha(charCode) ||\n isAsciiDigit(charCode) ||\n charCode === /* UNDERSCORE = */ 0x5f\n ) {\n return CharacterType.ALPHA_LETTER;\n }\n return CharacterType.PUNCT;\n } else if (isThai(charCode)) {\n return CharacterType.THAI_LETTER;\n } else if (charCode === /* NBSP = */ 0xa0) {\n return CharacterType.SPACE;\n }\n return CharacterType.ALPHA_LETTER;\n }\n\n if (isHan(charCode)) {\n return CharacterType.HAN_LETTER;\n } else if (isKatakana(charCode)) {\n return CharacterType.KATAKANA_LETTER;\n } else if (isHiragana(charCode)) {\n return CharacterType.HIRAGANA_LETTER;\n } else if (isHalfwidthKatakana(charCode)) {\n return CharacterType.HALFWIDTH_KATAKANA_LETTER;\n }\n return CharacterType.ALPHA_LETTER;\n}\n\nlet NormalizeWithNFKC;\nfunction getNormalizeWithNFKC() {\n /* eslint-disable no-irregular-whitespace */\n NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-ËË -ˤʹͺ;΄-΅·Ï-Ï–Ï°-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-à§à§Ÿà¨³à¨¶à©™-ਜ਼ਫ਼àœ-àำຳໜ-à»à¼Œà½ƒà½à½’བྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-áµáµ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-á¿á¿‰á¿‹á¿-á¿á¿“á¿›á¿-῟ΰΎá¿-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾â‡-â‰â—âŸâ°-â±â´-â‚Žâ‚-ₜ₨℀-℃℅-ℇ℉-â„“â„•-â„–â„™-â„â„ -™ℤΩℨK-â„ℯ-ℱℳ-ℹ℻-⅀ⅅ-â…‰â…-ⅿ↉∬-âˆâˆ¯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇ã‰-㉾㊀-ã¿êšœ-êšê°êŸ²-ꟴꟸ-ꟹêœ-êŸê©ï¤€-ï¨ï¨ï¨’凞-ï¨žï¨ ï¨¢ï¨¥-都飯-ï©ï©°-龎ff-stﬓ-ﬗï¬ï¬Ÿ-זּטּ-לּמּï€-ïïƒ-ï„ï†-ﮱﯓ-ï´½ïµ-ï¶ï¶’-ﷇﷰ-ï·¼ï¸-︙︰-﹄﹇-ï¹’ï¹”-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼï¼-하-ᅦᅧ-ï¿ï¿’-ï¿—ï¿š-ï¿œï¿ -₩`;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n const ranges = [];\n const range = [];\n const diacriticsRegex = /^\\p{M}$/u;\n // Some chars must be replaced by their NFKC counterpart during a search.\n for (let i = 0; i < 65536; i++) {\n const c = String.fromCharCode(i);\n if (c.normalize(\"NFKC\") !== c && !diacriticsRegex.test(c)) {\n if (range.length !== 2) {\n range[0] = range[1] = i;\n continue;\n }\n if (range[1] + 1 !== i) {\n if (range[0] === range[1]) {\n ranges.push(String.fromCharCode(range[0]));\n } else {\n ranges.push(\n `${String.fromCharCode(range[0])}-${String.fromCharCode(\n range[1]\n )}`\n );\n }\n range[0] = range[1] = i;\n } else {\n range[1] = i;\n }\n }\n }\n if (ranges.join(\"\") !== NormalizeWithNFKC) {\n throw new Error(\n \"getNormalizeWithNFKC - update the `NormalizeWithNFKC` string.\"\n );\n }\n }\n return NormalizeWithNFKC;\n}\n\nexport { CharacterType, getCharacterType, getNormalizeWithNFKC };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { isValidRotation, parseQueryString } from \"./ui_utils.js\";\nimport { waitOnEventOrTimeout } from \"./event_utils.js\";\n\n// Heuristic value used when force-resetting `this._blockHashChange`.\nconst HASH_CHANGE_TIMEOUT = 1000; // milliseconds\n// Heuristic value used when adding the current position to the browser history.\nconst POSITION_UPDATED_THRESHOLD = 50;\n// Heuristic value used when adding a temporary position to the browser history.\nconst UPDATE_VIEWAREA_TIMEOUT = 1000; // milliseconds\n\n/**\n * @typedef {Object} PDFHistoryOptions\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {EventBus} eventBus - The application event bus.\n */\n\n/**\n * @typedef {Object} InitializeParameters\n * @property {string} fingerprint - The PDF document's unique fingerprint.\n * @property {boolean} [resetHistory] - Reset the browsing history.\n * @property {boolean} [updateUrl] - Attempt to update the document URL, with\n * the current hash, when pushing/replacing browser history entries.\n */\n\n/**\n * @typedef {Object} PushParameters\n * @property {string} [namedDest] - The named destination. If absent, a\n * stringified version of `explicitDest` is used.\n * @property {Array} explicitDest - The explicit destination array.\n * @property {number} pageNumber - The page to which the destination points.\n */\n\nfunction getCurrentHash() {\n return document.location.hash;\n}\n\nclass PDFHistory {\n /**\n * @param {PDFHistoryOptions} options\n */\n constructor({ linkService, eventBus }) {\n this.linkService = linkService;\n this.eventBus = eventBus;\n\n this._initialized = false;\n this._fingerprint = \"\";\n this.reset();\n\n this._boundEvents = null;\n // Ensure that we don't miss a \"pagesinit\" event,\n // by registering the listener immediately.\n this.eventBus._on(\"pagesinit\", () => {\n this._isPagesLoaded = false;\n\n this.eventBus._on(\n \"pagesloaded\",\n evt => {\n this._isPagesLoaded = !!evt.pagesCount;\n },\n { once: true }\n );\n });\n }\n\n /**\n * Initialize the history for the PDF document, using either the current\n * browser history entry or the document hash, whichever is present.\n * @param {InitializeParameters} params\n */\n initialize({ fingerprint, resetHistory = false, updateUrl = false }) {\n if (!fingerprint || typeof fingerprint !== \"string\") {\n console.error(\n 'PDFHistory.initialize: The \"fingerprint\" must be a non-empty string.'\n );\n return;\n }\n // Ensure that any old state is always reset upon initialization.\n if (this._initialized) {\n this.reset();\n }\n const reInitialized =\n this._fingerprint !== \"\" && this._fingerprint !== fingerprint;\n this._fingerprint = fingerprint;\n this._updateUrl = updateUrl === true;\n\n this._initialized = true;\n this._bindEvents();\n const state = window.history.state;\n\n this._popStateInProgress = false;\n this._blockHashChange = 0;\n this._currentHash = getCurrentHash();\n this._numPositionUpdates = 0;\n\n this._uid = this._maxUid = 0;\n this._destination = null;\n this._position = null;\n\n if (!this._isValidState(state, /* checkReload = */ true) || resetHistory) {\n const { hash, page, rotation } = this._parseCurrentHash(\n /* checkNameddest = */ true\n );\n\n if (!hash || reInitialized || resetHistory) {\n // Ensure that the browser history is reset on PDF document load.\n this._pushOrReplaceState(null, /* forceReplace = */ true);\n return;\n }\n // Ensure that the browser history is initialized correctly when\n // the document hash is present on PDF document load.\n this._pushOrReplaceState(\n { hash, page, rotation },\n /* forceReplace = */ true\n );\n return;\n }\n\n // The browser history contains a valid entry, ensure that the history is\n // initialized correctly on PDF document load.\n const destination = state.destination;\n this._updateInternalState(\n destination,\n state.uid,\n /* removeTemporary = */ true\n );\n\n if (destination.rotation !== undefined) {\n this._initialRotation = destination.rotation;\n }\n if (destination.dest) {\n this._initialBookmark = JSON.stringify(destination.dest);\n\n // If the history is updated, e.g. through the user changing the hash,\n // before the initial destination has become visible, then we do *not*\n // want to potentially add `this._position` to the browser history.\n this._destination.page = null;\n } else if (destination.hash) {\n this._initialBookmark = destination.hash;\n } else if (destination.page) {\n // Fallback case; shouldn't be necessary, but better safe than sorry.\n this._initialBookmark = `page=${destination.page}`;\n }\n }\n\n /**\n * Reset the current `PDFHistory` instance, and consequently prevent any\n * further updates and/or navigation of the browser history.\n */\n reset() {\n if (this._initialized) {\n this._pageHide(); // Simulate a 'pagehide' event when resetting.\n\n this._initialized = false;\n this._unbindEvents();\n }\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n this._initialBookmark = null;\n this._initialRotation = null;\n }\n\n /**\n * Push an internal destination to the browser history.\n * @param {PushParameters}\n */\n push({ namedDest = null, explicitDest, pageNumber }) {\n if (!this._initialized) {\n return;\n }\n if (namedDest && typeof namedDest !== \"string\") {\n console.error(\n \"PDFHistory.push: \" +\n `\"${namedDest}\" is not a valid namedDest parameter.`\n );\n return;\n } else if (!Array.isArray(explicitDest)) {\n console.error(\n \"PDFHistory.push: \" +\n `\"${explicitDest}\" is not a valid explicitDest parameter.`\n );\n return;\n } else if (!this._isValidPage(pageNumber)) {\n // Allow an unset `pageNumber` if and only if the history is still empty;\n // please refer to the `this._destination.page = null;` comment above.\n if (pageNumber !== null || this._destination) {\n console.error(\n \"PDFHistory.push: \" +\n `\"${pageNumber}\" is not a valid pageNumber parameter.`\n );\n return;\n }\n }\n\n const hash = namedDest || JSON.stringify(explicitDest);\n if (!hash) {\n // The hash *should* never be undefined, but if that were to occur,\n // avoid any possible issues by not updating the browser history.\n return;\n }\n\n let forceReplace = false;\n if (\n this._destination &&\n (isDestHashesEqual(this._destination.hash, hash) ||\n isDestArraysEqual(this._destination.dest, explicitDest))\n ) {\n // When the new destination is identical to `this._destination`, and\n // its `page` is undefined, replace the current browser history entry.\n // NOTE: This can only occur if `this._destination` was set either:\n // - through the document hash being specified on load.\n // - through the user changing the hash of the document.\n if (this._destination.page) {\n return;\n }\n forceReplace = true;\n }\n if (this._popStateInProgress && !forceReplace) {\n return;\n }\n\n this._pushOrReplaceState(\n {\n dest: explicitDest,\n hash,\n page: pageNumber,\n rotation: this.linkService.rotation,\n },\n forceReplace\n );\n\n if (!this._popStateInProgress) {\n // Prevent the browser history from updating while the new destination is\n // being scrolled into view, to avoid potentially inconsistent state.\n this._popStateInProgress = true;\n // We defer the resetting of `this._popStateInProgress`, to account for\n // e.g. zooming occurring when the new destination is being navigated to.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n }\n\n /**\n * Push a page to the browser history; generally the `push` method should be\n * used instead.\n * @param {number} pageNumber\n */\n pushPage(pageNumber) {\n if (!this._initialized) {\n return;\n }\n if (!this._isValidPage(pageNumber)) {\n console.error(\n `PDFHistory.pushPage: \"${pageNumber}\" is not a valid page number.`\n );\n return;\n }\n\n if (this._destination?.page === pageNumber) {\n // When the new page is identical to the one in `this._destination`, we\n // don't want to add a potential duplicate entry in the browser history.\n return;\n }\n if (this._popStateInProgress) {\n return;\n }\n\n this._pushOrReplaceState({\n // Simulate an internal destination, for `this._tryPushCurrentPosition`:\n dest: null,\n hash: `page=${pageNumber}`,\n page: pageNumber,\n rotation: this.linkService.rotation,\n });\n\n if (!this._popStateInProgress) {\n // Prevent the browser history from updating while the new page is\n // being scrolled into view, to avoid potentially inconsistent state.\n this._popStateInProgress = true;\n // We defer the resetting of `this._popStateInProgress`, to account for\n // e.g. zooming occurring when the new page is being navigated to.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n }\n\n /**\n * Push the current position to the browser history.\n */\n pushCurrentPosition() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n this._tryPushCurrentPosition();\n }\n\n /**\n * Go back one step in the browser history.\n * NOTE: Avoids navigating away from the document, useful for \"named actions\".\n */\n back() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid > 0) {\n window.history.back();\n }\n }\n\n /**\n * Go forward one step in the browser history.\n * NOTE: Avoids navigating away from the document, useful for \"named actions\".\n */\n forward() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid < this._maxUid) {\n window.history.forward();\n }\n }\n\n /**\n * @type {boolean} Indicating if the user is currently moving through the\n * browser history, useful e.g. for skipping the next 'hashchange' event.\n */\n get popStateInProgress() {\n return (\n this._initialized &&\n (this._popStateInProgress || this._blockHashChange > 0)\n );\n }\n\n get initialBookmark() {\n return this._initialized ? this._initialBookmark : null;\n }\n\n get initialRotation() {\n return this._initialized ? this._initialRotation : null;\n }\n\n /**\n * @private\n */\n _pushOrReplaceState(destination, forceReplace = false) {\n const shouldReplace = forceReplace || !this._destination;\n const newState = {\n fingerprint: this._fingerprint,\n uid: shouldReplace ? this._uid : this._uid + 1,\n destination,\n };\n\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n window.history.state?.chromecomState\n ) {\n // history.state.chromecomState is managed by chromecom.js.\n newState.chromecomState = window.history.state.chromecomState;\n }\n this._updateInternalState(destination, newState.uid);\n\n let newUrl;\n if (this._updateUrl && destination?.hash) {\n const baseUrl = document.location.href.split(\"#\")[0];\n // Prevent errors in Firefox.\n if (!baseUrl.startsWith(\"file://\")) {\n newUrl = `${baseUrl}#${destination.hash}`;\n }\n }\n if (shouldReplace) {\n window.history.replaceState(newState, \"\", newUrl);\n } else {\n window.history.pushState(newState, \"\", newUrl);\n }\n\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n top === window\n ) {\n // eslint-disable-next-line no-undef\n chrome.runtime.sendMessage(\"showPageAction\");\n }\n }\n\n /**\n * @private\n */\n _tryPushCurrentPosition(temporary = false) {\n if (!this._position) {\n return;\n }\n let position = this._position;\n if (temporary) {\n position = Object.assign(Object.create(null), this._position);\n position.temporary = true;\n }\n\n if (!this._destination) {\n this._pushOrReplaceState(position);\n return;\n }\n if (this._destination.temporary) {\n // Always replace a previous *temporary* position.\n this._pushOrReplaceState(position, /* forceReplace = */ true);\n return;\n }\n if (this._destination.hash === position.hash) {\n return; // The current document position has not changed.\n }\n if (\n !this._destination.page &&\n (POSITION_UPDATED_THRESHOLD <= 0 ||\n this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)\n ) {\n // `this._destination` was set through the user changing the hash of\n // the document. Do not add `this._position` to the browser history,\n // to avoid \"flooding\" it with lots of (nearly) identical entries,\n // since we cannot ensure that the document position has changed.\n return;\n }\n\n let forceReplace = false;\n if (\n this._destination.page >= position.first &&\n this._destination.page <= position.page\n ) {\n // When the `page` of `this._destination` is still visible, do not\n // update the browsing history when `this._destination` either:\n // - contains an internal destination, since in this case we\n // cannot ensure that the document position has actually changed.\n // - was set through the user changing the hash of the document.\n if (this._destination.dest !== undefined || !this._destination.first) {\n return;\n }\n // To avoid \"flooding\" the browser history, replace the current entry.\n forceReplace = true;\n }\n this._pushOrReplaceState(position, forceReplace);\n }\n\n /**\n * @private\n */\n _isValidPage(val) {\n return (\n Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount\n );\n }\n\n /**\n * @private\n */\n _isValidState(state, checkReload = false) {\n if (!state) {\n return false;\n }\n if (state.fingerprint !== this._fingerprint) {\n if (checkReload) {\n // Potentially accept the history entry, even if the fingerprints don't\n // match, when the viewer was reloaded (see issue 6847).\n if (\n typeof state.fingerprint !== \"string\" ||\n state.fingerprint.length !== this._fingerprint.length\n ) {\n return false;\n }\n const [perfEntry] = performance.getEntriesByType(\"navigation\");\n if (perfEntry?.type !== \"reload\") {\n return false;\n }\n } else {\n // This should only occur in viewers with support for opening more than\n // one PDF document, e.g. the GENERIC viewer.\n return false;\n }\n }\n if (!Number.isInteger(state.uid) || state.uid < 0) {\n return false;\n }\n if (state.destination === null || typeof state.destination !== \"object\") {\n return false;\n }\n return true;\n }\n\n /**\n * @private\n */\n _updateInternalState(destination, uid, removeTemporary = false) {\n if (this._updateViewareaTimeout) {\n // When updating `this._destination`, make sure that we always wait for\n // the next 'updateviewarea' event before (potentially) attempting to\n // push the current position to the browser history.\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n if (removeTemporary && destination?.temporary) {\n // When the `destination` comes from the browser history,\n // we no longer treat it as a *temporary* position.\n delete destination.temporary;\n }\n this._destination = destination;\n this._uid = uid;\n this._maxUid = Math.max(this._maxUid, uid);\n // This should always be reset when `this._destination` is updated.\n this._numPositionUpdates = 0;\n }\n\n /**\n * @private\n */\n _parseCurrentHash(checkNameddest = false) {\n const hash = unescape(getCurrentHash()).substring(1);\n const params = parseQueryString(hash);\n\n const nameddest = params.get(\"nameddest\") || \"\";\n let page = params.get(\"page\") | 0;\n\n if (!this._isValidPage(page) || (checkNameddest && nameddest.length > 0)) {\n page = null;\n }\n return { hash, page, rotation: this.linkService.rotation };\n }\n\n /**\n * @private\n */\n _updateViewarea({ location }) {\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n this._position = {\n hash: location.pdfOpenParams.substring(1),\n page: this.linkService.page,\n first: location.pageNumber,\n rotation: location.rotation,\n };\n\n if (this._popStateInProgress) {\n return;\n }\n\n if (\n POSITION_UPDATED_THRESHOLD > 0 &&\n this._isPagesLoaded &&\n this._destination &&\n !this._destination.page\n ) {\n // If the current destination was set through the user changing the hash\n // of the document, we will usually not try to push the current position\n // to the browser history; see `this._tryPushCurrentPosition()`.\n //\n // To prevent `this._tryPushCurrentPosition()` from effectively being\n // reduced to a no-op in this case, we will assume that the position\n // *did* in fact change if the 'updateviewarea' event was dispatched\n // more than `POSITION_UPDATED_THRESHOLD` times.\n this._numPositionUpdates++;\n }\n\n if (UPDATE_VIEWAREA_TIMEOUT > 0) {\n // When closing the browser, a 'pagehide' event will be dispatched which\n // *should* allow us to push the current position to the browser history.\n // In practice, it seems that the event is arriving too late in order for\n // the session history to be successfully updated.\n // (For additional details, please refer to the discussion in\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1153393.)\n //\n // To workaround this we attempt to *temporarily* add the current position\n // to the browser history only when the viewer is *idle*,\n // i.e. when scrolling and/or zooming does not occur.\n //\n // PLEASE NOTE: It's absolutely imperative that the browser history is\n // *not* updated too often, since that would render the viewer more or\n // less unusable. Hence the use of a timeout to delay the update until\n // the viewer has been idle for `UPDATE_VIEWAREA_TIMEOUT` milliseconds.\n this._updateViewareaTimeout = setTimeout(() => {\n if (!this._popStateInProgress) {\n this._tryPushCurrentPosition(/* temporary = */ true);\n }\n this._updateViewareaTimeout = null;\n }, UPDATE_VIEWAREA_TIMEOUT);\n }\n }\n\n /**\n * @private\n */\n _popState({ state }) {\n const newHash = getCurrentHash(),\n hashChanged = this._currentHash !== newHash;\n this._currentHash = newHash;\n\n if (\n (typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n state?.chromecomState &&\n !this._isValidState(state)) ||\n !state\n ) {\n // This case corresponds to the user changing the hash of the document.\n this._uid++;\n\n const { hash, page, rotation } = this._parseCurrentHash();\n this._pushOrReplaceState(\n { hash, page, rotation },\n /* forceReplace = */ true\n );\n return;\n }\n if (!this._isValidState(state)) {\n // This should only occur in viewers with support for opening more than\n // one PDF document, e.g. the GENERIC viewer.\n return;\n }\n\n // Prevent the browser history from updating until the new destination,\n // as stored in the browser history, has been scrolled into view.\n this._popStateInProgress = true;\n\n if (hashChanged) {\n // When the hash changed, implying that the 'popstate' event will be\n // followed by a 'hashchange' event, then we do *not* want to update the\n // browser history when handling the 'hashchange' event (in web/app.js)\n // since that would *overwrite* the new destination navigated to below.\n //\n // To avoid accidentally disabling all future user-initiated hash changes,\n // if there's e.g. another 'hashchange' listener that stops the event\n // propagation, we make sure to always force-reset `this._blockHashChange`\n // after `HASH_CHANGE_TIMEOUT` milliseconds have passed.\n this._blockHashChange++;\n waitOnEventOrTimeout({\n target: window,\n name: \"hashchange\",\n delay: HASH_CHANGE_TIMEOUT,\n }).then(() => {\n this._blockHashChange--;\n });\n }\n\n // Navigate to the new destination.\n const destination = state.destination;\n this._updateInternalState(\n destination,\n state.uid,\n /* removeTemporary = */ true\n );\n\n if (isValidRotation(destination.rotation)) {\n this.linkService.rotation = destination.rotation;\n }\n if (destination.dest) {\n this.linkService.goToDestination(destination.dest);\n } else if (destination.hash) {\n this.linkService.setHash(destination.hash);\n } else if (destination.page) {\n // Fallback case; shouldn't be necessary, but better safe than sorry.\n this.linkService.page = destination.page;\n }\n\n // Since `PDFLinkService.goToDestination` is asynchronous, we thus defer the\n // resetting of `this._popStateInProgress` slightly.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n\n /**\n * @private\n */\n _pageHide() {\n // Attempt to push the `this._position` into the browser history when\n // navigating away from the document. This is *only* done if the history\n // is empty/temporary, since otherwise an existing browser history entry\n // will end up being overwritten (given that new entries cannot be pushed\n // into the browser history when the 'unload' event has already fired).\n if (!this._destination || this._destination.temporary) {\n this._tryPushCurrentPosition();\n }\n }\n\n /**\n * @private\n */\n _bindEvents() {\n if (this._boundEvents) {\n return; // The event listeners were already added.\n }\n this._boundEvents = {\n updateViewarea: this._updateViewarea.bind(this),\n popState: this._popState.bind(this),\n pageHide: this._pageHide.bind(this),\n };\n\n this.eventBus._on(\"updateviewarea\", this._boundEvents.updateViewarea);\n window.addEventListener(\"popstate\", this._boundEvents.popState);\n window.addEventListener(\"pagehide\", this._boundEvents.pageHide);\n }\n\n /**\n * @private\n */\n _unbindEvents() {\n if (!this._boundEvents) {\n return; // The event listeners were already removed.\n }\n this.eventBus._off(\"updateviewarea\", this._boundEvents.updateViewarea);\n window.removeEventListener(\"popstate\", this._boundEvents.popState);\n window.removeEventListener(\"pagehide\", this._boundEvents.pageHide);\n\n this._boundEvents = null;\n }\n}\n\nfunction isDestHashesEqual(destHash, pushHash) {\n if (typeof destHash !== \"string\" || typeof pushHash !== \"string\") {\n return false;\n }\n if (destHash === pushHash) {\n return true;\n }\n const nameddest = parseQueryString(destHash).get(\"nameddest\");\n if (nameddest === pushHash) {\n return true;\n }\n return false;\n}\n\nfunction isDestArraysEqual(firstDest, secondDest) {\n function isEntryEqual(first, second) {\n if (typeof first !== typeof second) {\n return false;\n }\n if (Array.isArray(first) || Array.isArray(second)) {\n return false;\n }\n if (first !== null && typeof first === \"object\" && second !== null) {\n if (Object.keys(first).length !== Object.keys(second).length) {\n return false;\n }\n for (const key in first) {\n if (!isEntryEqual(first[key], second[key])) {\n return false;\n }\n }\n return true;\n }\n return first === second || (Number.isNaN(first) && Number.isNaN(second));\n }\n\n if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {\n return false;\n }\n if (firstDest.length !== secondDest.length) {\n return false;\n }\n for (let i = 0, ii = firstDest.length; i < ii; i++) {\n if (!isEntryEqual(firstDest[i], secondDest[i])) {\n return false;\n }\n }\n return true;\n}\n\nexport { isDestArraysEqual, isDestHashesEqual, PDFHistory };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\n\n/**\n * @typedef {Object} PDFLayerViewerOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IL10n} l10n - Localization service.\n */\n\n/**\n * @typedef {Object} PDFLayerViewerRenderParameters\n * @property {OptionalContentConfig|null} optionalContentConfig - An\n * {OptionalContentConfig} instance.\n * @property {PDFDocument} pdfDocument - A {PDFDocument} instance.\n */\n\nclass PDFLayerViewer extends BaseTreeViewer {\n constructor(options) {\n super(options);\n this.l10n = options.l10n;\n\n this.eventBus._on(\"optionalcontentconfigchanged\", evt => {\n this.#updateLayers(evt.promise);\n });\n this.eventBus._on(\"resetlayers\", () => {\n this.#updateLayers();\n });\n this.eventBus._on(\"togglelayerstree\", this._toggleAllTreeItems.bind(this));\n }\n\n reset() {\n super.reset();\n this._optionalContentConfig = null;\n this._optionalContentHash = null;\n }\n\n /**\n * @private\n */\n _dispatchEvent(layersCount) {\n this.eventBus.dispatch(\"layersloaded\", {\n source: this,\n layersCount,\n });\n }\n\n /**\n * @private\n */\n _bindLink(element, { groupId, input }) {\n const setVisibility = () => {\n this._optionalContentConfig.setVisibility(groupId, input.checked);\n this._optionalContentHash = this._optionalContentConfig.getHash();\n\n this.eventBus.dispatch(\"optionalcontentconfig\", {\n source: this,\n promise: Promise.resolve(this._optionalContentConfig),\n });\n };\n\n element.onclick = evt => {\n if (evt.target === input) {\n setVisibility();\n return true;\n } else if (evt.target !== element) {\n return true; // The target is the \"label\", which is handled above.\n }\n input.checked = !input.checked;\n setVisibility();\n return false;\n };\n }\n\n /**\n * @private\n */\n async _setNestedName(element, { name = null }) {\n if (typeof name === \"string\") {\n element.textContent = this._normalizeTextContent(name);\n return;\n }\n element.textContent = await this.l10n.get(\"additional_layers\");\n element.style.fontStyle = \"italic\";\n }\n\n /**\n * @private\n */\n _addToggleButton(div, { name = null }) {\n super._addToggleButton(div, /* hidden = */ name === null);\n }\n\n /**\n * @private\n */\n _toggleAllTreeItems() {\n if (!this._optionalContentConfig) {\n return;\n }\n super._toggleAllTreeItems();\n }\n\n /**\n * @param {PDFLayerViewerRenderParameters} params\n */\n render({ optionalContentConfig, pdfDocument }) {\n if (this._optionalContentConfig) {\n this.reset();\n }\n this._optionalContentConfig = optionalContentConfig || null;\n this._pdfDocument = pdfDocument || null;\n\n const groups = optionalContentConfig?.getOrder();\n if (!groups) {\n this._dispatchEvent(/* layersCount = */ 0);\n return;\n }\n this._optionalContentHash = optionalContentConfig.getHash();\n\n const fragment = document.createDocumentFragment(),\n queue = [{ parent: fragment, groups }];\n let layersCount = 0,\n hasAnyNesting = false;\n while (queue.length > 0) {\n const levelData = queue.shift();\n for (const groupId of levelData.groups) {\n const div = document.createElement(\"div\");\n div.className = \"treeItem\";\n\n const element = document.createElement(\"a\");\n div.append(element);\n\n if (typeof groupId === \"object\") {\n hasAnyNesting = true;\n this._addToggleButton(div, groupId);\n this._setNestedName(element, groupId);\n\n const itemsDiv = document.createElement(\"div\");\n itemsDiv.className = \"treeItems\";\n div.append(itemsDiv);\n\n queue.push({ parent: itemsDiv, groups: groupId.order });\n } else {\n const group = optionalContentConfig.getGroup(groupId);\n\n const input = document.createElement(\"input\");\n this._bindLink(element, { groupId, input });\n input.type = \"checkbox\";\n input.checked = group.visible;\n\n const label = document.createElement(\"label\");\n label.textContent = this._normalizeTextContent(group.name);\n\n label.append(input);\n element.append(label);\n layersCount++;\n }\n\n levelData.parent.append(div);\n }\n }\n\n this._finishRendering(fragment, layersCount, hasAnyNesting);\n }\n\n async #updateLayers(promise = null) {\n if (!this._optionalContentConfig) {\n return;\n }\n const pdfDocument = this._pdfDocument;\n const optionalContentConfig = await (promise ||\n pdfDocument.getOptionalContentConfig());\n\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the optional content resolved.\n }\n if (promise) {\n if (optionalContentConfig.getHash() === this._optionalContentHash) {\n return; // The optional content didn't change, hence no need to reset the UI.\n }\n } else {\n this.eventBus.dispatch(\"optionalcontentconfig\", {\n source: this,\n promise: Promise.resolve(optionalContentConfig),\n });\n }\n\n // Reset the sidebarView to the new state.\n this.render({\n optionalContentConfig,\n pdfDocument: this._pdfDocument,\n });\n }\n}\n\nexport { PDFLayerViewer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\nimport { PromiseCapability } from \"pdfjs-lib\";\nimport { SidebarView } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} PDFOutlineViewerOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {DownloadManager} downloadManager - The download manager.\n */\n\n/**\n * @typedef {Object} PDFOutlineViewerRenderParameters\n * @property {Array|null} outline - An array of outline objects.\n * @property {PDFDocument} pdfDocument - A {PDFDocument} instance.\n */\n\nclass PDFOutlineViewer extends BaseTreeViewer {\n /**\n * @param {PDFOutlineViewerOptions} options\n */\n constructor(options) {\n super(options);\n this.linkService = options.linkService;\n this.downloadManager = options.downloadManager;\n\n this.eventBus._on(\"toggleoutlinetree\", this._toggleAllTreeItems.bind(this));\n this.eventBus._on(\n \"currentoutlineitem\",\n this._currentOutlineItem.bind(this)\n );\n\n this.eventBus._on(\"pagechanging\", evt => {\n this._currentPageNumber = evt.pageNumber;\n });\n this.eventBus._on(\"pagesloaded\", evt => {\n this._isPagesLoaded = !!evt.pagesCount;\n\n // If the capability is still pending, see the `_dispatchEvent`-method,\n // we know that the `currentOutlineItem`-button can be enabled here.\n if (\n this._currentOutlineItemCapability &&\n !this._currentOutlineItemCapability.settled\n ) {\n this._currentOutlineItemCapability.resolve(\n /* enabled = */ this._isPagesLoaded\n );\n }\n });\n this.eventBus._on(\"sidebarviewchanged\", evt => {\n this._sidebarView = evt.view;\n });\n }\n\n reset() {\n super.reset();\n this._outline = null;\n\n this._pageNumberToDestHashCapability = null;\n this._currentPageNumber = 1;\n this._isPagesLoaded = null;\n\n if (\n this._currentOutlineItemCapability &&\n !this._currentOutlineItemCapability.settled\n ) {\n this._currentOutlineItemCapability.resolve(/* enabled = */ false);\n }\n this._currentOutlineItemCapability = null;\n }\n\n /**\n * @private\n */\n _dispatchEvent(outlineCount) {\n this._currentOutlineItemCapability = new PromiseCapability();\n if (\n outlineCount === 0 ||\n this._pdfDocument?.loadingParams.disableAutoFetch\n ) {\n this._currentOutlineItemCapability.resolve(/* enabled = */ false);\n } else if (this._isPagesLoaded !== null) {\n this._currentOutlineItemCapability.resolve(\n /* enabled = */ this._isPagesLoaded\n );\n }\n\n this.eventBus.dispatch(\"outlineloaded\", {\n source: this,\n outlineCount,\n currentOutlineItemPromise: this._currentOutlineItemCapability.promise,\n });\n }\n\n /**\n * @private\n */\n _bindLink(\n element,\n { url, newWindow, action, attachment, dest, setOCGState }\n ) {\n const { linkService } = this;\n\n if (url) {\n linkService.addLinkAttributes(element, url, newWindow);\n return;\n }\n if (action) {\n element.href = linkService.getAnchorUrl(\"\");\n element.onclick = () => {\n linkService.executeNamedAction(action);\n return false;\n };\n return;\n }\n if (attachment) {\n element.href = linkService.getAnchorUrl(\"\");\n element.onclick = () => {\n this.downloadManager.openOrDownloadData(\n element,\n attachment.content,\n attachment.filename\n );\n return false;\n };\n return;\n }\n if (setOCGState) {\n element.href = linkService.getAnchorUrl(\"\");\n element.onclick = () => {\n linkService.executeSetOCGState(setOCGState);\n return false;\n };\n return;\n }\n\n element.href = linkService.getDestinationHash(dest);\n element.onclick = evt => {\n this._updateCurrentTreeItem(evt.target.parentNode);\n\n if (dest) {\n linkService.goToDestination(dest);\n }\n return false;\n };\n }\n\n /**\n * @private\n */\n _setStyles(element, { bold, italic }) {\n if (bold) {\n element.style.fontWeight = \"bold\";\n }\n if (italic) {\n element.style.fontStyle = \"italic\";\n }\n }\n\n /**\n * @private\n */\n _addToggleButton(div, { count, items }) {\n let hidden = false;\n if (count < 0) {\n let totalCount = items.length;\n if (totalCount > 0) {\n const queue = [...items];\n while (queue.length > 0) {\n const { count: nestedCount, items: nestedItems } = queue.shift();\n if (nestedCount > 0 && nestedItems.length > 0) {\n totalCount += nestedItems.length;\n queue.push(...nestedItems);\n }\n }\n }\n if (Math.abs(count) === totalCount) {\n hidden = true;\n }\n }\n super._addToggleButton(div, hidden);\n }\n\n /**\n * @private\n */\n _toggleAllTreeItems() {\n if (!this._outline) {\n return;\n }\n super._toggleAllTreeItems();\n }\n\n /**\n * @param {PDFOutlineViewerRenderParameters} params\n */\n render({ outline, pdfDocument }) {\n if (this._outline) {\n this.reset();\n }\n this._outline = outline || null;\n this._pdfDocument = pdfDocument || null;\n\n if (!outline) {\n this._dispatchEvent(/* outlineCount = */ 0);\n return;\n }\n\n const fragment = document.createDocumentFragment();\n const queue = [{ parent: fragment, items: outline }];\n let outlineCount = 0,\n hasAnyNesting = false;\n while (queue.length > 0) {\n const levelData = queue.shift();\n for (const item of levelData.items) {\n const div = document.createElement(\"div\");\n div.className = \"treeItem\";\n\n const element = document.createElement(\"a\");\n this._bindLink(element, item);\n this._setStyles(element, item);\n element.textContent = this._normalizeTextContent(item.title);\n\n div.append(element);\n\n if (item.items.length > 0) {\n hasAnyNesting = true;\n this._addToggleButton(div, item);\n\n const itemsDiv = document.createElement(\"div\");\n itemsDiv.className = \"treeItems\";\n div.append(itemsDiv);\n\n queue.push({ parent: itemsDiv, items: item.items });\n }\n\n levelData.parent.append(div);\n outlineCount++;\n }\n }\n\n this._finishRendering(fragment, outlineCount, hasAnyNesting);\n }\n\n /**\n * Find/highlight the current outline item, corresponding to the active page.\n * @private\n */\n async _currentOutlineItem() {\n if (!this._isPagesLoaded) {\n throw new Error(\"_currentOutlineItem: All pages have not been loaded.\");\n }\n if (!this._outline || !this._pdfDocument) {\n return;\n }\n\n const pageNumberToDestHash = await this._getPageNumberToDestHash(\n this._pdfDocument\n );\n if (!pageNumberToDestHash) {\n return;\n }\n this._updateCurrentTreeItem(/* treeItem = */ null);\n\n if (this._sidebarView !== SidebarView.OUTLINE) {\n return; // The outline view is no longer visible, hence do nothing.\n }\n // When there is no destination on the current page, always check the\n // previous ones in (reverse) order.\n for (let i = this._currentPageNumber; i > 0; i--) {\n const destHash = pageNumberToDestHash.get(i);\n if (!destHash) {\n continue;\n }\n const linkElement = this.container.querySelector(`a[href=\"${destHash}\"]`);\n if (!linkElement) {\n continue;\n }\n this._scrollToCurrentTreeItem(linkElement.parentNode);\n break;\n }\n }\n\n /**\n * To (significantly) simplify the overall implementation, we will only\n * consider *one* destination per page when finding/highlighting the current\n * outline item (similar to e.g. Adobe Reader); more specifically, we choose\n * the *first* outline item at the *lowest* level of the outline tree.\n * @private\n */\n async _getPageNumberToDestHash(pdfDocument) {\n if (this._pageNumberToDestHashCapability) {\n return this._pageNumberToDestHashCapability.promise;\n }\n this._pageNumberToDestHashCapability = new PromiseCapability();\n\n const pageNumberToDestHash = new Map(),\n pageNumberNesting = new Map();\n const queue = [{ nesting: 0, items: this._outline }];\n while (queue.length > 0) {\n const levelData = queue.shift(),\n currentNesting = levelData.nesting;\n for (const { dest, items } of levelData.items) {\n let explicitDest, pageNumber;\n if (typeof dest === \"string\") {\n explicitDest = await pdfDocument.getDestination(dest);\n\n if (pdfDocument !== this._pdfDocument) {\n return null; // The document was closed while the data resolved.\n }\n } else {\n explicitDest = dest;\n }\n if (Array.isArray(explicitDest)) {\n const [destRef] = explicitDest;\n\n if (typeof destRef === \"object\" && destRef !== null) {\n pageNumber = this.linkService._cachedPageNumber(destRef);\n\n if (!pageNumber) {\n try {\n pageNumber = (await pdfDocument.getPageIndex(destRef)) + 1;\n\n if (pdfDocument !== this._pdfDocument) {\n return null; // The document was closed while the data resolved.\n }\n this.linkService.cachePageRef(pageNumber, destRef);\n } catch {\n // Invalid page reference, ignore it and continue parsing.\n }\n }\n } else if (Number.isInteger(destRef)) {\n pageNumber = destRef + 1;\n }\n\n if (\n Number.isInteger(pageNumber) &&\n (!pageNumberToDestHash.has(pageNumber) ||\n currentNesting > pageNumberNesting.get(pageNumber))\n ) {\n const destHash = this.linkService.getDestinationHash(dest);\n pageNumberToDestHash.set(pageNumber, destHash);\n pageNumberNesting.set(pageNumber, currentNesting);\n }\n }\n\n if (items.length > 0) {\n queue.push({ nesting: currentNesting + 1, items });\n }\n }\n }\n\n this._pageNumberToDestHashCapability.resolve(\n pageNumberToDestHash.size > 0 ? pageNumberToDestHash : null\n );\n return this._pageNumberToDestHashCapability.promise;\n }\n}\n\nexport { PDFOutlineViewer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n normalizeWheelEventDelta,\n PresentationModeState,\n ScrollMode,\n SpreadMode,\n} from \"./ui_utils.js\";\nimport { AnnotationEditorType } from \"pdfjs-lib\";\n\nconst DELAY_BEFORE_HIDING_CONTROLS = 3000; // in ms\nconst ACTIVE_SELECTOR = \"pdfPresentationMode\";\nconst CONTROLS_SELECTOR = \"pdfPresentationModeControls\";\nconst MOUSE_SCROLL_COOLDOWN_TIME = 50; // in ms\nconst PAGE_SWITCH_THRESHOLD = 0.1;\n\n// Number of CSS pixels for a movement to count as a swipe.\nconst SWIPE_MIN_DISTANCE_THRESHOLD = 50;\n\n// Swipe angle deviation from the x or y axis before it is not\n// considered a swipe in that direction any more.\nconst SWIPE_ANGLE_THRESHOLD = Math.PI / 6;\n\n/**\n * @typedef {Object} PDFPresentationModeOptions\n * @property {HTMLDivElement} container - The container for the viewer element.\n * @property {PDFViewer} pdfViewer - The document viewer.\n * @property {EventBus} eventBus - The application event bus.\n */\n\nclass PDFPresentationMode {\n #state = PresentationModeState.UNKNOWN;\n\n #args = null;\n\n /**\n * @param {PDFPresentationModeOptions} options\n */\n constructor({ container, pdfViewer, eventBus }) {\n this.container = container;\n this.pdfViewer = pdfViewer;\n this.eventBus = eventBus;\n\n this.contextMenuOpen = false;\n this.mouseScrollTimeStamp = 0;\n this.mouseScrollDelta = 0;\n this.touchSwipeState = null;\n }\n\n /**\n * Request the browser to enter fullscreen mode.\n * @returns {Promise<boolean>} Indicating if the request was successful.\n */\n async request() {\n const { container, pdfViewer } = this;\n\n if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) {\n return false;\n }\n this.#addFullscreenChangeListeners();\n this.#notifyStateChange(PresentationModeState.CHANGING);\n\n const promise = container.requestFullscreen();\n\n this.#args = {\n pageNumber: pdfViewer.currentPageNumber,\n scaleValue: pdfViewer.currentScaleValue,\n scrollMode: pdfViewer.scrollMode,\n spreadMode: null,\n annotationEditorMode: null,\n };\n\n if (\n pdfViewer.spreadMode !== SpreadMode.NONE &&\n !(pdfViewer.pageViewsReady && pdfViewer.hasEqualPageSizes)\n ) {\n console.warn(\n \"Ignoring Spread modes when entering PresentationMode, \" +\n \"since the document may contain varying page sizes.\"\n );\n this.#args.spreadMode = pdfViewer.spreadMode;\n }\n if (pdfViewer.annotationEditorMode !== AnnotationEditorType.DISABLE) {\n this.#args.annotationEditorMode = pdfViewer.annotationEditorMode;\n }\n\n try {\n await promise;\n pdfViewer.focus(); // Fixes bug 1787456.\n return true;\n } catch {\n this.#removeFullscreenChangeListeners();\n this.#notifyStateChange(PresentationModeState.NORMAL);\n }\n return false;\n }\n\n get active() {\n return (\n this.#state === PresentationModeState.CHANGING ||\n this.#state === PresentationModeState.FULLSCREEN\n );\n }\n\n #mouseWheel(evt) {\n if (!this.active) {\n return;\n }\n evt.preventDefault();\n\n const delta = normalizeWheelEventDelta(evt);\n const currentTime = Date.now();\n const storedTime = this.mouseScrollTimeStamp;\n\n // If we've already switched page, avoid accidentally switching again.\n if (\n currentTime > storedTime &&\n currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME\n ) {\n return;\n }\n // If the scroll direction changed, reset the accumulated scroll delta.\n if (\n (this.mouseScrollDelta > 0 && delta < 0) ||\n (this.mouseScrollDelta < 0 && delta > 0)\n ) {\n this.#resetMouseScrollState();\n }\n this.mouseScrollDelta += delta;\n\n if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) {\n const totalDelta = this.mouseScrollDelta;\n this.#resetMouseScrollState();\n const success =\n totalDelta > 0\n ? this.pdfViewer.previousPage()\n : this.pdfViewer.nextPage();\n if (success) {\n this.mouseScrollTimeStamp = currentTime;\n }\n }\n }\n\n #notifyStateChange(state) {\n this.#state = state;\n\n this.eventBus.dispatch(\"presentationmodechanged\", { source: this, state });\n }\n\n #enter() {\n this.#notifyStateChange(PresentationModeState.FULLSCREEN);\n this.container.classList.add(ACTIVE_SELECTOR);\n\n // Ensure that the correct page is scrolled into view when entering\n // Presentation Mode, by waiting until fullscreen mode in enabled.\n setTimeout(() => {\n this.pdfViewer.scrollMode = ScrollMode.PAGE;\n if (this.#args.spreadMode !== null) {\n this.pdfViewer.spreadMode = SpreadMode.NONE;\n }\n this.pdfViewer.currentPageNumber = this.#args.pageNumber;\n this.pdfViewer.currentScaleValue = \"page-fit\";\n\n if (this.#args.annotationEditorMode !== null) {\n this.pdfViewer.annotationEditorMode = {\n mode: AnnotationEditorType.NONE,\n };\n }\n }, 0);\n\n this.#addWindowListeners();\n this.#showControls();\n this.contextMenuOpen = false;\n\n // Text selection is disabled in Presentation Mode, thus it's not possible\n // for the user to deselect text that is selected (e.g. with \"Select all\")\n // when entering Presentation Mode, hence we remove any active selection.\n window.getSelection().removeAllRanges();\n }\n\n #exit() {\n const pageNumber = this.pdfViewer.currentPageNumber;\n this.container.classList.remove(ACTIVE_SELECTOR);\n\n // Ensure that the correct page is scrolled into view when exiting\n // Presentation Mode, by waiting until fullscreen mode is disabled.\n setTimeout(() => {\n this.#removeFullscreenChangeListeners();\n this.#notifyStateChange(PresentationModeState.NORMAL);\n\n this.pdfViewer.scrollMode = this.#args.scrollMode;\n if (this.#args.spreadMode !== null) {\n this.pdfViewer.spreadMode = this.#args.spreadMode;\n }\n this.pdfViewer.currentScaleValue = this.#args.scaleValue;\n this.pdfViewer.currentPageNumber = pageNumber;\n\n if (this.#args.annotationEditorMode !== null) {\n this.pdfViewer.annotationEditorMode = {\n mode: this.#args.annotationEditorMode,\n };\n }\n this.#args = null;\n }, 0);\n\n this.#removeWindowListeners();\n this.#hideControls();\n this.#resetMouseScrollState();\n this.contextMenuOpen = false;\n }\n\n #mouseDown(evt) {\n if (this.contextMenuOpen) {\n this.contextMenuOpen = false;\n evt.preventDefault();\n return;\n }\n if (evt.button !== 0) {\n return;\n }\n // Enable clicking of links in presentation mode. Note: only links\n // pointing to destinations in the current PDF document work.\n if (\n evt.target.href &&\n evt.target.parentNode?.hasAttribute(\"data-internal-link\")\n ) {\n return;\n }\n // Unless an internal link was clicked, advance one page.\n evt.preventDefault();\n\n if (evt.shiftKey) {\n this.pdfViewer.previousPage();\n } else {\n this.pdfViewer.nextPage();\n }\n }\n\n #contextMenu() {\n this.contextMenuOpen = true;\n }\n\n #showControls() {\n if (this.controlsTimeout) {\n clearTimeout(this.controlsTimeout);\n } else {\n this.container.classList.add(CONTROLS_SELECTOR);\n }\n this.controlsTimeout = setTimeout(() => {\n this.container.classList.remove(CONTROLS_SELECTOR);\n delete this.controlsTimeout;\n }, DELAY_BEFORE_HIDING_CONTROLS);\n }\n\n #hideControls() {\n if (!this.controlsTimeout) {\n return;\n }\n clearTimeout(this.controlsTimeout);\n this.container.classList.remove(CONTROLS_SELECTOR);\n delete this.controlsTimeout;\n }\n\n /**\n * Resets the properties used for tracking mouse scrolling events.\n */\n #resetMouseScrollState() {\n this.mouseScrollTimeStamp = 0;\n this.mouseScrollDelta = 0;\n }\n\n #touchSwipe(evt) {\n if (!this.active) {\n return;\n }\n if (evt.touches.length > 1) {\n // Multiple touch points detected; cancel the swipe.\n this.touchSwipeState = null;\n return;\n }\n\n switch (evt.type) {\n case \"touchstart\":\n this.touchSwipeState = {\n startX: evt.touches[0].pageX,\n startY: evt.touches[0].pageY,\n endX: evt.touches[0].pageX,\n endY: evt.touches[0].pageY,\n };\n break;\n case \"touchmove\":\n if (this.touchSwipeState === null) {\n return;\n }\n this.touchSwipeState.endX = evt.touches[0].pageX;\n this.touchSwipeState.endY = evt.touches[0].pageY;\n // Avoid the swipe from triggering browser gestures (Chrome in\n // particular has some sort of swipe gesture in fullscreen mode).\n evt.preventDefault();\n break;\n case \"touchend\":\n if (this.touchSwipeState === null) {\n return;\n }\n let delta = 0;\n const dx = this.touchSwipeState.endX - this.touchSwipeState.startX;\n const dy = this.touchSwipeState.endY - this.touchSwipeState.startY;\n const absAngle = Math.abs(Math.atan2(dy, dx));\n if (\n Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD &&\n (absAngle <= SWIPE_ANGLE_THRESHOLD ||\n absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)\n ) {\n // Horizontal swipe.\n delta = dx;\n } else if (\n Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD &&\n Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD\n ) {\n // Vertical swipe.\n delta = dy;\n }\n if (delta > 0) {\n this.pdfViewer.previousPage();\n } else if (delta < 0) {\n this.pdfViewer.nextPage();\n }\n break;\n }\n }\n\n #addWindowListeners() {\n this.showControlsBind = this.#showControls.bind(this);\n this.mouseDownBind = this.#mouseDown.bind(this);\n this.mouseWheelBind = this.#mouseWheel.bind(this);\n this.resetMouseScrollStateBind = this.#resetMouseScrollState.bind(this);\n this.contextMenuBind = this.#contextMenu.bind(this);\n this.touchSwipeBind = this.#touchSwipe.bind(this);\n\n window.addEventListener(\"mousemove\", this.showControlsBind);\n window.addEventListener(\"mousedown\", this.mouseDownBind);\n window.addEventListener(\"wheel\", this.mouseWheelBind, { passive: false });\n window.addEventListener(\"keydown\", this.resetMouseScrollStateBind);\n window.addEventListener(\"contextmenu\", this.contextMenuBind);\n window.addEventListener(\"touchstart\", this.touchSwipeBind);\n window.addEventListener(\"touchmove\", this.touchSwipeBind);\n window.addEventListener(\"touchend\", this.touchSwipeBind);\n }\n\n #removeWindowListeners() {\n window.removeEventListener(\"mousemove\", this.showControlsBind);\n window.removeEventListener(\"mousedown\", this.mouseDownBind);\n window.removeEventListener(\"wheel\", this.mouseWheelBind, {\n passive: false,\n });\n window.removeEventListener(\"keydown\", this.resetMouseScrollStateBind);\n window.removeEventListener(\"contextmenu\", this.contextMenuBind);\n window.removeEventListener(\"touchstart\", this.touchSwipeBind);\n window.removeEventListener(\"touchmove\", this.touchSwipeBind);\n window.removeEventListener(\"touchend\", this.touchSwipeBind);\n\n delete this.showControlsBind;\n delete this.mouseDownBind;\n delete this.mouseWheelBind;\n delete this.resetMouseScrollStateBind;\n delete this.contextMenuBind;\n delete this.touchSwipeBind;\n }\n\n #fullscreenChange() {\n if (/* isFullscreen = */ document.fullscreenElement) {\n this.#enter();\n } else {\n this.#exit();\n }\n }\n\n #addFullscreenChangeListeners() {\n this.fullscreenChangeBind = this.#fullscreenChange.bind(this);\n window.addEventListener(\"fullscreenchange\", this.fullscreenChangeBind);\n }\n\n #removeFullscreenChangeListeners() {\n window.removeEventListener(\"fullscreenchange\", this.fullscreenChangeBind);\n delete this.fullscreenChangeBind;\n }\n}\n\nexport { PDFPresentationMode };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./interfaces\").IRenderableView} IRenderableView */\n/** @typedef {import(\"./pdf_viewer\").PDFViewer} PDFViewer */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_thumbnail_viewer\").PDFThumbnailViewer} PDFThumbnailViewer */\n\nimport { RenderingCancelledException } from \"pdfjs-lib\";\nimport { RenderingStates } from \"./ui_utils.js\";\n\nconst CLEANUP_TIMEOUT = 30000;\n\n/**\n * Controls rendering of the views for pages and thumbnails.\n */\nclass PDFRenderingQueue {\n constructor() {\n this.pdfViewer = null;\n this.pdfThumbnailViewer = null;\n this.onIdle = null;\n this.highestPriorityPage = null;\n /** @type {number} */\n this.idleTimeout = null;\n this.printing = false;\n this.isThumbnailViewEnabled = false;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n Object.defineProperty(this, \"hasViewer\", {\n value: () => !!this.pdfViewer,\n });\n }\n }\n\n /**\n * @param {PDFViewer} pdfViewer\n */\n setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n\n /**\n * @param {PDFThumbnailViewer} pdfThumbnailViewer\n */\n setThumbnailViewer(pdfThumbnailViewer) {\n this.pdfThumbnailViewer = pdfThumbnailViewer;\n }\n\n /**\n * @param {IRenderableView} view\n * @returns {boolean}\n */\n isHighestPriority(view) {\n return this.highestPriorityPage === view.renderingId;\n }\n\n /**\n * @param {Object} currentlyVisiblePages\n */\n renderHighestPriority(currentlyVisiblePages) {\n if (this.idleTimeout) {\n clearTimeout(this.idleTimeout);\n this.idleTimeout = null;\n }\n\n // Pages have a higher priority than thumbnails, so check them first.\n if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {\n return;\n }\n // No pages needed rendering, so check thumbnails.\n if (\n this.isThumbnailViewEnabled &&\n this.pdfThumbnailViewer?.forceRendering()\n ) {\n return;\n }\n\n if (this.printing) {\n // If printing is currently ongoing do not reschedule cleanup.\n return;\n }\n\n if (this.onIdle) {\n this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);\n }\n }\n\n /**\n * @param {Object} visible\n * @param {Array} views\n * @param {boolean} scrolledDown\n * @param {boolean} [preRenderExtra]\n */\n getHighestPriority(visible, views, scrolledDown, preRenderExtra = false) {\n /**\n * The state has changed. Figure out which page has the highest priority to\n * render next (if any).\n *\n * Priority:\n * 1. visible pages\n * 2. if last scrolled down, the page after the visible pages, or\n * if last scrolled up, the page before the visible pages\n */\n const visibleViews = visible.views,\n numVisible = visibleViews.length;\n\n if (numVisible === 0) {\n return null;\n }\n for (let i = 0; i < numVisible; i++) {\n const view = visibleViews[i].view;\n if (!this.isViewFinished(view)) {\n return view;\n }\n }\n const firstId = visible.first.id,\n lastId = visible.last.id;\n\n // All the visible views have rendered; try to handle any \"holes\" in the\n // page layout (can happen e.g. with spreadModes at higher zoom levels).\n if (lastId - firstId + 1 > numVisible) {\n const visibleIds = visible.ids;\n for (let i = 1, ii = lastId - firstId; i < ii; i++) {\n const holeId = scrolledDown ? firstId + i : lastId - i;\n if (visibleIds.has(holeId)) {\n continue;\n }\n const holeView = views[holeId - 1];\n if (!this.isViewFinished(holeView)) {\n return holeView;\n }\n }\n }\n\n // All the visible views have rendered; try to render next/previous page.\n // (IDs start at 1, so no need to add 1 when `scrolledDown === true`.)\n let preRenderIndex = scrolledDown ? lastId : firstId - 2;\n let preRenderView = views[preRenderIndex];\n\n if (preRenderView && !this.isViewFinished(preRenderView)) {\n return preRenderView;\n }\n if (preRenderExtra) {\n preRenderIndex += scrolledDown ? 1 : -1;\n preRenderView = views[preRenderIndex];\n\n if (preRenderView && !this.isViewFinished(preRenderView)) {\n return preRenderView;\n }\n }\n // Everything that needs to be rendered has been.\n return null;\n }\n\n /**\n * @param {IRenderableView} view\n * @returns {boolean}\n */\n isViewFinished(view) {\n return view.renderingState === RenderingStates.FINISHED;\n }\n\n /**\n * Render a page or thumbnail view. This calls the appropriate function\n * based on the views state. If the view is already rendered it will return\n * `false`.\n *\n * @param {IRenderableView} view\n */\n renderView(view) {\n switch (view.renderingState) {\n case RenderingStates.FINISHED:\n return false;\n case RenderingStates.PAUSED:\n this.highestPriorityPage = view.renderingId;\n view.resume();\n break;\n case RenderingStates.RUNNING:\n this.highestPriorityPage = view.renderingId;\n break;\n case RenderingStates.INITIAL:\n this.highestPriorityPage = view.renderingId;\n view\n .draw()\n .finally(() => {\n this.renderHighestPriority();\n })\n .catch(reason => {\n if (reason instanceof RenderingCancelledException) {\n return;\n }\n console.error(`renderView: \"${reason}\"`);\n });\n break;\n }\n return true;\n }\n}\n\nexport { PDFRenderingQueue };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n\nimport { apiPageLayoutToViewerModes, RenderingStates } from \"./ui_utils.js\";\nimport { PromiseCapability, shadow } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} PDFScriptingManagerOptions\n * @property {EventBus} eventBus - The application event bus.\n * @property {string} sandboxBundleSrc - The path and filename of the scripting\n * bundle.\n * @property {Object} [externalServices] - The factory that is used when\n * initializing scripting; must contain a `createScripting` method.\n * PLEASE NOTE: Primarily intended for the default viewer use-case.\n * @property {function} [docProperties] - The function that is used to lookup\n * the necessary document properties.\n */\n\nclass PDFScriptingManager {\n #closeCapability = null;\n\n #destroyCapability = null;\n\n #docProperties = null;\n\n #eventBus = null;\n\n #externalServices = null;\n\n #pdfDocument = null;\n\n #pdfViewer = null;\n\n #ready = false;\n\n #sandboxBundleSrc = null;\n\n #scripting = null;\n\n #willPrintCapability = null;\n\n /**\n * @param {PDFScriptingManagerOptions} options\n */\n constructor({\n eventBus,\n sandboxBundleSrc = null,\n externalServices = null,\n docProperties = null,\n }) {\n this.#eventBus = eventBus;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC || CHROME\")) {\n this.#sandboxBundleSrc = sandboxBundleSrc;\n }\n this.#externalServices = externalServices;\n this.#docProperties = docProperties;\n }\n\n setViewer(pdfViewer) {\n this.#pdfViewer = pdfViewer;\n }\n\n async setDocument(pdfDocument) {\n if (this.#pdfDocument) {\n await this.#destroyScripting();\n }\n this.#pdfDocument = pdfDocument;\n\n if (!pdfDocument) {\n return;\n }\n const [objects, calculationOrder, docActions] = await Promise.all([\n pdfDocument.getFieldObjects(),\n pdfDocument.getCalculationOrderIds(),\n pdfDocument.getJSActions(),\n ]);\n\n if (!objects && !docActions) {\n // No FieldObjects or JavaScript actions were found in the document.\n await this.#destroyScripting();\n return;\n }\n if (pdfDocument !== this.#pdfDocument) {\n return; // The document was closed while the data resolved.\n }\n try {\n this.#scripting = this.#initScripting();\n } catch (error) {\n console.error(`setDocument: \"${error.message}\".`);\n\n await this.#destroyScripting();\n return;\n }\n\n this._internalEvents.set(\"updatefromsandbox\", event => {\n if (event?.source === window) {\n this.#updateFromSandbox(event.detail);\n }\n });\n this._internalEvents.set(\"dispatcheventinsandbox\", event => {\n this.#scripting?.dispatchEventInSandbox(event.detail);\n });\n\n this._internalEvents.set(\"pagechanging\", ({ pageNumber, previous }) => {\n if (pageNumber === previous) {\n return; // The current page didn't change.\n }\n this.#dispatchPageClose(previous);\n this.#dispatchPageOpen(pageNumber);\n });\n this._internalEvents.set(\"pagerendered\", ({ pageNumber }) => {\n if (!this._pageOpenPending.has(pageNumber)) {\n return; // No pending \"PageOpen\" event for the newly rendered page.\n }\n if (pageNumber !== this.#pdfViewer.currentPageNumber) {\n return; // The newly rendered page is no longer the current one.\n }\n this.#dispatchPageOpen(pageNumber);\n });\n this._internalEvents.set(\"pagesdestroy\", async () => {\n await this.#dispatchPageClose(this.#pdfViewer.currentPageNumber);\n\n await this.#scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillClose\",\n });\n\n this.#closeCapability?.resolve();\n });\n\n for (const [name, listener] of this._internalEvents) {\n this.#eventBus._on(name, listener);\n }\n\n try {\n const docProperties = await this.#docProperties(pdfDocument);\n if (pdfDocument !== this.#pdfDocument) {\n return; // The document was closed while the properties resolved.\n }\n\n await this.#scripting.createSandbox({\n objects,\n calculationOrder,\n appInfo: {\n platform: navigator.platform,\n language: navigator.language,\n },\n docInfo: {\n ...docProperties,\n actions: docActions,\n },\n });\n\n this.#eventBus.dispatch(\"sandboxcreated\", { source: this });\n } catch (error) {\n console.error(`setDocument: \"${error.message}\".`);\n\n await this.#destroyScripting();\n return;\n }\n\n await this.#scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"Open\",\n });\n await this.#dispatchPageOpen(\n this.#pdfViewer.currentPageNumber,\n /* initialize = */ true\n );\n\n // Defer this slightly, to ensure that scripting is *fully* initialized.\n Promise.resolve().then(() => {\n if (pdfDocument === this.#pdfDocument) {\n this.#ready = true;\n }\n });\n }\n\n async dispatchWillSave() {\n return this.#scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillSave\",\n });\n }\n\n async dispatchDidSave() {\n return this.#scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"DidSave\",\n });\n }\n\n async dispatchWillPrint() {\n if (!this.#scripting) {\n return;\n }\n await this.#willPrintCapability?.promise;\n this.#willPrintCapability = new PromiseCapability();\n try {\n await this.#scripting.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillPrint\",\n });\n } catch (ex) {\n this.#willPrintCapability.resolve();\n this.#willPrintCapability = null;\n throw ex;\n }\n\n await this.#willPrintCapability.promise;\n }\n\n async dispatchDidPrint() {\n return this.#scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"DidPrint\",\n });\n }\n\n get destroyPromise() {\n return this.#destroyCapability?.promise || null;\n }\n\n get ready() {\n return this.#ready;\n }\n\n /**\n * @private\n */\n get _internalEvents() {\n return shadow(this, \"_internalEvents\", new Map());\n }\n\n /**\n * @private\n */\n get _pageOpenPending() {\n return shadow(this, \"_pageOpenPending\", new Set());\n }\n\n /**\n * @private\n */\n get _visitedPages() {\n return shadow(this, \"_visitedPages\", new Map());\n }\n\n async #updateFromSandbox(detail) {\n const pdfViewer = this.#pdfViewer;\n // Ignore some events, see below, that don't make sense in PresentationMode.\n const isInPresentationMode =\n pdfViewer.isInPresentationMode || pdfViewer.isChangingPresentationMode;\n\n const { id, siblings, command, value } = detail;\n if (!id) {\n switch (command) {\n case \"clear\":\n console.clear();\n break;\n case \"error\":\n console.error(value);\n break;\n case \"layout\":\n if (!isInPresentationMode) {\n const modes = apiPageLayoutToViewerModes(value);\n pdfViewer.spreadMode = modes.spreadMode;\n }\n break;\n case \"page-num\":\n pdfViewer.currentPageNumber = value + 1;\n break;\n case \"print\":\n await pdfViewer.pagesPromise;\n this.#eventBus.dispatch(\"print\", { source: this });\n break;\n case \"println\":\n console.log(value);\n break;\n case \"zoom\":\n if (!isInPresentationMode) {\n pdfViewer.currentScaleValue = value;\n }\n break;\n case \"SaveAs\":\n this.#eventBus.dispatch(\"download\", { source: this });\n break;\n case \"FirstPage\":\n pdfViewer.currentPageNumber = 1;\n break;\n case \"LastPage\":\n pdfViewer.currentPageNumber = pdfViewer.pagesCount;\n break;\n case \"NextPage\":\n pdfViewer.nextPage();\n break;\n case \"PrevPage\":\n pdfViewer.previousPage();\n break;\n case \"ZoomViewIn\":\n if (!isInPresentationMode) {\n pdfViewer.increaseScale();\n }\n break;\n case \"ZoomViewOut\":\n if (!isInPresentationMode) {\n pdfViewer.decreaseScale();\n }\n break;\n case \"WillPrintFinished\":\n this.#willPrintCapability?.resolve();\n this.#willPrintCapability = null;\n break;\n }\n return;\n }\n\n if (isInPresentationMode && detail.focus) {\n return;\n }\n delete detail.id;\n delete detail.siblings;\n\n const ids = siblings ? [id, ...siblings] : [id];\n for (const elementId of ids) {\n const element = document.querySelector(\n `[data-element-id=\"${elementId}\"]`\n );\n if (element) {\n element.dispatchEvent(new CustomEvent(\"updatefromsandbox\", { detail }));\n } else {\n // The element hasn't been rendered yet, use the AnnotationStorage.\n this.#pdfDocument?.annotationStorage.setValue(elementId, detail);\n }\n }\n }\n\n async #dispatchPageOpen(pageNumber, initialize = false) {\n const pdfDocument = this.#pdfDocument,\n visitedPages = this._visitedPages;\n\n if (initialize) {\n this.#closeCapability = new PromiseCapability();\n }\n if (!this.#closeCapability) {\n return; // Scripting isn't fully initialized yet.\n }\n const pageView = this.#pdfViewer.getPageView(/* index = */ pageNumber - 1);\n\n if (pageView?.renderingState !== RenderingStates.FINISHED) {\n this._pageOpenPending.add(pageNumber);\n return; // Wait for the page to finish rendering.\n }\n this._pageOpenPending.delete(pageNumber);\n\n const actionsPromise = (async () => {\n // Avoid sending, and thus serializing, the `actions` data more than once.\n const actions = await (!visitedPages.has(pageNumber)\n ? pageView.pdfPage?.getJSActions()\n : null);\n if (pdfDocument !== this.#pdfDocument) {\n return; // The document was closed while the actions resolved.\n }\n\n await this.#scripting?.dispatchEventInSandbox({\n id: \"page\",\n name: \"PageOpen\",\n pageNumber,\n actions,\n });\n })();\n visitedPages.set(pageNumber, actionsPromise);\n }\n\n async #dispatchPageClose(pageNumber) {\n const pdfDocument = this.#pdfDocument,\n visitedPages = this._visitedPages;\n\n if (!this.#closeCapability) {\n return; // Scripting isn't fully initialized yet.\n }\n if (this._pageOpenPending.has(pageNumber)) {\n return; // The page is still rendering; no \"PageOpen\" event dispatched.\n }\n const actionsPromise = visitedPages.get(pageNumber);\n if (!actionsPromise) {\n return; // The \"PageClose\" event must be preceded by a \"PageOpen\" event.\n }\n visitedPages.set(pageNumber, null);\n\n // Ensure that the \"PageOpen\" event is dispatched first.\n await actionsPromise;\n if (pdfDocument !== this.#pdfDocument) {\n return; // The document was closed while the actions resolved.\n }\n\n await this.#scripting?.dispatchEventInSandbox({\n id: \"page\",\n name: \"PageClose\",\n pageNumber,\n });\n }\n\n #initScripting() {\n this.#destroyCapability = new PromiseCapability();\n\n if (this.#scripting) {\n throw new Error(\"#initScripting: Scripting already exists.\");\n }\n return this.#externalServices.createScripting({\n sandboxBundleSrc: this.#sandboxBundleSrc,\n });\n }\n\n async #destroyScripting() {\n if (!this.#scripting) {\n this.#pdfDocument = null;\n\n this.#destroyCapability?.resolve();\n return;\n }\n if (this.#closeCapability) {\n await Promise.race([\n this.#closeCapability.promise,\n new Promise(resolve => {\n // Avoid the scripting/sandbox-destruction hanging indefinitely.\n setTimeout(resolve, 1000);\n }),\n ]).catch(() => {\n // Ignore any errors, to ensure that the sandbox is always destroyed.\n });\n this.#closeCapability = null;\n }\n this.#pdfDocument = null;\n\n try {\n await this.#scripting.destroySandbox();\n } catch {}\n\n this.#willPrintCapability?.reject(new Error(\"Scripting destroyed.\"));\n this.#willPrintCapability = null;\n\n for (const [name, listener] of this._internalEvents) {\n this.#eventBus._off(name, listener);\n }\n this._internalEvents.clear();\n\n this._pageOpenPending.clear();\n this._visitedPages.clear();\n\n this.#scripting = null;\n this.#ready = false;\n\n this.#destroyCapability?.resolve();\n }\n}\n\nexport { PDFScriptingManager };\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n docStyle,\n PresentationModeState,\n SidebarView,\n toggleCheckedBtn,\n toggleExpandedBtn,\n} from \"./ui_utils.js\";\n\nconst SIDEBAR_WIDTH_VAR = \"--sidebar-width\";\nconst SIDEBAR_MIN_WIDTH = 200; // pixels\nconst SIDEBAR_RESIZING_CLASS = \"sidebarResizing\";\nconst UI_NOTIFICATION_CLASS = \"pdfSidebarNotification\";\n\n/**\n * @typedef {Object} PDFSidebarOptions\n * @property {PDFSidebarElements} elements - The DOM elements.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IL10n} l10n - The localization service.\n */\n\n/**\n * @typedef {Object} PDFSidebarElements\n * @property {HTMLDivElement} outerContainer - The outer container\n * (encasing both the viewer and sidebar elements).\n * @property {HTMLDivElement} sidebarContainer - The sidebar container\n * (in which the views are placed).\n * @property {HTMLButtonElement} toggleButton - The button used for\n * opening/closing the sidebar.\n * @property {HTMLDivElement} resizer - The DOM element that can be dragged in\n * order to adjust the width of the sidebar.\n * @property {HTMLButtonElement} thumbnailButton - The button used to show\n * the thumbnail view.\n * @property {HTMLButtonElement} outlineButton - The button used to show\n * the outline view.\n * @property {HTMLButtonElement} attachmentsButton - The button used to show\n * the attachments view.\n * @property {HTMLButtonElement} layersButton - The button used to show\n * the layers view.\n * @property {HTMLDivElement} thumbnailView - The container in which\n * the thumbnails are placed.\n * @property {HTMLDivElement} outlineView - The container in which\n * the outline is placed.\n * @property {HTMLDivElement} attachmentsView - The container in which\n * the attachments are placed.\n * @property {HTMLDivElement} layersView - The container in which\n * the layers are placed.\n * @property {HTMLDivElement} outlineOptionsContainer - The container in which\n * the outline view-specific option button(s) are placed.\n * @property {HTMLButtonElement} currentOutlineItemButton - The button used to\n * find the current outline item.\n */\n\nclass PDFSidebar {\n #isRTL = false;\n\n #mouseMoveBound = this.#mouseMove.bind(this);\n\n #mouseUpBound = this.#mouseUp.bind(this);\n\n #outerContainerWidth = null;\n\n #width = null;\n\n /**\n * @param {PDFSidebarOptions} options\n */\n constructor({ elements, eventBus, l10n }) {\n this.isOpen = false;\n this.active = SidebarView.THUMBS;\n this.isInitialViewSet = false;\n this.isInitialEventDispatched = false;\n\n /**\n * Callback used when the sidebar has been opened/closed, to ensure that\n * the viewers (PDFViewer/PDFThumbnailViewer) are updated correctly.\n */\n this.onToggled = null;\n this.onUpdateThumbnails = null;\n\n this.outerContainer = elements.outerContainer;\n this.sidebarContainer = elements.sidebarContainer;\n this.toggleButton = elements.toggleButton;\n this.resizer = elements.resizer;\n\n this.thumbnailButton = elements.thumbnailButton;\n this.outlineButton = elements.outlineButton;\n this.attachmentsButton = elements.attachmentsButton;\n this.layersButton = elements.layersButton;\n\n this.thumbnailView = elements.thumbnailView;\n this.outlineView = elements.outlineView;\n this.attachmentsView = elements.attachmentsView;\n this.layersView = elements.layersView;\n\n this._outlineOptionsContainer = elements.outlineOptionsContainer;\n this._currentOutlineItemButton = elements.currentOutlineItemButton;\n\n this.eventBus = eventBus;\n this.l10n = l10n;\n\n l10n.getDirection().then(dir => {\n this.#isRTL = dir === \"rtl\";\n });\n this.#addEventListeners();\n }\n\n reset() {\n this.isInitialViewSet = false;\n this.isInitialEventDispatched = false;\n\n this.#hideUINotification(/* reset = */ true);\n this.switchView(SidebarView.THUMBS);\n\n this.outlineButton.disabled = false;\n this.attachmentsButton.disabled = false;\n this.layersButton.disabled = false;\n this._currentOutlineItemButton.disabled = true;\n }\n\n /**\n * @type {number} One of the values in {SidebarView}.\n */\n get visibleView() {\n return this.isOpen ? this.active : SidebarView.NONE;\n }\n\n /**\n * @param {number} view - The sidebar view that should become visible,\n * must be one of the values in {SidebarView}.\n */\n setInitialView(view = SidebarView.NONE) {\n if (this.isInitialViewSet) {\n return;\n }\n this.isInitialViewSet = true;\n\n // If the user has already manually opened the sidebar, immediately closing\n // it would be bad UX; also ignore the \"unknown\" sidebar view value.\n if (view === SidebarView.NONE || view === SidebarView.UNKNOWN) {\n this.#dispatchEvent();\n return;\n }\n this.switchView(view, /* forceOpen = */ true);\n\n // Prevent dispatching two back-to-back \"sidebarviewchanged\" events,\n // since `this.switchView` dispatched the event if the view changed.\n if (!this.isInitialEventDispatched) {\n this.#dispatchEvent();\n }\n }\n\n /**\n * @param {number} view - The sidebar view that should be switched to,\n * must be one of the values in {SidebarView}.\n * @param {boolean} [forceOpen] - Ensure that the sidebar is open.\n * The default value is `false`.\n */\n switchView(view, forceOpen = false) {\n const isViewChanged = view !== this.active;\n let forceRendering = false;\n\n switch (view) {\n case SidebarView.NONE:\n if (this.isOpen) {\n this.close();\n }\n return; // Closing will trigger rendering and dispatch the event.\n case SidebarView.THUMBS:\n if (this.isOpen && isViewChanged) {\n forceRendering = true;\n }\n break;\n case SidebarView.OUTLINE:\n if (this.outlineButton.disabled) {\n return;\n }\n break;\n case SidebarView.ATTACHMENTS:\n if (this.attachmentsButton.disabled) {\n return;\n }\n break;\n case SidebarView.LAYERS:\n if (this.layersButton.disabled) {\n return;\n }\n break;\n default:\n console.error(`PDFSidebar.switchView: \"${view}\" is not a valid view.`);\n return;\n }\n // Update the active view *after* it has been validated above,\n // in order to prevent setting it to an invalid state.\n this.active = view;\n\n // Update the CSS classes (and aria attributes), for all buttons and views.\n toggleCheckedBtn(\n this.thumbnailButton,\n view === SidebarView.THUMBS,\n this.thumbnailView\n );\n toggleCheckedBtn(\n this.outlineButton,\n view === SidebarView.OUTLINE,\n this.outlineView\n );\n toggleCheckedBtn(\n this.attachmentsButton,\n view === SidebarView.ATTACHMENTS,\n this.attachmentsView\n );\n toggleCheckedBtn(\n this.layersButton,\n view === SidebarView.LAYERS,\n this.layersView\n );\n\n // Finally, update view-specific CSS classes.\n this._outlineOptionsContainer.classList.toggle(\n \"hidden\",\n view !== SidebarView.OUTLINE\n );\n\n if (forceOpen && !this.isOpen) {\n this.open();\n return; // Opening will trigger rendering and dispatch the event.\n }\n if (forceRendering) {\n this.onUpdateThumbnails();\n this.onToggled();\n }\n if (isViewChanged) {\n this.#dispatchEvent();\n }\n }\n\n open() {\n if (this.isOpen) {\n return;\n }\n this.isOpen = true;\n toggleExpandedBtn(this.toggleButton, true);\n\n this.outerContainer.classList.add(\"sidebarMoving\", \"sidebarOpen\");\n\n if (this.active === SidebarView.THUMBS) {\n this.onUpdateThumbnails();\n }\n this.onToggled();\n this.#dispatchEvent();\n\n this.#hideUINotification();\n }\n\n close() {\n if (!this.isOpen) {\n return;\n }\n this.isOpen = false;\n toggleExpandedBtn(this.toggleButton, false);\n\n this.outerContainer.classList.add(\"sidebarMoving\");\n this.outerContainer.classList.remove(\"sidebarOpen\");\n\n this.onToggled();\n this.#dispatchEvent();\n }\n\n toggle() {\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n }\n\n #dispatchEvent() {\n if (this.isInitialViewSet) {\n this.isInitialEventDispatched ||= true;\n }\n\n this.eventBus.dispatch(\"sidebarviewchanged\", {\n source: this,\n view: this.visibleView,\n });\n }\n\n #showUINotification() {\n this.toggleButton.setAttribute(\n \"data-l10n-id\",\n \"toggle_sidebar_notification2\"\n );\n this.l10n.translate(this.toggleButton);\n\n if (!this.isOpen) {\n // Only show the notification on the `toggleButton` if the sidebar is\n // currently closed, to avoid unnecessarily bothering the user.\n this.toggleButton.classList.add(UI_NOTIFICATION_CLASS);\n }\n }\n\n #hideUINotification(reset = false) {\n if (this.isOpen || reset) {\n // Only hide the notification on the `toggleButton` if the sidebar is\n // currently open, or when the current PDF document is being closed.\n this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS);\n }\n\n if (reset) {\n this.toggleButton.setAttribute(\"data-l10n-id\", \"toggle_sidebar\");\n this.l10n.translate(this.toggleButton);\n }\n }\n\n #addEventListeners() {\n this.sidebarContainer.addEventListener(\"transitionend\", evt => {\n if (evt.target === this.sidebarContainer) {\n this.outerContainer.classList.remove(\"sidebarMoving\");\n }\n });\n\n this.toggleButton.addEventListener(\"click\", () => {\n this.toggle();\n });\n\n // Buttons for switching views.\n this.thumbnailButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.THUMBS);\n });\n\n this.outlineButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.OUTLINE);\n });\n this.outlineButton.addEventListener(\"dblclick\", () => {\n this.eventBus.dispatch(\"toggleoutlinetree\", { source: this });\n });\n\n this.attachmentsButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.ATTACHMENTS);\n });\n\n this.layersButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.LAYERS);\n });\n this.layersButton.addEventListener(\"dblclick\", () => {\n this.eventBus.dispatch(\"resetlayers\", { source: this });\n });\n\n // Buttons for view-specific options.\n this._currentOutlineItemButton.addEventListener(\"click\", () => {\n this.eventBus.dispatch(\"currentoutlineitem\", { source: this });\n });\n\n // Disable/enable views.\n const onTreeLoaded = (count, button, view) => {\n button.disabled = !count;\n\n if (count) {\n this.#showUINotification();\n } else if (this.active === view) {\n // If the `view` was opened by the user during document load,\n // switch away from it if it turns out to be empty.\n this.switchView(SidebarView.THUMBS);\n }\n };\n\n this.eventBus._on(\"outlineloaded\", evt => {\n onTreeLoaded(evt.outlineCount, this.outlineButton, SidebarView.OUTLINE);\n\n evt.currentOutlineItemPromise.then(enabled => {\n if (!this.isInitialViewSet) {\n return;\n }\n this._currentOutlineItemButton.disabled = !enabled;\n });\n });\n\n this.eventBus._on(\"attachmentsloaded\", evt => {\n onTreeLoaded(\n evt.attachmentsCount,\n this.attachmentsButton,\n SidebarView.ATTACHMENTS\n );\n });\n\n this.eventBus._on(\"layersloaded\", evt => {\n onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS);\n });\n\n // Update the thumbnailViewer, if visible, when exiting presentation mode.\n this.eventBus._on(\"presentationmodechanged\", evt => {\n if (\n evt.state === PresentationModeState.NORMAL &&\n this.visibleView === SidebarView.THUMBS\n ) {\n this.onUpdateThumbnails();\n }\n });\n\n // Handle resizing of the sidebar.\n this.resizer.addEventListener(\"mousedown\", evt => {\n if (evt.button !== 0) {\n return;\n }\n // Disable the `transition-duration` rules when sidebar resizing begins,\n // in order to improve responsiveness and to avoid visual glitches.\n this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);\n\n window.addEventListener(\"mousemove\", this.#mouseMoveBound);\n window.addEventListener(\"mouseup\", this.#mouseUpBound);\n });\n\n this.eventBus._on(\"resize\", evt => {\n // When the *entire* viewer is resized, such that it becomes narrower,\n // ensure that the sidebar doesn't end up being too wide.\n if (evt.source !== window) {\n return;\n }\n // Always reset the cached width when the viewer is resized.\n this.#outerContainerWidth = null;\n\n if (!this.#width) {\n // The sidebar hasn't been resized, hence no need to adjust its width.\n return;\n }\n // NOTE: If the sidebar is closed, we don't need to worry about\n // visual glitches nor ensure that rendering is triggered.\n if (!this.isOpen) {\n this.#updateWidth(this.#width);\n return;\n }\n this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);\n const updated = this.#updateWidth(this.#width);\n\n Promise.resolve().then(() => {\n this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);\n // Trigger rendering if the sidebar width changed, to avoid\n // depending on the order in which 'resize' events are handled.\n if (updated) {\n this.eventBus.dispatch(\"resize\", { source: this });\n }\n });\n });\n }\n\n /**\n * @type {number}\n */\n get outerContainerWidth() {\n return (this.#outerContainerWidth ||= this.outerContainer.clientWidth);\n }\n\n /**\n * returns {boolean} Indicating if the sidebar width was updated.\n */\n #updateWidth(width = 0) {\n // Prevent the sidebar from becoming too narrow, or from occupying more\n // than half of the available viewer width.\n const maxWidth = Math.floor(this.outerContainerWidth / 2);\n if (width > maxWidth) {\n width = maxWidth;\n }\n if (width < SIDEBAR_MIN_WIDTH) {\n width = SIDEBAR_MIN_WIDTH;\n }\n // Only update the UI when the sidebar width did in fact change.\n if (width === this.#width) {\n return false;\n }\n this.#width = width;\n\n docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`);\n return true;\n }\n\n #mouseMove(evt) {\n let width = evt.clientX;\n // For sidebar resizing to work correctly in RTL mode, invert the width.\n if (this.#isRTL) {\n width = this.outerContainerWidth - width;\n }\n this.#updateWidth(width);\n }\n\n #mouseUp(evt) {\n // Re-enable the `transition-duration` rules when sidebar resizing ends...\n this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);\n // ... and ensure that rendering will always be triggered.\n this.eventBus.dispatch(\"resize\", { source: this });\n\n window.removeEventListener(\"mousemove\", this.#mouseMoveBound);\n window.removeEventListener(\"mouseup\", this.#mouseUpBound);\n }\n}\n\nexport { PDFSidebar };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n\nimport {\n getVisibleElements,\n isValidRotation,\n RenderingStates,\n scrollIntoView,\n watchScroll,\n} from \"./ui_utils.js\";\nimport { PDFThumbnailView, TempImageFactory } from \"./pdf_thumbnail_view.js\";\n\nconst THUMBNAIL_SCROLL_MARGIN = -19;\nconst THUMBNAIL_SELECTED_CLASS = \"selected\";\n\n/**\n * @typedef {Object} PDFThumbnailViewerOptions\n * @property {HTMLDivElement} container - The container for the thumbnail\n * elements.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {PDFRenderingQueue} renderingQueue - The rendering queue object.\n * @property {IL10n} l10n - Localization service.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n */\n\n/**\n * Viewer control to display thumbnails for pages in a PDF document.\n */\nclass PDFThumbnailViewer {\n /**\n * @param {PDFThumbnailViewerOptions} options\n */\n constructor({\n container,\n eventBus,\n linkService,\n renderingQueue,\n l10n,\n pageColors,\n }) {\n this.container = container;\n this.eventBus = eventBus;\n this.linkService = linkService;\n this.renderingQueue = renderingQueue;\n this.l10n = l10n;\n this.pageColors = pageColors || null;\n\n this.scroll = watchScroll(this.container, this._scrollUpdated.bind(this));\n this._resetView();\n }\n\n /**\n * @private\n */\n _scrollUpdated() {\n this.renderingQueue.renderHighestPriority();\n }\n\n getThumbnail(index) {\n return this._thumbnails[index];\n }\n\n /**\n * @private\n */\n _getVisibleThumbs() {\n return getVisibleElements({\n scrollEl: this.container,\n views: this._thumbnails,\n });\n }\n\n scrollThumbnailIntoView(pageNumber) {\n if (!this.pdfDocument) {\n return;\n }\n const thumbnailView = this._thumbnails[pageNumber - 1];\n\n if (!thumbnailView) {\n console.error('scrollThumbnailIntoView: Invalid \"pageNumber\" parameter.');\n return;\n }\n\n if (pageNumber !== this._currentPageNumber) {\n const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1];\n // Remove the highlight from the previous thumbnail...\n prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS);\n // ... and add the highlight to the new thumbnail.\n thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);\n }\n const { first, last, views } = this._getVisibleThumbs();\n\n // If the thumbnail isn't currently visible, scroll it into view.\n if (views.length > 0) {\n let shouldScroll = false;\n if (pageNumber <= first.id || pageNumber >= last.id) {\n shouldScroll = true;\n } else {\n for (const { id, percent } of views) {\n if (id !== pageNumber) {\n continue;\n }\n shouldScroll = percent < 100;\n break;\n }\n }\n if (shouldScroll) {\n scrollIntoView(thumbnailView.div, { top: THUMBNAIL_SCROLL_MARGIN });\n }\n }\n\n this._currentPageNumber = pageNumber;\n }\n\n get pagesRotation() {\n return this._pagesRotation;\n }\n\n set pagesRotation(rotation) {\n if (!isValidRotation(rotation)) {\n throw new Error(\"Invalid thumbnails rotation angle.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n if (this._pagesRotation === rotation) {\n return; // The rotation didn't change.\n }\n this._pagesRotation = rotation;\n\n const updateArgs = { rotation };\n for (const thumbnail of this._thumbnails) {\n thumbnail.update(updateArgs);\n }\n }\n\n cleanup() {\n for (const thumbnail of this._thumbnails) {\n if (thumbnail.renderingState !== RenderingStates.FINISHED) {\n thumbnail.reset();\n }\n }\n TempImageFactory.destroyCanvas();\n }\n\n /**\n * @private\n */\n _resetView() {\n this._thumbnails = [];\n this._currentPageNumber = 1;\n this._pageLabels = null;\n this._pagesRotation = 0;\n\n // Remove the thumbnails from the DOM.\n this.container.textContent = \"\";\n }\n\n /**\n * @param {PDFDocumentProxy} pdfDocument\n */\n setDocument(pdfDocument) {\n if (this.pdfDocument) {\n this._cancelRendering();\n this._resetView();\n }\n\n this.pdfDocument = pdfDocument;\n if (!pdfDocument) {\n return;\n }\n const firstPagePromise = pdfDocument.getPage(1);\n const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();\n\n firstPagePromise\n .then(firstPdfPage => {\n const pagesCount = pdfDocument.numPages;\n const viewport = firstPdfPage.getViewport({ scale: 1 });\n\n for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n const thumbnail = new PDFThumbnailView({\n container: this.container,\n eventBus: this.eventBus,\n id: pageNum,\n defaultViewport: viewport.clone(),\n optionalContentConfigPromise,\n linkService: this.linkService,\n renderingQueue: this.renderingQueue,\n l10n: this.l10n,\n pageColors: this.pageColors,\n });\n this._thumbnails.push(thumbnail);\n }\n // Set the first `pdfPage` immediately, since it's already loaded,\n // rather than having to repeat the `PDFDocumentProxy.getPage` call in\n // the `this.#ensurePdfPageLoaded` method before rendering can start.\n this._thumbnails[0]?.setPdfPage(firstPdfPage);\n\n // Ensure that the current thumbnail is always highlighted on load.\n const thumbnailView = this._thumbnails[this._currentPageNumber - 1];\n thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);\n })\n .catch(reason => {\n console.error(\"Unable to initialize thumbnail viewer\", reason);\n });\n }\n\n /**\n * @private\n */\n _cancelRendering() {\n for (const thumbnail of this._thumbnails) {\n thumbnail.cancelRendering();\n }\n }\n\n /**\n * @param {Array|null} labels\n */\n setPageLabels(labels) {\n if (!this.pdfDocument) {\n return;\n }\n if (!labels) {\n this._pageLabels = null;\n } else if (\n !(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)\n ) {\n this._pageLabels = null;\n console.error(\"PDFThumbnailViewer_setPageLabels: Invalid page labels.\");\n } else {\n this._pageLabels = labels;\n }\n // Update all the `PDFThumbnailView` instances.\n for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {\n this._thumbnails[i].setPageLabel(this._pageLabels?.[i] ?? null);\n }\n }\n\n /**\n * @param {PDFThumbnailView} thumbView\n * @returns {Promise<PDFPageProxy | null>}\n */\n async #ensurePdfPageLoaded(thumbView) {\n if (thumbView.pdfPage) {\n return thumbView.pdfPage;\n }\n try {\n const pdfPage = await this.pdfDocument.getPage(thumbView.id);\n if (!thumbView.pdfPage) {\n thumbView.setPdfPage(pdfPage);\n }\n return pdfPage;\n } catch (reason) {\n console.error(\"Unable to get page for thumb view\", reason);\n return null; // Page error -- there is nothing that can be done.\n }\n }\n\n #getScrollAhead(visible) {\n if (visible.first?.id === 1) {\n return true;\n } else if (visible.last?.id === this._thumbnails.length) {\n return false;\n }\n return this.scroll.down;\n }\n\n forceRendering() {\n const visibleThumbs = this._getVisibleThumbs();\n const scrollAhead = this.#getScrollAhead(visibleThumbs);\n const thumbView = this.renderingQueue.getHighestPriority(\n visibleThumbs,\n this._thumbnails,\n scrollAhead\n );\n if (thumbView) {\n this.#ensurePdfPageLoaded(thumbView).then(() => {\n this.renderingQueue.renderView(thumbView);\n });\n return true;\n }\n return false;\n }\n}\n\nexport { PDFThumbnailViewer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/optional_content_config\").OptionalContentConfig} OptionalContentConfig */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n/** @typedef {import(\"./interfaces\").IRenderableView} IRenderableView */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n\nimport { OutputScale, RenderingStates } from \"./ui_utils.js\";\nimport { RenderingCancelledException } from \"pdfjs-lib\";\n\nconst DRAW_UPSCALE_FACTOR = 2; // See comment in `PDFThumbnailView.draw` below.\nconst MAX_NUM_SCALING_STEPS = 3;\nconst THUMBNAIL_WIDTH = 98; // px\n\n/**\n * @typedef {Object} PDFThumbnailViewOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} id - The thumbnail's unique ID (normally its number).\n * @property {PageViewport} defaultViewport - The page viewport.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -\n * A promise that is resolved with an {@link OptionalContentConfig} instance.\n * The default value is `null`.\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {PDFRenderingQueue} renderingQueue - The rendering queue object.\n * @property {IL10n} l10n - Localization service.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n */\n\nclass TempImageFactory {\n static #tempCanvas = null;\n\n static getCanvas(width, height) {\n const tempCanvas = (this.#tempCanvas ||= document.createElement(\"canvas\"));\n tempCanvas.width = width;\n tempCanvas.height = height;\n\n // Since this is a temporary canvas, we need to fill it with a white\n // background ourselves. `_getPageDrawContext` uses CSS rules for this.\n const ctx = tempCanvas.getContext(\"2d\", { alpha: false });\n ctx.save();\n ctx.fillStyle = \"rgb(255, 255, 255)\";\n ctx.fillRect(0, 0, width, height);\n ctx.restore();\n return [tempCanvas, tempCanvas.getContext(\"2d\")];\n }\n\n static destroyCanvas() {\n const tempCanvas = this.#tempCanvas;\n if (tempCanvas) {\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n tempCanvas.width = 0;\n tempCanvas.height = 0;\n }\n this.#tempCanvas = null;\n }\n}\n\n/**\n * @implements {IRenderableView}\n */\nclass PDFThumbnailView {\n /**\n * @param {PDFThumbnailViewOptions} options\n */\n constructor({\n container,\n eventBus,\n id,\n defaultViewport,\n optionalContentConfigPromise,\n linkService,\n renderingQueue,\n l10n,\n pageColors,\n }) {\n this.id = id;\n this.renderingId = \"thumbnail\" + id;\n this.pageLabel = null;\n\n this.pdfPage = null;\n this.rotation = 0;\n this.viewport = defaultViewport;\n this.pdfPageRotate = defaultViewport.rotation;\n this._optionalContentConfigPromise = optionalContentConfigPromise || null;\n this.pageColors = pageColors || null;\n\n this.eventBus = eventBus;\n this.linkService = linkService;\n this.renderingQueue = renderingQueue;\n\n this.renderTask = null;\n this.renderingState = RenderingStates.INITIAL;\n this.resume = null;\n this.l10n = l10n;\n\n const anchor = document.createElement(\"a\");\n anchor.href = linkService.getAnchorUrl(\"#page=\" + id);\n this._thumbPageTitle.then(msg => {\n anchor.title = msg;\n });\n anchor.onclick = function () {\n linkService.goToPage(id);\n return false;\n };\n this.anchor = anchor;\n\n const div = document.createElement(\"div\");\n div.className = \"thumbnail\";\n div.setAttribute(\"data-page-number\", this.id);\n this.div = div;\n this.#updateDims();\n\n const img = document.createElement(\"div\");\n img.className = \"thumbnailImage\";\n this._placeholderImg = img;\n\n div.append(img);\n anchor.append(div);\n container.append(anchor);\n }\n\n #updateDims() {\n const { width, height } = this.viewport;\n const ratio = width / height;\n\n this.canvasWidth = THUMBNAIL_WIDTH;\n this.canvasHeight = (this.canvasWidth / ratio) | 0;\n this.scale = this.canvasWidth / width;\n\n const { style } = this.div;\n style.setProperty(\"--thumbnail-width\", `${this.canvasWidth}px`);\n style.setProperty(\"--thumbnail-height\", `${this.canvasHeight}px`);\n }\n\n setPdfPage(pdfPage) {\n this.pdfPage = pdfPage;\n this.pdfPageRotate = pdfPage.rotate;\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = pdfPage.getViewport({ scale: 1, rotation: totalRotation });\n this.reset();\n }\n\n reset() {\n this.cancelRendering();\n this.renderingState = RenderingStates.INITIAL;\n\n this.div.removeAttribute(\"data-loaded\");\n this.image?.replaceWith(this._placeholderImg);\n this.#updateDims();\n\n if (this.image) {\n this.image.removeAttribute(\"src\");\n delete this.image;\n }\n }\n\n update({ rotation = null }) {\n if (typeof rotation === \"number\") {\n this.rotation = rotation; // The rotation may be zero.\n }\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = this.viewport.clone({\n scale: 1,\n rotation: totalRotation,\n });\n this.reset();\n }\n\n /**\n * PLEASE NOTE: Most likely you want to use the `this.reset()` method,\n * rather than calling this one directly.\n */\n cancelRendering() {\n if (this.renderTask) {\n this.renderTask.cancel();\n this.renderTask = null;\n }\n this.resume = null;\n }\n\n /**\n * @private\n */\n _getPageDrawContext(upscaleFactor = 1) {\n // Keep the no-thumbnail outline visible, i.e. `data-loaded === false`,\n // until rendering/image conversion is complete, to avoid display issues.\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\", { alpha: false });\n const outputScale = new OutputScale();\n\n canvas.width = (upscaleFactor * this.canvasWidth * outputScale.sx) | 0;\n canvas.height = (upscaleFactor * this.canvasHeight * outputScale.sy) | 0;\n\n const transform = outputScale.scaled\n ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0]\n : null;\n\n return { ctx, canvas, transform };\n }\n\n /**\n * @private\n */\n _convertCanvasToImage(canvas) {\n if (this.renderingState !== RenderingStates.FINISHED) {\n throw new Error(\"_convertCanvasToImage: Rendering has not finished.\");\n }\n const reducedCanvas = this._reduceImage(canvas);\n\n const image = document.createElement(\"img\");\n image.className = \"thumbnailImage\";\n this._thumbPageCanvas.then(msg => {\n image.setAttribute(\"aria-label\", msg);\n });\n image.src = reducedCanvas.toDataURL();\n this.image = image;\n\n this.div.setAttribute(\"data-loaded\", true);\n this._placeholderImg.replaceWith(image);\n\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n reducedCanvas.width = 0;\n reducedCanvas.height = 0;\n }\n\n async #finishRenderTask(renderTask, canvas, error = null) {\n // The renderTask may have been replaced by a new one, so only remove\n // the reference to the renderTask if it matches the one that is\n // triggering this callback.\n if (renderTask === this.renderTask) {\n this.renderTask = null;\n }\n\n if (error instanceof RenderingCancelledException) {\n return;\n }\n this.renderingState = RenderingStates.FINISHED;\n this._convertCanvasToImage(canvas);\n\n if (error) {\n throw error;\n }\n }\n\n async draw() {\n if (this.renderingState !== RenderingStates.INITIAL) {\n console.error(\"Must be in new state before drawing\");\n return undefined;\n }\n const { pdfPage } = this;\n\n if (!pdfPage) {\n this.renderingState = RenderingStates.FINISHED;\n throw new Error(\"pdfPage is not loaded\");\n }\n\n this.renderingState = RenderingStates.RUNNING;\n\n // Render the thumbnail at a larger size and downsize the canvas (similar\n // to `setImage`), to improve consistency between thumbnails created by\n // the `draw` and `setImage` methods (fixes issue 8233).\n // NOTE: To primarily avoid increasing memory usage too much, but also to\n // reduce downsizing overhead, we purposely limit the up-scaling factor.\n const { ctx, canvas, transform } =\n this._getPageDrawContext(DRAW_UPSCALE_FACTOR);\n const drawViewport = this.viewport.clone({\n scale: DRAW_UPSCALE_FACTOR * this.scale,\n });\n const renderContinueCallback = cont => {\n if (!this.renderingQueue.isHighestPriority(this)) {\n this.renderingState = RenderingStates.PAUSED;\n this.resume = () => {\n this.renderingState = RenderingStates.RUNNING;\n cont();\n };\n return;\n }\n cont();\n };\n\n const renderContext = {\n canvasContext: ctx,\n transform,\n viewport: drawViewport,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n pageColors: this.pageColors,\n };\n const renderTask = (this.renderTask = pdfPage.render(renderContext));\n renderTask.onContinue = renderContinueCallback;\n\n const resultPromise = renderTask.promise.then(\n () => this.#finishRenderTask(renderTask, canvas),\n error => this.#finishRenderTask(renderTask, canvas, error)\n );\n resultPromise.finally(() => {\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n canvas.width = 0;\n canvas.height = 0;\n\n this.eventBus.dispatch(\"thumbnailrendered\", {\n source: this,\n pageNumber: this.id,\n pdfPage: this.pdfPage,\n });\n });\n\n return resultPromise;\n }\n\n setImage(pageView) {\n if (this.renderingState !== RenderingStates.INITIAL) {\n return;\n }\n const { thumbnailCanvas: canvas, pdfPage, scale } = pageView;\n if (!canvas) {\n return;\n }\n if (!this.pdfPage) {\n this.setPdfPage(pdfPage);\n }\n if (scale < this.scale) {\n // Avoid upscaling the image, since that makes the thumbnail look blurry.\n return;\n }\n this.renderingState = RenderingStates.FINISHED;\n this._convertCanvasToImage(canvas);\n }\n\n /**\n * @private\n */\n _reduceImage(img) {\n const { ctx, canvas } = this._getPageDrawContext();\n\n if (img.width <= 2 * canvas.width) {\n ctx.drawImage(\n img,\n 0,\n 0,\n img.width,\n img.height,\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n return canvas;\n }\n // drawImage does an awful job of rescaling the image, doing it gradually.\n let reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS;\n let reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS;\n const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(\n reducedWidth,\n reducedHeight\n );\n\n while (reducedWidth > img.width || reducedHeight > img.height) {\n reducedWidth >>= 1;\n reducedHeight >>= 1;\n }\n reducedImageCtx.drawImage(\n img,\n 0,\n 0,\n img.width,\n img.height,\n 0,\n 0,\n reducedWidth,\n reducedHeight\n );\n while (reducedWidth > 2 * canvas.width) {\n reducedImageCtx.drawImage(\n reducedImage,\n 0,\n 0,\n reducedWidth,\n reducedHeight,\n 0,\n 0,\n reducedWidth >> 1,\n reducedHeight >> 1\n );\n reducedWidth >>= 1;\n reducedHeight >>= 1;\n }\n ctx.drawImage(\n reducedImage,\n 0,\n 0,\n reducedWidth,\n reducedHeight,\n 0,\n 0,\n canvas.width,\n canvas.height\n );\n return canvas;\n }\n\n get _thumbPageTitle() {\n return this.l10n.get(\"thumb_page_title\", {\n page: this.pageLabel ?? this.id,\n });\n }\n\n get _thumbPageCanvas() {\n return this.l10n.get(\"thumb_page_canvas\", {\n page: this.pageLabel ?? this.id,\n });\n }\n\n /**\n * @param {string|null} label\n */\n setPageLabel(label) {\n this.pageLabel = typeof label === \"string\" ? label : null;\n\n this._thumbPageTitle.then(msg => {\n this.anchor.title = msg;\n });\n\n if (this.renderingState !== RenderingStates.FINISHED) {\n return;\n }\n\n this._thumbPageCanvas.then(msg => {\n this.image?.setAttribute(\"aria-label\", msg);\n });\n }\n}\n\nexport { PDFThumbnailView, TempImageFactory };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/optional_content_config\").OptionalContentConfig} OptionalContentConfig */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_find_controller\").PDFFindController} PDFFindController */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_scripting_manager\").PDFScriptingManager} PDFScriptingManager */\n\nimport {\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationMode,\n PermissionFlag,\n PixelsPerInch,\n PromiseCapability,\n version,\n} from \"pdfjs-lib\";\nimport {\n DEFAULT_SCALE,\n DEFAULT_SCALE_DELTA,\n DEFAULT_SCALE_VALUE,\n docStyle,\n getVisibleElements,\n isPortraitOrientation,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n MAX_AUTO_SCALE,\n MAX_SCALE,\n MIN_SCALE,\n PresentationModeState,\n removeNullCharacters,\n RenderingStates,\n SCROLLBAR_PADDING,\n scrollIntoView,\n ScrollMode,\n SpreadMode,\n TextLayerMode,\n UNKNOWN_SCALE,\n VERTICAL_PADDING,\n watchScroll,\n} from \"./ui_utils.js\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { PDFPageView } from \"./pdf_page_view.js\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\n\nconst DEFAULT_CACHE_SIZE = 10;\n\nconst PagesCountLimit = {\n FORCE_SCROLL_MODE_PAGE: 15000,\n FORCE_LAZY_PAGE_INIT: 7500,\n PAUSE_EAGER_PAGE_INIT: 250,\n};\n\nfunction isValidAnnotationEditorMode(mode) {\n return (\n Object.values(AnnotationEditorType).includes(mode) &&\n mode !== AnnotationEditorType.DISABLE\n );\n}\n\n/**\n * @typedef {Object} PDFViewerOptions\n * @property {HTMLDivElement} container - The container for the viewer element.\n * @property {HTMLDivElement} [viewer] - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IPDFLinkService} [linkService] - The navigation/linking service.\n * @property {IDownloadManager} [downloadManager] - The download manager\n * component.\n * @property {PDFFindController} [findController] - The find controller\n * component.\n * @property {PDFScriptingManager} [scriptingManager] - The scripting manager\n * component.\n * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.\n * @property {boolean} [removePageBorders] - Removes the border shadow around\n * the pages. The default value is `false`.\n * @property {number} [textLayerMode] - Controls if the text layer used for\n * selection and searching is created. The constants from {TextLayerMode}\n * should be used. The default value is `TextLayerMode.ENABLE`.\n * @property {number} [annotationMode] - Controls if the annotation layer is\n * created, and if interactive form elements or `AnnotationStorage`-data are\n * being rendered. The constants from {@link AnnotationMode} should be used;\n * see also {@link RenderParameters} and {@link GetOperatorListParameters}.\n * The default value is `AnnotationMode.ENABLE_FORMS`.\n * @property {number} [annotationEditorMode] - Enables the creation and editing\n * of new Annotations. The constants from {@link AnnotationEditorType} should\n * be used. The default value is `AnnotationEditorType.NONE`.\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * mainly for annotation icons. Include trailing slash.\n * @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of\n * landscape pages upon printing. The default is `false`.\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n * @property {number} [maxCanvasPixels] - The maximum supported canvas size in\n * total pixels, i.e. width * height. Use `-1` for no limit, or `0` for\n * CSS-only zooming. The default value is 4096 * 4096 (16 mega-pixels).\n * @property {IL10n} [l10n] - Localization service.\n * @property {boolean} [enablePermissions] - Enables PDF document permissions,\n * when they exist. The default value is `false`.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n */\n\nclass PDFPageViewBuffer {\n // Here we rely on the fact that `Set`s preserve the insertion order.\n #buf = new Set();\n\n #size = 0;\n\n constructor(size) {\n this.#size = size;\n }\n\n push(view) {\n const buf = this.#buf;\n if (buf.has(view)) {\n buf.delete(view); // Move the view to the \"end\" of the buffer.\n }\n buf.add(view);\n\n if (buf.size > this.#size) {\n this.#destroyFirstView();\n }\n }\n\n /**\n * After calling resize, the size of the buffer will be `newSize`.\n * The optional parameter `idsToKeep` is, if present, a Set of page-ids to\n * push to the back of the buffer, delaying their destruction. The size of\n * `idsToKeep` has no impact on the final size of the buffer; if `idsToKeep`\n * is larger than `newSize`, some of those pages will be destroyed anyway.\n */\n resize(newSize, idsToKeep = null) {\n this.#size = newSize;\n\n const buf = this.#buf;\n if (idsToKeep) {\n const ii = buf.size;\n let i = 1;\n for (const view of buf) {\n if (idsToKeep.has(view.id)) {\n buf.delete(view); // Move the view to the \"end\" of the buffer.\n buf.add(view);\n }\n if (++i > ii) {\n break;\n }\n }\n }\n\n while (buf.size > this.#size) {\n this.#destroyFirstView();\n }\n }\n\n has(view) {\n return this.#buf.has(view);\n }\n\n [Symbol.iterator]() {\n return this.#buf.keys();\n }\n\n #destroyFirstView() {\n const firstView = this.#buf.keys().next().value;\n\n firstView?.destroy();\n this.#buf.delete(firstView);\n }\n}\n\n/**\n * Simple viewer control to display PDF content/pages.\n */\nclass PDFViewer {\n #buffer = null;\n\n #altTextManager = null;\n\n #annotationEditorMode = AnnotationEditorType.NONE;\n\n #annotationEditorUIManager = null;\n\n #annotationMode = AnnotationMode.ENABLE_FORMS;\n\n #containerTopLeft = null;\n\n #copyCallbackBound = null;\n\n #enablePermissions = false;\n\n #getAllTextInProgress = false;\n\n #hiddenCopyElement = null;\n\n #interruptCopyCondition = false;\n\n #previousContainerHeight = 0;\n\n #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this));\n\n #scrollModePageState = null;\n\n #onVisibilityChange = null;\n\n #scaleTimeoutId = null;\n\n #textLayerMode = TextLayerMode.ENABLE;\n\n /**\n * @param {PDFViewerOptions} options\n */\n constructor(options) {\n const viewerVersion =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : null;\n if (version !== viewerVersion) {\n throw new Error(\n `The API version \"${version}\" does not match the Viewer version \"${viewerVersion}\".`\n );\n }\n this.container = options.container;\n this.viewer = options.viewer || options.container.firstElementChild;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (this.container?.tagName !== \"DIV\" || this.viewer?.tagName !== \"DIV\") {\n throw new Error(\"Invalid `container` and/or `viewer` option.\");\n }\n\n if (\n this.container.offsetParent &&\n getComputedStyle(this.container).position !== \"absolute\"\n ) {\n throw new Error(\"The `container` must be absolutely positioned.\");\n }\n }\n this.#resizeObserver.observe(this.container);\n\n this.eventBus = options.eventBus;\n this.linkService = options.linkService || new SimpleLinkService();\n this.downloadManager = options.downloadManager || null;\n this.findController = options.findController || null;\n this.#altTextManager = options.altTextManager || null;\n\n if (this.findController) {\n this.findController.onIsPageVisible = pageNumber =>\n this._getVisiblePages().ids.has(pageNumber);\n }\n this._scriptingManager = options.scriptingManager || null;\n this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE;\n this.#annotationMode =\n options.annotationMode ?? AnnotationMode.ENABLE_FORMS;\n this.#annotationEditorMode =\n options.annotationEditorMode ?? AnnotationEditorType.NONE;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.removePageBorders = options.removePageBorders || false;\n\n if (options.useOnlyCssZoom) {\n console.error(\n \"useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead.\"\n );\n options.maxCanvasPixels = 0;\n }\n }\n this.isOffscreenCanvasSupported =\n options.isOffscreenCanvasSupported ?? true;\n this.maxCanvasPixels = options.maxCanvasPixels;\n this.l10n = options.l10n || NullL10n;\n this.#enablePermissions = options.enablePermissions || false;\n this.pageColors = options.pageColors || null;\n\n this.defaultRenderingQueue = !options.renderingQueue;\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.defaultRenderingQueue\n ) {\n // Custom rendering queue is not specified, using default one\n this.renderingQueue = new PDFRenderingQueue();\n this.renderingQueue.setViewer(this);\n } else {\n this.renderingQueue = options.renderingQueue;\n }\n\n this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this));\n this.presentationModeState = PresentationModeState.UNKNOWN;\n this._onBeforeDraw = this._onAfterDraw = null;\n this._resetView();\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n this.viewer.classList.add(\"removePageBorders\");\n }\n\n this.#updateContainerHeightCss();\n\n // Trigger API-cleanup, once thumbnail rendering has finished,\n // if the relevant pageView is *not* cached in the buffer.\n this.eventBus._on(\"thumbnailrendered\", ({ pageNumber, pdfPage }) => {\n const pageView = this._pages[pageNumber - 1];\n if (!this.#buffer.has(pageView)) {\n pdfPage?.cleanup();\n }\n });\n }\n\n get pagesCount() {\n return this._pages.length;\n }\n\n getPageView(index) {\n return this._pages[index];\n }\n\n getCachedPageViews() {\n return new Set(this.#buffer);\n }\n\n /**\n * @type {boolean} - True if all {PDFPageView} objects are initialized.\n */\n get pageViewsReady() {\n // Prevent printing errors when 'disableAutoFetch' is set, by ensuring\n // that *all* pages have in fact been completely loaded.\n return (\n this._pagesCapability.settled &&\n this._pages.every(pageView => pageView?.pdfPage)\n );\n }\n\n /**\n * @type {boolean}\n */\n get renderForms() {\n return this.#annotationMode === AnnotationMode.ENABLE_FORMS;\n }\n\n /**\n * @type {boolean}\n */\n get enableScripting() {\n return !!this._scriptingManager;\n }\n\n /**\n * @type {number}\n */\n get currentPageNumber() {\n return this._currentPageNumber;\n }\n\n /**\n * @param {number} val - The page number.\n */\n set currentPageNumber(val) {\n if (!Number.isInteger(val)) {\n throw new Error(\"Invalid page number.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n // The intent can be to just reset a scroll position and/or scale.\n if (!this._setCurrentPageNumber(val, /* resetCurrentPageView = */ true)) {\n console.error(`currentPageNumber: \"${val}\" is not a valid page.`);\n }\n }\n\n /**\n * @returns {boolean} Whether the pageNumber is valid (within bounds).\n * @private\n */\n _setCurrentPageNumber(val, resetCurrentPageView = false) {\n if (this._currentPageNumber === val) {\n if (resetCurrentPageView) {\n this.#resetCurrentPageView();\n }\n return true;\n }\n\n if (!(0 < val && val <= this.pagesCount)) {\n return false;\n }\n const previous = this._currentPageNumber;\n this._currentPageNumber = val;\n\n this.eventBus.dispatch(\"pagechanging\", {\n source: this,\n pageNumber: val,\n pageLabel: this._pageLabels?.[val - 1] ?? null,\n previous,\n });\n\n if (resetCurrentPageView) {\n this.#resetCurrentPageView();\n }\n return true;\n }\n\n /**\n * @type {string|null} Returns the current page label, or `null` if no page\n * labels exist.\n */\n get currentPageLabel() {\n return this._pageLabels?.[this._currentPageNumber - 1] ?? null;\n }\n\n /**\n * @param {string} val - The page label.\n */\n set currentPageLabel(val) {\n if (!this.pdfDocument) {\n return;\n }\n let page = val | 0; // Fallback page number.\n if (this._pageLabels) {\n const i = this._pageLabels.indexOf(val);\n if (i >= 0) {\n page = i + 1;\n }\n }\n // The intent can be to just reset a scroll position and/or scale.\n if (!this._setCurrentPageNumber(page, /* resetCurrentPageView = */ true)) {\n console.error(`currentPageLabel: \"${val}\" is not a valid page.`);\n }\n }\n\n /**\n * @type {number}\n */\n get currentScale() {\n return this._currentScale !== UNKNOWN_SCALE\n ? this._currentScale\n : DEFAULT_SCALE;\n }\n\n /**\n * @param {number} val - Scale of the pages in percents.\n */\n set currentScale(val) {\n if (isNaN(val)) {\n throw new Error(\"Invalid numeric scale.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n this.#setScale(val, { noScroll: false });\n }\n\n /**\n * @type {string}\n */\n get currentScaleValue() {\n return this._currentScaleValue;\n }\n\n /**\n * @param val - The scale of the pages (in percent or predefined value).\n */\n set currentScaleValue(val) {\n if (!this.pdfDocument) {\n return;\n }\n this.#setScale(val, { noScroll: false });\n }\n\n /**\n * @type {number}\n */\n get pagesRotation() {\n return this._pagesRotation;\n }\n\n /**\n * @param {number} rotation - The rotation of the pages (0, 90, 180, 270).\n */\n set pagesRotation(rotation) {\n if (!isValidRotation(rotation)) {\n throw new Error(\"Invalid pages rotation angle.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n if (this._pagesRotation === rotation) {\n return; // The rotation didn't change.\n }\n this._pagesRotation = rotation;\n\n const pageNumber = this._currentPageNumber;\n\n this.refresh(true, { rotation });\n\n // Prevent errors in case the rotation changes *before* the scale has been\n // set to a non-default value.\n if (this._currentScaleValue) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n\n this.eventBus.dispatch(\"rotationchanging\", {\n source: this,\n pagesRotation: rotation,\n pageNumber,\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n\n get firstPagePromise() {\n return this.pdfDocument ? this._firstPageCapability.promise : null;\n }\n\n get onePageRendered() {\n return this.pdfDocument ? this._onePageRenderedCapability.promise : null;\n }\n\n get pagesPromise() {\n return this.pdfDocument ? this._pagesCapability.promise : null;\n }\n\n #layerProperties() {\n const self = this;\n return {\n get annotationEditorUIManager() {\n return self.#annotationEditorUIManager;\n },\n get annotationStorage() {\n return self.pdfDocument?.annotationStorage;\n },\n get downloadManager() {\n return self.downloadManager;\n },\n get enableScripting() {\n return !!self._scriptingManager;\n },\n get fieldObjectsPromise() {\n return self.pdfDocument?.getFieldObjects();\n },\n get findController() {\n return self.findController;\n },\n get hasJSActionsPromise() {\n return self.pdfDocument?.hasJSActions();\n },\n get linkService() {\n return self.linkService;\n },\n };\n }\n\n /**\n * Currently only *some* permissions are supported.\n * @returns {Object}\n */\n #initializePermissions(permissions) {\n const params = {\n annotationEditorMode: this.#annotationEditorMode,\n annotationMode: this.#annotationMode,\n textLayerMode: this.#textLayerMode,\n };\n if (!permissions) {\n return params;\n }\n\n if (\n !permissions.includes(PermissionFlag.COPY) &&\n this.#textLayerMode === TextLayerMode.ENABLE\n ) {\n params.textLayerMode = TextLayerMode.ENABLE_PERMISSIONS;\n }\n\n if (!permissions.includes(PermissionFlag.MODIFY_CONTENTS)) {\n params.annotationEditorMode = AnnotationEditorType.DISABLE;\n }\n\n if (\n !permissions.includes(PermissionFlag.MODIFY_ANNOTATIONS) &&\n !permissions.includes(PermissionFlag.FILL_INTERACTIVE_FORMS) &&\n this.#annotationMode === AnnotationMode.ENABLE_FORMS\n ) {\n params.annotationMode = AnnotationMode.ENABLE;\n }\n\n return params;\n }\n\n #onePageRenderedOrForceFetch() {\n // Unless the viewer *and* its pages are visible, rendering won't start and\n // `this._onePageRenderedCapability` thus won't be resolved.\n // To ensure that automatic printing, on document load, still works even in\n // those cases we force-allow fetching of all pages when:\n // - The current window/tab is inactive, which will prevent rendering since\n // `requestAnimationFrame` is being used; fixes bug 1746213.\n // - The viewer is hidden in the DOM, e.g. in a `display: none` <iframe>\n // element; fixes bug 1618621.\n // - The viewer is visible, but none of the pages are (e.g. if the\n // viewer is very small); fixes bug 1618955.\n if (\n document.visibilityState === \"hidden\" ||\n !this.container.offsetParent ||\n this._getVisiblePages().views.length === 0\n ) {\n return Promise.resolve();\n }\n\n // Handle the window/tab becoming inactive *after* rendering has started;\n // fixes (another part of) bug 1746213.\n const visibilityChangePromise = new Promise(resolve => {\n this.#onVisibilityChange = () => {\n if (document.visibilityState !== \"hidden\") {\n return;\n }\n resolve();\n\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n };\n document.addEventListener(\"visibilitychange\", this.#onVisibilityChange);\n });\n\n return Promise.race([\n this._onePageRenderedCapability.promise,\n visibilityChangePromise,\n ]);\n }\n\n async getAllText() {\n const texts = [];\n const buffer = [];\n for (\n let pageNum = 1, pagesCount = this.pdfDocument.numPages;\n pageNum <= pagesCount;\n ++pageNum\n ) {\n if (this.#interruptCopyCondition) {\n return null;\n }\n buffer.length = 0;\n const page = await this.pdfDocument.getPage(pageNum);\n // By default getTextContent pass disableNormalization equals to false\n // which is fine because we want a normalized string.\n const { items } = await page.getTextContent();\n for (const item of items) {\n if (item.str) {\n buffer.push(item.str);\n }\n if (item.hasEOL) {\n buffer.push(\"\\n\");\n }\n }\n texts.push(removeNullCharacters(buffer.join(\"\")));\n }\n\n return texts.join(\"\\n\");\n }\n\n #copyCallback(textLayerMode, event) {\n const selection = document.getSelection();\n const { focusNode, anchorNode } = selection;\n if (\n anchorNode &&\n focusNode &&\n selection.containsNode(this.#hiddenCopyElement)\n ) {\n // About the condition above:\n // - having non-null anchorNode and focusNode are here to guaranty that\n // we have at least a kind of selection.\n // - this.#hiddenCopyElement is an invisible element which is impossible\n // to select manually (its display is none) but ctrl+A will select all\n // including this element so having it in the selection means that all\n // has been selected.\n\n if (\n this.#getAllTextInProgress ||\n textLayerMode === TextLayerMode.ENABLE_PERMISSIONS\n ) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n this.#getAllTextInProgress = true;\n\n // TODO: if all the pages are rendered we don't need to wait for\n // getAllText and we could just get text from the Selection object.\n\n // Select all the document.\n const savedCursor = this.container.style.cursor;\n this.container.style.cursor = \"wait\";\n\n const interruptCopy = ev =>\n (this.#interruptCopyCondition = ev.key === \"Escape\");\n window.addEventListener(\"keydown\", interruptCopy);\n\n this.getAllText()\n .then(async text => {\n if (text !== null) {\n await navigator.clipboard.writeText(text);\n }\n })\n .catch(reason => {\n console.warn(\n `Something goes wrong when extracting the text: ${reason.message}`\n );\n })\n .finally(() => {\n this.#getAllTextInProgress = false;\n this.#interruptCopyCondition = false;\n window.removeEventListener(\"keydown\", interruptCopy);\n this.container.style.cursor = savedCursor;\n });\n\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n /**\n * @param {PDFDocumentProxy} pdfDocument\n */\n setDocument(pdfDocument) {\n if (this.pdfDocument) {\n this.eventBus.dispatch(\"pagesdestroy\", { source: this });\n\n this._cancelRendering();\n this._resetView();\n\n this.findController?.setDocument(null);\n this._scriptingManager?.setDocument(null);\n\n if (this.#annotationEditorUIManager) {\n this.#annotationEditorUIManager.destroy();\n this.#annotationEditorUIManager = null;\n }\n }\n\n this.pdfDocument = pdfDocument;\n if (!pdfDocument) {\n return;\n }\n const pagesCount = pdfDocument.numPages;\n const firstPagePromise = pdfDocument.getPage(1);\n // Rendering (potentially) depends on this, hence fetching it immediately.\n const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();\n const permissionsPromise = this.#enablePermissions\n ? pdfDocument.getPermissions()\n : Promise.resolve();\n\n // Given that browsers don't handle huge amounts of DOM-elements very well,\n // enforce usage of PAGE-scrolling when loading *very* long/large documents.\n if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {\n console.warn(\n \"Forcing PAGE-scrolling for performance reasons, given the length of the document.\"\n );\n const mode = (this._scrollMode = ScrollMode.PAGE);\n this.eventBus.dispatch(\"scrollmodechanged\", { source: this, mode });\n }\n\n this._pagesCapability.promise.then(\n () => {\n this.eventBus.dispatch(\"pagesloaded\", { source: this, pagesCount });\n },\n () => {\n /* Prevent \"Uncaught (in promise)\"-messages in the console. */\n }\n );\n\n this._onBeforeDraw = evt => {\n const pageView = this._pages[evt.pageNumber - 1];\n if (!pageView) {\n return;\n }\n // Add the page to the buffer at the start of drawing. That way it can be\n // evicted from the buffer and destroyed even if we pause its rendering.\n this.#buffer.push(pageView);\n };\n this.eventBus._on(\"pagerender\", this._onBeforeDraw);\n\n this._onAfterDraw = evt => {\n if (evt.cssTransform || this._onePageRenderedCapability.settled) {\n return;\n }\n this._onePageRenderedCapability.resolve({ timestamp: evt.timestamp });\n\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n this._onAfterDraw = null;\n\n if (this.#onVisibilityChange) {\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n }\n };\n this.eventBus._on(\"pagerendered\", this._onAfterDraw);\n\n // Fetch a single page so we can get a viewport that will be the default\n // viewport for all pages\n Promise.all([firstPagePromise, permissionsPromise])\n .then(([firstPdfPage, permissions]) => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the first page resolved.\n }\n this._firstPageCapability.resolve(firstPdfPage);\n this._optionalContentConfigPromise = optionalContentConfigPromise;\n\n const { annotationEditorMode, annotationMode, textLayerMode } =\n this.#initializePermissions(permissions);\n\n if (textLayerMode !== TextLayerMode.DISABLE) {\n const element = (this.#hiddenCopyElement =\n document.createElement(\"div\"));\n element.id = \"hiddenCopyElement\";\n this.viewer.before(element);\n }\n\n if (annotationEditorMode !== AnnotationEditorType.DISABLE) {\n const mode = annotationEditorMode;\n\n if (pdfDocument.isPureXfa) {\n console.warn(\"Warning: XFA-editing is not implemented.\");\n } else if (isValidAnnotationEditorMode(mode)) {\n this.#annotationEditorUIManager = new AnnotationEditorUIManager(\n this.container,\n this.viewer,\n this.#altTextManager,\n this.eventBus,\n pdfDocument,\n this.pageColors\n );\n if (mode !== AnnotationEditorType.NONE) {\n this.#annotationEditorUIManager.updateMode(mode);\n }\n } else {\n console.error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n }\n\n const layerProperties = this.#layerProperties.bind(this);\n const viewerElement =\n this._scrollMode === ScrollMode.PAGE ? null : this.viewer;\n const scale = this.currentScale;\n const viewport = firstPdfPage.getViewport({\n scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n });\n // Ensure that the various layers always get the correct initial size,\n // see issue 15795.\n this.viewer.style.setProperty(\"--scale-factor\", viewport.scale);\n if (\n this.pageColors?.foreground === \"CanvasText\" ||\n this.pageColors?.background === \"Canvas\"\n ) {\n this.viewer.style.setProperty(\n \"--hcm-highligh-filter\",\n pdfDocument.filterFactory.addHighlightHCMFilter(\n \"CanvasText\",\n \"Canvas\",\n \"HighlightText\",\n \"Highlight\"\n )\n );\n }\n\n for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n const pageView = new PDFPageView({\n container: viewerElement,\n eventBus: this.eventBus,\n id: pageNum,\n scale,\n defaultViewport: viewport.clone(),\n optionalContentConfigPromise,\n renderingQueue: this.renderingQueue,\n textLayerMode,\n annotationMode,\n imageResourcesPath: this.imageResourcesPath,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n maxCanvasPixels: this.maxCanvasPixels,\n pageColors: this.pageColors,\n l10n: this.l10n,\n layerProperties,\n });\n this._pages.push(pageView);\n }\n // Set the first `pdfPage` immediately, since it's already loaded,\n // rather than having to repeat the `PDFDocumentProxy.getPage` call in\n // the `this.#ensurePdfPageLoaded` method before rendering can start.\n const firstPageView = this._pages[0];\n if (firstPageView) {\n firstPageView.setPdfPage(firstPdfPage);\n this.linkService.cachePageRef(1, firstPdfPage.ref);\n }\n\n if (this._scrollMode === ScrollMode.PAGE) {\n // Ensure that the current page becomes visible on document load.\n this.#ensurePageViewVisible();\n } else if (this._spreadMode !== SpreadMode.NONE) {\n this._updateSpreadMode();\n }\n\n // Fetch all the pages since the viewport is needed before printing\n // starts to create the correct size canvas. Wait until one page is\n // rendered so we don't tie up too many resources early on.\n this.#onePageRenderedOrForceFetch().then(async () => {\n this.findController?.setDocument(pdfDocument); // Enable searching.\n this._scriptingManager?.setDocument(pdfDocument); // Enable scripting.\n\n if (this.#hiddenCopyElement) {\n this.#copyCallbackBound = this.#copyCallback.bind(\n this,\n textLayerMode\n );\n document.addEventListener(\"copy\", this.#copyCallbackBound);\n }\n\n if (this.#annotationEditorUIManager) {\n // Ensure that the Editor buttons, in the toolbar, are updated.\n this.eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode: this.#annotationEditorMode,\n });\n }\n\n // In addition to 'disableAutoFetch' being set, also attempt to reduce\n // resource usage when loading *very* long/large documents.\n if (\n pdfDocument.loadingParams.disableAutoFetch ||\n pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT\n ) {\n // XXX: Printing is semi-broken with auto fetch disabled.\n this._pagesCapability.resolve();\n return;\n }\n let getPagesLeft = pagesCount - 1; // The first page was already loaded.\n\n if (getPagesLeft <= 0) {\n this._pagesCapability.resolve();\n return;\n }\n for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {\n const promise = pdfDocument.getPage(pageNum).then(\n pdfPage => {\n const pageView = this._pages[pageNum - 1];\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n this.linkService.cachePageRef(pageNum, pdfPage.ref);\n if (--getPagesLeft === 0) {\n this._pagesCapability.resolve();\n }\n },\n reason => {\n console.error(\n `Unable to get page ${pageNum} to initialize viewer`,\n reason\n );\n if (--getPagesLeft === 0) {\n this._pagesCapability.resolve();\n }\n }\n );\n\n if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) {\n await promise;\n }\n }\n });\n\n this.eventBus.dispatch(\"pagesinit\", { source: this });\n\n pdfDocument.getMetadata().then(({ info }) => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the metadata resolved.\n }\n if (info.Language) {\n this.viewer.lang = info.Language;\n }\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n })\n .catch(reason => {\n console.error(\"Unable to initialize viewer\", reason);\n\n this._pagesCapability.reject(reason);\n });\n }\n\n /**\n * @param {Array|null} labels\n */\n setPageLabels(labels) {\n if (!this.pdfDocument) {\n return;\n }\n if (!labels) {\n this._pageLabels = null;\n } else if (\n !(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)\n ) {\n this._pageLabels = null;\n console.error(`setPageLabels: Invalid page labels.`);\n } else {\n this._pageLabels = labels;\n }\n // Update all the `PDFPageView` instances.\n for (let i = 0, ii = this._pages.length; i < ii; i++) {\n this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);\n }\n }\n\n _resetView() {\n this._pages = [];\n this._currentPageNumber = 1;\n this._currentScale = UNKNOWN_SCALE;\n this._currentScaleValue = null;\n this._pageLabels = null;\n this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);\n this._location = null;\n this._pagesRotation = 0;\n this._optionalContentConfigPromise = null;\n this._firstPageCapability = new PromiseCapability();\n this._onePageRenderedCapability = new PromiseCapability();\n this._pagesCapability = new PromiseCapability();\n this._scrollMode = ScrollMode.VERTICAL;\n this._previousScrollMode = ScrollMode.UNKNOWN;\n this._spreadMode = SpreadMode.NONE;\n\n this.#scrollModePageState = {\n previousPageNumber: 1,\n scrollDown: true,\n pages: [],\n };\n\n if (this._onBeforeDraw) {\n this.eventBus._off(\"pagerender\", this._onBeforeDraw);\n this._onBeforeDraw = null;\n }\n if (this._onAfterDraw) {\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n this._onAfterDraw = null;\n }\n if (this.#onVisibilityChange) {\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n }\n // Remove the pages from the DOM...\n this.viewer.textContent = \"\";\n // ... and reset the Scroll mode CSS class(es) afterwards.\n this._updateScrollMode();\n\n this.viewer.removeAttribute(\"lang\");\n\n if (this.#hiddenCopyElement) {\n document.removeEventListener(\"copy\", this.#copyCallbackBound);\n this.#copyCallbackBound = null;\n\n this.#hiddenCopyElement.remove();\n this.#hiddenCopyElement = null;\n }\n }\n\n #ensurePageViewVisible() {\n if (this._scrollMode !== ScrollMode.PAGE) {\n throw new Error(\"#ensurePageViewVisible: Invalid scrollMode value.\");\n }\n const pageNumber = this._currentPageNumber,\n state = this.#scrollModePageState,\n viewer = this.viewer;\n\n // Temporarily remove all the pages from the DOM...\n viewer.textContent = \"\";\n // ... and clear out the active ones.\n state.pages.length = 0;\n\n if (this._spreadMode === SpreadMode.NONE && !this.isInPresentationMode) {\n // Finally, append the new page to the viewer.\n const pageView = this._pages[pageNumber - 1];\n viewer.append(pageView.div);\n\n state.pages.push(pageView);\n } else {\n const pageIndexSet = new Set(),\n parity = this._spreadMode - 1;\n\n // Determine the pageIndices in the new spread.\n if (parity === -1) {\n // PresentationMode is active, with `SpreadMode.NONE` set.\n pageIndexSet.add(pageNumber - 1);\n } else if (pageNumber % 2 !== parity) {\n // Left-hand side page.\n pageIndexSet.add(pageNumber - 1);\n pageIndexSet.add(pageNumber);\n } else {\n // Right-hand side page.\n pageIndexSet.add(pageNumber - 2);\n pageIndexSet.add(pageNumber - 1);\n }\n\n // Finally, append the new pages to the viewer and apply the spreadMode.\n const spread = document.createElement(\"div\");\n spread.className = \"spread\";\n\n if (this.isInPresentationMode) {\n const dummyPage = document.createElement(\"div\");\n dummyPage.className = \"dummyPage\";\n spread.append(dummyPage);\n }\n\n for (const i of pageIndexSet) {\n const pageView = this._pages[i];\n if (!pageView) {\n continue;\n }\n spread.append(pageView.div);\n\n state.pages.push(pageView);\n }\n viewer.append(spread);\n }\n\n state.scrollDown = pageNumber >= state.previousPageNumber;\n state.previousPageNumber = pageNumber;\n }\n\n _scrollUpdate() {\n if (this.pagesCount === 0) {\n return;\n }\n this.update();\n }\n\n #scrollIntoView(pageView, pageSpot = null) {\n const { div, id } = pageView;\n\n // Ensure that `this._currentPageNumber` is correct, when `#scrollIntoView`\n // is called directly (and not from `#resetCurrentPageView`).\n if (this._currentPageNumber !== id) {\n this._setCurrentPageNumber(id);\n }\n if (this._scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n // Ensure that rendering always occurs, to avoid showing a blank page,\n // even if the current position doesn't change when the page is scrolled.\n this.update();\n }\n\n if (!pageSpot && !this.isInPresentationMode) {\n const left = div.offsetLeft + div.clientLeft,\n right = left + div.clientWidth;\n const { scrollLeft, clientWidth } = this.container;\n if (\n this._scrollMode === ScrollMode.HORIZONTAL ||\n left < scrollLeft ||\n right > scrollLeft + clientWidth\n ) {\n pageSpot = { left: 0, top: 0 };\n }\n }\n scrollIntoView(div, pageSpot);\n\n // Ensure that the correct *initial* document position is set, when any\n // OpenParameters are used, for documents with non-default Scroll/Spread\n // modes (fixes issue 15695). This is necessary since the scroll-handler\n // invokes the `update`-method asynchronously, and `this._location` could\n // thus be wrong when the initial zooming occurs in the default viewer.\n if (!this._currentScaleValue && this._location) {\n this._location = null;\n }\n }\n\n /**\n * Prevent unnecessary re-rendering of all pages when the scale changes\n * only because of limited numerical precision.\n */\n #isSameScale(newScale) {\n return (\n newScale === this._currentScale ||\n Math.abs(newScale - this._currentScale) < 1e-15\n );\n }\n\n #setScaleUpdatePages(\n newScale,\n newValue,\n { noScroll = false, preset = false, drawingDelay = -1 }\n ) {\n this._currentScaleValue = newValue.toString();\n\n if (this.#isSameScale(newScale)) {\n if (preset) {\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: newValue,\n });\n }\n return;\n }\n\n this.viewer.style.setProperty(\n \"--scale-factor\",\n newScale * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n\n const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;\n this.refresh(true, {\n scale: newScale,\n drawingDelay: postponeDrawing ? drawingDelay : -1,\n });\n\n if (postponeDrawing) {\n this.#scaleTimeoutId = setTimeout(() => {\n this.#scaleTimeoutId = null;\n this.refresh();\n }, drawingDelay);\n }\n\n this._currentScale = newScale;\n\n if (!noScroll) {\n let page = this._currentPageNumber,\n dest;\n if (\n this._location &&\n !(this.isInPresentationMode || this.isChangingPresentationMode)\n ) {\n page = this._location.pageNumber;\n dest = [\n null,\n { name: \"XYZ\" },\n this._location.left,\n this._location.top,\n null,\n ];\n }\n this.scrollPageIntoView({\n pageNumber: page,\n destArray: dest,\n allowNegativeOffset: true,\n });\n }\n\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: preset ? newValue : undefined,\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n\n get #pageWidthScaleFactor() {\n if (\n this._spreadMode !== SpreadMode.NONE &&\n this._scrollMode !== ScrollMode.HORIZONTAL\n ) {\n return 2;\n }\n return 1;\n }\n\n #setScale(value, options) {\n let scale = parseFloat(value);\n\n if (scale > 0) {\n options.preset = false;\n this.#setScaleUpdatePages(scale, value, options);\n } else {\n const currentPage = this._pages[this._currentPageNumber - 1];\n if (!currentPage) {\n return;\n }\n let hPadding = SCROLLBAR_PADDING,\n vPadding = VERTICAL_PADDING;\n\n if (this.isInPresentationMode) {\n // Pages have a 2px (transparent) border in PresentationMode, see\n // the `web/pdf_viewer.css` file.\n hPadding = vPadding = 4; // 2 * 2px\n if (this._spreadMode !== SpreadMode.NONE) {\n // Account for two pages being visible in PresentationMode, thus\n // \"doubling\" the total border width.\n hPadding *= 2;\n }\n } else if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n hPadding = vPadding = 0;\n } else if (this._scrollMode === ScrollMode.HORIZONTAL) {\n [hPadding, vPadding] = [vPadding, hPadding]; // Swap the padding values.\n }\n const pageWidthScale =\n (((this.container.clientWidth - hPadding) / currentPage.width) *\n currentPage.scale) /\n this.#pageWidthScaleFactor;\n const pageHeightScale =\n ((this.container.clientHeight - vPadding) / currentPage.height) *\n currentPage.scale;\n switch (value) {\n case \"page-actual\":\n scale = 1;\n break;\n case \"page-width\":\n scale = pageWidthScale;\n break;\n case \"page-height\":\n scale = pageHeightScale;\n break;\n case \"page-fit\":\n scale = Math.min(pageWidthScale, pageHeightScale);\n break;\n case \"auto\":\n // For pages in landscape mode, fit the page height to the viewer\n // *unless* the page would thus become too wide to fit horizontally.\n const horizontalScale = isPortraitOrientation(currentPage)\n ? pageWidthScale\n : Math.min(pageHeightScale, pageWidthScale);\n scale = Math.min(MAX_AUTO_SCALE, horizontalScale);\n break;\n default:\n console.error(`#setScale: \"${value}\" is an unknown zoom value.`);\n return;\n }\n options.preset = true;\n this.#setScaleUpdatePages(scale, value, options);\n }\n }\n\n /**\n * Refreshes page view: scrolls to the current page and updates the scale.\n */\n #resetCurrentPageView() {\n const pageView = this._pages[this._currentPageNumber - 1];\n\n if (this.isInPresentationMode) {\n // Fixes the case when PDF has different page sizes.\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this.#scrollIntoView(pageView);\n }\n\n /**\n * @param {string} label - The page label.\n * @returns {number|null} The page number corresponding to the page label,\n * or `null` when no page labels exist and/or the input is invalid.\n */\n pageLabelToPageNumber(label) {\n if (!this._pageLabels) {\n return null;\n }\n const i = this._pageLabels.indexOf(label);\n if (i < 0) {\n return null;\n }\n return i + 1;\n }\n\n /**\n * @typedef {Object} ScrollPageIntoViewParameters\n * @property {number} pageNumber - The page number.\n * @property {Array} [destArray] - The original PDF destination array, in the\n * format: <page-ref> </XYZ|/FitXXX> <args..>\n * @property {boolean} [allowNegativeOffset] - Allow negative page offsets.\n * The default value is `false`.\n * @property {boolean} [ignoreDestinationZoom] - Ignore the zoom argument in\n * the destination array. The default value is `false`.\n */\n\n /**\n * Scrolls page into view.\n * @param {ScrollPageIntoViewParameters} params\n */\n scrollPageIntoView({\n pageNumber,\n destArray = null,\n allowNegativeOffset = false,\n ignoreDestinationZoom = false,\n }) {\n if (!this.pdfDocument) {\n return;\n }\n const pageView =\n Number.isInteger(pageNumber) && this._pages[pageNumber - 1];\n if (!pageView) {\n console.error(\n `scrollPageIntoView: \"${pageNumber}\" is not a valid pageNumber parameter.`\n );\n return;\n }\n\n if (this.isInPresentationMode || !destArray) {\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n return;\n }\n let x = 0,\n y = 0;\n let width = 0,\n height = 0,\n widthScale,\n heightScale;\n const changeOrientation = pageView.rotation % 180 !== 0;\n const pageWidth =\n (changeOrientation ? pageView.height : pageView.width) /\n pageView.scale /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n const pageHeight =\n (changeOrientation ? pageView.width : pageView.height) /\n pageView.scale /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n let scale = 0;\n switch (destArray[1].name) {\n case \"XYZ\":\n x = destArray[2];\n y = destArray[3];\n scale = destArray[4];\n // If x and/or y coordinates are not supplied, default to\n // _top_ left of the page (not the obvious bottom left,\n // since aligning the bottom of the intended page with the\n // top of the window is rarely helpful).\n x = x !== null ? x : 0;\n y = y !== null ? y : pageHeight;\n break;\n case \"Fit\":\n case \"FitB\":\n scale = \"page-fit\";\n break;\n case \"FitH\":\n case \"FitBH\":\n y = destArray[2];\n scale = \"page-width\";\n // According to the PDF spec, section 12.3.2.2, a `null` value in the\n // parameter should maintain the position relative to the new page.\n if (y === null && this._location) {\n x = this._location.left;\n y = this._location.top;\n } else if (typeof y !== \"number\" || y < 0) {\n // The \"top\" value isn't optional, according to the spec, however some\n // bad PDF generators will pretend that it is (fixes bug 1663390).\n y = pageHeight;\n }\n break;\n case \"FitV\":\n case \"FitBV\":\n x = destArray[2];\n width = pageWidth;\n height = pageHeight;\n scale = \"page-height\";\n break;\n case \"FitR\":\n x = destArray[2];\n y = destArray[3];\n width = destArray[4] - x;\n height = destArray[5] - y;\n let hPadding = SCROLLBAR_PADDING,\n vPadding = VERTICAL_PADDING;\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n hPadding = vPadding = 0;\n }\n widthScale =\n (this.container.clientWidth - hPadding) /\n width /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n heightScale =\n (this.container.clientHeight - vPadding) /\n height /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));\n break;\n default:\n console.error(\n `scrollPageIntoView: \"${destArray[1].name}\" is not a valid destination type.`\n );\n return;\n }\n\n if (!ignoreDestinationZoom) {\n if (scale && scale !== this._currentScale) {\n this.currentScaleValue = scale;\n } else if (this._currentScale === UNKNOWN_SCALE) {\n this.currentScaleValue = DEFAULT_SCALE_VALUE;\n }\n }\n\n if (scale === \"page-fit\" && !destArray[4]) {\n this.#scrollIntoView(pageView);\n return;\n }\n\n const boundingRect = [\n pageView.viewport.convertToViewportPoint(x, y),\n pageView.viewport.convertToViewportPoint(x + width, y + height),\n ];\n let left = Math.min(boundingRect[0][0], boundingRect[1][0]);\n let top = Math.min(boundingRect[0][1], boundingRect[1][1]);\n\n if (!allowNegativeOffset) {\n // Some bad PDF generators will create destinations with e.g. top values\n // that exceeds the page height. Ensure that offsets are not negative,\n // to prevent a previous page from becoming visible (fixes bug 874482).\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n }\n this.#scrollIntoView(pageView, /* pageSpot = */ { left, top });\n }\n\n _updateLocation(firstPage) {\n const currentScale = this._currentScale;\n const currentScaleValue = this._currentScaleValue;\n const normalizedScaleValue =\n parseFloat(currentScaleValue) === currentScale\n ? Math.round(currentScale * 10000) / 100\n : currentScaleValue;\n\n const pageNumber = firstPage.id;\n const currentPageView = this._pages[pageNumber - 1];\n const container = this.container;\n const topLeft = currentPageView.getPagePoint(\n container.scrollLeft - firstPage.x,\n container.scrollTop - firstPage.y\n );\n const intLeft = Math.round(topLeft[0]);\n const intTop = Math.round(topLeft[1]);\n\n let pdfOpenParams = `#page=${pageNumber}`;\n if (!this.isInPresentationMode) {\n pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`;\n }\n\n this._location = {\n pageNumber,\n scale: normalizedScaleValue,\n top: intTop,\n left: intLeft,\n rotation: this._pagesRotation,\n pdfOpenParams,\n };\n }\n\n update() {\n const visible = this._getVisiblePages();\n const visiblePages = visible.views,\n numVisiblePages = visiblePages.length;\n\n if (numVisiblePages === 0) {\n return;\n }\n const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);\n this.#buffer.resize(newCacheSize, visible.ids);\n\n this.renderingQueue.renderHighestPriority(visible);\n\n const isSimpleLayout =\n this._spreadMode === SpreadMode.NONE &&\n (this._scrollMode === ScrollMode.PAGE ||\n this._scrollMode === ScrollMode.VERTICAL);\n const currentId = this._currentPageNumber;\n let stillFullyVisible = false;\n\n for (const page of visiblePages) {\n if (page.percent < 100) {\n break;\n }\n if (page.id === currentId && isSimpleLayout) {\n stillFullyVisible = true;\n break;\n }\n }\n this._setCurrentPageNumber(\n stillFullyVisible ? currentId : visiblePages[0].id\n );\n\n this._updateLocation(visible.first);\n this.eventBus.dispatch(\"updateviewarea\", {\n source: this,\n location: this._location,\n });\n }\n\n containsElement(element) {\n return this.container.contains(element);\n }\n\n focus() {\n this.container.focus();\n }\n\n get _isContainerRtl() {\n return getComputedStyle(this.container).direction === \"rtl\";\n }\n\n get isInPresentationMode() {\n return this.presentationModeState === PresentationModeState.FULLSCREEN;\n }\n\n get isChangingPresentationMode() {\n return this.presentationModeState === PresentationModeState.CHANGING;\n }\n\n get isHorizontalScrollbarEnabled() {\n return this.isInPresentationMode\n ? false\n : this.container.scrollWidth > this.container.clientWidth;\n }\n\n get isVerticalScrollbarEnabled() {\n return this.isInPresentationMode\n ? false\n : this.container.scrollHeight > this.container.clientHeight;\n }\n\n _getVisiblePages() {\n const views =\n this._scrollMode === ScrollMode.PAGE\n ? this.#scrollModePageState.pages\n : this._pages,\n horizontal = this._scrollMode === ScrollMode.HORIZONTAL,\n rtl = horizontal && this._isContainerRtl;\n\n return getVisibleElements({\n scrollEl: this.container,\n views,\n sortByVisibility: true,\n horizontal,\n rtl,\n });\n }\n\n cleanup() {\n for (const pageView of this._pages) {\n if (pageView.renderingState !== RenderingStates.FINISHED) {\n pageView.reset();\n }\n }\n }\n\n /**\n * @private\n */\n _cancelRendering() {\n for (const pageView of this._pages) {\n pageView.cancelRendering();\n }\n }\n\n /**\n * @param {PDFPageView} pageView\n * @returns {Promise<PDFPageProxy | null>}\n */\n async #ensurePdfPageLoaded(pageView) {\n if (pageView.pdfPage) {\n return pageView.pdfPage;\n }\n try {\n const pdfPage = await this.pdfDocument.getPage(pageView.id);\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) {\n this.linkService.cachePageRef(pageView.id, pdfPage.ref);\n }\n return pdfPage;\n } catch (reason) {\n console.error(\"Unable to get page for page view\", reason);\n return null; // Page error -- there is nothing that can be done.\n }\n }\n\n #getScrollAhead(visible) {\n if (visible.first?.id === 1) {\n return true;\n } else if (visible.last?.id === this.pagesCount) {\n return false;\n }\n switch (this._scrollMode) {\n case ScrollMode.PAGE:\n return this.#scrollModePageState.scrollDown;\n case ScrollMode.HORIZONTAL:\n return this.scroll.right;\n }\n return this.scroll.down;\n }\n\n forceRendering(currentlyVisiblePages) {\n const visiblePages = currentlyVisiblePages || this._getVisiblePages();\n const scrollAhead = this.#getScrollAhead(visiblePages);\n const preRenderExtra =\n this._spreadMode !== SpreadMode.NONE &&\n this._scrollMode !== ScrollMode.HORIZONTAL;\n\n const pageView = this.renderingQueue.getHighestPriority(\n visiblePages,\n this._pages,\n scrollAhead,\n preRenderExtra\n );\n\n if (pageView) {\n this.#ensurePdfPageLoaded(pageView).then(() => {\n this.renderingQueue.renderView(pageView);\n });\n return true;\n }\n return false;\n }\n\n /**\n * @type {boolean} Whether all pages of the PDF document have identical\n * widths and heights.\n */\n get hasEqualPageSizes() {\n const firstPageView = this._pages[0];\n for (let i = 1, ii = this._pages.length; i < ii; ++i) {\n const pageView = this._pages[i];\n if (\n pageView.width !== firstPageView.width ||\n pageView.height !== firstPageView.height\n ) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Returns sizes of the pages.\n * @returns {Array} Array of objects with width/height/rotation fields.\n */\n getPagesOverview() {\n let initialOrientation;\n return this._pages.map(pageView => {\n const viewport = pageView.pdfPage.getViewport({ scale: 1 });\n const orientation = isPortraitOrientation(viewport);\n if (initialOrientation === undefined) {\n initialOrientation = orientation;\n } else if (\n this.enablePrintAutoRotate &&\n orientation !== initialOrientation\n ) {\n // Rotate to fit the initial orientation.\n return {\n width: viewport.height,\n height: viewport.width,\n rotation: (viewport.rotation - 90) % 360,\n };\n }\n return {\n width: viewport.width,\n height: viewport.height,\n rotation: viewport.rotation,\n };\n });\n }\n\n /**\n * @type {Promise<OptionalContentConfig | null>}\n */\n get optionalContentConfigPromise() {\n if (!this.pdfDocument) {\n return Promise.resolve(null);\n }\n if (!this._optionalContentConfigPromise) {\n console.error(\"optionalContentConfigPromise: Not initialized yet.\");\n // Prevent issues if the getter is accessed *before* the `onePageRendered`\n // promise has resolved; won't (normally) happen in the default viewer.\n return this.pdfDocument.getOptionalContentConfig();\n }\n return this._optionalContentConfigPromise;\n }\n\n /**\n * @param {Promise<OptionalContentConfig>} promise - A promise that is\n * resolved with an {@link OptionalContentConfig} instance.\n */\n set optionalContentConfigPromise(promise) {\n if (!(promise instanceof Promise)) {\n throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);\n }\n if (!this.pdfDocument) {\n return;\n }\n if (!this._optionalContentConfigPromise) {\n // Ignore the setter *before* the `onePageRendered` promise has resolved,\n // since it'll be overwritten anyway; won't happen in the default viewer.\n return;\n }\n this._optionalContentConfigPromise = promise;\n\n this.refresh(false, { optionalContentConfigPromise: promise });\n\n this.eventBus.dispatch(\"optionalcontentconfigchanged\", {\n source: this,\n promise,\n });\n }\n\n /**\n * @type {number} One of the values in {ScrollMode}.\n */\n get scrollMode() {\n return this._scrollMode;\n }\n\n /**\n * @param {number} mode - The direction in which the document pages should be\n * laid out within the scrolling container.\n * The constants from {ScrollMode} should be used.\n */\n set scrollMode(mode) {\n if (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n ) {\n // NOTE: Always ignore the pageLayout in GeckoView since there's\n // no UI available to change Scroll/Spread modes for the user.\n return;\n }\n if (this._scrollMode === mode) {\n return; // The Scroll mode didn't change.\n }\n if (!isValidScrollMode(mode)) {\n throw new Error(`Invalid scroll mode: ${mode}`);\n }\n if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {\n return; // Disabled for performance reasons.\n }\n this._previousScrollMode = this._scrollMode;\n\n this._scrollMode = mode;\n this.eventBus.dispatch(\"scrollmodechanged\", { source: this, mode });\n\n this._updateScrollMode(/* pageNumber = */ this._currentPageNumber);\n }\n\n _updateScrollMode(pageNumber = null) {\n const scrollMode = this._scrollMode,\n viewer = this.viewer;\n\n viewer.classList.toggle(\n \"scrollHorizontal\",\n scrollMode === ScrollMode.HORIZONTAL\n );\n viewer.classList.toggle(\"scrollWrapped\", scrollMode === ScrollMode.WRAPPED);\n\n if (!this.pdfDocument || !pageNumber) {\n return;\n }\n\n if (scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else if (this._previousScrollMode === ScrollMode.PAGE) {\n // Ensure that the current spreadMode is still applied correctly when\n // the *previous* scrollMode was `ScrollMode.PAGE`.\n this._updateSpreadMode();\n }\n // Non-numeric scale values can be sensitive to the scroll orientation.\n // Call this before re-scrolling to the current page, to ensure that any\n // changes in scale don't move the current page.\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n this.update();\n }\n\n /**\n * @type {number} One of the values in {SpreadMode}.\n */\n get spreadMode() {\n return this._spreadMode;\n }\n\n /**\n * @param {number} mode - Group the pages in spreads, starting with odd- or\n * even-number pages (unless `SpreadMode.NONE` is used).\n * The constants from {SpreadMode} should be used.\n */\n set spreadMode(mode) {\n if (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n ) {\n // NOTE: Always ignore the pageLayout in GeckoView since there's\n // no UI available to change Scroll/Spread modes for the user.\n return;\n }\n if (this._spreadMode === mode) {\n return; // The Spread mode didn't change.\n }\n if (!isValidSpreadMode(mode)) {\n throw new Error(`Invalid spread mode: ${mode}`);\n }\n this._spreadMode = mode;\n this.eventBus.dispatch(\"spreadmodechanged\", { source: this, mode });\n\n this._updateSpreadMode(/* pageNumber = */ this._currentPageNumber);\n }\n\n _updateSpreadMode(pageNumber = null) {\n if (!this.pdfDocument) {\n return;\n }\n const viewer = this.viewer,\n pages = this._pages;\n\n if (this._scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else {\n // Temporarily remove all the pages from the DOM.\n viewer.textContent = \"\";\n\n if (this._spreadMode === SpreadMode.NONE) {\n for (const pageView of this._pages) {\n viewer.append(pageView.div);\n }\n } else {\n const parity = this._spreadMode - 1;\n let spread = null;\n for (let i = 0, ii = pages.length; i < ii; ++i) {\n if (spread === null) {\n spread = document.createElement(\"div\");\n spread.className = \"spread\";\n viewer.append(spread);\n } else if (i % 2 === parity) {\n spread = spread.cloneNode(false);\n viewer.append(spread);\n }\n spread.append(pages[i].div);\n }\n }\n }\n\n if (!pageNumber) {\n return;\n }\n // Non-numeric scale values can be sensitive to the scroll orientation.\n // Call this before re-scrolling to the current page, to ensure that any\n // changes in scale don't move the current page.\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n this.update();\n }\n\n /**\n * @private\n */\n _getPageAdvance(currentPageNumber, previous = false) {\n switch (this._scrollMode) {\n case ScrollMode.WRAPPED: {\n const { views } = this._getVisiblePages(),\n pageLayout = new Map();\n\n // Determine the current (visible) page layout.\n for (const { id, y, percent, widthPercent } of views) {\n if (percent === 0 || widthPercent < 100) {\n continue;\n }\n let yArray = pageLayout.get(y);\n if (!yArray) {\n pageLayout.set(y, (yArray ||= []));\n }\n yArray.push(id);\n }\n // Find the row of the current page.\n for (const yArray of pageLayout.values()) {\n const currentIndex = yArray.indexOf(currentPageNumber);\n if (currentIndex === -1) {\n continue;\n }\n const numPages = yArray.length;\n if (numPages === 1) {\n break;\n }\n // Handle documents with varying page sizes.\n if (previous) {\n for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {\n const currentId = yArray[i],\n expectedId = yArray[i + 1] - 1;\n if (currentId < expectedId) {\n return currentPageNumber - expectedId;\n }\n }\n } else {\n for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {\n const currentId = yArray[i],\n expectedId = yArray[i - 1] + 1;\n if (currentId > expectedId) {\n return expectedId - currentPageNumber;\n }\n }\n }\n // The current row is \"complete\", advance to the previous/next one.\n if (previous) {\n const firstId = yArray[0];\n if (firstId < currentPageNumber) {\n return currentPageNumber - firstId + 1;\n }\n } else {\n const lastId = yArray[numPages - 1];\n if (lastId > currentPageNumber) {\n return lastId - currentPageNumber + 1;\n }\n }\n break;\n }\n break;\n }\n case ScrollMode.HORIZONTAL: {\n break;\n }\n case ScrollMode.PAGE:\n case ScrollMode.VERTICAL: {\n if (this._spreadMode === SpreadMode.NONE) {\n break; // Normal vertical scrolling.\n }\n const parity = this._spreadMode - 1;\n\n if (previous && currentPageNumber % 2 !== parity) {\n break; // Left-hand side page.\n } else if (!previous && currentPageNumber % 2 === parity) {\n break; // Right-hand side page.\n }\n const { views } = this._getVisiblePages(),\n expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;\n\n for (const { id, percent, widthPercent } of views) {\n if (id !== expectedId) {\n continue;\n }\n if (percent > 0 && widthPercent === 100) {\n return 2;\n }\n break;\n }\n break;\n }\n }\n return 1;\n }\n\n /**\n * Go to the next page, taking scroll/spread-modes into account.\n * @returns {boolean} Whether navigation occurred.\n */\n nextPage() {\n const currentPageNumber = this._currentPageNumber,\n pagesCount = this.pagesCount;\n\n if (currentPageNumber >= pagesCount) {\n return false;\n }\n const advance =\n this._getPageAdvance(currentPageNumber, /* previous = */ false) || 1;\n\n this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);\n return true;\n }\n\n /**\n * Go to the previous page, taking scroll/spread-modes into account.\n * @returns {boolean} Whether navigation occurred.\n */\n previousPage() {\n const currentPageNumber = this._currentPageNumber;\n\n if (currentPageNumber <= 1) {\n return false;\n }\n const advance =\n this._getPageAdvance(currentPageNumber, /* previous = */ true) || 1;\n\n this.currentPageNumber = Math.max(currentPageNumber - advance, 1);\n return true;\n }\n\n /**\n * @typedef {Object} ChangeScaleOptions\n * @property {number} [drawingDelay]\n * @property {number} [scaleFactor]\n * @property {number} [steps]\n */\n\n /**\n * Increase the current zoom level one, or more, times.\n * @param {ChangeScaleOptions} [options]\n */\n increaseScale({ drawingDelay, scaleFactor, steps } = {}) {\n if (!this.pdfDocument) {\n return;\n }\n let newScale = this._currentScale;\n if (scaleFactor > 1) {\n newScale = Math.round(newScale * scaleFactor * 100) / 100;\n } else {\n steps ??= 1;\n do {\n newScale =\n Math.ceil((newScale * DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;\n } while (--steps > 0 && newScale < MAX_SCALE);\n }\n this.#setScale(Math.min(MAX_SCALE, newScale), {\n noScroll: false,\n drawingDelay,\n });\n }\n\n /**\n * Decrease the current zoom level one, or more, times.\n * @param {ChangeScaleOptions} [options]\n */\n decreaseScale({ drawingDelay, scaleFactor, steps } = {}) {\n if (!this.pdfDocument) {\n return;\n }\n let newScale = this._currentScale;\n if (scaleFactor > 0 && scaleFactor < 1) {\n newScale = Math.round(newScale * scaleFactor * 100) / 100;\n } else {\n steps ??= 1;\n do {\n newScale =\n Math.floor((newScale / DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;\n } while (--steps > 0 && newScale > MIN_SCALE);\n }\n this.#setScale(Math.max(MIN_SCALE, newScale), {\n noScroll: false,\n drawingDelay,\n });\n }\n\n #updateContainerHeightCss(height = this.container.clientHeight) {\n if (height !== this.#previousContainerHeight) {\n this.#previousContainerHeight = height;\n docStyle.setProperty(\"--viewer-container-height\", `${height}px`);\n }\n }\n\n #resizeObserverCallback(entries) {\n for (const entry of entries) {\n if (entry.target === this.container) {\n this.#updateContainerHeightCss(\n Math.floor(entry.borderBoxSize[0].blockSize)\n );\n this.#containerTopLeft = null;\n break;\n }\n }\n }\n\n get containerTopLeft() {\n return (this.#containerTopLeft ||= [\n this.container.offsetTop,\n this.container.offsetLeft,\n ]);\n }\n\n /**\n * @type {number}\n */\n get annotationEditorMode() {\n return this.#annotationEditorUIManager\n ? this.#annotationEditorMode\n : AnnotationEditorType.DISABLE;\n }\n\n /**\n * @param {number} mode - AnnotationEditor mode (None, FreeText, Ink, ...)\n */\n set annotationEditorMode({ mode, editId = null }) {\n if (!this.#annotationEditorUIManager) {\n throw new Error(`The AnnotationEditor is not enabled.`);\n }\n if (this.#annotationEditorMode === mode) {\n return; // The AnnotationEditor mode didn't change.\n }\n if (!isValidAnnotationEditorMode(mode)) {\n throw new Error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n if (!this.pdfDocument) {\n return;\n }\n this.#annotationEditorMode = mode;\n this.eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode,\n });\n\n this.#annotationEditorUIManager.updateMode(mode, editId);\n }\n\n // eslint-disable-next-line accessor-pairs\n set annotationEditorParams({ type, value }) {\n if (!this.#annotationEditorUIManager) {\n throw new Error(`The AnnotationEditor is not enabled.`);\n }\n this.#annotationEditorUIManager.updateParams(type, value);\n }\n\n refresh(noUpdate = false, updateArgs = Object.create(null)) {\n if (!this.pdfDocument) {\n return;\n }\n for (const pageView of this._pages) {\n pageView.update(updateArgs);\n }\n if (this.#scaleTimeoutId !== null) {\n clearTimeout(this.#scaleTimeoutId);\n this.#scaleTimeoutId = null;\n }\n if (!noUpdate) {\n this.update();\n }\n }\n}\n\nexport { PagesCountLimit, PDFPageViewBuffer, PDFViewer };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * PLEASE NOTE: This file is currently imported in both the `web/` and\n * `src/display/` folders, hence be EXTREMELY careful about\n * introducing any dependencies here since that can lead to an\n * unexpected/unnecessary size increase of the *built* files.\n */\n\n/**\n * A subset of the l10n strings in the `l10n/en-US/viewer.properties` file.\n */\nconst DEFAULT_L10N_STRINGS = {\n of_pages: \"of {{pagesCount}}\",\n page_of_pages: \"({{pageNumber}} of {{pagesCount}})\",\n\n document_properties_kb: \"{{size_kb}} KB ({{size_b}} bytes)\",\n document_properties_mb: \"{{size_mb}} MB ({{size_b}} bytes)\",\n document_properties_date_string: \"{{date}}, {{time}}\",\n document_properties_page_size_unit_inches: \"in\",\n document_properties_page_size_unit_millimeters: \"mm\",\n document_properties_page_size_orientation_portrait: \"portrait\",\n document_properties_page_size_orientation_landscape: \"landscape\",\n document_properties_page_size_name_a3: \"A3\",\n document_properties_page_size_name_a4: \"A4\",\n document_properties_page_size_name_letter: \"Letter\",\n document_properties_page_size_name_legal: \"Legal\",\n document_properties_page_size_dimension_string:\n \"{{width}} × {{height}} {{unit}} ({{orientation}})\",\n document_properties_page_size_dimension_name_string:\n \"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})\",\n document_properties_linearized_yes: \"Yes\",\n document_properties_linearized_no: \"No\",\n\n additional_layers: \"Additional Layers\",\n page_landmark: \"Page {{page}}\",\n thumb_page_title: \"Page {{page}}\",\n thumb_page_canvas: \"Thumbnail of Page {{page}}\",\n\n find_reached_top: \"Reached top of document, continued from bottom\",\n find_reached_bottom: \"Reached end of document, continued from top\",\n \"find_match_count[one]\": \"{{current}} of {{total}} match\",\n \"find_match_count[other]\": \"{{current}} of {{total}} matches\",\n \"find_match_count_limit[one]\": \"More than {{limit}} match\",\n \"find_match_count_limit[other]\": \"More than {{limit}} matches\",\n find_not_found: \"Phrase not found\",\n\n page_scale_width: \"Page Width\",\n page_scale_fit: \"Page Fit\",\n page_scale_auto: \"Automatic Zoom\",\n page_scale_actual: \"Actual Size\",\n page_scale_percent: \"{{scale}}%\",\n\n loading_error: \"An error occurred while loading the PDF.\",\n invalid_file_error: \"Invalid or corrupted PDF file.\",\n missing_file_error: \"Missing PDF file.\",\n unexpected_response_error: \"Unexpected server response.\",\n rendering_error: \"An error occurred while rendering the page.\",\n\n annotation_date_string: \"{{date}}, {{time}}\",\n\n printing_not_supported:\n \"Warning: Printing is not fully supported by this browser.\",\n printing_not_ready: \"Warning: The PDF is not fully loaded for printing.\",\n web_fonts_disabled:\n \"Web fonts are disabled: unable to use embedded PDF fonts.\",\n\n free_text2_default_content: \"Start typing…\",\n editor_free_text2_aria_label: \"Text Editor\",\n editor_ink2_aria_label: \"Draw Editor\",\n editor_ink_canvas_aria_label: \"User-created image\",\n editor_alt_text_button_label: \"Alt text\",\n editor_alt_text_edit_button_label: \"Edit alt text\",\n editor_alt_text_decorative_tooltip: \"Marked as decorative\",\n};\nif (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n DEFAULT_L10N_STRINGS.print_progress_percent = \"{{progress}}%\";\n}\n\nfunction getL10nFallback(key, args) {\n switch (key) {\n case \"find_match_count\":\n key = `find_match_count[${args.total === 1 ? \"one\" : \"other\"}]`;\n break;\n case \"find_match_count_limit\":\n key = `find_match_count_limit[${args.limit === 1 ? \"one\" : \"other\"}]`;\n break;\n }\n return DEFAULT_L10N_STRINGS[key] || \"\";\n}\n\n// Replaces {{arguments}} with their values.\nfunction formatL10nValue(text, args) {\n if (!args) {\n return text;\n }\n return text.replaceAll(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (all, name) => {\n return name in args ? args[name] : \"{{\" + name + \"}}\";\n });\n}\n\n/**\n * No-op implementation of the localization service.\n * @implements {IL10n}\n */\nconst NullL10n = {\n async getLanguage() {\n return \"en-us\";\n },\n\n async getDirection() {\n return \"ltr\";\n },\n\n async get(key, args = null, fallback = getL10nFallback(key, args)) {\n return formatL10nValue(fallback, args);\n },\n\n async translate(element) {},\n};\n\nexport { getL10nFallback, NullL10n };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/optional_content_config\").OptionalContentConfig} OptionalContentConfig */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IRenderableView} IRenderableView */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n\nimport {\n AbortException,\n AnnotationMode,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n shadow,\n} from \"pdfjs-lib\";\nimport {\n approximateFraction,\n DEFAULT_SCALE,\n OutputScale,\n RenderingStates,\n roundToDivide,\n TextLayerMode,\n} from \"./ui_utils.js\";\nimport { AnnotationEditorLayerBuilder } from \"./annotation_editor_layer_builder.js\";\nimport { AnnotationLayerBuilder } from \"./annotation_layer_builder.js\";\nimport { compatibilityParams } from \"./app_options.js\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\nimport { StructTreeLayerBuilder } from \"./struct_tree_layer_builder.js\";\nimport { TextAccessibilityManager } from \"./text_accessibility.js\";\nimport { TextHighlighter } from \"./text_highlighter.js\";\nimport { TextLayerBuilder } from \"./text_layer_builder.js\";\nimport { XfaLayerBuilder } from \"./xfa_layer_builder.js\";\n\n/**\n * @typedef {Object} PDFPageViewOptions\n * @property {HTMLDivElement} [container] - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} id - The page unique ID (normally its number).\n * @property {number} [scale] - The page scale display.\n * @property {PageViewport} defaultViewport - The page viewport.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -\n * A promise that is resolved with an {@link OptionalContentConfig} instance.\n * The default value is `null`.\n * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.\n * @property {number} [textLayerMode] - Controls if the text layer used for\n * selection and searching is created. The constants from {TextLayerMode}\n * should be used. The default value is `TextLayerMode.ENABLE`.\n * @property {number} [annotationMode] - Controls if the annotation layer is\n * created, and if interactive form elements or `AnnotationStorage`-data are\n * being rendered. The constants from {@link AnnotationMode} should be used;\n * see also {@link RenderParameters} and {@link GetOperatorListParameters}.\n * The default value is `AnnotationMode.ENABLE_FORMS`.\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n * @property {number} [maxCanvasPixels] - The maximum supported canvas size in\n * total pixels, i.e. width * height. Use `-1` for no limit, or `0` for\n * CSS-only zooming. The default value is 4096 * 4096 (16 mega-pixels).\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n * @property {IL10n} [l10n] - Localization service.\n * @property {function} [layerProperties] - The function that is used to lookup\n * the necessary layer-properties.\n */\n\nconst MAX_CANVAS_PIXELS = compatibilityParams.maxCanvasPixels || 16777216;\n\nconst DEFAULT_LAYER_PROPERTIES = () => {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"COMPONENTS\")) {\n return null;\n }\n return {\n annotationEditorUIManager: null,\n annotationStorage: null,\n downloadManager: null,\n enableScripting: false,\n fieldObjectsPromise: null,\n findController: null,\n hasJSActionsPromise: null,\n get linkService() {\n return new SimpleLinkService();\n },\n };\n};\n\n/**\n * @implements {IRenderableView}\n */\nclass PDFPageView {\n #annotationMode = AnnotationMode.ENABLE_FORMS;\n\n #hasRestrictedScaling = false;\n\n #layerProperties = null;\n\n #loadingId = null;\n\n #previousRotation = null;\n\n #renderError = null;\n\n #renderingState = RenderingStates.INITIAL;\n\n #textLayerMode = TextLayerMode.ENABLE;\n\n #useThumbnailCanvas = {\n directDrawing: true,\n initialOptionalContent: true,\n regularAnnotations: true,\n };\n\n #viewportMap = new WeakMap();\n\n /**\n * @param {PDFPageViewOptions} options\n */\n constructor(options) {\n const container = options.container;\n const defaultViewport = options.defaultViewport;\n\n this.id = options.id;\n this.renderingId = \"page\" + this.id;\n this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES;\n\n this.pdfPage = null;\n this.pageLabel = null;\n this.rotation = 0;\n this.scale = options.scale || DEFAULT_SCALE;\n this.viewport = defaultViewport;\n this.pdfPageRotate = defaultViewport.rotation;\n this._optionalContentConfigPromise =\n options.optionalContentConfigPromise || null;\n this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE;\n this.#annotationMode =\n options.annotationMode ?? AnnotationMode.ENABLE_FORMS;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.isOffscreenCanvasSupported =\n options.isOffscreenCanvasSupported ?? true;\n this.maxCanvasPixels = options.maxCanvasPixels ?? MAX_CANVAS_PIXELS;\n this.pageColors = options.pageColors || null;\n\n this.eventBus = options.eventBus;\n this.renderingQueue = options.renderingQueue;\n this.l10n = options.l10n || NullL10n;\n\n this.renderTask = null;\n this.resume = null;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this._isStandalone = !this.renderingQueue?.hasViewer();\n this._container = container;\n\n if (options.useOnlyCssZoom) {\n console.error(\n \"useOnlyCssZoom was removed, please use `maxCanvasPixels = 0` instead.\"\n );\n this.maxCanvasPixels = 0;\n }\n }\n\n this._annotationCanvasMap = null;\n\n this.annotationLayer = null;\n this.annotationEditorLayer = null;\n this.textLayer = null;\n this.zoomLayer = null;\n this.xfaLayer = null;\n this.structTreeLayer = null;\n\n const div = document.createElement(\"div\");\n div.className = \"page\";\n div.setAttribute(\"data-page-number\", this.id);\n div.setAttribute(\"role\", \"region\");\n this.l10n.get(\"page_landmark\", { page: this.id }).then(msg => {\n div.setAttribute(\"aria-label\", msg);\n });\n this.div = div;\n\n this.#setDimensions();\n container?.append(div);\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._isStandalone\n ) {\n // Ensure that the various layers always get the correct initial size,\n // see issue 15795.\n container?.style.setProperty(\n \"--scale-factor\",\n this.scale * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n\n const { optionalContentConfigPromise } = options;\n if (optionalContentConfigPromise) {\n // Ensure that the thumbnails always display the *initial* document\n // state, for documents with optional content.\n optionalContentConfigPromise.then(optionalContentConfig => {\n if (\n optionalContentConfigPromise !== this._optionalContentConfigPromise\n ) {\n return;\n }\n this.#useThumbnailCanvas.initialOptionalContent =\n optionalContentConfig.hasInitialVisibility;\n });\n }\n }\n }\n\n get renderingState() {\n return this.#renderingState;\n }\n\n set renderingState(state) {\n if (state === this.#renderingState) {\n return;\n }\n this.#renderingState = state;\n\n if (this.#loadingId) {\n clearTimeout(this.#loadingId);\n this.#loadingId = null;\n }\n\n switch (state) {\n case RenderingStates.PAUSED:\n this.div.classList.remove(\"loading\");\n break;\n case RenderingStates.RUNNING:\n this.div.classList.add(\"loadingIcon\");\n this.#loadingId = setTimeout(() => {\n // Adding the loading class is slightly postponed in order to not have\n // it with loadingIcon.\n // If we don't do that the visibility of the background is changed but\n // the transition isn't triggered.\n this.div.classList.add(\"loading\");\n this.#loadingId = null;\n }, 0);\n break;\n case RenderingStates.INITIAL:\n case RenderingStates.FINISHED:\n this.div.classList.remove(\"loadingIcon\", \"loading\");\n break;\n }\n }\n\n #setDimensions() {\n const { viewport } = this;\n if (this.pdfPage) {\n if (this.#previousRotation === viewport.rotation) {\n return;\n }\n this.#previousRotation = viewport.rotation;\n }\n\n setLayerDimensions(\n this.div,\n viewport,\n /* mustFlip = */ true,\n /* mustRotate = */ false\n );\n }\n\n setPdfPage(pdfPage) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._isStandalone &&\n (this.pageColors?.foreground === \"CanvasText\" ||\n this.pageColors?.background === \"Canvas\")\n ) {\n this._container?.style.setProperty(\n \"--hcm-highligh-filter\",\n pdfPage.filterFactory.addHighlightHCMFilter(\n \"CanvasText\",\n \"Canvas\",\n \"HighlightText\",\n \"Highlight\"\n )\n );\n }\n this.pdfPage = pdfPage;\n this.pdfPageRotate = pdfPage.rotate;\n\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = pdfPage.getViewport({\n scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: totalRotation,\n });\n this.#setDimensions();\n this.reset();\n }\n\n destroy() {\n this.reset();\n this.pdfPage?.cleanup();\n }\n\n get _textHighlighter() {\n return shadow(\n this,\n \"_textHighlighter\",\n new TextHighlighter({\n pageIndex: this.id - 1,\n eventBus: this.eventBus,\n findController: this.#layerProperties().findController,\n })\n );\n }\n\n async #renderAnnotationLayer() {\n let error = null;\n try {\n await this.annotationLayer.render(this.viewport, \"display\");\n } catch (ex) {\n console.error(`#renderAnnotationLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"annotationlayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderAnnotationEditorLayer() {\n let error = null;\n try {\n await this.annotationEditorLayer.render(this.viewport, \"display\");\n } catch (ex) {\n console.error(`#renderAnnotationEditorLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"annotationeditorlayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderXfaLayer() {\n let error = null;\n try {\n const result = await this.xfaLayer.render(this.viewport, \"display\");\n if (result?.textDivs && this._textHighlighter) {\n this.#buildXfaTextContentItems(result.textDivs);\n }\n } catch (ex) {\n console.error(`#renderXfaLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"xfalayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderTextLayer() {\n const { pdfPage, textLayer, viewport } = this;\n if (!textLayer) {\n return;\n }\n\n let error = null;\n try {\n if (!textLayer.renderingDone) {\n const readableStream = pdfPage.streamTextContent({\n includeMarkedContent: true,\n disableNormalization: true,\n });\n textLayer.setTextContentSource(readableStream);\n }\n await textLayer.render(viewport);\n } catch (ex) {\n if (ex instanceof AbortException) {\n return;\n }\n console.error(`#renderTextLayer: \"${ex}\".`);\n error = ex;\n }\n\n this.eventBus.dispatch(\"textlayerrendered\", {\n source: this,\n pageNumber: this.id,\n numTextDivs: textLayer.numTextDivs,\n error,\n });\n\n this.#renderStructTreeLayer();\n }\n\n /**\n * The structure tree is currently only supported when the text layer is\n * enabled and a canvas is used for rendering.\n *\n * The structure tree must be generated after the text layer for the\n * aria-owns to work.\n */\n async #renderStructTreeLayer() {\n if (!this.textLayer) {\n return;\n }\n this.structTreeLayer ||= new StructTreeLayerBuilder();\n\n const tree = await (!this.structTreeLayer.renderingDone\n ? this.pdfPage.getStructTree()\n : null);\n const treeDom = this.structTreeLayer?.render(tree);\n if (treeDom) {\n this.canvas?.append(treeDom);\n }\n this.structTreeLayer?.show();\n }\n\n async #buildXfaTextContentItems(textDivs) {\n const text = await this.pdfPage.getTextContent();\n const items = [];\n for (const item of text.items) {\n items.push(item.str);\n }\n this._textHighlighter.setTextMapping(textDivs, items);\n this._textHighlighter.enable();\n }\n\n /**\n * @private\n */\n _resetZoomLayer(removeFromDOM = false) {\n if (!this.zoomLayer) {\n return;\n }\n const zoomLayerCanvas = this.zoomLayer.firstChild;\n this.#viewportMap.delete(zoomLayerCanvas);\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n zoomLayerCanvas.width = 0;\n zoomLayerCanvas.height = 0;\n\n if (removeFromDOM) {\n // Note: `ChildNode.remove` doesn't throw if the parent node is undefined.\n this.zoomLayer.remove();\n }\n this.zoomLayer = null;\n }\n\n reset({\n keepZoomLayer = false,\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false,\n keepTextLayer = false,\n } = {}) {\n this.cancelRendering({\n keepAnnotationLayer,\n keepAnnotationEditorLayer,\n keepXfaLayer,\n keepTextLayer,\n });\n this.renderingState = RenderingStates.INITIAL;\n\n const div = this.div;\n\n const childNodes = div.childNodes,\n zoomLayerNode = (keepZoomLayer && this.zoomLayer) || null,\n annotationLayerNode =\n (keepAnnotationLayer && this.annotationLayer?.div) || null,\n annotationEditorLayerNode =\n (keepAnnotationEditorLayer && this.annotationEditorLayer?.div) || null,\n xfaLayerNode = (keepXfaLayer && this.xfaLayer?.div) || null,\n textLayerNode = (keepTextLayer && this.textLayer?.div) || null;\n for (let i = childNodes.length - 1; i >= 0; i--) {\n const node = childNodes[i];\n switch (node) {\n case zoomLayerNode:\n case annotationLayerNode:\n case annotationEditorLayerNode:\n case xfaLayerNode:\n case textLayerNode:\n continue;\n }\n node.remove();\n }\n div.removeAttribute(\"data-loaded\");\n\n if (annotationLayerNode) {\n // Hide the annotation layer until all elements are resized\n // so they are not displayed on the already resized page.\n this.annotationLayer.hide();\n }\n if (annotationEditorLayerNode) {\n this.annotationEditorLayer.hide();\n }\n if (xfaLayerNode) {\n // Hide the XFA layer until all elements are resized\n // so they are not displayed on the already resized page.\n this.xfaLayer.hide();\n }\n if (textLayerNode) {\n this.textLayer.hide();\n }\n this.structTreeLayer?.hide();\n\n if (!zoomLayerNode) {\n if (this.canvas) {\n this.#viewportMap.delete(this.canvas);\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n this.canvas.width = 0;\n this.canvas.height = 0;\n delete this.canvas;\n }\n this._resetZoomLayer();\n }\n }\n\n /**\n * @typedef {Object} PDFPageViewUpdateParameters\n * @property {number} [scale] The new scale, if specified.\n * @property {number} [rotation] The new rotation, if specified.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise]\n * A promise that is resolved with an {@link OptionalContentConfig}\n * instance. The default value is `null`.\n * @property {number} [drawingDelay]\n */\n\n /**\n * Update e.g. the scale and/or rotation of the page.\n * @param {PDFPageViewUpdateParameters} params\n */\n update({\n scale = 0,\n rotation = null,\n optionalContentConfigPromise = null,\n drawingDelay = -1,\n }) {\n this.scale = scale || this.scale;\n if (typeof rotation === \"number\") {\n this.rotation = rotation; // The rotation may be zero.\n }\n if (optionalContentConfigPromise instanceof Promise) {\n this._optionalContentConfigPromise = optionalContentConfigPromise;\n\n // Ensure that the thumbnails always display the *initial* document state,\n // for documents with optional content.\n optionalContentConfigPromise.then(optionalContentConfig => {\n if (\n optionalContentConfigPromise !== this._optionalContentConfigPromise\n ) {\n return;\n }\n this.#useThumbnailCanvas.initialOptionalContent =\n optionalContentConfig.hasInitialVisibility;\n });\n }\n this.#useThumbnailCanvas.directDrawing = true;\n\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = this.viewport.clone({\n scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: totalRotation,\n });\n this.#setDimensions();\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._isStandalone\n ) {\n this._container?.style.setProperty(\"--scale-factor\", this.viewport.scale);\n }\n\n if (this.canvas) {\n let onlyCssZoom = false;\n if (this.#hasRestrictedScaling) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.maxCanvasPixels === 0\n ) {\n onlyCssZoom = true;\n } else if (this.maxCanvasPixels > 0) {\n const { width, height } = this.viewport;\n const { sx, sy } = this.outputScale;\n onlyCssZoom =\n ((Math.floor(width) * sx) | 0) * ((Math.floor(height) * sy) | 0) >\n this.maxCanvasPixels;\n }\n }\n const postponeDrawing =\n !onlyCssZoom && drawingDelay >= 0 && drawingDelay < 1000;\n\n if (postponeDrawing || onlyCssZoom) {\n if (\n postponeDrawing &&\n this.renderingState !== RenderingStates.FINISHED\n ) {\n this.cancelRendering({\n keepZoomLayer: true,\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true,\n keepTextLayer: true,\n cancelExtraDelay: drawingDelay,\n });\n // It isn't really finished, but once we have finished\n // to postpone, we'll call this.reset(...) which will set\n // the rendering state to INITIAL, hence the next call to\n // PDFViewer.update() will trigger a redraw (if it's mandatory).\n this.renderingState = RenderingStates.FINISHED;\n // Ensure that the thumbnails won't become partially (or fully) blank,\n // if the sidebar is opened before the actual rendering is done.\n this.#useThumbnailCanvas.directDrawing = false;\n }\n\n this.cssTransform({\n target: this.canvas,\n redrawAnnotationLayer: true,\n redrawAnnotationEditorLayer: true,\n redrawXfaLayer: true,\n redrawTextLayer: !postponeDrawing,\n hideTextLayer: postponeDrawing,\n });\n\n if (postponeDrawing) {\n // The \"pagerendered\"-event will be dispatched once the actual\n // rendering is done, hence don't dispatch it here as well.\n return;\n }\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: true,\n timestamp: performance.now(),\n error: this.#renderError,\n });\n return;\n }\n if (!this.zoomLayer && !this.canvas.hidden) {\n this.zoomLayer = this.canvas.parentNode;\n this.zoomLayer.style.position = \"absolute\";\n }\n }\n if (this.zoomLayer) {\n this.cssTransform({ target: this.zoomLayer.firstChild });\n }\n this.reset({\n keepZoomLayer: true,\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true,\n keepTextLayer: true,\n });\n }\n\n /**\n * PLEASE NOTE: Most likely you want to use the `this.reset()` method,\n * rather than calling this one directly.\n */\n cancelRendering({\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false,\n keepTextLayer = false,\n cancelExtraDelay = 0,\n } = {}) {\n if (this.renderTask) {\n this.renderTask.cancel(cancelExtraDelay);\n this.renderTask = null;\n }\n this.resume = null;\n\n if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) {\n this.textLayer.cancel();\n this.textLayer = null;\n }\n if (this.structTreeLayer && !this.textLayer) {\n this.structTreeLayer = null;\n }\n if (\n this.annotationLayer &&\n (!keepAnnotationLayer || !this.annotationLayer.div)\n ) {\n this.annotationLayer.cancel();\n this.annotationLayer = null;\n this._annotationCanvasMap = null;\n }\n if (\n this.annotationEditorLayer &&\n (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)\n ) {\n this.annotationEditorLayer.cancel();\n this.annotationEditorLayer = null;\n }\n if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {\n this.xfaLayer.cancel();\n this.xfaLayer = null;\n this._textHighlighter?.disable();\n }\n }\n\n cssTransform({\n target,\n redrawAnnotationLayer = false,\n redrawAnnotationEditorLayer = false,\n redrawXfaLayer = false,\n redrawTextLayer = false,\n hideTextLayer = false,\n }) {\n // Scale target (canvas), its wrapper and page container.\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n !(target instanceof HTMLCanvasElement)\n ) {\n throw new Error(\"Expected `target` to be a canvas.\");\n }\n if (!target.hasAttribute(\"zooming\")) {\n target.setAttribute(\"zooming\", true);\n const { style } = target;\n style.width = style.height = \"\";\n }\n\n const originalViewport = this.#viewportMap.get(target);\n if (this.viewport !== originalViewport) {\n // The canvas may have been originally rotated; rotate relative to that.\n const relativeRotation =\n this.viewport.rotation - originalViewport.rotation;\n const absRotation = Math.abs(relativeRotation);\n let scaleX = 1,\n scaleY = 1;\n if (absRotation === 90 || absRotation === 270) {\n const { width, height } = this.viewport;\n // Scale x and y because of the rotation.\n scaleX = height / width;\n scaleY = width / height;\n }\n target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;\n }\n\n if (redrawAnnotationLayer && this.annotationLayer) {\n this.#renderAnnotationLayer();\n }\n if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {\n this.#renderAnnotationEditorLayer();\n }\n if (redrawXfaLayer && this.xfaLayer) {\n this.#renderXfaLayer();\n }\n\n if (this.textLayer) {\n if (hideTextLayer) {\n this.textLayer.hide();\n this.structTreeLayer?.hide();\n } else if (redrawTextLayer) {\n this.#renderTextLayer();\n }\n }\n }\n\n get width() {\n return this.viewport.width;\n }\n\n get height() {\n return this.viewport.height;\n }\n\n getPagePoint(x, y) {\n return this.viewport.convertToPdfPoint(x, y);\n }\n\n async #finishRenderTask(renderTask, error = null) {\n // The renderTask may have been replaced by a new one, so only remove\n // the reference to the renderTask if it matches the one that is\n // triggering this callback.\n if (renderTask === this.renderTask) {\n this.renderTask = null;\n }\n\n if (error instanceof RenderingCancelledException) {\n this.#renderError = null;\n return;\n }\n this.#renderError = error;\n\n this.renderingState = RenderingStates.FINISHED;\n this._resetZoomLayer(/* removeFromDOM = */ true);\n\n // Ensure that the thumbnails won't become partially (or fully) blank,\n // for documents that contain interactive form elements.\n this.#useThumbnailCanvas.regularAnnotations = !renderTask.separateAnnots;\n\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: false,\n timestamp: performance.now(),\n error: this.#renderError,\n });\n\n if (error) {\n throw error;\n }\n }\n\n async draw() {\n if (this.renderingState !== RenderingStates.INITIAL) {\n console.error(\"Must be in new state before drawing\");\n this.reset(); // Ensure that we reset all state to prevent issues.\n }\n const { div, l10n, pageColors, pdfPage, viewport } = this;\n\n if (!pdfPage) {\n this.renderingState = RenderingStates.FINISHED;\n throw new Error(\"pdfPage is not loaded\");\n }\n\n this.renderingState = RenderingStates.RUNNING;\n\n // Wrap the canvas so that if it has a CSS transform for high DPI the\n // overflow will be hidden in Firefox.\n const canvasWrapper = document.createElement(\"div\");\n canvasWrapper.classList.add(\"canvasWrapper\");\n div.append(canvasWrapper);\n\n if (\n !this.textLayer &&\n this.#textLayerMode !== TextLayerMode.DISABLE &&\n !pdfPage.isPureXfa\n ) {\n this._accessibilityManager ||= new TextAccessibilityManager();\n\n this.textLayer = new TextLayerBuilder({\n highlighter: this._textHighlighter,\n accessibilityManager: this._accessibilityManager,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n enablePermissions:\n this.#textLayerMode === TextLayerMode.ENABLE_PERMISSIONS,\n });\n div.append(this.textLayer.div);\n }\n\n if (\n !this.annotationLayer &&\n this.#annotationMode !== AnnotationMode.DISABLE\n ) {\n const {\n annotationStorage,\n downloadManager,\n enableScripting,\n fieldObjectsPromise,\n hasJSActionsPromise,\n linkService,\n } = this.#layerProperties();\n\n this._annotationCanvasMap ||= new Map();\n this.annotationLayer = new AnnotationLayerBuilder({\n pageDiv: div,\n pdfPage,\n annotationStorage,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.#annotationMode === AnnotationMode.ENABLE_FORMS,\n linkService,\n downloadManager,\n l10n,\n enableScripting,\n hasJSActionsPromise,\n fieldObjectsPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n accessibilityManager: this._accessibilityManager,\n });\n }\n\n const renderContinueCallback = cont => {\n showCanvas?.(false);\n if (this.renderingQueue && !this.renderingQueue.isHighestPriority(this)) {\n this.renderingState = RenderingStates.PAUSED;\n this.resume = () => {\n this.renderingState = RenderingStates.RUNNING;\n cont();\n };\n return;\n }\n cont();\n };\n\n const { width, height } = viewport;\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\"role\", \"presentation\");\n\n // Keep the canvas hidden until the first draw callback, or until drawing\n // is complete when `!this.renderingQueue`, to prevent black flickering.\n canvas.hidden = true;\n const hasHCM = !!(pageColors?.background && pageColors?.foreground);\n\n let showCanvas = isLastShow => {\n // In HCM, a final filter is applied on the canvas which means that\n // before it's applied we've normal colors. Consequently, to avoid to have\n // a final flash we just display it once all the drawing is done.\n if (!hasHCM || isLastShow) {\n canvas.hidden = false;\n showCanvas = null; // Only invoke the function once.\n }\n };\n canvasWrapper.append(canvas);\n this.canvas = canvas;\n\n const ctx = canvas.getContext(\"2d\", { alpha: false });\n const outputScale = (this.outputScale = new OutputScale());\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.maxCanvasPixels === 0\n ) {\n const invScale = 1 / this.scale;\n // Use a scale that makes the canvas have the originally intended size\n // of the page.\n outputScale.sx *= invScale;\n outputScale.sy *= invScale;\n this.#hasRestrictedScaling = true;\n } else if (this.maxCanvasPixels > 0) {\n const pixelsInViewport = width * height;\n const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);\n if (outputScale.sx > maxScale || outputScale.sy > maxScale) {\n outputScale.sx = maxScale;\n outputScale.sy = maxScale;\n this.#hasRestrictedScaling = true;\n } else {\n this.#hasRestrictedScaling = false;\n }\n }\n const sfx = approximateFraction(outputScale.sx);\n const sfy = approximateFraction(outputScale.sy);\n\n canvas.width = roundToDivide(width * outputScale.sx, sfx[0]);\n canvas.height = roundToDivide(height * outputScale.sy, sfy[0]);\n const { style } = canvas;\n style.width = roundToDivide(width, sfx[1]) + \"px\";\n style.height = roundToDivide(height, sfy[1]) + \"px\";\n\n // Add the viewport so it's known what it was originally drawn with.\n this.#viewportMap.set(canvas, viewport);\n\n // Rendering area\n const transform = outputScale.scaled\n ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0]\n : null;\n const renderContext = {\n canvasContext: ctx,\n transform,\n viewport,\n annotationMode: this.#annotationMode,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n pageColors,\n };\n const renderTask = (this.renderTask = this.pdfPage.render(renderContext));\n renderTask.onContinue = renderContinueCallback;\n\n const resultPromise = renderTask.promise.then(\n async () => {\n showCanvas?.(true);\n await this.#finishRenderTask(renderTask);\n\n this.#renderTextLayer();\n\n if (this.annotationLayer) {\n await this.#renderAnnotationLayer();\n }\n\n if (!this.annotationEditorLayer) {\n const { annotationEditorUIManager } = this.#layerProperties();\n\n if (!annotationEditorUIManager) {\n return;\n }\n this.annotationEditorLayer = new AnnotationEditorLayerBuilder({\n uiManager: annotationEditorUIManager,\n pageDiv: div,\n pdfPage,\n l10n,\n accessibilityManager: this._accessibilityManager,\n annotationLayer: this.annotationLayer?.annotationLayer,\n });\n }\n this.#renderAnnotationEditorLayer();\n },\n error => {\n // When zooming with a `drawingDelay` set, avoid temporarily showing\n // a black canvas if rendering was cancelled before the `onContinue`-\n // callback had been invoked at least once.\n if (!(error instanceof RenderingCancelledException)) {\n showCanvas?.(true);\n }\n return this.#finishRenderTask(renderTask, error);\n }\n );\n\n if (pdfPage.isPureXfa) {\n if (!this.xfaLayer) {\n const { annotationStorage, linkService } = this.#layerProperties();\n\n this.xfaLayer = new XfaLayerBuilder({\n pageDiv: div,\n pdfPage,\n annotationStorage,\n linkService,\n });\n } else if (this.xfaLayer.div) {\n // The xfa layer needs to stay on top.\n div.append(this.xfaLayer.div);\n }\n this.#renderXfaLayer();\n }\n\n div.setAttribute(\"data-loaded\", true);\n\n this.eventBus.dispatch(\"pagerender\", {\n source: this,\n pageNumber: this.id,\n });\n return resultPromise;\n }\n\n /**\n * @param {string|null} label\n */\n setPageLabel(label) {\n this.pageLabel = typeof label === \"string\" ? label : null;\n\n if (this.pageLabel !== null) {\n this.div.setAttribute(\"data-page-label\", this.pageLabel);\n } else {\n this.div.removeAttribute(\"data-page-label\");\n }\n }\n\n /**\n * For use by the `PDFThumbnailView.setImage`-method.\n * @ignore\n */\n get thumbnailCanvas() {\n const { directDrawing, initialOptionalContent, regularAnnotations } =\n this.#useThumbnailCanvas;\n return directDrawing && initialOptionalContent && regularAnnotations\n ? this.canvas\n : null;\n }\n}\n\nexport { PDFPageView };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/editor/tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/annotation_layer.js\").AnnotationLayer} AnnotationLayer */\n\nimport { AnnotationEditorLayer } from \"pdfjs-lib\";\nimport { NullL10n } from \"./l10n_utils.js\";\n\n/**\n * @typedef {Object} AnnotationEditorLayerBuilderOptions\n * @property {AnnotationEditorUIManager} [uiManager]\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\n * @property {IL10n} [l10n]\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {AnnotationLayer} [annotationLayer]\n */\n\nclass AnnotationEditorLayerBuilder {\n #annotationLayer = null;\n\n #uiManager;\n\n /**\n * @param {AnnotationEditorLayerBuilderOptions} options\n */\n constructor(options) {\n this.pageDiv = options.pageDiv;\n this.pdfPage = options.pdfPage;\n this.accessibilityManager = options.accessibilityManager;\n this.l10n = options.l10n || NullL10n;\n this.annotationEditorLayer = null;\n this.div = null;\n this._cancelled = false;\n this.#uiManager = options.uiManager;\n this.#annotationLayer = options.annotationLayer || null;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n */\n async render(viewport, intent = \"display\") {\n if (intent !== \"display\") {\n return;\n }\n\n if (this._cancelled) {\n return;\n }\n\n const clonedViewport = viewport.clone({ dontFlip: true });\n if (this.div) {\n this.annotationEditorLayer.update({ viewport: clonedViewport });\n this.show();\n return;\n }\n\n // Create an AnnotationEditor layer div\n const div = (this.div = document.createElement(\"div\"));\n div.className = \"annotationEditorLayer\";\n div.tabIndex = 0;\n div.hidden = true;\n div.dir = this.#uiManager.direction;\n this.pageDiv.append(div);\n\n this.annotationEditorLayer = new AnnotationEditorLayer({\n uiManager: this.#uiManager,\n div,\n accessibilityManager: this.accessibilityManager,\n pageIndex: this.pdfPage.pageNumber - 1,\n l10n: this.l10n,\n viewport: clonedViewport,\n annotationLayer: this.#annotationLayer,\n });\n\n const parameters = {\n viewport: clonedViewport,\n div,\n annotations: null,\n intent,\n };\n\n this.annotationEditorLayer.render(parameters);\n this.show();\n }\n\n cancel() {\n this._cancelled = true;\n\n if (!this.div) {\n return;\n }\n this.pageDiv = null;\n this.annotationEditorLayer.destroy();\n this.div.remove();\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n\n show() {\n if (!this.div || this.annotationEditorLayer.isEmpty) {\n return;\n }\n this.div.hidden = false;\n }\n}\n\nexport { AnnotationEditorLayerBuilder };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/annotation_storage\").AnnotationStorage} AnnotationStorage */\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n\nimport { AnnotationLayer } from \"pdfjs-lib\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { PresentationModeState } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} AnnotationLayerBuilderOptions\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\n * @property {AnnotationStorage} [annotationStorage]\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} renderForms\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\n * @property {IL10n} l10n - Localization service.\n * @property {boolean} [enableScripting]\n * @property {Promise<boolean>} [hasJSActionsPromise]\n * @property {Promise<Object<string, Array<Object>> | null>}\n * [fieldObjectsPromise]\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]\n * @property {TextAccessibilityManager} [accessibilityManager]\n */\n\nclass AnnotationLayerBuilder {\n #onPresentationModeChanged = null;\n\n /**\n * @param {AnnotationLayerBuilderOptions} options\n */\n constructor({\n pageDiv,\n pdfPage,\n linkService,\n downloadManager,\n annotationStorage = null,\n imageResourcesPath = \"\",\n renderForms = true,\n l10n = NullL10n,\n enableScripting = false,\n hasJSActionsPromise = null,\n fieldObjectsPromise = null,\n annotationCanvasMap = null,\n accessibilityManager = null,\n }) {\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.linkService = linkService;\n this.downloadManager = downloadManager;\n this.imageResourcesPath = imageResourcesPath;\n this.renderForms = renderForms;\n this.l10n = l10n;\n this.annotationStorage = annotationStorage;\n this.enableScripting = enableScripting;\n this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false);\n this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);\n this._annotationCanvasMap = annotationCanvasMap;\n this._accessibilityManager = accessibilityManager;\n\n this.annotationLayer = null;\n this.div = null;\n this._cancelled = false;\n this._eventBus = linkService.eventBus;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n * @returns {Promise<void>} A promise that is resolved when rendering of the\n * annotations is complete.\n */\n async render(viewport, intent = \"display\") {\n if (this.div) {\n if (this._cancelled || !this.annotationLayer) {\n return;\n }\n // If an annotationLayer already exists, refresh its children's\n // transformation matrices.\n this.annotationLayer.update({\n viewport: viewport.clone({ dontFlip: true }),\n });\n return;\n }\n\n const [annotations, hasJSActions, fieldObjects] = await Promise.all([\n this.pdfPage.getAnnotations({ intent }),\n this._hasJSActionsPromise,\n this._fieldObjectsPromise,\n ]);\n if (this._cancelled) {\n return;\n }\n\n // Create an annotation layer div and render the annotations\n // if there is at least one annotation.\n const div = (this.div = document.createElement(\"div\"));\n div.className = \"annotationLayer\";\n this.pageDiv.append(div);\n\n if (annotations.length === 0) {\n this.hide();\n return;\n }\n\n this.annotationLayer = new AnnotationLayer({\n div,\n accessibilityManager: this._accessibilityManager,\n annotationCanvasMap: this._annotationCanvasMap,\n l10n: this.l10n,\n page: this.pdfPage,\n viewport: viewport.clone({ dontFlip: true }),\n });\n\n await this.annotationLayer.render({\n annotations,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.renderForms,\n linkService: this.linkService,\n downloadManager: this.downloadManager,\n annotationStorage: this.annotationStorage,\n enableScripting: this.enableScripting,\n hasJSActions,\n fieldObjects,\n });\n\n // Ensure that interactive form elements in the annotationLayer are\n // disabled while PresentationMode is active (see issue 12232).\n if (this.linkService.isInPresentationMode) {\n this.#updatePresentationModeState(PresentationModeState.FULLSCREEN);\n }\n if (!this.#onPresentationModeChanged) {\n this.#onPresentationModeChanged = evt => {\n this.#updatePresentationModeState(evt.state);\n };\n this._eventBus?._on(\n \"presentationmodechanged\",\n this.#onPresentationModeChanged\n );\n }\n }\n\n cancel() {\n this._cancelled = true;\n\n if (this.#onPresentationModeChanged) {\n this._eventBus?._off(\n \"presentationmodechanged\",\n this.#onPresentationModeChanged\n );\n this.#onPresentationModeChanged = null;\n }\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n\n #updatePresentationModeState(state) {\n if (!this.div) {\n return;\n }\n let disableFormElements = false;\n\n switch (state) {\n case PresentationModeState.FULLSCREEN:\n disableFormElements = true;\n break;\n case PresentationModeState.NORMAL:\n break;\n default:\n return;\n }\n for (const section of this.div.childNodes) {\n if (section.hasAttribute(\"data-internal-link\")) {\n continue;\n }\n section.inert = disableFormElements;\n }\n }\n}\n\nexport { AnnotationLayerBuilder };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { removeNullCharacters } from \"./ui_utils.js\";\n\nconst PDF_ROLE_TO_HTML_ROLE = {\n // Document level structure types\n Document: null, // There's a \"document\" role, but it doesn't make sense here.\n DocumentFragment: null,\n // Grouping level structure types\n Part: \"group\",\n Sect: \"group\", // XXX: There's a \"section\" role, but it's abstract.\n Div: \"group\",\n Aside: \"note\",\n NonStruct: \"none\",\n // Block level structure types\n P: null,\n // H<n>,\n H: \"heading\",\n Title: null,\n FENote: \"note\",\n // Sub-block level structure type\n Sub: \"group\",\n // General inline level structure types\n Lbl: null,\n Span: null,\n Em: null,\n Strong: null,\n Link: \"link\",\n Annot: \"note\",\n Form: \"form\",\n // Ruby and Warichu structure types\n Ruby: null,\n RB: null,\n RT: null,\n RP: null,\n Warichu: null,\n WT: null,\n WP: null,\n // List standard structure types\n L: \"list\",\n LI: \"listitem\",\n LBody: null,\n // Table standard structure types\n Table: \"table\",\n TR: \"row\",\n TH: \"columnheader\",\n TD: \"cell\",\n THead: \"columnheader\",\n TBody: null,\n TFoot: null,\n // Standard structure type Caption\n Caption: null,\n // Standard structure type Figure\n Figure: \"figure\",\n // Standard structure type Formula\n Formula: null,\n // standard structure type Artifact\n Artifact: null,\n};\n\nconst HEADING_PATTERN = /^H(\\d+)$/;\n\nclass StructTreeLayerBuilder {\n #treeDom = undefined;\n\n get renderingDone() {\n return this.#treeDom !== undefined;\n }\n\n render(structTree) {\n if (this.#treeDom !== undefined) {\n return this.#treeDom;\n }\n const treeDom = this.#walk(structTree);\n treeDom?.classList.add(\"structTree\");\n return (this.#treeDom = treeDom);\n }\n\n hide() {\n if (this.#treeDom && !this.#treeDom.hidden) {\n this.#treeDom.hidden = true;\n }\n }\n\n show() {\n if (this.#treeDom?.hidden) {\n this.#treeDom.hidden = false;\n }\n }\n\n #setAttributes(structElement, htmlElement) {\n const { alt, id, lang } = structElement;\n if (alt !== undefined) {\n htmlElement.setAttribute(\"aria-label\", removeNullCharacters(alt));\n }\n if (id !== undefined) {\n htmlElement.setAttribute(\"aria-owns\", id);\n }\n if (lang !== undefined) {\n htmlElement.setAttribute(\n \"lang\",\n removeNullCharacters(lang, /* replaceInvisible = */ true)\n );\n }\n }\n\n #walk(node) {\n if (!node) {\n return null;\n }\n\n const element = document.createElement(\"span\");\n if (\"role\" in node) {\n const { role } = node;\n const match = role.match(HEADING_PATTERN);\n if (match) {\n element.setAttribute(\"role\", \"heading\");\n element.setAttribute(\"aria-level\", match[1]);\n } else if (PDF_ROLE_TO_HTML_ROLE[role]) {\n element.setAttribute(\"role\", PDF_ROLE_TO_HTML_ROLE[role]);\n }\n }\n\n this.#setAttributes(node, element);\n\n if (node.children) {\n if (node.children.length === 1 && \"id\" in node.children[0]) {\n // Often there is only one content node so just set the values on the\n // parent node to avoid creating an extra span.\n this.#setAttributes(node.children[0], element);\n } else {\n for (const kid of node.children) {\n element.append(this.#walk(kid));\n }\n }\n }\n return element;\n }\n}\n\nexport { StructTreeLayerBuilder };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { binarySearchFirstItem } from \"./ui_utils.js\";\n\n/**\n * This class aims to provide some methods:\n * - to reorder elements in the DOM with respect to the visual order;\n * - to create a link, using aria-owns, between spans in the textLayer and\n * annotations in the annotationLayer. The goal is to help to know\n * where the annotations are in the text flow.\n */\nclass TextAccessibilityManager {\n #enabled = false;\n\n #textChildren = null;\n\n #textNodes = new Map();\n\n #waitingElements = new Map();\n\n setTextMapping(textDivs) {\n this.#textChildren = textDivs;\n }\n\n /**\n * Compare the positions of two elements, it must correspond to\n * the visual ordering.\n *\n * @param {HTMLElement} e1\n * @param {HTMLElement} e2\n * @returns {number}\n */\n static #compareElementPositions(e1, e2) {\n const rect1 = e1.getBoundingClientRect();\n const rect2 = e2.getBoundingClientRect();\n\n if (rect1.width === 0 && rect1.height === 0) {\n return +1;\n }\n\n if (rect2.width === 0 && rect2.height === 0) {\n return -1;\n }\n\n const top1 = rect1.y;\n const bot1 = rect1.y + rect1.height;\n const mid1 = rect1.y + rect1.height / 2;\n\n const top2 = rect2.y;\n const bot2 = rect2.y + rect2.height;\n const mid2 = rect2.y + rect2.height / 2;\n\n if (mid1 <= top2 && mid2 >= bot1) {\n return -1;\n }\n\n if (mid2 <= top1 && mid1 >= bot2) {\n return +1;\n }\n\n const centerX1 = rect1.x + rect1.width / 2;\n const centerX2 = rect2.x + rect2.width / 2;\n\n return centerX1 - centerX2;\n }\n\n /**\n * Function called when the text layer has finished rendering.\n */\n enable() {\n if (this.#enabled) {\n throw new Error(\"TextAccessibilityManager is already enabled.\");\n }\n if (!this.#textChildren) {\n throw new Error(\"Text divs and strings have not been set.\");\n }\n\n this.#enabled = true;\n this.#textChildren = this.#textChildren.slice();\n this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions);\n\n if (this.#textNodes.size > 0) {\n // Some links have been made before this manager has been disabled, hence\n // we restore them.\n const textChildren = this.#textChildren;\n for (const [id, nodeIndex] of this.#textNodes) {\n const element = document.getElementById(id);\n if (!element) {\n // If the page was *fully* reset the element no longer exists, and it\n // will be re-inserted later (i.e. when the annotationLayer renders).\n this.#textNodes.delete(id);\n continue;\n }\n this.#addIdToAriaOwns(id, textChildren[nodeIndex]);\n }\n }\n\n for (const [element, isRemovable] of this.#waitingElements) {\n this.addPointerInTextLayer(element, isRemovable);\n }\n this.#waitingElements.clear();\n }\n\n disable() {\n if (!this.#enabled) {\n return;\n }\n\n // Don't clear this.#textNodes which is used to rebuild the aria-owns\n // in case it's re-enabled at some point.\n\n this.#waitingElements.clear();\n this.#textChildren = null;\n this.#enabled = false;\n }\n\n /**\n * Remove an aria-owns id from a node in the text layer.\n * @param {HTMLElement} element\n */\n removePointerInTextLayer(element) {\n if (!this.#enabled) {\n this.#waitingElements.delete(element);\n return;\n }\n\n const children = this.#textChildren;\n if (!children || children.length === 0) {\n return;\n }\n\n const { id } = element;\n const nodeIndex = this.#textNodes.get(id);\n if (nodeIndex === undefined) {\n return;\n }\n\n const node = children[nodeIndex];\n\n this.#textNodes.delete(id);\n let owns = node.getAttribute(\"aria-owns\");\n if (owns?.includes(id)) {\n owns = owns\n .split(\" \")\n .filter(x => x !== id)\n .join(\" \");\n if (owns) {\n node.setAttribute(\"aria-owns\", owns);\n } else {\n node.removeAttribute(\"aria-owns\");\n node.setAttribute(\"role\", \"presentation\");\n }\n }\n }\n\n #addIdToAriaOwns(id, node) {\n const owns = node.getAttribute(\"aria-owns\");\n if (!owns?.includes(id)) {\n node.setAttribute(\"aria-owns\", owns ? `${owns} ${id}` : id);\n }\n node.removeAttribute(\"role\");\n }\n\n /**\n * Find the text node which is the nearest and add an aria-owns attribute\n * in order to correctly position this editor in the text flow.\n * @param {HTMLElement} element\n * @param {boolean} isRemovable\n * @returns {string|null} The id in the struct tree if any.\n */\n addPointerInTextLayer(element, isRemovable) {\n const { id } = element;\n if (!id) {\n return null;\n }\n\n if (!this.#enabled) {\n // The text layer needs to be there, so we postpone the association.\n this.#waitingElements.set(element, isRemovable);\n return null;\n }\n\n if (isRemovable) {\n this.removePointerInTextLayer(element);\n }\n\n const children = this.#textChildren;\n if (!children || children.length === 0) {\n return null;\n }\n\n const index = binarySearchFirstItem(\n children,\n node =>\n TextAccessibilityManager.#compareElementPositions(element, node) < 0\n );\n\n const nodeIndex = Math.max(0, index - 1);\n const child = children[nodeIndex];\n this.#addIdToAriaOwns(id, child);\n this.#textNodes.set(id, nodeIndex);\n\n const parent = child.parentNode;\n return parent?.classList.contains(\"markedContent\") ? parent.id : null;\n }\n\n /**\n * Move a div in the DOM in order to respect the visual order.\n * @param {HTMLDivElement} element\n * @returns {string|null} The id in the struct tree if any.\n */\n moveElementInDOM(container, element, contentElement, isRemovable) {\n const id = this.addPointerInTextLayer(contentElement, isRemovable);\n\n if (!container.hasChildNodes()) {\n container.append(element);\n return id;\n }\n\n const children = Array.from(container.childNodes).filter(\n node => node !== element\n );\n\n if (children.length === 0) {\n return id;\n }\n\n const elementToCompare = contentElement || element;\n const index = binarySearchFirstItem(\n children,\n node =>\n TextAccessibilityManager.#compareElementPositions(\n elementToCompare,\n node\n ) < 0\n );\n\n if (index === 0) {\n children[0].before(element);\n } else {\n children[index - 1].after(element);\n }\n\n return id;\n }\n}\n\nexport { TextAccessibilityManager };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_find_controller\").PDFFindController} PDFFindController */\n\n/**\n * @typedef {Object} TextHighlighterOptions\n * @property {PDFFindController} findController\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} pageIndex - The page index.\n */\n\n/**\n * TextHighlighter handles highlighting matches from the FindController in\n * either the text layer or XFA layer depending on the type of document.\n */\nclass TextHighlighter {\n /**\n * @param {TextHighlighterOptions} options\n */\n constructor({ findController, eventBus, pageIndex }) {\n this.findController = findController;\n this.matches = [];\n this.eventBus = eventBus;\n this.pageIdx = pageIndex;\n this._onUpdateTextLayerMatches = null;\n this.textDivs = null;\n this.textContentItemsStr = null;\n this.enabled = false;\n }\n\n /**\n * Store two arrays that will map DOM nodes to text they should contain.\n * The arrays should be of equal length and the array element at each index\n * should correspond to the other. e.g.\n * `items[0] = \"<span>Item 0</span>\" and texts[0] = \"Item 0\";\n *\n * @param {Array<Node>} divs\n * @param {Array<string>} texts\n */\n setTextMapping(divs, texts) {\n this.textDivs = divs;\n this.textContentItemsStr = texts;\n }\n\n /**\n * Start listening for events to update the highlighter and check if there are\n * any current matches that need be highlighted.\n */\n enable() {\n if (!this.textDivs || !this.textContentItemsStr) {\n throw new Error(\"Text divs and strings have not been set.\");\n }\n if (this.enabled) {\n throw new Error(\"TextHighlighter is already enabled.\");\n }\n this.enabled = true;\n if (!this._onUpdateTextLayerMatches) {\n this._onUpdateTextLayerMatches = evt => {\n if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {\n this._updateMatches();\n }\n };\n this.eventBus._on(\n \"updatetextlayermatches\",\n this._onUpdateTextLayerMatches\n );\n }\n this._updateMatches();\n }\n\n disable() {\n if (!this.enabled) {\n return;\n }\n this.enabled = false;\n if (this._onUpdateTextLayerMatches) {\n this.eventBus._off(\n \"updatetextlayermatches\",\n this._onUpdateTextLayerMatches\n );\n this._onUpdateTextLayerMatches = null;\n }\n this._updateMatches(/* reset = */ true);\n }\n\n _convertMatches(matches, matchesLength) {\n // Early exit if there is nothing to convert.\n if (!matches) {\n return [];\n }\n const { textContentItemsStr } = this;\n\n let i = 0,\n iIndex = 0;\n const end = textContentItemsStr.length - 1;\n const result = [];\n\n for (let m = 0, mm = matches.length; m < mm; m++) {\n // Calculate the start position.\n let matchIdx = matches[m];\n\n // Loop over the divIdxs.\n while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n if (i === textContentItemsStr.length) {\n console.error(\"Could not find a matching mapping\");\n }\n\n const match = {\n begin: {\n divIdx: i,\n offset: matchIdx - iIndex,\n },\n };\n\n // Calculate the end position.\n matchIdx += matchesLength[m];\n\n // Somewhat the same array as above, but use > instead of >= to get\n // the end position right.\n while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n match.end = {\n divIdx: i,\n offset: matchIdx - iIndex,\n };\n result.push(match);\n }\n return result;\n }\n\n _renderMatches(matches) {\n // Early exit if there is nothing to render.\n if (matches.length === 0) {\n return;\n }\n const { findController, pageIdx } = this;\n const { textContentItemsStr, textDivs } = this;\n\n const isSelectedPage = pageIdx === findController.selected.pageIdx;\n const selectedMatchIdx = findController.selected.matchIdx;\n const highlightAll = findController.state.highlightAll;\n let prevEnd = null;\n const infinity = {\n divIdx: -1,\n offset: undefined,\n };\n\n function beginText(begin, className) {\n const divIdx = begin.divIdx;\n textDivs[divIdx].textContent = \"\";\n return appendTextToDiv(divIdx, 0, begin.offset, className);\n }\n\n function appendTextToDiv(divIdx, fromOffset, toOffset, className) {\n let div = textDivs[divIdx];\n if (div.nodeType === Node.TEXT_NODE) {\n const span = document.createElement(\"span\");\n div.before(span);\n span.append(div);\n textDivs[divIdx] = span;\n div = span;\n }\n const content = textContentItemsStr[divIdx].substring(\n fromOffset,\n toOffset\n );\n const node = document.createTextNode(content);\n if (className) {\n const span = document.createElement(\"span\");\n span.className = `${className} appended`;\n span.append(node);\n div.append(span);\n return className.includes(\"selected\") ? span.offsetLeft : 0;\n }\n div.append(node);\n return 0;\n }\n\n let i0 = selectedMatchIdx,\n i1 = i0 + 1;\n if (highlightAll) {\n i0 = 0;\n i1 = matches.length;\n } else if (!isSelectedPage) {\n // Not highlighting all and this isn't the selected page, so do nothing.\n return;\n }\n\n let lastDivIdx = -1;\n let lastOffset = -1;\n for (let i = i0; i < i1; i++) {\n const match = matches[i];\n const begin = match.begin;\n if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) {\n // It's possible to be in this situation if we searched for a 'f' and we\n // have a ligature 'ff' in the text. The 'ff' has to be highlighted two\n // times.\n continue;\n }\n lastDivIdx = begin.divIdx;\n lastOffset = begin.offset;\n\n const end = match.end;\n const isSelected = isSelectedPage && i === selectedMatchIdx;\n const highlightSuffix = isSelected ? \" selected\" : \"\";\n let selectedLeft = 0;\n\n // Match inside new div.\n if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {\n // If there was a previous div, then add the text at the end.\n if (prevEnd !== null) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n // Clear the divs and set the content until the starting point.\n beginText(begin);\n } else {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);\n }\n\n if (begin.divIdx === end.divIdx) {\n selectedLeft = appendTextToDiv(\n begin.divIdx,\n begin.offset,\n end.offset,\n \"highlight\" + highlightSuffix\n );\n } else {\n selectedLeft = appendTextToDiv(\n begin.divIdx,\n begin.offset,\n infinity.offset,\n \"highlight begin\" + highlightSuffix\n );\n for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {\n textDivs[n0].className = \"highlight middle\" + highlightSuffix;\n }\n beginText(end, \"highlight end\" + highlightSuffix);\n }\n prevEnd = end;\n\n if (isSelected) {\n // Attempt to scroll the selected match into view.\n findController.scrollMatchIntoView({\n element: textDivs[begin.divIdx],\n selectedLeft,\n pageIndex: pageIdx,\n matchIndex: selectedMatchIdx,\n });\n }\n }\n\n if (prevEnd) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n }\n\n _updateMatches(reset = false) {\n if (!this.enabled && !reset) {\n return;\n }\n const { findController, matches, pageIdx } = this;\n const { textContentItemsStr, textDivs } = this;\n let clearedUntilDivIdx = -1;\n\n // Clear all current matches.\n for (const match of matches) {\n const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);\n for (let n = begin, end = match.end.divIdx; n <= end; n++) {\n const div = textDivs[n];\n div.textContent = textContentItemsStr[n];\n div.className = \"\";\n }\n clearedUntilDivIdx = match.end.divIdx + 1;\n }\n\n if (!findController?.highlightMatches || reset) {\n return;\n }\n // Convert the matches on the `findController` into the match format\n // used for the textLayer.\n const pageMatches = findController.pageMatches[pageIdx] || null;\n const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;\n\n this.matches = this._convertMatches(pageMatches, pageMatchesLength);\n this._renderMatches(this.matches);\n }\n}\n\nexport { TextHighlighter };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"../src/display/api\").TextContent} TextContent */\n/** @typedef {import(\"./text_highlighter\").TextHighlighter} TextHighlighter */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n\nimport { normalizeUnicode, renderTextLayer, updateTextLayer } from \"pdfjs-lib\";\nimport { removeNullCharacters } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} TextLayerBuilderOptions\n * @property {TextHighlighter} highlighter - Optional object that will handle\n * highlighting text from the find controller.\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n */\n\n/**\n * The text layer builder provides text selection functionality for the PDF.\n * It does this by creating overlay divs over the PDF's text. These divs\n * contain text that matches the PDF text they are overlaying.\n */\nclass TextLayerBuilder {\n #enablePermissions = false;\n\n #rotation = 0;\n\n #scale = 0;\n\n #textContentSource = null;\n\n constructor({\n highlighter = null,\n accessibilityManager = null,\n isOffscreenCanvasSupported = true,\n enablePermissions = false,\n }) {\n this.textContentItemsStr = [];\n this.renderingDone = false;\n this.textDivs = [];\n this.textDivProperties = new WeakMap();\n this.textLayerRenderTask = null;\n this.highlighter = highlighter;\n this.accessibilityManager = accessibilityManager;\n this.isOffscreenCanvasSupported = isOffscreenCanvasSupported;\n this.#enablePermissions = enablePermissions === true;\n\n this.div = document.createElement(\"div\");\n this.div.className = \"textLayer\";\n this.hide();\n }\n\n #finishRendering() {\n this.renderingDone = true;\n\n const endOfContent = document.createElement(\"div\");\n endOfContent.className = \"endOfContent\";\n this.div.append(endOfContent);\n\n this.#bindMouse();\n }\n\n get numTextDivs() {\n return this.textDivs.length;\n }\n\n /**\n * Renders the text layer.\n * @param {PageViewport} viewport\n */\n async render(viewport) {\n if (!this.#textContentSource) {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n\n const scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n const { rotation } = viewport;\n if (this.renderingDone) {\n const mustRotate = rotation !== this.#rotation;\n const mustRescale = scale !== this.#scale;\n if (mustRotate || mustRescale) {\n this.hide();\n updateTextLayer({\n container: this.div,\n viewport,\n textDivs: this.textDivs,\n textDivProperties: this.textDivProperties,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n mustRescale,\n mustRotate,\n });\n this.#scale = scale;\n this.#rotation = rotation;\n }\n this.show();\n return;\n }\n\n this.cancel();\n this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr);\n this.accessibilityManager?.setTextMapping(this.textDivs);\n\n this.textLayerRenderTask = renderTextLayer({\n textContentSource: this.#textContentSource,\n container: this.div,\n viewport,\n textDivs: this.textDivs,\n textDivProperties: this.textDivProperties,\n textContentItemsStr: this.textContentItemsStr,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n });\n\n await this.textLayerRenderTask.promise;\n this.#finishRendering();\n this.#scale = scale;\n this.#rotation = rotation;\n this.show();\n this.accessibilityManager?.enable();\n }\n\n hide() {\n if (!this.div.hidden) {\n // We turn off the highlighter in order to avoid to scroll into view an\n // element of the text layer which could be hidden.\n this.highlighter?.disable();\n this.div.hidden = true;\n }\n }\n\n show() {\n if (this.div.hidden && this.renderingDone) {\n this.div.hidden = false;\n this.highlighter?.enable();\n }\n }\n\n /**\n * Cancel rendering of the text layer.\n */\n cancel() {\n if (this.textLayerRenderTask) {\n this.textLayerRenderTask.cancel();\n this.textLayerRenderTask = null;\n }\n this.highlighter?.disable();\n this.accessibilityManager?.disable();\n this.textContentItemsStr.length = 0;\n this.textDivs.length = 0;\n this.textDivProperties = new WeakMap();\n }\n\n /**\n * @param {ReadableStream | TextContent} source\n */\n setTextContentSource(source) {\n this.cancel();\n this.#textContentSource = source;\n }\n\n /**\n * Improves text selection by adding an additional div where the mouse was\n * clicked. This reduces flickering of the content if the mouse is slowly\n * dragged up or down.\n */\n #bindMouse() {\n const { div } = this;\n\n div.addEventListener(\"mousedown\", evt => {\n const end = div.querySelector(\".endOfContent\");\n if (!end) {\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n // On non-Firefox browsers, the selection will feel better if the height\n // of the `endOfContent` div is adjusted to start at mouse click\n // location. This avoids flickering when the selection moves up.\n // However it does not work when selection is started on empty space.\n let adjustTop = evt.target !== div;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n adjustTop &&=\n getComputedStyle(end).getPropertyValue(\"-moz-user-select\") !==\n \"none\";\n }\n if (adjustTop) {\n const divBounds = div.getBoundingClientRect();\n const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);\n end.style.top = (r * 100).toFixed(2) + \"%\";\n }\n }\n end.classList.add(\"active\");\n });\n\n div.addEventListener(\"mouseup\", () => {\n const end = div.querySelector(\".endOfContent\");\n if (!end) {\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n end.style.top = \"\";\n }\n end.classList.remove(\"active\");\n });\n\n div.addEventListener(\"copy\", event => {\n if (!this.#enablePermissions) {\n const selection = document.getSelection();\n event.clipboardData.setData(\n \"text/plain\",\n removeNullCharacters(normalizeUnicode(selection.toString()))\n );\n }\n event.preventDefault();\n event.stopPropagation();\n });\n }\n}\n\nexport { TextLayerBuilder };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/annotation_storage\").AnnotationStorage} AnnotationStorage */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { XfaLayer } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} XfaLayerBuilderOptions\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\n * @property {AnnotationStorage} [annotationStorage]\n * @property {IPDFLinkService} linkService\n * @property {Object} [xfaHtml]\n */\n\nclass XfaLayerBuilder {\n /**\n * @param {XfaLayerBuilderOptions} options\n */\n constructor({\n pageDiv,\n pdfPage,\n annotationStorage = null,\n linkService,\n xfaHtml = null,\n }) {\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.annotationStorage = annotationStorage;\n this.linkService = linkService;\n this.xfaHtml = xfaHtml;\n\n this.div = null;\n this._cancelled = false;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n * @returns {Promise<Object | void>} A promise that is resolved when rendering\n * of the XFA layer is complete. The first rendering will return an object\n * with a `textDivs` property that can be used with the TextHighlighter.\n */\n async render(viewport, intent = \"display\") {\n if (intent === \"print\") {\n const parameters = {\n viewport: viewport.clone({ dontFlip: true }),\n div: this.div,\n xfaHtml: this.xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent,\n };\n\n // Create an xfa layer div and render the form\n const div = document.createElement(\"div\");\n this.pageDiv.append(div);\n parameters.div = div;\n\n return XfaLayer.render(parameters);\n }\n\n // intent === \"display\"\n const xfaHtml = await this.pdfPage.getXfa();\n if (this._cancelled || !xfaHtml) {\n return { textDivs: [] };\n }\n\n const parameters = {\n viewport: viewport.clone({ dontFlip: true }),\n div: this.div,\n xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent,\n };\n\n if (this.div) {\n return XfaLayer.update(parameters);\n }\n // Create an xfa layer div and render the form\n this.div = document.createElement(\"div\");\n this.pageDiv.append(this.div);\n parameters.div = this.div;\n\n return XfaLayer.render(parameters);\n }\n\n cancel() {\n this._cancelled = true;\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n}\n\nexport { XfaLayerBuilder };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CursorTool,\n ScrollMode,\n SpreadMode,\n toggleCheckedBtn,\n toggleExpandedBtn,\n} from \"./ui_utils.js\";\nimport { PagesCountLimit } from \"./pdf_viewer.js\";\n\n/**\n * @typedef {Object} SecondaryToolbarOptions\n * @property {HTMLDivElement} toolbar - Container for the secondary toolbar.\n * @property {HTMLButtonElement} toggleButton - Button to toggle the visibility\n * of the secondary toolbar.\n * @property {HTMLButtonElement} presentationModeButton - Button for entering\n * presentation mode.\n * @property {HTMLButtonElement} openFileButton - Button to open a file.\n * @property {HTMLButtonElement} printButton - Button to print the document.\n * @property {HTMLButtonElement} downloadButton - Button to download the\n * document.\n * @property {HTMLAnchorElement} viewBookmarkButton - Button to obtain a\n * bookmark link to the current location in the document.\n * @property {HTMLButtonElement} firstPageButton - Button to go to the first\n * page in the document.\n * @property {HTMLButtonElement} lastPageButton - Button to go to the last page\n * in the document.\n * @property {HTMLButtonElement} pageRotateCwButton - Button to rotate the pages\n * clockwise.\n * @property {HTMLButtonElement} pageRotateCcwButton - Button to rotate the\n * pages counterclockwise.\n * @property {HTMLButtonElement} cursorSelectToolButton - Button to enable the\n * select tool.\n * @property {HTMLButtonElement} cursorHandToolButton - Button to enable the\n * hand tool.\n * @property {HTMLButtonElement} documentPropertiesButton - Button for opening\n * the document properties dialog.\n */\n\nclass SecondaryToolbar {\n /**\n * @param {SecondaryToolbarOptions} options\n * @param {EventBus} eventBus\n */\n constructor(options, eventBus) {\n this.toolbar = options.toolbar;\n this.toggleButton = options.toggleButton;\n this.buttons = [\n {\n element: options.presentationModeButton,\n eventName: \"presentationmode\",\n close: true,\n },\n { element: options.printButton, eventName: \"print\", close: true },\n { element: options.downloadButton, eventName: \"download\", close: true },\n { element: options.viewBookmarkButton, eventName: null, close: true },\n { element: options.firstPageButton, eventName: \"firstpage\", close: true },\n { element: options.lastPageButton, eventName: \"lastpage\", close: true },\n {\n element: options.pageRotateCwButton,\n eventName: \"rotatecw\",\n close: false,\n },\n {\n element: options.pageRotateCcwButton,\n eventName: \"rotateccw\",\n close: false,\n },\n {\n element: options.cursorSelectToolButton,\n eventName: \"switchcursortool\",\n eventDetails: { tool: CursorTool.SELECT },\n close: true,\n },\n {\n element: options.cursorHandToolButton,\n eventName: \"switchcursortool\",\n eventDetails: { tool: CursorTool.HAND },\n close: true,\n },\n {\n element: options.scrollPageButton,\n eventName: \"switchscrollmode\",\n eventDetails: { mode: ScrollMode.PAGE },\n close: true,\n },\n {\n element: options.scrollVerticalButton,\n eventName: \"switchscrollmode\",\n eventDetails: { mode: ScrollMode.VERTICAL },\n close: true,\n },\n {\n element: options.scrollHorizontalButton,\n eventName: \"switchscrollmode\",\n eventDetails: { mode: ScrollMode.HORIZONTAL },\n close: true,\n },\n {\n element: options.scrollWrappedButton,\n eventName: \"switchscrollmode\",\n eventDetails: { mode: ScrollMode.WRAPPED },\n close: true,\n },\n {\n element: options.spreadNoneButton,\n eventName: \"switchspreadmode\",\n eventDetails: { mode: SpreadMode.NONE },\n close: true,\n },\n {\n element: options.spreadOddButton,\n eventName: \"switchspreadmode\",\n eventDetails: { mode: SpreadMode.ODD },\n close: true,\n },\n {\n element: options.spreadEvenButton,\n eventName: \"switchspreadmode\",\n eventDetails: { mode: SpreadMode.EVEN },\n close: true,\n },\n {\n element: options.documentPropertiesButton,\n eventName: \"documentproperties\",\n close: true,\n },\n ];\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.buttons.push({\n element: options.openFileButton,\n eventName: \"openfile\",\n close: true,\n });\n }\n this.items = {\n firstPage: options.firstPageButton,\n lastPage: options.lastPageButton,\n pageRotateCw: options.pageRotateCwButton,\n pageRotateCcw: options.pageRotateCcwButton,\n };\n\n this.eventBus = eventBus;\n this.opened = false;\n\n // Bind the event listeners for click, cursor tool, and scroll/spread mode\n // actions.\n this.#bindClickListeners();\n this.#bindCursorToolsListener(options);\n this.#bindScrollModeListener(options);\n this.#bindSpreadModeListener(options);\n\n this.reset();\n }\n\n /**\n * @type {boolean}\n */\n get isOpen() {\n return this.opened;\n }\n\n setPageNumber(pageNumber) {\n this.pageNumber = pageNumber;\n this.#updateUIState();\n }\n\n setPagesCount(pagesCount) {\n this.pagesCount = pagesCount;\n this.#updateUIState();\n }\n\n reset() {\n this.pageNumber = 0;\n this.pagesCount = 0;\n this.#updateUIState();\n\n // Reset the Scroll/Spread buttons too, since they're document specific.\n this.eventBus.dispatch(\"secondarytoolbarreset\", { source: this });\n }\n\n #updateUIState() {\n this.items.firstPage.disabled = this.pageNumber <= 1;\n this.items.lastPage.disabled = this.pageNumber >= this.pagesCount;\n this.items.pageRotateCw.disabled = this.pagesCount === 0;\n this.items.pageRotateCcw.disabled = this.pagesCount === 0;\n }\n\n #bindClickListeners() {\n // Button to toggle the visibility of the secondary toolbar.\n this.toggleButton.addEventListener(\"click\", this.toggle.bind(this));\n\n // All items within the secondary toolbar.\n for (const { element, eventName, close, eventDetails } of this.buttons) {\n element.addEventListener(\"click\", evt => {\n if (eventName !== null) {\n this.eventBus.dispatch(eventName, { source: this, ...eventDetails });\n }\n if (close) {\n this.close();\n }\n this.eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"buttons\",\n data: { id: element.id },\n },\n });\n });\n }\n }\n\n #bindCursorToolsListener({ cursorSelectToolButton, cursorHandToolButton }) {\n this.eventBus._on(\"cursortoolchanged\", ({ tool }) => {\n toggleCheckedBtn(cursorSelectToolButton, tool === CursorTool.SELECT);\n toggleCheckedBtn(cursorHandToolButton, tool === CursorTool.HAND);\n });\n }\n\n #bindScrollModeListener({\n scrollPageButton,\n scrollVerticalButton,\n scrollHorizontalButton,\n scrollWrappedButton,\n spreadNoneButton,\n spreadOddButton,\n spreadEvenButton,\n }) {\n const scrollModeChanged = ({ mode }) => {\n toggleCheckedBtn(scrollPageButton, mode === ScrollMode.PAGE);\n toggleCheckedBtn(scrollVerticalButton, mode === ScrollMode.VERTICAL);\n toggleCheckedBtn(scrollHorizontalButton, mode === ScrollMode.HORIZONTAL);\n toggleCheckedBtn(scrollWrappedButton, mode === ScrollMode.WRAPPED);\n\n // Permanently *disable* the Scroll buttons when PAGE-scrolling is being\n // enforced for *very* long/large documents; please see the `BaseViewer`.\n const forceScrollModePage =\n this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE;\n scrollPageButton.disabled = forceScrollModePage;\n scrollVerticalButton.disabled = forceScrollModePage;\n scrollHorizontalButton.disabled = forceScrollModePage;\n scrollWrappedButton.disabled = forceScrollModePage;\n\n // Temporarily *disable* the Spread buttons when horizontal scrolling is\n // enabled, since the non-default Spread modes doesn't affect the layout.\n const isHorizontal = mode === ScrollMode.HORIZONTAL;\n spreadNoneButton.disabled = isHorizontal;\n spreadOddButton.disabled = isHorizontal;\n spreadEvenButton.disabled = isHorizontal;\n };\n this.eventBus._on(\"scrollmodechanged\", scrollModeChanged);\n\n this.eventBus._on(\"secondarytoolbarreset\", evt => {\n if (evt.source === this) {\n scrollModeChanged({ mode: ScrollMode.VERTICAL });\n }\n });\n }\n\n #bindSpreadModeListener({\n spreadNoneButton,\n spreadOddButton,\n spreadEvenButton,\n }) {\n const spreadModeChanged = ({ mode }) => {\n toggleCheckedBtn(spreadNoneButton, mode === SpreadMode.NONE);\n toggleCheckedBtn(spreadOddButton, mode === SpreadMode.ODD);\n toggleCheckedBtn(spreadEvenButton, mode === SpreadMode.EVEN);\n };\n this.eventBus._on(\"spreadmodechanged\", spreadModeChanged);\n\n this.eventBus._on(\"secondarytoolbarreset\", evt => {\n if (evt.source === this) {\n spreadModeChanged({ mode: SpreadMode.NONE });\n }\n });\n }\n\n open() {\n if (this.opened) {\n return;\n }\n this.opened = true;\n toggleExpandedBtn(this.toggleButton, true, this.toolbar);\n }\n\n close() {\n if (!this.opened) {\n return;\n }\n this.opened = false;\n toggleExpandedBtn(this.toggleButton, false, this.toolbar);\n }\n\n toggle() {\n if (this.opened) {\n this.close();\n } else {\n this.open();\n }\n }\n}\n\nexport { SecondaryToolbar };\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n animationStarted,\n DEFAULT_SCALE,\n DEFAULT_SCALE_VALUE,\n MAX_SCALE,\n MIN_SCALE,\n toggleCheckedBtn,\n} from \"./ui_utils.js\";\nimport { AnnotationEditorType, noContextMenu } from \"pdfjs-lib\";\n\nconst PAGE_NUMBER_LOADING_INDICATOR = \"visiblePageIsLoading\";\n\n/**\n * @typedef {Object} ToolbarOptions\n * @property {HTMLDivElement} container - Container for the secondary toolbar.\n * @property {HTMLSpanElement} numPages - Label that contains number of pages.\n * @property {HTMLInputElement} pageNumber - Control for display and user input\n * of the current page number.\n * @property {HTMLSelectElement} scaleSelect - Scale selection control.\n * Its width is adjusted, when necessary, on UI localization.\n * @property {HTMLOptionElement} customScaleOption - The item used to display\n * a non-predefined scale.\n * @property {HTMLButtonElement} previous - Button to go to the previous page.\n * @property {HTMLButtonElement} next - Button to go to the next page.\n * @property {HTMLButtonElement} zoomIn - Button to zoom in the pages.\n * @property {HTMLButtonElement} zoomOut - Button to zoom out the pages.\n * @property {HTMLButtonElement} viewFind - Button to open find bar.\n * @property {HTMLButtonElement} openFile - Button to open a new document.\n * @property {HTMLButtonElement} editorFreeTextButton - Button to switch to\n * FreeText editing.\n * @property {HTMLButtonElement} download - Button to download the document.\n */\n\nclass Toolbar {\n #wasLocalized = false;\n\n /**\n * @param {ToolbarOptions} options\n * @param {EventBus} eventBus\n * @param {IL10n} l10n - Localization service.\n */\n constructor(options, eventBus, l10n) {\n this.toolbar = options.container;\n this.eventBus = eventBus;\n this.l10n = l10n;\n this.buttons = [\n { element: options.previous, eventName: \"previouspage\" },\n { element: options.next, eventName: \"nextpage\" },\n { element: options.zoomIn, eventName: \"zoomin\" },\n { element: options.zoomOut, eventName: \"zoomout\" },\n { element: options.print, eventName: \"print\" },\n { element: options.download, eventName: \"download\" },\n {\n element: options.editorFreeTextButton,\n eventName: \"switchannotationeditormode\",\n eventDetails: {\n get mode() {\n const { classList } = options.editorFreeTextButton;\n return classList.contains(\"toggled\")\n ? AnnotationEditorType.NONE\n : AnnotationEditorType.FREETEXT;\n },\n },\n },\n {\n element: options.editorInkButton,\n eventName: \"switchannotationeditormode\",\n eventDetails: {\n get mode() {\n const { classList } = options.editorInkButton;\n return classList.contains(\"toggled\")\n ? AnnotationEditorType.NONE\n : AnnotationEditorType.INK;\n },\n },\n },\n {\n element: options.editorStampButton,\n eventName: \"switchannotationeditormode\",\n eventDetails: {\n get mode() {\n const { classList } = options.editorStampButton;\n return classList.contains(\"toggled\")\n ? AnnotationEditorType.NONE\n : AnnotationEditorType.STAMP;\n },\n },\n },\n ];\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.buttons.push({ element: options.openFile, eventName: \"openfile\" });\n }\n this.items = {\n numPages: options.numPages,\n pageNumber: options.pageNumber,\n scaleSelect: options.scaleSelect,\n customScaleOption: options.customScaleOption,\n previous: options.previous,\n next: options.next,\n zoomIn: options.zoomIn,\n zoomOut: options.zoomOut,\n };\n\n // Bind the event listeners for click and various other actions.\n this.#bindListeners(options);\n\n this.reset();\n }\n\n setPageNumber(pageNumber, pageLabel) {\n this.pageNumber = pageNumber;\n this.pageLabel = pageLabel;\n this.#updateUIState(false);\n }\n\n setPagesCount(pagesCount, hasPageLabels) {\n this.pagesCount = pagesCount;\n this.hasPageLabels = hasPageLabels;\n this.#updateUIState(true);\n }\n\n setPageScale(pageScaleValue, pageScale) {\n this.pageScaleValue = (pageScaleValue || pageScale).toString();\n this.pageScale = pageScale;\n this.#updateUIState(false);\n }\n\n reset() {\n this.pageNumber = 0;\n this.pageLabel = null;\n this.hasPageLabels = false;\n this.pagesCount = 0;\n this.pageScaleValue = DEFAULT_SCALE_VALUE;\n this.pageScale = DEFAULT_SCALE;\n this.#updateUIState(true);\n this.updateLoadingIndicatorState();\n\n // Reset the Editor buttons too, since they're document specific.\n this.eventBus.dispatch(\"toolbarreset\", { source: this });\n }\n\n #bindListeners(options) {\n const { pageNumber, scaleSelect } = this.items;\n const self = this;\n\n // The buttons within the toolbar.\n for (const { element, eventName, eventDetails } of this.buttons) {\n element.addEventListener(\"click\", evt => {\n if (eventName !== null) {\n this.eventBus.dispatch(eventName, { source: this, ...eventDetails });\n }\n });\n }\n // The non-button elements within the toolbar.\n pageNumber.addEventListener(\"click\", function () {\n this.select();\n });\n pageNumber.addEventListener(\"change\", function () {\n self.eventBus.dispatch(\"pagenumberchanged\", {\n source: self,\n value: this.value,\n });\n });\n\n scaleSelect.addEventListener(\"change\", function () {\n if (this.value === \"custom\") {\n return;\n }\n self.eventBus.dispatch(\"scalechanged\", {\n source: self,\n value: this.value,\n });\n });\n // Here we depend on browsers dispatching the \"click\" event *after* the\n // \"change\" event, when the <select>-element changes.\n scaleSelect.addEventListener(\"click\", function (evt) {\n const target = evt.target;\n // Remove focus when an <option>-element was *clicked*, to improve the UX\n // for mouse users (fixes bug 1300525 and issue 4923).\n if (\n this.value === self.pageScaleValue &&\n target.tagName.toUpperCase() === \"OPTION\"\n ) {\n this.blur();\n }\n });\n // Suppress context menus for some controls.\n scaleSelect.oncontextmenu = noContextMenu;\n\n this.eventBus._on(\"localized\", () => {\n this.#wasLocalized = true;\n this.#adjustScaleWidth();\n this.#updateUIState(true);\n });\n\n this.#bindEditorToolsListener(options);\n }\n\n #bindEditorToolsListener({\n editorFreeTextButton,\n editorFreeTextParamsToolbar,\n editorInkButton,\n editorInkParamsToolbar,\n editorStampButton,\n editorStampParamsToolbar,\n }) {\n const editorModeChanged = ({ mode }) => {\n toggleCheckedBtn(\n editorFreeTextButton,\n mode === AnnotationEditorType.FREETEXT,\n editorFreeTextParamsToolbar\n );\n toggleCheckedBtn(\n editorInkButton,\n mode === AnnotationEditorType.INK,\n editorInkParamsToolbar\n );\n toggleCheckedBtn(\n editorStampButton,\n mode === AnnotationEditorType.STAMP,\n editorStampParamsToolbar\n );\n\n const isDisable = mode === AnnotationEditorType.DISABLE;\n editorFreeTextButton.disabled = isDisable;\n editorInkButton.disabled = isDisable;\n editorStampButton.disabled = isDisable;\n };\n this.eventBus._on(\"annotationeditormodechanged\", editorModeChanged);\n\n this.eventBus._on(\"toolbarreset\", evt => {\n if (evt.source === this) {\n editorModeChanged({ mode: AnnotationEditorType.DISABLE });\n }\n });\n }\n\n #updateUIState(resetNumPages = false) {\n if (!this.#wasLocalized) {\n // Don't update the UI state until we localize the toolbar.\n return;\n }\n const { pageNumber, pagesCount, pageScaleValue, pageScale, items } = this;\n\n if (resetNumPages) {\n if (this.hasPageLabels) {\n items.pageNumber.type = \"text\";\n } else {\n items.pageNumber.type = \"number\";\n this.l10n.get(\"of_pages\", { pagesCount }).then(msg => {\n items.numPages.textContent = msg;\n });\n }\n items.pageNumber.max = pagesCount;\n }\n\n if (this.hasPageLabels) {\n items.pageNumber.value = this.pageLabel;\n this.l10n.get(\"page_of_pages\", { pageNumber, pagesCount }).then(msg => {\n items.numPages.textContent = msg;\n });\n } else {\n items.pageNumber.value = pageNumber;\n }\n\n items.previous.disabled = pageNumber <= 1;\n items.next.disabled = pageNumber >= pagesCount;\n\n items.zoomOut.disabled = pageScale <= MIN_SCALE;\n items.zoomIn.disabled = pageScale >= MAX_SCALE;\n\n this.l10n\n .get(\"page_scale_percent\", { scale: Math.round(pageScale * 10000) / 100 })\n .then(msg => {\n let predefinedValueFound = false;\n for (const option of items.scaleSelect.options) {\n if (option.value !== pageScaleValue) {\n option.selected = false;\n continue;\n }\n option.selected = true;\n predefinedValueFound = true;\n }\n if (!predefinedValueFound) {\n items.customScaleOption.textContent = msg;\n items.customScaleOption.selected = true;\n }\n });\n }\n\n updateLoadingIndicatorState(loading = false) {\n const { pageNumber } = this.items;\n\n pageNumber.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);\n }\n\n /**\n * Increase the width of the zoom dropdown DOM element if, and only if, it's\n * too narrow to fit the *longest* of the localized strings.\n */\n async #adjustScaleWidth() {\n const { items, l10n } = this;\n\n const predefinedValuesPromise = Promise.all([\n l10n.get(\"page_scale_auto\"),\n l10n.get(\"page_scale_actual\"),\n l10n.get(\"page_scale_fit\"),\n l10n.get(\"page_scale_width\"),\n ]);\n await animationStarted;\n\n const style = getComputedStyle(items.scaleSelect);\n const scaleSelectWidth = parseFloat(\n style.getPropertyValue(\"--scale-select-width\")\n );\n\n // The temporary canvas is used to measure text length in the DOM.\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\", { alpha: false });\n ctx.font = `${style.fontSize} ${style.fontFamily}`;\n\n let maxWidth = 0;\n for (const predefinedValue of await predefinedValuesPromise) {\n const { width } = ctx.measureText(predefinedValue);\n if (width > maxWidth) {\n maxWidth = width;\n }\n }\n // Account for the icon width, and ensure that there's always some spacing\n // between the text and the icon.\n maxWidth += 0.3 * scaleSelectWidth;\n\n if (maxWidth > scaleSelectWidth) {\n const container = items.scaleSelect.parentNode;\n container.style.setProperty(\"--scale-select-width\", `${maxWidth}px`);\n }\n // Zeroing the width and height cause Firefox to release graphics resources\n // immediately, which can greatly reduce memory consumption.\n canvas.width = 0;\n canvas.height = 0;\n }\n}\n\nexport { Toolbar };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;\n\n/**\n * View History - This is a utility for saving various view parameters for\n * recently opened files.\n *\n * The way that the view parameters are stored depends on how PDF.js is built,\n * for 'gulp <flag>' the following cases exist:\n * - MOZCENTRAL - uses sessionStorage.\n * - GENERIC or CHROME - uses localStorage, if it is available.\n */\nclass ViewHistory {\n constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) {\n this.fingerprint = fingerprint;\n this.cacheSize = cacheSize;\n\n this._initializedPromise = this._readFromStorage().then(databaseStr => {\n const database = JSON.parse(databaseStr || \"{}\");\n let index = -1;\n if (!Array.isArray(database.files)) {\n database.files = [];\n } else {\n while (database.files.length >= this.cacheSize) {\n database.files.shift();\n }\n\n for (let i = 0, ii = database.files.length; i < ii; i++) {\n const branch = database.files[i];\n if (branch.fingerprint === this.fingerprint) {\n index = i;\n break;\n }\n }\n }\n if (index === -1) {\n index = database.files.push({ fingerprint: this.fingerprint }) - 1;\n }\n this.file = database.files[index];\n this.database = database;\n });\n }\n\n async _writeToStorage() {\n const databaseStr = JSON.stringify(this.database);\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n sessionStorage.setItem(\"pdfjs.history\", databaseStr);\n return;\n }\n localStorage.setItem(\"pdfjs.history\", databaseStr);\n }\n\n async _readFromStorage() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return sessionStorage.getItem(\"pdfjs.history\");\n }\n return localStorage.getItem(\"pdfjs.history\");\n }\n\n async set(name, val) {\n await this._initializedPromise;\n this.file[name] = val;\n return this._writeToStorage();\n }\n\n async setMultiple(properties) {\n await this._initializedPromise;\n for (const name in properties) {\n this.file[name] = properties[name];\n }\n return this._writeToStorage();\n }\n\n async get(name, defaultValue) {\n await this._initializedPromise;\n const val = this.file[name];\n return val !== undefined ? val : defaultValue;\n }\n\n async getMultiple(properties) {\n await this._initializedPromise;\n const values = Object.create(null);\n\n for (const name in properties) {\n const val = this.file[name];\n values[name] = val !== undefined ? val : properties[name];\n }\n return values;\n }\n}\n\nexport { ViewHistory };\n","/* Copyright 2013 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AppOptions, OptionKind } from \"./app_options.js\";\n\n/**\n * BasePreferences - Abstract base class for storing persistent settings.\n * Used for settings that should be applied to all opened documents,\n * or every time the viewer is loaded.\n */\nclass BasePreferences {\n #defaults = Object.freeze(\n typeof PDFJSDev === \"undefined\"\n ? AppOptions.getAll(OptionKind.PREFERENCE)\n : PDFJSDev.eval(\"DEFAULT_PREFERENCES\")\n );\n\n #prefs = Object.create(null);\n\n #initializedPromise = null;\n\n constructor() {\n if (this.constructor === BasePreferences) {\n throw new Error(\"Cannot initialize BasePreferences.\");\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\")) {\n Object.defineProperty(this, \"defaults\", {\n get() {\n return this.#defaults;\n },\n });\n }\n\n this.#initializedPromise = this._readFromStorage(this.#defaults).then(\n prefs => {\n for (const name in this.#defaults) {\n const prefValue = prefs?.[name];\n // Ignore preferences whose types don't match the default values.\n if (typeof prefValue === typeof this.#defaults[name]) {\n this.#prefs[name] = prefValue;\n }\n }\n }\n );\n }\n\n /**\n * Stub function for writing preferences to storage.\n * @param {Object} prefObj The preferences that should be written to storage.\n * @returns {Promise} A promise that is resolved when the preference values\n * have been written.\n */\n async _writeToStorage(prefObj) {\n throw new Error(\"Not implemented: _writeToStorage\");\n }\n\n /**\n * Stub function for reading preferences from storage.\n * @param {Object} prefObj The preferences that should be read from storage.\n * @returns {Promise} A promise that is resolved with an {Object} containing\n * the preferences that have been read.\n */\n async _readFromStorage(prefObj) {\n throw new Error(\"Not implemented: _readFromStorage\");\n }\n\n /**\n * Reset the preferences to their default values and update storage.\n * @returns {Promise} A promise that is resolved when the preference values\n * have been reset.\n */\n async reset() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Please use `about:config` to change preferences.\");\n }\n await this.#initializedPromise;\n const prefs = this.#prefs;\n\n this.#prefs = Object.create(null);\n return this._writeToStorage(this.#defaults).catch(reason => {\n // Revert all preference values, since writing to storage failed.\n this.#prefs = prefs;\n throw reason;\n });\n }\n\n /**\n * Set the value of a preference.\n * @param {string} name The name of the preference that should be changed.\n * @param {boolean|number|string} value The new value of the preference.\n * @returns {Promise} A promise that is resolved when the value has been set,\n * provided that the preference exists and the types match.\n */\n async set(name, value) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Please use `about:config` to change preferences.\");\n }\n await this.#initializedPromise;\n const defaultValue = this.#defaults[name],\n prefs = this.#prefs;\n\n if (defaultValue === undefined) {\n throw new Error(`Set preference: \"${name}\" is undefined.`);\n } else if (value === undefined) {\n throw new Error(\"Set preference: no value is specified.\");\n }\n const valueType = typeof value,\n defaultType = typeof defaultValue;\n\n if (valueType !== defaultType) {\n if (valueType === \"number\" && defaultType === \"string\") {\n value = value.toString();\n } else {\n throw new Error(\n `Set preference: \"${value}\" is a ${valueType}, expected a ${defaultType}.`\n );\n }\n } else if (valueType === \"number\" && !Number.isInteger(value)) {\n throw new Error(`Set preference: \"${value}\" must be an integer.`);\n }\n\n this.#prefs[name] = value;\n return this._writeToStorage(this.#prefs).catch(reason => {\n // Revert all preference values, since writing to storage failed.\n this.#prefs = prefs;\n throw reason;\n });\n }\n\n /**\n * Get the value of a preference.\n * @param {string} name The name of the preference whose value is requested.\n * @returns {Promise} A promise resolved with a {boolean|number|string}\n * containing the value of the preference.\n */\n async get(name) {\n await this.#initializedPromise;\n const defaultValue = this.#defaults[name];\n\n if (defaultValue === undefined) {\n throw new Error(`Get preference: \"${name}\" is undefined.`);\n }\n return this.#prefs[name] ?? defaultValue;\n }\n\n /**\n * Get the values of all preferences.\n * @returns {Promise} A promise that is resolved with an {Object} containing\n * the values of all preferences.\n */\n async getAll() {\n await this.#initializedPromise;\n const obj = Object.create(null);\n\n for (const name in this.#defaults) {\n obj[name] = this.#prefs[name] ?? this.#defaults[name];\n }\n return obj;\n }\n}\n\nexport { BasePreferences };\n","/* Copyright 2013 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n\nimport { createValidAbsoluteUrl, isPdfFile } from \"pdfjs-lib\";\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"CHROME || GENERIC\")) {\n throw new Error(\n 'Module \"pdfjs-web/download_manager\" shall not be used ' +\n \"outside CHROME and GENERIC builds.\"\n );\n}\n\nfunction download(blobUrl, filename) {\n const a = document.createElement(\"a\");\n if (!a.click) {\n throw new Error('DownloadManager: \"a.click()\" is not supported.');\n }\n a.href = blobUrl;\n a.target = \"_parent\";\n // Use a.download if available. This increases the likelihood that\n // the file is downloaded instead of opened by another PDF plugin.\n if (\"download\" in a) {\n a.download = filename;\n }\n // <a> must be in the document for recent Firefox versions,\n // otherwise .click() is ignored.\n (document.body || document.documentElement).append(a);\n a.click();\n a.remove();\n}\n\n/**\n * @implements {IDownloadManager}\n */\nclass DownloadManager {\n #openBlobUrls = new WeakMap();\n\n downloadUrl(url, filename, _options) {\n if (!createValidAbsoluteUrl(url, \"http://example.com\")) {\n console.error(`downloadUrl - not a valid URL: ${url}`);\n return; // restricted/invalid URL\n }\n download(url + \"#pdfjs.action=download\", filename);\n }\n\n downloadData(data, filename, contentType) {\n const blobUrl = URL.createObjectURL(\n new Blob([data], { type: contentType })\n );\n download(blobUrl, filename);\n }\n\n /**\n * @returns {boolean} Indicating if the data was opened.\n */\n openOrDownloadData(element, data, filename) {\n const isPdfData = isPdfFile(filename);\n const contentType = isPdfData ? \"application/pdf\" : \"\";\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"COMPONENTS\")) &&\n isPdfData\n ) {\n let blobUrl = this.#openBlobUrls.get(element);\n if (!blobUrl) {\n blobUrl = URL.createObjectURL(new Blob([data], { type: contentType }));\n this.#openBlobUrls.set(element, blobUrl);\n }\n let viewerUrl;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // The current URL is the viewer, let's use it and append the file.\n viewerUrl = \"?file=\" + encodeURIComponent(blobUrl + \"#\" + filename);\n } else if (PDFJSDev.test(\"CHROME\")) {\n // In the Chrome extension, the URL is rewritten using the history API\n // in viewer.js, so an absolute URL must be generated.\n viewerUrl =\n // eslint-disable-next-line no-undef\n chrome.runtime.getURL(\"/content/web/viewer.html\") +\n \"?file=\" +\n encodeURIComponent(blobUrl + \"#\" + filename);\n }\n\n try {\n window.open(viewerUrl);\n return true;\n } catch (ex) {\n console.error(`openOrDownloadData: ${ex}`);\n // Release the `blobUrl`, since opening it failed, and fallback to\n // downloading the PDF file.\n URL.revokeObjectURL(blobUrl);\n this.#openBlobUrls.delete(element);\n }\n }\n\n this.downloadData(data, filename, contentType);\n return false;\n }\n\n download(blob, url, filename, _options) {\n const blobUrl = URL.createObjectURL(blob);\n download(blobUrl, filename);\n }\n}\n\nexport { DownloadManager };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n\nimport \"../external/webL10n/l10n.js\";\nimport { getL10nFallback } from \"./l10n_utils.js\";\n\nconst PARTIAL_LANG_CODES = {\n en: \"en-US\",\n es: \"es-ES\",\n fy: \"fy-NL\",\n ga: \"ga-IE\",\n gu: \"gu-IN\",\n hi: \"hi-IN\",\n hy: \"hy-AM\",\n nb: \"nb-NO\",\n ne: \"ne-NP\",\n nn: \"nn-NO\",\n pa: \"pa-IN\",\n pt: \"pt-PT\",\n sv: \"sv-SE\",\n zh: \"zh-CN\",\n};\n\n// Try to support \"incompletely\" specified language codes (see issue 13689).\nfunction fixupLangCode(langCode) {\n return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode;\n}\n\n/**\n * @implements {IL10n}\n */\nclass GenericL10n {\n constructor(lang) {\n const { webL10n } = document;\n this._lang = lang;\n this._ready = new Promise((resolve, reject) => {\n webL10n.setLanguage(fixupLangCode(lang), () => {\n resolve(webL10n);\n });\n });\n }\n\n async getLanguage() {\n const l10n = await this._ready;\n return l10n.getLanguage();\n }\n\n async getDirection() {\n const l10n = await this._ready;\n return l10n.getDirection();\n }\n\n async get(key, args = null, fallback = getL10nFallback(key, args)) {\n const l10n = await this._ready;\n return l10n.get(key, args, fallback);\n }\n\n async translate(element) {\n const l10n = await this._ready;\n return l10n.translate(element);\n }\n}\n\nexport { GenericL10n };\n","/**\n * Copyright (c) 2011-2013 Fabien Cazenave, Mozilla.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n/*\n Additional modifications for PDF.js project:\n - Disables language initialization on page loading.\n - Disables document translation on page loading.\n - Removes consoleWarn and consoleLog and use console.log/warn directly.\n - Removes window._ assignment.\n - Remove compatibility code for OldIE.\n - Replaces `String.prototype.substr()` with `String.prototype.substring()`.\n - Replaces one `Node.insertBefore()` with `Element.prepend()`.\n - Removes `fireL10nReadyEvent` since the \"localized\" event it dispatches\n is unused and may clash with an identically named event in the viewer.\n - Use preprocessor statements for browser globals (removed during building),\n to enable more unit-testing in Node.js environments.\n*/\n\n/*jshint browser: true, devel: true, es5: true, globalstrict: true */\n'use strict';\n\n(typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"LIB\") ? {} : document).webL10n = (function(window, document) {\n var gL10nData = {};\n var gTextData = '';\n var gTextProp = 'textContent';\n var gLanguage = '';\n var gMacros = {};\n var gReadyState = 'loading';\n\n\n /**\n * Synchronously loading l10n resources significantly minimizes flickering\n * from displaying the app with non-localized strings and then updating the\n * strings. Although this will block all script execution on this page, we\n * expect that the l10n resources are available locally on flash-storage.\n *\n * As synchronous XHR is generally considered as a bad idea, we're still\n * loading l10n resources asynchronously -- but we keep this in a setting,\n * just in case... and applications using this library should hide their\n * content until the `localized' event happens.\n */\n\n var gAsyncResourceLoading = true; // read-only\n\n\n /**\n * DOM helpers for the so-called \"HTML API\".\n *\n * These functions are written for modern browsers. For old versions of IE,\n * they're overridden in the 'startup' section at the end of this file.\n */\n\n function getL10nResourceLinks() {\n return document.querySelectorAll('link[type=\"application/l10n\"]');\n }\n\n function getL10nDictionary() {\n var script = document.querySelector('script[type=\"application/l10n\"]');\n // TODO: support multiple and external JSON dictionaries\n return script ? JSON.parse(script.innerHTML) : null;\n }\n\n function getTranslatableChildren(element) {\n return element ? element.querySelectorAll('*[data-l10n-id]') : [];\n }\n\n function getL10nAttributes(element) {\n if (!element)\n return {};\n\n var l10nId = element.getAttribute('data-l10n-id');\n var l10nArgs = element.getAttribute('data-l10n-args');\n var args = {};\n if (l10nArgs) {\n try {\n args = JSON.parse(l10nArgs);\n } catch (e) {\n console.warn('could not parse arguments for #' + l10nId);\n }\n }\n return { id: l10nId, args: args };\n }\n\n function xhrLoadText(url, onSuccess, onFailure) {\n onSuccess = onSuccess || function _onSuccess(data) {};\n onFailure = onFailure || function _onFailure() {};\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, gAsyncResourceLoading);\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=utf-8');\n }\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n if (xhr.status == 200 || xhr.status === 0) {\n onSuccess(xhr.responseText);\n } else {\n onFailure();\n }\n }\n };\n xhr.onerror = onFailure;\n xhr.ontimeout = onFailure;\n\n // in Firefox OS with the app:// protocol, trying to XHR a non-existing\n // URL will raise an exception here -- hence this ugly try...catch.\n try {\n xhr.send(null);\n } catch (e) {\n onFailure();\n }\n }\n\n\n /**\n * l10n resource parser:\n * - reads (async XHR) the l10n resource matching `lang';\n * - imports linked resources (synchronously) when specified;\n * - parses the text data (fills `gL10nData' and `gTextData');\n * - triggers success/failure callbacks when done.\n *\n * @param {string} href\n * URL of the l10n resource to parse.\n *\n * @param {string} lang\n * locale (language) to parse. Must be a lowercase string.\n *\n * @param {Function} successCallback\n * triggered when the l10n resource has been successfully parsed.\n *\n * @param {Function} failureCallback\n * triggered when the an error has occurred.\n *\n * @return {void}\n * uses the following global variables: gL10nData, gTextData, gTextProp.\n */\n\n function parseResource(href, lang, successCallback, failureCallback) {\n var baseURL = href.replace(/[^\\/]*$/, '') || './';\n\n // handle escaped characters (backslashes) in a string\n function evalString(text) {\n if (text.lastIndexOf('\\\\') < 0)\n return text;\n return text.replace(/\\\\\\\\/g, '\\\\')\n .replace(/\\\\n/g, '\\n')\n .replace(/\\\\r/g, '\\r')\n .replace(/\\\\t/g, '\\t')\n .replace(/\\\\b/g, '\\b')\n .replace(/\\\\f/g, '\\f')\n .replace(/\\\\{/g, '{')\n .replace(/\\\\}/g, '}')\n .replace(/\\\\\"/g, '\"')\n .replace(/\\\\'/g, \"'\");\n }\n\n // parse *.properties text data into an l10n dictionary\n // If gAsyncResourceLoading is false, then the callback will be called\n // synchronously. Otherwise it is called asynchronously.\n function parseProperties(text, parsedPropertiesCallback) {\n var dictionary = {};\n\n // token expressions\n var reBlank = /^\\s*|\\s*$/;\n var reComment = /^\\s*#|^\\s*$/;\n var reSection = /^\\s*\\[(.*)\\]\\s*$/;\n var reImport = /^\\s*@import\\s+url\\((.*)\\)\\s*$/i;\n var reSplit = /^([^=\\s]*)\\s*=\\s*(.+)$/; // TODO: escape EOLs with '\\'\n\n // parse the *.properties file into an associative array\n function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {\n var entries = rawText.replace(reBlank, '').split(/[\\r\\n]+/);\n var currentLang = '*';\n var genericLang = lang.split('-', 1)[0];\n var skipLang = false;\n var match = '';\n\n function nextEntry() {\n // Use infinite loop instead of recursion to avoid reaching the\n // maximum recursion limit for content with many lines.\n while (true) {\n if (!entries.length) {\n parsedRawLinesCallback();\n return;\n }\n var line = entries.shift();\n\n // comment or blank line?\n if (reComment.test(line))\n continue;\n\n // the extended syntax supports [lang] sections and @import rules\n if (extendedSyntax) {\n match = reSection.exec(line);\n if (match) { // section start?\n // RFC 4646, section 4.4, \"All comparisons MUST be performed\n // in a case-insensitive manner.\"\n\n currentLang = match[1].toLowerCase();\n skipLang = (currentLang !== '*') &&\n (currentLang !== lang) && (currentLang !== genericLang);\n continue;\n } else if (skipLang) {\n continue;\n }\n match = reImport.exec(line);\n if (match) { // @import rule?\n loadImport(baseURL + match[1], nextEntry);\n return;\n }\n }\n\n // key-value pair\n var tmp = line.match(reSplit);\n if (tmp && tmp.length == 3) {\n dictionary[tmp[1]] = evalString(tmp[2]);\n }\n }\n }\n nextEntry();\n }\n\n // import another *.properties file\n function loadImport(url, callback) {\n xhrLoadText(url, function(content) {\n parseRawLines(content, false, callback); // don't allow recursive imports\n }, function () {\n console.warn(url + ' not found.');\n callback();\n });\n }\n\n // fill the dictionary\n parseRawLines(text, true, function() {\n parsedPropertiesCallback(dictionary);\n });\n }\n\n // load and parse l10n data (warning: global variables are used here)\n xhrLoadText(href, function(response) {\n gTextData += response; // mostly for debug\n\n // parse *.properties text data into an l10n dictionary\n parseProperties(response, function(data) {\n\n // find attribute descriptions, if any\n for (var key in data) {\n var id, prop, index = key.lastIndexOf('.');\n if (index > 0) { // an attribute has been specified\n id = key.substring(0, index);\n prop = key.substring(index + 1);\n } else { // no attribute: assuming text content by default\n id = key;\n prop = gTextProp;\n }\n if (!gL10nData[id]) {\n gL10nData[id] = {};\n }\n gL10nData[id][prop] = data[key];\n }\n\n // trigger callback\n if (successCallback) {\n successCallback();\n }\n });\n }, failureCallback);\n }\n\n // load and parse all resources for the specified locale\n function loadLocale(lang, callback) {\n // RFC 4646, section 2.1 states that language tags have to be treated as\n // case-insensitive. Convert to lowercase for case-insensitive comparisons.\n if (lang) {\n lang = lang.toLowerCase();\n }\n\n callback = callback || function _callback() {};\n\n clear();\n gLanguage = lang;\n\n // check all <link type=\"application/l10n\" href=\"...\" /> nodes\n // and load the resource files\n var langLinks = getL10nResourceLinks();\n var langCount = langLinks.length;\n if (langCount === 0) {\n // we might have a pre-compiled dictionary instead\n var dict = getL10nDictionary();\n if (dict && dict.locales && dict.default_locale) {\n console.log('using the embedded JSON directory, early way out');\n gL10nData = dict.locales[lang];\n if (!gL10nData) {\n var defaultLocale = dict.default_locale.toLowerCase();\n for (var anyCaseLang in dict.locales) {\n anyCaseLang = anyCaseLang.toLowerCase();\n if (anyCaseLang === lang) {\n gL10nData = dict.locales[lang];\n break;\n } else if (anyCaseLang === defaultLocale) {\n gL10nData = dict.locales[defaultLocale];\n }\n }\n }\n callback();\n } else {\n console.log('no resource to load, early way out');\n }\n // early way out\n gReadyState = 'complete';\n return;\n }\n\n // start the callback when all resources are loaded\n var onResourceLoaded = null;\n var gResourceCount = 0;\n onResourceLoaded = function() {\n gResourceCount++;\n if (gResourceCount >= langCount) {\n callback();\n gReadyState = 'complete';\n }\n };\n\n // load all resource files\n function L10nResourceLink(link) {\n var href = link.href;\n // Note: If |gAsyncResourceLoading| is false, then the following callbacks\n // are synchronously called.\n this.load = function(lang, callback) {\n parseResource(href, lang, callback, function() {\n console.warn(href + ' not found.');\n // lang not found, used default resource instead\n console.warn('\"' + lang + '\" resource not found');\n gLanguage = '';\n // Resource not loaded, but we still need to call the callback.\n callback();\n });\n };\n }\n\n for (var i = 0; i < langCount; i++) {\n var resource = new L10nResourceLink(langLinks[i]);\n resource.load(lang, onResourceLoaded);\n }\n }\n\n // clear all l10n data\n function clear() {\n gL10nData = {};\n gTextData = '';\n gLanguage = '';\n // TODO: clear all non predefined macros.\n // There's no such macro /yet/ but we're planning to have some...\n }\n\n\n /**\n * Get rules for plural forms (shared with JetPack), see:\n * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html\n * https://github.com/mozilla/addon-sdk/blob/master/python-lib/plural-rules-generator.p\n *\n * @param {string} lang\n * locale (language) used.\n *\n * @return {Function}\n * returns a function that gives the plural form name for a given integer:\n * var fun = getPluralRules('en');\n * fun(1) -> 'one'\n * fun(0) -> 'other'\n * fun(1000) -> 'other'.\n */\n\n function getPluralRules(lang) {\n var locales2rules = {\n 'af': 3,\n 'ak': 4,\n 'am': 4,\n 'ar': 1,\n 'asa': 3,\n 'az': 0,\n 'be': 11,\n 'bem': 3,\n 'bez': 3,\n 'bg': 3,\n 'bh': 4,\n 'bm': 0,\n 'bn': 3,\n 'bo': 0,\n 'br': 20,\n 'brx': 3,\n 'bs': 11,\n 'ca': 3,\n 'cgg': 3,\n 'chr': 3,\n 'cs': 12,\n 'cy': 17,\n 'da': 3,\n 'de': 3,\n 'dv': 3,\n 'dz': 0,\n 'ee': 3,\n 'el': 3,\n 'en': 3,\n 'eo': 3,\n 'es': 3,\n 'et': 3,\n 'eu': 3,\n 'fa': 0,\n 'ff': 5,\n 'fi': 3,\n 'fil': 4,\n 'fo': 3,\n 'fr': 5,\n 'fur': 3,\n 'fy': 3,\n 'ga': 8,\n 'gd': 24,\n 'gl': 3,\n 'gsw': 3,\n 'gu': 3,\n 'guw': 4,\n 'gv': 23,\n 'ha': 3,\n 'haw': 3,\n 'he': 2,\n 'hi': 4,\n 'hr': 11,\n 'hu': 0,\n 'id': 0,\n 'ig': 0,\n 'ii': 0,\n 'is': 3,\n 'it': 3,\n 'iu': 7,\n 'ja': 0,\n 'jmc': 3,\n 'jv': 0,\n 'ka': 0,\n 'kab': 5,\n 'kaj': 3,\n 'kcg': 3,\n 'kde': 0,\n 'kea': 0,\n 'kk': 3,\n 'kl': 3,\n 'km': 0,\n 'kn': 0,\n 'ko': 0,\n 'ksb': 3,\n 'ksh': 21,\n 'ku': 3,\n 'kw': 7,\n 'lag': 18,\n 'lb': 3,\n 'lg': 3,\n 'ln': 4,\n 'lo': 0,\n 'lt': 10,\n 'lv': 6,\n 'mas': 3,\n 'mg': 4,\n 'mk': 16,\n 'ml': 3,\n 'mn': 3,\n 'mo': 9,\n 'mr': 3,\n 'ms': 0,\n 'mt': 15,\n 'my': 0,\n 'nah': 3,\n 'naq': 7,\n 'nb': 3,\n 'nd': 3,\n 'ne': 3,\n 'nl': 3,\n 'nn': 3,\n 'no': 3,\n 'nr': 3,\n 'nso': 4,\n 'ny': 3,\n 'nyn': 3,\n 'om': 3,\n 'or': 3,\n 'pa': 3,\n 'pap': 3,\n 'pl': 13,\n 'ps': 3,\n 'pt': 3,\n 'rm': 3,\n 'ro': 9,\n 'rof': 3,\n 'ru': 11,\n 'rwk': 3,\n 'sah': 0,\n 'saq': 3,\n 'se': 7,\n 'seh': 3,\n 'ses': 0,\n 'sg': 0,\n 'sh': 11,\n 'shi': 19,\n 'sk': 12,\n 'sl': 14,\n 'sma': 7,\n 'smi': 7,\n 'smj': 7,\n 'smn': 7,\n 'sms': 7,\n 'sn': 3,\n 'so': 3,\n 'sq': 3,\n 'sr': 11,\n 'ss': 3,\n 'ssy': 3,\n 'st': 3,\n 'sv': 3,\n 'sw': 3,\n 'syr': 3,\n 'ta': 3,\n 'te': 3,\n 'teo': 3,\n 'th': 0,\n 'ti': 4,\n 'tig': 3,\n 'tk': 3,\n 'tl': 4,\n 'tn': 3,\n 'to': 0,\n 'tr': 0,\n 'ts': 3,\n 'tzm': 22,\n 'uk': 11,\n 'ur': 3,\n 've': 3,\n 'vi': 0,\n 'vun': 3,\n 'wa': 4,\n 'wae': 3,\n 'wo': 0,\n 'xh': 3,\n 'xog': 3,\n 'yo': 0,\n 'zh': 0,\n 'zu': 3\n };\n\n // utility functions for plural rules methods\n function isIn(n, list) {\n return list.indexOf(n) !== -1;\n }\n function isBetween(n, start, end) {\n return start <= n && n <= end;\n }\n\n // list of all plural rules methods:\n // map an integer to the plural form name to use\n var pluralRules = {\n '0': function(n) {\n return 'other';\n },\n '1': function(n) {\n if ((isBetween((n % 100), 3, 10)))\n return 'few';\n if (n === 0)\n return 'zero';\n if ((isBetween((n % 100), 11, 99)))\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '2': function(n) {\n if (n !== 0 && (n % 10) === 0)\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '3': function(n) {\n if (n == 1)\n return 'one';\n return 'other';\n },\n '4': function(n) {\n if ((isBetween(n, 0, 1)))\n return 'one';\n return 'other';\n },\n '5': function(n) {\n if ((isBetween(n, 0, 2)) && n != 2)\n return 'one';\n return 'other';\n },\n '6': function(n) {\n if (n === 0)\n return 'zero';\n if ((n % 10) == 1 && (n % 100) != 11)\n return 'one';\n return 'other';\n },\n '7': function(n) {\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '8': function(n) {\n if ((isBetween(n, 3, 6)))\n return 'few';\n if ((isBetween(n, 7, 10)))\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '9': function(n) {\n if (n === 0 || n != 1 && (isBetween((n % 100), 1, 19)))\n return 'few';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '10': function(n) {\n if ((isBetween((n % 10), 2, 9)) && !(isBetween((n % 100), 11, 19)))\n return 'few';\n if ((n % 10) == 1 && !(isBetween((n % 100), 11, 19)))\n return 'one';\n return 'other';\n },\n '11': function(n) {\n if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))\n return 'few';\n if ((n % 10) === 0 ||\n (isBetween((n % 10), 5, 9)) ||\n (isBetween((n % 100), 11, 14)))\n return 'many';\n if ((n % 10) == 1 && (n % 100) != 11)\n return 'one';\n return 'other';\n },\n '12': function(n) {\n if ((isBetween(n, 2, 4)))\n return 'few';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '13': function(n) {\n if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))\n return 'few';\n if (n != 1 && (isBetween((n % 10), 0, 1)) ||\n (isBetween((n % 10), 5, 9)) ||\n (isBetween((n % 100), 12, 14)))\n return 'many';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '14': function(n) {\n if ((isBetween((n % 100), 3, 4)))\n return 'few';\n if ((n % 100) == 2)\n return 'two';\n if ((n % 100) == 1)\n return 'one';\n return 'other';\n },\n '15': function(n) {\n if (n === 0 || (isBetween((n % 100), 2, 10)))\n return 'few';\n if ((isBetween((n % 100), 11, 19)))\n return 'many';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '16': function(n) {\n if ((n % 10) == 1 && n != 11)\n return 'one';\n return 'other';\n },\n '17': function(n) {\n if (n == 3)\n return 'few';\n if (n === 0)\n return 'zero';\n if (n == 6)\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '18': function(n) {\n if (n === 0)\n return 'zero';\n if ((isBetween(n, 0, 2)) && n !== 0 && n != 2)\n return 'one';\n return 'other';\n },\n '19': function(n) {\n if ((isBetween(n, 2, 10)))\n return 'few';\n if ((isBetween(n, 0, 1)))\n return 'one';\n return 'other';\n },\n '20': function(n) {\n if ((isBetween((n % 10), 3, 4) || ((n % 10) == 9)) && !(\n isBetween((n % 100), 10, 19) ||\n isBetween((n % 100), 70, 79) ||\n isBetween((n % 100), 90, 99)\n ))\n return 'few';\n if ((n % 1000000) === 0 && n !== 0)\n return 'many';\n if ((n % 10) == 2 && !isIn((n % 100), [12, 72, 92]))\n return 'two';\n if ((n % 10) == 1 && !isIn((n % 100), [11, 71, 91]))\n return 'one';\n return 'other';\n },\n '21': function(n) {\n if (n === 0)\n return 'zero';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '22': function(n) {\n if ((isBetween(n, 0, 1)) || (isBetween(n, 11, 99)))\n return 'one';\n return 'other';\n },\n '23': function(n) {\n if ((isBetween((n % 10), 1, 2)) || (n % 20) === 0)\n return 'one';\n return 'other';\n },\n '24': function(n) {\n if ((isBetween(n, 3, 10) || isBetween(n, 13, 19)))\n return 'few';\n if (isIn(n, [2, 12]))\n return 'two';\n if (isIn(n, [1, 11]))\n return 'one';\n return 'other';\n }\n };\n\n // return a function that gives the plural form name for a given integer\n var index = locales2rules[lang.replace(/-.*$/, '')];\n if (!(index in pluralRules)) {\n console.warn('plural form unknown for [' + lang + ']');\n return function() { return 'other'; };\n }\n return pluralRules[index];\n }\n\n // pre-defined 'plural' macro\n gMacros.plural = function(str, param, key, prop) {\n var n = parseFloat(param);\n if (isNaN(n))\n return str;\n\n // TODO: support other properties (l20n still doesn't...)\n if (prop != gTextProp)\n return str;\n\n // initialize _pluralRules\n if (!gMacros._pluralRules) {\n gMacros._pluralRules = getPluralRules(gLanguage);\n }\n var index = '[' + gMacros._pluralRules(n) + ']';\n\n // try to find a [zero|one|two] key if it's defined\n if (n === 0 && (key + '[zero]') in gL10nData) {\n str = gL10nData[key + '[zero]'][prop];\n } else if (n == 1 && (key + '[one]') in gL10nData) {\n str = gL10nData[key + '[one]'][prop];\n } else if (n == 2 && (key + '[two]') in gL10nData) {\n str = gL10nData[key + '[two]'][prop];\n } else if ((key + index) in gL10nData) {\n str = gL10nData[key + index][prop];\n } else if ((key + '[other]') in gL10nData) {\n str = gL10nData[key + '[other]'][prop];\n }\n\n return str;\n };\n\n\n /**\n * l10n dictionary functions\n */\n\n // fetch an l10n object, warn if not found, apply `args' if possible\n function getL10nData(key, args, fallback) {\n var data = gL10nData[key];\n if (!data) {\n console.warn('#' + key + ' is undefined.');\n if (!fallback) {\n return null;\n }\n data = fallback;\n }\n\n /** This is where l10n expressions should be processed.\n * The plan is to support C-style expressions from the l20n project;\n * until then, only two kinds of simple expressions are supported:\n * {[ index ]} and {{ arguments }}.\n */\n var rv = {};\n for (var prop in data) {\n var str = data[prop];\n str = substIndexes(str, args, key, prop);\n str = substArguments(str, args, key);\n rv[prop] = str;\n }\n return rv;\n }\n\n // replace {[macros]} with their values\n function substIndexes(str, args, key, prop) {\n var reIndex = /\\{\\[\\s*([a-zA-Z]+)\\(([a-zA-Z]+)\\)\\s*\\]\\}/;\n var reMatch = reIndex.exec(str);\n if (!reMatch || !reMatch.length)\n return str;\n\n // an index/macro has been found\n // Note: at the moment, only one parameter is supported\n var macroName = reMatch[1];\n var paramName = reMatch[2];\n var param;\n if (args && paramName in args) {\n param = args[paramName];\n } else if (paramName in gL10nData) {\n param = gL10nData[paramName];\n }\n\n // there's no macro parser yet: it has to be defined in gMacros\n if (macroName in gMacros) {\n var macro = gMacros[macroName];\n str = macro(str, param, key, prop);\n }\n return str;\n }\n\n // replace {{arguments}} with their values\n function substArguments(str, args, key) {\n var reArgs = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n return str.replace(reArgs, function(matched_text, arg) {\n if (args && arg in args) {\n return args[arg];\n }\n if (arg in gL10nData) {\n return gL10nData[arg];\n }\n console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');\n return matched_text;\n });\n }\n\n // translate an HTML element\n function translateElement(element) {\n var l10n = getL10nAttributes(element);\n if (!l10n.id)\n return;\n\n // get the related l10n object\n var data = getL10nData(l10n.id, l10n.args);\n if (!data) {\n console.warn('#' + l10n.id + ' is undefined.');\n return;\n }\n\n // translate element (TODO: security checks?)\n if (data[gTextProp]) { // XXX\n if (getChildElementCount(element) === 0) {\n element[gTextProp] = data[gTextProp];\n } else {\n // this element has element children: replace the content of the first\n // (non-empty) child textNode and clear other child textNodes\n var children = element.childNodes;\n var found = false;\n for (var i = 0, l = children.length; i < l; i++) {\n if (children[i].nodeType === 3 && /\\S/.test(children[i].nodeValue)) {\n if (found) {\n children[i].nodeValue = '';\n } else {\n children[i].nodeValue = data[gTextProp];\n found = true;\n }\n }\n }\n // if no (non-empty) textNode is found, insert a textNode before the\n // first element child.\n if (!found) {\n var textNode = document.createTextNode(data[gTextProp]);\n element.prepend(textNode);\n }\n }\n delete data[gTextProp];\n }\n\n for (var k in data) {\n element[k] = data[k];\n }\n }\n\n // webkit browsers don't currently support 'children' on SVG elements...\n function getChildElementCount(element) {\n if (element.children) {\n return element.children.length;\n }\n if (typeof element.childElementCount !== 'undefined') {\n return element.childElementCount;\n }\n var count = 0;\n for (var i = 0; i < element.childNodes.length; i++) {\n count += element.nodeType === 1 ? 1 : 0;\n }\n return count;\n }\n\n // translate an HTML subtree\n function translateFragment(element) {\n element = element || document.documentElement;\n\n // check all translatable children (= w/ a `data-l10n-id' attribute)\n var children = getTranslatableChildren(element);\n var elementCount = children.length;\n for (var i = 0; i < elementCount; i++) {\n translateElement(children[i]);\n }\n\n // translate element itself if necessary\n translateElement(element);\n }\n\n return {\n // get a localized string\n get: function(key, args, fallbackString) {\n var index = key.lastIndexOf('.');\n var prop = gTextProp;\n if (index > 0) { // An attribute has been specified\n prop = key.substring(index + 1);\n key = key.substring(0, index);\n }\n var fallback;\n if (fallbackString) {\n fallback = {};\n fallback[prop] = fallbackString;\n }\n var data = getL10nData(key, args, fallback);\n if (data && prop in data) {\n return data[prop];\n }\n return '{{' + key + '}}';\n },\n\n // debug\n getData: function() { return gL10nData; },\n getText: function() { return gTextData; },\n\n // get|set the document language\n getLanguage: function() { return gLanguage; },\n setLanguage: function(lang, callback) {\n loadLocale(lang, function() {\n if (callback)\n callback();\n });\n },\n\n // get the direction (ltr|rtl) of the current language\n getDirection: function() {\n // http://www.w3.org/International/questions/qa-scripts\n // Arabic, Hebrew, Farsi, Pashto, Urdu\n var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];\n var shortCode = gLanguage.split('-', 1)[0];\n return (rtlList.indexOf(shortCode) >= 0) ? 'rtl' : 'ltr';\n },\n\n // translate an element or document fragment\n translate: translateFragment,\n\n // this can be used to prevent race conditions\n getReadyState: function() { return gReadyState; },\n ready: function(callback) {\n if (!callback) {\n return;\n } else if (gReadyState == 'complete' || gReadyState == 'interactive') {\n window.setTimeout(function() {\n callback();\n });\n } else if (document.addEventListener) {\n document.addEventListener('localized', function once() {\n document.removeEventListener('localized', once);\n callback();\n });\n }\n }\n };\n}) (\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"LIB\") ? {} : window,\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"LIB\") ? {} : document\n);\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getPdfFilenameFromUrl, loadScript } from \"pdfjs-lib\";\n\nasync function docProperties(pdfDocument) {\n const url = \"\",\n baseUrl = url.split(\"#\")[0];\n // eslint-disable-next-line prefer-const\n let { info, metadata, contentDispositionFilename, contentLength } =\n await pdfDocument.getMetadata();\n\n if (!contentLength) {\n const { length } = await pdfDocument.getDownloadInfo();\n contentLength = length;\n }\n\n return {\n ...info,\n baseURL: baseUrl,\n filesize: contentLength,\n filename: contentDispositionFilename || getPdfFilenameFromUrl(url),\n metadata: metadata?.getRaw(),\n authors: metadata?.get(\"dc:creator\"),\n numPages: pdfDocument.numPages,\n URL: url,\n };\n}\n\nclass GenericScripting {\n constructor(sandboxBundleSrc) {\n this._ready = loadScript(\n sandboxBundleSrc,\n /* removeScriptElement = */ true\n ).then(() => {\n return window.pdfjsSandbox.QuickJSSandbox();\n });\n }\n\n async createSandbox(data) {\n const sandbox = await this._ready;\n sandbox.create(data);\n }\n\n async dispatchEventInSandbox(event) {\n const sandbox = await this._ready;\n setTimeout(() => sandbox.dispatchEvent(event), 0);\n }\n\n async destroySandbox() {\n const sandbox = await this._ready;\n sandbox.nukeSandbox();\n }\n}\n\nexport { docProperties, GenericScripting };\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationMode, PixelsPerInch } from \"pdfjs-lib\";\nimport { PDFPrintServiceFactory, PDFViewerApplication } from \"./app.js\";\nimport { getXfaHtmlForPrinting } from \"./print_utils.js\";\n\nlet activeService = null;\nlet dialog = null;\nlet overlayManager = null;\n\n// Renders the page to the canvas of the given print service, and returns\n// the suggested dimensions of the output page.\nfunction renderPage(\n activeServiceOnEntry,\n pdfDocument,\n pageNumber,\n size,\n printResolution,\n optionalContentConfigPromise,\n printAnnotationStoragePromise\n) {\n const scratchCanvas = activeService.scratchCanvas;\n\n // The size of the canvas in pixels for printing.\n const PRINT_UNITS = printResolution / PixelsPerInch.PDF;\n scratchCanvas.width = Math.floor(size.width * PRINT_UNITS);\n scratchCanvas.height = Math.floor(size.height * PRINT_UNITS);\n\n const ctx = scratchCanvas.getContext(\"2d\");\n ctx.save();\n ctx.fillStyle = \"rgb(255, 255, 255)\";\n ctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height);\n ctx.restore();\n\n return Promise.all([\n pdfDocument.getPage(pageNumber),\n printAnnotationStoragePromise,\n ]).then(function ([pdfPage, printAnnotationStorage]) {\n const renderContext = {\n canvasContext: ctx,\n transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],\n viewport: pdfPage.getViewport({ scale: 1, rotation: size.rotation }),\n intent: \"print\",\n annotationMode: AnnotationMode.ENABLE_STORAGE,\n optionalContentConfigPromise,\n printAnnotationStorage,\n };\n return pdfPage.render(renderContext).promise;\n });\n}\n\nclass PDFPrintService {\n constructor(\n pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n optionalContentConfigPromise = null,\n printAnnotationStoragePromise = null,\n l10n\n ) {\n this.pdfDocument = pdfDocument;\n this.pagesOverview = pagesOverview;\n this.printContainer = printContainer;\n this._printResolution = printResolution || 150;\n this._optionalContentConfigPromise =\n optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();\n this._printAnnotationStoragePromise =\n printAnnotationStoragePromise || Promise.resolve();\n this.l10n = l10n;\n this.currentPage = -1;\n // The temporary canvas where renderPage paints one page at a time.\n this.scratchCanvas = document.createElement(\"canvas\");\n }\n\n layout() {\n this.throwIfInactive();\n\n const body = document.querySelector(\"body\");\n body.setAttribute(\"data-pdfjsprinting\", true);\n\n const { width, height } = this.pagesOverview[0];\n const hasEqualPageSizes = this.pagesOverview.every(\n size => size.width === width && size.height === height\n );\n if (!hasEqualPageSizes) {\n console.warn(\n \"Not all pages have the same size. The printed result may be incorrect!\"\n );\n }\n\n // Insert a @page + size rule to make sure that the page size is correctly\n // set. Note that we assume that all pages have the same size, because\n // variable-size pages are not supported yet (e.g. in Chrome & Firefox).\n // TODO(robwu): Use named pages when size calculation bugs get resolved\n // (e.g. https://crbug.com/355116) AND when support for named pages is\n // added (http://www.w3.org/TR/css3-page/#using-named-pages).\n // In browsers where @page + size is not supported, the next stylesheet\n // will be ignored and the user has to select the correct paper size in\n // the UI if wanted.\n this.pageStyleSheet = document.createElement(\"style\");\n this.pageStyleSheet.textContent = `@page { size: ${width}pt ${height}pt;}`;\n body.append(this.pageStyleSheet);\n }\n\n destroy() {\n if (activeService !== this) {\n // |activeService| cannot be replaced without calling destroy() first,\n // so if it differs then an external consumer has a stale reference to us.\n return;\n }\n this.printContainer.textContent = \"\";\n\n const body = document.querySelector(\"body\");\n body.removeAttribute(\"data-pdfjsprinting\");\n\n if (this.pageStyleSheet) {\n this.pageStyleSheet.remove();\n this.pageStyleSheet = null;\n }\n this.scratchCanvas.width = this.scratchCanvas.height = 0;\n this.scratchCanvas = null;\n activeService = null;\n ensureOverlay().then(function () {\n if (overlayManager.active === dialog) {\n overlayManager.close(dialog);\n }\n });\n }\n\n renderPages() {\n if (this.pdfDocument.isPureXfa) {\n getXfaHtmlForPrinting(this.printContainer, this.pdfDocument);\n return Promise.resolve();\n }\n\n const pageCount = this.pagesOverview.length;\n const renderNextPage = (resolve, reject) => {\n this.throwIfInactive();\n if (++this.currentPage >= pageCount) {\n renderProgress(pageCount, pageCount, this.l10n);\n resolve();\n return;\n }\n const index = this.currentPage;\n renderProgress(index, pageCount, this.l10n);\n renderPage(\n this,\n this.pdfDocument,\n /* pageNumber = */ index + 1,\n this.pagesOverview[index],\n this._printResolution,\n this._optionalContentConfigPromise,\n this._printAnnotationStoragePromise\n )\n .then(this.useRenderedPage.bind(this))\n .then(function () {\n renderNextPage(resolve, reject);\n }, reject);\n };\n return new Promise(renderNextPage);\n }\n\n useRenderedPage() {\n this.throwIfInactive();\n const img = document.createElement(\"img\");\n const scratchCanvas = this.scratchCanvas;\n if (\"toBlob\" in scratchCanvas) {\n scratchCanvas.toBlob(function (blob) {\n img.src = URL.createObjectURL(blob);\n });\n } else {\n img.src = scratchCanvas.toDataURL();\n }\n\n const wrapper = document.createElement(\"div\");\n wrapper.className = \"printedPage\";\n wrapper.append(img);\n this.printContainer.append(wrapper);\n\n return new Promise(function (resolve, reject) {\n img.onload = resolve;\n img.onerror = reject;\n });\n }\n\n performPrint() {\n this.throwIfInactive();\n return new Promise(resolve => {\n // Push window.print in the macrotask queue to avoid being affected by\n // the deprecation of running print() code in a microtask, see\n // https://github.com/mozilla/pdf.js/issues/7547.\n setTimeout(() => {\n if (!this.active) {\n resolve();\n return;\n }\n print.call(window);\n // Delay promise resolution in case print() was not synchronous.\n setTimeout(resolve, 20); // Tidy-up.\n }, 0);\n });\n }\n\n get active() {\n return this === activeService;\n }\n\n throwIfInactive() {\n if (!this.active) {\n throw new Error(\"This print request was cancelled or completed.\");\n }\n }\n}\n\nconst print = window.print;\nwindow.print = function () {\n if (activeService) {\n console.warn(\"Ignored window.print() because of a pending print job.\");\n return;\n }\n ensureOverlay().then(function () {\n if (activeService) {\n overlayManager.open(dialog);\n }\n });\n\n try {\n dispatchEvent(\"beforeprint\");\n } finally {\n if (!activeService) {\n console.error(\"Expected print service to be initialized.\");\n ensureOverlay().then(function () {\n if (overlayManager.active === dialog) {\n overlayManager.close(dialog);\n }\n });\n return; // eslint-disable-line no-unsafe-finally\n }\n const activeServiceOnEntry = activeService;\n activeService\n .renderPages()\n .then(function () {\n return activeServiceOnEntry.performPrint();\n })\n .catch(function () {\n // Ignore any error messages.\n })\n .then(function () {\n // aborts acts on the \"active\" print request, so we need to check\n // whether the print request (activeServiceOnEntry) is still active.\n // Without the check, an unrelated print request (created after aborting\n // this print request while the pages were being generated) would be\n // aborted.\n if (activeServiceOnEntry.active) {\n abort();\n }\n });\n }\n};\n\nfunction dispatchEvent(eventType) {\n const event = new CustomEvent(eventType, {\n bubbles: false,\n cancelable: false,\n detail: \"custom\",\n });\n window.dispatchEvent(event);\n}\n\nfunction abort() {\n if (activeService) {\n activeService.destroy();\n dispatchEvent(\"afterprint\");\n }\n}\n\nfunction renderProgress(index, total, l10n) {\n if (typeof PDFJSDev === \"undefined\" && window.isGECKOVIEW) {\n return;\n }\n dialog ||= document.getElementById(\"printServiceDialog\");\n const progress = Math.round((100 * index) / total);\n const progressBar = dialog.querySelector(\"progress\");\n const progressPerc = dialog.querySelector(\".relative-progress\");\n progressBar.value = progress;\n l10n.get(\"print_progress_percent\", { progress }).then(msg => {\n progressPerc.textContent = msg;\n });\n}\n\nwindow.addEventListener(\n \"keydown\",\n function (event) {\n // Intercept Cmd/Ctrl + P in all browsers.\n // Also intercept Cmd/Ctrl + Shift + P in Chrome and Opera\n if (\n event.keyCode === /* P= */ 80 &&\n (event.ctrlKey || event.metaKey) &&\n !event.altKey &&\n (!event.shiftKey || window.chrome || window.opera)\n ) {\n window.print();\n\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n },\n true\n);\n\nif (\"onbeforeprint\" in window) {\n // Do not propagate before/afterprint events when they are not triggered\n // from within this polyfill. (FF / Chrome 63+).\n const stopPropagationIfNeeded = function (event) {\n if (event.detail !== \"custom\") {\n event.stopImmediatePropagation();\n }\n };\n window.addEventListener(\"beforeprint\", stopPropagationIfNeeded);\n window.addEventListener(\"afterprint\", stopPropagationIfNeeded);\n}\n\nlet overlayPromise;\nfunction ensureOverlay() {\n if (typeof PDFJSDev === \"undefined\" && window.isGECKOVIEW) {\n return Promise.reject(\n new Error(\"ensureOverlay not implemented in GECKOVIEW development mode.\")\n );\n }\n if (!overlayPromise) {\n overlayManager = PDFViewerApplication.overlayManager;\n if (!overlayManager) {\n throw new Error(\"The overlay manager has not yet been initialized.\");\n }\n dialog ||= document.getElementById(\"printServiceDialog\");\n\n overlayPromise = overlayManager.register(\n dialog,\n /* canForceClose = */ true\n );\n\n document.getElementById(\"printCancel\").onclick = abort;\n dialog.addEventListener(\"close\", abort);\n }\n return overlayPromise;\n}\n\nPDFPrintServiceFactory.instance = {\n supportsPrinting: true,\n\n createPrintService(\n pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n optionalContentConfigPromise,\n printAnnotationStoragePromise,\n l10n\n ) {\n if (activeService) {\n throw new Error(\"The print service is created and active.\");\n }\n activeService = new PDFPrintService(\n pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n optionalContentConfigPromise,\n printAnnotationStoragePromise,\n l10n\n );\n return activeService;\n },\n};\n\nexport { PDFPrintService };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getXfaPageViewport, PixelsPerInch } from \"pdfjs-lib\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\nimport { XfaLayerBuilder } from \"./xfa_layer_builder.js\";\n\nfunction getXfaHtmlForPrinting(printContainer, pdfDocument) {\n const xfaHtml = pdfDocument.allXfaHtml;\n const linkService = new SimpleLinkService();\n const scale = Math.round(PixelsPerInch.PDF_TO_CSS_UNITS * 100) / 100;\n\n for (const xfaPage of xfaHtml.children) {\n const page = document.createElement(\"div\");\n page.className = \"xfaPrintedPage\";\n printContainer.append(page);\n\n const builder = new XfaLayerBuilder({\n pageDiv: page,\n pdfPage: null,\n annotationStorage: pdfDocument.annotationStorage,\n linkService,\n xfaHtml: xfaPage,\n });\n const viewport = getXfaPageViewport(xfaPage, { scale });\n\n builder.render(viewport, \"print\");\n }\n}\n\nexport { getXfaHtmlForPrinting };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport \"web-com\";\nimport \"web-print_service\";\nimport { RenderingStates, ScrollMode, SpreadMode } from \"./ui_utils.js\";\nimport { AppOptions } from \"./app_options.js\";\nimport { LinkTarget } from \"./pdf_link_service.js\";\nimport { PDFViewerApplication } from \"./app.js\";\n\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsVersion =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : void 0;\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsBuild =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : void 0;\n\nconst AppConstants =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? { LinkTarget, RenderingStates, ScrollMode, SpreadMode }\n : null;\n\nwindow.PDFViewerApplication = PDFViewerApplication;\nwindow.PDFViewerApplicationConstants = AppConstants;\nwindow.PDFViewerApplicationOptions = AppOptions;\n\nfunction getViewerConfiguration() {\n return {\n appContainer: document.body,\n mainContainer: document.getElementById(\"viewerContainer\"),\n viewerContainer: document.getElementById(\"viewer\"),\n toolbar: {\n container: document.getElementById(\"toolbarViewer\"),\n numPages: document.getElementById(\"numPages\"),\n pageNumber: document.getElementById(\"pageNumber\"),\n scaleSelect: document.getElementById(\"scaleSelect\"),\n customScaleOption: document.getElementById(\"customScaleOption\"),\n previous: document.getElementById(\"previous\"),\n next: document.getElementById(\"next\"),\n zoomIn: document.getElementById(\"zoomIn\"),\n zoomOut: document.getElementById(\"zoomOut\"),\n viewFind: document.getElementById(\"viewFind\"),\n openFile:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? document.getElementById(\"openFile\")\n : null,\n print: document.getElementById(\"print\"),\n editorFreeTextButton: document.getElementById(\"editorFreeText\"),\n editorFreeTextParamsToolbar: document.getElementById(\n \"editorFreeTextParamsToolbar\"\n ),\n editorInkButton: document.getElementById(\"editorInk\"),\n editorInkParamsToolbar: document.getElementById(\"editorInkParamsToolbar\"),\n editorStampButton: document.getElementById(\"editorStamp\"),\n editorStampParamsToolbar: document.getElementById(\n \"editorStampParamsToolbar\"\n ),\n download: document.getElementById(\"download\"),\n },\n secondaryToolbar: {\n toolbar: document.getElementById(\"secondaryToolbar\"),\n toggleButton: document.getElementById(\"secondaryToolbarToggle\"),\n presentationModeButton: document.getElementById(\"presentationMode\"),\n openFileButton:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? document.getElementById(\"secondaryOpenFile\")\n : null,\n printButton: document.getElementById(\"secondaryPrint\"),\n downloadButton: document.getElementById(\"secondaryDownload\"),\n viewBookmarkButton: document.getElementById(\"viewBookmark\"),\n firstPageButton: document.getElementById(\"firstPage\"),\n lastPageButton: document.getElementById(\"lastPage\"),\n pageRotateCwButton: document.getElementById(\"pageRotateCw\"),\n pageRotateCcwButton: document.getElementById(\"pageRotateCcw\"),\n cursorSelectToolButton: document.getElementById(\"cursorSelectTool\"),\n cursorHandToolButton: document.getElementById(\"cursorHandTool\"),\n scrollPageButton: document.getElementById(\"scrollPage\"),\n scrollVerticalButton: document.getElementById(\"scrollVertical\"),\n scrollHorizontalButton: document.getElementById(\"scrollHorizontal\"),\n scrollWrappedButton: document.getElementById(\"scrollWrapped\"),\n spreadNoneButton: document.getElementById(\"spreadNone\"),\n spreadOddButton: document.getElementById(\"spreadOdd\"),\n spreadEvenButton: document.getElementById(\"spreadEven\"),\n documentPropertiesButton: document.getElementById(\"documentProperties\"),\n },\n sidebar: {\n // Divs (and sidebar button)\n outerContainer: document.getElementById(\"outerContainer\"),\n sidebarContainer: document.getElementById(\"sidebarContainer\"),\n toggleButton: document.getElementById(\"sidebarToggle\"),\n resizer: document.getElementById(\"sidebarResizer\"),\n // Buttons\n thumbnailButton: document.getElementById(\"viewThumbnail\"),\n outlineButton: document.getElementById(\"viewOutline\"),\n attachmentsButton: document.getElementById(\"viewAttachments\"),\n layersButton: document.getElementById(\"viewLayers\"),\n // Views\n thumbnailView: document.getElementById(\"thumbnailView\"),\n outlineView: document.getElementById(\"outlineView\"),\n attachmentsView: document.getElementById(\"attachmentsView\"),\n layersView: document.getElementById(\"layersView\"),\n // View-specific options\n outlineOptionsContainer: document.getElementById(\n \"outlineOptionsContainer\"\n ),\n currentOutlineItemButton: document.getElementById(\"currentOutlineItem\"),\n },\n findBar: {\n bar: document.getElementById(\"findbar\"),\n toggleButton: document.getElementById(\"viewFind\"),\n findField: document.getElementById(\"findInput\"),\n highlightAllCheckbox: document.getElementById(\"findHighlightAll\"),\n caseSensitiveCheckbox: document.getElementById(\"findMatchCase\"),\n matchDiacriticsCheckbox: document.getElementById(\"findMatchDiacritics\"),\n entireWordCheckbox: document.getElementById(\"findEntireWord\"),\n findMsg: document.getElementById(\"findMsg\"),\n findResultsCount: document.getElementById(\"findResultsCount\"),\n findPreviousButton: document.getElementById(\"findPrevious\"),\n findNextButton: document.getElementById(\"findNext\"),\n },\n passwordOverlay: {\n dialog: document.getElementById(\"passwordDialog\"),\n label: document.getElementById(\"passwordText\"),\n input: document.getElementById(\"password\"),\n submitButton: document.getElementById(\"passwordSubmit\"),\n cancelButton: document.getElementById(\"passwordCancel\"),\n },\n documentProperties: {\n dialog: document.getElementById(\"documentPropertiesDialog\"),\n closeButton: document.getElementById(\"documentPropertiesClose\"),\n fields: {\n fileName: document.getElementById(\"fileNameField\"),\n fileSize: document.getElementById(\"fileSizeField\"),\n title: document.getElementById(\"titleField\"),\n author: document.getElementById(\"authorField\"),\n subject: document.getElementById(\"subjectField\"),\n keywords: document.getElementById(\"keywordsField\"),\n creationDate: document.getElementById(\"creationDateField\"),\n modificationDate: document.getElementById(\"modificationDateField\"),\n creator: document.getElementById(\"creatorField\"),\n producer: document.getElementById(\"producerField\"),\n version: document.getElementById(\"versionField\"),\n pageCount: document.getElementById(\"pageCountField\"),\n pageSize: document.getElementById(\"pageSizeField\"),\n linearized: document.getElementById(\"linearizedField\"),\n },\n },\n altTextDialog: {\n dialog: document.getElementById(\"altTextDialog\"),\n optionDescription: document.getElementById(\"descriptionButton\"),\n optionDecorative: document.getElementById(\"decorativeButton\"),\n textarea: document.getElementById(\"descriptionTextarea\"),\n cancelButton: document.getElementById(\"altTextCancel\"),\n saveButton: document.getElementById(\"altTextSave\"),\n },\n annotationEditorParams: {\n editorFreeTextFontSize: document.getElementById(\"editorFreeTextFontSize\"),\n editorFreeTextColor: document.getElementById(\"editorFreeTextColor\"),\n editorInkColor: document.getElementById(\"editorInkColor\"),\n editorInkThickness: document.getElementById(\"editorInkThickness\"),\n editorInkOpacity: document.getElementById(\"editorInkOpacity\"),\n editorStampAddImage: document.getElementById(\"editorStampAddImage\"),\n },\n printContainer: document.getElementById(\"printContainer\"),\n openFileInput:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? document.getElementById(\"fileInput\")\n : null,\n debuggerScriptPath: \"./debugger.js\",\n };\n}\n\nfunction webViewerLoad() {\n const config = getViewerConfiguration();\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\")) {\n // Give custom implementations of the default viewer a simpler way to\n // set various `AppOptions`, by dispatching an event once all viewer\n // files are loaded but *before* the viewer initialization has run.\n const event = new CustomEvent(\"webviewerloaded\", {\n bubbles: true,\n cancelable: true,\n detail: {\n source: window,\n },\n });\n try {\n // Attempt to dispatch the event at the embedding `document`,\n // in order to support cases where the viewer is embedded in\n // a *dynamically* created <iframe> element.\n parent.document.dispatchEvent(event);\n } catch (ex) {\n // The viewer could be in e.g. a cross-origin <iframe> element,\n // fallback to dispatching the event at the current `document`.\n console.error(`webviewerloaded: ${ex}`);\n document.dispatchEvent(event);\n }\n }\n PDFViewerApplication.run(config);\n}\n\n// Block the \"load\" event until all pages are loaded, to ensure that printing\n// works in Firefox; see https://bugzilla.mozilla.org/show_bug.cgi?id=1618553\ndocument.blockUnblockOnload?.(true);\n\nif (\n document.readyState === \"interactive\" ||\n document.readyState === \"complete\"\n) {\n webViewerLoad();\n} else {\n document.addEventListener(\"DOMContentLoaded\", webViewerLoad, true);\n}\n\nexport {\n PDFViewerApplication,\n AppConstants as PDFViewerApplicationConstants,\n AppOptions as PDFViewerApplicationOptions,\n};\n"],"names":["_app","require","_preferences","_download_manager","_genericl10n","_generic_scripting","GenericCom","exports","GenericPreferences","BasePreferences","_writeToStorage","prefObj","localStorage","setItem","JSON","stringify","_readFromStorage","parse","getItem","GenericExternalServices","DefaultExternalServices","createDownloadManager","DownloadManager","createPreferences","createL10n","_ref","locale","GenericL10n","createScripting","_ref2","sandboxBundleSrc","GenericScripting","PDFViewerApplication","externalServices","$","DESCRIPTORS","global","getBuiltIn","uncurryThis","call","isCallable","isObject","isArray","hasOwn","toString","lengthOfArrayLike","createProperty","fails","parseJSONString","NATIVE_SYMBOL","Number","SyntaxError","nativeParse","enumerableOwnProperties","getOwnPropertyDescriptor","Object","at","charAt","slice","exec","push","IS_DIGIT","IS_NON_ZERO_DIGIT","IS_NUMBER_START","IS_WHITESPACE","PRIMITIVE","OBJECT","$parse","source","reviver","context","Context","root","value","endIndex","skip","end","length","internalize","holder","name","node","val","unmodified","elementRecordsLen","keys","len","i","P","nodeIsArray","nodes","internalizeProperty","undefined","object","key","descriptor","configurable","Node","index","prototype","fork","nextIndex","chr","number","array","string","keyword","type","start","expectKeypair","until","result","expectElement","parsed","startIndex","exponentStartIndex","regex","j","NO_SOURCE_SUPPORT","unsafeInt","PROPER_BASE_PARSE","Infinity","target","stat","forced","text","f","createNonEnumerableProperty","defineBuiltIn","defineGlobalProperty","copyConstructorProperties","isForced","module","options","TARGET","GLOBAL","STATIC","FORCED","targetProperty","sourceProperty","dontCallGetSet","sham","check","it","Math","globalThis","window","self","Function","propertyIsEnumerableModule","createPropertyDescriptor","toIndexedObject","toPropertyKey","IE8_DOM_DEFINE","$getOwnPropertyDescriptor","O","error","defineProperty","get","NATIVE_BIND","bind","apply","arguments","test","hasOwnProperty","$propertyIsEnumerable","propertyIsEnumerable","NASHORN_BUG","V","enumerable","bitmap","writable","IndexedObject","requireObjectCoercible","classof","$Object","split","FunctionPrototype","uncurryThisWithBind","fn","stringSlice","isNullOrUndefined","$TypeError","TypeError","toPrimitive","isSymbol","argument","getMethod","ordinaryToPrimitive","wellKnownSymbol","TO_PRIMITIVE","input","pref","exoticToPrim","$documentAll","documentAll","all","IS_HTMLDDA","document","isPrototypeOf","USE_SYMBOL_AS_UID","$Symbol","aFunction","namespace","method","Symbol","iterator","V8_VERSION","$String","String","getOwnPropertySymbols","symbol","userAgent","process","Deno","versions","version","v8","match","navigator","aCallable","func","tryToString","valueOf","shared","uid","WellKnownSymbolsStore","createWellKnownSymbol","withoutSetter","IS_PURE","store","mode","copyright","license","SHARED","toObject","id","postfix","random","createElement","a","EXISTS","definePropertyModule","V8_PROTOTYPE_DEFINE_BUG","anObject","$defineProperty","ENUMERABLE","CONFIGURABLE","WRITABLE","Attributes","current","makeBuiltIn","simple","unsafe","nonConfigurable","nonWritable","CONFIGURABLE_FUNCTION_NAME","inspectSource","InternalStateModule","enforceInternalState","enforce","getInternalState","replace","join","CONFIGURABLE_LENGTH","TEMPLATE","getter","setter","arity","constructor","state","getDescriptor","PROPER","something","functionToString","NATIVE_WEAK_MAP","sharedKey","hiddenKeys","OBJECT_ALREADY_INITIALIZED","WeakMap","set","has","getterFor","TYPE","metadata","facade","STATE","ownKeys","getOwnPropertyDescriptorModule","exceptions","getOwnPropertyNamesModule","getOwnPropertySymbolsModule","concat","internalObjectKeys","enumBugKeys","getOwnPropertyNames","indexOf","names","toAbsoluteIndex","createMethod","IS_INCLUDES","$this","el","fromIndex","includes","toIntegerOrInfinity","max","min","integer","trunc","ceil","floor","x","n","toLength","obj","replacement","feature","detection","data","normalize","POLYFILL","NATIVE","toLowerCase","Array","TO_STRING_TAG_SUPPORT","classofRaw","TO_STRING_TAG","CORRECT_ARGUMENTS","tryGet","tag","callee","propertyKey","$SyntaxError","$parseInt","parseInt","fromCharCode","codePoints","IS_4_HEX_DIGITS","IS_C0_CONTROL_CODE","unterminated","twoChars","fourHexDigits","_ui_utils","_pdfjsLib","_app_options","_event_utils","_pdf_link_service","_webAlt_text_manager","_webAnnotation_editor_params","_overlay_manager","_password_prompt","_webPdf_attachment_viewer","_webPdf_cursor_tools","_webPdf_document_properties","_webPdf_find_bar","_pdf_find_controller","_pdf_history","_webPdf_layer_viewer","_webPdf_outline_viewer","_webPdf_presentation_mode","_pdf_rendering_queue","_pdf_scripting_manager","_webPdf_sidebar","_webPdf_thumbnail_viewer","_pdf_viewer","_webSecondary_toolbar","_webToolbar","_view_history","FORCE_PAGES_LOADED_TIMEOUT","WHEEL_ZOOM_DISABLED_TIMEOUT","ViewOnLoad","UNKNOWN","PREVIOUS","INITIAL","ViewerCssTheme","AUTOMATIC","LIGHT","DARK","Error","updateFindControlState","updateFindMatchesCount","initPassiveLoading","callbacks","reportTelemetry","supportsPinchToZoom","shadow","supportsIntegratedFind","supportsDocumentFonts","supportedMouseWheelZoomModifierKeys","ctrlKey","metaKey","isInAutomation","updateEditorStates","canvasMaxAreaInBytes","getNimbusExperimentData","Promise","resolve","initialBookmark","location","hash","substring","_initializedCapability","PromiseCapability","appConfig","pdfDocument","pdfLoadingTask","printService","pdfViewer","pdfThumbnailViewer","pdfRenderingQueue","pdfPresentationMode","pdfDocumentProperties","pdfLinkService","pdfHistory","pdfSidebar","pdfOutlineViewer","pdfAttachmentViewer","pdfLayerViewer","pdfCursorTools","pdfScriptingManager","downloadManager","overlayManager","preferences","toolbar","secondaryToolbar","eventBus","l10n","annotationEditorParams","isInitialViewSet","downloadComplete","isViewerEmbedded","parent","url","baseUrl","_downloadUrl","_boundEvents","create","documentInfo","_contentDispositionFilename","_contentLength","_saveInProgress","_wheelUnusedTicks","_wheelUnusedFactor","_touchUnusedTicks","_touchUnusedFactor","_PDFBug","_hasAnnotationEditors","_title","title","_printAnnotationStoragePromise","_touchInfo","_isCtrlKeyDown","_nimbusDataPromise","initialize","_initializeOptions","_forceCssTheme","_initializeL10n","AppOptions","LinkTarget","NONE","TOP","_initializeViewerComponents","bindEvents","bindWindowEvents","appContainer","documentElement","translate","then","dispatch","_parseHashParams","_hasUserOptions","console","warn","setAll","getAll","reason","message","mainContainer","viewerContainer","params","parseQueryString","loadFakeWorker","ex","TextLayerMode","DISABLE","classList","add","loadPDFBug","loadCSS","enabled","init","dir","getDirection","getElementsByTagName","cssTheme","values","styleSheet","styleSheets","cssRules","ii","rule","CSSMediaRule","media","deleteRule","darkRules","cssText","insertRule","AutomationEventBus","EventBus","OverlayManager","PDFRenderingQueue","onIdle","_cleanup","PDFLinkService","externalLinkTarget","externalLinkRel","ignoreDestinationZoom","findController","PDFFindController","linkService","updateMatchesCountOnProgress","PDFScriptingManager","docProperties","_scriptingDocProperties","container","viewer","annotationEditorMode","isOffscreenCanvasSupported","FeatureTest","pageColors","matchMedia","matches","background","foreground","altTextManager","altTextDialog","AltTextManager","PDFViewer","renderingQueue","scriptingManager","textLayerMode","annotationMode","imageResourcesPath","enablePrintAutoRotate","maxCanvasPixels","enablePermissions","setViewer","sidebar","thumbnailView","PDFThumbnailViewer","setThumbnailViewer","PDFHistory","setHistory","findBar","PDFFindBar","AnnotationEditorType","editorStampButton","remove","AnnotationEditorParams","getElementById","documentProperties","PDFDocumentProperties","_docFilename","cursorHandToolButton","PDFCursorTools","cursorToolOnLoad","Toolbar","SecondaryToolbar","supportsFullscreen","presentationModeButton","PDFPresentationMode","passwordOverlay","passwordPrompt","PasswordPrompt","outlineView","PDFOutlineViewer","attachmentsView","PDFAttachmentViewer","layersView","PDFLayerViewer","PDFSidebar","elements","onToggled","forceRendering","onUpdateThumbnails","pageView","getCachedPageViews","renderingState","RenderingStates","FINISHED","getThumbnail","setImage","scrollThumbnailIntoView","currentPageNumber","run","config","file","queryString","search","validateFileURL","fileInput","openFileInput","addEventListener","evt","files","preventDefault","dataTransfer","dropEffect","effectAllowed","msg","supportsPrinting","print","printButton","viewFind","open","_hideViewBookmark","initialized","settled","initializedPromise","promise","zoomIn","steps","scaleFactor","isInPresentationMode","increaseScale","drawingDelay","zoomOut","decreaseScale","zoomReset","currentScaleValue","DEFAULT_SCALE_VALUE","pagesCount","numPages","page","PDFPrintServiceFactory","instance","fullscreenEnabled","loadingBar","barElement","bar","ProgressBar","setTitleUsingUrl","downloadUrl","isDataScheme","getPdfFilenameFromUrl","decodeURIComponent","getFilenameFromUrl","setTitle","editorIndicator","printing","viewBookmarkButton","contains","close","_unblockDocumentLoadEvent","annotationStorage","size","_annotationStorageModified","save","promises","destroy","setDocument","externalLinkEnabled","destroyPromise","reset","cleanup","args","deprecatedArgs","byteLength","workerParams","OptionKind","WORKER","assign","GlobalWorkerOptions","originalUrl","apiParams","API","loadingTask","getDocument","onPassword","updateCallback","setUpdateCallback","onProgress","loaded","total","progress","load","InvalidPDFException","MissingPDFException","UnexpectedResponseException","_documentError","_ensureDownloadComplete","download","filename","getData","blob","Blob","dispatchWillSave","saveDocument","dispatchDidSave","downloadOrSave","openInExternalApp","moreInfo","_otherError","moreInfoText","build","stack","lineNumber","level","percent","round","loadingParams","disableAutoFetch","setDisableAutoFetch","getDownloadInfo","hide","firstPagePromise","pageLayoutPromise","getPageLayout","catch","pageModePromise","getPageMode","openActionPromise","getOpenAction","setPagesCount","onePageRendered","pagesPromise","storedPromise","ViewHistory","fingerprints","getMultiple","zoom","scrollLeft","scrollTop","rotation","sidebarView","SidebarView","scrollMode","ScrollMode","spreadMode","SpreadMode","pdfPage","setWidth","_initializeAnnotationStorageCallbacks","animationStarted","_ref3","timeStamp","stored","pageLayout","pageMode","openAction","viewOnLoad","_initializePdfHistory","fingerprint","initialDest","dest","apiPageModeToSidebarView","modes","apiPageLayoutToViewerModes","setInitialView","focus","race","setTimeout","hasEqualPageSizes","update","_initializeAutoPrint","timestamp","getOutline","outline","render","getAttachments","attachments","optionalContentConfigPromise","optionalContentConfig","_initializePageLabels","_initializeMetadata","_on","once","baseURL","filesize","getRaw","authors","URL","jsActions","enableScripting","getJSActions","triggerAutoPrint","action","some","js","AutoPrintRegExp","triggerPrinting","info","contentDispositionFilename","contentLength","getMetadata","log","PDFFormatVersion","Producer","trim","Creator","pdfTitle","Title","metadataTitle","IsXFAPresent","IsAcroFormPresent","isPureXfa","enableXfa","renderForms","IsSignaturesPresent","labels","getPageLabels","numLabels","standardLabels","emptyLabels","label","setPageLabels","setPageNumber","currentPageLabel","_ref4","resetHistory","updateUrl","initialRotation","explicitDest","pageNumber","onSetModified","beforeUnload","onResetModified","removeEventListener","onAnnotationEditor","typeStr","storedHash","setRotation","angle","isValidRotation","pagesRotation","setViewerModes","scroll","spread","isValidScrollMode","isValidSpreadMode","setHash","isThumbnailViewEnabled","visibleView","THUMBS","renderHighestPriority","beforePrint","dispatchWillPrint","pageViewsReady","alert","pagesOverview","getPagesOverview","printContainer","printResolution","createPrintService","layout","afterPrint","dispatchDidPrint","resetModified","rotatePages","delta","requestPresentationMode","request","webViewerResize","webViewerHashchange","webViewerPageRender","webViewerPageRendered","webViewerUpdateViewarea","webViewerPageChanging","webViewerScaleChanging","webViewerRotationChanging","webViewerSidebarViewChanged","webViewerPageMode","webViewerNamedAction","webViewerPresentationModeChanged","webViewerPresentationMode","webViewerSwitchAnnotationEditorMode","webViewerSwitchAnnotationEditorParams","webViewerPrint","webViewerDownload","webViewerOpenInExternalApp","webViewerFirstPage","webViewerLastPage","webViewerNextPage","webViewerPreviousPage","webViewerZoomIn","webViewerZoomOut","webViewerZoomReset","webViewerPageNumberChanged","webViewerScaleChanged","webViewerRotateCw","webViewerRotateCcw","webViewerOptionalContentConfig","webViewerSwitchScrollMode","webViewerScrollModeChanged","webViewerSwitchSpreadMode","webViewerSpreadModeChanged","webViewerDocumentProperties","webViewerFindFromUrlHash","webViewerUpdateFindMatchesCount","webViewerUpdateFindControlState","reportPageStatsPDFBug","webViewerFileInputChange","webViewerOpenFile","addWindowResolutionChange","webViewerResolutionChange","mediaQueryList","devicePixelRatio","removeWindowResolutionChange","windowResize","windowHashChange","windowBeforePrint","windowAfterPrint","windowUpdateFromSandbox","event","detail","webViewerVisibilityChange","webViewerWheel","passive","webViewerTouchStart","webViewerTouchMove","webViewerTouchEnd","webViewerClick","webViewerKeyDown","webViewerKeyUp","unbindEvents","_off","unbindWindowEvents","_accumulateTicks","ticks","prop","wholeTicks","_accumulateFactor","previousScale","factor","newFactor","_centerAtPos","y","scaleDiff","currentScale","top","left","containerTopLeft","blockUnblockOnload","scriptingReady","ready","HOSTED_VIEWER_ORIGINS","viewerOrigin","href","origin","fileOrigin","workerSrc","loadScript","PDFWorker","debuggerScriptPath","PDFBug","import","_ref5","Stats","getPageView","stats","_ref6","updateLoadingIndicatorState","_ref7","_ref8","view","OUTLINE","ATTACHMENTS","LAYERS","switchView","select","toggle","presentationModeState","_ref9","_ref10","setMultiple","scale","getAnchorUrl","pdfOpenParams","popStateInProgress","createObjectURL","click","nextPage","previousPage","goToPage","query","caseSensitive","entireWord","highlightAll","findPrevious","matchDiacritics","_ref11","matchesCount","updateResultsCount","_ref12","previous","rawQuery","updateUIState","setPageScale","presetValue","_ref13","pageLabel","currentPage","RUNNING","refresh","visibilityState","setZoomDisabledTimeout","zoomDisabledTimeout","clearTimeout","deltaMode","exp","deltaY","isBuiltInMac","isPinchToZoom","WheelEvent","DOM_DELTA_PIXEL","deltaX","abs","deltaZ","active","normalizeWheelEventDirection","DOM_DELTA_LINE","DOM_DELTA_PAGE","sign","PIXELS_PER_LINE_SCALE","clientX","clientY","touches","touch0","touch1","identifier","touch0X","pageX","touch0Y","pageY","touch1X","touch1Y","page0X","page0Y","page1X","page1Y","pTouch0X","pTouch0Y","pTouch1X","pTouch1Y","v1X","v1Y","v2X","v2Y","det","hypot","diff0X","diff1X","diff0Y","diff1Y","dotProduct","distance","pDistance","newScaleFactor","isOpen","containsElement","toggleButton","isViewerInPresentationMode","handled","ensureViewerFocused","cmd","altKey","shiftKey","keyCode","newState","curElement","getActiveOrFocusedElement","curElementTagName","tagName","toUpperCase","isContentEditable","turnPage","turnOnlyIfPageFit","isVerticalScrollbarEnabled","isHorizontalScrollbarEnabled","opened","switchTool","CursorTool","SELECT","HAND","returnValue","webViewerAnnotationEditorStatesChanged","webViewerReportTelemetry","_ref14","details","wrapErrorConstructorWithCause","WEB_ASSEMBLY","WebAssembly","cause","exportGlobalErrorCauseWrapper","ERROR_NAME","wrapper","exportWebAssemblyErrorCauseWrapper","EvalError","RangeError","ReferenceError","URIError","CompileError","LinkError","RuntimeError","Reflect","setPrototypeOf","proxyAccessor","inheritIfRequired","normalizeStringArgument","installErrorCause","installErrorStack","FULL_NAME","IS_AGGREGATE_ERROR","STACK_TRACE_LIMIT","OPTIONS_POSITION","path","OriginalError","OriginalErrorPrototype","BaseError","WrappedError","b","uncurryThisAccessor","aPossiblePrototype","CORRECT_SETTER","proto","__proto__","Target","Source","dummy","Wrapper","NewTarget","NewTargetPrototype","$default","clearErrorStack","ERROR_STACK_INSTALLABLE","captureStackTrace","C","dropEntries","$Error","TEST","arg","V8_OR_CHAKRA_STACK_ENTRY","IS_V8_OR_CHAKRA_STACK","prepareStackTrace","setArrayLength","doesNotExceedSafeInteger","INCORRECT_TO_LENGTH","properErrorOnNonWritableLength","item","argCount","SILENT_ON_NON_WRITABLE_LENGTH_SET","MAX_SAFE_INTEGER","validateArgumentsLength","$URLSearchParams","URLSearchParams","URLSearchParamsPrototype","append","$delete","forEach","$value","entries","v","k","dindex","found","entriesLength","entry","passed","required","$has","defineBuiltInAccessor","count","DEFAULT_SCALE","DEFAULT_SCALE_DELTA","MIN_SCALE","MAX_SCALE","UNKNOWN_SCALE","MAX_AUTO_SCALE","SCROLLBAR_PADDING","VERTICAL_PADDING","PAUSED","PresentationModeState","NORMAL","CHANGING","FULLSCREEN","ENABLE","ENABLE_PERMISSIONS","VERTICAL","HORIZONTAL","WRAPPED","PAGE","ODD","EVEN","ZOOM","OutputScale","pixelRatio","sx","sy","scaled","scrollIntoView","element","spot","scrollMatches","offsetParent","offsetY","offsetTop","clientTop","offsetX","offsetLeft","clientLeft","clientHeight","scrollHeight","clientWidth","scrollWidth","getComputedStyle","overflow","watchScroll","viewAreaElement","callback","debounceScroll","rAF","requestAnimationFrame","viewAreaElementScrolled","currentX","lastX","right","currentY","lastY","down","_eventHandler","Map","InvisibleCharactersRegExp","removeNullCharacters","str","replaceInvisible","replaceAll","binarySearchFirstItem","items","condition","minIndex","maxIndex","currentIndex","currentItem","approximateFraction","xinv","limit","x_","c","d","p","q","roundToDivide","div","r","getPageSizeInches","userUnit","rotate","x1","y1","x2","y2","changeOrientation","width","height","backtrackBeforeAllVisibleElements","views","elt","pageTop","getVisibleElements","scrollEl","sortByVisibility","horizontal","rtl","bottom","isElementBottomAfterViewTop","elementBottom","isElementNextAfterViewHorizontally","elementLeft","elementRight","visible","ids","Set","numViews","firstVisibleElementInd","lastEdge","currentWidth","currentHeight","viewWidth","viewHeight","viewRight","viewBottom","hiddenHeight","hiddenWidth","fractionHeight","fractionWidth","widthPercent","first","last","sort","pc","atan2","PI","normalizeWheelEventDelta","MOUSE_PIXELS_PER_LINE","MOUSE_LINES_PER_PAGE","isInteger","isPortraitOrientation","docStyle","style","clamp","disableAutoFetchTimeout","isNaN","setProperty","parentNode","scrollbarWidth","offsetWidth","delay","show","curRoot","curActiveOrFocused","activeElement","querySelector","shadowRoot","toggleCheckedBtn","button","setAttribute","toggleExpandedBtn","difference","setMethodAcceptSetLike","real","aSet","SetHelpers","clone","getSetRecord","iterateSet","iterateSimple","other","otherRec","e","getIterator","SetPrototype","iterate","next","interruptible","record","ITERATOR_INSTEAD_OF_RECORD","step","done","getIteratorDirect","INVALID_SIZE","$RangeError","SetRecord","numSize","intSize","createSetLike","error2","intersection","INCORRECT","from","isDisjointFrom","iteratorClose","kind","innerResult","innerError","isSubsetOf","isSupersetOf","symmetricDifference","keysIter","union","pdfjsLib","compatibilityParams","platform","maxTouchPoints","isAndroid","isIOS","checkCanvasSizeLimitation","VIEWER","PREFERENCE","defaultOptions","defaultZoomDelay","defaultZoomValue","disableHistory","disablePageLabels","enableStampEditor","historyUpdateUrl","forcePageColors","pageColorsBackground","pageColorsForeground","pdfBugEnabled","sidebarViewOnLoad","scrollModeOnLoad","spreadModeOnLoad","viewerCssTheme","cMapPacked","cMapUrl","disableFontFace","disableRange","disableStream","docBaseUrl","fontExtraProperties","isEvalSupported","maxImageSize","pdfBug","standardFontDataUrl","verbosity","workerPort","defaultUrl","disablePreferences","language","userOptions","userOption","defaultOption","valueType","WaitOnType","EVENT","TIMEOUT","waitOnEventOrTimeout","reject","handler","eventHandler","timeout","timeoutHandler","listeners","on","eventName","listener","external","off","eventListeners","externalListeners","splice","DEFAULT_LINK_REL","SELF","BLANK","PARENT","addLinkAttributes","link","rel","onclick","targetStr","pagesRefCache","_ignoreDestinationZoom","clear","goToDestinationHelper","rawDest","namedDest","destRef","_cachedPageNumber","getPageIndex","pageIndex","cachePageRef","pushCurrentPosition","scrollPageIntoView","destArray","goToDestination","getDestination","pageLabelToPageNumber","pushPage","newWindow","getDestinationHash","escape","anchor","phrase","zoomArgs","zoomArg","zoomArgNumber","parseFloat","allowNegativeOffset","unescape","isValidExplicitDestination","executeNamedAction","back","forward","executeSetOCGState","operator","elem","setVisibility","group","getGroup","pageNum","pageRef","refStr","gen","num","destLength","allowNull","param","SimpleLinkService","boundUpdateUIState","boundSetPosition","setPosition","boundOnClick","onClick","currentEditor","cancelButton","dialog","hasUsedPointer","optionDescription","optionDecorative","saveButton","textarea","uiManager","previousAltText","svgElement","rectElement","telemetryData","finish","register","_elements","createSVGElement","svgFactory","DOMSVGFactory","svg","defs","mask","rect","editAltText","editor","altText","decorative","altTextData","checked","removeEditListeners","containerX","containerY","containerW","containerH","getBoundingClientRect","innerWidth","windowW","innerHeight","windowH","dialogW","dialogH","getClientDimensions","MARGIN","isLTR","direction","xs","xe","ys","ye","subtype","editorType","alt_text_keyboard","removeOnClickListeners","addEditListeners","disabled","alt_text_description","alt_text_edit","alt_text_decorative","bindListeners","editorFreeTextFontSize","editorFreeTextColor","editorInkColor","editorInkThickness","editorInkOpacity","editorStampAddImage","dispatchEvent","AnnotationEditorParamsType","valueAsNumber","FREETEXT_SIZE","FREETEXT_COLOR","INK_COLOR","INK_THICKNESS","INK_OPACITY","overlays","canForceClose","showModal","activeCapability","submitButton","_isViewerEmbedded","verify","cancel","passwordIncorrect","PasswordResponses","INCORRECT_PASSWORD","textContent","password","invokeCallback","_base_tree_viewer","BaseTreeViewer","appendAttachment","keepRenderedCapability","_attachments","_renderedCapability","_pendingDispatchEvent","_dispatchEvent","attachmentsCount","_bindLink","content","openOrDownloadData","fragment","createDocumentFragment","className","_normalizeTextContent","_finishRendering","renderedPromise","TREEITEM_OFFSET_TOP","TREEITEM_SELECTED_CLASS","_pdfDocument","_lastToggleIsShow","_currentTreeItem","_addToggleButton","hidden","toggler","stopPropagation","shouldShowAll","_toggleTreeItem","prepend","querySelectorAll","_toggleAllTreeItems","hasAnyNesting","_updateCurrentTreeItem","treeItem","_scrollToCurrentTreeItem","currentNode","firstElementChild","scrollTo","_grab_to_pan","prevActive","addEventListeners","activeTool","tool","disableActiveTool","_handTool","deactivate","activate","disableActive","enableActive","GrabToPan","CSS_CLASS_GRAB","ownerDocument","_onMouseDown","onMouseDown","_onMouseMove","onMouseMove","_endPan","endPan","overlay","ignoreTarget","originalTarget","scrollLeftStart","scrollTopStart","clientXStart","clientYStart","focusedElement","blur","buttons","xDiff","yDiff","behavior","body","DEFAULT_FIELD_CONTENT","NON_METRIC_LOCALES","US_PAGE_NAMES","METRIC_PAGE_NAMES","getPageName","isPortrait","pageNames","fieldData","fileNameLookup","fields","closeButton","_fileNameLookup","_currentPageNumber","_pagesRotation","_isNonMetricLocale","getLanguage","_dataAvailableCapability","updateUI","fileName","fileSize","creationDate","modificationDate","pageSize","isLinearized","parseFileSize","parseDate","CreationDate","ModDate","getPage","parsePageSize","parseLinearization","IsLinearized","freeze","author","Author","subject","Subject","keywords","Keywords","creator","producer","pageCount","linearized","kb","mb","size_mb","toPrecision","toLocaleString","size_kb","size_b","pageSizeInches","sizeInches","sizeMillimeters","rawName","exactMillimeters","intMillimeters","unit","orientation","inputDate","dateObject","PDFDateString","toDateObject","date","toLocaleDateString","time","toLocaleTimeString","MATCHES_COUNT_LIMIT","findField","highlightAllCheckbox","caseSensitiveCheckbox","matchDiacriticsCheckbox","entireWordCheckbox","findMsg","findResultsCount","findPreviousButton","findNextButton","adjustWidth","findPrev","status","FindState","FOUND","PENDING","NOT_FOUND","matchCountMsg","findbarHeight","inputContainerHeight","_pdf_find_utils","FIND_TIMEOUT","MATCH_SCROLL_OFFSET_TOP","MATCH_SCROLL_OFFSET_LEFT","CHARACTERS_TO_NORMALIZE","DIACRITICS_EXCEPTION","DIACRITICS_EXCEPTION_STR","DIACRITICS_REG_EXP","SPECIAL_CHARS_REG_EXP","NOT_DIACRITIC_FROM_END_REG_EXP","NOT_DIACRITIC_FROM_START_REG_EXP","SYLLABLES_REG_EXP","SYLLABLES_LENGTHS","FIRST_CHAR_SYLLABLES_REG_EXP","NFKC_CHARS_TO_NORMALIZE","noSyllablesRegExp","withSyllablesRegExp","syllablePositions","m","char","normalizationRegex","toNormalizeWithNFKC","getNormalizeWithNFKC","CJK","HKDiacritics","regexp","RegExp","rawDiacriticsPositions","normalized","positions","rawDiacriticsIndex","syllableIndex","shift","shiftOrigin","eol","hasDiacritics","p1","p2","p3","p4","p5","p6","p7","p8","jj","hasTrailingDashEOL","endsWith","newCharLen","getOriginalIndex","diffs","pos","oldStart","oldEnd","oldLen","visitedPagesCount","_linkService","_eventBus","onIsPageVisible","onFind","onFindBarClose","highlightMatches","_highlightMatches","pageMatches","_pageMatches","pageMatchesLength","_pageMatchesLength","selected","_selected","_firstPageCapability","phraseSearch","shouldDirtyMatch","_dirtyMatch","extractText","findbarClosed","pendingTimeout","_findTimeout","nextMatch","updateAllPages","scrollMatchIntoView","selectedLeft","matchIndex","_scrollMatches","matchIdx","pageIdx","_offset","wrapped","_extractTextPromises","_pageContents","_pageDiffs","_hasDiacritics","_matchesCountTotal","_pagesToSearch","_pendingFindMatches","_resumePageIdx","_rawQuery","_normalizedQuery","filter","map","newQuery","prevQuery","newType","prevType","isEntireWord","startIdx","charCodeAt","getCharacterType","calculateRegExpMatch","pageContent","matchesLength","matchPos","matchLen","convertToRegExpString","isUnicode","trailingSpaces","calculateMatch","reverse","isUnicodePart","queryPart","flags","updatePage","nextPageMatch","pageMatchesCount","updateUIResultsCount","textOptions","disableNormalization","extractTextCapability","getTextContent","strBuf","textItem","hasEOL","currentPageIndex","delete","offset","numPageMatches","updateMatch","advanceOffsetPage","matchesReady","numMatches","requestMatchesCount","CharacterType","SPACE","ALPHA_LETTER","PUNCT","HAN_LETTER","KATAKANA_LETTER","HIRAGANA_LETTER","HALFWIDTH_KATAKANA_LETTER","THAI_LETTER","isAlphabeticalScript","charCode","isAscii","isAsciiAlpha","isAsciiDigit","isAsciiSpace","isHan","isKatakana","isHiragana","isHalfwidthKatakana","isThai","NormalizeWithNFKC","HASH_CHANGE_TIMEOUT","POSITION_UPDATED_THRESHOLD","UPDATE_VIEWAREA_TIMEOUT","getCurrentHash","_initialized","_fingerprint","_isPagesLoaded","reInitialized","_updateUrl","_bindEvents","history","_popStateInProgress","_blockHashChange","_currentHash","_numPositionUpdates","_uid","_maxUid","_destination","_position","_isValidState","_parseCurrentHash","_pushOrReplaceState","destination","_updateInternalState","_initialRotation","_initialBookmark","_pageHide","_unbindEvents","_updateViewareaTimeout","_isValidPage","forceReplace","isDestHashesEqual","isDestArraysEqual","_tryPushCurrentPosition","shouldReplace","newUrl","startsWith","replaceState","pushState","temporary","position","checkReload","perfEntry","performance","getEntriesByType","removeTemporary","checkNameddest","nameddest","_updateViewarea","_popState","newHash","hashChanged","updateViewarea","popState","pageHide","destHash","pushHash","firstDest","secondDest","isEntryEqual","second","updateLayers","_optionalContentConfig","_optionalContentHash","layersCount","groupId","getHash","_setNestedName","fontStyle","groups","getOrder","queue","levelData","itemsDiv","order","getOptionalContentConfig","_currentOutlineItem","_currentOutlineItemCapability","_sidebarView","_outline","_pageNumberToDestHashCapability","outlineCount","currentOutlineItemPromise","attachment","setOCGState","_setStyles","bold","italic","fontWeight","totalCount","nestedCount","nestedItems","pageNumberToDestHash","_getPageNumberToDestHash","linkElement","pageNumberNesting","nesting","currentNesting","DELAY_BEFORE_HIDING_CONTROLS","ACTIVE_SELECTOR","CONTROLS_SELECTOR","MOUSE_SCROLL_COOLDOWN_TIME","PAGE_SWITCH_THRESHOLD","SWIPE_MIN_DISTANCE_THRESHOLD","SWIPE_ANGLE_THRESHOLD","contextMenuOpen","mouseScrollTimeStamp","mouseScrollDelta","touchSwipeState","requestFullscreen","addFullscreenChangeListeners","notifyStateChange","scaleValue","removeFullscreenChangeListeners","mouseWheel","currentTime","Date","now","storedTime","resetMouseScrollState","totalDelta","success","enter","addWindowListeners","showControls","getSelection","removeAllRanges","exit","removeWindowListeners","hideControls","mouseDown","hasAttribute","contextMenu","controlsTimeout","touchSwipe","startX","startY","endX","endY","dx","dy","absAngle","showControlsBind","mouseDownBind","mouseWheelBind","resetMouseScrollStateBind","contextMenuBind","touchSwipeBind","fullscreenChange","fullscreenElement","fullscreenChangeBind","CLEANUP_TIMEOUT","highestPriorityPage","idleTimeout","isHighestPriority","renderingId","currentlyVisiblePages","getHighestPriority","scrolledDown","preRenderExtra","visibleViews","numVisible","isViewFinished","firstId","lastId","visibleIds","holeId","holeView","preRenderIndex","preRenderView","renderView","resume","draw","finally","RenderingCancelledException","closeCapability","destroyCapability","scripting","willPrintCapability","destroyScripting","objects","calculationOrder","docActions","getFieldObjects","getCalculationOrderIds","initScripting","_internalEvents","updateFromSandbox","dispatchEventInSandbox","dispatchPageClose","dispatchPageOpen","_pageOpenPending","createSandbox","appInfo","docInfo","actions","_visitedPages","isChangingPresentationMode","siblings","command","elementId","CustomEvent","setValue","visitedPages","actionsPromise","destroySandbox","SIDEBAR_WIDTH_VAR","SIDEBAR_MIN_WIDTH","SIDEBAR_RESIZING_CLASS","UI_NOTIFICATION_CLASS","isRTL","mouseMoveBound","mouseMove","mouseUpBound","mouseUp","outerContainerWidth","isInitialEventDispatched","outerContainer","sidebarContainer","resizer","thumbnailButton","outlineButton","attachmentsButton","layersButton","_outlineOptionsContainer","outlineOptionsContainer","_currentOutlineItemButton","currentOutlineItemButton","hideUINotification","forceOpen","isViewChanged","showUINotification","onTreeLoaded","updateWidth","updated","maxWidth","_pdf_thumbnail_view","THUMBNAIL_SCROLL_MARGIN","THUMBNAIL_SELECTED_CLASS","_scrollUpdated","_resetView","_thumbnails","_getVisibleThumbs","prevThumbnailView","shouldScroll","updateArgs","thumbnail","TempImageFactory","destroyCanvas","_pageLabels","_cancelRendering","firstPdfPage","viewport","getViewport","PDFThumbnailView","defaultViewport","setPdfPage","cancelRendering","setPageLabel","ensurePdfPageLoaded","thumbView","getScrollAhead","visibleThumbs","scrollAhead","DRAW_UPSCALE_FACTOR","MAX_NUM_SCALING_STEPS","THUMBNAIL_WIDTH","tempCanvas","getCanvas","ctx","getContext","alpha","fillStyle","fillRect","restore","pdfPageRotate","_optionalContentConfigPromise","renderTask","_thumbPageTitle","updateDims","img","_placeholderImg","ratio","canvasWidth","canvasHeight","totalRotation","removeAttribute","image","replaceWith","_getPageDrawContext","upscaleFactor","canvas","outputScale","transform","_convertCanvasToImage","reducedCanvas","_reduceImage","_thumbPageCanvas","src","toDataURL","finishRenderTask","drawViewport","renderContinueCallback","cont","renderContext","canvasContext","onContinue","resultPromise","thumbnailCanvas","drawImage","reducedWidth","reducedHeight","reducedImage","reducedImageCtx","_l10n_utils","_pdf_page_view","DEFAULT_CACHE_SIZE","PagesCountLimit","FORCE_SCROLL_MODE_PAGE","FORCE_LAZY_PAGE_INIT","PAUSE_EAGER_PAGE_INIT","isValidAnnotationEditorMode","PDFPageViewBuffer","buf","destroyFirstView","resize","newSize","idsToKeep","firstView","buffer","annotationEditorUIManager","AnnotationMode","ENABLE_FORMS","copyCallbackBound","getAllTextInProgress","hiddenCopyElement","interruptCopyCondition","previousContainerHeight","resizeObserver","ResizeObserver","resizeObserverCallback","scrollModePageState","onVisibilityChange","scaleTimeoutId","viewerVersion","observe","_getVisiblePages","_scriptingManager","removePageBorders","useOnlyCssZoom","NullL10n","defaultRenderingQueue","_scrollUpdate","_onBeforeDraw","_onAfterDraw","updateContainerHeightCss","_pages","_pagesCapability","every","_setCurrentPageNumber","resetCurrentPageView","_currentScale","setScale","noScroll","_currentScaleValue","_onePageRenderedCapability","layerProperties","fieldObjectsPromise","hasJSActionsPromise","hasJSActions","initializePermissions","permissions","PermissionFlag","COPY","MODIFY_CONTENTS","MODIFY_ANNOTATIONS","FILL_INTERACTIVE_FORMS","onePageRenderedOrForceFetch","visibilityChangePromise","getAllText","texts","copyCallback","selection","focusNode","anchorNode","containsNode","savedCursor","cursor","interruptCopy","ev","clipboard","writeText","permissionsPromise","getPermissions","_scrollMode","cssTransform","before","AnnotationEditorUIManager","updateMode","viewerElement","PixelsPerInch","PDF_TO_CSS_UNITS","filterFactory","addHighlightHCMFilter","PDFPageView","firstPageView","ref","ensurePageViewVisible","_spreadMode","_updateSpreadMode","getPagesLeft","Language","lang","_location","_previousScrollMode","previousPageNumber","scrollDown","pages","_updateScrollMode","pageIndexSet","parity","dummyPage","pageSpot","isSameScale","newScale","setScaleUpdatePages","newValue","preset","postponeDrawing","pageWidthScaleFactor","hPadding","vPadding","pageWidthScale","pageHeightScale","horizontalScale","widthScale","heightScale","pageWidth","pageHeight","boundingRect","convertToViewportPoint","_updateLocation","firstPage","normalizedScaleValue","currentPageView","topLeft","getPagePoint","intLeft","intTop","visiblePages","numVisiblePages","newCacheSize","isSimpleLayout","currentId","stillFullyVisible","_isContainerRtl","initialOrientation","cloneNode","_getPageAdvance","yArray","expectedId","advance","toFixed","borderBoxSize","blockSize","editId","updateParams","noUpdate","DEFAULT_L10N_STRINGS","of_pages","page_of_pages","document_properties_kb","document_properties_mb","document_properties_date_string","document_properties_page_size_unit_inches","document_properties_page_size_unit_millimeters","document_properties_page_size_orientation_portrait","document_properties_page_size_orientation_landscape","document_properties_page_size_name_a3","document_properties_page_size_name_a4","document_properties_page_size_name_letter","document_properties_page_size_name_legal","document_properties_page_size_dimension_string","document_properties_page_size_dimension_name_string","document_properties_linearized_yes","document_properties_linearized_no","additional_layers","page_landmark","thumb_page_title","thumb_page_canvas","find_reached_top","find_reached_bottom","find_not_found","page_scale_width","page_scale_fit","page_scale_auto","page_scale_actual","page_scale_percent","loading_error","invalid_file_error","missing_file_error","unexpected_response_error","rendering_error","annotation_date_string","printing_not_supported","printing_not_ready","web_fonts_disabled","free_text2_default_content","editor_free_text2_aria_label","editor_ink2_aria_label","editor_ink_canvas_aria_label","editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip","print_progress_percent","getL10nFallback","formatL10nValue","fallback","_annotation_editor_layer_builder","_annotation_layer_builder","_struct_tree_layer_builder","_text_accessibility","_text_highlighter","_text_layer_builder","_xfa_layer_builder","MAX_CANVAS_PIXELS","DEFAULT_LAYER_PROPERTIES","hasRestrictedScaling","loadingId","previousRotation","renderError","useThumbnailCanvas","directDrawing","initialOptionalContent","regularAnnotations","viewportMap","_isStandalone","hasViewer","_container","_annotationCanvasMap","annotationLayer","annotationEditorLayer","textLayer","zoomLayer","xfaLayer","structTreeLayer","setDimensions","hasInitialVisibility","setLayerDimensions","_textHighlighter","TextHighlighter","renderAnnotationLayer","renderAnnotationEditorLayer","renderXfaLayer","textDivs","buildXfaTextContentItems","renderTextLayer","renderingDone","readableStream","streamTextContent","includeMarkedContent","setTextContentSource","AbortException","numTextDivs","renderStructTreeLayer","StructTreeLayerBuilder","tree","getStructTree","treeDom","setTextMapping","enable","_resetZoomLayer","removeFromDOM","zoomLayerCanvas","firstChild","keepZoomLayer","keepAnnotationLayer","keepAnnotationEditorLayer","keepXfaLayer","keepTextLayer","childNodes","zoomLayerNode","annotationLayerNode","annotationEditorLayerNode","xfaLayerNode","textLayerNode","onlyCssZoom","cancelExtraDelay","redrawAnnotationLayer","redrawAnnotationEditorLayer","redrawXfaLayer","redrawTextLayer","hideTextLayer","disable","originalViewport","relativeRotation","absRotation","scaleX","scaleY","convertToPdfPoint","separateAnnots","canvasWrapper","_accessibilityManager","TextAccessibilityManager","TextLayerBuilder","highlighter","accessibilityManager","AnnotationLayerBuilder","pageDiv","annotationCanvasMap","showCanvas","hasHCM","isLastShow","invScale","pixelsInViewport","maxScale","sqrt","sfx","sfy","AnnotationEditorLayerBuilder","XfaLayerBuilder","_cancelled","intent","clonedViewport","dontFlip","tabIndex","AnnotationEditorLayer","parameters","annotations","isEmpty","onPresentationModeChanged","_hasJSActionsPromise","_fieldObjectsPromise","fieldObjects","getAnnotations","AnnotationLayer","updatePresentationModeState","disableFormElements","section","inert","PDF_ROLE_TO_HTML_ROLE","Document","DocumentFragment","Part","Sect","Div","Aside","NonStruct","H","FENote","Sub","Lbl","Span","Em","Strong","Link","Annot","Form","Ruby","RB","RT","RP","Warichu","WT","WP","L","LI","LBody","Table","TR","TH","TD","THead","TBody","TFoot","Caption","Figure","Formula","Artifact","HEADING_PATTERN","structTree","walk","setAttributes","structElement","htmlElement","alt","role","children","kid","textChildren","textNodes","waitingElements","compareElementPositions","e1","e2","rect1","rect2","top1","bot1","mid1","top2","bot2","mid2","centerX1","centerX2","nodeIndex","addIdToAriaOwns","isRemovable","addPointerInTextLayer","removePointerInTextLayer","owns","getAttribute","child","moveElementInDOM","contentElement","hasChildNodes","elementToCompare","after","_onUpdateTextLayerMatches","textContentItemsStr","divs","_updateMatches","_convertMatches","iIndex","mm","begin","divIdx","_renderMatches","isSelectedPage","selectedMatchIdx","prevEnd","infinity","beginText","appendTextToDiv","fromOffset","toOffset","nodeType","TEXT_NODE","span","createTextNode","i0","i1","lastDivIdx","lastOffset","isSelected","highlightSuffix","n0","n1","clearedUntilDivIdx","textContentSource","textDivProperties","textLayerRenderTask","finishRendering","endOfContent","bindMouse","mustRotate","mustRescale","updateTextLayer","adjustTop","getPropertyValue","divBounds","clipboardData","setData","normalizeUnicode","xfaHtml","XfaLayer","getXfa","downloadButton","firstPageButton","lastPageButton","pageRotateCwButton","pageRotateCcwButton","cursorSelectToolButton","eventDetails","scrollPageButton","scrollVerticalButton","scrollHorizontalButton","scrollWrappedButton","spreadNoneButton","spreadOddButton","spreadEvenButton","documentPropertiesButton","openFileButton","lastPage","pageRotateCw","pageRotateCcw","bindClickListeners","bindCursorToolsListener","bindScrollModeListener","bindSpreadModeListener","scrollModeChanged","forceScrollModePage","isHorizontal","spreadModeChanged","PAGE_NUMBER_LOADING_INDICATOR","wasLocalized","editorFreeTextButton","FREETEXT","editorInkButton","INK","STAMP","openFile","scaleSelect","customScaleOption","hasPageLabels","pageScaleValue","pageScale","oncontextmenu","noContextMenu","adjustScaleWidth","bindEditorToolsListener","editorFreeTextParamsToolbar","editorInkParamsToolbar","editorStampParamsToolbar","editorModeChanged","isDisable","resetNumPages","predefinedValueFound","option","loading","predefinedValuesPromise","scaleSelectWidth","font","fontSize","fontFamily","predefinedValue","measureText","DEFAULT_VIEW_HISTORY_CACHE_SIZE","cacheSize","_initializedPromise","databaseStr","database","branch","properties","defaultValue","defaults","prefs","prefValue","defaultType","blobUrl","openBlobUrls","_options","createValidAbsoluteUrl","downloadData","contentType","isPdfData","isPdfFile","viewerUrl","encodeURIComponent","revokeObjectURL","PARTIAL_LANG_CODES","en","es","fy","ga","gu","hi","hy","nb","ne","nn","pa","pt","sv","zh","fixupLangCode","langCode","webL10n","_lang","_ready","setLanguage","gL10nData","gTextData","gTextProp","gLanguage","gMacros","gReadyState","gAsyncResourceLoading","getL10nResourceLinks","getL10nDictionary","script","innerHTML","getTranslatableChildren","getL10nAttributes","l10nId","l10nArgs","xhrLoadText","onSuccess","onFailure","_onSuccess","_onFailure","xhr","XMLHttpRequest","overrideMimeType","onreadystatechange","readyState","responseText","onerror","ontimeout","send","parseResource","successCallback","failureCallback","evalString","lastIndexOf","parseProperties","parsedPropertiesCallback","dictionary","reBlank","reComment","reSection","reImport","reSplit","parseRawLines","rawText","extendedSyntax","parsedRawLinesCallback","currentLang","genericLang","skipLang","nextEntry","line","loadImport","tmp","response","loadLocale","_callback","langLinks","langCount","dict","locales","default_locale","defaultLocale","anyCaseLang","onResourceLoaded","gResourceCount","L10nResourceLink","resource","getPluralRules","locales2rules","isIn","list","isBetween","pluralRules","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","plural","_pluralRules","getL10nData","rv","substIndexes","substArguments","reIndex","reMatch","macroName","paramName","macro","reArgs","matched_text","translateElement","getChildElementCount","l","nodeValue","textNode","childElementCount","translateFragment","elementCount","fallbackString","getText","rtlList","shortCode","getReadyState","pdfjsSandbox","QuickJSSandbox","sandbox","nukeSandbox","_print_utils","activeService","renderPage","activeServiceOnEntry","printAnnotationStoragePromise","scratchCanvas","PRINT_UNITS","PDF","printAnnotationStorage","ENABLE_STORAGE","PDFPrintService","_printResolution","throwIfInactive","pageStyleSheet","ensureOverlay","renderPages","getXfaHtmlForPrinting","renderNextPage","renderProgress","useRenderedPage","toBlob","onload","performPrint","abort","eventType","bubbles","cancelable","progressBar","progressPerc","chrome","opera","stopImmediatePropagation","stopPropagationIfNeeded","overlayPromise","allXfaHtml","xfaPage","builder","getXfaPageViewport","pdfjsVersion","pdfjsBuild","AppConstants","PDFViewerApplicationConstants","PDFViewerApplicationOptions","getViewerConfiguration","webViewerLoad"],"sourceRoot":""}