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,CAAC,kBAAkB,EAAE,EAAE,CAAC;IACrC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;EAC/B;EAEF,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC;AAClC;AAIA,QAAQ,CAAC,kBAAkB,GAAG,IAAI,CAAC;AAEnC,IACE,QAAQ,CAAC,UAAU,KAAK,aAAa,IACrC,QAAQ,CAAC,UAAU,KAAK,UAAU,EAClC;EACA,aAAa,CAAC,CAAC;AACjB,CAAC,MAAM;EACL,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,aAAa,EAAE,IAAI,CAAC;AACpE","sources":["webpack://pdf.js/./web/ui_utils.js","webpack://pdf.js/./web/app_options.js","webpack://pdf.js/./web/pdfjs.js","webpack://pdf.js/./web/internal_evt.js","webpack://pdf.js/./web/pdf_link_service.js","webpack://pdf.js/./web/event_utils.js","webpack://pdf.js/./web/external_services.js","webpack://pdf.js/./web/preferences.js","webpack://pdf.js/./node_modules/@fluent/bundle/esm/types.js","webpack://pdf.js/./node_modules/@fluent/bundle/esm/resolver.js","webpack://pdf.js/./node_modules/@fluent/bundle/esm/scope.js","webpack://pdf.js/./node_modules/@fluent/bundle/esm/builtins.js","webpack://pdf.js/./node_modules/@fluent/bundle/esm/memoizer.js","webpack://pdf.js/./node_modules/@fluent/bundle/esm/bundle.js","webpack://pdf.js/./node_modules/@fluent/bundle/esm/resource.js","webpack://pdf.js/./node_modules/@fluent/bundle/esm/index.js","webpack://pdf.js/./node_modules/@fluent/dom/esm/overlay.js","webpack://pdf.js/./node_modules/cached-iterable/src/cached_iterable.mjs","webpack://pdf.js/./node_modules/cached-iterable/src/cached_sync_iterable.mjs","webpack://pdf.js/./node_modules/cached-iterable/src/cached_async_iterable.mjs","webpack://pdf.js/./node_modules/cached-iterable/src/index.mjs","webpack://pdf.js/./node_modules/@fluent/dom/esm/localization.js","webpack://pdf.js/./node_modules/@fluent/dom/esm/dom_localization.js","webpack://pdf.js/./node_modules/@fluent/dom/esm/index.js","webpack://pdf.js/./web/l10n.js","webpack://pdf.js/./web/genericl10n.js","webpack://pdf.js/./web/generic_scripting.js","webpack://pdf.js/./web/generic_signature_storage.js","webpack://pdf.js/./web/genericcom.js","webpack://pdf.js/./web/new_alt_text_manager.js","webpack://pdf.js/./web/alt_text_manager.js","webpack://pdf.js/./web/annotation_editor_params.js","webpack://pdf.js/./web/caret_browsing.js","webpack://pdf.js/./web/sidebar.js","webpack://pdf.js/./web/comment_manager.js","webpack://pdf.js/./web/base_download_manager.js","webpack://pdf.js/./web/download_manager.js","webpack://pdf.js/./web/editor_undo_bar.js","webpack://pdf.js/./web/overlay_manager.js","webpack://pdf.js/./web/password_prompt.js","webpack://pdf.js/./web/base_tree_viewer.js","webpack://pdf.js/./web/pdf_attachment_viewer.js","webpack://pdf.js/./web/grab_to_pan.js","webpack://pdf.js/./web/pdf_cursor_tools.js","webpack://pdf.js/./web/pdf_document_properties.js","webpack://pdf.js/./web/pdf_find_utils.js","webpack://pdf.js/./web/pdf_find_controller.js","webpack://pdf.js/./web/pdf_find_bar.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/xfa_layer_builder.js","webpack://pdf.js/./web/print_utils.js","webpack://pdf.js/./web/pdf_print_service.js","webpack://pdf.js/./web/renderable_view.js","webpack://pdf.js/./web/pdf_rendering_queue.js","webpack://pdf.js/./web/pdf_scripting_manager.js","webpack://pdf.js/./web/pdf_text_extractor.js","webpack://pdf.js/./web/menu.js","webpack://pdf.js/./web/pdf_thumbnail_view.js","webpack://pdf.js/./web/pdf_thumbnail_viewer.js","webpack://pdf.js/./web/annotation_editor_layer_builder.js","webpack://pdf.js/./web/annotation_layer_builder.js","webpack://pdf.js/./web/autolinker.js","webpack://pdf.js/./web/base_pdf_page_view.js","webpack://pdf.js/./web/draw_layer_builder.js","webpack://pdf.js/./web/pdf_page_detail_view.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/pdf_page_view.js","webpack://pdf.js/./web/pdf_viewer.js","webpack://pdf.js/./web/secondary_toolbar.js","webpack://pdf.js/./web/signature_manager.js","webpack://pdf.js/./web/digital_signature_properties_manager.js","webpack://pdf.js/./web/toolbar.js","webpack://pdf.js/./web/view_history.js","webpack://pdf.js/./web/views_manager.js","webpack://pdf.js/./web/app.js","webpack://pdf.js/./web/viewer.js"],"sourcesContent":["/* 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 = 25.0;\nconst UNKNOWN_SCALE = 0;\nconst MAX_AUTO_SCALE = 1.25;\nconst SCROLLBAR_PADDING = 40;\nconst VERTICAL_PADDING = 5;\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 * 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 */\nfunction scrollIntoView(element, spot) {\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 ) {\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, abortSignal = undefined) {\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, {\n useCapture: true,\n signal: abortSignal,\n });\n abortSignal?.addEventListener(\n \"abort\",\n () => window.cancelAnimationFrame(rAF),\n { once: true }\n );\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\n// eslint-disable-next-line no-control-regex\nconst InvisibleCharsRegExp = /[\\x00-\\x1F]/g;\n\n/**\n * @param {string} str\n * @param {boolean} [replaceInvisible]\n */\nfunction removeNullCharacters(str, replaceInvisible = false) {\n if (!InvisibleCharsRegExp.test(str)) {\n return str;\n }\n if (replaceInvisible) {\n return str.replaceAll(InvisibleCharsRegExp, m => (m === \"\\x00\" ? \"\" : \" \"));\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 * They are both natural numbers.\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 // Select closest of the neighbours to x.\n if (x_ - a / b < c / d - x_) {\n return x_ === x ? [a, b] : [b, a];\n }\n return x_ === x ? [c, d] : [d, c];\n}\n\n/**\n * @param {number} x - A positive number to round to a multiple of `div`.\n * @param {number} div - A natural number.\n */\nfunction floorToDivide(x, div) {\n return x - (x % 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 minY = Math.max(0, top - currentHeight);\n const minX = Math.max(0, left - currentWidth);\n\n const hiddenHeight = minY + Math.max(0, viewBottom - bottom);\n const hiddenWidth = minX + 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 visibleArea:\n // We only specify which part of the page is visible when it's not\n // the full page, as there is no point in handling a partial page\n // rendering otherwise.\n percent === 100\n ? null\n : {\n minX,\n minY,\n maxX: Math.min(viewRight, right) - currentWidth,\n maxY: Math.min(viewBottom, bottom) - currentHeight,\n },\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\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 = val;\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 (this.#percent === 100 || 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 toggleSelectedBtn(button, toggle, view = null) {\n button.classList.toggle(\"selected\", toggle);\n button.setAttribute(\"aria-selected\", 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\n// In Firefox, the css calc function uses f32 precision but the Chrome or Safari\n// are using f64 one. So in order to have the same rendering in all browsers, we\n// need to use the right precision in order to have correct dimensions.\nconst calcRound =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? Math.fround\n : (function () {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ) {\n return x => x;\n }\n const e = document.createElement(\"div\");\n e.style.width = \"round(down, calc(1.6666666666666665 * 792px), 1px)\";\n return e.style.width === \"calc(1320px)\" ? Math.fround : x => x;\n })();\n\nexport {\n animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n approximateFraction,\n AutoPrintRegExp,\n backtrackBeforeAllVisibleElements, // only exported for testing\n binarySearchFirstItem,\n calcRound,\n CursorTool,\n DEFAULT_SCALE,\n DEFAULT_SCALE_DELTA,\n DEFAULT_SCALE_VALUE,\n docStyle,\n floorToDivide,\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 parseQueryString,\n PresentationModeState,\n ProgressBar,\n removeNullCharacters,\n SCROLLBAR_PADDING,\n scrollIntoView,\n ScrollMode,\n SidebarView,\n SpreadMode,\n TextLayerMode,\n toggleCheckedBtn,\n toggleExpandedBtn,\n toggleSelectedBtn,\n UNKNOWN_SCALE,\n VERTICAL_PADDING,\n watchScroll,\n};\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\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n var compatParams = new Map(); // eslint-disable-line no-var\n const { maxTouchPoints, platform, userAgent } = navigator;\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 if (isIOS || isAndroid) {\n compatParams.set(\"maxCanvasPixels\", 5242880);\n }\n\n // Don't use system fonts on Android (issue 18210).\n // Support: Android\n if (isAndroid) {\n compatParams.set(\"useSystemFonts\", false);\n }\n}\n\nconst OptionKind = {\n BROWSER: 0x01,\n VIEWER: 0x02,\n API: 0x04,\n WORKER: 0x08,\n EVENT_DISPATCH: 0x10,\n PREFERENCE: 0x80,\n};\n\n// Should only be used with options that allow multiple types.\nconst Type = {\n BOOLEAN: 0x01,\n NUMBER: 0x02,\n OBJECT: 0x04,\n STRING: 0x08,\n UNDEFINED: 0x10,\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 = new Map([\n // Begin OptionKind.BROWSER\n [\n \"allowedGlobalEvents\",\n {\n /** @type {Object} */\n value: null,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"canvasMaxAreaInBytes\",\n {\n /** @type {number} */\n value: -1,\n kind: OptionKind.BROWSER + OptionKind.API,\n },\n ],\n [\n \"isInAutomation\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"localeProperties\",\n {\n /** @type {Object} */\n value:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? { lang: navigator.language || \"en-US\" }\n : null,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"maxCanvasDim\",\n {\n /** @type {number} */\n value: 32767,\n kind: OptionKind.BROWSER + OptionKind.VIEWER,\n },\n ],\n [\n \"nimbusDataStr\",\n {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"supportsCaretBrowsingMode\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"supportsDocumentFonts\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"supportsDownloading\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"supportsIntegratedFind\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"supportsMouseWheelZoomCtrlKey\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"supportsMouseWheelZoomMetaKey\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"supportsPinchToZoom\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"supportsPrinting\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.BROWSER,\n },\n ],\n [\n \"toolbarDensity\",\n {\n /** @type {number} */\n value: 0, // 0 = \"normal\", 1 = \"compact\", 2 = \"touch\"\n kind: OptionKind.BROWSER + OptionKind.EVENT_DISPATCH,\n },\n ],\n // End OptionKind.BROWSER\n\n // Begin OptionKind.VIEWER\n [\n \"altTextLearnMoreUrl\",\n {\n /** @type {string} */\n value:\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? \"https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/pdf-alt-text\"\n : \"\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"annotationEditorMode\",\n {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"annotationMode\",\n {\n /** @type {number} */\n value: 2,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"capCanvasAreaFactor\",\n {\n /** @type {number} */\n value: 200,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"commentLearnMoreUrl\",\n {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"MOZCENTRAL\")\n ? \"https://support.mozilla.org/%LOCALE%/kb/view-pdf-files-firefox-or-choose-another-viewer#w_add-a-comment-to-a-pdf\"\n : \"\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"cursorToolOnLoad\",\n {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"debuggerSrc\",\n {\n /** @type {string} */\n value: \"./debugger.mjs\",\n kind: OptionKind.VIEWER,\n },\n ],\n ...(typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")\n ? [\n [\n \"defaultUrl\",\n {\n /** @type {string} */\n value:\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\")\n ? \"\"\n : \"compressed.tracemonkey-pldi-09.pdf\",\n kind: OptionKind.VIEWER,\n },\n ],\n ]\n : []),\n [\n \"defaultZoomDelay\",\n {\n /** @type {number} */\n value: 400,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"defaultZoomValue\",\n {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"disableHistory\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER,\n },\n ],\n [\n \"disablePageLabels\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n ...(typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? [\n [\n \"disablePreferences\",\n {\n /** @type {boolean} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER,\n },\n ],\n ]\n : []),\n ...(typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\")\n ? [\n [\n \"disableTelemetry\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n ]\n : []),\n [\n \"enableAltText\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableAltTextModelDownload\",\n {\n /** @type {boolean} */\n value: true,\n kind:\n OptionKind.VIEWER + OptionKind.PREFERENCE + OptionKind.EVENT_DISPATCH,\n },\n ],\n [\n \"enableAutoLinking\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableComment\",\n {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableDetailCanvas\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER,\n },\n ],\n ...(typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? [\n [\n \"enableFakeMLManager\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER,\n },\n ],\n ]\n : []),\n [\n \"enableGuessAltText\",\n {\n /** @type {boolean} */\n value: true,\n kind:\n OptionKind.VIEWER + OptionKind.PREFERENCE + OptionKind.EVENT_DISPATCH,\n },\n ],\n [\n \"enableHighlightFloatingButton\",\n {\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: typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableMerge\",\n {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableNewAltTextWhenAddingImage\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableNewBadge\",\n {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"MOZCENTRAL\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableOptimizedPartialRendering\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enablePermissions\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enablePrintAutoRotate\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableScripting\",\n {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableSelectionRendering\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableSignatureEditor\",\n {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableSignatureVerification\",\n {\n // On in MOZCENTRAL (NSS provides the verification path) and in\n // local dev builds; off in shipping GENERIC builds, where no\n // verifier is wired up by default.\n /** @type {boolean} */\n value:\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"TESTING || MOZCENTRAL\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableSplitMerge\",\n {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableUpdatedAddImage\",\n {\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: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"externalLinkRel\",\n {\n /** @type {string} */\n value: \"noopener noreferrer nofollow\",\n kind: OptionKind.VIEWER,\n },\n ],\n [\n \"externalLinkTarget\",\n {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n ...(typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"MOZCENTRAL && !GECKOVIEW\")\n ? [\n [\n \"featuresNotificationDismissed\",\n {\n /** @type {boolean} */\n value: false,\n kind:\n OptionKind.VIEWER +\n OptionKind.PREFERENCE +\n OptionKind.EVENT_DISPATCH,\n },\n ],\n ]\n : []),\n [\n \"highlightEditorColors\",\n {\n /** @type {string} */\n value:\n \"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F,\" +\n \"yellow_HCM=#FFFFCC,green_HCM=#53FFBC,blue_HCM=#80EBFF,pink_HCM=#F6B8FF,red_HCM=#C50043\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"historyUpdateUrl\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"ignoreDestinationZoom\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"imageResourcesPath\",\n {\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 ],\n [\n \"imagesRightClickMinSize\",\n {\n /** @type {number} */\n value:\n typeof PDFJSDev === \"undefined\" ||\n // Firefox mobile does not support right-clicking on images,\n // see https://bugzilla.mozilla.org/show_bug.cgi?id=2014081.\n // This option is disabled by default outside of MOZCENTRAL\n // because it degrades the text selection experience in Chrome\n // and Safari.\n PDFJSDev.test(\"MOZCENTRAL && !GECKOVIEW\")\n ? 16\n : -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"maxCanvasPixels\",\n {\n /** @type {number} */\n value: 2 ** 25,\n kind: OptionKind.VIEWER,\n },\n ],\n [\n \"minDurationToUpdateCanvas\",\n {\n /** @type {number} */\n value: 500, // ms\n kind: OptionKind.VIEWER,\n },\n ],\n [\n \"forcePageColors\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"pageColorsBackground\",\n {\n /** @type {string} */\n value: \"Canvas\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"pageColorsForeground\",\n {\n /** @type {string} */\n value: \"CanvasText\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"pdfBugEnabled\",\n {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"postMessageAfterPrintCallback\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"printResolution\",\n {\n /** @type {number} */\n value: 150,\n kind: OptionKind.VIEWER,\n },\n ],\n ...(typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")\n ? [\n [\n \"sandboxBundleSrc\",\n {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\"\n ? \"../build/dev-sandbox/pdf.sandbox.mjs\"\n : \"../build/pdf.sandbox.mjs\",\n kind: OptionKind.VIEWER,\n },\n ],\n ]\n : []),\n [\n \"sidebarViewOnLoad\",\n {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"scrollModeOnLoad\",\n {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"spreadModeOnLoad\",\n {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"textLayerMode\",\n {\n /** @type {number} */\n value: 1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"viewerCssTheme\",\n {\n /** @type {number} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\") ? 2 : 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n [\n \"viewOnLoad\",\n {\n /** @type {boolean} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ],\n // End OptionKind.VIEWER\n\n // Begin OptionKind.API\n [\n \"cMapPacked\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n ],\n [\n \"cMapUrl\",\n {\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 ],\n [\n \"disableAutoFetch\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n ],\n [\n \"disableFontFace\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n ],\n [\n \"disableRange\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n ],\n [\n \"disableStream\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n ],\n [\n \"docBaseUrl\",\n {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\"\n ? // NOTE: We cannot use the `updateUrlHash` function here, because of\n // the default preferences generation (see `gulpfile.mjs`).\n // However, the following line is *only* used in development mode.\n document.URL.split(\"#\", 1)[0]\n : \"\",\n kind: OptionKind.API,\n },\n ],\n [\n \"enableHWA\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableWebGPU\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n ],\n [\n \"enableXfa\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n ],\n [\n \"fontExtraProperties\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n ],\n [\n \"iccUrl\",\n {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../external/iccs/\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/iccs/\"\n : \"../web/iccs/\",\n kind: OptionKind.API,\n },\n ],\n [\n \"isOffscreenCanvasSupported\",\n {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n ],\n [\n \"maxImageSize\",\n {\n /** @type {number} */\n value: -1,\n kind: OptionKind.API,\n },\n ],\n [\n \"pdfBug\",\n {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n ],\n [\n \"standardFontDataUrl\",\n {\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 ],\n [\n \"useSystemFonts\",\n {\n // On Android, there is almost no chance to have the font we want so we\n // don't use the system fonts in this case (bug 1882613).\n /** @type {boolean|undefined} */\n value: (\n typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")\n )\n ? false\n : undefined,\n kind: OptionKind.API,\n type: Type.BOOLEAN + Type.UNDEFINED,\n },\n ],\n [\n \"verbosity\",\n {\n /** @type {number} */\n value: 1,\n kind: OptionKind.API,\n },\n ],\n [\n \"wasmUrl\",\n {\n /** @type {string} */\n value:\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/wasm/\"\n : \"../web/wasm/\",\n kind: OptionKind.API,\n },\n ],\n // End OptionKind.API\n\n // Begin OptionKind.WORKER\n [\n \"workerPort\",\n {\n /** @type {Object} */\n value:\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? globalThis.pdfjsPreloadedWorker || null\n : null,\n kind: OptionKind.WORKER,\n },\n ],\n [\n \"workerSrc\",\n {\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.mjs\"\n : \"../build/pdf.worker.mjs\",\n kind: OptionKind.WORKER,\n },\n ],\n // End OptionKind.WORKER\n]);\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // Ensure that the `defaultOptions` are correctly specified.\n for (const [name, { value, kind, type }] of defaultOptions) {\n if (kind & OptionKind.PREFERENCE) {\n if (kind === OptionKind.PREFERENCE) {\n throw new Error(`Cannot use only \"PREFERENCE\" kind: ${name}`);\n }\n if (kind & OptionKind.BROWSER) {\n throw new Error(`Cannot mix \"PREFERENCE\" and \"BROWSER\" kind: ${name}`);\n }\n if (type !== undefined) {\n throw new Error(\n `Cannot have \\`type\\`-field for \"PREFERENCE\" kind: ${name}`\n );\n }\n if (typeof compatParams === \"object\" && compatParams.has(name)) {\n throw new Error(\n `Should not have compatibility-value for \"PREFERENCE\" kind: ${name}`\n );\n }\n // Only \"simple\" preference-values are allowed.\n if (\n typeof value !== \"boolean\" &&\n typeof value !== \"string\" &&\n !Number.isInteger(value)\n ) {\n throw new Error(`Invalid value for \"PREFERENCE\" kind: ${name}`);\n }\n } else if (kind & OptionKind.BROWSER) {\n if (type !== undefined) {\n throw new Error(\n `Cannot have \\`type\\`-field for \"BROWSER\" kind: ${name}`\n );\n }\n if (typeof compatParams === \"object\" && compatParams.has(name)) {\n throw new Error(\n `Should not have compatibility-value for \"BROWSER\" kind: ${name}`\n );\n }\n if (value === undefined) {\n throw new Error(`Invalid value for \"BROWSER\" kind: ${name}`);\n }\n }\n }\n}\n\nclass AppOptions {\n static eventBus;\n\n static #opts = new Map();\n\n static {\n // Initialize all the user-options.\n for (const [name, defaultOpt] of defaultOptions) {\n this.#opts.set(name, defaultOpt.value);\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // Apply any compatibility-values to the user-options.\n for (const [name, value] of compatParams) {\n this.#opts.set(name, value);\n }\n this._hasInvokedSet = false;\n\n this._checkDisablePreferences = () => {\n if (this.get(\"disablePreferences\")) {\n // Give custom implementations of the default viewer a simpler way to\n // opt-out of having the `Preferences` override existing `AppOptions`.\n return true;\n }\n if (this._hasInvokedSet) {\n console.warn(\n \"The Preferences may override manually set AppOptions; \" +\n 'please use the \"disablePreferences\"-option to prevent that.'\n );\n }\n return false;\n };\n }\n }\n\n constructor() {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n throw new Error(\"Cannot initialize AppOptions.\");\n }\n }\n\n static get(name) {\n return this.#opts.get(name);\n }\n\n static getAll(kind = null, defaultOnly = false) {\n const options = Object.create(null);\n for (const [name, defaultOpt] of defaultOptions) {\n if (kind && !(kind & defaultOpt.kind)) {\n continue;\n }\n options[name] = !defaultOnly ? this.#opts.get(name) : defaultOpt.value;\n }\n return options;\n }\n\n static set(name, value) {\n this.setAll({ [name]: value });\n }\n\n static setAll(options, prefs = false) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this._hasInvokedSet ||= true;\n }\n let events;\n\n for (const name in options) {\n const defaultOpt = defaultOptions.get(name),\n userOpt = options[name];\n\n if (\n !defaultOpt ||\n !(\n typeof userOpt === typeof defaultOpt.value ||\n Type[(typeof userOpt).toUpperCase()] & defaultOpt.type\n )\n ) {\n continue;\n }\n const { kind } = defaultOpt;\n\n if (\n prefs &&\n !(kind & OptionKind.BROWSER || kind & OptionKind.PREFERENCE)\n ) {\n continue;\n }\n if (this.eventBus && kind & OptionKind.EVENT_DISPATCH) {\n (events ||= new Map()).set(name, userOpt);\n }\n this.#opts.set(name, userOpt);\n }\n\n if (events) {\n for (const [name, value] of events) {\n this.eventBus.dispatch(name.toLowerCase(), { source: this, value });\n }\n }\n }\n}\n\nexport { AppOptions, OptionKind };\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\nconst {\n AbortException,\n AnnotationEditorLayer,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationLayer,\n AnnotationMode,\n AnnotationType,\n applyOpacity,\n build,\n ColorPicker,\n createValidAbsoluteUrl,\n CSSConstants,\n DOMSVGFactory,\n DrawLayer,\n FeatureTest,\n fetchData,\n findContrastColor,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getRGBA,\n getUuid,\n GlobalWorkerOptions,\n ImageKind,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n isValidExplicitDest,\n makeArr,\n makeMap,\n makeObj,\n makeSet,\n MathClamp,\n noContextMenu,\n normalizeUnicode,\n OPS,\n OutputScale,\n PasswordException,\n PasswordResponses,\n PDFDataRangeTransport,\n PDFDateString,\n PDFWorker,\n PermissionFlag,\n PixelsPerInch,\n RenderingCancelledException,\n renderRichText,\n ResponseException,\n setLayerDimensions,\n shadow,\n SignatureExtractor,\n stopEvent,\n SupportedImageMimeTypes,\n TextLayer,\n TextLayerImages,\n TouchManager,\n updateUrlHash,\n Util,\n VerbosityLevel,\n version,\n XfaLayer,\n} = globalThis.pdfjsLib;\n\nexport {\n AbortException,\n AnnotationEditorLayer,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationLayer,\n AnnotationMode,\n AnnotationType,\n applyOpacity,\n build,\n ColorPicker,\n createValidAbsoluteUrl,\n CSSConstants,\n DOMSVGFactory,\n DrawLayer,\n FeatureTest,\n fetchData,\n findContrastColor,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getRGBA,\n getUuid,\n GlobalWorkerOptions,\n ImageKind,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n isValidExplicitDest,\n makeArr,\n makeMap,\n makeObj,\n makeSet,\n MathClamp,\n noContextMenu,\n normalizeUnicode,\n OPS,\n OutputScale,\n PasswordException,\n PasswordResponses,\n PDFDataRangeTransport,\n PDFDateString,\n PDFWorker,\n PermissionFlag,\n PixelsPerInch,\n RenderingCancelledException,\n renderRichText,\n ResponseException,\n setLayerDimensions,\n shadow,\n SignatureExtractor,\n stopEvent,\n SupportedImageMimeTypes,\n TextLayer,\n TextLayerImages,\n TouchManager,\n updateUrlHash,\n Util,\n VerbosityLevel,\n version,\n XfaLayer,\n};\n","/* Copyright 2026 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 * Keep this file in sync with `src/shared/internal_evt.js`.\n */\n\nconst INTERNAL_EVT =\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"INTERNAL_EVT\")\n : \"internalEvent\";\n\nconst internalOpt = Object.freeze({ internal: INTERNAL_EVT });\n\nexport { INTERNAL_EVT, internalOpt };\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\n/**\n * @import { CatalogAttachmentContent } from \"../src/core/catalog.js\";\n */\n\nimport { isValidExplicitDest, PasswordException } from \"pdfjs-lib\";\nimport { internalOpt } from \"./internal_evt.js\";\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} 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 */\nclass PDFLinkService {\n externalLinkEnabled = true;\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._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 }\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?.pagesMapper.pagesNumber || 0;\n }\n\n /**\n * @type {number}\n */\n get page() {\n return this.pdfDocument ? this.pdfViewer.currentPageNumber : 1;\n }\n\n /**\n * @param {number} value\n */\n set page(value) {\n if (this.pdfDocument) {\n this.pdfViewer.currentPageNumber = value;\n }\n }\n\n /**\n * @type {number}\n */\n get rotation() {\n return this.pdfDocument ? this.pdfViewer.pagesRotation : 0;\n }\n\n /**\n * @param {number} value\n */\n set rotation(value) {\n if (this.pdfDocument) {\n this.pdfViewer.pagesRotation = value;\n }\n }\n\n /**\n * @type {boolean}\n */\n get isInPresentationMode() {\n return this.pdfDocument ? this.pdfViewer.isInPresentationMode : false;\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, pageNumber;\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 `goToDestination: \"${explicitDest}\" is not a valid destination array, for dest=\"${dest}\".`\n );\n return;\n }\n // Dest array looks like that: <page-ref> </XYZ|/FitXXX> <args..>\n const [destRef] = explicitDest;\n\n if (destRef && typeof destRef === \"object\") {\n pageNumber = this.pdfDocument.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 try {\n pageNumber = (await this.pdfDocument.getPageIndex(destRef)) + 1;\n } catch {\n console.error(\n `goToDestination: \"${destRef}\" is not a valid page reference, for dest=\"${dest}\".`\n );\n return;\n }\n }\n } else if (Number.isInteger(destRef)) {\n pageNumber = destRef + 1;\n }\n if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {\n console.error(\n `goToDestination: \"${pageNumber}\" is not a valid page number, for dest=\"${dest}\".`\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 const ac = new AbortController();\n this.eventBus.on(\n \"textlayerrendered\",\n evt => {\n if (evt.pageNumber === pageNumber) {\n evt.source.textLayer.div.focus();\n ac.abort();\n }\n },\n { signal: ac.signal, ...internalOpt }\n );\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 Number.isInteger(pageNumber) &&\n pageNumber > 0 &&\n pageNumber <= this.pagesCount\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 * Scrolls to a specific location in the PDF document.\n * @param {number} pageNumber - The page number to scroll to.\n * @param {number} x - The x-coordinate to scroll to in page coordinates.\n * @param {number} y - The y-coordinate to scroll to in page coordinates.\n * @param {Object} [options]\n */\n goToXY(pageNumber, x, y, options = {}) {\n this.pdfViewer.scrollPageIntoView({\n pageNumber,\n destArray: [null, { name: \"XYZ\" }, x, y],\n ignoreDestinationZoom: true,\n ...options,\n });\n }\n\n /**\n * @param {string} id\n * Unique attachment identifier (required).\n * @returns {Promise<CatalogAttachmentContent>}\n * Content.\n */\n async getAttachmentContent(id) {\n try {\n return await this.pdfDocument?.getAttachmentContent(id);\n } catch (error) {\n if (!(error instanceof PasswordException)) {\n console.warn(`Unable to load attachment content: ${error}`);\n }\n }\n return null;\n }\n\n /**\n * Adds various attributes (href, title, target, rel) to hyperlinks.\n * @param {HTMLAnchorElement} link\n * @param {string} url\n * @param {boolean} [newWindow]\n */\n addLinkAttributes(link, url, newWindow = false) {\n if (!url || typeof url !== \"string\") {\n throw new Error('A valid \"url\" parameter must provided.');\n }\n const target = newWindow ? LinkTarget.BLANK : this.externalLinkTarget,\n rel = this.externalLinkRel;\n\n // Strip userinfo (user:password@) from URLs used for display, to prevent\n // phishing via hostname-spoofing (e.g. https://trusted.example@attacker.example/).\n let displayUrl = url;\n const parsedUrl = URL.parse(url);\n if (parsedUrl?.username || parsedUrl?.password) {\n parsedUrl.username = parsedUrl.password = \"\";\n displayUrl = parsedUrl.href;\n }\n\n if (this.externalLinkEnabled) {\n link.href = url;\n link.title = displayUrl;\n } else {\n link.href = \"\";\n link.title = `Disabled: ${displayUrl}`;\n link.onclick = () => false;\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 * @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\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n return;\n }\n // Support opening of PDF attachments in the Firefox PDF Viewer,\n // which uses a couple of non-standard hash parameters; refer to\n // `DownloadManager._getOpenDataUrl` in the firefoxcom.js file.\n if (!params.has(\"filename\") || !params.has(\"filedest\")) {\n return;\n }\n hash = params.get(\"filedest\");\n }\n\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 (typeof dest === \"string\" || isValidExplicitDest(dest)) {\n this.goToDestination(dest);\n return;\n }\n console.error(\n `PDFLinkService.setHash: \"${unescape(hash)}\" is not a valid destination.`\n );\n }\n\n /**\n * @param {string} action\n */\n executeNamedAction(action) {\n if (!this.pdfDocument) {\n return;\n }\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 if (!this.pdfDocument) {\n return;\n }\n const pdfDocument = this.pdfDocument,\n optionalContentConfig = await this.pdfViewer.optionalContentConfigPromise;\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the optional content resolved.\n }\n optionalContentConfig.setOCGState(action);\n\n this.pdfViewer.optionalContentConfigPromise = Promise.resolve(\n optionalContentConfig\n );\n }\n}\n\nclass SimpleLinkService extends PDFLinkService {\n setDocument(pdfDocument, baseUrl = null) {}\n}\n\nexport { LinkTarget, PDFLinkService, SimpleLinkService };\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 { INTERNAL_EVT, internalOpt } from \"./internal_evt.js\";\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 */\nasync function waitOnEventOrTimeout({ target, name, delay = 0 }) {\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 const { promise, resolve } = Promise.withResolvers();\n const ac = new AbortController();\n\n function handler(type) {\n ac.abort(); // Remove event listener.\n clearTimeout(timeout);\n\n resolve(type);\n }\n\n const evtMethod = target instanceof EventBus ? \"on\" : \"addEventListener\";\n const evtOpts =\n target instanceof EventBus\n ? { signal: ac.signal, ...internalOpt }\n : { signal: ac.signal };\n target[evtMethod](name, handler.bind(null, WaitOnType.EVENT), evtOpts);\n\n const timeout = setTimeout(handler.bind(null, WaitOnType.TIMEOUT), delay);\n\n return promise;\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 constructor() {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // Prevent the class methods from being overridden by third-party users,\n // to ensure that `INTERNAL_EVT` cannot be accessed from the outside.\n Object.seal(this);\n }\n }\n\n /**\n * @param {string} eventName\n * @param {function} listener\n * @param {Object} [options]\n */\n on(eventName, listener, options = null) {\n let rmAbort = null;\n if (options?.signal instanceof AbortSignal) {\n const { signal } = options;\n if (signal.aborted) {\n console.error(\"Cannot use an `aborted` signal.\");\n return;\n }\n const onAbort = () => this.off(eventName, listener);\n rmAbort = () => signal.removeEventListener(\"abort\", onAbort);\n\n signal.addEventListener(\"abort\", onAbort);\n }\n\n const eventListeners = (this.#listeners[eventName] ??= []);\n eventListeners.push({\n listener,\n internal: options?.internal === INTERNAL_EVT,\n once: options?.once === true,\n rmAbort,\n });\n }\n\n /**\n * @param {string} eventName\n * @param {function} listener\n * @param {Object} [options]\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 const evt = eventListeners[i];\n if (evt.listener === listener) {\n evt.rmAbort?.(); // Ensure that the `AbortSignal` listener is removed.\n eventListeners.splice(i, 1);\n return;\n }\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?.length) {\n return;\n }\n let extListeners;\n // Making copy of the listeners array in case if it will be modified\n // during dispatch.\n for (const { listener, internal, once } of eventListeners.slice(0)) {\n if (once) {\n this.off(eventName, listener);\n }\n if (!internal) {\n (extListeners ??= []).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 (extListeners) {\n for (const listener of extListeners) {\n listener(data);\n }\n }\n }\n}\n\n/**\n * NOTE: Only used in the Firefox built-in pdf viewer.\n */\nclass FirefoxEventBus extends EventBus {\n #externalServices;\n\n #globalEventNames;\n\n #isInAutomation;\n\n constructor(globalEventNames, externalServices, isInAutomation) {\n super();\n this.#globalEventNames = globalEventNames;\n this.#externalServices = externalServices;\n this.#isInAutomation = isInAutomation;\n }\n\n dispatch(eventName, data) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: FirefoxEventBus.dispatch\");\n }\n super.dispatch(eventName, data);\n\n if (this.#isInAutomation) {\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 if (this.#globalEventNames?.has(eventName)) {\n this.#externalServices.dispatchGlobalEvent({\n eventName,\n detail: data,\n });\n }\n }\n}\n\nexport { EventBus, FirefoxEventBus, waitOnEventOrTimeout, WaitOnType };\n","/* Copyright 2024 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 BaseExternalServices {\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseExternalServices\n ) {\n throw new Error(\"Cannot initialize BaseExternalServices.\");\n }\n }\n\n updateFindControlState(data) {}\n\n updateFindMatchesCount(data) {}\n\n initPassiveLoading() {}\n\n reportTelemetry(data) {}\n\n reportText(data) {}\n\n /**\n * @returns {Promise<L10n>}\n */\n async createL10n() {\n throw new Error(\"Not implemented: createL10n\");\n }\n\n createScripting() {\n throw new Error(\"Not implemented: createScripting\");\n }\n\n createSignatureStorage() {\n throw new Error(\"Not implemented: createSignatureStorage\");\n }\n\n /**\n * Build a signature verifier for the Digital signature properties panel.\n *\n * The MOZCENTRAL build returns a verifier that calls into NSS via\n * the chrome bridge. The default GENERIC implementation returns\n * `null` — there is no portable cryptographic verification path\n * outside Firefox, so the toolbar button stays hidden and the\n * worker is never asked for `getSignatures()`.\n *\n * Downstream consumers of `pdfjs-dist` that want the Signature\n * Properties UI should subclass `BaseExternalServices` and return\n * an object exposing `verify(signature)` (and optionally\n * `viewCertificate(certificate)`) that resolves to a\n * `VerificationResult` — see `web/firefoxcom.js` for the exact shape.\n *\n * @returns {Object|null}\n */\n createSignatureVerifier() {\n return null;\n }\n\n updateEditorStates(data) {\n throw new Error(\"Not implemented: updateEditorStates\");\n }\n\n dispatchGlobalEvent(_event) {}\n}\n\nexport { BaseExternalServices };\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 AppOptions.getAll(OptionKind.PREFERENCE, /* defaultOnly = */ true)\n );\n\n #initializedPromise = null;\n\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BasePreferences\n ) {\n throw new Error(\"Cannot initialize BasePreferences.\");\n }\n\n this.#initializedPromise = this._readFromStorage(this.#defaults).then(\n ({ browserPrefs, prefs }) => {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n AppOptions._checkDisablePreferences()\n ) {\n return;\n }\n AppOptions.setAll({ ...browserPrefs, ...prefs }, /* prefs = */ true);\n }\n );\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n window.addEventListener(\n \"updatedPreference\",\n async ({ detail: { name, value } }) => {\n await this.#initializedPromise;\n AppOptions.setAll({ [name]: value }, /* prefs = */ true);\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 AppOptions.setAll(this.#defaults, /* prefs = */ true);\n\n await this._writeToStorage(this.#defaults);\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 await this.#initializedPromise;\n AppOptions.setAll({ [name]: value }, /* prefs = */ true);\n\n await this._writeToStorage(\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? { [name]: AppOptions.get(name) }\n : AppOptions.getAll(OptionKind.PREFERENCE)\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 if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: get\");\n }\n await this.#initializedPromise;\n return AppOptions.get(name);\n }\n\n get defaults() {\n return this.#defaults;\n }\n\n get initializedPromise() {\n return this.#initializedPromise;\n }\n}\n\nexport { BasePreferences };\n","/**\n * The `FluentType` class is the base of Fluent's type system.\n *\n * Fluent types wrap JavaScript values and store additional configuration for\n * them, which can then be used in the `toString` method together with a proper\n * `Intl` formatter.\n */\nexport class FluentType {\n /**\n * Create a `FluentType` instance.\n *\n * @param value The JavaScript value to wrap.\n */\n constructor(value) {\n this.value = value;\n }\n /**\n * Unwrap the raw value stored by this `FluentType`.\n */\n valueOf() {\n return this.value;\n }\n}\n/**\n * A {@link FluentType} representing no correct value.\n */\nexport class FluentNone extends FluentType {\n /**\n * Create an instance of `FluentNone` with an optional fallback value.\n * @param value The fallback value of this `FluentNone`.\n */\n constructor(value = \"???\") {\n super(value);\n }\n /**\n * Format this `FluentNone` to the fallback string.\n */\n toString(scope) {\n return `{${this.value}}`;\n }\n}\n/**\n * A {@link FluentType} representing a number.\n *\n * A `FluentNumber` instance stores the number value of the number it\n * represents. It may also store an option bag of options which will be passed\n * to `Intl.NumerFormat` when the `FluentNumber` is formatted to a string.\n */\nexport class FluentNumber extends FluentType {\n /**\n * Create an instance of `FluentNumber` with options to the\n * `Intl.NumberFormat` constructor.\n *\n * @param value The number value of this `FluentNumber`.\n * @param opts Options which will be passed to `Intl.NumberFormat`.\n */\n constructor(value, opts = {}) {\n super(value);\n this.opts = opts;\n }\n /**\n * Format this `FluentNumber` to a string.\n */\n toString(scope) {\n if (scope) {\n try {\n const nf = scope.memoizeIntlObject(Intl.NumberFormat, this.opts);\n return nf.format(this.value);\n }\n catch (err) {\n scope.reportError(err);\n }\n }\n return this.value.toString(10);\n }\n}\n/**\n * A {@link FluentType} representing a date and time.\n *\n * A `FluentDateTime` instance stores a Date object, Temporal object, or a number\n * as a numerical timestamp in milliseconds. It may also store an\n * option bag of options which will be passed to `Intl.DateTimeFormat` when the\n * `FluentDateTime` is formatted to a string.\n */\nexport class FluentDateTime extends FluentType {\n static supportsValue(value) {\n if (typeof value === \"number\")\n return true;\n if (value instanceof Date)\n return true;\n if (value instanceof FluentType)\n return FluentDateTime.supportsValue(value.valueOf());\n // Temporary workaround to support environments without Temporal\n if (\"Temporal\" in globalThis) {\n // for TypeScript, which doesn't know about Temporal yet\n const _Temporal = globalThis.Temporal;\n if (value instanceof _Temporal.Instant ||\n value instanceof _Temporal.PlainDateTime ||\n value instanceof _Temporal.PlainDate ||\n value instanceof _Temporal.PlainMonthDay ||\n value instanceof _Temporal.PlainTime ||\n value instanceof _Temporal.PlainYearMonth) {\n return true;\n }\n }\n return false;\n }\n /**\n * Create an instance of `FluentDateTime` with options to the\n * `Intl.DateTimeFormat` constructor.\n *\n * @param value The number value of this `FluentDateTime`, in milliseconds.\n * @param opts Options which will be passed to `Intl.DateTimeFormat`.\n */\n constructor(value, opts = {}) {\n // unwrap any FluentType value, but only retain the opts from FluentDateTime\n if (value instanceof FluentDateTime) {\n opts = { ...value.opts, ...opts };\n value = value.value;\n }\n else if (value instanceof FluentType) {\n value = value.valueOf();\n }\n // Intl.DateTimeFormat defaults to gregorian calendar, but Temporal defaults to iso8601\n if (typeof value === \"object\" &&\n \"calendarId\" in value &&\n opts.calendar === undefined) {\n opts = { ...opts, calendar: value.calendarId };\n }\n super(value);\n this.opts = opts;\n }\n [Symbol.toPrimitive](hint) {\n return hint === \"string\" ? this.toString() : this.toNumber();\n }\n /**\n * Convert this `FluentDateTime` to a number.\n * Note that this isn't always possible due to the nature of Temporal objects.\n * In such cases, a TypeError will be thrown.\n */\n toNumber() {\n const value = this.value;\n if (typeof value === \"number\")\n return value;\n if (value instanceof Date)\n return value.getTime();\n if (\"epochMilliseconds\" in value) {\n return value.epochMilliseconds;\n }\n if (\"toZonedDateTime\" in value) {\n return value.toZonedDateTime(\"UTC\").epochMilliseconds;\n }\n throw new TypeError(\"Unwrapping a non-number value as a number\");\n }\n /**\n * Format this `FluentDateTime` to a string.\n */\n toString(scope) {\n if (scope) {\n try {\n const dtf = scope.memoizeIntlObject(Intl.DateTimeFormat, this.opts);\n return dtf.format(this.value);\n }\n catch (err) {\n scope.reportError(err);\n }\n }\n if (typeof this.value === \"number\" || this.value instanceof Date) {\n return new Date(this.value).toISOString();\n }\n return this.value.toString();\n }\n}\n","/**\n * The role of the Fluent resolver is to format a `Pattern` to an instance of\n * `FluentValue`. For performance reasons, primitive strings are considered\n * such instances, too.\n *\n * Translations can contain references to other messages or variables,\n * conditional logic in form of select expressions, traits which describe their\n * grammatical features, and can use Fluent builtins which make use of the\n * `Intl` formatters to format numbers and dates into the bundle's languages.\n * See the documentation of the Fluent syntax for more information.\n *\n * In case of errors the resolver will try to salvage as much of the\n * translation as possible. In rare situations where the resolver didn't know\n * how to recover from an error it will return an instance of `FluentNone`.\n *\n * All expressions resolve to an instance of `FluentValue`. The caller should\n * use the `toString` method to convert the instance to a native value.\n *\n * Functions in this file pass around an instance of the `Scope` class, which\n * stores the data required for successful resolution and error recovery.\n */\nimport { FluentType, FluentNone, FluentNumber, FluentDateTime, } from \"./types.js\";\n/**\n * The maximum number of placeables which can be expanded in a single call to\n * `formatPattern`. The limit protects against the Billion Laughs and Quadratic\n * Blowup attacks. See https://msdn.microsoft.com/en-us/magazine/ee335713.aspx.\n */\nconst MAX_PLACEABLES = 100;\n/** Unicode bidi isolation characters. */\nconst FSI = \"\\u2068\";\nconst PDI = \"\\u2069\";\n/** Helper: match a variant key to the given selector. */\nfunction match(scope, selector, key) {\n if (key === selector) {\n // Both are strings.\n return true;\n }\n // XXX Consider comparing options too, e.g. minimumFractionDigits.\n if (key instanceof FluentNumber &&\n selector instanceof FluentNumber &&\n key.value === selector.value) {\n return true;\n }\n if (selector instanceof FluentNumber && typeof key === \"string\") {\n let category = scope\n .memoizeIntlObject(Intl.PluralRules, selector.opts)\n .select(selector.value);\n if (key === category) {\n return true;\n }\n }\n return false;\n}\n/** Helper: resolve the default variant from a list of variants. */\nfunction getDefault(scope, variants, star) {\n if (variants[star]) {\n return resolvePattern(scope, variants[star].value);\n }\n scope.reportError(new RangeError(\"No default\"));\n return new FluentNone();\n}\n/** Helper: resolve arguments to a call expression. */\nfunction getArguments(scope, args) {\n const positional = [];\n const named = Object.create(null);\n for (const arg of args) {\n if (arg.type === \"narg\") {\n named[arg.name] = resolveExpression(scope, arg.value);\n }\n else {\n positional.push(resolveExpression(scope, arg));\n }\n }\n return { positional, named };\n}\n/** Resolve an expression to a Fluent type. */\nfunction resolveExpression(scope, expr) {\n switch (expr.type) {\n case \"str\":\n return expr.value;\n case \"num\":\n return new FluentNumber(expr.value, {\n minimumFractionDigits: expr.precision,\n });\n case \"var\":\n return resolveVariableReference(scope, expr);\n case \"mesg\":\n return resolveMessageReference(scope, expr);\n case \"term\":\n return resolveTermReference(scope, expr);\n case \"func\":\n return resolveFunctionReference(scope, expr);\n case \"select\":\n return resolveSelectExpression(scope, expr);\n default:\n return new FluentNone();\n }\n}\n/** Resolve a reference to a variable. */\nfunction resolveVariableReference(scope, { name }) {\n let arg;\n if (scope.params) {\n // We're inside a TermReference. It's OK to reference undefined parameters.\n if (Object.prototype.hasOwnProperty.call(scope.params, name)) {\n arg = scope.params[name];\n }\n else {\n return new FluentNone(`$${name}`);\n }\n }\n else if (scope.args &&\n Object.prototype.hasOwnProperty.call(scope.args, name)) {\n // We're in the top-level Pattern or inside a MessageReference. Missing\n // variables references produce ReferenceErrors.\n arg = scope.args[name];\n }\n else {\n scope.reportError(new ReferenceError(`Unknown variable: $${name}`));\n return new FluentNone(`$${name}`);\n }\n // Return early if the argument already is an instance of FluentType.\n if (arg instanceof FluentType) {\n return arg;\n }\n // Convert the argument to a Fluent type.\n switch (typeof arg) {\n case \"string\":\n return arg;\n case \"number\":\n return new FluentNumber(arg);\n case \"object\":\n if (FluentDateTime.supportsValue(arg)) {\n return new FluentDateTime(arg);\n }\n // eslint-disable-next-line no-fallthrough\n default:\n scope.reportError(new TypeError(`Variable type not supported: $${name}, ${typeof arg}`));\n return new FluentNone(`$${name}`);\n }\n}\n/** Resolve a reference to another message. */\nfunction resolveMessageReference(scope, { name, attr }) {\n const message = scope.bundle._messages.get(name);\n if (!message) {\n scope.reportError(new ReferenceError(`Unknown message: ${name}`));\n return new FluentNone(name);\n }\n if (attr) {\n const attribute = message.attributes[attr];\n if (attribute) {\n return resolvePattern(scope, attribute);\n }\n scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`));\n return new FluentNone(`${name}.${attr}`);\n }\n if (message.value) {\n return resolvePattern(scope, message.value);\n }\n scope.reportError(new ReferenceError(`No value: ${name}`));\n return new FluentNone(name);\n}\n/** Resolve a call to a Term with key-value arguments. */\nfunction resolveTermReference(scope, { name, attr, args }) {\n const id = `-${name}`;\n const term = scope.bundle._terms.get(id);\n if (!term) {\n scope.reportError(new ReferenceError(`Unknown term: ${id}`));\n return new FluentNone(id);\n }\n if (attr) {\n const attribute = term.attributes[attr];\n if (attribute) {\n // Every TermReference has its own variables.\n scope.params = getArguments(scope, args).named;\n const resolved = resolvePattern(scope, attribute);\n scope.params = null;\n return resolved;\n }\n scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`));\n return new FluentNone(`${id}.${attr}`);\n }\n scope.params = getArguments(scope, args).named;\n const resolved = resolvePattern(scope, term.value);\n scope.params = null;\n return resolved;\n}\n/** Resolve a call to a Function with positional and key-value arguments. */\nfunction resolveFunctionReference(scope, { name, args }) {\n // Some functions are built-in. Others may be provided by the runtime via\n // the `FluentBundle` constructor.\n let func = scope.bundle._functions[name];\n if (!func) {\n scope.reportError(new ReferenceError(`Unknown function: ${name}()`));\n return new FluentNone(`${name}()`);\n }\n if (typeof func !== \"function\") {\n scope.reportError(new TypeError(`Function ${name}() is not callable`));\n return new FluentNone(`${name}()`);\n }\n try {\n let resolved = getArguments(scope, args);\n return func(resolved.positional, resolved.named);\n }\n catch (err) {\n scope.reportError(err);\n return new FluentNone(`${name}()`);\n }\n}\n/** Resolve a select expression to the member object. */\nfunction resolveSelectExpression(scope, { selector, variants, star }) {\n let sel = resolveExpression(scope, selector);\n if (sel instanceof FluentNone) {\n return getDefault(scope, variants, star);\n }\n // Match the selector against keys of each variant, in order.\n for (const variant of variants) {\n const key = resolveExpression(scope, variant.key);\n if (match(scope, sel, key)) {\n return resolvePattern(scope, variant.value);\n }\n }\n return getDefault(scope, variants, star);\n}\n/** Resolve a pattern (a complex string with placeables). */\nexport function resolveComplexPattern(scope, ptn) {\n if (scope.dirty.has(ptn)) {\n scope.reportError(new RangeError(\"Cyclic reference\"));\n return new FluentNone();\n }\n // Tag the pattern as dirty for the purpose of the current resolution.\n scope.dirty.add(ptn);\n const result = [];\n // Wrap interpolations with Directional Isolate Formatting characters\n // only when the pattern has more than one element.\n const useIsolating = scope.bundle._useIsolating && ptn.length > 1;\n for (const elem of ptn) {\n if (typeof elem === \"string\") {\n result.push(scope.bundle._transform(elem));\n continue;\n }\n scope.placeables++;\n if (scope.placeables > MAX_PLACEABLES) {\n scope.dirty.delete(ptn);\n // This is a fatal error which causes the resolver to instantly bail out\n // on this pattern. The length check protects against excessive memory\n // usage, and throwing protects against eating up the CPU when long\n // placeables are deeply nested.\n throw new RangeError(`Too many placeables expanded: ${scope.placeables}, ` +\n `max allowed is ${MAX_PLACEABLES}`);\n }\n if (useIsolating) {\n result.push(FSI);\n }\n result.push(resolveExpression(scope, elem).toString(scope));\n if (useIsolating) {\n result.push(PDI);\n }\n }\n scope.dirty.delete(ptn);\n return result.join(\"\");\n}\n/**\n * Resolve a simple or a complex Pattern to a FluentString\n * (which is really the string primitive).\n */\nfunction resolvePattern(scope, value) {\n // Resolve a simple pattern.\n if (typeof value === \"string\") {\n return scope.bundle._transform(value);\n }\n return resolveComplexPattern(scope, value);\n}\n","export class Scope {\n constructor(bundle, errors, args) {\n /**\n * The Set of patterns already encountered during this resolution.\n * Used to detect and prevent cyclic resolutions.\n * @ignore\n */\n this.dirty = new WeakSet();\n /** A dict of parameters passed to a TermReference. */\n this.params = null;\n /**\n * The running count of placeables resolved so far.\n * Used to detect the Billion Laughs and Quadratic Blowup attacks.\n * @ignore\n */\n this.placeables = 0;\n this.bundle = bundle;\n this.errors = errors;\n this.args = args;\n }\n reportError(error) {\n if (!this.errors || !(error instanceof Error)) {\n throw error;\n }\n this.errors.push(error);\n }\n memoizeIntlObject(ctor, opts) {\n let cache = this.bundle._intls.get(ctor);\n if (!cache) {\n cache = {};\n this.bundle._intls.set(ctor, cache);\n }\n let id = JSON.stringify(opts);\n if (!cache[id]) {\n // @ts-expect-error This is fine.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n cache[id] = new ctor(this.bundle.locales, opts);\n }\n return cache[id];\n }\n}\n","/**\n * @overview\n *\n * The FTL resolver ships with a number of functions built-in.\n *\n * Each function take two arguments:\n * - args - an array of positional args\n * - opts - an object of key-value args\n *\n * Arguments to functions are guaranteed to already be instances of\n * `FluentValue`. Functions must return `FluentValues` as well.\n */\nimport { FluentNone, FluentNumber, FluentDateTime, } from \"./types.js\";\nfunction values(opts, allowed) {\n const unwrapped = Object.create(null);\n for (const [name, opt] of Object.entries(opts)) {\n if (allowed.includes(name)) {\n unwrapped[name] = opt.valueOf();\n }\n }\n return unwrapped;\n}\nconst NUMBER_ALLOWED = [\n \"unitDisplay\",\n \"currencyDisplay\",\n \"useGrouping\",\n \"minimumIntegerDigits\",\n \"minimumFractionDigits\",\n \"maximumFractionDigits\",\n \"minimumSignificantDigits\",\n \"maximumSignificantDigits\",\n];\n/**\n * The implementation of the `NUMBER()` builtin available to translations.\n *\n * Translations may call the `NUMBER()` builtin in order to specify formatting\n * options of a number. For example:\n *\n * pi = The value of π is {NUMBER($pi, maximumFractionDigits: 2)}.\n *\n * The implementation expects an array of {@link FluentValue | FluentValues} representing the\n * positional arguments, and an object of named {@link FluentValue | FluentValues} representing the\n * named parameters.\n *\n * The following options are recognized:\n *\n * unitDisplay\n * currencyDisplay\n * useGrouping\n * minimumIntegerDigits\n * minimumFractionDigits\n * maximumFractionDigits\n * minimumSignificantDigits\n * maximumSignificantDigits\n *\n * Other options are ignored.\n *\n * @param args The positional arguments passed to this `NUMBER()`.\n * @param opts The named argments passed to this `NUMBER()`.\n */\nexport function NUMBER(args, opts) {\n let arg = args[0];\n if (arg instanceof FluentNone) {\n return new FluentNone(`NUMBER(${arg.valueOf()})`);\n }\n if (arg instanceof FluentNumber) {\n return new FluentNumber(arg.valueOf(), {\n ...arg.opts,\n ...values(opts, NUMBER_ALLOWED),\n });\n }\n if (arg instanceof FluentDateTime) {\n return new FluentNumber(arg.toNumber(), {\n ...values(opts, NUMBER_ALLOWED),\n });\n }\n throw new TypeError(\"Invalid argument to NUMBER\");\n}\nconst DATETIME_ALLOWED = [\n \"dateStyle\",\n \"timeStyle\",\n \"fractionalSecondDigits\",\n \"dayPeriod\",\n \"hour12\",\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n];\n/**\n * The implementation of the `DATETIME()` builtin available to translations.\n *\n * Translations may call the `DATETIME()` builtin in order to specify\n * formatting options of a number. For example:\n *\n * now = It's {DATETIME($today, month: \"long\")}.\n *\n * The implementation expects an array of {@link FluentValue | FluentValues} representing the\n * positional arguments, and an object of named {@link FluentValue | FluentValues} representing the\n * named parameters.\n *\n * The following options are recognized:\n *\n * dateStyle\n * timeStyle\n * fractionalSecondDigits\n * dayPeriod\n * hour12\n * weekday\n * era\n * year\n * month\n * day\n * hour\n * minute\n * second\n * timeZoneName\n *\n * Other options are ignored.\n *\n * @param args The positional arguments passed to this `DATETIME()`.\n * @param opts The named argments passed to this `DATETIME()`.\n */\nexport function DATETIME(args, opts) {\n let arg = args[0];\n if (arg instanceof FluentNone) {\n return new FluentNone(`DATETIME(${arg.valueOf()})`);\n }\n if (arg instanceof FluentDateTime || arg instanceof FluentNumber) {\n return new FluentDateTime(arg, values(opts, DATETIME_ALLOWED));\n }\n throw new TypeError(\"Invalid argument to DATETIME\");\n}\n","const cache = new Map();\nexport function getMemoizerForLocale(locales) {\n const stringLocale = Array.isArray(locales) ? locales.join(\" \") : locales;\n let memoizer = cache.get(stringLocale);\n if (memoizer === undefined) {\n memoizer = new Map();\n cache.set(stringLocale, memoizer);\n }\n return memoizer;\n}\n","import { resolveComplexPattern } from \"./resolver.js\";\nimport { Scope } from \"./scope.js\";\nimport { FluentNone } from \"./types.js\";\nimport { NUMBER, DATETIME } from \"./builtins.js\";\nimport { getMemoizerForLocale } from \"./memoizer.js\";\n/**\n * Message bundles are single-language stores of translation resources. They are\n * responsible for formatting message values and attributes to strings.\n */\nexport class FluentBundle {\n /**\n * Create an instance of `FluentBundle`.\n *\n * @example\n * ```js\n * let bundle = new FluentBundle([\"en-US\", \"en\"]);\n *\n * let bundle = new FluentBundle(locales, {useIsolating: false});\n *\n * let bundle = new FluentBundle(locales, {\n * useIsolating: true,\n * functions: {\n * NODE_ENV: () => process.env.NODE_ENV\n * }\n * });\n * ```\n *\n * @param locales - Used to instantiate `Intl` formatters used by translations.\n * @param options - Optional configuration for the bundle.\n */\n constructor(locales, { functions, useIsolating = true, transform = (v) => v, } = {}) {\n /** @ignore */\n this._terms = new Map();\n /** @ignore */\n this._messages = new Map();\n this.locales = Array.isArray(locales) ? locales : [locales];\n this._functions = {\n NUMBER,\n DATETIME,\n ...functions,\n };\n this._useIsolating = useIsolating;\n this._transform = transform;\n this._intls = getMemoizerForLocale(locales);\n }\n /**\n * Check if a message is present in the bundle.\n *\n * @param id - The identifier of the message to check.\n */\n hasMessage(id) {\n return this._messages.has(id);\n }\n /**\n * Return a raw unformatted message object from the bundle.\n *\n * Raw messages are `{value, attributes}` shapes containing translation units\n * called `Patterns`. `Patterns` are implementation-specific; they should be\n * treated as black boxes and formatted with `FluentBundle.formatPattern`.\n *\n * @param id - The identifier of the message to check.\n */\n getMessage(id) {\n return this._messages.get(id);\n }\n /**\n * Add a translation resource to the bundle.\n *\n * @example\n * ```js\n * let res = new FluentResource(\"foo = Foo\");\n * bundle.addResource(res);\n * bundle.getMessage(\"foo\");\n * // → {value: .., attributes: {..}}\n * ```\n *\n * @param res\n * @param options\n */\n addResource(res, { allowOverrides = false, } = {}) {\n const errors = [];\n for (let i = 0; i < res.body.length; i++) {\n let entry = res.body[i];\n if (entry.id.startsWith(\"-\")) {\n // Identifiers starting with a dash (-) define terms. Terms are private\n // and cannot be retrieved from FluentBundle.\n if (allowOverrides === false && this._terms.has(entry.id)) {\n errors.push(new Error(`Attempt to override an existing term: \"${entry.id}\"`));\n continue;\n }\n this._terms.set(entry.id, entry);\n }\n else {\n if (allowOverrides === false && this._messages.has(entry.id)) {\n errors.push(new Error(`Attempt to override an existing message: \"${entry.id}\"`));\n continue;\n }\n this._messages.set(entry.id, entry);\n }\n }\n return errors;\n }\n /**\n * Format a `Pattern` to a string.\n *\n * Format a raw `Pattern` into a string. `args` will be used to resolve\n * references to variables passed as arguments to the translation.\n *\n * In case of errors `formatPattern` will try to salvage as much of the\n * translation as possible and will still return a string. For performance\n * reasons, the encountered errors are not returned but instead are appended\n * to the `errors` array passed as the third argument.\n *\n * If `errors` is omitted, the first encountered error will be thrown.\n *\n * @example\n * ```js\n * let errors = [];\n * bundle.addResource(\n * new FluentResource(\"hello = Hello, {$name}!\"));\n *\n * let hello = bundle.getMessage(\"hello\");\n * if (hello.value) {\n * bundle.formatPattern(hello.value, {name: \"Jane\"}, errors);\n * // Returns \"Hello, Jane!\" and `errors` is empty.\n *\n * bundle.formatPattern(hello.value, undefined, errors);\n * // Returns \"Hello, {$name}!\" and `errors` is now:\n * // [<ReferenceError: Unknown variable: name>]\n * }\n * ```\n */\n formatPattern(pattern, args = null, errors = null) {\n // Resolve a simple pattern without creating a scope. No error handling is\n // required; by definition simple patterns don't have placeables.\n if (typeof pattern === \"string\") {\n return this._transform(pattern);\n }\n // Resolve a complex pattern.\n let scope = new Scope(this, errors, args);\n try {\n let value = resolveComplexPattern(scope, pattern);\n return value.toString(scope);\n }\n catch (err) {\n if (scope.errors && err instanceof Error) {\n scope.errors.push(err);\n return new FluentNone().toString(scope);\n }\n throw err;\n }\n }\n}\n","// This regex is used to iterate through the beginnings of messages and terms.\n// With the /m flag, the ^ matches at the beginning of every line.\nconst RE_MESSAGE_START = /^(-?[a-zA-Z][\\w-]*) *= */gm;\n// Both Attributes and Variants are parsed in while loops. These regexes are\n// used to break out of them.\nconst RE_ATTRIBUTE_START = /\\.([a-zA-Z][\\w-]*) *= */y;\nconst RE_VARIANT_START = /\\*?\\[/y;\nconst RE_NUMBER_LITERAL = /(-?[0-9]+(?:\\.([0-9]+))?)/y;\nconst RE_IDENTIFIER = /([a-zA-Z][\\w-]*)/y;\nconst RE_REFERENCE = /([$-])?([a-zA-Z][\\w-]*)(?:\\.([a-zA-Z][\\w-]*))?/y;\nconst RE_FUNCTION_NAME = /^[A-Z][A-Z0-9_-]*$/;\n// A \"run\" is a sequence of text or string literal characters which don't\n// require any special handling. For TextElements such special characters are: {\n// (starts a placeable), and line breaks which require additional logic to check\n// if the next line is indented. For StringLiterals they are: \\ (starts an\n// escape sequence), \" (ends the literal), and line breaks which are not allowed\n// in StringLiterals. Note that string runs may be empty; text runs may not.\nconst RE_TEXT_RUN = /([^{}\\n\\r]+)/y;\nconst RE_STRING_RUN = /([^\\\\\"\\n\\r]*)/y;\n// Escape sequences.\nconst RE_STRING_ESCAPE = /\\\\([\\\\\"])/y;\nconst RE_UNICODE_ESCAPE = /\\\\u([a-fA-F0-9]{4})|\\\\U([a-fA-F0-9]{6})/y;\n// Used for trimming TextElements and indents.\nconst RE_LEADING_NEWLINES = /^\\n+/;\nconst RE_TRAILING_SPACES = / +$/;\n// Used in makeIndent to strip spaces from blank lines and normalize CRLF to LF.\nconst RE_BLANK_LINES = / *\\r?\\n/g;\n// Used in makeIndent to measure the indentation.\nconst RE_INDENT = /( *)$/;\n// Common tokens.\nconst TOKEN_BRACE_OPEN = /{\\s*/y;\nconst TOKEN_BRACE_CLOSE = /\\s*}/y;\nconst TOKEN_BRACKET_OPEN = /\\[\\s*/y;\nconst TOKEN_BRACKET_CLOSE = /\\s*] */y;\nconst TOKEN_PAREN_OPEN = /\\s*\\(\\s*/y;\nconst TOKEN_ARROW = /\\s*->\\s*/y;\nconst TOKEN_COLON = /\\s*:\\s*/y;\n// Note the optional comma. As a deviation from the Fluent EBNF, the parser\n// doesn't enforce commas between call arguments.\nconst TOKEN_COMMA = /\\s*,?\\s*/y;\nconst TOKEN_BLANK = /\\s+/y;\n/**\n * Fluent Resource is a structure storing parsed localization entries.\n */\nexport class FluentResource {\n constructor(source) {\n this.body = [];\n RE_MESSAGE_START.lastIndex = 0;\n let cursor = 0;\n // Iterate over the beginnings of messages and terms to efficiently skip\n // comments and recover from errors.\n while (true) {\n let next = RE_MESSAGE_START.exec(source);\n if (next === null) {\n break;\n }\n cursor = RE_MESSAGE_START.lastIndex;\n try {\n this.body.push(parseMessage(next[1]));\n }\n catch (err) {\n if (err instanceof SyntaxError) {\n // Don't report any Fluent syntax errors. Skip directly to the\n // beginning of the next message or term.\n continue;\n }\n throw err;\n }\n }\n // The parser implementation is inlined below for performance reasons,\n // as well as for convenience of accessing `source` and `cursor`.\n // The parser focuses on minimizing the number of false negatives at the\n // expense of increasing the risk of false positives. In other words, it\n // aims at parsing valid Fluent messages with a success rate of 100%, but it\n // may also parse a few invalid messages which the reference parser would\n // reject. The parser doesn't perform any validation and may produce entries\n // which wouldn't make sense in the real world. For best results users are\n // advised to validate translations with the fluent-syntax parser\n // pre-runtime.\n // The parser makes an extensive use of sticky regexes which can be anchored\n // to any offset of the source string without slicing it. Errors are thrown\n // to bail out of parsing of ill-formed messages.\n function test(re) {\n re.lastIndex = cursor;\n return re.test(source);\n }\n // Advance the cursor by the char if it matches. May be used as a predicate\n // (was the match found?) or, if errorClass is passed, as an assertion.\n function consumeChar(char, errorClass) {\n if (source[cursor] === char) {\n cursor++;\n return true;\n }\n if (errorClass) {\n throw new errorClass(`Expected ${char}`);\n }\n return false;\n }\n // Advance the cursor by the token if it matches. May be used as a predicate\n // (was the match found?) or, if errorClass is passed, as an assertion.\n function consumeToken(re, errorClass) {\n if (test(re)) {\n cursor = re.lastIndex;\n return true;\n }\n if (errorClass) {\n throw new errorClass(`Expected ${re.toString()}`);\n }\n return false;\n }\n // Execute a regex, advance the cursor, and return all capture groups.\n function match(re) {\n re.lastIndex = cursor;\n let result = re.exec(source);\n if (result === null) {\n throw new SyntaxError(`Expected ${re.toString()}`);\n }\n cursor = re.lastIndex;\n return result;\n }\n // Execute a regex, advance the cursor, and return the capture group.\n function match1(re) {\n return match(re)[1];\n }\n function parseMessage(id) {\n let value = parsePattern();\n let attributes = parseAttributes();\n if (value === null && Object.keys(attributes).length === 0) {\n throw new SyntaxError(\"Expected message value or attributes\");\n }\n return { id, value, attributes };\n }\n function parseAttributes() {\n let attrs = Object.create(null);\n while (test(RE_ATTRIBUTE_START)) {\n let name = match1(RE_ATTRIBUTE_START);\n let value = parsePattern();\n if (value === null) {\n throw new SyntaxError(\"Expected attribute value\");\n }\n attrs[name] = value;\n }\n return attrs;\n }\n function parsePattern() {\n let first;\n // First try to parse any simple text on the same line as the id.\n if (test(RE_TEXT_RUN)) {\n first = match1(RE_TEXT_RUN);\n }\n // If there's a placeable on the first line, parse a complex pattern.\n if (source[cursor] === \"{\" || source[cursor] === \"}\") {\n // Re-use the text parsed above, if possible.\n return parsePatternElements(first ? [first] : [], Infinity);\n }\n // RE_TEXT_VALUE stops at newlines. Only continue parsing the pattern if\n // what comes after the newline is indented.\n let indent = parseIndent();\n if (indent) {\n if (first) {\n // If there's text on the first line, the blank block is part of the\n // translation content in its entirety.\n return parsePatternElements([first, indent], indent.length);\n }\n // Otherwise, we're dealing with a block pattern, i.e. a pattern which\n // starts on a new line. Discrad the leading newlines but keep the\n // inline indent; it will be used by the dedentation logic.\n indent.value = trim(indent.value, RE_LEADING_NEWLINES);\n return parsePatternElements([indent], indent.length);\n }\n if (first) {\n // It was just a simple inline text after all.\n return trim(first, RE_TRAILING_SPACES);\n }\n return null;\n }\n // Parse a complex pattern as an array of elements.\n function parsePatternElements(elements = [], commonIndent) {\n while (true) {\n if (test(RE_TEXT_RUN)) {\n elements.push(match1(RE_TEXT_RUN));\n continue;\n }\n if (source[cursor] === \"{\") {\n elements.push(parsePlaceable());\n continue;\n }\n if (source[cursor] === \"}\") {\n throw new SyntaxError(\"Unbalanced closing brace\");\n }\n let indent = parseIndent();\n if (indent) {\n elements.push(indent);\n commonIndent = Math.min(commonIndent, indent.length);\n continue;\n }\n break;\n }\n let lastIndex = elements.length - 1;\n let lastElement = elements[lastIndex];\n // Trim the trailing spaces in the last element if it's a TextElement.\n if (typeof lastElement === \"string\") {\n elements[lastIndex] = trim(lastElement, RE_TRAILING_SPACES);\n }\n let baked = [];\n for (let element of elements) {\n if (element instanceof Indent) {\n // Dedent indented lines by the maximum common indent.\n element = element.value.slice(0, element.value.length - commonIndent);\n }\n if (element) {\n baked.push(element);\n }\n }\n return baked;\n }\n function parsePlaceable() {\n consumeToken(TOKEN_BRACE_OPEN, SyntaxError);\n let selector = parseInlineExpression();\n if (consumeToken(TOKEN_BRACE_CLOSE)) {\n return selector;\n }\n if (consumeToken(TOKEN_ARROW)) {\n let variants = parseVariants();\n consumeToken(TOKEN_BRACE_CLOSE, SyntaxError);\n return {\n type: \"select\",\n selector,\n ...variants,\n };\n }\n throw new SyntaxError(\"Unclosed placeable\");\n }\n function parseInlineExpression() {\n if (source[cursor] === \"{\") {\n // It's a nested placeable.\n return parsePlaceable();\n }\n if (test(RE_REFERENCE)) {\n let [, sigil, name, attr = null] = match(RE_REFERENCE);\n if (sigil === \"$\") {\n return { type: \"var\", name };\n }\n if (consumeToken(TOKEN_PAREN_OPEN)) {\n let args = parseArguments();\n if (sigil === \"-\") {\n // A parameterized term: -term(...).\n return { type: \"term\", name, attr, args };\n }\n if (RE_FUNCTION_NAME.test(name)) {\n return { type: \"func\", name, args };\n }\n throw new SyntaxError(\"Function names must be all upper-case\");\n }\n if (sigil === \"-\") {\n // A non-parameterized term: -term.\n return {\n type: \"term\",\n name,\n attr,\n args: [],\n };\n }\n return { type: \"mesg\", name, attr };\n }\n return parseLiteral();\n }\n function parseArguments() {\n let args = [];\n while (true) {\n switch (source[cursor]) {\n case \")\": // End of the argument list.\n cursor++;\n return args;\n case undefined: // EOF\n throw new SyntaxError(\"Unclosed argument list\");\n }\n args.push(parseArgument());\n // Commas between arguments are treated as whitespace.\n consumeToken(TOKEN_COMMA);\n }\n }\n function parseArgument() {\n let expr = parseInlineExpression();\n if (expr.type !== \"mesg\") {\n return expr;\n }\n if (consumeToken(TOKEN_COLON)) {\n // The reference is the beginning of a named argument.\n return {\n type: \"narg\",\n name: expr.name,\n value: parseLiteral(),\n };\n }\n // It's a regular message reference.\n return expr;\n }\n function parseVariants() {\n let variants = [];\n let count = 0;\n let star;\n while (test(RE_VARIANT_START)) {\n if (consumeChar(\"*\")) {\n star = count;\n }\n let key = parseVariantKey();\n let value = parsePattern();\n if (value === null) {\n throw new SyntaxError(\"Expected variant value\");\n }\n variants[count++] = { key, value };\n }\n if (count === 0) {\n return null;\n }\n if (star === undefined) {\n throw new SyntaxError(\"Expected default variant\");\n }\n return { variants, star };\n }\n function parseVariantKey() {\n consumeToken(TOKEN_BRACKET_OPEN, SyntaxError);\n let key;\n if (test(RE_NUMBER_LITERAL)) {\n key = parseNumberLiteral();\n }\n else {\n key = {\n type: \"str\",\n value: match1(RE_IDENTIFIER),\n };\n }\n consumeToken(TOKEN_BRACKET_CLOSE, SyntaxError);\n return key;\n }\n function parseLiteral() {\n if (test(RE_NUMBER_LITERAL)) {\n return parseNumberLiteral();\n }\n if (source[cursor] === '\"') {\n return parseStringLiteral();\n }\n throw new SyntaxError(\"Invalid expression\");\n }\n function parseNumberLiteral() {\n let [, value, fraction = \"\"] = match(RE_NUMBER_LITERAL);\n let precision = fraction.length;\n return {\n type: \"num\",\n value: parseFloat(value),\n precision,\n };\n }\n function parseStringLiteral() {\n consumeChar('\"', SyntaxError);\n let value = \"\";\n while (true) {\n value += match1(RE_STRING_RUN);\n if (source[cursor] === \"\\\\\") {\n value += parseEscapeSequence();\n continue;\n }\n if (consumeChar('\"')) {\n return { type: \"str\", value };\n }\n // We've reached an EOL of EOF.\n throw new SyntaxError(\"Unclosed string literal\");\n }\n }\n // Unescape known escape sequences.\n function parseEscapeSequence() {\n if (test(RE_STRING_ESCAPE)) {\n return match1(RE_STRING_ESCAPE);\n }\n if (test(RE_UNICODE_ESCAPE)) {\n let [, codepoint4, codepoint6] = match(RE_UNICODE_ESCAPE);\n let codepoint = parseInt(codepoint4 || codepoint6, 16);\n return codepoint <= 0xd7ff || 0xe000 <= codepoint\n ? // It's a Unicode scalar value.\n String.fromCodePoint(codepoint)\n : // Lonely surrogates can cause trouble when the parsing result is\n // saved using UTF-8. Use U+FFFD REPLACEMENT CHARACTER instead.\n \"�\";\n }\n throw new SyntaxError(\"Unknown escape sequence\");\n }\n // Parse blank space. Return it if it looks like indent before a pattern\n // line. Skip it othwerwise.\n function parseIndent() {\n let start = cursor;\n consumeToken(TOKEN_BLANK);\n // Check the first non-blank character after the indent.\n switch (source[cursor]) {\n case \".\":\n case \"[\":\n case \"*\":\n case \"}\":\n case undefined: // EOF\n // A special character. End the Pattern.\n return false;\n case \"{\":\n // Placeables don't require indentation (in EBNF: block-placeable).\n // Continue the Pattern.\n return makeIndent(source.slice(start, cursor));\n }\n // If the first character on the line is not one of the special characters\n // listed above, it's a regular text character. Check if there's at least\n // one space of indent before it.\n if (source[cursor - 1] === \" \") {\n // It's an indented text character (in EBNF: indented-char). Continue\n // the Pattern.\n return makeIndent(source.slice(start, cursor));\n }\n // A not-indented text character is likely the identifier of the next\n // message. End the Pattern.\n return false;\n }\n // Trim blanks in text according to the given regex.\n function trim(text, re) {\n return text.replace(re, \"\");\n }\n // Normalize a blank block and extract the indent details.\n function makeIndent(blank) {\n let value = blank.replace(RE_BLANK_LINES, \"\\n\");\n let length = RE_INDENT.exec(blank)[1].length;\n return new Indent(value, length);\n }\n }\n}\nclass Indent {\n constructor(value, length) {\n this.value = value;\n this.length = length;\n }\n}\n","/**\n * A JavaScript implementation of Project Fluent, a localization\n * framework designed to unleash the expressive power of the natural language.\n *\n * @module\n */\nexport { FluentBundle } from \"./bundle.js\";\nexport { FluentResource } from \"./resource.js\";\nexport { FluentType, FluentNone, FluentNumber, FluentDateTime, } from \"./types.js\";\n","/* eslint no-console: [\"error\", {allow: [\"warn\"]}] */\n/* global console */\n// Match the opening angle bracket (<) in HTML tags, and HTML entities like\n// &, &, &.\nconst reOverlay = /<|&#?\\w+;/;\n/**\n * Elements allowed in translations even if they are not present in the source\n * HTML. They are text-level elements as defined by the HTML5 spec:\n * https://www.w3.org/TR/html5/text-level-semantics.html with the exception of:\n *\n * - a - because we don't allow href on it anyways,\n * - ruby, rt, rp - because we don't allow nested elements to be inserted.\n */\nconst TEXT_LEVEL_ELEMENTS = {\n \"http://www.w3.org/1999/xhtml\": [\n \"em\",\n \"strong\",\n \"small\",\n \"s\",\n \"cite\",\n \"q\",\n \"dfn\",\n \"abbr\",\n \"data\",\n \"time\",\n \"code\",\n \"var\",\n \"samp\",\n \"kbd\",\n \"sub\",\n \"sup\",\n \"i\",\n \"b\",\n \"u\",\n \"mark\",\n \"bdi\",\n \"bdo\",\n \"span\",\n \"br\",\n \"wbr\",\n ],\n};\nconst LOCALIZABLE_ATTRIBUTES = {\n \"http://www.w3.org/1999/xhtml\": {\n global: [\"title\", \"aria-description\", \"aria-label\", \"aria-valuetext\"],\n a: [\"download\"],\n area: [\"download\", \"alt\"],\n // value is special-cased in isAttrNameLocalizable\n input: [\"alt\", \"placeholder\"],\n menuitem: [\"label\"],\n menu: [\"label\"],\n optgroup: [\"label\"],\n option: [\"label\"],\n track: [\"label\"],\n img: [\"alt\"],\n textarea: [\"placeholder\"],\n th: [\"abbr\"],\n },\n \"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul\": {\n global: [\n \"accesskey\",\n \"aria-label\",\n \"aria-valuetext\",\n \"label\",\n \"title\",\n \"tooltiptext\",\n ],\n description: [\"value\"],\n key: [\"key\", \"keycode\"],\n label: [\"value\"],\n textbox: [\"placeholder\", \"value\"],\n },\n};\n/**\n * Translate an element.\n *\n * Translate the element's text content and attributes. Some HTML markup is\n * allowed in the translation. The element's children with the data-l10n-name\n * attribute will be treated as arguments to the translation. If the\n * translation defines the same children, their attributes and text contents\n * will be used for translating the matching source child.\n *\n * @param {Element} element\n * @param {Object} translation\n * @private\n */\nexport default function translateElement(element, translation) {\n const { value } = translation;\n if (typeof value === \"string\") {\n if (element.localName === \"title\" &&\n element.namespaceURI === \"http://www.w3.org/1999/xhtml\") {\n // A special case for the HTML title element whose content must be text.\n element.textContent = value;\n }\n else if (!reOverlay.test(value)) {\n // If the translation doesn't contain any markup skip the overlay logic.\n element.textContent = value;\n }\n else {\n // Else parse the translation's HTML using an inert template element,\n // sanitize it and replace the element's content.\n const templateElement = element.ownerDocument.createElementNS(\"http://www.w3.org/1999/xhtml\", \"template\");\n templateElement.innerHTML = value;\n overlayChildNodes(templateElement.content, element);\n }\n }\n // Even if the translation doesn't define any localizable attributes, run\n // overlayAttributes to remove any localizable attributes set by previous\n // translations.\n overlayAttributes(translation, element);\n}\n/**\n * Replace child nodes of an element with child nodes of another element.\n *\n * The contents of the target element will be cleared and fully replaced with\n * sanitized contents of the source element.\n *\n * @param {DocumentFragment} fromFragment - The source of children to overlay.\n * @param {Element} toElement - The target of the overlay.\n * @private\n */\nfunction overlayChildNodes(fromFragment, toElement) {\n for (const childNode of fromFragment.childNodes) {\n if (childNode.nodeType === childNode.TEXT_NODE) {\n // Keep the translated text node.\n continue;\n }\n if (childNode.hasAttribute(\"data-l10n-name\")) {\n const sanitized = getNodeForNamedElement(toElement, childNode);\n fromFragment.replaceChild(sanitized, childNode);\n continue;\n }\n if (isElementAllowed(childNode)) {\n const sanitized = createSanitizedElement(childNode);\n fromFragment.replaceChild(sanitized, childNode);\n continue;\n }\n console.warn(`An element of forbidden type \"${childNode.localName}\" was found in ` +\n \"the translation. Only safe text-level elements and elements with \" +\n \"data-l10n-name are allowed.\");\n // If all else fails, replace the element with its text content.\n fromFragment.replaceChild(createTextNodeFromTextContent(childNode), childNode);\n }\n toElement.textContent = \"\";\n toElement.appendChild(fromFragment);\n}\nfunction hasAttribute(attributes, name) {\n if (!attributes) {\n return false;\n }\n for (let attr of attributes) {\n if (attr.name === name) {\n return true;\n }\n }\n return false;\n}\n/**\n * Transplant localizable attributes of an element to another element.\n *\n * Any localizable attributes already set on the target element will be\n * cleared.\n *\n * @param {Element|Object} fromElement - The source of child nodes to overlay.\n * @param {Element} toElement - The target of the overlay.\n * @private\n */\nfunction overlayAttributes(fromElement, toElement) {\n const explicitlyAllowed = toElement.hasAttribute(\"data-l10n-attrs\")\n ? toElement\n .getAttribute(\"data-l10n-attrs\")\n .split(\",\")\n .map(i => i.trim())\n : null;\n // Remove existing localizable attributes if they\n // will not be used in the new translation.\n for (const attr of Array.from(toElement.attributes)) {\n if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) &&\n !hasAttribute(fromElement.attributes, attr.name)) {\n toElement.removeAttribute(attr.name);\n }\n }\n // fromElement might be a {value, attributes} object as returned by\n // Localization.messageFromBundle. In which case attributes may be null to\n // save GC cycles.\n if (!fromElement.attributes) {\n return;\n }\n // Set localizable attributes.\n for (const attr of Array.from(fromElement.attributes)) {\n if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) &&\n toElement.getAttribute(attr.name) !== attr.value) {\n toElement.setAttribute(attr.name, attr.value);\n }\n }\n}\n/**\n * Sanitize a child element created by the translation.\n *\n * Try to find a corresponding child in sourceElement and use it as the base\n * for the sanitization. This will preserve functional attribtues defined on\n * the child element in the source HTML.\n *\n * @param {Element} sourceElement - The source for data-l10n-name lookups.\n * @param {Element} translatedChild - The translated child to be sanitized.\n * @returns {Element}\n * @private\n */\nfunction getNodeForNamedElement(sourceElement, translatedChild) {\n const childName = translatedChild.getAttribute(\"data-l10n-name\");\n const sourceChild = sourceElement.querySelector(`[data-l10n-name=\"${childName}\"]`);\n if (!sourceChild) {\n console.warn(`An element named \"${childName}\" wasn't found in the source.`);\n return createTextNodeFromTextContent(translatedChild);\n }\n if (sourceChild.localName !== translatedChild.localName) {\n console.warn(`An element named \"${childName}\" was found in the translation ` +\n `but its type ${translatedChild.localName} didn't match the ` +\n `element found in the source (${sourceChild.localName}).`);\n return createTextNodeFromTextContent(translatedChild);\n }\n // Remove it from sourceElement so that the translation cannot use\n // the same reference name again.\n sourceElement.removeChild(sourceChild);\n // We can't currently guarantee that a translation won't remove\n // sourceChild from the element completely, which could break the app if\n // it relies on an event handler attached to the sourceChild. Let's make\n // this limitation explicit for now by breaking the identitiy of the\n // sourceChild by cloning it. This will destroy all event handlers\n // attached to sourceChild via addEventListener and via on<name>\n // properties.\n const clone = sourceChild.cloneNode(false);\n return shallowPopulateUsing(translatedChild, clone);\n}\n/**\n * Sanitize an allowed element.\n *\n * Text-level elements allowed in translations may only use safe attributes\n * and will have any nested markup stripped to text content.\n *\n * @param {Element} element - The element to be sanitized.\n * @returns {Element}\n * @private\n */\nfunction createSanitizedElement(element) {\n // Start with an empty element of the same type to remove nested children\n // and non-localizable attributes defined by the translation.\n const clone = element.ownerDocument.createElement(element.localName);\n return shallowPopulateUsing(element, clone);\n}\n/**\n * Convert an element to a text node.\n *\n * @param {Element} element - The element to be sanitized.\n * @returns {Node}\n * @private\n */\nfunction createTextNodeFromTextContent(element) {\n return element.ownerDocument.createTextNode(element.textContent);\n}\n/**\n * Check if element is allowed in the translation.\n *\n * This method is used by the sanitizer when the translation markup contains\n * an element which is not present in the source code.\n *\n * @param {Element} element\n * @returns {boolean}\n * @private\n */\nfunction isElementAllowed(element) {\n const allowed = TEXT_LEVEL_ELEMENTS[element.namespaceURI];\n return allowed && allowed.includes(element.localName);\n}\n/**\n * Check if attribute is allowed for the given element.\n *\n * This method is used by the sanitizer when the translation markup contains\n * DOM attributes, or when the translation has traits which map to DOM\n * attributes.\n *\n * `explicitlyAllowed` can be passed as a list of attributes explicitly\n * allowed on this element.\n *\n * @param {string} name\n * @param {Element} element\n * @param {Array} explicitlyAllowed\n * @returns {boolean}\n * @private\n */\nfunction isAttrNameLocalizable(name, element, explicitlyAllowed = null) {\n if (explicitlyAllowed && explicitlyAllowed.includes(name)) {\n return true;\n }\n const allowed = LOCALIZABLE_ATTRIBUTES[element.namespaceURI];\n if (!allowed) {\n return false;\n }\n const attrName = name.toLowerCase();\n const elemName = element.localName;\n // Is it a globally safe attribute?\n if (allowed.global.includes(attrName)) {\n return true;\n }\n // Are there no allowed attributes for this element?\n if (!allowed[elemName]) {\n return false;\n }\n // Is it allowed on this element?\n if (allowed[elemName].includes(attrName)) {\n return true;\n }\n // Special case for value on HTML inputs with type button, reset, submit\n if (element.namespaceURI === \"http://www.w3.org/1999/xhtml\" &&\n elemName === \"input\" &&\n attrName === \"value\") {\n const type = element.type.toLowerCase();\n if (type === \"submit\" || type === \"button\" || type === \"reset\") {\n return true;\n }\n }\n return false;\n}\n/**\n * Helper to set textContent and localizable attributes on an element.\n *\n * @param {Element} fromElement\n * @param {Element} toElement\n * @returns {Element}\n * @private\n */\nfunction shallowPopulateUsing(fromElement, toElement) {\n toElement.textContent = fromElement.textContent;\n overlayAttributes(fromElement, toElement);\n return toElement;\n}\n","/*\n * Base CachedIterable class.\n */\nexport default class CachedIterable extends Array {\n /**\n * Create a `CachedIterable` instance from an iterable or, if another\n * instance of `CachedIterable` is passed, return it without any\n * modifications.\n *\n * @param {Iterable} iterable\n * @returns {CachedIterable}\n */\n static from(iterable) {\n if (iterable instanceof this) {\n return iterable;\n }\n\n return new this(iterable);\n }\n}\n","import CachedIterable from \"./cached_iterable.mjs\";\n\n/*\n * CachedSyncIterable caches the elements yielded by an iterable.\n *\n * It can be used to iterate over an iterable many times without depleting the\n * iterable.\n */\nexport default class CachedSyncIterable extends CachedIterable {\n /**\n * Create an `CachedSyncIterable` instance.\n *\n * @param {Iterable} iterable\n * @returns {CachedSyncIterable}\n */\n constructor(iterable) {\n super();\n\n if (Symbol.iterator in Object(iterable)) {\n this.iterator = iterable[Symbol.iterator]();\n } else {\n throw new TypeError(\"Argument must implement the iteration protocol.\");\n }\n }\n\n [Symbol.iterator]() {\n const cached = this;\n let cur = 0;\n\n return {\n next() {\n if (cached.length <= cur) {\n cached.push(cached.iterator.next());\n }\n return cached[cur++];\n }\n };\n }\n\n /**\n * This method allows user to consume the next element from the iterator\n * into the cache.\n *\n * @param {number} count - number of elements to consume\n */\n touchNext(count = 1) {\n let idx = 0;\n while (idx++ < count) {\n const last = this[this.length - 1];\n if (last && last.done) {\n break;\n }\n this.push(this.iterator.next());\n }\n // Return the last cached {value, done} object to allow the calling\n // code to decide if it needs to call touchNext again.\n return this[this.length - 1];\n }\n}\n","import CachedIterable from \"./cached_iterable.mjs\";\n\n/*\n * CachedAsyncIterable caches the elements yielded by an async iterable.\n *\n * It can be used to iterate over an iterable many times without depleting the\n * iterable.\n */\nexport default class CachedAsyncIterable extends CachedIterable {\n /**\n * Create an `CachedAsyncIterable` instance.\n *\n * @param {Iterable} iterable\n * @returns {CachedAsyncIterable}\n */\n constructor(iterable) {\n super();\n\n if (Symbol.asyncIterator in Object(iterable)) {\n this.iterator = iterable[Symbol.asyncIterator]();\n } else if (Symbol.iterator in Object(iterable)) {\n this.iterator = iterable[Symbol.iterator]();\n } else {\n throw new TypeError(\"Argument must implement the iteration protocol.\");\n }\n }\n\n /**\n * Asynchronous iterator caching the yielded elements.\n *\n * Elements yielded by the original iterable will be cached and available\n * synchronously. Returns an async generator object implementing the\n * iterator protocol over the elements of the original (async or sync)\n * iterable.\n */\n [Symbol.asyncIterator]() {\n const cached = this;\n let cur = 0;\n\n return {\n async next() {\n if (cached.length <= cur) {\n cached.push(cached.iterator.next());\n }\n return cached[cur++];\n }\n };\n }\n\n /**\n * This method allows user to consume the next element from the iterator\n * into the cache.\n *\n * @param {number} count - number of elements to consume\n */\n async touchNext(count = 1) {\n let idx = 0;\n while (idx++ < count) {\n const last = this[this.length - 1];\n if (last && (await last).done) {\n break;\n }\n this.push(this.iterator.next());\n }\n // Return the last cached {value, done} object to allow the calling\n // code to decide if it needs to call touchNext again.\n return this[this.length - 1];\n }\n}\n","export {default as CachedSyncIterable} from \"./cached_sync_iterable.mjs\";\nexport {default as CachedAsyncIterable} from \"./cached_async_iterable.mjs\";\n","/* eslint no-console: [\"error\", { allow: [\"warn\", \"error\"] }] */\n/* global console */\nimport { CachedAsyncIterable } from \"cached-iterable\";\n/**\n * The `Localization` class is a central high-level API for vanilla\n * JavaScript use of Fluent.\n * It combines language negotiation, FluentBundle and I/O to\n * provide a scriptable API to format translations.\n */\nexport default class Localization {\n /**\n * @param {Array<String>} resourceIds - List of resource IDs\n * @param {Function} generateBundles - Function that returns a\n * generator over FluentBundles\n *\n * @returns {Localization}\n */\n constructor(resourceIds = [], generateBundles) {\n this.resourceIds = resourceIds;\n this.generateBundles = generateBundles;\n this.onChange(true);\n }\n addResourceIds(resourceIds, eager = false) {\n this.resourceIds.push(...resourceIds);\n this.onChange(eager);\n return this.resourceIds.length;\n }\n removeResourceIds(resourceIds) {\n this.resourceIds = this.resourceIds.filter(r => !resourceIds.includes(r));\n this.onChange();\n return this.resourceIds.length;\n }\n /**\n * Format translations and handle fallback if needed.\n *\n * Format translations for `keys` from `FluentBundle` instances on this\n * DOMLocalization. In case of errors, fetch the next context in the\n * fallback chain.\n *\n * @param {Array<Object>} keys - Translation keys to format.\n * @param {Function} method - Formatting function.\n * @returns {Promise<Array<string|Object>>}\n * @private\n */\n async formatWithFallback(keys, method) {\n const translations = [];\n let hasAtLeastOneBundle = false;\n for await (const bundle of this.bundles) {\n hasAtLeastOneBundle = true;\n const missingIds = keysFromBundle(method, bundle, keys, translations);\n if (missingIds.size === 0) {\n break;\n }\n if (typeof console !== \"undefined\") {\n const locale = bundle.locales[0];\n const ids = Array.from(missingIds).join(\", \");\n console.warn(`[fluent] Missing translations in ${locale}: ${ids}`);\n }\n }\n if (!hasAtLeastOneBundle && typeof console !== \"undefined\") {\n console.warn(`[fluent] Request for keys failed because no resource bundles got generated.\n keys: ${JSON.stringify(keys)}.\n resourceIds: ${JSON.stringify(this.resourceIds)}.`);\n }\n return translations;\n }\n /**\n * Format translations into `{value, attributes}` objects.\n *\n * The fallback logic is the same as in `formatValues`\n * but it returns `{value, attributes}` objects\n * which are suitable for the translation of DOM elements.\n *\n * Returns a Promise resolving to an array of the translation strings.\n *\n * @example\n * ```js\n * docL10n.formatMessages([\n * {id: 'hello', args: { who: 'Mary' }},\n * {id: 'welcome'}\n * ]).then(console.log);\n *\n * // [\n * // { value: 'Hello, Mary!', attributes: null },\n * // {\n * // value: 'Welcome!',\n * // attributes: [ { name: \"title\", value: 'Hello' } ]\n * // }\n * // ]\n * ```\n *\n * @param {Array<Object>} keys\n * @returns {Promise<Array<{value: string, attributes: Object}>>}\n * @private\n */\n formatMessages(keys) {\n return this.formatWithFallback(keys, messageFromBundle);\n }\n /**\n * Retrieve translations corresponding to the passed keys.\n *\n * A generalized version of `DOMLocalization.formatValue`. Keys must\n * be `{id, args}` objects.\n *\n * Returns a Promise resolving to an array of the translation strings.\n *\n * @example\n * ```js\n * docL10n.formatValues([\n * {id: 'hello', args: { who: 'Mary' }},\n * {id: 'hello', args: { who: 'John' }},\n * {id: 'welcome'}\n * ]).then(console.log);\n *\n * // ['Hello, Mary!', 'Hello, John!', 'Welcome!']\n * ```\n *\n * @param {Array<Object>} keys\n * @returns {Promise<Array<string>>}\n */\n formatValues(keys) {\n return this.formatWithFallback(keys, valueFromBundle);\n }\n /**\n * Retrieve the translation corresponding to the `id` identifier.\n *\n * If passed, `args` is a simple hash object with a list of variables that\n * will be interpolated in the value of the translation.\n *\n * Returns a Promise resolving to the translation string.\n *\n * Use this sparingly for one-off messages which don't need to be\n * retranslated when the user changes their language preferences, e.g. in\n * notifications.\n *\n * @example\n * ```js\n * docL10n.formatValue(\n * 'hello', { who: 'world' }\n * ).then(console.log);\n *\n * // 'Hello, world!'\n * ```\n *\n * @param {string} id - Identifier of the translation to format\n * @param {Object} [args] - Optional external arguments\n * @returns {Promise<string>}\n */\n async formatValue(id, args) {\n const [val] = await this.formatValues([{ id, args }]);\n return val;\n }\n handleEvent() {\n this.onChange();\n }\n /**\n * This method should be called when there's a reason to believe\n * that language negotiation or available resources changed.\n */\n onChange(eager = false) {\n this.bundles = CachedAsyncIterable.from(this.generateBundles(this.resourceIds));\n if (eager) {\n this.bundles.touchNext(2);\n }\n }\n}\n/**\n * Format the value of a message into a string or `null`.\n *\n * This function is passed as a method to `keysFromBundle` and resolve\n * a value of a single L10n Entity using provided `FluentBundle`.\n *\n * If the message doesn't have a value, return `null`.\n *\n * @param {FluentBundle} bundle\n * @param {Array<Error>} errors\n * @param {Object} message\n * @param {Object} args\n * @returns {string|null}\n * @private\n */\nfunction valueFromBundle(bundle, errors, message, args) {\n if (message.value) {\n return bundle.formatPattern(message.value, args, errors);\n }\n return null;\n}\n/**\n * Format all public values of a message into a {value, attributes} object.\n *\n * This function is passed as a method to `keysFromBundle` and resolve\n * a single L10n Entity using provided `FluentBundle`.\n *\n * The function will return an object with a value and attributes of the\n * entity.\n *\n * @param {FluentBundle} bundle\n * @param {Array<Error>} errors\n * @param {Object} message\n * @param {Object} args\n * @returns {Object}\n * @private\n */\nfunction messageFromBundle(bundle, errors, message, args) {\n const formatted = {\n value: null,\n attributes: null,\n };\n if (message.value) {\n formatted.value = bundle.formatPattern(message.value, args, errors);\n }\n let attrNames = Object.keys(message.attributes);\n if (attrNames.length > 0) {\n formatted.attributes = new Array(attrNames.length);\n for (let [i, name] of attrNames.entries()) {\n let value = bundle.formatPattern(message.attributes[name], args, errors);\n formatted.attributes[i] = { name, value };\n }\n }\n return formatted;\n}\n/**\n * This function is an inner function for `Localization.formatWithFallback`.\n *\n * It takes a `FluentBundle`, list of l10n-ids and a method to be used for\n * key resolution (either `valueFromBundle` or `messageFromBundle`) and\n * optionally a value returned from `keysFromBundle` executed against\n * another `FluentBundle`.\n *\n * The idea here is that if the previous `FluentBundle` did not resolve\n * all keys, we're calling this function with the next context to resolve\n * the remaining ones.\n *\n * In the function, we loop over `keys` and check if we have the `prev`\n * passed and if it has an error entry for the position we're in.\n *\n * If it doesn't, it means that we have a good translation for this key and\n * we return it. If it does, we'll try to resolve the key using the passed\n * `FluentBundle`.\n *\n * In the end, we fill the translations array, and return the Set with\n * missing ids.\n *\n * See `Localization.formatWithFallback` for more info on how this is used.\n *\n * @param {Function} method\n * @param {FluentBundle} bundle\n * @param {Array<string>} keys\n * @param {{Array<{value: string, attributes: Object}>}} translations\n *\n * @returns {Set<string>}\n * @private\n */\nfunction keysFromBundle(method, bundle, keys, translations) {\n const messageErrors = [];\n const missingIds = new Set();\n keys.forEach(({ id, args }, i) => {\n if (translations[i] !== undefined) {\n return;\n }\n let message = bundle.getMessage(id);\n if (message) {\n messageErrors.length = 0;\n translations[i] = method(bundle, messageErrors, message, args);\n if (messageErrors.length > 0 && typeof console !== \"undefined\") {\n const locale = bundle.locales[0];\n const errors = messageErrors.join(\", \");\n console.warn(`[fluent][resolver] errors in ${locale}/${id}: ${errors}.`);\n }\n }\n else {\n missingIds.add(id);\n }\n });\n return missingIds;\n}\n","import translateElement from \"./overlay.js\";\nimport Localization from \"./localization.js\";\nconst L10NID_ATTR_NAME = \"data-l10n-id\";\nconst L10NARGS_ATTR_NAME = \"data-l10n-args\";\nconst L10N_ELEMENT_QUERY = `[${L10NID_ATTR_NAME}]`;\n/**\n * The `DOMLocalization` class is responsible for fetching resources and\n * formatting translations.\n *\n * It implements the fallback strategy in case of errors encountered during the\n * formatting of translations and methods for observing DOM\n * trees with a `MutationObserver`.\n */\nexport default class DOMLocalization extends Localization {\n /**\n * @param {Array<String>} resourceIds - List of resource IDs\n * @param {Function} generateBundles - Function that returns a\n * generator over FluentBundles\n * @returns {DOMLocalization}\n */\n constructor(resourceIds, generateBundles) {\n super(resourceIds, generateBundles);\n // A Set of DOM trees observed by the `MutationObserver`.\n this.roots = new Set();\n // requestAnimationFrame handler.\n this.pendingrAF = null;\n // list of elements pending for translation.\n this.pendingElements = new Set();\n this.windowElement = null;\n this.mutationObserver = null;\n this.observerConfig = {\n attributes: true,\n characterData: false,\n childList: true,\n subtree: true,\n attributeFilter: [L10NID_ATTR_NAME, L10NARGS_ATTR_NAME],\n };\n }\n onChange(eager = false) {\n super.onChange(eager);\n if (this.roots) {\n this.translateRoots();\n }\n }\n /**\n * Set the `data-l10n-id` and `data-l10n-args` attributes on DOM elements.\n * FluentDOM makes use of mutation observers to detect changes\n * to `data-l10n-*` attributes and translate elements asynchronously.\n * `setAttributes` is a convenience method which allows to translate\n * DOM elements declaratively.\n *\n * You should always prefer to use `data-l10n-id` on elements (statically in\n * HTML or dynamically via `setAttributes`) over manually retrieving\n * translations with `format`. The use of attributes ensures that the\n * elements can be retranslated when the user changes their language\n * preferences.\n *\n * ```javascript\n * localization.setAttributes(\n * document.querySelector('#welcome'), 'hello', { who: 'world' }\n * );\n * ```\n *\n * This will set the following attributes on the `#welcome` element.\n * The MutationObserver will pick up this change and will localize the element\n * asynchronously.\n *\n * ```html\n * <p id='welcome'\n * data-l10n-id='hello'\n * data-l10n-args='{\"who\": \"world\"}'>\n * </p>\n * ```\n *\n * @param {Element} element - Element to set attributes on\n * @param {string} id - l10n-id string\n * @param {Object<string, string>} args - KVP list of l10n arguments\n * @returns {Element}\n */\n setAttributes(element, id, args) {\n element.setAttribute(L10NID_ATTR_NAME, id);\n if (args) {\n element.setAttribute(L10NARGS_ATTR_NAME, JSON.stringify(args));\n }\n else {\n element.removeAttribute(L10NARGS_ATTR_NAME);\n }\n return element;\n }\n /**\n * Get the `data-l10n-*` attributes from DOM elements.\n *\n * ```javascript\n * localization.getAttributes(\n * document.querySelector('#welcome')\n * );\n * // -> { id: 'hello', args: { who: 'world' } }\n * ```\n *\n * @param {Element} element - HTML element\n * @returns {{id: string, args: Object}}\n */\n getAttributes(element) {\n return {\n id: element.getAttribute(L10NID_ATTR_NAME),\n args: JSON.parse(element.getAttribute(L10NARGS_ATTR_NAME) || null),\n };\n }\n /**\n * Add `newRoot` to the list of roots managed by this `DOMLocalization`.\n *\n * Additionally, if this `DOMLocalization` has an observer, start observing\n * `newRoot` in order to translate mutations in it.\n *\n * @param {Element | DocumentFragment} newRoot - Root to observe.\n */\n connectRoot(newRoot) {\n for (const root of this.roots) {\n if (root === newRoot ||\n root.contains(newRoot) ||\n newRoot.contains(root)) {\n throw new Error(\"Cannot add a root that overlaps with existing root.\");\n }\n }\n if (this.windowElement) {\n if (this.windowElement !== newRoot.ownerDocument.defaultView) {\n throw new Error(`Cannot connect a root:\n DOMLocalization already has a root from a different window.`);\n }\n }\n else {\n this.windowElement = newRoot.ownerDocument.defaultView;\n this.mutationObserver = new this.windowElement.MutationObserver(mutations => this.translateMutations(mutations));\n }\n this.roots.add(newRoot);\n this.mutationObserver.observe(newRoot, this.observerConfig);\n }\n /**\n * Remove `root` from the list of roots managed by this `DOMLocalization`.\n *\n * Additionally, if this `DOMLocalization` has an observer, stop observing\n * `root`.\n *\n * Returns `true` if the root was the last one managed by this\n * `DOMLocalization`.\n *\n * @param {Element | DocumentFragment} root - Root to disconnect.\n * @returns {boolean}\n */\n disconnectRoot(root) {\n this.roots.delete(root);\n // Pause the mutation observer to stop observing `root`.\n this.pauseObserving();\n if (this.roots.size === 0) {\n this.mutationObserver = null;\n if (this.windowElement && this.pendingrAF) {\n this.windowElement.cancelAnimationFrame(this.pendingrAF);\n }\n this.windowElement = null;\n this.pendingrAF = null;\n this.pendingElements.clear();\n return true;\n }\n // Resume observing all other roots.\n this.resumeObserving();\n return false;\n }\n /**\n * Translate all roots associated with this `DOMLocalization`.\n *\n * @returns {Promise}\n */\n translateRoots() {\n const roots = Array.from(this.roots);\n return Promise.all(roots.map(root => this.translateFragment(root)));\n }\n /**\n * Pauses the `MutationObserver`.\n */\n pauseObserving() {\n if (!this.mutationObserver) {\n return;\n }\n this.translateMutations(this.mutationObserver.takeRecords());\n this.mutationObserver.disconnect();\n }\n /**\n * Resumes the `MutationObserver`.\n */\n resumeObserving() {\n if (!this.mutationObserver) {\n return;\n }\n for (const root of this.roots) {\n this.mutationObserver.observe(root, this.observerConfig);\n }\n }\n /**\n * Translate mutations detected by the `MutationObserver`.\n *\n * @private\n */\n translateMutations(mutations) {\n for (const mutation of mutations) {\n switch (mutation.type) {\n case \"attributes\":\n if (mutation.target.hasAttribute(\"data-l10n-id\")) {\n this.pendingElements.add(mutation.target);\n }\n break;\n case \"childList\":\n for (const addedNode of mutation.addedNodes) {\n if (addedNode.nodeType === addedNode.ELEMENT_NODE) {\n if (addedNode.childElementCount) {\n for (const element of this.getTranslatables(addedNode)) {\n this.pendingElements.add(element);\n }\n }\n else if (addedNode.hasAttribute(L10NID_ATTR_NAME)) {\n this.pendingElements.add(addedNode);\n }\n }\n }\n break;\n }\n }\n // This fragment allows us to coalesce all pending translations\n // into a single requestAnimationFrame.\n if (this.pendingElements.size > 0) {\n if (this.pendingrAF === null) {\n this.pendingrAF = this.windowElement.requestAnimationFrame(() => {\n this.translateElements(Array.from(this.pendingElements));\n this.pendingElements.clear();\n this.pendingrAF = null;\n });\n }\n }\n }\n /**\n * Translate a DOM element or fragment asynchronously using this\n * `DOMLocalization` object.\n *\n * Manually trigger the translation (or re-translation) of a DOM fragment.\n * Use the `data-l10n-id` and `data-l10n-args` attributes to mark up the DOM\n * with information about which translations to use.\n *\n * Returns a `Promise` that gets resolved once the translation is complete.\n *\n * @param {Element | DocumentFragment} frag - Element or DocumentFragment to be translated\n * @returns {Promise}\n */\n translateFragment(frag) {\n return this.translateElements(this.getTranslatables(frag));\n }\n /**\n * Translate a list of DOM elements asynchronously using this\n * `DOMLocalization` object.\n *\n * Manually trigger the translation (or re-translation) of a list of elements.\n * Use the `data-l10n-id` and `data-l10n-args` attributes to mark up the DOM\n * with information about which translations to use.\n *\n * Returns a `Promise` that gets resolved once the translation is complete.\n *\n * @param {Array<Element>} elements - List of elements to be translated\n * @returns {Promise}\n */\n async translateElements(elements) {\n if (!elements.length) {\n return undefined;\n }\n const keys = elements.map(this.getKeysForElement);\n const translations = await this.formatMessages(keys);\n return this.applyTranslations(elements, translations);\n }\n /**\n * Applies translations onto elements.\n *\n * @param {Array<Element>} elements\n * @param {Array<Object>} translations\n * @private\n */\n applyTranslations(elements, translations) {\n this.pauseObserving();\n for (let i = 0; i < elements.length; i++) {\n if (translations[i] !== undefined) {\n translateElement(elements[i], translations[i]);\n }\n }\n this.resumeObserving();\n }\n /**\n * Collects all translatable child elements of the element.\n *\n * @param {Element | DocumentFragment} element\n * @returns {Array<Element>}\n * @private\n */\n getTranslatables(element) {\n const nodes = Array.from(element.querySelectorAll(L10N_ELEMENT_QUERY));\n if (typeof element.hasAttribute === \"function\" &&\n element.hasAttribute(L10NID_ATTR_NAME)) {\n nodes.push(element);\n }\n return nodes;\n }\n /**\n * Get the `data-l10n-*` attributes from DOM elements as a two-element\n * array.\n *\n * @param {Element} element\n * @returns {Object}\n * @private\n */\n getKeysForElement(element) {\n return {\n id: element.getAttribute(L10NID_ATTR_NAME),\n args: JSON.parse(element.getAttribute(L10NARGS_ATTR_NAME) || null),\n };\n }\n}\n","export { default as DOMLocalization } from \"./dom_localization.js\";\nexport { default as Localization } from \"./localization.js\";\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\n/**\n * NOTE: The L10n-implementations should use lowercase language-codes\n * internally.\n */\nclass L10n {\n #dir;\n\n #elements;\n\n #lang;\n\n #l10n;\n\n constructor({ lang, isRTL }, l10n = null) {\n this.#lang = L10n.#fixupLangCode(lang);\n this.#l10n = l10n;\n this.#dir = (isRTL ?? L10n.#isRTL(this.#lang)) ? \"rtl\" : \"ltr\";\n }\n\n _setL10n(l10n) {\n this.#l10n = l10n;\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n document.l10n = l10n;\n }\n }\n\n /** @inheritdoc */\n getLanguage() {\n return this.#lang;\n }\n\n /** @inheritdoc */\n getDirection() {\n return this.#dir;\n }\n\n /** @inheritdoc */\n async get(ids, args = null, fallback) {\n if (Array.isArray(ids)) {\n ids = ids.map(id => ({ id }));\n const messages = await this.#l10n.formatMessages(ids);\n return messages.map(message => message.value);\n }\n\n const messages = await this.#l10n.formatMessages([\n {\n id: ids,\n args,\n },\n ]);\n return messages[0]?.value || fallback;\n }\n\n /** @inheritdoc */\n async translate(element) {\n (this.#elements ||= new Set()).add(element);\n try {\n this.#l10n.connectRoot(element);\n await this.#l10n.translateRoots();\n } catch {\n // Element is under an existing root, so there is no need to add it again.\n }\n }\n\n /** @inheritdoc */\n async translateOnce(element) {\n try {\n await this.#l10n.translateElements([element]);\n } catch (ex) {\n console.error(\"translateOnce:\", ex);\n }\n }\n\n /** @inheritdoc */\n async destroy() {\n if (this.#elements) {\n for (const element of this.#elements) {\n this.#l10n.disconnectRoot(element);\n }\n this.#elements.clear();\n this.#elements = null;\n }\n this.#l10n.pauseObserving();\n }\n\n /** @inheritdoc */\n pause() {\n this.#l10n.pauseObserving();\n }\n\n /** @inheritdoc */\n resume() {\n this.#l10n.resumeObserving();\n }\n\n static #fixupLangCode(langCode) {\n // Use only lowercase language-codes internally, and fallback to English.\n langCode = langCode?.toLowerCase() || \"en-us\";\n\n // Try to support \"incompletely\" specified language codes (see issue 13689).\n const 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 return PARTIAL_LANG_CODES[langCode] || langCode;\n }\n\n static #isRTL(lang) {\n const shortCode = lang.split(\"-\", 1)[0];\n return [\"ar\", \"he\", \"fa\", \"ps\", \"ur\"].includes(shortCode);\n }\n}\n\nconst GenericL10n = null;\n\nexport { GenericL10n, L10n };\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 { FeatureTest, fetchData } from \"pdfjs-lib\";\nimport { FluentBundle, FluentResource } from \"fluent-bundle\";\nimport { DOMLocalization } from \"fluent-dom\";\nimport { L10n } from \"./l10n.js\";\n\nfunction PLATFORM() {\n const { isAndroid, isLinux, isMac, isWindows } = FeatureTest.platform;\n if (isLinux) {\n return \"linux\";\n }\n if (isWindows) {\n return \"windows\";\n }\n if (isMac) {\n return \"macos\";\n }\n if (isAndroid) {\n return \"android\";\n }\n return \"other\";\n}\n\nfunction createBundle(lang, text) {\n const resource = new FluentResource(text);\n const bundle = new FluentBundle(lang, {\n functions: { PLATFORM },\n });\n const errors = bundle.addResource(resource);\n if (errors.length) {\n console.error(\"L10n errors\", errors);\n }\n return bundle;\n}\n\nclass GenericL10n extends L10n {\n constructor(lang) {\n super({ lang });\n\n const generateBundles = !lang\n ? GenericL10n.#generateBundlesFallback.bind(\n GenericL10n,\n this.getLanguage()\n )\n : GenericL10n.#generateBundles.bind(\n GenericL10n,\n \"en-us\",\n this.getLanguage()\n );\n this._setL10n(new DOMLocalization([], generateBundles));\n }\n\n /**\n * Generate the bundles for Fluent.\n * @param {String} defaultLang - The fallback language to use for\n * translations.\n * @param {String} baseLang - The base language to use for translations.\n */\n static async *#generateBundles(defaultLang, baseLang) {\n const { baseURL, paths } = await this.#getPaths();\n\n const langs = [baseLang];\n if (defaultLang !== baseLang) {\n // Also fallback to the short-format of the base language\n // (see issue 17269).\n const shortLang = baseLang.split(\"-\", 1)[0];\n\n if (shortLang !== baseLang) {\n langs.push(shortLang);\n }\n langs.push(defaultLang);\n }\n // Trigger fetching of bundles in parallel, to reduce overall load time.\n const bundles = langs.map(lang => [\n lang,\n this.#createBundle(lang, baseURL, paths),\n ]);\n\n for (const [lang, bundlePromise] of bundles) {\n const bundle = await bundlePromise;\n if (bundle) {\n yield bundle;\n } else if (lang === \"en-us\") {\n yield this.#createBundleFallback(lang);\n }\n }\n }\n\n static async #createBundle(lang, baseURL, paths) {\n const path = paths[lang];\n if (!path) {\n return null;\n }\n const url = new URL(path, baseURL);\n const text = await fetchData(url, /* type = */ \"text\");\n\n return createBundle(lang, text);\n }\n\n static async #getPaths() {\n try {\n const { href } = document.querySelector(`link[type=\"application/l10n\"]`);\n const paths = await fetchData(href, /* type = */ \"json\");\n\n return {\n baseURL: href.substring(0, href.lastIndexOf(\"/\") + 1) || \"./\",\n paths,\n };\n } catch {}\n return { baseURL: \"./\", paths: Object.create(null) };\n }\n\n static async *#generateBundlesFallback(lang) {\n yield this.#createBundleFallback(lang);\n }\n\n static async #createBundleFallback(lang) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n throw new Error(\"Not implemented: #createBundleFallback\");\n }\n const text =\n typeof PDFJSDev === \"undefined\"\n ? await fetchData(\n new URL(\"../l10n/en-US/viewer.ftl\", window.location.href),\n /* type = */ \"text\"\n )\n : PDFJSDev.eval(\"DEFAULT_FTL\");\n\n return createBundle(lang, text);\n }\n}\n\nexport { GenericL10n };\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 } from \"pdfjs-lib\";\n\nasync function docProperties(pdfDocument) {\n const url = \"\",\n baseUrl = \"\";\n const { info, metadata, contentDispositionFilename, contentLength } =\n await pdfDocument.getMetadata();\n\n return {\n ...info,\n baseURL: baseUrl,\n filesize: contentLength || (await pdfDocument.getDownloadInfo()).length,\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, wasmUrl) {\n this._ready = new Promise((resolve, reject) => {\n const sandbox =\n typeof PDFJSDev === \"undefined\"\n ? import(sandboxBundleSrc) // eslint-disable-line no-unsanitized/method\n : __raw_import__(sandboxBundleSrc);\n sandbox\n .then(pdfjsSandbox => {\n resolve(\n pdfjsSandbox.QuickJSSandbox(new URL(wasmUrl, location.href).href)\n );\n })\n .catch(reject);\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 2025 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 { getUuid } from \"pdfjs-lib\";\n\nconst KEY_STORAGE = \"pdfjs.signature\";\n\nclass SignatureStorage {\n // TODO: Encrypt the data in using a password and add a UI for entering it.\n // We could use the Web Crypto API for this (see https://bradyjoslin.com/blog/encryption-webcrypto/\n // for an example).\n\n #eventBus;\n\n #signatures = null;\n\n #signal = null;\n\n constructor(eventBus, signal) {\n this.#eventBus = eventBus;\n this.#signal = signal;\n }\n\n #save() {\n localStorage.setItem(\n KEY_STORAGE,\n JSON.stringify(Object.fromEntries(this.#signatures))\n );\n }\n\n async getAll() {\n if (this.#signal) {\n window.addEventListener(\n \"storage\",\n ({ key }) => {\n if (key === KEY_STORAGE) {\n this.#signatures = null;\n this.#eventBus?.dispatch(\"storedsignatureschanged\", {\n source: this,\n });\n }\n },\n { signal: this.#signal }\n );\n this.#signal = null;\n }\n if (!this.#signatures) {\n this.#signatures = new Map();\n const data = localStorage.getItem(KEY_STORAGE);\n if (data) {\n for (const [key, value] of Object.entries(JSON.parse(data))) {\n this.#signatures.set(key, value);\n }\n }\n }\n return this.#signatures;\n }\n\n async isFull() {\n // Only allow 5 signatures to be saved.\n return (await this.size()) === 5;\n }\n\n async size() {\n return (await this.getAll()).size;\n }\n\n async create(data) {\n if (await this.isFull()) {\n return null;\n }\n const uuid = getUuid();\n this.#signatures.set(uuid, data);\n this.#save();\n\n return uuid;\n }\n\n async delete(uuid) {\n const signatures = await this.getAll();\n if (!signatures.has(uuid)) {\n return false;\n }\n signatures.delete(uuid);\n this.#save();\n\n return true;\n }\n}\n\nexport { SignatureStorage };\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 { AppOptions } from \"./app_options.js\";\nimport { BaseExternalServices } from \"./external_services.js\";\nimport { BasePreferences } from \"./preferences.js\";\nimport { GenericL10n } from \"./genericl10n.js\";\nimport { GenericScripting } from \"./generic_scripting.js\";\nimport { SignatureStorage } from \"./generic_signature_storage.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\nfunction initCom(app) {}\n\nclass Preferences extends BasePreferences {\n async _writeToStorage(prefObj) {\n localStorage.setItem(\"pdfjs.preferences\", JSON.stringify(prefObj));\n }\n\n async _readFromStorage(prefObj) {\n return { prefs: JSON.parse(localStorage.getItem(\"pdfjs.preferences\")) };\n }\n}\n\nclass ExternalServices extends BaseExternalServices {\n constructor() {\n super();\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"reportText\", {\n value: data => {\n window._reportTextData = data;\n },\n });\n }\n }\n\n async createL10n() {\n return new GenericL10n(AppOptions.get(\"localeProperties\")?.lang);\n }\n\n createScripting() {\n return new GenericScripting(\n AppOptions.get(\"sandboxBundleSrc\"),\n AppOptions.get(\"wasmUrl\")\n );\n }\n\n createSignatureStorage(eventBus, signal) {\n return new SignatureStorage(eventBus, signal);\n }\n\n createSignatureVerifier() {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n return new FakeSignatureVerifier();\n }\n return null;\n }\n}\n\nclass MLManager {\n static {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n this.getFakeMLManager = options => new FakeMLManager(options);\n }\n }\n\n async isEnabledFor(_name) {\n return false;\n }\n\n async deleteModel(_service) {\n return null;\n }\n\n isReady(_name) {\n return false;\n }\n\n guess(_data) {}\n\n toggleService(_name, _enabled) {}\n}\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // eslint-disable-next-line no-var\n var FakeMLManager = class {\n eventBus = null;\n\n hasProgress = false;\n\n constructor({ enableGuessAltText, enableAltTextModelDownload }) {\n this.enableGuessAltText = enableGuessAltText;\n this.enableAltTextModelDownload = enableAltTextModelDownload;\n }\n\n setEventBus(eventBus, abortSignal) {\n this.eventBus = eventBus;\n }\n\n async isEnabledFor(_name) {\n return this.enableGuessAltText;\n }\n\n async deleteModel(_name) {\n this.enableAltTextModelDownload = false;\n return null;\n }\n\n async loadModel(_name) {}\n\n async downloadModel(_name) {\n // Simulate downloading the model but with progress.\n // The progress can be seen in the new alt-text dialog.\n this.hasProgress = true;\n\n const { promise, resolve } = Promise.withResolvers();\n const total = 1e8;\n const end = 1.5 * total;\n const increment = 5e6;\n let loaded = 0;\n const id = setInterval(() => {\n loaded += increment;\n if (loaded <= end) {\n this.eventBus.dispatch(\"loadaiengineprogress\", {\n source: this,\n detail: {\n total,\n totalLoaded: loaded,\n finished: loaded + increment >= end,\n },\n });\n return;\n }\n clearInterval(id);\n this.hasProgress = false;\n this.enableAltTextModelDownload = true;\n resolve(true);\n }, 900);\n return promise;\n }\n\n isReady(_name) {\n return this.enableAltTextModelDownload;\n }\n\n guess({ request: { data } }) {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve(data ? { output: \"Fake alt text.\" } : { error: true });\n }, 3000);\n });\n }\n\n toggleService(_name, enabled) {\n this.enableGuessAltText = enabled;\n }\n };\n\n // eslint-disable-next-line no-var\n var FakeSignatureVerifier = class {\n async verify(signature) {\n if (signature.signatureType === null) {\n return {\n status: \"unknown\",\n errorCode: \"SUBFILTER_NOT_SUPPORTED\",\n message: signature.subFilter,\n certificate: null,\n documentModifiedAfterSigning: !signature.coversWholeDocument,\n modificationsAfterSignature: signature.modificationsAfterSignature,\n };\n }\n\n return {\n status: \"unknown\",\n errorCode: \"EMPTY_RESPONSE\",\n message: null,\n certificate: null,\n documentModifiedAfterSigning: !signature.coversWholeDocument,\n modificationsAfterSignature: signature.modificationsAfterSignature,\n };\n }\n\n async viewCertificate(certificate) {\n return false;\n }\n };\n}\n\nexport { ExternalServices, initCom, MLManager, Preferences };\n","/* Copyright 2024 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 { internalOpt } from \"./internal_evt.js\";\nimport { noContextMenu } from \"pdfjs-lib\";\n\nclass NewAltTextManager {\n #boundCancel = this.#cancel.bind(this);\n\n #createAutomaticallyButton;\n\n #currentEditor = null;\n\n #cancelButton;\n\n #descriptionContainer;\n\n #dialog;\n\n #disclaimer;\n\n #downloadModel;\n\n #downloadModelDescription;\n\n #eventBus;\n\n #firstTime = false;\n\n #guessedAltText;\n\n #hasAI = null;\n\n #isEditing = null;\n\n #imagePreview;\n\n #imageData;\n\n #isAILoading = false;\n\n #wasAILoading = false;\n\n #learnMore;\n\n #notNowButton;\n\n #overlayManager;\n\n #textarea;\n\n #title;\n\n #uiManager;\n\n #previousAltText = null;\n\n constructor(\n {\n descriptionContainer,\n dialog,\n imagePreview,\n cancelButton,\n disclaimer,\n notNowButton,\n saveButton,\n textarea,\n learnMore,\n errorCloseButton,\n createAutomaticallyButton,\n downloadModel,\n downloadModelDescription,\n title,\n },\n overlayManager,\n eventBus\n ) {\n this.#cancelButton = cancelButton;\n this.#createAutomaticallyButton = createAutomaticallyButton;\n this.#descriptionContainer = descriptionContainer;\n this.#dialog = dialog;\n this.#disclaimer = disclaimer;\n this.#notNowButton = notNowButton;\n this.#imagePreview = imagePreview;\n this.#textarea = textarea;\n this.#learnMore = learnMore;\n this.#title = title;\n this.#downloadModel = downloadModel;\n this.#downloadModelDescription = downloadModelDescription;\n this.#overlayManager = overlayManager;\n this.#eventBus = eventBus;\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.#boundCancel);\n notNowButton.addEventListener(\"click\", this.#boundCancel);\n saveButton.addEventListener(\"click\", this.#save.bind(this));\n errorCloseButton.addEventListener(\"click\", () => {\n this.#toggleError(false);\n });\n createAutomaticallyButton.addEventListener(\"click\", async () => {\n const checked =\n createAutomaticallyButton.getAttribute(\"aria-pressed\") !== \"true\";\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.image.alt_text.ai_generation_check\",\n data: { status: checked },\n });\n\n if (this.#uiManager) {\n const isAltTextEnabled =\n await this.#uiManager.mlManager.isEnabledFor(\"altText\");\n this.#createAutomaticallyButton.disabled = true;\n if (checked && !isAltTextEnabled) {\n this.#textarea.value = \"\";\n this.#setProgress();\n this.#uiManager.setPreference(\"enableGuessAltText\", true);\n await this.#uiManager.mlManager.downloadModel(\"altText\");\n this.#setPref(\"enableAltTextModelDownload\", true);\n } else if (!checked && isAltTextEnabled) {\n this.#uiManager.setPreference(\"enableGuessAltText\", false);\n await this.#uiManager.mlManager.deleteModel(\"altText\");\n this.#setPref(\"enableAltTextModelDownload\", false);\n }\n this.#createAutomaticallyButton.disabled = false;\n await this.#uiManager.mlManager.toggleService(\"altText\", checked);\n }\n this.#toggleGuessAltText(checked, /* isInitial = */ false);\n });\n textarea.addEventListener(\"focus\", () => {\n this.#wasAILoading = this.#isAILoading;\n this.#toggleLoading(false);\n this.#toggleTitleAndDisclaimer();\n });\n textarea.addEventListener(\"blur\", () => {\n if (!textarea.value) {\n this.#toggleLoading(this.#wasAILoading);\n }\n this.#toggleTitleAndDisclaimer();\n });\n textarea.addEventListener(\"input\", () => {\n this.#toggleTitleAndDisclaimer();\n });\n textarea.addEventListener(\"keydown\", e => {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.key === \"Enter\" &&\n !saveButton.disabled\n ) {\n this.#save();\n }\n });\n\n eventBus.on(\n \"enableguessalttext\",\n ({ value }) => {\n this.#toggleGuessAltText(value, /* isInitial = */ false);\n },\n internalOpt\n );\n\n this.#overlayManager.register(dialog);\n\n this.#learnMore.addEventListener(\"click\", () => {\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.image.alt_text.info\",\n data: { topic: \"alt_text\" },\n });\n });\n }\n\n #setPref(name, value) {\n this.#eventBus.dispatch(\"setpreference\", {\n source: this,\n name,\n value,\n });\n }\n\n #toggleLoading(value) {\n if (!this.#uiManager || this.#isAILoading === value) {\n return;\n }\n this.#isAILoading = value;\n this.#descriptionContainer.classList.toggle(\"loading\", value);\n }\n\n #toggleError(value) {\n if (!this.#uiManager) {\n return;\n }\n this.#dialog.classList.toggle(\"error\", value);\n }\n\n async #toggleGuessAltText(value, isInitial) {\n if (!this.#uiManager) {\n return;\n }\n this.#dialog.classList.toggle(\"aiDisabled\", !value);\n this.#createAutomaticallyButton.setAttribute(\"aria-pressed\", value);\n\n if (value) {\n const { altTextLearnMoreUrl } = this.#uiManager.mlManager;\n if (altTextLearnMoreUrl) {\n this.#learnMore.href = altTextLearnMoreUrl;\n }\n this.#mlGuessAltText(isInitial);\n } else {\n this.#toggleLoading(false);\n this.#isAILoading = false;\n this.#toggleTitleAndDisclaimer();\n }\n }\n\n #toggleNotNow() {\n this.#notNowButton.classList.toggle(\"hidden\", !this.#firstTime);\n this.#cancelButton.classList.toggle(\"hidden\", this.#firstTime);\n }\n\n #toggleAI(value) {\n if (!this.#uiManager || this.#hasAI === value) {\n return;\n }\n this.#hasAI = value;\n this.#dialog.classList.toggle(\"noAi\", !value);\n this.#toggleTitleAndDisclaimer();\n }\n\n #toggleTitleAndDisclaimer() {\n // Disclaimer is visible when the AI is loading or the user didn't change\n // the guessed alt text.\n const visible =\n this.#isAILoading ||\n (this.#guessedAltText && this.#guessedAltText === this.#textarea.value);\n this.#disclaimer.hidden = !visible;\n\n // The title changes depending if the text area is empty or not.\n const isEditing = this.#isAILoading || !!this.#textarea.value;\n if (this.#isEditing === isEditing) {\n return;\n }\n this.#isEditing = isEditing;\n this.#title.setAttribute(\n \"data-l10n-id\",\n isEditing\n ? \"pdfjs-editor-new-alt-text-dialog-edit-label\"\n : \"pdfjs-editor-new-alt-text-dialog-add-label\"\n );\n }\n\n async #mlGuessAltText(isInitial) {\n if (this.#isAILoading) {\n // We're still loading the previous guess.\n return;\n }\n\n if (this.#textarea.value) {\n // The user has already set an alt text.\n return;\n }\n\n if (isInitial && this.#previousAltText !== null) {\n // The user has already set an alt text (empty or not).\n return;\n }\n\n this.#guessedAltText = this.#currentEditor.guessedAltText;\n if (this.#previousAltText === null && this.#guessedAltText) {\n // We have a guessed alt text and the user didn't change it.\n this.#addAltText(this.#guessedAltText);\n return;\n }\n\n this.#toggleLoading(true);\n this.#toggleTitleAndDisclaimer();\n\n let hasError = false;\n try {\n // When calling #mlGuessAltText we don't wait for it, so we must take care\n // that the alt text dialog can have been closed before the response is.\n\n const altText = await this.#currentEditor.mlGuessAltText(\n this.#imageData,\n /* updateAltTextData = */ false\n );\n if (altText) {\n this.#guessedAltText = altText;\n this.#wasAILoading = this.#isAILoading;\n if (this.#isAILoading) {\n this.#addAltText(altText);\n }\n }\n } catch (e) {\n console.error(e);\n hasError = true;\n }\n\n this.#toggleLoading(false);\n this.#toggleTitleAndDisclaimer();\n\n if (hasError && this.#uiManager) {\n this.#toggleError(true);\n }\n }\n\n #addAltText(altText) {\n if (!this.#uiManager || this.#textarea.value) {\n return;\n }\n this.#textarea.value = altText;\n this.#toggleTitleAndDisclaimer();\n }\n\n #setProgress() {\n // Show the download model progress.\n this.#downloadModel.classList.toggle(\"hidden\", false);\n\n const callback = async ({ detail: { finished, total, totalLoaded } }) => {\n const ONE_MEGA_BYTES = 1e6;\n // totalLoaded can be greater than total if the download is compressed.\n // So we cheat to avoid any confusion.\n totalLoaded = Math.min(0.99 * total, totalLoaded);\n\n // Update the progress.\n const totalSize = (this.#downloadModelDescription.ariaValueMax =\n Math.round(total / ONE_MEGA_BYTES));\n const downloadedSize = (this.#downloadModelDescription.ariaValueNow =\n Math.round(totalLoaded / ONE_MEGA_BYTES));\n this.#downloadModelDescription.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ totalSize, downloadedSize })\n );\n if (!finished) {\n return;\n }\n\n // We're done, remove the listener and hide the download model progress.\n this.#eventBus.off(\"loadaiengineprogress\", callback);\n this.#downloadModel.classList.toggle(\"hidden\", true);\n\n this.#toggleAI(true);\n if (!this.#uiManager) {\n return;\n }\n const { mlManager } = this.#uiManager;\n\n // The model has been downloaded, we can now enable the AI service.\n mlManager.toggleService(\"altText\", true);\n this.#toggleGuessAltText(\n await mlManager.isEnabledFor(\"altText\"),\n /* isInitial = */ true\n );\n };\n this.#eventBus.on(\"loadaiengineprogress\", callback, internalOpt);\n }\n\n async editAltText(uiManager, editor, firstTime) {\n if (this.#currentEditor || !editor) {\n return;\n }\n\n if (firstTime && editor.hasAltTextData()) {\n editor.altTextFinish();\n return;\n }\n\n this.#firstTime = firstTime;\n const { mlManager } = uiManager;\n const hasAI = !!mlManager;\n this.#toggleTitleAndDisclaimer();\n\n if (mlManager && !mlManager.isReady(\"altText\")) {\n if (mlManager.hasProgress) {\n this.#setProgress();\n } else {\n this.#createAutomaticallyButton.setAttribute(\"aria-pressed\", false);\n }\n } else {\n this.#downloadModel.classList.toggle(\"hidden\", true);\n }\n\n const isAltTextEnabledPromise = mlManager?.isEnabledFor(\"altText\");\n\n this.#currentEditor = editor;\n this.#uiManager = uiManager;\n this.#uiManager.removeEditListeners();\n\n ({ altText: this.#previousAltText } = editor.altTextData);\n this.#textarea.value = this.#previousAltText ?? \"\";\n\n // TODO: get this value from Firefox\n // (https://bugzilla.mozilla.org/show_bug.cgi?id=1908184)\n const AI_MAX_IMAGE_DIMENSION = 224;\n const MAX_PREVIEW_DIMENSION = 180;\n\n // The max dimension of the preview in the dialog is 180px, so we keep 224px\n // and rescale it thanks to css.\n\n let canvas, width, height;\n if (mlManager) {\n ({\n canvas,\n width,\n height,\n imageData: this.#imageData,\n } = editor.copyCanvas(\n AI_MAX_IMAGE_DIMENSION,\n MAX_PREVIEW_DIMENSION,\n /* createImageData = */ true\n ));\n if (hasAI) {\n this.#toggleGuessAltText(\n await isAltTextEnabledPromise,\n /* isInitial = */ true\n );\n }\n } else {\n ({ canvas, width, height } = editor.copyCanvas(\n AI_MAX_IMAGE_DIMENSION,\n MAX_PREVIEW_DIMENSION,\n /* createImageData = */ false\n ));\n }\n\n canvas.setAttribute(\"role\", \"presentation\");\n const { style } = canvas;\n style.width = `${width}px`;\n style.height = `${height}px`;\n this.#imagePreview.append(canvas);\n\n this.#toggleNotNow();\n this.#toggleAI(hasAI);\n this.#toggleError(false);\n\n try {\n await this.#overlayManager.open(this.#dialog);\n } catch (ex) {\n this.#close();\n throw ex;\n }\n }\n\n #cancel() {\n this.#currentEditor.altTextData = {\n cancel: true,\n };\n const altText = this.#textarea.value.trim();\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.image.alt_text.dismiss\",\n data: {\n alt_text_type: altText ? \"present\" : \"empty\",\n flow: this.#firstTime ? \"image_add\" : \"alt_text_edit\",\n },\n });\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.image.image_added\",\n data: { alt_text_modal: true, alt_text_type: \"skipped\" },\n });\n this.#finish();\n }\n\n #finish() {\n this.#overlayManager.closeIfActive(this.#dialog);\n }\n\n #close() {\n const canvas = this.#imagePreview.firstElementChild;\n canvas.remove();\n canvas.width = canvas.height = 0;\n this.#imageData = null;\n\n this.#toggleLoading(false);\n\n this.#uiManager?.addEditListeners();\n this.#currentEditor.altTextFinish();\n this.#uiManager?.setSelected(this.#currentEditor);\n this.#currentEditor = null;\n this.#uiManager = null;\n }\n\n #extractWords(text) {\n return new Set(\n text\n .toLowerCase()\n .split(/[^\\p{L}\\p{N}]+/gu)\n .filter(x => !!x)\n );\n }\n\n #save() {\n const altText = this.#textarea.value.trim();\n this.#currentEditor.altTextData = {\n altText,\n decorative: false,\n };\n this.#currentEditor.altTextData.guessedAltText = this.#guessedAltText;\n\n if (this.#guessedAltText && this.#guessedAltText !== altText) {\n const guessedWords = this.#extractWords(this.#guessedAltText);\n const words = this.#extractWords(altText);\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.image.alt_text.user_edit\",\n data: {\n total_words: guessedWords.size,\n words_removed: guessedWords.difference(words).size,\n words_added: words.difference(guessedWords).size,\n },\n });\n }\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.image.image_added\",\n data: {\n alt_text_modal: true,\n alt_text_type: altText ? \"present\" : \"empty\",\n },\n });\n\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.image.alt_text.save\",\n data: {\n alt_text_type: altText ? \"present\" : \"empty\",\n flow: this.#firstTime ? \"image_add\" : \"alt_text_edit\",\n },\n });\n\n this.#finish();\n }\n\n destroy() {\n this.#uiManager = null; // Avoid re-adding the edit listeners.\n this.#finish();\n }\n}\n\nclass ImageAltTextSettings {\n #createModelButton;\n\n #dialog;\n\n #eventBus;\n\n #mlManager;\n\n #overlayManager;\n\n #showAltTextDialogButton;\n\n constructor(\n {\n dialog,\n createModelButton,\n learnMore,\n closeButton,\n showAltTextDialogButton,\n },\n overlayManager,\n eventBus,\n mlManager\n ) {\n this.#dialog = dialog;\n this.#createModelButton = createModelButton;\n this.#showAltTextDialogButton = showAltTextDialogButton;\n this.#overlayManager = overlayManager;\n this.#eventBus = eventBus;\n this.#mlManager = mlManager;\n\n const { altTextLearnMoreUrl } = mlManager;\n if (altTextLearnMoreUrl) {\n learnMore.href = altTextLearnMoreUrl;\n }\n\n dialog.addEventListener(\"contextmenu\", noContextMenu);\n\n createModelButton.addEventListener(\"click\", async e => {\n const checked = this.#togglePref(\"enableGuessAltText\", e);\n await (checked ? this.#download(true) : this.#delete(true));\n await mlManager.toggleService(\"altText\", checked);\n this.#reportTelemetry({\n type: \"stamp\",\n action: \"pdfjs.image.alt_text.settings_ai_generation_check\",\n data: { status: checked },\n });\n });\n\n showAltTextDialogButton.addEventListener(\"click\", e => {\n const checked = this.#togglePref(\"enableNewAltTextWhenAddingImage\", e);\n this.#reportTelemetry({\n type: \"stamp\",\n action: \"pdfjs.image.alt_text.settings_edit_alt_text_check\",\n data: { status: checked },\n });\n });\n\n closeButton.addEventListener(\"click\", this.#finish.bind(this));\n\n learnMore.addEventListener(\"click\", () => {\n this.#reportTelemetry({\n type: \"stamp\",\n action: \"pdfjs.image.alt_text.info\",\n data: { topic: \"ai_generation\" },\n });\n });\n\n eventBus.on(\n \"enablealttextmodeldownload\",\n ({ value }) => {\n if (value) {\n this.#download(false);\n } else {\n this.#delete(false);\n }\n },\n internalOpt\n );\n\n this.#overlayManager.register(dialog);\n }\n\n #reportTelemetry(data) {\n this.#eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data,\n },\n });\n }\n\n async #download(isFromUI = false) {\n if (isFromUI) {\n await this.#mlManager.downloadModel(\"altText\");\n\n this.#setPref(\"enableGuessAltText\", true);\n this.#mlManager.toggleService(\"altText\", true);\n this.#setPref(\"enableAltTextModelDownload\", true);\n }\n }\n\n async #delete(isFromUI = false) {\n if (isFromUI) {\n await this.#mlManager.deleteModel(\"altText\");\n this.#setPref(\"enableGuessAltText\", false);\n this.#setPref(\"enableAltTextModelDownload\", false);\n }\n\n this.#createModelButton.setAttribute(\"aria-pressed\", false);\n }\n\n async open({ enableGuessAltText, enableNewAltTextWhenAddingImage }) {\n const { enableAltTextModelDownload } = this.#mlManager;\n this.#createModelButton.setAttribute(\n \"aria-pressed\",\n enableAltTextModelDownload && enableGuessAltText\n );\n this.#showAltTextDialogButton.setAttribute(\n \"aria-pressed\",\n enableNewAltTextWhenAddingImage\n );\n\n await this.#overlayManager.open(this.#dialog);\n this.#reportTelemetry({\n type: \"stamp\",\n action: \"pdfjs.image.alt_text.settings_displayed\",\n });\n }\n\n #togglePref(name, { target }) {\n const checked = target.getAttribute(\"aria-pressed\") !== \"true\";\n this.#setPref(name, checked);\n target.setAttribute(\"aria-pressed\", checked);\n return checked;\n }\n\n #setPref(name, value) {\n this.#eventBus.dispatch(\"setpreference\", {\n source: this,\n name,\n value,\n });\n }\n\n #finish() {\n this.#overlayManager.closeIfActive(this.#dialog);\n }\n}\n\nexport { ImageAltTextSettings, NewAltTextManager };\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 } from \"pdfjs-lib\";\nimport { internalOpt } from \"./internal_evt.js\";\n\nclass AltTextManager {\n #clickAC = null;\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 #resizeAC = 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 const onUpdateUIState = this.#updateUIState.bind(this);\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\", onUpdateUIState);\n optionDecorative.addEventListener(\"change\", onUpdateUIState);\n textarea.addEventListener(\"keydown\", e => {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.key === \"Enter\" &&\n !saveButton.disabled\n ) {\n this.#save();\n }\n });\n\n this.#overlayManager.register(dialog);\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 this.#createSVGElement();\n\n this.#hasUsedPointer = false;\n\n this.#clickAC = new AbortController();\n const clickOpts = { signal: this.#clickAC.signal },\n onClick = this.#onClick.bind(this);\n for (const element of [\n this.#optionDescription,\n this.#optionDecorative,\n this.#textarea,\n this.#saveButton,\n this.#cancelButton,\n ]) {\n element.addEventListener(\"click\", onClick, clickOpts);\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\n this.#resizeAC = new AbortController();\n this.#eventBus.on(\"resize\", this.#setPosition.bind(this), {\n signal: this.#resizeAC.signal,\n ...internalOpt,\n });\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 this.#overlayManager.closeIfActive(this.#dialog);\n }\n\n #close() {\n this.#currentEditor._reportTelemetry(\n this.#telemetryData || {\n action: \"alt_text_cancel\",\n alt_text_keyboard: !this.#hasUsedPointer,\n }\n );\n this.#telemetryData = null;\n\n this.#removeOnClickListeners();\n this.#uiManager?.addEditListeners();\n this.#resizeAC?.abort();\n this.#resizeAC = null;\n this.#currentEditor.altTextFinish();\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 this.#clickAC?.abort();\n this.#clickAC = null;\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\n/** @typedef {import(\"./event_utils.js\").EventBus} EventBus */\n\nimport {\n AnnotationEditorParamsType,\n FeatureTest,\n getRGBA,\n Util,\n} from \"pdfjs-lib\";\nimport { internalOpt } from \"./internal_evt.js\";\n\n/**\n * @typedef {Object} AnnotationEditorParamsOptions\n * @property {HTMLInputElement} editorFreeTextFontSize\n * @property {HTMLInputElement} editorFreeTextColor\n * @property {HTMLInputElement} editorInkColor\n * @property {HTMLInputElement} editorInkThickness\n * @property {HTMLInputElement} editorInkOpacity\n * @property {HTMLButtonElement} editorStampAddImage\n * @property {HTMLInputElement} editorFreeHighlightThickness\n * @property {HTMLButtonElement} editorHighlightShowAll\n * @property {HTMLButtonElement} editorSignatureAddSignature\n */\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 /**\n * @param {AnnotationEditorParamsOptions} options\n */\n #bindListeners({\n editorFreeTextFontSize,\n editorFreeTextColor,\n editorInkColor,\n editorInkThickness,\n editorInkOpacity,\n editorStampAddImage,\n editorFreeHighlightThickness,\n editorHighlightShowAll,\n editorSignatureAddSignature,\n }) {\n const { eventBus } = this;\n\n const dispatchEvent = (typeStr, value) => {\n 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\n // Handlers for INK_COLOR and INK_OPACITY sync-back, set up differently\n // depending on whether alpha is supported.\n let updateInkColor, updateInkOpacity;\n\n if (FeatureTest.isAlphaColorInputSupported) {\n // Enable alpha on the color input and remove the now-redundant opacity\n // slider from the DOM.\n editorInkColor.setAttribute(\"alpha\", \"\");\n editorInkOpacity.closest(\".editorParamsSetter\").remove();\n\n // Track last-known color/opacity so that sync-back events for either\n // property can reconstruct the full #RRGGBBAA without re-parsing the\n // input's current (format-varying) value.\n let currentInkColor = \"#000000\";\n let currentInkOpacity = 1;\n\n editorInkColor.addEventListener(\"input\", function () {\n // The returned value format varies by browser; normalize it.\n const rgba = getRGBA(this.value);\n if (!rgba) {\n return;\n }\n const [r, g, b, opacity] = rgba;\n const hex = Util.makeHexColor(r, g, b);\n currentInkColor = hex;\n currentInkOpacity = opacity;\n dispatchEvent(\"INK_COLOR_AND_OPACITY\", { color: hex, opacity });\n });\n\n updateInkColor = value => {\n currentInkColor = value;\n const alphaHex = Util.hexNums[Math.round(currentInkOpacity * 255)];\n editorInkColor.value = currentInkColor + alphaHex;\n };\n updateInkOpacity = value => {\n currentInkOpacity = value;\n const alphaHex = Util.hexNums[Math.round(currentInkOpacity * 255)];\n editorInkColor.value = currentInkColor + alphaHex;\n };\n } else {\n editorInkColor.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_COLOR\", this.value);\n });\n editorInkOpacity.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_OPACITY\", this.valueAsNumber);\n });\n\n updateInkColor = value => {\n editorInkColor.value = value;\n };\n updateInkOpacity = value => {\n editorInkOpacity.value = value;\n };\n }\n\n editorInkThickness.addEventListener(\"input\", function () {\n dispatchEvent(\"INK_THICKNESS\", this.valueAsNumber);\n });\n editorStampAddImage.addEventListener(\"click\", () => {\n eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data: { action: \"pdfjs.image.add_image_click\" },\n },\n });\n dispatchEvent(\"CREATE\");\n });\n editorFreeHighlightThickness.addEventListener(\"input\", function () {\n dispatchEvent(\"HIGHLIGHT_THICKNESS\", this.valueAsNumber);\n });\n editorHighlightShowAll.addEventListener(\"click\", function () {\n const checked = this.getAttribute(\"aria-pressed\") === \"true\";\n this.setAttribute(\"aria-pressed\", !checked);\n dispatchEvent(\"HIGHLIGHT_SHOW_ALL\", !checked);\n });\n editorSignatureAddSignature.addEventListener(\"click\", () => {\n dispatchEvent(\"CREATE\");\n });\n\n eventBus.on(\n \"annotationeditorparamschanged\",\n 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 updateInkColor(value);\n break;\n case AnnotationEditorParamsType.INK_THICKNESS:\n editorInkThickness.value = value;\n break;\n case AnnotationEditorParamsType.INK_OPACITY:\n updateInkOpacity(value);\n break;\n case AnnotationEditorParamsType.HIGHLIGHT_COLOR:\n eventBus.dispatch(\"mainhighlightcolorpickerupdatecolor\", {\n source: this,\n value,\n });\n break;\n case AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:\n editorFreeHighlightThickness.value = value;\n break;\n case AnnotationEditorParamsType.HIGHLIGHT_FREE:\n editorFreeHighlightThickness.disabled = !value;\n break;\n case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:\n editorHighlightShowAll.setAttribute(\"aria-pressed\", value);\n break;\n }\n }\n },\n internalOpt\n );\n }\n}\n\nexport { AnnotationEditorParams };\n","/* Copyright 2024 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// Used to compare floats: there is no exact equality due to rounding errors.\nconst PRECISION = 1e-1;\n\nclass CaretBrowsingMode {\n #mainContainer;\n\n #toolBarHeight = 0;\n\n #viewerContainer;\n\n constructor(abortSignal, mainContainer, viewerContainer, toolbarContainer) {\n this.#mainContainer = mainContainer;\n this.#viewerContainer = viewerContainer;\n\n if (!toolbarContainer) {\n return;\n }\n this.#toolBarHeight = toolbarContainer.getBoundingClientRect().height;\n\n const toolbarObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n if (entry.target === toolbarContainer) {\n this.#toolBarHeight = Math.floor(entry.borderBoxSize[0].blockSize);\n break;\n }\n }\n });\n toolbarObserver.observe(toolbarContainer);\n\n abortSignal.addEventListener(\"abort\", () => toolbarObserver.disconnect(), {\n once: true,\n });\n }\n\n /**\n * Return true if the two rectangles are on the same line.\n * @param {DOMRect} rect1\n * @param {DOMRect} rect2\n * @returns {boolean}\n */\n #isOnSameLine(rect1, rect2) {\n const top1 = rect1.y;\n const bot1 = rect1.bottom;\n const mid1 = rect1.y + rect1.height / 2;\n\n const top2 = rect2.y;\n const bot2 = rect2.bottom;\n const mid2 = rect2.y + rect2.height / 2;\n\n return (top1 <= mid2 && mid2 <= bot1) || (top2 <= mid1 && mid1 <= bot2);\n }\n\n /**\n * Return `true` if the rectangle is:\n * - under the caret when `isUp === false`.\n * - over the caret when `isUp === true`.\n * @param {DOMRect} rect\n * @param {number} x\n * @param {number} y\n * @param {boolean} isUp\n * @returns {boolean}\n */\n #isUnderOver(rect, x, y, isUp) {\n const midY = rect.y + rect.height / 2;\n return (\n (isUp ? y >= midY : y <= midY) &&\n rect.x - PRECISION <= x &&\n x <= rect.right + PRECISION\n );\n }\n\n /**\n * Check if the rectangle is visible.\n * @param {DOMRect} rect\n * @returns {boolean}\n */\n #isVisible(rect) {\n return (\n rect.top >= this.#toolBarHeight &&\n rect.left >= 0 &&\n rect.bottom <=\n (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth)\n );\n }\n\n /**\n * Get the position of the caret.\n * @param {Selection} selection\n * @param {boolean} isUp\n * @returns {Array<number>}\n */\n #getCaretPosition(selection, isUp) {\n const { focusNode, focusOffset } = selection;\n const range = document.createRange();\n range.setStart(focusNode, focusOffset);\n range.setEnd(focusNode, focusOffset);\n const rect = range.getBoundingClientRect();\n\n return [rect.x, isUp ? rect.top : rect.bottom];\n }\n\n static #caretPositionFromPoint(x, y) {\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n !document.caretPositionFromPoint\n ) {\n const { startContainer: offsetNode, startOffset: offset } =\n document.caretRangeFromPoint(x, y);\n return { offsetNode, offset };\n }\n return document.caretPositionFromPoint(x, y);\n }\n\n #setCaretPositionHelper(selection, caretX, select, element, rect) {\n rect ||= element.getBoundingClientRect();\n if (caretX <= rect.x + PRECISION) {\n if (select) {\n selection.extend(element.firstChild, 0);\n } else {\n selection.setPosition(element.firstChild, 0);\n }\n return;\n }\n if (rect.right - PRECISION <= caretX) {\n const { lastChild } = element;\n if (select) {\n selection.extend(lastChild, lastChild.length);\n } else {\n selection.setPosition(lastChild, lastChild.length);\n }\n return;\n }\n\n const midY = rect.y + rect.height / 2;\n let caretPosition = CaretBrowsingMode.#caretPositionFromPoint(caretX, midY);\n let parentElement = caretPosition.offsetNode?.parentElement;\n if (parentElement && parentElement !== element) {\n // There is an element on top of the one in the text layer, so we\n // need to hide all the elements (except the one in the text layer)\n // at this position in order to get the correct caret position.\n const elementsAtPoint = document.elementsFromPoint(caretX, midY);\n const savedVisibilities = [];\n for (const el of elementsAtPoint) {\n if (el === element) {\n break;\n }\n const { style } = el;\n savedVisibilities.push([el, style.visibility]);\n style.visibility = \"hidden\";\n }\n caretPosition = CaretBrowsingMode.#caretPositionFromPoint(caretX, midY);\n parentElement = caretPosition.offsetNode?.parentElement;\n for (const [el, visibility] of savedVisibilities) {\n el.style.visibility = visibility;\n }\n }\n if (parentElement !== element) {\n // The element targeted by caretPositionFromPoint isn't in the text\n // layer.\n if (select) {\n selection.extend(element.firstChild, 0);\n } else {\n selection.setPosition(element.firstChild, 0);\n }\n return;\n }\n if (select) {\n selection.extend(caretPosition.offsetNode, caretPosition.offset);\n } else {\n selection.setPosition(caretPosition.offsetNode, caretPosition.offset);\n }\n }\n\n /**\n * Set the caret position or extend the selection (it depends on the select\n * parameter).\n * @param {boolean} select\n * @param {Selection} selection\n * @param {Element} newLineElement\n * @param {DOMRect} newLineElementRect\n * @param {number} caretX\n */\n #setCaretPosition(\n select,\n selection,\n newLineElement,\n newLineElementRect,\n caretX\n ) {\n if (this.#isVisible(newLineElementRect)) {\n this.#setCaretPositionHelper(\n selection,\n caretX,\n select,\n newLineElement,\n newLineElementRect\n );\n return;\n }\n this.#mainContainer.addEventListener(\n \"scrollend\",\n this.#setCaretPositionHelper.bind(\n this,\n selection,\n caretX,\n select,\n newLineElement,\n null\n ),\n { once: true }\n );\n newLineElement.scrollIntoView();\n }\n\n /**\n * Get the node on the next page.\n * @param {Element} textLayer\n * @param {boolean} isUp\n * @returns {Node}\n */\n #getNodeOnNextPage(textLayer, isUp) {\n while (true) {\n const page = textLayer.closest(\".page\");\n const pageNumber = parseInt(page.getAttribute(\"data-page-number\"), 10);\n const nextPage = isUp ? pageNumber - 1 : pageNumber + 1;\n textLayer = this.#viewerContainer.querySelector(\n `.page[data-page-number=\"${nextPage}\"] .textLayer`\n );\n if (!textLayer) {\n return null;\n }\n const walker = document.createTreeWalker(textLayer, NodeFilter.SHOW_TEXT);\n const node = isUp ? walker.lastChild() : walker.firstChild();\n if (node) {\n return node;\n }\n }\n }\n\n /**\n * Move the caret in the given direction.\n * @param {boolean} isUp\n * @param {boolean} select\n */\n moveCaret(isUp, select) {\n const selection = document.getSelection();\n if (selection.rangeCount === 0) {\n return;\n }\n const { focusNode } = selection;\n const focusElement =\n focusNode.nodeType !== Node.ELEMENT_NODE\n ? focusNode.parentElement\n : focusNode;\n const root = focusElement.closest(\".textLayer\");\n if (!root) {\n return;\n }\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);\n walker.currentNode = focusNode;\n\n // Move to the next element which is not on the same line as the focus\n // element.\n const focusRect = focusElement.getBoundingClientRect();\n let newLineElement = null;\n const nodeIterator = (\n isUp ? walker.previousSibling : walker.nextSibling\n ).bind(walker);\n while (nodeIterator()) {\n const element = walker.currentNode.parentElement;\n if (!this.#isOnSameLine(focusRect, element.getBoundingClientRect())) {\n newLineElement = element;\n break;\n }\n }\n\n if (!newLineElement) {\n // Need to find the next line on the next page.\n const node = this.#getNodeOnNextPage(root, isUp);\n if (!node) {\n return;\n }\n if (select) {\n const lastNode =\n (isUp ? walker.firstChild() : walker.lastChild()) || focusNode;\n selection.extend(lastNode, isUp ? 0 : lastNode.length);\n const range = document.createRange();\n range.setStart(node, isUp ? node.length : 0);\n range.setEnd(node, isUp ? node.length : 0);\n selection.addRange(range);\n return;\n }\n const [caretX] = this.#getCaretPosition(selection, isUp);\n const { parentElement } = node;\n this.#setCaretPosition(\n select,\n selection,\n parentElement,\n parentElement.getBoundingClientRect(),\n caretX\n );\n return;\n }\n\n // We've a candidate for the next line now we want to find the first element\n // which is under/over the caret.\n const [caretX, caretY] = this.#getCaretPosition(selection, isUp);\n const newLineElementRect = newLineElement.getBoundingClientRect();\n\n // Maybe the element on the new line is a valid candidate.\n if (this.#isUnderOver(newLineElementRect, caretX, caretY, isUp)) {\n this.#setCaretPosition(\n select,\n selection,\n newLineElement,\n newLineElementRect,\n caretX\n );\n return;\n }\n\n while (nodeIterator()) {\n // Search an element on the same line as newLineElement\n // which could be under/over the caret.\n const element = walker.currentNode.parentElement;\n const elementRect = element.getBoundingClientRect();\n if (!this.#isOnSameLine(newLineElementRect, elementRect)) {\n break;\n }\n if (this.#isUnderOver(elementRect, caretX, caretY, isUp)) {\n // We found the element.\n this.#setCaretPosition(select, selection, element, elementRect, caretX);\n return;\n }\n }\n\n // No element has been found so just put the caret on the element on the new\n // line.\n this.#setCaretPosition(\n select,\n selection,\n newLineElement,\n newLineElementRect,\n caretX\n );\n }\n}\n\nexport { CaretBrowsingMode };\n","/* Copyright 2025 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 { noContextMenu, stopEvent } from \"pdfjs-lib\";\n\n// Timeout before ending resize operation.\nconst RESIZE_TIMEOUT = 400; // ms\n\n/**\n * Viewer control to display a sidebar with resizer functionality.\n */\nclass Sidebar {\n #initialWidth = 0;\n\n #width = 0;\n\n #coefficient;\n\n #resizeTimeout = null;\n\n #resizer;\n\n #isResizerOnTheLeft;\n\n #isKeyboardResizing = false;\n\n #resizeObserver;\n\n #prevX = 0;\n\n /**\n * @typedef {Object} SidebarElements\n * @property {HTMLElement} sidebar - The sidebar element.\n * @property {HTMLElement} resizer - The sidebar resizer element.\n * @property {HTMLElement} toggleButton - The button used to toggle the\n * sidebar.\n */\n\n /**\n * Create a sidebar with resizer functionality.\n * @param {SidebarElements} sidebarElements\n * @param {boolean} ltr\n * @param {boolean} isResizerOnTheLeft\n */\n constructor(\n { sidebar, resizer, toggleButton },\n ltr,\n isResizerOnTheLeft,\n globalAbortSignal\n ) {\n this._sidebar = sidebar;\n this.#coefficient = ltr === isResizerOnTheLeft ? -1 : 1;\n this.#resizer = resizer;\n this.#isResizerOnTheLeft = isResizerOnTheLeft;\n\n const style = window.getComputedStyle(sidebar);\n this.#initialWidth = this.#width = parseFloat(\n style.getPropertyValue(\"--sidebar-width\")\n );\n resizer.ariaValueMin =\n parseFloat(style.getPropertyValue(\"--sidebar-min-width\")) || 0;\n resizer.ariaValueMax =\n parseFloat(style.getPropertyValue(\"--sidebar-max-width\")) || Infinity;\n resizer.ariaValueNow = this.#width;\n\n this.#makeSidebarResizable();\n toggleButton.addEventListener(\"click\", this.toggle.bind(this));\n this._isOpen = false;\n sidebar.hidden = true;\n globalAbortSignal?.addEventListener(\"abort\", this.destroy.bind(this), {\n once: true,\n });\n\n this.#resizeObserver = new ResizeObserver(\n ([\n {\n borderBoxSize: [{ inlineSize }],\n },\n ]) => {\n if (!isNaN(this.#prevX)) {\n this.#prevX += this.#coefficient * (inlineSize - this.#width);\n }\n this.#setWidth(inlineSize);\n }\n );\n this.#resizeObserver.observe(sidebar);\n }\n\n #makeSidebarResizable() {\n const sidebarStyle = this._sidebar.style;\n let pointerMoveAC;\n const cancelResize = () => {\n this.#resizeTimeout = null;\n this._sidebar.classList.remove(\"resizing\");\n pointerMoveAC?.abort();\n pointerMoveAC = null;\n this.#isKeyboardResizing = false;\n this.onStopResizing();\n this.#prevX = NaN;\n };\n this.#resizer.addEventListener(\"pointerdown\", e => {\n if (pointerMoveAC) {\n cancelResize();\n return;\n }\n this.onStartResizing();\n const { clientX } = e;\n stopEvent(e);\n this.#prevX = clientX;\n pointerMoveAC = new AbortController();\n const { signal } = pointerMoveAC;\n const sidebar = this._sidebar;\n sidebar.classList.add(\"resizing\");\n const parentStyle = sidebar.parentElement.style;\n parentStyle.minWidth = 0;\n window.addEventListener(\"contextmenu\", noContextMenu, { signal });\n window.addEventListener(\n \"pointermove\",\n ev => {\n if (!pointerMoveAC || Math.abs(ev.clientX - this.#prevX) < 1) {\n return;\n }\n stopEvent(ev);\n sidebarStyle.width = `${Math.round(this.#width + this.#coefficient * (ev.clientX - this.#prevX))}px`;\n },\n { signal, capture: true }\n );\n window.addEventListener(\"blur\", cancelResize, { signal });\n window.addEventListener(\n \"pointerup\",\n ev => {\n if (pointerMoveAC) {\n cancelResize();\n stopEvent(ev);\n }\n },\n { signal }\n );\n });\n this.#resizer.addEventListener(\"keydown\", e => {\n const { key } = e;\n const isArrowLeft = key === \"ArrowLeft\";\n if (isArrowLeft || key === \"ArrowRight\") {\n if (!this.#isKeyboardResizing) {\n this._sidebar.classList.add(\"resizing\");\n this.#isKeyboardResizing = true;\n this.onStartResizing();\n }\n\n const base = e.ctrlKey || e.metaKey ? 10 : 1;\n const dx = base * (isArrowLeft ? -1 : 1);\n clearTimeout(this.#resizeTimeout);\n this.#resizeTimeout = setTimeout(cancelResize, RESIZE_TIMEOUT);\n sidebarStyle.width = `${Math.round(this.#width + this.#coefficient * dx)}px`;\n stopEvent(e);\n }\n });\n }\n\n #setWidth(newWidth) {\n this.#width = newWidth;\n this.#resizer.ariaValueNow = Math.round(newWidth);\n if (this.#isResizerOnTheLeft) {\n this._sidebar.parentElement.style.insetInlineStart = `${(this.#initialWidth - newWidth).toFixed(3)}px`;\n }\n this.onResizing(newWidth);\n }\n\n /**\n * Get the current width of the sidebar in pixels.\n * @returns {number}\n */\n get width() {\n return this.#width;\n }\n\n /**\n * Set the width of the sidebar in pixels.\n * @param {number} newWidth\n */\n set width(newWidth) {\n this._sidebar.style.width = `${newWidth}px`;\n }\n\n /**\n * Callback to be executed when the user starts resizing the sidebar.\n */\n onStartResizing() {}\n\n /**\n * Callback to be executed when the user stops resizing the sidebar.\n */\n onStopResizing() {}\n\n /**\n * Callback to be executed when the sidebar is being resized.\n * @param {number} newWidth - The new width of the sidebar in pixels.\n */\n onResizing(_newWidth) {}\n\n /**\n * Toggle the sidebar's visibility.\n * @param {boolean} [visibility] - The visibility state to set.\n */\n toggle(visibility = !this._isOpen) {\n this._sidebar.hidden = !(this._isOpen = visibility);\n }\n\n destroy() {\n this.#resizeObserver?.disconnect();\n this.#resizeObserver = null;\n }\n}\n\nexport { Sidebar };\n","/* Copyright 2025 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 AnnotationEditorType,\n applyOpacity,\n CSSConstants,\n findContrastColor,\n MathClamp,\n noContextMenu,\n PDFDateString,\n renderRichText,\n shadow,\n stopEvent,\n Util,\n} from \"pdfjs-lib\";\nimport { binarySearchFirstItem } from \"./ui_utils.js\";\nimport { Sidebar } from \"./sidebar.js\";\n\nclass CommentManager {\n #dialog;\n\n #popup;\n\n #sidebar;\n\n static #hasForcedColors = null;\n\n constructor(\n commentDialog,\n sidebar,\n eventBus,\n linkService,\n overlayManager,\n ltr,\n hasForcedColors,\n globalAbortSignal\n ) {\n const dateFormat = new Intl.DateTimeFormat(undefined, {\n dateStyle: \"long\",\n });\n this.dialogElement = commentDialog.dialog;\n this.#dialog = new CommentDialog(\n commentDialog,\n overlayManager,\n eventBus,\n ltr\n );\n this.#popup = new CommentPopup(\n eventBus,\n dateFormat,\n ltr,\n this.dialogElement\n );\n this.#sidebar = new CommentSidebar(\n sidebar,\n eventBus,\n linkService,\n this.#popup,\n dateFormat,\n ltr,\n globalAbortSignal\n );\n this.#popup.sidebar = this.#sidebar;\n CommentManager.#hasForcedColors = hasForcedColors;\n }\n\n setSidebarUiManager(uiManager) {\n this.#sidebar.setUIManager(uiManager);\n }\n\n showSidebar(annotations) {\n this.#sidebar.show(annotations);\n }\n\n hideSidebar() {\n this.#sidebar.hide();\n }\n\n removeComments(ids) {\n this.#sidebar.removeComments(ids);\n }\n\n selectComment(id) {\n this.#sidebar.selectComment(null, id);\n }\n\n addComment(annotation) {\n this.#sidebar.addComment(annotation);\n }\n\n updateComment(annotation) {\n this.#sidebar.updateComment(annotation);\n }\n\n toggleCommentPopup(editor, isSelected, visibility, isEditable) {\n if (isSelected) {\n this.selectComment(editor.uid);\n }\n this.#popup.toggle(editor, isSelected, visibility, isEditable);\n }\n\n destroyPopup() {\n this.#popup.destroy();\n }\n\n updatePopupColor(editor) {\n this.#popup.updateColor(editor);\n }\n\n showDialog(uiManager, editor, posX, posY, options) {\n return this.#dialog.open(uiManager, editor, posX, posY, options);\n }\n\n makeCommentColor(color, opacity) {\n return CommentManager._makeCommentColor(color, opacity);\n }\n\n static _makeCommentColor(color, opacity) {\n return this.#hasForcedColors\n ? null\n : findContrastColor(\n applyOpacity(color, opacity ?? 1),\n CSSConstants.commentForegroundColor\n );\n }\n\n destroy() {\n this.#dialog.destroy();\n this.#sidebar.hide();\n this.#popup.destroy();\n }\n}\n\nclass CommentSidebar extends Sidebar {\n #annotations = null;\n\n #eventBus;\n\n #boundCommentClick = this.#commentClick.bind(this);\n\n #boundCommentKeydown = this.#commentKeydown.bind(this);\n\n #closeButton;\n\n #commentsList;\n\n #commentCount;\n\n #dateFormat;\n\n #sidebarTitle;\n\n #learnMoreUrl;\n\n #linkService;\n\n #popup;\n\n #elementsToAnnotations = null;\n\n #idsToElements = null;\n\n #uiManager = null;\n\n constructor(\n {\n learnMoreUrl,\n sidebar,\n sidebarResizer,\n commentsList,\n commentCount,\n sidebarTitle,\n closeButton,\n commentToolbarButton,\n },\n eventBus,\n linkService,\n popup,\n dateFormat,\n ltr,\n globalAbortSignal\n ) {\n super(\n { sidebar, resizer: sidebarResizer, toggleButton: commentToolbarButton },\n ltr,\n /* isResizerOnTheLeft = */ true,\n globalAbortSignal\n );\n this.#sidebarTitle = sidebarTitle;\n this.#commentsList = commentsList;\n this.#commentCount = commentCount;\n this.#learnMoreUrl = learnMoreUrl;\n this.#linkService = linkService;\n this.#closeButton = closeButton;\n this.#popup = popup;\n this.#dateFormat = dateFormat;\n this.#eventBus = eventBus;\n\n closeButton.addEventListener(\"click\", () => {\n eventBus.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode: AnnotationEditorType.NONE,\n });\n });\n const keyDownCallback = e => {\n if (e.key === \"ArrowDown\" || e.key === \"Home\" || e.key === \"F6\") {\n this.#commentsList.firstElementChild.focus();\n stopEvent(e);\n } else if (e.key === \"ArrowUp\" || e.key === \"End\") {\n this.#commentsList.lastElementChild.focus();\n stopEvent(e);\n }\n };\n commentToolbarButton.addEventListener(\"keydown\", keyDownCallback);\n sidebar.addEventListener(\"keydown\", keyDownCallback);\n }\n\n setUIManager(uiManager) {\n this.#uiManager = uiManager;\n }\n\n show(annotations) {\n this.#elementsToAnnotations = new WeakMap();\n this.#idsToElements = new Map();\n this.#annotations = annotations;\n annotations.sort(this.#sortComments.bind(this));\n if (annotations.length !== 0) {\n const fragment = document.createDocumentFragment();\n for (const annotation of annotations) {\n fragment.append(this.#createCommentElement(annotation));\n }\n\n this.#setCommentsCount(fragment);\n this.#commentsList.append(fragment);\n } else {\n this.#setCommentsCount();\n }\n this._sidebar.hidden = false;\n this.#eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"commentSidebar\",\n data: { numberOfAnnotations: annotations.length },\n },\n });\n }\n\n hide() {\n this._sidebar.hidden = true;\n this.#commentsList.replaceChildren();\n this.#elementsToAnnotations = null;\n this.#idsToElements = null;\n this.#annotations = null;\n }\n\n removeComments(ids) {\n if (ids.length === 0 || !this.#idsToElements) {\n return;\n }\n if (\n new Set(this.#idsToElements.keys()).difference(new Set(ids)).size === 0\n ) {\n this.#removeAll();\n return;\n }\n for (const id of ids) {\n this.#removeComment(id);\n }\n }\n\n focusComment(id) {\n const element = this.#idsToElements.get(id);\n if (!element) {\n return;\n }\n this._sidebar.scrollTop = element.offsetTop - this._sidebar.offsetTop;\n for (const el of this.#commentsList.children) {\n el.classList.toggle(\"selected\", el === element);\n }\n }\n\n updateComment(annotation) {\n if (!this.#idsToElements) {\n return;\n }\n const {\n id,\n creationDate,\n modificationDate,\n richText,\n contentsObj,\n popupRef,\n } = annotation;\n\n if (!popupRef || (!richText && !contentsObj?.str)) {\n this.#removeComment(id);\n }\n\n const element = this.#idsToElements.get(id);\n if (!element) {\n return;\n }\n const prevAnnotation = this.#elementsToAnnotations.get(element);\n let index = binarySearchFirstItem(\n this.#annotations,\n a => this.#sortComments(a, prevAnnotation) >= 0\n );\n if (index >= this.#annotations.length) {\n return;\n }\n\n this.#setDate(element.firstElementChild, modificationDate || creationDate);\n this.#setText(element.lastElementChild, richText, contentsObj);\n\n this.#annotations.splice(index, 1);\n index = binarySearchFirstItem(\n this.#annotations,\n a => this.#sortComments(a, annotation) >= 0\n );\n this.#annotations.splice(index, 0, annotation);\n if (index >= this.#commentsList.children.length) {\n this.#commentsList.append(element);\n } else {\n this.#commentsList.insertBefore(\n element,\n this.#commentsList.children[index]\n );\n }\n }\n\n #removeComment(id) {\n const element = this.#idsToElements?.get(id);\n if (!element) {\n return;\n }\n const annotation = this.#elementsToAnnotations.get(element);\n const index = binarySearchFirstItem(\n this.#annotations,\n a => this.#sortComments(a, annotation) >= 0\n );\n if (index >= this.#annotations.length) {\n return;\n }\n this.#annotations.splice(index, 1);\n element.remove();\n this.#idsToElements.delete(id);\n this.#setCommentsCount();\n }\n\n #removeAll() {\n this.#commentsList.replaceChildren();\n this.#elementsToAnnotations = new WeakMap();\n this.#idsToElements.clear();\n this.#annotations.length = 0;\n this.#setCommentsCount();\n }\n\n selectComment(element, id = null) {\n if (!this.#idsToElements) {\n return;\n }\n const hasNoElement = !element;\n element ||= this.#idsToElements.get(id);\n for (const el of this.#commentsList.children) {\n el.classList.toggle(\"selected\", el === element);\n }\n if (hasNoElement) {\n element?.scrollIntoView({ behavior: \"instant\", block: \"center\" });\n }\n }\n\n addComment(annotation) {\n if (this.#idsToElements?.has(annotation.id)) {\n return;\n }\n const { popupRef, contentsObj } = annotation;\n if (!popupRef || !contentsObj?.str) {\n return;\n }\n const commentItem = this.#createCommentElement(annotation);\n if (this.#annotations.length === 0) {\n this.#commentsList.replaceChildren(commentItem);\n this.#annotations.push(annotation);\n this.#setCommentsCount();\n return;\n }\n const index = binarySearchFirstItem(\n this.#annotations,\n a => this.#sortComments(a, annotation) >= 0\n );\n this.#annotations.splice(index, 0, annotation);\n if (index >= this.#commentsList.children.length) {\n this.#commentsList.append(commentItem);\n } else {\n this.#commentsList.insertBefore(\n commentItem,\n this.#commentsList.children[index]\n );\n }\n this.#setCommentsCount();\n }\n\n #setCommentsCount(container = this.#commentsList) {\n const count = this.#idsToElements.size;\n this.#sidebarTitle.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ count })\n );\n this.#commentCount.textContent = count;\n if (count === 0) {\n container.append(this.#createZeroCommentElement());\n }\n }\n\n #createZeroCommentElement() {\n const commentItem = document.createElement(\"li\");\n commentItem.classList.add(\"sidebarComment\", \"noComments\");\n const textDiv = document.createElement(\"div\");\n textDiv.className = \"sidebarCommentText\";\n textDiv.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-comments-sidebar-no-comments1\"\n );\n commentItem.append(textDiv);\n if (this.#learnMoreUrl) {\n const a = document.createElement(\"a\");\n a.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-comments-sidebar-no-comments-link\"\n );\n a.href = this.#learnMoreUrl;\n a.target = \"_blank\";\n a.rel = \"noopener noreferrer\";\n commentItem.append(a);\n }\n return commentItem;\n }\n\n #setDate(element, date) {\n date = PDFDateString.toDateObject(date);\n element.dateTime = date.toISOString();\n element.textContent = this.#dateFormat.format(date);\n }\n\n #setText(element, richText, contentsObj) {\n element.replaceChildren();\n const html =\n richText?.str && (!contentsObj?.str || richText.str === contentsObj.str)\n ? richText.html\n : contentsObj?.str;\n renderRichText(\n {\n html,\n dir: contentsObj?.dir || \"auto\",\n className: \"richText\",\n },\n element\n );\n }\n\n #createCommentElement(annotation) {\n const {\n id,\n creationDate,\n modificationDate,\n richText,\n contentsObj,\n color,\n opacity,\n } = annotation;\n const commentItem = document.createElement(\"li\");\n commentItem.role = \"button\";\n commentItem.className = \"sidebarComment\";\n commentItem.tabIndex = -1;\n commentItem.style.backgroundColor =\n (color && CommentManager._makeCommentColor(color, opacity)) || \"\";\n const dateDiv = document.createElement(\"time\");\n this.#setDate(dateDiv, modificationDate || creationDate);\n\n const textDiv = document.createElement(\"div\");\n textDiv.className = \"sidebarCommentText\";\n this.#setText(textDiv, richText, contentsObj);\n\n commentItem.append(dateDiv, textDiv);\n commentItem.addEventListener(\"click\", this.#boundCommentClick);\n commentItem.addEventListener(\"keydown\", this.#boundCommentKeydown);\n\n this.#elementsToAnnotations.set(commentItem, annotation);\n this.#idsToElements.set(id, commentItem);\n return commentItem;\n }\n\n async #commentClick({ currentTarget }) {\n if (currentTarget.classList.contains(\"selected\")) {\n currentTarget.classList.remove(\"selected\");\n this.#popup._hide();\n return;\n }\n const annotation = this.#elementsToAnnotations.get(currentTarget);\n if (!annotation) {\n return;\n }\n this.#popup._hide();\n const { id, pageIndex, rect } = annotation;\n const pageNumber = pageIndex + 1;\n const pageVisiblePromise =\n this.#uiManager?.waitForEditorsRendered(pageNumber);\n this.#linkService?.goToXY(pageNumber, rect[0], rect[3], {\n center: \"both\",\n });\n this.selectComment(currentTarget);\n await pageVisiblePromise;\n this.#uiManager?.selectComment(pageIndex, id);\n }\n\n #commentKeydown(e) {\n const { key, currentTarget } = e;\n switch (key) {\n case \"ArrowDown\":\n (\n currentTarget.nextElementSibling ||\n this.#commentsList.firstElementChild\n ).focus();\n stopEvent(e);\n break;\n case \"ArrowUp\":\n (\n currentTarget.previousElementSibling ||\n this.#commentsList.lastElementChild\n ).focus();\n stopEvent(e);\n break;\n case \"Home\":\n this.#commentsList.firstElementChild.focus();\n stopEvent(e);\n break;\n case \"End\":\n this.#commentsList.lastElementChild.focus();\n stopEvent(e);\n break;\n case \"Enter\":\n case \" \":\n this.#commentClick(e);\n stopEvent(e);\n break;\n case \"ShiftTab\":\n this.#closeButton.focus();\n stopEvent(e);\n break;\n }\n }\n\n #sortComments(a, b) {\n const dateA = PDFDateString.toDateObject(\n a.modificationDate || a.creationDate\n );\n const dateB = PDFDateString.toDateObject(\n b.modificationDate || b.creationDate\n );\n if (dateA !== dateB) {\n if (dateA !== null && dateB !== null) {\n return dateB - dateA;\n }\n return dateA !== null ? -1 : 1;\n }\n if (a.pageIndex !== b.pageIndex) {\n return a.pageIndex - b.pageIndex;\n }\n if (a.rect[3] !== b.rect[3]) {\n return b.rect[3] - a.rect[3];\n }\n if (a.rect[0] !== b.rect[0]) {\n return a.rect[0] - b.rect[0];\n }\n if (a.rect[1] !== b.rect[1]) {\n return b.rect[1] - a.rect[1];\n }\n if (a.rect[2] !== b.rect[2]) {\n return a.rect[2] - b.rect[2];\n }\n return a.id.localeCompare(b.id);\n }\n}\n\nclass CommentDialog {\n #dialog;\n\n #editor;\n\n #overlayManager;\n\n #previousText = \"\";\n\n #commentText = \"\";\n\n #textInput;\n\n #title;\n\n #saveButton;\n\n #uiManager;\n\n #prevDragX = 0;\n\n #prevDragY = 0;\n\n #dialogX = 0;\n\n #dialogY = 0;\n\n #isLTR;\n\n #eventBus;\n\n constructor(\n { dialog, toolbar, title, textInput, cancelButton, saveButton },\n overlayManager,\n eventBus,\n ltr\n ) {\n this.#dialog = dialog;\n this.#textInput = textInput;\n this.#overlayManager = overlayManager;\n this.#eventBus = eventBus;\n this.#saveButton = saveButton;\n this.#title = title;\n this.#isLTR = ltr;\n\n const finishBound = this.#finish.bind(this);\n dialog.addEventListener(\"close\", finishBound);\n dialog.addEventListener(\"contextmenu\", e => {\n if (e.target !== this.#textInput) {\n e.preventDefault();\n }\n });\n cancelButton.addEventListener(\"click\", finishBound);\n saveButton.addEventListener(\"click\", this.#save.bind(this));\n\n textInput.addEventListener(\"input\", () => {\n saveButton.disabled = textInput.value === this.#previousText;\n });\n textInput.addEventListener(\"keydown\", e => {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.key === \"Enter\" &&\n !saveButton.disabled\n ) {\n this.#save();\n }\n });\n\n // Make the dialog draggable.\n let pointerMoveAC;\n const cancelDrag = () => {\n dialog.classList.remove(\"dragging\");\n pointerMoveAC?.abort();\n pointerMoveAC = null;\n };\n toolbar.addEventListener(\"pointerdown\", e => {\n if (pointerMoveAC) {\n cancelDrag();\n return;\n }\n const { clientX, clientY } = e;\n stopEvent(e);\n this.#prevDragX = clientX;\n this.#prevDragY = clientY;\n pointerMoveAC = new AbortController();\n const { signal } = pointerMoveAC;\n const { innerHeight, innerWidth } = window;\n dialog.classList.add(\"dragging\");\n window.addEventListener(\n \"pointermove\",\n ev => {\n if (!pointerMoveAC) {\n return;\n }\n const { clientX: x, clientY: y } = ev;\n this.#setPosition(\n this.#dialogX + (x - this.#prevDragX) / innerWidth,\n this.#dialogY + (y - this.#prevDragY) / innerHeight\n );\n this.#prevDragX = x;\n this.#prevDragY = y;\n stopEvent(ev);\n },\n { signal }\n );\n window.addEventListener(\"blur\", cancelDrag, { signal });\n window.addEventListener(\n \"pointerup\",\n ev => {\n if (pointerMoveAC) {\n cancelDrag();\n stopEvent(ev);\n }\n },\n { signal }\n );\n });\n\n overlayManager.register(dialog);\n }\n\n async open(uiManager, editor, posX, posY, options) {\n if (editor) {\n this.#uiManager = uiManager;\n this.#editor = editor;\n }\n const {\n contentsObj: { str },\n color,\n opacity,\n } = editor.getData();\n const { style: dialogStyle } = this.#dialog;\n if (color) {\n dialogStyle.backgroundColor = CommentManager._makeCommentColor(\n color,\n opacity\n );\n dialogStyle.borderColor = Util.makeHexColor(...color);\n } else {\n dialogStyle.backgroundColor = dialogStyle.borderColor = \"\";\n }\n this.#commentText = str || \"\";\n const textInput = this.#textInput;\n textInput.value = this.#previousText = this.#commentText;\n if (str) {\n this.#title.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-edit-comment-dialog-title-when-editing\"\n );\n this.#saveButton.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-edit-comment-dialog-save-button-when-editing\"\n );\n } else {\n this.#title.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-edit-comment-dialog-title-when-adding\"\n );\n this.#saveButton.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-edit-comment-dialog-save-button-when-adding\"\n );\n }\n if (options?.height) {\n textInput.style.height = `${options.height}px`;\n }\n this.#uiManager?.removeEditListeners();\n this.#saveButton.disabled = true;\n const parentDimensions = options?.parentDimensions;\n const { innerHeight, innerWidth } = window;\n if (editor.hasDefaultPopupPosition()) {\n const { dialogWidth, dialogHeight } = this._dialogDimensions;\n if (parentDimensions) {\n if (\n this.#isLTR &&\n posX + dialogWidth >\n Math.min(parentDimensions.x + parentDimensions.width, innerWidth)\n ) {\n const buttonWidth = this.#editor.commentButtonWidth;\n posX -= dialogWidth - buttonWidth * parentDimensions.width;\n } else if (!this.#isLTR) {\n const buttonWidth =\n this.#editor.commentButtonWidth * parentDimensions.width;\n if (posX - dialogWidth < Math.max(0, parentDimensions.x)) {\n posX = Math.max(0, posX);\n } else {\n posX -= dialogWidth - buttonWidth;\n }\n }\n }\n const height = Math.max(dialogHeight, options?.height || 0);\n if (posY + height > innerHeight) {\n posY = innerHeight - height;\n }\n if (posY < 0) {\n posY = 0;\n }\n }\n\n posX = MathClamp(posX / innerWidth, 0, 1);\n posY = MathClamp(posY / innerHeight, 0, 1);\n this.#setPosition(posX, posY);\n\n await this.#overlayManager.open(this.#dialog);\n textInput.focus();\n }\n\n async #save() {\n this.#editor.comment = this.#textInput.value;\n this.#finish();\n }\n\n get _dialogDimensions() {\n const dialog = this.#dialog;\n const { style } = dialog;\n style.opacity = \"0\";\n style.display = \"block\";\n const { width, height } = dialog.getBoundingClientRect();\n style.opacity = style.display = \"\";\n return shadow(this, \"_dialogDimensions\", {\n dialogWidth: width,\n dialogHeight: height,\n });\n }\n\n #setPosition(x, y) {\n this.#dialogX = x;\n this.#dialogY = y;\n const { style } = this.#dialog;\n style.left = `${100 * x}%`;\n style.top = `${100 * y}%`;\n }\n\n #finish() {\n if (!this.#editor) {\n return;\n }\n const edited = this.#textInput.value !== this.#commentText;\n this.#eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"comment\",\n data: {\n edited,\n },\n },\n });\n\n this.#editor?.focusCommentButton();\n this.#editor = null;\n this.#textInput.value = this.#previousText = this.#commentText = \"\";\n this.#overlayManager.closeIfActive(this.#dialog);\n this.#textInput.style.height = \"\";\n this.#uiManager?.addEditListeners();\n this.#uiManager = null;\n }\n\n destroy() {\n this.#uiManager = null;\n this.#editor = null;\n this.#finish();\n }\n}\n\nclass CommentPopup {\n #buttonsContainer = null;\n\n #eventBus;\n\n #commentDialog;\n\n #dateFormat;\n\n #editor = null;\n\n #isLTR;\n\n #container = null;\n\n #text = null;\n\n #time = null;\n\n #prevDragX = 0;\n\n #prevDragY = 0;\n\n #posX = 0;\n\n #posY = 0;\n\n #previousFocusedElement = null;\n\n #selected = false;\n\n #visible = false;\n\n constructor(eventBus, dateFormat, ltr, commentDialog) {\n this.#eventBus = eventBus;\n this.#dateFormat = dateFormat;\n this.#isLTR = ltr;\n this.#commentDialog = commentDialog;\n this.sidebar = null;\n }\n\n get _popupWidth() {\n const container = this.#createPopup();\n const { style } = container;\n style.opacity = \"0\";\n style.display = \"block\";\n document.body.append(container);\n const width = container.getBoundingClientRect().width;\n container.remove();\n style.opacity = style.display = \"\";\n return shadow(this, \"_popupWidth\", width);\n }\n\n #createPopup() {\n if (this.#container) {\n return this.#container;\n }\n const container = (this.#container = document.createElement(\"div\"));\n container.className = \"commentPopup\";\n container.id = \"commentPopup\";\n container.tabIndex = -1;\n container.role = \"dialog\";\n container.ariaModal = \"false\";\n container.addEventListener(\"contextmenu\", noContextMenu);\n container.addEventListener(\"keydown\", e => {\n if (e.key === \"Escape\") {\n this.toggle(this.#editor, true, false);\n this.#previousFocusedElement?.focus();\n stopEvent(e);\n }\n });\n container.addEventListener(\"click\", () => {\n container.focus();\n });\n\n const top = document.createElement(\"div\");\n top.className = \"commentPopupTop\";\n const time = (this.#time = document.createElement(\"time\"));\n time.className = \"commentPopupTime\";\n\n const buttons = (this.#buttonsContainer = document.createElement(\"div\"));\n buttons.className = \"commentPopupButtons\";\n const edit = document.createElement(\"button\");\n edit.classList.add(\"commentPopupEdit\", \"toolbarButton\");\n edit.tabIndex = 0;\n edit.setAttribute(\"data-l10n-id\", \"pdfjs-editor-edit-comment-popup-button\");\n edit.ariaHasPopup = \"dialog\";\n edit.ariaControlsElements = [this.#commentDialog];\n const editLabel = document.createElement(\"span\");\n editLabel.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-edit-comment-popup-button-label\"\n );\n edit.append(editLabel);\n edit.addEventListener(\"click\", () => {\n const editor = this.#editor;\n const height = parseFloat(getComputedStyle(this.#text).height);\n this.toggle(editor, /* isSelected */ true, /* visibility */ false);\n editor.editComment({\n height,\n });\n });\n edit.addEventListener(\"contextmenu\", noContextMenu);\n\n const del = document.createElement(\"button\");\n del.classList.add(\"commentPopupDelete\", \"toolbarButton\");\n del.tabIndex = 0;\n del.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-delete-comment-popup-button\"\n );\n const delLabel = document.createElement(\"span\");\n delLabel.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-delete-comment-popup-button-label\"\n );\n del.append(delLabel);\n del.addEventListener(\"click\", () => {\n this.#eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"comment\",\n data: {\n deleted: true,\n },\n },\n });\n const editor = this.#editor;\n const savedData = editor.comment;\n this.destroy();\n if (savedData?.text) {\n editor._uiManager.deleteComment(editor, savedData);\n } else {\n editor.comment = null;\n }\n editor.focus();\n });\n del.addEventListener(\"contextmenu\", noContextMenu);\n buttons.append(edit, del);\n\n top.append(time, buttons);\n\n const separator = document.createElement(\"hr\");\n\n const text = (this.#text = document.createElement(\"div\"));\n text.className = \"commentPopupText\";\n container.append(top, separator, text);\n\n // Make the dialog draggable.\n let pointerMoveAC;\n const cancelDrag = () => {\n container.classList.remove(\"dragging\");\n pointerMoveAC?.abort();\n pointerMoveAC = null;\n };\n top.addEventListener(\"pointerdown\", e => {\n if (pointerMoveAC) {\n cancelDrag();\n return;\n }\n const { target, clientX, clientY } = e;\n if (buttons.contains(target)) {\n return;\n }\n stopEvent(e);\n const { width: parentWidth, height: parentHeight } =\n this.#editor.parentBoundingClientRect;\n this.#prevDragX = clientX;\n this.#prevDragY = clientY;\n pointerMoveAC = new AbortController();\n const { signal } = pointerMoveAC;\n container.classList.add(\"dragging\");\n window.addEventListener(\n \"pointermove\",\n ev => {\n if (!pointerMoveAC) {\n return; // Not dragging.\n }\n const { clientX: x, clientY: y } = ev;\n this.#setPosition(\n this.#posX + (x - this.#prevDragX) / parentWidth,\n this.#posY + (y - this.#prevDragY) / parentHeight,\n /* correctPosition = */ false\n );\n this.#prevDragX = x;\n this.#prevDragY = y;\n stopEvent(ev);\n },\n { signal }\n );\n window.addEventListener(\"blur\", cancelDrag, { signal });\n window.addEventListener(\n \"pointerup\",\n ev => {\n if (pointerMoveAC) {\n cancelDrag();\n stopEvent(ev);\n }\n },\n { signal }\n );\n });\n\n return container;\n }\n\n updateColor(editor) {\n if (this.#editor !== editor || !this.#visible) {\n return;\n }\n const { color, opacity } = editor.getData();\n this.#container.style.backgroundColor =\n (color && CommentManager._makeCommentColor(color, opacity)) || \"\";\n }\n\n _hide(editor) {\n const container = this.#createPopup();\n\n container.classList.toggle(\"hidden\", true);\n container.classList.toggle(\"selected\", false);\n (editor || this.#editor)?.setCommentButtonStates({\n selected: false,\n hasPopup: false,\n });\n this.#editor = null;\n this.#selected = false;\n this.#visible = false;\n this.#text.replaceChildren();\n this.sidebar.selectComment(null);\n }\n\n toggle(editor, isSelected, visibility = undefined, isEditable = true) {\n if (!editor) {\n this.destroy();\n return;\n }\n\n if (isSelected) {\n visibility ??=\n this.#editor === editor ? !this.#selected || !this.#visible : true;\n } else {\n if (this.#selected) {\n return;\n }\n visibility ??= !this.#visible;\n }\n\n if (!visibility) {\n this._hide(editor);\n return;\n }\n\n this.#visible = true;\n if (this.#editor !== editor) {\n this.#editor?.setCommentButtonStates({\n selected: false,\n hasPopup: false,\n });\n }\n\n const container = this.#createPopup();\n this.#buttonsContainer.classList.toggle(\"hidden\", !isEditable);\n container.classList.toggle(\"hidden\", false);\n container.classList.toggle(\"selected\", isSelected);\n this.#selected = isSelected;\n this.#editor = editor;\n editor.setCommentButtonStates({\n selected: isSelected,\n hasPopup: true,\n });\n\n const {\n contentsObj,\n richText,\n creationDate,\n modificationDate,\n color,\n opacity,\n } = editor.getData();\n container.style.backgroundColor =\n (color && CommentManager._makeCommentColor(color, opacity)) || \"\";\n this.#text.replaceChildren();\n const html =\n richText?.str && (!contentsObj?.str || richText.str === contentsObj.str)\n ? richText.html\n : contentsObj?.str;\n if (html) {\n renderRichText(\n {\n html,\n dir: contentsObj?.dir || \"auto\",\n className: \"richText\",\n },\n this.#text\n );\n }\n this.#time.textContent = this.#dateFormat.format(\n PDFDateString.toDateObject(modificationDate || creationDate)\n );\n this.#setPosition(\n ...editor.commentPopupPosition,\n /* correctPosition = */ editor.hasDefaultPopupPosition()\n );\n editor.elementBeforePopup.after(container);\n container.addEventListener(\n \"focus\",\n ({ relatedTarget }) => {\n this.#previousFocusedElement = relatedTarget;\n },\n { once: true }\n );\n if (isSelected) {\n setTimeout(() => container.focus(), 0);\n }\n }\n\n #setPosition(x, y, correctPosition) {\n if (!correctPosition) {\n this.#editor.commentPopupPosition = [x, y];\n } else {\n const parentRect = this.#editor.parentBoundingClientRect;\n const widthRatio = this._popupWidth / parentRect.width;\n if (\n (this.#isLTR && x + widthRatio > 1) ||\n (!this.#isLTR && x - widthRatio >= 0)\n ) {\n const buttonWidth = this.#editor.commentButtonWidth;\n x -= widthRatio - buttonWidth;\n }\n const margin = 0.01;\n if (this.#isLTR) {\n x = Math.max(x, -parentRect.x / parentRect.width + margin);\n } else {\n x = Math.min(\n x,\n (window.innerWidth - parentRect.x) / parentRect.width -\n widthRatio -\n margin\n );\n }\n }\n this.#posX = x;\n this.#posY = y;\n const { style } = this.#container;\n style.left = `${100 * x}%`;\n style.top = `${100 * y}%`;\n }\n\n destroy() {\n this._hide();\n this.#container?.remove();\n this.#container = this.#text = this.#time = null;\n this.#prevDragX = this.#prevDragY = Infinity;\n this.#posX = this.#posY = 0;\n this.#previousFocusedElement = null;\n }\n}\n\nexport { CommentManager };\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 { isPdfFile } from \"pdfjs-lib\";\n\nclass BaseDownloadManager {\n #openBlobUrls = new WeakMap();\n\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseDownloadManager\n ) {\n throw new Error(\"Cannot initialize BaseDownloadManager.\");\n }\n }\n\n _triggerDownload(blobUrl, originalUrl, filename, isAttachment = false) {\n throw new Error(\"Not implemented: _triggerDownload\");\n }\n\n _getOpenDataUrl(blobUrl, filename, dest = null) {\n throw new Error(\"Not implemented: _getOpenDataUrl\");\n }\n\n /**\n * @param {Uint8Array} data\n * @param {string} filename\n * @param {string} [contentType]\n */\n downloadData(data, filename, contentType) {\n const blobUrl = URL.createObjectURL(\n new Blob([data], { type: contentType })\n );\n\n this._triggerDownload(\n blobUrl,\n /* originalUrl = */ blobUrl,\n filename,\n /* isAttachment = */ true\n );\n }\n\n /**\n * @param {Uint8Array} data\n * @param {string} filename\n * @param {string | null} [dest]\n * @returns {boolean} Indicating if the data was opened.\n */\n openOrDownloadData(data, filename, dest = null) {\n const isPdfData = isPdfFile(filename);\n const contentType = isPdfData ? \"application/pdf\" : \"\";\n\n if (isPdfData) {\n const blobUrl = this.#openBlobUrls.getOrInsertComputed(data, () =>\n URL.createObjectURL(new Blob([data], { type: contentType }))\n );\n try {\n const viewerUrl = this._getOpenDataUrl(blobUrl, filename, dest);\n\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(data);\n }\n }\n\n this.downloadData(data, filename, contentType);\n return false;\n }\n\n /**\n * @param {Uint8Array} data\n * @param {string} url\n * @param {string} filename\n */\n download(data, url, filename) {\n const blobUrl = data\n ? URL.createObjectURL(new Blob([data], { type: \"application/pdf\" }))\n : null;\n\n this._triggerDownload(blobUrl, /* originalUrl = */ url, filename);\n }\n}\n\nexport { BaseDownloadManager };\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 { BaseDownloadManager } from \"./base_download_manager.js\";\nimport { createValidAbsoluteUrl } 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\nclass DownloadManager extends BaseDownloadManager {\n _triggerDownload(blobUrl, originalUrl, filename, isAttachment = false) {\n if (!blobUrl && !isAttachment) {\n // Fallback to downloading non-attachments by their URL.\n if (!createValidAbsoluteUrl(originalUrl, \"http://example.com\")) {\n throw new Error(`_triggerDownload - not a valid URL: ${originalUrl}`);\n }\n blobUrl = originalUrl + \"#pdfjs.action=download\";\n }\n\n const a = document.createElement(\"a\");\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 _getOpenDataUrl(blobUrl, filename, dest = null) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"COMPONENTS\")) {\n throw new Error(\"Opening data is not supported in `COMPONENTS` builds.\");\n }\n // The current URL is the viewer, let's use it and append the file.\n let url = \"?file=\" + encodeURIComponent(blobUrl + \"#\" + filename);\n if (dest) {\n url += `#${escape(dest)}`;\n }\n return url;\n }\n}\n\nexport { DownloadManager };\n","/* Copyright 2024 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 { internalOpt } from \"./internal_evt.js\";\nimport { noContextMenu } from \"pdfjs-lib\";\n\nclass EditorUndoBar {\n #closeButton = null;\n\n #container;\n\n #eventBus = null;\n\n #focusTimeout = null;\n\n #initController = null;\n\n isOpen = false;\n\n #message;\n\n #showController = null;\n\n #undoButton;\n\n static #l10nMessages = Object.freeze({\n highlight: \"pdfjs-editor-undo-bar-message-highlight\",\n freetext: \"pdfjs-editor-undo-bar-message-freetext\",\n stamp: \"pdfjs-editor-undo-bar-message-stamp\",\n ink: \"pdfjs-editor-undo-bar-message-ink\",\n signature: \"pdfjs-editor-undo-bar-message-signature\",\n comment: \"pdfjs-editor-undo-bar-message-comment\",\n _multiple: \"pdfjs-editor-undo-bar-message-multiple\",\n });\n\n constructor({ container, message, undoButton, closeButton }, eventBus) {\n this.#container = container;\n this.#message = message;\n this.#undoButton = undoButton;\n this.#closeButton = closeButton;\n this.#eventBus = eventBus;\n }\n\n destroy() {\n this.#initController?.abort();\n this.#initController = null;\n\n this.hide();\n }\n\n show(undoAction, messageData) {\n if (!this.#initController) {\n this.#initController = new AbortController();\n const domOpts = { signal: this.#initController.signal };\n const evtOpts = { signal: this.#initController.signal, ...internalOpt };\n const boundHide = this.hide.bind(this);\n\n this.#container.addEventListener(\"contextmenu\", noContextMenu, domOpts);\n this.#closeButton.addEventListener(\"click\", boundHide, domOpts);\n this.#eventBus.on(\"beforeprint\", boundHide, evtOpts);\n this.#eventBus.on(\"download\", boundHide, evtOpts);\n }\n\n this.hide();\n\n if (typeof messageData === \"string\") {\n this.#message.setAttribute(\n \"data-l10n-id\",\n EditorUndoBar.#l10nMessages[messageData]\n );\n } else {\n this.#message.setAttribute(\n \"data-l10n-id\",\n EditorUndoBar.#l10nMessages._multiple\n );\n this.#message.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ count: messageData })\n );\n }\n this.isOpen = true;\n this.#container.hidden = false;\n\n this.#showController = new AbortController();\n\n this.#undoButton.addEventListener(\n \"click\",\n () => {\n undoAction();\n this.hide();\n },\n { signal: this.#showController.signal }\n );\n\n // Without the setTimeout, VoiceOver will read out the document title\n // instead of the popup label.\n this.#focusTimeout = setTimeout(() => {\n if (!this.#container.contains(document.activeElement)) {\n this.#container.focus();\n }\n this.#focusTimeout = null;\n }, 100);\n }\n\n hide() {\n if (!this.isOpen) {\n return;\n }\n this.isOpen = false;\n this.#container.hidden = true;\n\n this.#showController?.abort();\n this.#showController = null;\n\n if (this.#focusTimeout) {\n clearTimeout(this.#focusTimeout);\n this.#focusTimeout = null;\n }\n }\n}\n\nexport { EditorUndoBar };\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\", ({ target }) => {\n if (this.#active === target) {\n this.#active = null;\n }\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 /**\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 closeIfActive(dialog) {\n if (this.#active === dialog) {\n await this.close(dialog);\n }\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\n/** @typedef {import(\"./overlay_manager.js\").OverlayManager} OverlayManager */\n\nimport { PasswordResponses } 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 {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, 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._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 e.preventDefault();\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 await this.#activeCapability?.promise;\n this.#activeCapability = Promise.withResolvers();\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.setAttribute(\n \"data-l10n-id\",\n passwordIncorrect ? \"pdfjs-password-invalid\" : \"pdfjs-password-label\"\n );\n }\n\n async close() {\n this.overlayManager.closeIfActive(this.dialog);\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 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\";\nimport { stopEvent } from \"pdfjs-lib\";\n\nconst TREEITEM_SELECTED_CLASS = \"selected\";\n\nclass BaseTreeViewer {\n constructor(options) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === BaseTreeViewer\n ) {\n throw new Error(\"Cannot initialize BaseTreeViewer.\");\n }\n this.container = options.container;\n this.eventBus = options.eventBus;\n this._l10n = options.l10n;\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.replaceChildren();\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(\"withNesting\");\n }\n\n /**\n * @protected\n */\n _dispatchEvent(count) {\n throw new Error(\"Not implemented: _dispatchEvent\");\n }\n\n /**\n * @protected\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 * @param {HTMLDivElement} div\n * @param {boolean|object} [hidden]\n * @protected\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 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 // Pause translation when collapsing/expanding the subtree.\n this._l10n.pause();\n\n this._lastToggleIsShow = show;\n for (const toggler of root.querySelectorAll(\".treeItemToggler\")) {\n toggler.classList.toggle(\"treeItemsHidden\", !show);\n }\n this._l10n.resume();\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(\"withNesting\");\n this._lastToggleIsShow = !fragment.querySelector(\".treeItemsHidden\");\n this.container.addEventListener(\"click\", e => {\n const { target } = e;\n if (!target.classList.contains(\"treeItemToggler\")) {\n return;\n }\n stopEvent(e);\n target.classList.toggle(\"treeItemsHidden\");\n if (e.shiftKey) {\n const shouldShowAll = !target.classList.contains(\"treeItemsHidden\");\n this._toggleTreeItem(target.parentNode, shouldShowAll);\n }\n });\n }\n // Pause translation when inserting the tree into the DOM.\n this._l10n.pause();\n this.container.append(fragment);\n this._l10n.resume();\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 // Pause translation when expanding the treeItem.\n this._l10n.pause();\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._l10n.resume();\n\n this._updateCurrentTreeItem(treeItem);\n\n treeItem.scrollIntoView({\n behavior: \"instant\",\n block: \"center\",\n inline: \"center\",\n container: \"nearest\",\n });\n }\n}\n\nexport { BaseTreeViewer };\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(\"./event_utils.js\").EventBus} EventBus */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./download_manager.js\").DownloadManager} DownloadManager */\n\n/**\n * @import {\n * CatalogAttachmentContent,\n * CatalogAttachment,\n * } from \"../src/core/catalog.js\";\n * @import { PDFLinkService } from \"./pdf_link_service.js\";\n */\n\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\nimport { internalOpt } from \"./internal_evt.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 * @property {PDFLinkService} linkService - Link service.\n */\n\n/**\n * @typedef PDFAttachmentViewerRenderParameters\n * @property {Map<string, CatalogAttachment> | null} attachments - A lookup\n * table of attachment objects.\n * @property {boolean} [keepRenderedCapability]\n */\n\nclass PDFAttachmentViewer extends BaseTreeViewer {\n /**\n * @param {PDFAttachmentViewerOptions} options\n */\n constructor(options) {\n super(options);\n this.downloadManager = options.downloadManager;\n this.linkService = options.linkService;\n\n this.eventBus.on(\n \"fileattachmentannotation\",\n this.#appendAttachment.bind(this),\n internalOpt\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 = Promise.withResolvers();\n }\n this._pendingDispatchEvent = false;\n }\n\n /**\n * @protected\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 * @param {HTMLAnchorElement} element\n * @param {CatalogAttachment & { attachmentId?: string }} item\n * @returns {undefined}\n * @protected\n */\n _bindLink(\n element,\n { attachmentId, content: fallbackContent, description, filename }\n ) {\n if (description) {\n element.title = description;\n }\n\n const openAttachment = async () => {\n /** @type {CatalogAttachmentContent | undefined} */\n // Prefer lazy loading when we have an attachment id; fallbackContent is\n // only for the annotation-append path where bytes may already be present.\n const content = attachmentId\n ? await this.linkService.getAttachmentContent(attachmentId)\n : fallbackContent;\n\n if (content) {\n this.downloadManager?.openOrDownloadData(content, filename);\n }\n };\n\n element.onclick = () => {\n openAttachment();\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 const ul = document.createElement(\"ul\");\n fragment.append(ul);\n let attachmentsCount = 0;\n for (const [name, item] of attachments) {\n const li = document.createElement(\"li\");\n ul.append(li);\n const element = document.createElement(\"a\");\n li.append(element);\n this._bindLink(element, {\n ...item,\n attachmentId: item.attachmentId ?? name,\n });\n element.textContent = this._normalizeTextContent(item.filename);\n\n attachmentsCount++;\n }\n\n this._finishRendering(fragment, attachmentsCount);\n }\n\n /**\n * Used to append FileAttachment annotations to the sidebar.\n */\n #appendAttachment(item) {\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 = new Map(this._attachments);\n\n if (attachments.has(item.filename)) {\n return; // Ignore the new attachment if it already exists.\n }\n attachments.set(item.filename, item);\n\n this.render({\n attachments,\n keepRenderedCapability: true,\n });\n });\n }\n}\n\nexport { PDFAttachmentViewer };\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\nimport { stopEvent } from \"pdfjs-lib\";\n\n// Class name of element which can be grabbed.\nconst CSS_CLASS_GRAB = \"grab-to-pan-grab\";\n\n/**\n * @typedef {Object} GrabToPanOptions\n * @property {HTMLElement} element\n */\n\nclass GrabToPan {\n #activateAC = null;\n\n #mouseDownAC = null;\n\n #scrollAC = null;\n\n /**\n * Construct a GrabToPan instance for a given HTML element.\n * @param {GrabToPanOptions} options\n */\n constructor({ element }) {\n this.element = element;\n this.document = element.ownerDocument;\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.#activateAC) {\n this.#activateAC = new AbortController();\n\n this.element.addEventListener(\"mousedown\", this.#onMouseDown.bind(this), {\n capture: true,\n signal: this.#activateAC.signal,\n });\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.#activateAC) {\n this.#activateAC.abort();\n this.#activateAC = null;\n\n this.#endPan();\n this.element.classList.remove(CSS_CLASS_GRAB);\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\n this.#mouseDownAC = new AbortController();\n const boundEndPan = this.#endPan.bind(this),\n mouseOpts = { capture: true, signal: this.#mouseDownAC.signal };\n\n this.document.addEventListener(\n \"mousemove\",\n this.#onMouseMove.bind(this),\n mouseOpts\n );\n this.document.addEventListener(\"mouseup\", boundEndPan, mouseOpts);\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.#scrollAC = new AbortController();\n\n this.element.addEventListener(\"scroll\", boundEndPan, {\n capture: true,\n signal: this.#scrollAC.signal,\n });\n stopEvent(event);\n\n const focusedElement = document.activeElement;\n if (focusedElement && !focusedElement.contains(event.target)) {\n focusedElement.blur();\n }\n }\n\n #onMouseMove(event) {\n this.#scrollAC?.abort();\n this.#scrollAC = null;\n\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.#mouseDownAC?.abort();\n this.#mouseDownAC = null;\n this.#scrollAC?.abort();\n this.#scrollAC = null;\n // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n this.overlay.remove();\n }\n}\n\nexport { GrabToPan };\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.js\").EventBus} EventBus */\n\nimport { AnnotationEditorType, shadow } from \"pdfjs-lib\";\nimport { CursorTool, PresentationModeState } from \"./ui_utils.js\";\nimport { GrabToPan } from \"./grab_to_pan.js\";\nimport { internalOpt } from \"./internal_evt.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 this.#switchTool(tool);\n }\n\n #switchTool(tool, disabled = false) {\n if (tool === this.#active) {\n if (this.#prevActive !== null) {\n // Ensure that the `disabled`-attribute of the buttons will be updated.\n this.eventBus.dispatch(\"cursortoolchanged\", {\n source: this,\n tool,\n disabled,\n });\n }\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 disabled,\n });\n }\n\n #addEventListeners() {\n const { eventBus } = this;\n\n eventBus.on(\n \"switchcursortool\",\n evt => {\n if (!evt.reset) {\n this.switchTool(evt.tool);\n } else if (this.#prevActive !== null) {\n annotationEditorMode = AnnotationEditorType.NONE;\n presentationModeState = PresentationModeState.NORMAL;\n\n enableActive();\n }\n },\n internalOpt\n );\n\n let annotationEditorMode = AnnotationEditorType.NONE,\n presentationModeState = PresentationModeState.NORMAL;\n\n const disableActive = () => {\n this.#prevActive ??= this.#active; // Keep track of the first one.\n this.#switchTool(CursorTool.SELECT, /* disabled = */ true);\n };\n const enableActive = () => {\n if (\n this.#prevActive !== null &&\n annotationEditorMode === AnnotationEditorType.NONE &&\n presentationModeState === PresentationModeState.NORMAL\n ) {\n this.#switchTool(this.#prevActive);\n this.#prevActive = null;\n }\n };\n\n eventBus.on(\n \"annotationeditormodechanged\",\n ({ mode }) => {\n annotationEditorMode = mode;\n\n if (mode === AnnotationEditorType.NONE) {\n enableActive();\n } else {\n disableActive();\n }\n },\n internalOpt\n );\n\n eventBus.on(\n \"presentationmodechanged\",\n ({ state }) => {\n presentationModeState = state;\n\n if (state === PresentationModeState.NORMAL) {\n enableActive();\n } else if (state === PresentationModeState.FULLSCREEN) {\n disableActive();\n }\n },\n internalOpt\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 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(\"./event_utils.js\").EventBus} EventBus */\n/** @typedef {import(\"./overlay_manager.js\").OverlayManager} OverlayManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/api.js\").PDFDocumentProxy} PDFDocumentProxy */\n\nimport { getPageSizeInches, isPortraitOrientation } from \"./ui_utils.js\";\nimport { internalOpt } from \"./internal_evt.js\";\nimport { PDFDateString } from \"pdfjs-lib\";\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. The names,\n// which are l10n-ids, should be lowercase.\n// See https://en.wikipedia.org/wiki/Paper_size\nconst US_PAGE_NAMES = {\n \"8.5x11\": \"pdfjs-document-properties-page-size-name-letter\",\n \"8.5x14\": \"pdfjs-document-properties-page-size-name-legal\",\n};\nconst METRIC_PAGE_NAMES = {\n \"297x420\": \"pdfjs-document-properties-page-size-name-a-three\",\n \"210x297\": \"pdfjs-document-properties-page-size-name-a-four\",\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 {L10n} 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 titleLookup\n ) {\n this.dialog = dialog;\n this.fields = fields;\n this.overlayManager = overlayManager;\n this.l10n = l10n;\n this._fileNameLookup = fileNameLookup;\n this._titleLookup = titleLookup;\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(\n \"pagechanging\",\n evt => {\n this._currentPageNumber = evt.pageNumber;\n },\n internalOpt\n );\n eventBus.on(\n \"rotationchanging\",\n evt => {\n this._pagesRotation = evt.pagesRotation;\n },\n internalOpt\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 if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n this._fieldDataLastUpdated = Date.now();\n }\n\n // Get the document properties.\n const [\n { info, metadata, /* contentDispositionFilename, */ contentLength },\n pdfPage,\n ] = await Promise.all([\n this.pdfDocument.getMetadata(),\n this.pdfDocument.getPage(currentPageNumber).catch(reason => {\n console.error(\n `PDFDocumentProperties - unable to get page ${currentPageNumber}.`,\n reason\n );\n return null;\n }),\n ]);\n\n const [\n fileName,\n fileSize,\n title,\n creationDate,\n modificationDate,\n pageSize,\n isLinearized,\n ] = await Promise.all([\n this._fileNameLookup(),\n this.#parseFileSize(contentLength),\n this._titleLookup(),\n this.#parseDate(metadata?.get(\"xmp:createdate\"), info.CreationDate),\n this.#parseDate(metadata?.get(\"xmp:modifydate\"), info.ModDate),\n this.#parsePageSize(pdfPage, pagesRotation),\n this.#parseLinearization(info.IsLinearized),\n ]);\n\n this.#fieldData = Object.freeze({\n fileName,\n fileSize,\n title,\n author: metadata?.get(\"dc:creator\")?.join(\"\\n\") || info.Author,\n subject: metadata?.get(\"dc:subject\")?.join(\"\\n\") || info.Subject,\n keywords: metadata?.get(\"pdf:keywords\") || info.Keywords,\n creationDate,\n modificationDate,\n creator: metadata?.get(\"xmp:creatortool\") || info.Creator,\n producer: metadata?.get(\"pdf: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();\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 = Promise.withResolvers();\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 \"-\".\n */\n #updateUI() {\n if (this.#fieldData && this.overlayManager.active !== this.dialog) {\n // Don't bother updating the dialog if it's already been closed,\n // unless it's being reset (i.e. `this.#fieldData === null`),\n // since it will be updated the next time `this.open` is called.\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n this.dialog.dataset.fieldDataLastUpdated = this._fieldDataLastUpdated;\n }\n for (const id in this.fields) {\n const content = this.#fieldData?.[id];\n this.fields[id].textContent = content || content === 0 ? content : \"-\";\n }\n }\n\n async #parseFileSize(b = 0) {\n const kb = b / 1024,\n mb = kb / 1024;\n return kb\n ? this.l10n.get(\n mb >= 1\n ? \"pdfjs-document-properties-size-mb\"\n : \"pdfjs-document-properties-size-kb\",\n { mb, kb, b }\n )\n : undefined;\n }\n\n async #parsePageSize(pdfPage, pagesRotation) {\n if (!pdfPage) {\n return undefined;\n }\n let pageSizeInches = getPageSizeInches(pdfPage);\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 nonMetric = NON_METRIC_LOCALES.includes(this.l10n.getLanguage());\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 nameId =\n getPageName(sizeInches, isPortrait, US_PAGE_NAMES) ||\n getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES);\n\n if (\n !nameId &&\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 nameId = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);\n if (nameId) {\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 nonMetric ? sizeInches : sizeMillimeters,\n this.l10n.get(\n nonMetric\n ? \"pdfjs-document-properties-page-size-unit-inches\"\n : \"pdfjs-document-properties-page-size-unit-millimeters\"\n ),\n nameId && this.l10n.get(nameId),\n this.l10n.get(\n isPortrait\n ? \"pdfjs-document-properties-page-size-orientation-portrait\"\n : \"pdfjs-document-properties-page-size-orientation-landscape\"\n ),\n ]);\n\n return this.l10n.get(\n name\n ? \"pdfjs-document-properties-page-size-dimension-name-string\"\n : \"pdfjs-document-properties-page-size-dimension-string\",\n { width, height, unit, name, orientation }\n );\n }\n\n async #parseDate(metadataDate, infoDate) {\n const dateObj =\n Date.parse(metadataDate) || PDFDateString.toDateObject(infoDate);\n return dateObj\n ? this.l10n.get(\"pdfjs-document-properties-date-time-string\", {\n dateObj: dateObj.valueOf(),\n })\n : undefined;\n }\n\n #parseLinearization(isLinearized) {\n return this.l10n.get(\n isLinearized\n ? \"pdfjs-document-properties-linearized-yes\"\n : \"pdfjs-document-properties-linearized-no\"\n );\n }\n}\n\nexport { PDFDocumentProperties };\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\nimport { FeatureTest } from \"pdfjs-lib\";\n\nlet wordSegmenter = null;\nlet graphemeSegmenter = null;\n\nfunction isWordBreakAt(content, pos) {\n // `pos` must be a grapheme boundary (so a combining mark stays attached to\n // its base, and a surrogate pair isn't split) as well as a word boundary,\n // the latter tested on the two adjacent grapheme clusters in isolation like\n // Firefox's find (see `nsFind::BreakInBetween`).\n graphemeSegmenter ||= new Intl.Segmenter(undefined, {\n granularity: \"grapheme\",\n });\n\n const graphemes = graphemeSegmenter.segment(content);\n const after = graphemes.containing(pos);\n if (after.index !== pos) {\n return false;\n }\n\n wordSegmenter ||= new Intl.Segmenter(undefined, { granularity: \"word\" });\n const before = graphemes.containing(pos - 1).segment;\n return (\n wordSegmenter.segment(before + after.segment).containing(before.length)\n .index === before.length\n );\n}\n\n/**\n * Determine if the match spanning `[startIdx, startIdx + length)` in `content`\n * is a whole word, i.e. there's a word break on each side of it. Each boundary\n * is tested on its two adjacent characters in isolation rather than on the\n * whole string, so a contraction such as \"can't\" doesn't prevent \"can\" from\n * being an entire word, matching Firefox's find:\n * https://searchfox.org/firefox-main/source/toolkit/components/find/nsFind.cpp\n */\nfunction isEntireWord(content, startIdx, length) {\n const endIdx = startIdx + length;\n return (\n (startIdx === 0 || isWordBreakAt(content, startIdx)) &&\n (endIdx === content.length || isWordBreakAt(content, endIdx))\n );\n}\n\nlet NormalizeWithNFKC;\nfunction getNormalizeWithNFKC() {\n if (\n (typeof PDFJSDev === \"undefined\" && FeatureTest.platform.isFirefox) ||\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\"))\n ) {\n // The `NormalizeWithNFKC` string is generated with the for loop below.\n // Because of a small difference between Chrome and Firefox, the string is\n // only hardcoded for Firefox, and Chrome (or others) will generate it at\n // runtime.\n // In order to detect if the string is up to date, a check is performed in\n // the loop below, and if a difference is detected, an error is thrown.\n /* eslint-disable no-irregular-whitespace */\n NormalizeWithNFKC ||= `\\xA0¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;\n }\n\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"TESTING\") ||\n (!PDFJSDev.test(\"MOZCENTRAL\") && !NormalizeWithNFKC)\n ) {\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 if (i >= 0xd800 && i <= 0xdfff) {\n continue; // Skip surrogates since they're not valid Unicode scalar values.\n }\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\n const rangesStr = ranges.join(\"\");\n if (!NormalizeWithNFKC) {\n NormalizeWithNFKC = rangesStr;\n } else if (rangesStr !== NormalizeWithNFKC) {\n for (let i = 1; i < rangesStr.length; i++) {\n if (rangesStr[i] !== NormalizeWithNFKC[i]) {\n console.log(\n `Difference at index ${i}: ` +\n `U+${rangesStr.charCodeAt(i).toString(16).toUpperCase().padStart(4, \"0\")}` +\n `!== U+${NormalizeWithNFKC.charCodeAt(i)\n .toString(16)\n .toUpperCase()\n .padStart(4, \"0\")}`\n );\n break;\n }\n }\n throw new Error(\n \"getNormalizeWithNFKC - update the `NormalizeWithNFKC` string.\"\n );\n }\n }\n return NormalizeWithNFKC;\n}\n\nexport { getNormalizeWithNFKC, isEntireWord };\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(\"./pdf_link_service.js\").PDFLinkService} PDFLinkService */\n\nimport { getNormalizeWithNFKC, isEntireWord } from \"./pdf_find_utils.js\";\nimport { binarySearchFirstItem } from \"./ui_utils.js\";\nimport { internalOpt } from \"./internal_evt.js\";\n\nconst FindState = {\n FOUND: 0,\n NOT_FOUND: 1,\n WRAPPED: 2,\n PENDING: 3,\n};\n\nconst CHARACTERS_TO_NORMALIZE = new Map([\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 = /([+^$|])|(\\p{P}+)|(\\s+)|(\\p{M})|(\\p{L})/gu;\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, options = {}) {\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 const hasSyllables = syllablePositions.length > 0;\n const ignoreDashEOL = options.ignoreDashEOL ?? false;\n\n let normalizationRegex;\n if (!hasSyllables && noSyllablesRegExp) {\n normalizationRegex = noSyllablesRegExp;\n } else if (hasSyllables && withSyllablesRegExp) {\n normalizationRegex = withSyllablesRegExp;\n } else {\n // Compile the regular expression for text normalization once.\n const replace = CHARACTERS_TO_NORMALIZE.keys().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 BrokenWord = `\\\\p{Ll}-\\\\n(?=\\\\p{Ll})|\\\\p{Lu}-\\\\n(?=\\\\p{L})`;\n\n const regexps = [\n /* p1 */ `[${replace}]`,\n /* p2 */ `[${toNormalizeWithNFKC}]`,\n /* p3 */ `${HKDiacritics}\\\\n`,\n /* p4 */ \"\\\\p{M}+(?:-\\\\n)?\",\n /* p5 */ `${BrokenWord}`,\n /* p6 */ \"\\\\S-\\\\n\",\n /* p7 */ `${CJK}\\\\n`,\n /* p8 */ \"\\\\n\",\n /* p9 */ hasSyllables\n ? FIRST_CHAR_SYLLABLES_REG_EXP\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 \"\\\\u0000\",\n ];\n normalizationRegex = new RegExp(\n regexps.map(r => `(${r})`).join(\"|\"),\n \"gmu\"\n );\n\n if (hasSyllables) {\n withSyllablesRegExp = normalizationRegex;\n } else {\n noSyllablesRegExp = normalizationRegex;\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, p9, i) => {\n i -= shiftOrigin;\n if (p1) {\n // Maybe fractions or quotations mark...\n const replacement = CHARACTERS_TO_NORMALIZE.get(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 const replacement = NFKC_CHARS_TO_NORMALIZE.getOrInsertComputed(\n p2,\n () => p2.normalize(\"NFKC\")\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 (p6)` 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 if (ignoreDashEOL) {\n // Keep the - but remove the EOL.\n shiftOrigin += 1;\n eol += 1;\n return p5.slice(0, -1);\n }\n // In \"X-\\ny\", \"-\\n\" is removed because an hyphen at the end of a line\n // between two letters is likely here to mark a break 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 // A - following a non-space character that is not detected as the\n // hyphen breaking a word in two lines needs to be preserved. It could\n // be, for example, in a compound word or in a date.\n // Only remove the newline.\n shiftOrigin += 1;\n eol += 1;\n return p6.slice(0, -1);\n }\n\n if (p7) {\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 = p7.length - 1;\n positions.push(i - shift + len, shift);\n shiftOrigin += 1;\n eol += 1;\n return p7.slice(0, -1);\n }\n\n if (p8) {\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 // p9\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 p9;\n }\n );\n\n positions.push(normalized.length, shift);\n const starts = new Uint32Array(positions.length >> 1);\n const shifts = new Int32Array(positions.length >> 1);\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n starts[i >> 1] = positions[i];\n shifts[i >> 1] = positions[i + 1];\n }\n\n return [normalized, [starts, shifts], 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 const [starts, shifts] = diffs;\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(starts, x => x >= start);\n if (starts[i] > start) {\n --i;\n }\n\n let j = binarySearchFirstItem(starts, x => x >= end, i);\n if (starts[j] > end) {\n --j;\n }\n\n // First char in the old string.\n const oldStart = start + shifts[i];\n\n // Last char in the old string.\n const oldEnd = end + shifts[j];\n const oldLen = oldEnd + 1 - oldStart;\n\n return [oldStart, oldLen];\n}\n\n/**\n * @typedef {Object} PDFFindControllerOptions\n * @property {PDFLinkService} linkService - The navigation/linking service.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} [delay] - The number of milliseconds to delay execution of\n * find commands. In the viewer each keystroke in the find bar triggers a\n * `find` event, so this delay avoids triggering a search prematurely when the\n * user is still typing the query. The default value is 250.\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 #delay = 0;\n\n #visitedPagesCount = 0;\n\n #copiedPageData = null;\n\n #savedPageData = null;\n\n /**\n * @param {PDFFindControllerOptions} options\n */\n constructor({\n linkService,\n eventBus,\n delay = 250,\n updateMatchesCountOnProgress = true,\n }) {\n this._linkService = linkService;\n this._eventBus = eventBus;\n this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress;\n this.#delay = delay;\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), internalOpt);\n eventBus.on(\"findbarclose\", this.#onFindBarClose.bind(this), internalOpt);\n eventBus.on(\"pagesedited\", this.#onPagesEdited.bind(this), internalOpt);\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 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 }, this.#delay);\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} pageIndex\n * @property {number} matchIndex\n */\n\n /**\n * Scroll the current match into view.\n * @param {PDFFindControllerScrollMatchIntoViewParams}\n */\n scrollMatchIntoView({ element = null, pageIndex = -1, matchIndex = -1 }) {\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 element.scrollIntoView({ block: \"start\", inline: \"center\" });\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 this.#copiedPageData = null;\n\n this._firstPageCapability = Promise.withResolvers();\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 #convertToRegExpString(query, hasDiacritics) {\n const { matchDiacritics } = this.#state;\n let isUnicode = false;\n const addExtraWhitespaces = (original, fixed) => {\n if (original === query) {\n return fixed;\n }\n if (query.startsWith(original)) {\n return `${fixed}[ ]*`;\n }\n if (query.endsWith(original)) {\n return `[ ]*${fixed}`;\n }\n return `[ ]*${fixed}[ ]*`;\n };\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 interfere with regexp syntax.\n return addExtraWhitespaces(p1, RegExp.escape(p1));\n }\n if (p2) {\n // Allow whitespaces around group of punctuation signs.\n return addExtraWhitespaces(p2, RegExp.escape(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 if (!this.#state) {\n return;\n }\n const query = this.#query;\n if (query.length === 0) {\n return; // Do nothing: the matches should be wiped out already.\n }\n const pageContent = this._pageContents[pageIndex];\n const matcherResult = this.match(query, pageContent, pageIndex);\n\n const matches = (this._pageMatches[pageIndex] = []);\n const matchesLength = (this._pageMatchesLength[pageIndex] = []);\n const diffs = this._pageDiffs[pageIndex];\n\n matcherResult?.forEach(({ index, length }) => {\n const [matchPos, matchLen] = getOriginalIndex(diffs, index, length);\n if (matchLen) {\n matches.push(matchPos);\n matchesLength.push(matchLen);\n }\n });\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 = matches.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 /**\n * @typedef {Object} FindMatch\n * @property {number} index - The start of the matched text in the page's\n * string contents.\n * @property {number} length - The length of the matched text.\n */\n\n /**\n * @param {string | string[]} query - The search query.\n * @param {string} pageContent - The text content of the page to search in.\n * @param {number} pageIndex - The index of the page that is being processed.\n * @returns {FindMatch[] | undefined} An array of matches in the provided\n * page.\n */\n match(query, pageContent, 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 if (!query) {\n // The query can be empty because some chars like diacritics could have\n // been stripped out.\n return undefined;\n }\n\n const { caseSensitive, entireWord } = this.#state;\n const flags = `g${isUnicode ? \"u\" : \"\"}${caseSensitive ? \"\" : \"i\"}`;\n query = new RegExp(query, flags);\n\n const matches = [];\n let match;\n while ((match = query.exec(pageContent)) !== null) {\n if (\n entireWord &&\n !isEntireWord(pageContent, match.index, match[0].length)\n ) {\n continue;\n }\n matches.push({ index: match.index, length: match[0].length });\n }\n return matches;\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 deferred = Promise.resolve();\n const textOptions = { disableNormalization: true };\n const pdfDoc = this._pdfDocument;\n for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {\n const { promise, resolve } = Promise.withResolvers();\n this._extractTextPromises[i] = promise;\n\n deferred = deferred.then(async () => {\n if (pdfDoc !== this._pdfDocument) {\n resolve();\n return;\n }\n try {\n const pdfPage = await pdfDoc.getPage(i + 1);\n const textContent = await pdfPage.getTextContent(textOptions);\n\n if (pdfDoc !== this._pdfDocument) {\n resolve();\n return;\n }\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 // Store the normalized page content (text items) as one string.\n [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] =\n normalize(strBuf.join(\"\"));\n } catch (ex) {\n if (pdfDoc !== this._pdfDocument) {\n resolve();\n return;\n }\n console.error(`Unable to get text content for page ${i + 1}`, ex);\n // Page error -- assuming no text content.\n [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] =\n [\"\", null, false];\n }\n resolve();\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 #onPagesEdited({ pagesMapper, type, pageNumbers }) {\n if (this._extractTextPromises.length === 0) {\n return;\n }\n\n if (type === \"copy\") {\n const promises = new Map();\n const contents = new Map();\n const diffs = new Map();\n const diacritics = new Map();\n for (const pageNum of pageNumbers) {\n promises.set(pageNum, this._extractTextPromises[pageNum - 1]);\n contents.set(pageNum, this._pageContents[pageNum - 1]);\n diffs.set(pageNum, this._pageDiffs[pageNum - 1]);\n diacritics.set(pageNum, this._hasDiacritics[pageNum - 1]);\n }\n this.#copiedPageData = { promises, contents, diffs, diacritics };\n return;\n }\n\n if (type === \"cancelCopy\") {\n this.#copiedPageData = null;\n return;\n }\n\n if (type === \"delete\") {\n this.#savedPageData = {\n promises: this._extractTextPromises,\n contents: this._pageContents,\n diffs: this._pageDiffs,\n diacritics: this._hasDiacritics,\n };\n }\n\n if (type === \"cancelDelete\") {\n this._extractTextPromises = this.#savedPageData.promises;\n this._pageContents = this.#savedPageData.contents;\n this._pageDiffs = this.#savedPageData.diffs;\n this._hasDiacritics = this.#savedPageData.diacritics;\n return;\n }\n\n if (type === \"cleanSavedData\") {\n this.#savedPageData = null;\n return;\n }\n\n // Cancel any pending find timeout and clear a pending resume page index\n // synchronously. Calling #onFindBarClose() here would schedule its cleanup\n // asynchronously.\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n this._resumePageIdx = null;\n this._dirtyMatch = true;\n const prevPromises = this._extractTextPromises;\n const prevContents = this._pageContents;\n const prevDiffs = this._pageDiffs;\n const prevDiacritics = this._hasDiacritics;\n const extractTextPromises = (this._extractTextPromises = []);\n const pageContents = (this._pageContents = []);\n const pageDiffs = (this._pageDiffs = []);\n const hasDiacritics = (this._hasDiacritics = []);\n for (let i = 1, ii = pagesMapper.pagesNumber; i <= ii; i++) {\n const prevPageNumber = pagesMapper.getPrevPageNumber(i);\n if (prevPageNumber < 0) {\n const src = -prevPageNumber;\n extractTextPromises.push(\n this.#copiedPageData?.promises.get(src) || Promise.resolve()\n );\n pageContents.push(this.#copiedPageData?.contents.get(src) ?? \"\");\n pageDiffs.push(this.#copiedPageData?.diffs.get(src) ?? null);\n hasDiacritics.push(this.#copiedPageData?.diacritics.get(src) ?? false);\n continue;\n }\n extractTextPromises.push(\n prevPromises[prevPageNumber - 1] || Promise.resolve()\n );\n pageContents.push(prevContents[prevPageNumber - 1] ?? \"\");\n pageDiffs.push(prevDiffs[prevPageNumber - 1] ?? null);\n hasDiacritics.push(prevDiacritics[prevPageNumber - 1] ?? false);\n }\n if (this.#state) {\n this.#nextMatch();\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 entireWord: this.#state?.entireWord ?? null,\n matchesCount: this.#requestMatchesCount(),\n rawQuery: this.#state?.query ?? null,\n });\n }\n}\n\nexport { FindState, getOriginalIndex, normalize, PDFFindController };\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 #mainContainer;\n\n #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this));\n\n opened = false;\n\n constructor(options, mainContainer, eventBus) {\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.#mainContainer = mainContainer;\n\n const checkedInputs = new Map([\n [this.highlightAll, \"highlightallchange\"],\n [this.caseSensitive, \"casesensitivitychange\"],\n [this.entireWord, \"entirewordchange\"],\n [this.matchDiacritics, \"diacriticmatchingchange\"],\n ]);\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\", ({ keyCode, shiftKey, target }) => {\n switch (keyCode) {\n case 13: // Enter\n if (target === this.findField) {\n this.dispatchEvent(\"again\", shiftKey);\n } else if (checkedInputs.has(target)) {\n target.checked = !target.checked;\n this.dispatchEvent(/* evtName = */ checkedInputs.get(target));\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 this.findNextButton.addEventListener(\"click\", () => {\n this.dispatchEvent(\"again\", false);\n });\n\n for (const [elem, evtName] of checkedInputs) {\n elem.addEventListener(\"click\", () => {\n this.dispatchEvent(evtName);\n });\n }\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 const { findField, findMsg } = this;\n let findMsgId = \"\",\n 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 findMsgId = \"pdfjs-find-not-found\";\n status = \"notFound\";\n break;\n case FindState.WRAPPED:\n findMsgId = previous\n ? \"pdfjs-find-reached-top\"\n : \"pdfjs-find-reached-bottom\";\n break;\n }\n findField.setAttribute(\"data-status\", status);\n findField.setAttribute(\"aria-invalid\", state === FindState.NOT_FOUND);\n\n findMsg.setAttribute(\"data-status\", status);\n if (findMsgId) {\n findMsg.setAttribute(\"data-l10n-id\", findMsgId);\n } else {\n findMsg.removeAttribute(\"data-l10n-id\");\n findMsg.textContent = \"\";\n }\n\n this.updateResultsCount(matchesCount);\n }\n\n updateResultsCount({ current = 0, total = 0 } = {}) {\n const { findResultsCount } = this;\n\n if (total > 0) {\n const limit = MATCHES_COUNT_LIMIT;\n\n findResultsCount.setAttribute(\n \"data-l10n-id\",\n total > limit\n ? \"pdfjs-find-match-count-limit\"\n : \"pdfjs-find-match-count\"\n );\n findResultsCount.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ limit, current, total })\n );\n } else {\n findResultsCount.removeAttribute(\"data-l10n-id\");\n findResultsCount.textContent = \"\";\n }\n }\n\n open() {\n if (!this.opened) {\n // Potentially update the findbar layout, row vs column, when:\n // - The width of the viewer itself changes.\n // - The width of the findbar changes, by toggling the visibility\n // (or localization) of find count/status messages.\n this.#resizeObserver.observe(this.#mainContainer);\n this.#resizeObserver.observe(this.bar);\n\n this.opened = true;\n toggleExpandedBtn(this.toggleButton, true, this.bar);\n }\n this.findField.select();\n this.findField.focus();\n }\n\n close() {\n if (!this.opened) {\n return;\n }\n this.#resizeObserver.disconnect();\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 #resizeObserverCallback() {\n const { bar } = this;\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 bar.classList.remove(\"wrapContainers\");\n\n const findbarHeight = bar.clientHeight;\n const inputContainerHeight = 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 bar.classList.add(\"wrapContainers\");\n }\n }\n}\n\nexport { PDFFindBar };\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(\"./pdf_link_service.js\").PDFLinkService} PDFLinkService */\n\nimport { isValidRotation, parseQueryString } from \"./ui_utils.js\";\nimport { internalOpt } from \"./internal_evt.js\";\nimport { updateUrlHash } from \"pdfjs-lib\";\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 {PDFLinkService} 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 #eventAC = null;\n\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 // Ensure that we don't miss a \"pagesinit\" event,\n // by registering the listener immediately.\n this.eventBus.on(\n \"pagesinit\",\n () => {\n this._isPagesLoaded = false;\n\n this.eventBus.on(\n \"pagesloaded\",\n evt => {\n this._isPagesLoaded = !!evt.pagesCount;\n },\n { once: true, ...internalOpt }\n );\n },\n internalOpt\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 #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 { href, protocol } = document.location;\n if (protocol !== \"file:\") {\n newUrl = updateUrlHash(href, destination.hash);\n }\n }\n if (shouldReplace) {\n window.history.replaceState(newState, \"\", newUrl);\n } else {\n window.history.pushState(newState, \"\", newUrl);\n }\n }\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 #isValidPage(val) {\n return (\n Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount\n );\n }\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 #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 #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 #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 #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 #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 #bindEvents() {\n if (this.#eventAC) {\n return; // The event listeners were already added.\n }\n this.#eventAC = new AbortController();\n const { signal } = this.#eventAC;\n\n this.eventBus.on(\"updateviewarea\", this.#updateViewarea.bind(this), {\n signal,\n ...internalOpt,\n });\n window.addEventListener(\"popstate\", this.#popState.bind(this), { signal });\n window.addEventListener(\"pagehide\", this.#pageHide.bind(this), { signal });\n }\n\n #unbindEvents() {\n this.#eventAC?.abort();\n this.#eventAC = 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\n/** @typedef {import(\"./event_utils.js\").EventBus} EventBus */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/optional_content_config.js\").OptionalContentConfig} OptionalContentConfig */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/api.js\").PDFDocumentProxy} PDFDocumentProxy */\n\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\nimport { internalOpt } from \"./internal_evt.js\";\n\n/**\n * @typedef {Object} PDFLayerViewerOptions\n * @property {HTMLDivElement} container - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n */\n\n/**\n * @typedef {Object} PDFLayerViewerRenderParameters\n * @property {OptionalContentConfig|null} optionalContentConfig - An\n * {OptionalContentConfig} instance.\n * @property {PDFDocumentProxy} pdfDocument - A {PDFDocument} instance.\n */\n\nclass PDFLayerViewer extends BaseTreeViewer {\n constructor(options) {\n super(options);\n\n const { eventBus } = this;\n eventBus.on(\n \"optionalcontentconfigchanged\",\n evt => {\n this.#updateLayers(evt.promise);\n },\n internalOpt\n );\n eventBus.on(\n \"resetlayers\",\n () => {\n this.#updateLayers();\n },\n internalOpt\n );\n eventBus.on(\n \"togglelayerstree\",\n this._toggleAllTreeItems.bind(this),\n internalOpt\n );\n }\n\n reset() {\n super.reset();\n this._optionalContentConfig = null;\n\n this._optionalContentVisibility?.clear();\n this._optionalContentVisibility = null;\n }\n\n /**\n * @protected\n */\n _dispatchEvent(layersCount) {\n this.eventBus.dispatch(\"layersloaded\", {\n source: this,\n layersCount,\n });\n }\n\n /**\n * @protected\n */\n _bindLink(element, { groupId, input }) {\n const setVisibility = () => {\n const visible = input.checked;\n this._optionalContentConfig.setVisibility(groupId, visible);\n\n const cached = this._optionalContentVisibility.get(groupId);\n if (cached) {\n cached.visible = visible;\n }\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 _setNestedName(element, { name = null }) {\n if (typeof name === \"string\") {\n element.textContent = this._normalizeTextContent(name);\n return;\n }\n element.setAttribute(\"data-l10n-id\", \"pdfjs-additional-layers\");\n element.style.fontStyle = \"italic\";\n // Trigger translation manually, since translation is paused when\n // the final layer-tree is appended to the DOM.\n this._l10n.translateOnce(element);\n }\n\n /**\n * @protected\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._optionalContentVisibility = new Map();\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 const label = document.createElement(\"label\");\n const input = document.createElement(\"input\");\n label.append(\n input,\n document.createTextNode(this._normalizeTextContent(group.name))\n );\n this._bindLink(element, { groupId, input });\n input.type = \"checkbox\";\n input.checked = group.visible;\n\n this._optionalContentVisibility.set(groupId, {\n input,\n visible: input.checked,\n });\n\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({ intent: \"display\" }));\n\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the optional content resolved.\n }\n if (promise) {\n // Ensure that the UI displays the correct state (e.g. with RBGroups).\n for (const [groupId, cached] of this._optionalContentVisibility) {\n const group = optionalContentConfig.getGroup(groupId);\n\n if (group && cached.visible !== group.visible) {\n cached.input.checked = cached.visible = !cached.visible;\n }\n }\n return;\n }\n this.eventBus.dispatch(\"optionalcontentconfig\", {\n source: this,\n promise: Promise.resolve(optionalContentConfig),\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\n/** @typedef {import(\"./event_utils.js\").EventBus} EventBus */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./download_manager.js\").DownloadManager} DownloadManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/api.js\").PDFDocumentProxy} PDFDocumentProxy */\n\n/**\n * @import { CatalogAttachmentContent } from \"../src/core/catalog.js\";\n */\n\nimport { BaseTreeViewer } from \"./base_tree_viewer.js\";\nimport { internalOpt } from \"./internal_evt.js\";\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 {PDFLinkService} 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 {PDFDocumentProxy} 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 const { eventBus } = this;\n eventBus.on(\n \"toggleoutlinetree\",\n this._toggleAllTreeItems.bind(this),\n internalOpt\n );\n eventBus.on(\n \"currentoutlineitem\",\n this._currentOutlineItem.bind(this),\n internalOpt\n );\n\n eventBus.on(\n \"pagechanging\",\n evt => {\n this._currentPageNumber = evt.pageNumber;\n },\n internalOpt\n );\n eventBus.on(\n \"pagesloaded\",\n 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 this._currentOutlineItemCapability?.resolve(\n /* enabled = */ this._isPagesLoaded\n );\n },\n internalOpt\n );\n eventBus.on(\n \"sidebarviewchanged\",\n evt => {\n this._sidebarView = evt.view;\n },\n internalOpt\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 this._currentOutlineItemCapability?.resolve(/* enabled = */ false);\n this._currentOutlineItemCapability = null;\n }\n\n /**\n * @protected\n */\n _dispatchEvent(outlineCount) {\n this._currentOutlineItemCapability = Promise.withResolvers();\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 * @protected\n */\n _bindLink(\n element,\n { url, newWindow, action, attachmentId, 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 (attachmentId && attachment) {\n element.href = linkService.getAnchorUrl(\"\");\n\n const openAttachment = async () => {\n /** @type {CatalogAttachmentContent} */\n const content = await linkService.getAttachmentContent(attachmentId);\n\n if (content) {\n this.downloadManager?.openOrDownloadData(\n content,\n attachment.filename\n );\n }\n };\n\n element.onclick = () => {\n openAttachment();\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 * @protected\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 = Promise.withResolvers();\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 (destRef && typeof destRef === \"object\") {\n // The page reference must be available, since the current method\n // won't be invoked until all pages have been loaded.\n pageNumber = pdfDocument.cachedPageNumber(destRef);\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\n/** @typedef {import(\"./event_utils.js\").EventBus} EventBus */\n/** @typedef {import(\"./pdf_viewer.js\").PDFViewer} PDFViewer */\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 #fullscreenChangeAC = null;\n\n #windowAC = 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 if (evt.target.closest?.(\".mediaAnnotation\")) {\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 document.getSelection().empty();\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 // Allow interacting with embedded media controls rather than advancing.\n if (evt.target.closest?.(\".mediaAnnotation\")) {\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.target.closest?.(\".mediaAnnotation\")) {\n this.touchSwipeState = null;\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 if (this.#windowAC) {\n return;\n }\n this.#windowAC = new AbortController();\n const { signal } = this.#windowAC;\n\n const touchSwipeBind = this.#touchSwipe.bind(this);\n\n window.addEventListener(\"mousemove\", this.#showControls.bind(this), {\n signal,\n });\n window.addEventListener(\"mousedown\", this.#mouseDown.bind(this), {\n signal,\n });\n window.addEventListener(\"wheel\", this.#mouseWheel.bind(this), {\n passive: false,\n signal,\n });\n window.addEventListener(\"keydown\", this.#resetMouseScrollState.bind(this), {\n signal,\n });\n window.addEventListener(\"contextmenu\", this.#contextMenu.bind(this), {\n signal,\n });\n window.addEventListener(\"touchstart\", touchSwipeBind, { signal });\n window.addEventListener(\"touchmove\", touchSwipeBind, { signal });\n window.addEventListener(\"touchend\", touchSwipeBind, { signal });\n }\n\n #removeWindowListeners() {\n this.#windowAC?.abort();\n this.#windowAC = null;\n }\n\n #addFullscreenChangeListeners() {\n if (this.#fullscreenChangeAC) {\n return;\n }\n this.#fullscreenChangeAC = new AbortController();\n\n window.addEventListener(\n \"fullscreenchange\",\n () => {\n if (/* isFullscreen = */ document.fullscreenElement) {\n this.#enter();\n } else {\n this.#exit();\n }\n },\n { signal: this.#fullscreenChangeAC.signal }\n );\n }\n\n #removeFullscreenChangeListeners() {\n this.#fullscreenChangeAC?.abort();\n this.#fullscreenChangeAC = null;\n }\n}\n\nexport { PDFPresentationMode };\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/page_viewport\").PageViewport} PageViewport */\n/** @typedef {import(\"./pdf_link_service.js\").PDFLinkService} PDFLinkService */\n\nimport { XfaLayer } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} XfaLayerBuilderOptions\n * @property {PDFPageProxy} pdfPage\n * @property {AnnotationStorage} [annotationStorage]\n * @property {PDFLinkService} linkService\n * @property {Object} [xfaHtml]\n */\n\n/**\n * @typedef {Object} XfaLayerBuilderRenderOptions\n * @property {PageViewport} viewport\n * @property {string} [intent] - The default value is \"display\".\n */\n\nclass XfaLayerBuilder {\n #cancelled = false;\n\n div = null;\n\n /**\n * @param {XfaLayerBuilderOptions} options\n */\n constructor({\n pdfPage,\n annotationStorage = null,\n linkService,\n xfaHtml = null,\n }) {\n this.pdfPage = pdfPage;\n this.annotationStorage = annotationStorage;\n this.linkService = linkService;\n this.xfaHtml = xfaHtml;\n }\n\n /**\n * @param {XfaLayerBuilderRenderOptions} viewport\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 let xfaHtml;\n if (intent === \"print\") {\n xfaHtml = this.xfaHtml;\n } else {\n xfaHtml = await this.pdfPage.getXfa();\n\n if (this.#cancelled || !xfaHtml) {\n return { textDivs: [] };\n }\n }\n\n // Create an xfa layer div and render the form\n const hasDiv = !!this.div;\n const params = {\n viewport: viewport.clone({ dontFlip: true }),\n div: (this.div ??= document.createElement(\"div\")),\n xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent,\n };\n\n return hasDiv ? XfaLayer.update(params) : XfaLayer.render(params);\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 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 { PixelsPerInch, XfaLayer } from \"pdfjs-lib\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\nimport { XfaLayerBuilder } from \"./xfa_layer_builder.js\";\n\nclass BasePrintServiceFactory {\n constructor() {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n throw new Error(\"Cannot initialize BasePrintServiceFactory.\");\n }\n }\n\n static initGlobals(app) {}\n\n static get supportsPrinting() {\n throw new Error(\"Not implemented: supportsPrinting\");\n }\n\n static createPrintService(params) {\n throw new Error(\"Not implemented: createPrintService\");\n }\n}\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 pdfPage: null,\n annotationStorage: pdfDocument.annotationStorage,\n linkService,\n xfaHtml: xfaPage,\n });\n const viewport = XfaLayer.getPageViewport(xfaPage, { scale });\n\n builder.render({ viewport, intent: \"print\" });\n page.append(builder.div);\n }\n}\n\nexport { BasePrintServiceFactory, getXfaHtmlForPrinting };\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 AnnotationMode,\n PixelsPerInch,\n RenderingCancelledException,\n shadow,\n} from \"pdfjs-lib\";\nimport {\n BasePrintServiceFactory,\n getXfaHtmlForPrinting,\n} from \"./print_utils.js\";\n\nlet activeService = null;\nlet dialog = null;\nlet overlayManager = null;\nlet viewerApp = { initialized: false };\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 canvas: scratchCanvas,\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 const renderTask = pdfPage.render(renderContext);\n\n return renderTask.promise.catch(reason => {\n if (!(reason instanceof RenderingCancelledException)) {\n console.error(reason);\n }\n throw reason;\n });\n });\n}\n\nclass PDFPrintService {\n constructor({\n pdfDocument,\n pagesOverview,\n printContainer,\n printResolution,\n printAnnotationStoragePromise = null,\n }) {\n this.pdfDocument = pdfDocument;\n this.pagesOverview = pagesOverview;\n this.printContainer = printContainer;\n this._printResolution = printResolution || 150;\n this._optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({\n intent: \"print\",\n });\n this._printAnnotationStoragePromise =\n printAnnotationStoragePromise || Promise.resolve();\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 = new CSSStyleSheet();\n this.pageStyleSheet.replaceSync(`@page { size: ${width}pt ${height}pt;}`);\n document.adoptedStyleSheets.push(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 document.adoptedStyleSheets = document.adoptedStyleSheets.filter(\n styleSheet => styleSheet !== this.pageStyleSheet\n );\n this.pageStyleSheet = null;\n }\n if (this._blobURLs) {\n for (const url of this._blobURLs) {\n URL.revokeObjectURL(url);\n }\n this._blobURLs = null;\n }\n this.scratchCanvas.width = this.scratchCanvas.height = 0;\n this.scratchCanvas = null;\n activeService = null;\n ensureOverlay().then(function () {\n overlayManager.closeIfActive(dialog);\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);\n resolve();\n return;\n }\n const index = this.currentPage;\n renderProgress(index, pageCount);\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 this.scratchCanvas.toBlob(blob => {\n const blobURL = URL.createObjectURL(blob);\n img.src = blobURL;\n // Defer revocation until after printing completes (in destroy()) to avoid\n // broken print images in Firefox when a service worker is registered,\n // since Firefox re-fetches blob URLs when rendering the print dialog.\n // See https://github.com/mozilla/pdf.js/issues/19988\n (this._blobURLs ??= []).push(blobURL);\n });\n\n const wrapper = document.createElement(\"div\");\n wrapper.className = \"printedPage\";\n wrapper.append(img);\n this.printContainer.append(wrapper);\n\n const { promise, resolve, reject } = Promise.withResolvers();\n img.onload = resolve;\n img.onerror = reject;\n\n promise.catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n return promise;\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 if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n // eslint-disable-next-line no-unsafe-finally\n throw new Error(\"window.print() is not supported\");\n }\n console.error(\"Expected print service to be initialized.\");\n ensureOverlay().then(function () {\n overlayManager.closeIfActive(dialog);\n });\n } else {\n const activeServiceOnEntry = activeService;\n activeService\n .renderPages()\n .then(() => activeServiceOnEntry.performPrint())\n .catch(() => {\n // Ignore any error messages.\n })\n .then(() => {\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\n // aborting this print request while the pages were being generated)\n // would be aborted.\n if (activeServiceOnEntry.active) {\n abort();\n }\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) {\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 progressPerc.setAttribute(\"data-l10n-args\", JSON.stringify({ progress }));\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 = viewerApp.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\nclass PDFPrintServiceFactory extends BasePrintServiceFactory {\n static initGlobals(app) {\n viewerApp = app;\n }\n\n static get supportsPrinting() {\n return shadow(this, \"supportsPrinting\", true);\n }\n\n static createPrintService(params) {\n if (activeService) {\n throw new Error(\"The print service is created and active.\");\n }\n return (activeService = new PDFPrintService(params));\n }\n}\n\nexport { PDFPrintServiceFactory };\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 RenderingStates = {\n INITIAL: 0,\n RUNNING: 1,\n PAUSED: 2,\n FINISHED: 3,\n};\n\nclass RenderableView {\n /**\n * Unique ID for rendering queue.\n * @type {string}\n */\n renderingId = \"\";\n\n /**\n * @type {import(\"../src/display/api\").RenderTask | null}\n */\n renderTask = null;\n\n /**\n * @type {function | null}\n */\n resume = null;\n\n constructor() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.constructor === RenderableView\n ) {\n throw new Error(\"Cannot initialize RenderableView.\");\n }\n }\n\n /**\n * @type {number}\n */\n get renderingState() {\n throw new Error(\"Abstract getter `renderingState` accessed\");\n }\n\n /**\n * @param {number} state\n */\n set renderingState(state) {\n throw new Error(\"Abstract setter `renderingState` accessed\");\n }\n\n /**\n * @returns {Promise} Resolved on draw completion.\n */\n async draw() {\n throw new Error(\"Not implemented: draw\");\n }\n}\n\nexport { RenderableView, RenderingStates };\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(\"./pdf_viewer\").PDFViewer} PDFViewer */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_thumbnail_viewer\").PDFThumbnailViewer} PDFThumbnailViewer */\n/** @typedef {import(\"./renderable_view\").RenderableView} RenderableView */\n\nimport { RenderingCancelledException } from \"pdfjs-lib\";\nimport { RenderingStates } from \"./renderable_view.js\";\n\nconst CLEANUP_TIMEOUT = 30000;\n\n/**\n * Controls rendering of the views for pages and thumbnails.\n */\nclass PDFRenderingQueue {\n #highestPriorityPage = null;\n\n #idleTimeout = null;\n\n #pdfThumbnailViewer = null;\n\n #pdfViewer = null;\n\n isThumbnailViewEnabled = false;\n\n onIdle = null;\n\n printing = false;\n\n constructor() {\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 {RenderableView} 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 * @param {boolean} [ignoreDetailViews]\n */\n getHighestPriority(\n visible,\n views,\n scrolledDown,\n preRenderExtra = false,\n ignoreDetailViews = false\n ) {\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. zoomed-in partial views of visible pages, unless `ignoreDetailViews`\n * 3. 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\n if (!ignoreDetailViews) {\n for (let i = 0; i < numVisible; i++) {\n const { detailView } = visibleViews[i].view;\n if (detailView && !this.isViewFinished(detailView)) {\n return detailView;\n }\n }\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 {RenderableView} 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 {RenderableView} 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 } from \"./ui_utils.js\";\nimport { internalOpt } from \"./internal_evt.js\";\nimport { RenderingStates } from \"./renderable_view.js\";\nimport { 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\n * scripting 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 #eventAC = null;\n\n #eventBus = null;\n\n #externalServices = null;\n\n #objectIds = null;\n\n #pdfDocument = null;\n\n #pdfViewer = null;\n\n #ready = false;\n\n #scripting = null;\n\n #willPrintCapability = null;\n\n /**\n * @param {PDFScriptingManagerOptions} options\n */\n constructor({ eventBus, externalServices = null, docProperties = null }) {\n this.#eventBus = eventBus;\n this.#externalServices = externalServices;\n this.#docProperties = docProperties;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.defineProperty(this, \"sandboxTrip\", {\n value: () =>\n setTimeout(\n () =>\n this.#scripting?.dispatchEventInSandbox({\n name: \"sandboxtripbegin\",\n }),\n 0\n ),\n });\n }\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\n // Collect the ids of every field annotation, so that any sandbox message\n // targeting an unknown id can be ignored.\n if (objects) {\n this.#objectIds = new Set();\n for (const fields of Object.values(objects)) {\n for (const { id } of fields) {\n this.#objectIds.add(id);\n }\n }\n }\n\n try {\n this.#scripting = this.#initScripting();\n } catch (error) {\n console.error(\"setDocument:\", error);\n\n await this.#destroyScripting();\n return;\n }\n const eventBus = this.#eventBus;\n\n this.#eventAC = new AbortController();\n const evtOpts = { signal: this.#eventAC.signal, ...internalOpt };\n\n eventBus.on(\n \"updatefromsandbox\",\n event => {\n if (event?.source === window) {\n this.#updateFromSandbox(event.detail);\n }\n },\n evtOpts\n );\n eventBus.on(\n \"dispatcheventinsandbox\",\n event => {\n this.#scripting?.dispatchEventInSandbox(event.detail);\n },\n evtOpts\n );\n\n eventBus.on(\n \"pagechanging\",\n ({ 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 evtOpts\n );\n eventBus.on(\n \"pagerendered\",\n ({ 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 evtOpts\n );\n eventBus.on(\n \"pagesdestroy\",\n 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 evtOpts\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 eventBus.dispatch(\"sandboxcreated\", { source: this });\n } catch (error) {\n console.error(\"setDocument:\", error);\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 = Promise.withResolvers();\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 _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 if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"TESTING\") &&\n command === \"sandboxTripEnd\"\n ) {\n window.setTimeout(() => {\n window.dispatchEvent(new CustomEvent(\"sandboxtripend\"));\n }, 0);\n return;\n }\n\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 if (!this.#objectIds?.has(elementId)) {\n continue;\n }\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 = Promise.withResolvers();\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 = Promise.withResolvers();\n\n if (this.#scripting) {\n throw new Error(\"#initScripting: Scripting already exists.\");\n }\n return this.#externalServices.createScripting();\n }\n\n async #destroyScripting() {\n this.#objectIds = null;\n\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 this.#eventAC?.abort();\n this.#eventAC = null;\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 2024 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 { internalOpt } from \"./internal_evt.js\";\n\n/**\n * This class manages the interaction of extracting the text content of the page\n * and passing it back to the external service.\n */\nclass PdfTextExtractor {\n /** @type {BaseExternalServices} */\n #externalServices;\n\n /** @type {?Promise<string>} */\n #textPromise;\n\n #capability = Promise.withResolvers();\n\n constructor(externalServices, pdfViewer, eventBus) {\n this.#externalServices = externalServices;\n\n eventBus.on(\n \"pagesinit\",\n () => {\n this.#capability.resolve(pdfViewer);\n },\n internalOpt\n );\n eventBus.on(\n \"pagesdestroy\",\n () => {\n this.#capability.reject(new Error(\"pagesdestroy\"));\n this.#textPromise = null;\n\n this.#capability = Promise.withResolvers();\n },\n internalOpt\n );\n\n window.addEventListener(\"requestTextContent\", ({ detail }) => {\n this.extractTextContent(detail.requestId);\n });\n }\n\n /**\n * Builds up all of the text from a PDF.\n *\n * @param {number} requestId\n */\n async extractTextContent(requestId) {\n if (!this.#textPromise) {\n const textPromise = (this.#textPromise = this.#capability.promise.then(\n pdfViewer => pdfViewer.getAllText()\n ));\n\n // After the text resolves, cache the text for a little bit in case\n // multiple consumers call it.\n textPromise.then(() => {\n setTimeout(() => {\n if (this.#textPromise === textPromise) {\n this.#textPromise = null;\n }\n }, 5000);\n });\n }\n\n this.#externalServices.reportText({\n text: await this.#textPromise,\n requestId,\n });\n }\n}\n\nexport { PdfTextExtractor };\n","/* Copyright 2025 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 { noContextMenu, stopEvent } from \"pdfjs-lib\";\n\nclass Menu {\n #triggeringButton;\n\n #menu;\n\n #menuItems;\n\n #openMenuAC = null;\n\n #menuAC = new AbortController();\n\n #lastIndex = -1;\n\n #onFocusOutBound = this.#onFocusOut.bind(this);\n\n /**\n * Create a menu for the given button.\n * @param {HTMLElement} menuContainer\n * @param {HTMLElement} triggeringButton\n * @param {Array<HTMLElement>|null} menuItems\n */\n constructor(menuContainer, triggeringButton, menuItems) {\n this.#menu = menuContainer;\n this.#triggeringButton = triggeringButton;\n if (Array.isArray(menuItems)) {\n this.#menuItems = menuItems;\n } else {\n this.#menuItems = [];\n for (const button of this.#menu.querySelectorAll(\"button\")) {\n this.#menuItems.push(button);\n }\n }\n this.#setUpMenu();\n }\n\n /**\n * Close the menu.\n */\n #closeMenu() {\n if (!this.#openMenuAC) {\n return;\n }\n const menu = this.#menu;\n this.#triggeringButton.ariaExpanded = \"false\";\n this.#openMenuAC.abort();\n this.#openMenuAC = null;\n if (menu.contains(document.activeElement)) {\n // If the menu is closed while focused, focus the actions button.\n setTimeout(() => {\n if (!menu.contains(document.activeElement)) {\n this.#triggeringButton.focus();\n }\n }, 0);\n }\n this.#lastIndex = -1;\n }\n\n /**\n * Open the menu.\n */\n #openMenu() {\n if (this.#openMenuAC) {\n return;\n }\n\n const menu = this.#menu;\n this.#triggeringButton.ariaExpanded = \"true\";\n this.#openMenuAC = new AbortController();\n const signal = AbortSignal.any([\n this.#menuAC.signal,\n this.#openMenuAC.signal,\n ]);\n window.addEventListener(\n \"pointerdown\",\n ({ target }) => {\n if (\n !this.#triggeringButton.contains(target) &&\n !menu.contains(target)\n ) {\n this.#closeMenu();\n }\n },\n { signal }\n );\n const closeMenu = this.#closeMenu.bind(this);\n window.addEventListener(\"blur\", closeMenu, { signal });\n menu.addEventListener(\"focusout\", this.#onFocusOutBound, { signal });\n }\n\n #onFocusOut({ relatedTarget }) {\n if (\n !this.#triggeringButton.contains(relatedTarget) &&\n !this.#menu.contains(relatedTarget)\n ) {\n this.#closeMenu();\n }\n }\n\n /**\n * Set up the menu.\n */\n #setUpMenu() {\n this.#triggeringButton.addEventListener(\"click\", e => {\n if (this.#openMenuAC) {\n this.#closeMenu();\n return;\n }\n\n this.#openMenu();\n });\n this.#triggeringButton.addEventListener(\"focusout\", this.#onFocusOutBound);\n\n const { signal } = this.#menuAC;\n\n this.#menu.addEventListener(\n \"keydown\",\n e => {\n switch (e.key) {\n case \"Escape\":\n this.#closeMenu();\n stopEvent(e);\n break;\n case \"ArrowDown\":\n this.#goToNextItem(e.target, true);\n stopEvent(e);\n break;\n case \"ArrowUp\":\n this.#goToNextItem(e.target, false);\n stopEvent(e);\n break;\n case \"Home\":\n this.#menuItems\n .find(\n item => !item.disabled && !item.classList.contains(\"hidden\")\n )\n ?.focus();\n stopEvent(e);\n break;\n case \"End\":\n this.#menuItems\n .findLast(\n item => !item.disabled && !item.classList.contains(\"hidden\")\n )\n ?.focus();\n stopEvent(e);\n break;\n default:\n const { key } = e;\n if (!/^\\p{L}$/u.test(key)) {\n // It isn't a single letter, so ignore it.\n break;\n }\n const char = key.toLocaleLowerCase();\n this.#goToNextItem(e.target, true, item =>\n item.textContent.trim().toLowerCase().startsWith(char)\n );\n stopEvent(e);\n break;\n }\n },\n { signal, capture: true }\n );\n this.#menu.addEventListener(\"contextmenu\", noContextMenu, { signal });\n this.#menu.addEventListener(\"click\", this.#closeMenu.bind(this), {\n signal,\n capture: true,\n });\n this.#triggeringButton.addEventListener(\n \"keydown\",\n e => {\n switch (e.key) {\n case \" \":\n case \"Enter\":\n case \"ArrowDown\":\n case \"Home\":\n stopEvent(e);\n if (!this.#openMenuAC) {\n this.#openMenu();\n }\n this.#menuItems\n .find(\n item => !item.disabled && !item.classList.contains(\"hidden\")\n )\n ?.focus();\n break;\n case \"ArrowUp\":\n case \"End\":\n stopEvent(e);\n if (!this.#openMenuAC) {\n this.#openMenu();\n }\n this.#menuItems\n .findLast(\n item => !item.disabled && !item.classList.contains(\"hidden\")\n )\n ?.focus();\n break;\n case \"Escape\":\n this.#closeMenu();\n stopEvent(e);\n break;\n }\n },\n { signal }\n );\n }\n\n /**\n * Go to the next/previous menu item.\n * @param {HTMLElement} element\n * @param {boolean} forward\n */\n #goToNextItem(element, forward, check = () => true) {\n const index =\n this.#lastIndex === -1\n ? this.#menuItems.indexOf(element)\n : this.#lastIndex;\n const len = this.#menuItems.length;\n const increment = forward ? 1 : len - 1;\n for (\n let i = (index + increment) % len;\n i !== index;\n i = (i + increment) % len\n ) {\n const menuItem = this.#menuItems[i];\n if (\n !menuItem.disabled &&\n !menuItem.classList.contains(\"hidden\") &&\n check(menuItem)\n ) {\n menuItem.focus();\n this.#lastIndex = i;\n break;\n }\n }\n }\n\n destroy() {\n this.#closeMenu();\n this.#menuAC?.abort();\n this.#menuAC = null;\n }\n}\n\nexport { Menu };\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/page_viewport\").PageViewport} PageViewport */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n\nimport { OutputScale, RenderingCancelledException } from \"pdfjs-lib\";\nimport { RenderableView, RenderingStates } from \"./renderable_view.js\";\nimport { AppOptions } from \"./app_options.js\";\n\nconst DRAW_UPSCALE_FACTOR = 2; // See comment in `PDFThumbnailView.draw` below.\nconst MAX_NUM_SCALING_STEPS = 3;\nconst THUMBNAIL_WIDTH = 126; // 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 {PDFLinkService} linkService - The navigation/linking service.\n * @property {PDFRenderingQueue} renderingQueue - The rendering queue object.\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 * 8192 (32 mega-pixels).\n * @property {number} [maxCanvasDim] - The maximum supported canvas dimension,\n * in either width or height. Use `-1` for no limit.\n * The default value is 32767.\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\nfunction getTempCanvas(width, height) {\n const canvas = new OffscreenCanvas(width, height);\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 = canvas.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 [canvas, ctx];\n}\n\nclass PDFThumbnailView extends RenderableView {\n #renderingState = RenderingStates.INITIAL;\n\n /**\n * @param {PDFThumbnailViewOptions} options\n */\n constructor({\n container,\n eventBus,\n id,\n defaultViewport,\n optionalContentConfigPromise,\n linkService,\n renderingQueue,\n maxCanvasPixels,\n maxCanvasDim,\n pageColors,\n enableSplitMerge = false,\n }) {\n super();\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.maxCanvasPixels = maxCanvasPixels ?? AppOptions.get(\"maxCanvasPixels\");\n this.maxCanvasDim = maxCanvasDim || AppOptions.get(\"maxCanvasDim\");\n this.pageColors = pageColors || null;\n\n this.eventBus = eventBus;\n this.linkService = linkService;\n this.renderingQueue = renderingQueue;\n\n this.placeholder = null;\n\n const thumbnailContainer = (this.div = document.createElement(\"div\"));\n thumbnailContainer.className = \"thumbnail\";\n thumbnailContainer.setAttribute(\"page-number\", id);\n\n const imageContainer = (this.imageContainer =\n document.createElement(\"div\"));\n thumbnailContainer.append(imageContainer);\n imageContainer.classList.add(\n \"thumbnailImageContainer\",\n \"missingThumbnailImage\"\n );\n imageContainer.role = \"button\";\n imageContainer.tabIndex = -1;\n imageContainer.draggable = false;\n imageContainer.setAttribute(\"page-number\", id);\n imageContainer.setAttribute(\"data-l10n-id\", \"pdfjs-thumb-page-title1\");\n imageContainer.setAttribute(\"data-l10n-args\", this.#getPageL10nArgs(true));\n\n const image = (this.image = document.createElement(\"img\"));\n imageContainer.append(image);\n\n if (enableSplitMerge) {\n const checkbox = (this.checkbox = document.createElement(\"input\"));\n checkbox.type = \"checkbox\";\n checkbox.tabIndex = -1;\n checkbox.setAttribute(\"data-l10n-id\", \"pdfjs-thumb-page-checkbox1\");\n checkbox.setAttribute(\"data-l10n-args\", this.#getPageL10nArgs());\n thumbnailContainer.append(checkbox);\n this.pasteButton = null;\n }\n\n this.#updateDims();\n\n container.append(thumbnailContainer);\n }\n\n clone(container, id) {\n const thumbnailView = new PDFThumbnailView({\n container,\n id,\n eventBus: this.eventBus,\n defaultViewport: this.viewport,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n linkService: this.linkService,\n renderingQueue: this.renderingQueue,\n maxCanvasPixels: this.maxCanvasPixels,\n maxCanvasDim: this.maxCanvasDim,\n pageColors: this.pageColors,\n enableSplitMerge: !!this.checkbox,\n });\n const { imageContainer } = this;\n if (!imageContainer.classList.contains(\"missingThumbnailImage\")) {\n thumbnailView.image.replaceWith(this.image.cloneNode(true));\n thumbnailView.imageContainer.classList.remove(\"missingThumbnailImage\");\n }\n return thumbnailView;\n }\n\n addPasteButton(pasteCallback) {\n if (this.pasteButton) {\n return;\n }\n const pasteButton = (this.pasteButton = document.createElement(\"button\"));\n pasteButton.classList.add(\"thumbnailPasteButton\", \"viewsManagerButton\");\n pasteButton.tabIndex = 0;\n pasteButton.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-views-manager-paste-button-after\"\n );\n pasteButton.setAttribute(\"data-l10n-args\", this.#getPageL10nArgs());\n const span = document.createElement(\"span\");\n span.setAttribute(\"data-l10n-id\", \"pdfjs-views-manager-paste-button-label\");\n pasteButton.append(span);\n pasteButton.addEventListener(\"click\", () => {\n pasteCallback(this.id);\n });\n if (this.id === 1) {\n const prevPasteButton = (this.prevPasteButton =\n pasteButton.cloneNode(true));\n prevPasteButton.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-views-manager-paste-button-before\"\n );\n prevPasteButton.addEventListener(\"click\", () => {\n pasteCallback(0);\n });\n this.imageContainer.before(prevPasteButton);\n }\n\n this.imageContainer.after(pasteButton);\n }\n\n removePasteButton() {\n this.pasteButton?.remove();\n this.pasteButton = null;\n this.prevPasteButton?.remove();\n this.prevPasteButton = null;\n }\n\n toggleSelected(isSelected) {\n if (this.checkbox) {\n this.checkbox.checked = isSelected;\n }\n }\n\n updateId(newId) {\n this.id = newId;\n this.renderingId = `thumbnail${newId}`;\n this.div.setAttribute(\"page-number\", newId);\n this.imageContainer.setAttribute(\"page-number\", newId);\n // TODO: do we set the page label ?\n this.setPageLabel(this.pageLabel);\n }\n\n #updateDims() {\n const { width, height } = this.viewport;\n const ratio = width / height;\n\n const canvasWidth = (this.canvasWidth = THUMBNAIL_WIDTH);\n const canvasHeight = (this.canvasHeight = (canvasWidth / ratio) | 0);\n this.scale = canvasWidth / width;\n\n this.imageContainer.style.height = `${canvasHeight}px`;\n }\n\n get renderingState() {\n return this.#renderingState;\n }\n\n set renderingState(state) {\n this.#renderingState = state;\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 this.#updateDims();\n\n const { image, imageContainer } = this;\n const url = image.src;\n if (url) {\n URL.revokeObjectURL(url);\n image.src = \"\";\n imageContainer.removeAttribute(\"data-l10n-id\");\n imageContainer.removeAttribute(\"data-l10n-args\");\n imageContainer.classList.add(\"missingThumbnailImage\");\n }\n }\n\n destroy() {\n this.reset();\n this.toggleCurrent(false);\n this.div.remove();\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 toggleCurrent(isCurrent) {\n const { imageContainer } = this;\n if (isCurrent) {\n imageContainer.ariaCurrent = \"page\";\n imageContainer.tabIndex = 0;\n if (this.checkbox) {\n this.checkbox.tabIndex = 0;\n }\n } else {\n imageContainer.ariaCurrent = false;\n imageContainer.tabIndex = -1;\n if (this.checkbox) {\n this.checkbox.tabIndex = -1;\n }\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 if (this.renderTask) {\n this.renderTask.cancel();\n this.renderTask = null;\n }\n this.resume = null;\n }\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 outputScale = new OutputScale();\n const width = upscaleFactor * this.canvasWidth,\n height = upscaleFactor * this.canvasHeight;\n\n outputScale.limitCanvas(\n width,\n height,\n this.maxCanvasPixels,\n this.maxCanvasDim\n );\n // Because of: https://bugzilla.mozilla.org/show_bug.cgi?id=2003060\n // we need use a HTMLCanvasElement here.\n const canvas = document.createElement(\"canvas\");\n canvas.width = (width * outputScale.sx) | 0;\n canvas.height = (height * outputScale.sy) | 0;\n\n const transform = outputScale.scaled\n ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0]\n : null;\n\n return { canvas, transform };\n }\n\n async #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 const { imageContainer, image } = this;\n const { promise, resolve } = Promise.withResolvers();\n reducedCanvas.toBlob(resolve);\n const blob = await promise;\n image.src = URL.createObjectURL(blob);\n image.setAttribute(\"data-l10n-id\", \"pdfjs-thumb-page-canvas\");\n image.setAttribute(\"data-l10n-args\", this.#getPageL10nArgs());\n imageContainer.classList.remove(\"missingThumbnailImage\");\n }\n\n async draw() {\n if (this.renderingState !== RenderingStates.INITIAL) {\n console.error(\"Must be in new state before drawing\");\n return;\n }\n const { pageColors, 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 { canvas, transform } = 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 canvas,\n transform,\n viewport: drawViewport,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n pageColors,\n };\n const renderTask = (this.renderTask = pdfPage.render(renderContext));\n renderTask.onContinue = renderContinueCallback;\n\n let error = null;\n try {\n await renderTask.promise;\n } catch (e) {\n if (e instanceof RenderingCancelledException) {\n return;\n }\n error = e;\n } finally {\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 this.renderingState = RenderingStates.FINISHED;\n\n await this.#convertCanvasToImage(canvas);\n\n this.eventBus.dispatch(\"thumbnailrendered\", {\n source: this,\n pageNumber: this.id,\n pdfPage,\n });\n\n if (error) {\n throw error;\n }\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 #getReducedImageDims(canvas) {\n const width = canvas.width << MAX_NUM_SCALING_STEPS,\n height = canvas.height << MAX_NUM_SCALING_STEPS;\n\n const outputScale = new OutputScale();\n // Here we're not actually \"rendering\" to the canvas and the `OutputScale`\n // is thus only used to limit the canvas size, hence the identity scale.\n outputScale.sx = outputScale.sy = 1;\n\n outputScale.limitCanvas(\n width,\n height,\n this.maxCanvasPixels,\n this.maxCanvasDim\n );\n return [(width * outputScale.sx) | 0, (height * outputScale.sy) | 0];\n }\n\n #reduceImage(img) {\n const { canvas } = this.#getPageDrawContext(1);\n const ctx = canvas.getContext(\"2d\", {\n alpha: false,\n willReadFrequently: false,\n });\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, reducedHeight] = this.#getReducedImageDims(canvas);\n const [reducedImage, reducedImageCtx] = getTempCanvas(\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 #getPageL10nArgs(hasTotal = false) {\n return JSON.stringify({\n page: this.pageLabel ?? this.id,\n total: hasTotal ? this.linkService.pagesCount : undefined,\n });\n }\n\n /**\n * @param {string|null} label\n */\n setPageLabel(label) {\n this.pageLabel = typeof label === \"string\" ? label : null;\n this.imageContainer.setAttribute(\n \"data-l10n-args\",\n this.#getPageL10nArgs(true)\n );\n this.image.setAttribute(\"data-l10n-args\", this.#getPageL10nArgs());\n this.checkbox?.setAttribute(\"data-l10n-args\", this.#getPageL10nArgs());\n }\n}\n\nexport { PDFThumbnailView };\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// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n/** @typedef {import(\"./pdf_link_service.js\").PDFLinkService} PDFLinkService */\n\nimport {\n binarySearchFirstItem,\n getVisibleElements,\n isValidRotation,\n watchScroll,\n} from \"./ui_utils.js\";\nimport { MathClamp, noContextMenu, stopEvent } from \"pdfjs-lib\";\nimport { internalOpt } from \"./internal_evt.js\";\nimport { Menu } from \"./menu.js\";\nimport { PDFThumbnailView } from \"./pdf_thumbnail_view.js\";\nimport { RenderingStates } from \"./renderable_view.js\";\n\nconst SCROLL_OPTIONS = {\n behavior: \"instant\",\n block: \"nearest\",\n inline: \"nearest\",\n container: \"nearest\",\n};\n\n// This value is based on the one used in Firefox.\n// See\n// https://searchfox.org/firefox-main/rev/04cf27582307a9c351e991c740828d54cf786b76/dom/events/EventStateManager.cpp#2675-2698\n// This threshold is used to distinguish between a click and a drag.\nconst DRAG_THRESHOLD_IN_PIXELS = 5;\nconst PIXELS_TO_SCROLL_WHEN_DRAGGING = 20;\nconst SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT = 15;\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 {PDFLinkService} linkService - The navigation/linking service.\n * @property {PDFRenderingQueue} renderingQueue - The rendering queue object.\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 * 8192 (32 mega-pixels).\n * @property {number} [maxCanvasDim] - The maximum supported canvas dimension,\n * in either width or height. Use `-1` for no limit.\n * The default value is 32767.\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 {AbortSignal} [abortSignal] - The AbortSignal for the window\n * events.\n * @property {boolean} [enableNewBadge] - Enables the \"new\" badge for the split\n * and merge features.\n * @property {boolean} [enableMerge] - Enables the merge feature.\n * The default value is `false`.\n * @property {boolean} [enableSplitMerge] - Enables split and merge features.\n * The default value is `false`.\n * @property {Object} [statusBar] - The status bar elements to manage the status\n * label and action when editing pages.\n * @property {Object} [undoBar] - The undo bar elements to manage the undo\n * action.\n * @property {Object} [manageMenu] - The menu elements to manage saving edited\n * PDF.\n * @property {Object} [waitingBar] - The waiting bar elements shown during\n * long-running operations.\n * @property {Object} [addFileComponent] - The file picker and button used to\n * add one or more PDF files to merge with the current one.\n */\n\n/**\n * Viewer control to display thumbnails for pages in a PDF document.\n */\nclass PDFThumbnailViewer {\n static #draggingScaleFactor = 0;\n\n #enableMerge = false;\n\n #enableSplitMerge = false;\n\n #dragAC = null;\n\n #abortSignal = undefined;\n\n #externalDragActive = false;\n\n #draggedContainer = null;\n\n #thumbnailsPositions = null;\n\n #lastDraggedOverIndex = NaN;\n\n #selectedPages = null;\n\n #draggedImageX = 0;\n\n #draggedImageY = 0;\n\n #draggedImageWidth = 0;\n\n #draggedImageHeight = 0;\n\n #draggedImageOffsetX = 0;\n\n #draggedImageOffsetY = 0;\n\n #dragMarker = null;\n\n #pageNumberToRemove = NaN;\n\n #currentScrollBottom = 0;\n\n #currentScrollTop = 0;\n\n #pagesMapper = null;\n\n #manageExportButton = null;\n\n #manageDeleteButton = null;\n\n #manageCopyButton = null;\n\n #manageCutButton = null;\n\n #copiedThumbnails = null;\n\n #savedThumbnails = null;\n\n #deletedPageNumbers = null;\n\n #copiedPageNumbers = null;\n\n #boundPastePages = this.#pastePages.bind(this);\n\n #isCut = false;\n\n #isOneColumnView = false;\n\n #scrollableContainerWidth = 0;\n\n #scrollableContainerHeight = 0;\n\n #statusLabel = null;\n\n #statusBar = null;\n\n #deselectButton = null;\n\n #undoBar = null;\n\n #undoLabel = null;\n\n #undoButton = null;\n\n #undoCloseButton = null;\n\n #waitingBar = null;\n\n #isInPasteMode = false;\n\n #hasUndoBarVisible = false;\n\n #newBadge = null;\n\n /**\n * @param {PDFThumbnailViewerOptions} options\n */\n constructor({\n container,\n eventBus,\n linkService,\n renderingQueue,\n maxCanvasPixels,\n maxCanvasDim,\n pageColors,\n abortSignal,\n enableMerge,\n enableSplitMerge,\n enableNewBadge,\n statusBar,\n undoBar,\n waitingBar,\n manageMenu,\n addFileComponent,\n }) {\n this.scrollableContainer = container.parentElement;\n this.container = container;\n this.eventBus = eventBus;\n this.linkService = linkService;\n this.renderingQueue = renderingQueue;\n this.maxCanvasPixels = maxCanvasPixels;\n this.maxCanvasDim = maxCanvasDim;\n this.pageColors = pageColors || null;\n this.#abortSignal = abortSignal;\n this.#enableMerge = enableMerge || false;\n this.#enableSplitMerge = enableSplitMerge || false;\n this.#statusLabel = statusBar?.viewsManagerStatusActionLabel || null;\n this.#deselectButton =\n statusBar?.viewsManagerStatusActionDeselectButton || null;\n this.#statusBar = statusBar?.viewsManagerStatusAction || null;\n this.#undoBar = undoBar?.viewsManagerStatusUndo || null;\n this.#undoLabel = undoBar?.viewsManagerStatusUndoLabel || null;\n this.#undoButton = undoBar?.viewsManagerStatusUndoButton || null;\n this.#undoCloseButton = undoBar?.viewsManagerStatusUndoCloseButton || null;\n this.#waitingBar = waitingBar || null;\n\n if (this.#enableSplitMerge && manageMenu) {\n const {\n button: menuButton,\n menu,\n copy,\n cut,\n delete: del,\n exportSelected,\n } = manageMenu;\n\n if (enableNewBadge) {\n const newSpan = document.createElement(\"span\");\n newSpan.setAttribute(\"data-l10n-id\", \"pdfjs-new-badge-content\");\n newSpan.classList.add(\"newBadge\");\n menuButton.parentElement.before(newSpan);\n this.#newBadge = newSpan;\n }\n\n eventBus.on(\n \"pagesloaded\",\n () => {\n menuButton.disabled = false;\n },\n { once: true, ...internalOpt }\n );\n\n this._manageMenu = new Menu(menu, menuButton, [\n copy,\n cut,\n del,\n exportSelected,\n ]);\n this.#manageExportButton = exportSelected;\n exportSelected.addEventListener(\n \"click\",\n this.#saveExtractedPages.bind(this)\n );\n this.#manageDeleteButton = del;\n del.addEventListener(\"click\", this.#deletePages.bind(this, \"delete\"));\n this.#manageCopyButton = copy;\n copy.addEventListener(\"click\", this.#copyPages.bind(this));\n this.#manageCutButton = cut;\n cut.addEventListener(\"click\", this.#cutPages.bind(this));\n\n this.#toggleMenuEntries(false);\n menuButton.disabled = true;\n\n eventBus.on(\n \"editingaction\",\n ({ name }) => {\n switch (name) {\n case \"copyPage\":\n this.#copyPages();\n break;\n case \"cutPage\":\n this.#cutPages();\n break;\n case \"deletePage\":\n this.#deletePages(\"delete\");\n break;\n case \"savePage\":\n this.#saveExtractedPages();\n break;\n }\n },\n internalOpt\n );\n\n this.container.addEventListener(\n \"contextmenu\",\n e => {\n eventBus.dispatch(\"editingstateschanged\", {\n source: this,\n details: {\n thumbnailId:\n parseInt(\n e.target\n .closest(\".thumbnailImageContainer\")\n ?.parentElement.getAttribute(\"page-number\"),\n 10\n ) ?? -1,\n hasSelectedPages: !!this.#selectedPages?.size,\n canDeletePages: this.#canDelete(),\n },\n });\n },\n {\n signal: abortSignal,\n passive: true,\n }\n );\n\n this.#undoButton?.addEventListener(\"click\", this.#undo.bind(this));\n this.#undoCloseButton?.addEventListener(\n \"click\",\n this.#dismissUndo.bind(this, /* mustUpdateStatus = */ true)\n );\n this.#deselectButton?.addEventListener(\"click\", () => {\n this.#clearSelection();\n this.#toggleMenuEntries(false);\n this.#updateStatus(\"select\");\n });\n this.#deselectButton.classList.toggle(\"hidden\", true);\n\n if (this.#enableMerge && addFileComponent) {\n const { picker, button } = addFileComponent;\n picker.addEventListener(\"change\", () => {\n const files = Array.from(picker.files ?? []);\n if (files.length) {\n this.#mergeFiles(files, this._currentPageNumber - 1);\n }\n });\n button.addEventListener(\"click\", () => {\n picker.click();\n });\n this.#waitingBar.closeButton?.addEventListener(\"click\", () => {\n this.#toggleBar(\"status\");\n picker.value = \"\";\n });\n }\n } else {\n manageMenu.button.hidden = true;\n }\n\n this.scroll = watchScroll(\n this.scrollableContainer,\n this.#scrollUpdated.bind(this),\n abortSignal\n );\n this.#resetView();\n this.#addEventListeners();\n }\n\n #scrollUpdated() {\n this.renderingQueue.renderHighestPriority();\n }\n\n async #mergeFiles(files, insertAfter) {\n this.#toggleBar(\"waiting\", \"pdfjs-views-manager-waiting-for-file\");\n const entries = [];\n for (const file of files) {\n const isImage = file.type?.startsWith(\"image/\");\n if (!isImage && file.type !== \"application/pdf\") {\n const magic = await file.slice(0, 5).text();\n if (magic !== \"%PDF-\") {\n continue;\n }\n }\n if (isImage) {\n let bitmap;\n try {\n bitmap = await PDFThumbnailViewer.#fileToImageBitmap(file);\n } catch {\n continue;\n }\n entries.push({ image: bitmap, insertAfter });\n } else {\n entries.push({ document: await file.bytes(), insertAfter });\n }\n }\n if (entries.length === 0) {\n this.#toggleBar(\"status\");\n return;\n }\n const pagesCount = this.#pagesMapper.pagesNumber;\n const data = this.hasStructuralChanges()\n ? this.getStructuralChanges()\n : [{ document: null }];\n data.push(...entries);\n this.eventBus.on(\n \"pagesloaded\",\n () => {\n // Clear any pre-merge selection: thumbnails are rebuilt fresh\n // (all unchecked), so the old set would cause a label/visual\n // mismatch.\n this.#selectedPages = null;\n this.#updateMenuEntries();\n this.#toggleBar(\"status\");\n const newPagesCount = this.#pagesMapper.pagesNumber;\n const insertedPagesCount = newPagesCount - pagesCount;\n for (\n let i = insertAfter + 1, ii = insertAfter + 1 + insertedPagesCount;\n i < ii;\n i++\n ) {\n this._thumbnails[i].checkbox.checked = true;\n this.#selectPage(i + 1, true);\n }\n if (insertedPagesCount) {\n this.#updateCurrentPage(insertAfter + 2, /* force = */ true);\n }\n },\n { once: true, ...internalOpt }\n );\n this.#reportTelemetry({ action: \"merge\" });\n this.eventBus.dispatch(\"saveandload\", {\n source: this,\n data,\n });\n }\n\n getThumbnail(index) {\n return this._thumbnails[index];\n }\n\n #getVisibleThumbs() {\n return getVisibleElements({\n scrollEl: this.scrollableContainer,\n views: this._thumbnails,\n });\n }\n\n #resetCurrentThumbnail(newPageNumber) {\n if (!this.pdfDocument) {\n return;\n }\n const thumbnailView = this._thumbnails[this._currentPageNumber - 1];\n thumbnailView?.toggleCurrent(/* isCurrent = */ false);\n this._currentPageNumber = newPageNumber;\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 if (pageNumber !== this._currentPageNumber) {\n this.#resetCurrentThumbnail(pageNumber);\n thumbnailView.toggleCurrent(/* isCurrent = */ true);\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 thumbnailView.div.scrollIntoView(SCROLL_OPTIONS);\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 }\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 this.#pagesMapper = pdfDocument.pagesMapper;\n const firstPagePromise = pdfDocument.getPage(1);\n const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({\n intent: \"display\",\n });\n\n firstPagePromise\n .then(firstPdfPage => {\n const pagesCount = pdfDocument.numPages;\n const viewport = firstPdfPage.getViewport({ scale: 1 });\n const fragment = document.createDocumentFragment();\n\n for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n const thumbnail = new PDFThumbnailView({\n container: fragment,\n eventBus: this.eventBus,\n id: pageNum,\n defaultViewport: viewport.clone(),\n optionalContentConfigPromise,\n linkService: this.linkService,\n renderingQueue: this.renderingQueue,\n maxCanvasPixels: this.maxCanvasPixels,\n maxCanvasDim: this.maxCanvasDim,\n pageColors: this.pageColors,\n enableSplitMerge: this.#enableSplitMerge,\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.toggleCurrent(/* isCurrent = */ true);\n this.container.append(fragment);\n this.eventBus.dispatch(\"thumbnailsloaded\", {\n source: this,\n });\n })\n .catch(reason => {\n console.error(\"Unable to initialize thumbnail viewer\", reason);\n });\n }\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 /* preRenderExtra */ false,\n /* ignoreDetailViews */ true\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 hasStructuralChanges() {\n return this.#pagesMapper?.hasBeenAltered() || false;\n }\n\n getStructuralChanges() {\n return this.#pagesMapper?.getPageMappingForSaving() || null;\n }\n\n static #getScaleFactor(image) {\n return (PDFThumbnailViewer.#draggingScaleFactor ||= parseFloat(\n getComputedStyle(image).getPropertyValue(\"--thumbnail-dragging-scale\")\n ));\n }\n\n static #fitImageDimensions(width, height, { minSide = 0, maxSide }) {\n const longest = Math.max(width, height);\n let scale = 1;\n if (minSide > 0 && longest < minSide) {\n scale = minSide / longest;\n } else if (longest > maxSide) {\n scale = maxSide / longest;\n }\n return scale === 1\n ? { width, height }\n : {\n width: Math.max(1, Math.round(width * scale)),\n height: Math.max(1, Math.round(height * scale)),\n };\n }\n\n static async #fileToImageBitmap(file) {\n // Keep image pages large enough to look good when fitted to a PDF page, but\n // bounded so saving does not allocate worker-side buffers at camera-photo\n // dimensions.\n const MIN_RASTER_SIDE = 1024;\n const MAX_RASTER_SIDE = 4096;\n\n if (file.type !== \"image/svg+xml\") {\n const bitmap = await createImageBitmap(file);\n const { width, height } = PDFThumbnailViewer.#fitImageDimensions(\n bitmap.width,\n bitmap.height,\n { maxSide: MAX_RASTER_SIDE }\n );\n if (width === bitmap.width && height === bitmap.height) {\n return bitmap;\n }\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n ctx.drawImage(bitmap, 0, 0, width, height);\n bitmap.close();\n return canvas.transferToImageBitmap();\n }\n // createImageBitmap doesn't work with SVG (mirroring the workaround in\n // src/display/editor/tools.js ImageManager): load the file via an Image\n // element and rasterize it through an OffscreenCanvas. The target raster\n // size uses the SVG's intrinsic dimensions, clamped so the longest side\n // falls in [1024, 4096]: large enough to avoid pixelation when fitted to\n // a page, but capped to prevent a runaway SVG (e.g. a huge viewBox) from\n // allocating a multi-gigabyte bitmap.\n const url = URL.createObjectURL(file);\n try {\n const image = new Image();\n image.src = url;\n await image.decode();\n const { width, height } = PDFThumbnailViewer.#fitImageDimensions(\n image.naturalWidth || MIN_RASTER_SIDE,\n image.naturalHeight || MIN_RASTER_SIDE,\n { minSide: MIN_RASTER_SIDE, maxSide: MAX_RASTER_SIDE }\n );\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n ctx.drawImage(image, 0, 0, width, height);\n return canvas.transferToImageBitmap();\n } finally {\n URL.revokeObjectURL(url);\n }\n }\n\n #updateThumbnails(currentPageNumber) {\n this.#resetCurrentThumbnail(0);\n let newCurrentPageNumber = 0;\n const pagesMapper = this.#pagesMapper;\n const prevThumbnails = (this.#savedThumbnails = this._thumbnails);\n const newThumbnails = (this._thumbnails = []);\n const fragment = document.createDocumentFragment();\n const isCut = this.#isCut;\n for (let i = 1, ii = pagesMapper.pagesNumber; i <= ii; i++) {\n const prevPageNumber = pagesMapper.getPrevPageNumber(i);\n if (prevPageNumber < 0) {\n let thumbnail = this.#copiedThumbnails.get(-prevPageNumber);\n thumbnail.checkbox.checked = false;\n if (isCut) {\n thumbnail.updateId(i);\n fragment.append(thumbnail.div);\n } else {\n thumbnail = thumbnail.clone(fragment, i);\n }\n newThumbnails.push(thumbnail);\n continue;\n }\n if (prevPageNumber === currentPageNumber) {\n newCurrentPageNumber = i;\n }\n const newThumbnail = prevThumbnails[prevPageNumber - 1];\n newThumbnails.push(newThumbnail);\n newThumbnail.updateId(i);\n newThumbnail.checkbox.checked = false;\n fragment.append(newThumbnail.div);\n }\n this.container.replaceChildren(fragment);\n return newCurrentPageNumber;\n }\n\n #onStartDragging(draggedThumbnail) {\n this.#currentScrollTop = this.scrollableContainer.scrollTop;\n this.#currentScrollBottom =\n this.#currentScrollTop + this.scrollableContainer.clientHeight;\n this.#dragAC = new AbortController();\n this.container.classList.add(\"isDragging\");\n this.#newBadge?.classList.add(\"hidden\");\n const startPageNumber = parseInt(\n draggedThumbnail.getAttribute(\"page-number\"),\n 10\n );\n this.#lastDraggedOverIndex = startPageNumber - 1;\n if (!this.#selectedPages?.has(startPageNumber)) {\n this.#pageNumberToRemove = startPageNumber;\n this.#selectPage(startPageNumber, true);\n }\n\n for (const selected of this.#selectedPages) {\n const thumbnail = this._thumbnails[selected - 1];\n const placeholder = (thumbnail.placeholder =\n document.createElement(\"div\"));\n placeholder.classList.add(\"thumbnailImageContainer\", \"placeholder\");\n const { div, imageContainer } = thumbnail;\n div.classList.add(\"isDragging\");\n placeholder.style.height = getComputedStyle(imageContainer).height;\n imageContainer.after(placeholder);\n if (selected !== startPageNumber) {\n imageContainer.classList.add(\"hidden\");\n continue;\n }\n if (this.#selectedPages.size === 1) {\n imageContainer.classList.add(\"draggingThumbnail\");\n this.#draggedContainer = imageContainer;\n continue;\n }\n // For multiple selected thumbnails, only the one being dragged is shown\n // (with the dragging style), while the others are hidden.\n const draggedContainer = (this.#draggedContainer =\n document.createElement(\"div\"));\n draggedContainer.classList.add(\n \"draggingThumbnail\",\n \"thumbnailImageContainer\",\n \"multiple\"\n );\n draggedContainer.style.height = getComputedStyle(imageContainer).height;\n imageContainer.replaceWith(draggedContainer);\n imageContainer.classList.remove(\"thumbnailImageContainer\");\n draggedContainer.append(imageContainer);\n draggedContainer.setAttribute(\n \"data-multiple-count\",\n this.#selectedPages.size\n );\n }\n }\n\n #onStopDragging(isDropping = false) {\n const draggedContainer = this.#draggedContainer;\n this.#draggedContainer = null;\n const lastDraggedOverIndex = this.#lastDraggedOverIndex;\n this.#lastDraggedOverIndex = NaN;\n this.#dragMarker?.remove();\n this.#dragMarker = null;\n this.#dragAC.abort();\n this.#dragAC = null;\n this.#newBadge?.classList.remove(\"hidden\");\n\n this.container.classList.remove(\"isDragging\");\n for (const selected of this.#selectedPages) {\n const thumbnail = this._thumbnails[selected - 1];\n const { div, placeholder, imageContainer } = thumbnail;\n placeholder.remove();\n imageContainer.classList.remove(\"draggingThumbnail\", \"hidden\");\n div.classList.remove(\"isDragging\");\n }\n\n if (draggedContainer.classList.contains(\"multiple\")) {\n // Restore the dragged image to its thumbnail.\n const originalImageContainer = draggedContainer.firstElementChild;\n draggedContainer.replaceWith(originalImageContainer);\n originalImageContainer.classList.add(\"thumbnailImageContainer\");\n } else {\n draggedContainer.style.translate = \"\";\n }\n\n const selectedPages = this.#selectedPages;\n if (\n !isNaN(lastDraggedOverIndex) &&\n isDropping &&\n !(\n selectedPages.size === 1 &&\n (selectedPages.has(lastDraggedOverIndex + 1) ||\n selectedPages.has(lastDraggedOverIndex + 2))\n )\n ) {\n this._thumbnails[this._currentPageNumber - 1]?.toggleCurrent(\n /* isCurrent = */ false\n );\n this._currentPageNumber = -1;\n\n const newIndex = lastDraggedOverIndex + 1;\n const pagesToMove = Array.from(selectedPages).sort((a, b) => a - b);\n const pagesMapper = this.#pagesMapper;\n const currentPageNumber = isNaN(this.#pageNumberToRemove)\n ? pagesToMove[0]\n : this.#pageNumberToRemove;\n\n pagesMapper.movePages(selectedPages, pagesToMove, newIndex);\n\n this.#updateCurrentPage(this.#updateThumbnails(currentPageNumber));\n this.#thumbnailsPositions = null;\n\n selectedPages.clear();\n this.#pageNumberToRemove = NaN;\n this.#toggleMenuEntries(false);\n this.#updateStatus(\"select\");\n\n this.#reportTelemetry({ action: \"move\" });\n this.eventBus.dispatch(\"pagesedited\", {\n source: this,\n pagesMapper,\n type: \"move\",\n });\n }\n\n if (!isNaN(this.#pageNumberToRemove)) {\n this.#selectPage(this.#pageNumberToRemove, false);\n this.#pageNumberToRemove = NaN;\n }\n }\n\n #clearSelection() {\n for (const pageNumber of this.#selectedPages) {\n this._thumbnails[pageNumber - 1].toggleSelected(false);\n }\n this.#selectedPages.clear();\n }\n\n #updateCurrentPage(currentPageNumber, forceFocus = false) {\n setTimeout(() => {\n this.forceRendering();\n const newPageNumber = currentPageNumber || 1;\n this.linkService.goToPage(newPageNumber);\n const thumbnailView = this._thumbnails[newPageNumber - 1];\n if (forceFocus || !this.container.contains(document.activeElement)) {\n thumbnailView.imageContainer.focus();\n }\n }, 0);\n }\n\n #undo() {\n this.#clearSelection();\n this.#toggleMenuEntries(false);\n this.#updateStatus(\"select\");\n if (this.#copiedThumbnails) {\n // We undo a copy or a cut.\n this.#copiedThumbnails = null;\n this.#pagesMapper.cancelCopy();\n this.#togglePasteMode(false);\n\n this.eventBus.dispatch(\"pagesedited\", {\n source: this,\n pagesMapper: this.#pagesMapper,\n type: \"cancelCopy\",\n });\n }\n\n this.#isCut = false;\n if (this.#savedThumbnails) {\n // The thumbnail objects are shared between the post-operation list and\n // the saved (pre-operation) list. The object marked current in the\n // post-operation list may reappear at a different index in the restored\n // list.\n const currentThumb = this._thumbnails[this._currentPageNumber - 1];\n currentThumb?.toggleCurrent(false);\n\n const fragment = document.createDocumentFragment();\n for (let i = 1, ii = this.#savedThumbnails.length; i <= ii; i++) {\n const thumbnail = this.#savedThumbnails[i - 1];\n thumbnail.updateId(i);\n thumbnail.checkbox.checked = false;\n fragment.append(thumbnail.div);\n }\n this.container.replaceChildren(fragment);\n this._thumbnails = this.#savedThumbnails;\n this.#savedThumbnails = null;\n\n // Re-establish the current-page indicator at the position the current\n // thumbnail now occupies in the restored list.\n const newIdx = currentThumb ? this._thumbnails.indexOf(currentThumb) : -1;\n this._currentPageNumber = newIdx + 1;\n currentThumb?.toggleCurrent(newIdx !== -1);\n\n this.#pagesMapper.cancelDelete();\n\n this.eventBus.dispatch(\"pagesedited\", {\n source: this,\n pagesMapper: this.#pagesMapper,\n type: \"cancelDelete\",\n });\n }\n }\n\n #dismissUndo(mustUpdateStatus) {\n this.#copiedThumbnails = null;\n if (this.#deletedPageNumbers) {\n if (this.#savedThumbnails) {\n for (const pageNumber of this.#deletedPageNumbers) {\n this.#savedThumbnails[pageNumber - 1].destroy();\n }\n this.#savedThumbnails = null;\n }\n this.#deletedPageNumbers = null;\n }\n this.#isCut = false;\n if (mustUpdateStatus) {\n this.#updateStatus(\"select\");\n }\n this.#togglePasteMode(false);\n this.#pagesMapper.cleanSavedData();\n\n this.eventBus.dispatch(\"pagesedited\", {\n source: this,\n pagesMapper: this.#pagesMapper,\n type: \"cleanSavedData\",\n });\n }\n\n #canDelete() {\n const size = this.#selectedPages?.size || 0;\n return size > 0 && size < this._thumbnails.length;\n }\n\n #toggleBar(type, message, args) {\n this.#statusBar.classList.toggle(\"hidden\", type !== \"status\");\n this.#waitingBar.container.classList.toggle(\"hidden\", type !== \"waiting\");\n this.#undoBar.classList.toggle(\"hidden\", type !== \"undo\");\n this.#hasUndoBarVisible = type === \"undo\";\n\n switch (type) {\n case \"waiting\":\n this.#waitingBar.label.setAttribute(\"data-l10n-id\", message);\n break;\n case \"undo\":\n this.#undoLabel.setAttribute(\"data-l10n-id\", message);\n if (args) {\n this.#undoLabel.setAttribute(\"data-l10n-args\", JSON.stringify(args));\n }\n break;\n case \"status\":\n if (args) {\n this.#statusLabel.setAttribute(\n \"data-l10n-args\",\n JSON.stringify(args)\n );\n } else {\n this.#statusLabel.removeAttribute(\"data-l10n-args\");\n }\n this.#newBadge?.classList.toggle(\"hidden\", !!args);\n this.#deselectButton.classList.toggle(\"hidden\", !args);\n break;\n }\n }\n\n #togglePasteMode(enable) {\n this.#isInPasteMode = enable;\n if (enable) {\n this.container.classList.add(\"pasteMode\");\n for (const thumbnail of this._thumbnails) {\n thumbnail.addPasteButton(this.#boundPastePages);\n }\n } else {\n this.container.classList.remove(\"pasteMode\");\n for (const thumbnail of this._thumbnails) {\n thumbnail.removePasteButton();\n }\n }\n }\n\n #reportTelemetry(data) {\n this.eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"pageOrganization\",\n data,\n },\n });\n }\n\n #saveExtractedPages() {\n this.#reportTelemetry({ action: \"exportSelected\" });\n this.eventBus.dispatch(\"saveextractedpages\", {\n source: this,\n data: this.#pagesMapper.extractPages(this.#selectedPages),\n });\n this.#clearSelection();\n this.#toggleMenuEntries(false);\n this.#updateStatus(\"select\");\n }\n\n #copyPages(clearSelection = true) {\n if (!this.#isCut) {\n // Entering pure copy mode \"commits\" any pending paste/delete state so\n // that clicking the \"Done\" button later only cancels the copy and does\n // not accidentally restore a previous paste or delete.\n this.#savedThumbnails = null;\n this.#reportTelemetry({ action: \"copy\" });\n }\n this.#updateStatus(this.#isCut ? \"cut\" : \"copy\");\n const pageNumbersToCopy = (this.#copiedPageNumbers = Uint32Array.from(\n this.#selectedPages\n ).sort((a, b) => a - b));\n const pagesMapper = this.#pagesMapper;\n pagesMapper.copyPages(pageNumbersToCopy);\n this.#copiedThumbnails = new Map();\n for (const pageNumber of pageNumbersToCopy) {\n this.#copiedThumbnails.set(pageNumber, this._thumbnails[pageNumber - 1]);\n }\n this.eventBus.dispatch(\"pagesedited\", {\n source: this,\n pagesMapper,\n pageNumbers: pageNumbersToCopy,\n type: \"copy\",\n });\n if (clearSelection) {\n this.#clearSelection();\n }\n this.#togglePasteMode(true);\n this.#toggleMenuEntries(false);\n }\n\n #cutPages() {\n if (!this.#canDelete()) {\n return;\n }\n\n this.#reportTelemetry({ action: \"cut\" });\n this.#isCut = true;\n this.#copyPages(false);\n this.#deletePages(/* type = */ \"cut\");\n }\n\n #pastePages(index) {\n this.#reportTelemetry({ action: \"paste\" });\n const pagesMapper = this.#pagesMapper;\n const currentPageNumber = this.#copiedPageNumbers.includes(\n this._currentPageNumber\n )\n ? 0\n : this._currentPageNumber;\n\n pagesMapper.pastePages(index);\n this.#updateThumbnails(currentPageNumber);\n this.#updateCurrentPage(index + 1, /* forceFocus = */ true);\n this.#thumbnailsPositions = null;\n\n this.eventBus.dispatch(\"pagesedited\", {\n source: this,\n pagesMapper,\n hasBeenCut: this.#isCut,\n type: \"paste\",\n });\n\n this.#copiedThumbnails = null;\n this.#isCut = false;\n this.#togglePasteMode(false);\n this.#toggleMenuEntries(false);\n this.#updateStatus(\"select\");\n }\n\n #deletePages(type = \"delete\") {\n if (!this.#canDelete()) {\n return;\n }\n\n const selectedPages = this.#selectedPages;\n if (type === \"delete\") {\n this.#reportTelemetry({ action: \"delete\" });\n this.#updateStatus(\"delete\");\n }\n const pagesMapper = this.#pagesMapper;\n const currentPageNumber = selectedPages.has(this._currentPageNumber)\n ? 0\n : this._currentPageNumber;\n const pagesToDelete = (this.#deletedPageNumbers = Uint32Array.from(\n selectedPages\n ).sort((a, b) => a - b));\n\n pagesMapper.deletePages(pagesToDelete);\n this.#updateCurrentPage(this.#updateThumbnails(currentPageNumber));\n this.#thumbnailsPositions = null;\n\n selectedPages.clear();\n this.#updateMenuEntries();\n\n this.eventBus.dispatch(\"pagesedited\", {\n source: this,\n pagesMapper,\n pageNumbers: pagesToDelete,\n type,\n });\n }\n\n #updateMenuEntries() {\n const size = this.#selectedPages?.size || 0;\n this.#manageExportButton.disabled = this.#manageCopyButton.disabled = !size;\n this.#manageDeleteButton.disabled = this.#manageCutButton.disabled =\n !this.#canDelete();\n }\n\n #toggleMenuEntries(enable) {\n this.#manageExportButton.disabled =\n this.#manageDeleteButton.disabled =\n this.#manageCopyButton.disabled =\n this.#manageCutButton.disabled =\n !enable;\n }\n\n #updateStatus(type) {\n if (!this.#statusBar || !this.#undoBar) {\n return;\n }\n const count = this.#selectedPages?.size || 0;\n if (type === \"select\") {\n this.#statusLabel.setAttribute(\n \"data-l10n-id\",\n count\n ? \"pdfjs-views-manager-pages-status-action-label\"\n : \"pdfjs-views-manager-pages-status-none-action-label\"\n );\n this.#toggleBar(\"status\", \"\", count ? { count } : null);\n return;\n }\n\n let l10nId;\n switch (type) {\n case \"copy\":\n l10nId = \"pdfjs-views-manager-pages-status-undo-copy-label\";\n break;\n case \"cut\":\n l10nId = \"pdfjs-views-manager-status-undo-cut-label\";\n break;\n case \"delete\":\n l10nId = \"pdfjs-views-manager-pages-status-undo-delete-label\";\n break;\n }\n this.#toggleBar(\"undo\", l10nId, { count });\n\n const isCopy = type === \"copy\";\n this.#undoButton.firstElementChild.setAttribute(\n \"data-l10n-id\",\n isCopy\n ? \"pdfjs-views-manager-status-done-button-label\"\n : \"pdfjs-views-manager-status-undo-button-label\"\n );\n this.#undoCloseButton.classList.toggle(\"hidden\", isCopy);\n }\n\n #moveDraggedContainer(dx, dy) {\n if (this.#isOneColumnView) {\n dx = 0;\n }\n if (\n this.#draggedImageX + dx < 0 ||\n this.#draggedImageX + this.#draggedImageWidth + dx >\n this.#scrollableContainerWidth\n ) {\n dx = 0;\n }\n if (\n this.#draggedImageY + dy < 0 ||\n this.#draggedImageY + this.#draggedImageHeight + dy >\n this.#scrollableContainerHeight\n ) {\n dy = 0;\n }\n\n this.#draggedImageX += dx;\n this.#draggedImageY += dy;\n this.#draggedImageOffsetX += dx;\n this.#draggedImageOffsetY += dy;\n this.#draggedContainer.style.translate = `${this.#draggedImageOffsetX}px ${this.#draggedImageOffsetY}px`;\n if (\n this.#draggedImageY + this.#draggedImageHeight >\n this.#currentScrollBottom\n ) {\n this.scrollableContainer.scrollTop = Math.min(\n this.scrollableContainer.scrollTop + PIXELS_TO_SCROLL_WHEN_DRAGGING,\n this.#scrollableContainerHeight\n );\n } else if (this.#draggedImageY < this.#currentScrollTop) {\n this.scrollableContainer.scrollTop = Math.max(\n this.scrollableContainer.scrollTop - PIXELS_TO_SCROLL_WHEN_DRAGGING,\n 0\n );\n }\n\n const positionData = this.#findClosestThumbnail(\n this.#draggedImageX + this.#draggedImageWidth / 2,\n this.#draggedImageY + this.#draggedImageHeight / 2\n );\n this.#positionDragMarker(positionData);\n }\n\n #positionDragMarker(positionData) {\n if (!positionData) {\n return;\n }\n let dragMarker = this.#dragMarker;\n if (!dragMarker) {\n dragMarker = this.#dragMarker = document.createElement(\"div\");\n dragMarker.className = \"dragMarker\";\n this.container.firstChild.before(dragMarker);\n }\n\n const [index, space] = positionData;\n const dragMarkerStyle = dragMarker.style;\n const { bbox, x: xPos } = this.#thumbnailsPositions;\n let x, y, width, height;\n if (index < 0) {\n if (xPos.length === 1) {\n y = bbox[1] - SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT;\n x = bbox[0];\n width = bbox[2];\n } else {\n y = bbox[1];\n x = bbox[0] - SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT;\n height = bbox[3];\n }\n } else if (xPos.length === 1) {\n y = bbox[index * 4 + 1] + bbox[index * 4 + 3] + space;\n x = bbox[index * 4];\n width = bbox[index * 4 + 2];\n } else {\n y = bbox[index * 4 + 1];\n x = bbox[index * 4] + bbox[index * 4 + 2] + space;\n height = bbox[index * 4 + 3];\n }\n dragMarkerStyle.translate = `${x}px ${y}px`;\n dragMarkerStyle.width = width ? `${width}px` : \"\";\n dragMarkerStyle.height = height ? `${height}px` : \"\";\n }\n\n #computeThumbnailsPosition() {\n // Collect the center of each thumbnail.\n // This is used to determine the closest thumbnail when dragging.\n // TODO: handle the RTL case.\n const positionsX = [];\n const positionsY = [];\n const positionsLastX = [];\n const bbox = new Float32Array(this._thumbnails.length * 4);\n let prevX = -Infinity;\n let prevY = -Infinity;\n let reminder = -1;\n let firstRightX;\n let lastRightX;\n let firstBottomY;\n for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {\n const { div } = this._thumbnails[i];\n const {\n offsetTop: y,\n offsetLeft: x,\n offsetWidth: w,\n offsetHeight: h,\n } = div;\n if (w === 0) {\n // The thumbnail view isn't visible.\n return;\n }\n bbox[i * 4] = x;\n bbox[i * 4 + 1] = y;\n bbox[i * 4 + 2] = w;\n bbox[i * 4 + 3] = h;\n if (x > prevX) {\n prevX = x + w / 2;\n firstRightX ??= prevX + w;\n positionsX.push(prevX);\n }\n if (y > prevY) {\n if (reminder === -1 && positionsX.length > 1) {\n reminder = ii % positionsX.length;\n }\n prevY = y + h / 2;\n firstBottomY ??= prevY + h;\n positionsY.push(prevY);\n }\n if (reminder > 0 && i >= ii - reminder) {\n const cx = x + w / 2;\n positionsLastX.push(cx);\n lastRightX ??= cx + w;\n }\n }\n let space;\n if (positionsX.length > 1) {\n space = (positionsX[1] - firstRightX) / 2;\n } else if (positionsY.length > 1) {\n space = (positionsY[1] - firstBottomY) / 2;\n } else {\n space = SPACE_FOR_DRAG_MARKER_WHEN_NO_NEXT_ELEMENT;\n }\n this.#thumbnailsPositions = {\n x: positionsX,\n y: positionsY,\n lastX: positionsLastX,\n space,\n lastSpace: positionsLastX.length\n ? (positionsLastX.at(-1) - lastRightX) / 2\n : space,\n bbox,\n };\n this.#isOneColumnView = positionsX.length === 1;\n ({\n clientWidth: this.#scrollableContainerWidth,\n scrollHeight: this.#scrollableContainerHeight,\n } = this.scrollableContainer);\n }\n\n #addEventListeners() {\n this.eventBus.on(\n \"resize\",\n ({ source }) => {\n if (source.thumbnailsView === this.container) {\n this.#computeThumbnailsPosition();\n }\n },\n internalOpt\n );\n this.container.addEventListener(\"keydown\", e => {\n const { target } = e;\n const isCheckbox =\n target instanceof HTMLInputElement && target.type === \"checkbox\";\n\n switch (e.key) {\n case \"ArrowLeft\":\n this.#goToNextItem(target, false, true, isCheckbox);\n stopEvent(e);\n break;\n case \"ArrowRight\":\n this.#goToNextItem(target, true, true, isCheckbox);\n stopEvent(e);\n break;\n case \"ArrowDown\":\n this.#goToNextItem(target, true, false, isCheckbox);\n stopEvent(e);\n break;\n case \"ArrowUp\":\n this.#goToNextItem(target, false, false, isCheckbox);\n stopEvent(e);\n break;\n case \"Home\":\n this.#focusThumbnailElement(this._thumbnails[0], isCheckbox);\n stopEvent(e);\n break;\n case \"End\":\n this.#focusThumbnailElement(this._thumbnails.at(-1), isCheckbox);\n stopEvent(e);\n break;\n case \"Enter\":\n case \" \":\n if (!isCheckbox) {\n this.#goToPage(e);\n }\n // For checkboxes, let the default behavior handle toggling\n break;\n case \"c\":\n if (\n this.#enableSplitMerge &&\n (e.ctrlKey || e.metaKey) &&\n this.#selectedPages?.size\n ) {\n this.#copyPages();\n stopEvent(e);\n }\n break;\n case \"x\":\n if (\n this.#enableSplitMerge &&\n (e.ctrlKey || e.metaKey) &&\n this.#selectedPages?.size\n ) {\n this.#cutPages();\n stopEvent(e);\n }\n break;\n case \"Delete\":\n case \"Backspace\":\n if (\n this.#enableSplitMerge &&\n !this.#isInPasteMode &&\n this.#selectedPages?.size\n ) {\n this.#deletePages();\n stopEvent(e);\n }\n break;\n }\n });\n this.container.addEventListener(\"click\", e => {\n const { target } = e;\n if (target instanceof HTMLInputElement) {\n const pageNumber = parseInt(\n target.parentElement.getAttribute(\"page-number\"),\n 10\n );\n this.#selectPage(pageNumber, target.checked);\n return;\n }\n this.#goToPage(e);\n });\n this.#addDragListeners();\n this.#addExternalFileDropListeners();\n }\n\n #selectPage(pageNumber, checked) {\n if (this.#hasUndoBarVisible) {\n this.#dismissUndo(/* mustUpdateStatus = */ false);\n }\n const set = (this.#selectedPages ??= new Set());\n if (checked) {\n set.add(pageNumber);\n } else {\n set.delete(pageNumber);\n }\n\n this.#updateMenuEntries();\n this.#updateStatus(\"select\");\n }\n\n #addDragListeners() {\n if (!this.#enableSplitMerge) {\n return;\n }\n this.container.addEventListener(\"pointerdown\", e => {\n const {\n target: draggedImage,\n clientX: clickX,\n clientY: clickY,\n pointerId: dragPointerId,\n } = e;\n if (\n e.button !== 0 || // Skip right click.\n this.#isInPasteMode ||\n this._thumbnails.length === 1 ||\n !isNaN(this.#lastDraggedOverIndex) ||\n !draggedImage.classList.contains(\"thumbnailImageContainer\")\n ) {\n // We're already handling a drag, or the target is not draggable.\n return;\n }\n\n const thumbnail = draggedImage.parentElement;\n const pointerDownAC = new AbortController();\n const { signal: pointerDownSignal } = pointerDownAC;\n let prevDragX = clickX;\n let prevDragY = clickY;\n let prevScrollTop = this.scrollableContainer.scrollTop;\n\n // When dragging, the thumbnail is scaled down. To keep the cursor at the\n // same position on the thumbnail, we need to adjust the offset\n // accordingly.\n const scaleFactor = PDFThumbnailViewer.#getScaleFactor(draggedImage);\n this.#draggedImageOffsetY =\n ((scaleFactor - 1) * e.layerY + draggedImage.offsetTop) / scaleFactor;\n\n if (this.#isOneColumnView) {\n this.#draggedImageOffsetX =\n draggedImage.offsetLeft +\n ((scaleFactor - 1) * 0.5 * draggedImage.offsetWidth) / scaleFactor;\n } else {\n this.#draggedImageOffsetX =\n ((scaleFactor - 1) * e.layerX + draggedImage.offsetLeft) /\n scaleFactor;\n }\n this.#draggedImageX = thumbnail.offsetLeft + this.#draggedImageOffsetX;\n this.#draggedImageY = thumbnail.offsetTop + this.#draggedImageOffsetY;\n this.#draggedImageWidth = draggedImage.offsetWidth / scaleFactor;\n this.#draggedImageHeight = draggedImage.offsetHeight / scaleFactor;\n\n this.container.addEventListener(\n \"pointermove\",\n ev => {\n const { clientX: x, clientY: y, pointerId } = ev;\n if (isNaN(this.#lastDraggedOverIndex)) {\n if (\n pointerId !== dragPointerId ||\n (Math.abs(x - clickX) <= DRAG_THRESHOLD_IN_PIXELS &&\n Math.abs(y - clickY) <= DRAG_THRESHOLD_IN_PIXELS)\n ) {\n // Not enough movement to be considered a drag.\n return;\n }\n\n // First movement while dragging.\n this.#onStartDragging(thumbnail);\n const stopDragging = (_e, isDropping = false) => {\n this.#onStopDragging(isDropping);\n pointerDownAC.abort();\n };\n const { signal } = this.#dragAC;\n window.addEventListener(\n \"touchmove\",\n stopEvent /* Prevent the container from scrolling */,\n { passive: false, signal }\n );\n window.addEventListener(\"contextmenu\", noContextMenu, { signal });\n this.scrollableContainer.addEventListener(\n \"scrollend\",\n () => {\n const {\n scrollableContainer: { clientHeight, scrollTop },\n } = this;\n this.#currentScrollTop = scrollTop;\n this.#currentScrollBottom = scrollTop + clientHeight;\n const dy = scrollTop - prevScrollTop;\n prevScrollTop = scrollTop;\n this.#moveDraggedContainer(0, dy);\n },\n { passive: true, signal }\n );\n window.addEventListener(\n \"pointerup\",\n upEv => {\n if (upEv.pointerId !== dragPointerId) {\n return;\n }\n // Prevent the subsequent click event after pointerup.\n window.addEventListener(\"click\", stopEvent, {\n capture: true,\n once: true,\n signal,\n });\n stopEvent(upEv);\n stopDragging(upEv, /* isDropping = */ true);\n },\n { signal }\n );\n window.addEventListener(\"blur\", stopDragging, { signal });\n window.addEventListener(\"pointercancel\", stopDragging, { signal });\n window.addEventListener(\"wheel\", stopEvent, {\n passive: false,\n signal,\n });\n window.addEventListener(\n \"keydown\",\n kEv => {\n if (\n kEv.key === \"Escape\" &&\n !isNaN(this.#lastDraggedOverIndex)\n ) {\n stopDragging(kEv);\n }\n },\n { signal }\n );\n }\n\n const dx = x - prevDragX;\n const dy = y - prevDragY;\n prevDragX = x;\n prevDragY = y;\n this.#moveDraggedContainer(dx, dy);\n },\n { passive: true, signal: pointerDownSignal }\n );\n window.addEventListener(\n \"pointerup\",\n ({ pointerId }) => {\n if (pointerId !== dragPointerId) {\n return;\n }\n pointerDownAC.abort();\n },\n { signal: pointerDownSignal }\n );\n window.addEventListener(\"dragstart\", stopEvent, {\n capture: true,\n signal: pointerDownSignal,\n });\n });\n }\n\n #addExternalFileDropListeners() {\n if (!this.#enableMerge) {\n return;\n }\n const container = this.container;\n const signal = this.#abortSignal;\n\n const hasMergeableItem = dataTransfer => {\n if (!dataTransfer) {\n return false;\n }\n // The file's bytes aren't readable during dragover, so the MIME type is\n // the only available signal. Matches the existing global drop handler\n // in app.js. Files with no MIME (e.g. some macOS sources) are rejected\n // here to keep the \"copy\" cursor honest; if needed, drop-time magic-byte\n // validation in #mergeFiles would still catch a permissive variant.\n for (const item of dataTransfer.items) {\n if (\n item.kind === \"file\" &&\n (item.type === \"application/pdf\" || item.type.startsWith(\"image/\"))\n ) {\n return true;\n }\n }\n return false;\n };\n const pointerInContainer = ({ clientX, clientY }) => {\n const { left, right, top, bottom } = container.getBoundingClientRect();\n return (\n clientX >= left && clientX < right && clientY >= top && clientY < bottom\n );\n };\n\n container.addEventListener(\n \"dragenter\",\n e => {\n if (\n this.#externalDragActive ||\n // A page-move drag is already in progress.\n !isNaN(this.#lastDraggedOverIndex) ||\n !this._thumbnails.length ||\n !hasMergeableItem(e.dataTransfer)\n ) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = \"copy\";\n this.#externalDragActive = true;\n this.container.classList.add(\"isDraggingFile\");\n // Recompute positions in case the layout changed since last time.\n this.#thumbnailsPositions = null;\n this.#computeThumbnailsPosition();\n // Marker hasn't been positioned yet — first dragover will do it.\n this.#lastDraggedOverIndex = NaN;\n },\n { signal }\n );\n\n container.addEventListener(\n \"dragover\",\n e => {\n if (!this.#externalDragActive) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = \"copy\";\n if (!this.#thumbnailsPositions) {\n return;\n }\n const rect = container.getBoundingClientRect();\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n const positionData = this.#findClosestThumbnail(x, y);\n this.#positionDragMarker(positionData);\n },\n { signal }\n );\n\n container.addEventListener(\n \"dragleave\",\n e => {\n if (!this.#externalDragActive) {\n return;\n }\n // dragleave fires when crossing into a child element too; only treat\n // it as a true leave when the cursor has actually left the container.\n if (\n (e.relatedTarget && container.contains(e.relatedTarget)) ||\n pointerInContainer(e)\n ) {\n return;\n }\n this.#endExternalFileDrag();\n },\n { signal }\n );\n\n container.addEventListener(\n \"drop\",\n e => {\n if (!this.#externalDragActive) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n const files = Array.from(e.dataTransfer.files ?? []);\n // If no dragover ever ran (e.g. instant drop), compute the index from\n // the drop event itself so we don't fall through to a stale fallback.\n if (isNaN(this.#lastDraggedOverIndex) && this.#thumbnailsPositions) {\n const rect = container.getBoundingClientRect();\n this.#findClosestThumbnail(\n e.clientX - rect.left,\n e.clientY - rect.top\n );\n }\n const insertAfter = isNaN(this.#lastDraggedOverIndex)\n ? -1\n : this.#lastDraggedOverIndex;\n this.#endExternalFileDrag();\n if (files.length) {\n this.#mergeFiles(files, insertAfter);\n }\n },\n { signal }\n );\n }\n\n #endExternalFileDrag() {\n this.#externalDragActive = false;\n this.container.classList.remove(\"isDraggingFile\");\n this.#dragMarker?.remove();\n this.#dragMarker = null;\n this.#lastDraggedOverIndex = NaN;\n }\n\n #goToPage(e) {\n const container = e.target.closest(\".thumbnailImageContainer\");\n if (container) {\n const pageNumber = parseInt(container.getAttribute(\"page-number\"), 10);\n this.linkService.goToPage(pageNumber);\n stopEvent(e);\n }\n }\n\n /**\n * Focus either the checkbox or image of a thumbnail.\n * @param {PDFThumbnailView} thumbnail\n * @param {boolean} focusCheckbox - If true, focus checkbox; otherwise focus\n * image\n */\n #focusThumbnailElement(thumbnail, focusCheckbox) {\n if (focusCheckbox && thumbnail.checkbox) {\n thumbnail.checkbox.focus();\n } else {\n thumbnail.imageContainer.focus();\n }\n }\n\n /**\n * Go to the next/previous menu item.\n * @param {HTMLElement} element\n * @param {boolean} forward\n * @param {boolean} horizontal\n * @param {boolean} navigateCheckboxes - If true, focus checkboxes;\n * otherwise focus images\n */\n #goToNextItem(element, forward, horizontal, navigateCheckboxes = false) {\n let currentPageNumber = parseInt(\n element.parentElement.getAttribute(\"page-number\"),\n 10\n );\n if (isNaN(currentPageNumber)) {\n currentPageNumber = this._currentPageNumber;\n }\n\n const increment = forward ? 1 : -1;\n let nextThumbnail;\n if (horizontal) {\n const nextPageNumber = MathClamp(\n currentPageNumber + increment,\n 1,\n this._thumbnails.length + 1\n );\n nextThumbnail = this._thumbnails[nextPageNumber - 1];\n } else {\n const currentThumbnail = this._thumbnails[currentPageNumber - 1];\n const { x: currentX, y: currentY } =\n currentThumbnail.div.getBoundingClientRect();\n let firstWithDifferentY;\n for (\n let i = currentPageNumber - 1 + increment;\n i >= 0 && i < this._thumbnails.length;\n i += increment\n ) {\n const thumbnail = this._thumbnails[i];\n const { x, y } = thumbnail.div.getBoundingClientRect();\n if (!firstWithDifferentY && y !== currentY) {\n firstWithDifferentY = thumbnail;\n }\n if (x === currentX) {\n nextThumbnail = thumbnail;\n break;\n }\n }\n nextThumbnail ??= firstWithDifferentY;\n }\n if (nextThumbnail) {\n this.#focusThumbnailElement(nextThumbnail, navigateCheckboxes);\n }\n }\n\n // Given the drag center (x, y), find the drop slot index: the drag marker\n // will be placed after thumbnail[index], or before all thumbnails if index\n // is -1. Returns null when the drop slot hasn't changed (no marker update\n // needed), or [index, space] where space is the gap (in px) between\n // thumbnails at that slot, used to position the marker.\n //\n // positionsX holds the x-center of each column, positionsY the y-center of\n // each row. positionsLastX holds the x-centers for an incomplete last row\n // (when the total number of thumbnails is not a multiple of the column\n // count).\n #findClosestThumbnail(x, y) {\n if (!this.#thumbnailsPositions) {\n this.#computeThumbnailsPosition();\n }\n const {\n x: positionsX,\n y: positionsY,\n lastX: positionsLastX,\n space: spaceBetweenThumbnails,\n lastSpace: lastSpaceBetweenThumbnails,\n } = this.#thumbnailsPositions;\n const lastDraggedOverIndex = this.#lastDraggedOverIndex;\n\n // Fast-path: reconstruct the row/col of the previous drop slot and check\n // whether (x, y) still falls inside the same cell's bounds.\n let xPos = lastDraggedOverIndex % positionsX.length;\n let yPos = Math.floor(lastDraggedOverIndex / positionsX.length);\n let xArray = yPos === positionsY.length - 1 ? positionsLastX : positionsX;\n if (\n positionsY[yPos] <= y &&\n y < (positionsY[yPos + 1] ?? Infinity) &&\n xArray[xPos] <= x &&\n x < (xArray[xPos + 1] ?? Infinity)\n ) {\n // Fast-path: we're still in the same thumbnail.\n return null;\n }\n\n let index;\n // binarySearchFirstItem returns the first row index whose center is below\n // y, i.e. the first i such that positionsY[i] > y.\n yPos = binarySearchFirstItem(positionsY, cy => y < cy);\n if (this.#isOneColumnView) {\n // In a single column the drop slot is simply the row boundary: the marker\n // goes after row (yPos - 1), meaning before row yPos. index = -1 when y\n // is above the first thumbnail's center (drop before thumbnail 0).\n index = yPos - 1;\n } else {\n // Grid layout: first pick the nearest row, then the nearest column.\n\n if (yPos === positionsY.length) {\n // y is below the last row's center — clamp to the last row.\n yPos = positionsY.length - 1;\n } else {\n // Choose between the row just above (yPos - 1) and the row at yPos by\n // comparing distances, so the marker snaps to whichever row center is\n // closer to y.\n const dist1 = Math.abs(positionsY[yPos - 1] - y);\n const dist2 = Math.abs(positionsY[yPos] - y);\n yPos = dist1 < dist2 ? yPos - 1 : yPos;\n }\n // The last row may be incomplete, so use its own x-center array.\n xArray =\n yPos === positionsY.length - 1 && positionsLastX.length > 0\n ? positionsLastX\n : positionsX;\n // Find the column: the first column whose center is to the right of x,\n // minus 1, gives the column the cursor is in (or -1 if before column 0).\n xPos = binarySearchFirstItem(xArray, cx => x < cx) - 1;\n if (yPos < 0) {\n // y is above the first row: force drop before the very first thumbnail.\n if (xPos <= 0) {\n xPos = -1;\n }\n yPos = 0;\n }\n // Convert (row, col) to a flat thumbnail index, clamped to\n // [-1, length-1].\n index = MathClamp(\n yPos * positionsX.length + xPos,\n -1,\n this._thumbnails.length - 1\n );\n }\n if (index === lastDraggedOverIndex) {\n // No change.\n return null;\n }\n this.#lastDraggedOverIndex = index;\n // Use the last-row gap when the drop slot is in the incomplete last row.\n const space =\n yPos === positionsY.length - 1 && positionsLastX.length > 0 && xPos >= 0\n ? lastSpaceBetweenThumbnails\n : spaceBetweenThumbnails;\n\n return [index, space];\n }\n}\n\nexport { PDFThumbnailViewer };\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/page_viewport\").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// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/annotation_layer.js\").AnnotationLayer} AnnotationLayer */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/struct_tree_layer_builder.js\").StructTreeLayerBuilder} StructTreeLayerBuilder */\n\nimport { AnnotationEditorLayer } from \"pdfjs-lib\";\nimport { GenericL10n } from \"web-null_l10n\";\n\n/**\n * @typedef {Object} AnnotationEditorLayerBuilderOptions\n * @property {AnnotationEditorUIManager} [uiManager]\n * @property {number} pageIndex\n * @property {L10n} [l10n]\n * @property {StructTreeLayerBuilder} [structTreeLayer]\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {AnnotationLayer} [annotationLayer]\n * @property {TextLayer} [textLayer]\n * @property {DrawLayer} [drawLayer]\n * @property {function} [onAppend]\n */\n\n/**\n * @typedef {Object} AnnotationEditorLayerBuilderRenderOptions\n * @property {PageViewport} viewport\n * @property {string} [intent] - The default value is \"display\".\n */\n\nclass AnnotationEditorLayerBuilder {\n #annotationLayer = null;\n\n #drawLayer = null;\n\n #onAppend = null;\n\n #structTreeLayer = null;\n\n #textLayer = null;\n\n #uiManager;\n\n /**\n * @param {AnnotationEditorLayerBuilderOptions} options\n */\n constructor(options) {\n this.pageIndex = options.pageIndex;\n this.accessibilityManager = options.accessibilityManager;\n this.l10n = options.l10n;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.l10n ||= new GenericL10n();\n }\n this.annotationEditorLayer = null;\n this.div = null;\n this._cancelled = false;\n this.#uiManager = options.uiManager;\n this.#annotationLayer = options.annotationLayer || null;\n this.#textLayer = options.textLayer || null;\n this.#drawLayer = options.drawLayer || null;\n this.#onAppend = options.onAppend || null;\n this.#structTreeLayer = options.structTreeLayer || null;\n }\n\n updatePageIndex(newPageIndex) {\n this.pageIndex = newPageIndex;\n this.annotationEditorLayer?.updatePageIndex(newPageIndex);\n }\n\n /**\n * @param {AnnotationEditorLayerBuilderRenderOptions} options\n * @returns {Promise<void>}\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.hidden = true;\n div.dir = this.#uiManager.direction;\n this.#onAppend?.(div);\n\n this.annotationEditorLayer = new AnnotationEditorLayer({\n uiManager: this.#uiManager,\n div,\n structTreeLayer: this.#structTreeLayer,\n accessibilityManager: this.accessibilityManager,\n pageIndex: this.pageIndex,\n l10n: this.l10n,\n viewport: clonedViewport,\n annotationLayer: this.#annotationLayer,\n textLayer: this.#textLayer,\n drawLayer: this.#drawLayer,\n });\n\n const parameters = {\n viewport: clonedViewport,\n div,\n annotations: null,\n intent,\n };\n\n await 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.annotationEditorLayer.destroy();\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.annotationEditorLayer.pause(/* on */ true);\n this.div.hidden = true;\n }\n\n show() {\n if (!this.div || this.annotationEditorLayer.isInvisible) {\n return;\n }\n this.div.hidden = false;\n this.annotationEditorLayer.pause(/* on */ 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/page_viewport\").PageViewport} PageViewport */\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(\"./struct_tree_layer_builder.js\").StructTreeLayerBuilder} StructTreeLayerBuilder */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/editor/tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n/** @typedef {import(\"./comment_manager.js\").CommentManager} CommentManager */\n/** @typedef {import(\"./pdf_link_service.js\").PDFLinkService} PDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./base_download_manager.js\").BaseDownloadManager} BaseDownloadManager */\n\nimport {\n AnnotationLayer,\n AnnotationType,\n setLayerDimensions,\n Util,\n} from \"pdfjs-lib\";\nimport { internalOpt } from \"./internal_evt.js\";\nimport { PresentationModeState } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} AnnotationLayerBuilderOptions\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 {PDFLinkService} linkService\n * @property {BaseDownloadManager} [downloadManager]\n * @property {boolean} [enableComment]\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 * @property {AnnotationEditorUIManager} [annotationEditorUIManager]\n * @property {function} [onAppend]\n * @property {CommentManager} [commentManager]\n */\n\n/**\n * @typedef {Object} AnnotationLayerBuilderRenderOptions\n * @property {PageViewport} viewport\n * @property {string} [intent] - The default value is \"display\".\n * @property {StructTreeLayerBuilder} [structTreeLayer]\n * @property {Promise} [optionalContentConfigPromise]\n */\n\nclass AnnotationLayerBuilder {\n #annotations = null;\n\n #commentManager = null;\n\n #onAppend = null;\n\n #eventAC = null;\n\n #linksInjected = false;\n\n /**\n * @param {AnnotationLayerBuilderOptions} options\n */\n constructor({\n pdfPage,\n linkService,\n downloadManager,\n annotationStorage = null,\n imageResourcesPath = \"\",\n renderForms = true,\n enableComment = false,\n commentManager = null,\n enableScripting = false,\n hasJSActionsPromise = null,\n fieldObjectsPromise = null,\n annotationCanvasMap = null,\n accessibilityManager = null,\n annotationEditorUIManager = null,\n onAppend = null,\n }) {\n this.pdfPage = pdfPage;\n this.linkService = linkService;\n this.downloadManager = downloadManager;\n this.imageResourcesPath = imageResourcesPath;\n this.renderForms = renderForms;\n this.annotationStorage = annotationStorage;\n this.enableComment = enableComment;\n this.#commentManager = commentManager;\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 this._annotationEditorUIManager = annotationEditorUIManager;\n this.#onAppend = onAppend;\n\n this.annotationLayer = null;\n this.div = null;\n this._cancelled = false;\n this._eventBus = linkService.eventBus;\n }\n\n /**\n * @param {AnnotationLayerBuilderRenderOptions} options\n * @returns {Promise<void>} A promise that is resolved when rendering of the\n * annotations is complete.\n */\n async render({\n viewport,\n intent = \"display\",\n structTreeLayer = null,\n optionalContentConfigPromise = null,\n }) {\n if (this.div) {\n const optionalContentConfig = await optionalContentConfigPromise;\n\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 optionalContentConfig,\n });\n return;\n }\n\n const [annotations, hasJSActions, fieldObjects, optionalContentConfig] =\n await Promise.all([\n this.pdfPage.getAnnotations({ intent }),\n this._hasJSActionsPromise,\n this._fieldObjectsPromise,\n optionalContentConfigPromise,\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.#onAppend?.(div);\n this.#initAnnotationLayer(viewport, structTreeLayer);\n\n if (annotations.length === 0) {\n this.#annotations = annotations;\n setLayerDimensions(this.div, viewport);\n return;\n }\n\n await this.annotationLayer.render({\n annotations,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.renderForms,\n downloadManager: this.downloadManager,\n enableComment: this.enableComment,\n enableScripting: this.enableScripting,\n hasJSActions,\n fieldObjects,\n optionalContentConfig,\n });\n\n this.#annotations = annotations;\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.#eventAC) {\n this.#eventAC = new AbortController();\n\n this._eventBus?.on(\n \"presentationmodechanged\",\n evt => {\n this.#updatePresentationModeState(evt.state);\n },\n { signal: this.#eventAC.signal, ...internalOpt }\n );\n }\n }\n\n #initAnnotationLayer(viewport, structTreeLayer) {\n this.annotationLayer = new AnnotationLayer({\n div: this.div,\n accessibilityManager: this._accessibilityManager,\n annotationCanvasMap: this._annotationCanvasMap,\n annotationEditorUIManager: this._annotationEditorUIManager,\n annotationStorage: this.annotationStorage,\n page: this.pdfPage,\n viewport: viewport.clone({ dontFlip: true }),\n structTreeLayer,\n commentManager: this.#commentManager,\n linkService: this.linkService,\n });\n }\n\n cancel() {\n this._cancelled = true;\n\n this.#eventAC?.abort();\n this.#eventAC = null;\n this.annotationLayer?.destroy();\n }\n\n refreshCanvases() {\n this.annotationLayer?.refreshCanvases();\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n\n hasEditableAnnotations() {\n return !!this.annotationLayer?.hasEditableAnnotations();\n }\n\n /**\n * @param {Array<Object>} inferredLinks\n * @returns {Promise<void>} A promise that is resolved when the inferred links\n * are added to the annotation layer.\n */\n async injectLinkAnnotations(inferredLinks) {\n if (this.#annotations === null) {\n throw new Error(\n \"`render` method must be called before `injectLinkAnnotations`.\"\n );\n }\n if (this._cancelled || this.#linksInjected) {\n return;\n }\n this.#linksInjected = true;\n\n const newLinks = this.#annotations.length\n ? this.#checkInferredLinks(inferredLinks)\n : inferredLinks;\n\n if (!newLinks.length) {\n return;\n }\n\n await this.annotationLayer.addLinkAnnotations(newLinks);\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 (\n section.hasAttribute(\"data-internal-link\") ||\n section.classList.contains(\"mediaAnnotation\")\n ) {\n continue;\n }\n section.inert = disableFormElements;\n }\n }\n\n #checkInferredLinks(inferredLinks) {\n function annotationRects(annot) {\n if (!annot.quadPoints) {\n return [annot.rect];\n }\n const rects = [];\n for (let i = 2, ii = annot.quadPoints.length; i < ii; i += 8) {\n const trX = annot.quadPoints[i];\n const trY = annot.quadPoints[i + 1];\n const blX = annot.quadPoints[i + 2];\n const blY = annot.quadPoints[i + 3];\n rects.push([blX, blY, trX, trY]);\n }\n return rects;\n }\n\n function intersectAnnotations(annot1, annot2) {\n const intersections = [];\n const annot1Rects = annotationRects(annot1);\n const annot2Rects = annotationRects(annot2);\n for (const rect1 of annot1Rects) {\n for (const rect2 of annot2Rects) {\n const intersection = Util.intersect(rect1, rect2);\n if (intersection) {\n intersections.push(intersection);\n }\n }\n }\n return intersections;\n }\n\n function areaRects(rects) {\n let totalArea = 0;\n for (const rect of rects) {\n totalArea += Math.abs((rect[2] - rect[0]) * (rect[3] - rect[1]));\n }\n return totalArea;\n }\n\n return inferredLinks.filter(link => {\n let linkAreaRects;\n\n for (const annotation of this.#annotations) {\n if (annotation.annotationType !== AnnotationType.LINK) {\n continue;\n }\n // TODO: Add a test case to verify that we can find the intersection\n // between two annotations with quadPoints properly.\n const intersections = intersectAnnotations(annotation, link);\n\n if (intersections.length === 0) {\n continue;\n }\n linkAreaRects ??= areaRects(annotationRects(link));\n\n if (\n areaRects(intersections) / linkAreaRects >\n 0.5 /* If the overlap is more than 50%. */\n ) {\n return false;\n }\n }\n return true;\n });\n }\n}\n\nexport { AnnotationLayerBuilder };\n","/* Copyright 2025 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 { AnnotationType, createValidAbsoluteUrl, Util } from \"pdfjs-lib\";\nimport { getOriginalIndex, normalize } from \"./pdf_find_controller.js\";\n\nfunction DOMRectToPDF({ width, height, left, top }, pdfPageView) {\n if (width === 0 || height === 0) {\n return null;\n }\n\n const pageBox = pdfPageView.textLayer.div.getBoundingClientRect();\n const bottomLeft = pdfPageView.getPagePoint(\n left - pageBox.left,\n top - pageBox.top\n );\n const topRight = pdfPageView.getPagePoint(\n left - pageBox.left + width,\n top - pageBox.top + height\n );\n\n return Util.normalizeRect([\n bottomLeft[0],\n bottomLeft[1],\n topRight[0],\n topRight[1],\n ]);\n}\n\nfunction calculateLinkPosition(range, pdfPageView) {\n const rangeRects = range.getClientRects();\n if (rangeRects.length === 1) {\n return { rect: DOMRectToPDF(rangeRects[0], pdfPageView) };\n }\n\n const rect = [Infinity, Infinity, -Infinity, -Infinity];\n const quadPoints = [];\n let i = 0;\n for (const domRect of rangeRects) {\n const normalized = DOMRectToPDF(domRect, pdfPageView);\n if (normalized === null) {\n continue;\n }\n\n quadPoints[i] = quadPoints[i + 4] = normalized[0];\n quadPoints[i + 1] = quadPoints[i + 3] = normalized[3];\n quadPoints[i + 2] = quadPoints[i + 6] = normalized[2];\n quadPoints[i + 5] = quadPoints[i + 7] = normalized[1];\n\n Util.rectBoundingBox(...normalized, rect);\n i += 8;\n }\n return { quadPoints, rect };\n}\n\n/**\n * Given a DOM node `container` and an index into its text contents `offset`,\n * returns a pair consisting of text node that the `offset` actually points\n * to, together with the offset relative to that text node.\n * When the offset points at the boundary between two node, the result will\n * point to the first text node in depth-first traversal order.\n *\n * For example, given this DOM:\n * <p>abc<span>def</span>ghi</p>\n *\n * textPosition(p, 0) -> [#text \"abc\", 0] (before `a`)\n * textPosition(p, 2) -> [#text \"abc\", 2] (between `b` and `c`)\n * textPosition(p, 3) -> [#text \"abc\", 3] (after `c`)\n * textPosition(p, 5) -> [#text \"def\", 2] (between `e` and `f`)\n * textPosition(p, 6) -> [#text \"def\", 3] (after `f`)\n */\nfunction textPosition(container, offset) {\n let currentContainer = container;\n do {\n if (currentContainer.nodeType === Node.TEXT_NODE) {\n const currentLength = currentContainer.textContent.length;\n if (offset <= currentLength) {\n return [currentContainer, offset];\n }\n offset -= currentLength;\n } else if (currentContainer.firstChild) {\n currentContainer = currentContainer.firstChild;\n continue;\n }\n\n while (!currentContainer.nextSibling && currentContainer !== container) {\n currentContainer = currentContainer.parentNode;\n }\n if (currentContainer !== container) {\n currentContainer = currentContainer.nextSibling;\n }\n } while (currentContainer !== container);\n throw new Error(\"Offset is bigger than container's contents length.\");\n}\n\nfunction createLinkAnnotation({ url, index, length }, pdfPageView, id) {\n const highlighter = pdfPageView._textHighlighter;\n const [{ begin, end }] = highlighter._convertMatches([index], [length]);\n\n const range = new Range();\n range.setStart(\n ...textPosition(highlighter.textDivs[begin.divIdx], begin.offset)\n );\n range.setEnd(...textPosition(highlighter.textDivs[end.divIdx], end.offset));\n\n return {\n id: `inferred_link_${id}`,\n unsafeUrl: url,\n url,\n annotationType: AnnotationType.LINK,\n rotation: 0,\n ...calculateLinkPosition(range, pdfPageView),\n // Populated in the annotationLayer to avoid unnecessary object creation,\n // since most inferred links overlap existing LinkAnnotations:\n borderStyle: null,\n };\n}\n\nclass Autolinker {\n static #index = 0;\n\n static #regex;\n\n static #numericTLDRegex;\n\n static findLinks(text) {\n // Regex can be tested and verified at https://regex101.com/r/rXoLiT/2.\n this.#regex ??=\n // eslint-disable-next-line regexp/no-super-linear-backtracking\n /\\b(?:https?:\\/\\/|mailto:|www\\.)(?:[\\S--[\\p{P}<>]]|\\/|[\\S--[\\[\\]]]+[\\S--[\\p{P}<>]])+|(?=\\p{L})[\\S--[@\\p{Ps}\\p{Pe}<>]]+@([\\S--[[\\p{P}--\\-]<>]]+(?:\\.[\\S--[[\\p{P}--\\-]<>]]+)+)/gv;\n\n const [normalizedText, diffs] = normalize(text, { ignoreDashEOL: true });\n const matches = normalizedText.matchAll(this.#regex);\n const links = [];\n for (const match of matches) {\n const [url, emailDomain] = match;\n let raw;\n if (\n url.startsWith(\"www.\") ||\n url.startsWith(\"http://\") ||\n url.startsWith(\"https://\")\n ) {\n raw = url;\n } else if (emailDomain) {\n const hostname = URL.parse(`http://${emailDomain}`)?.hostname;\n if (!hostname) {\n continue;\n }\n this.#numericTLDRegex ??= /\\.\\d+$/;\n if (this.#numericTLDRegex.test(hostname)) {\n // Skip emails with a numeric TLD as domain.\n continue;\n }\n }\n raw ??= url.startsWith(\"mailto:\") ? url : `mailto:${url}`;\n\n const absoluteURL = createValidAbsoluteUrl(raw, null, {\n addDefaultProtocol: true,\n });\n if (absoluteURL) {\n const [index, length] = getOriginalIndex(\n diffs,\n match.index,\n url.length\n );\n links.push({ url: absoluteURL.href, index, length });\n }\n }\n return links;\n }\n\n static processLinks(pdfPageView) {\n return this.findLinks(\n pdfPageView._textHighlighter.textContentItemsStr.join(\"\\n\")\n ).map(link => createLinkAnnotation(link, pdfPageView, this.#index++));\n }\n}\n\nexport { Autolinker };\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 { FeatureTest, RenderingCancelledException } from \"pdfjs-lib\";\nimport { RenderableView, RenderingStates } from \"./renderable_view.js\";\n\nclass BasePDFPageView extends RenderableView {\n #loadingId = null;\n\n #renderError = null;\n\n #renderingState = RenderingStates.INITIAL;\n\n #showCanvas = null;\n\n #startTime = 0;\n\n #tempCanvas = null;\n\n canvas = null;\n\n /** @type {null | HTMLDivElement} */\n div = null;\n\n enableOptimizedPartialRendering = false;\n\n enableSelectionRendering = true;\n\n imagesRightClickMinSize = -1;\n\n eventBus = null;\n\n id = null;\n\n imageCoordinates = null;\n\n pageColors = null;\n\n recordedBBoxes = null;\n\n renderingQueue = null;\n\n constructor(options) {\n super();\n this.eventBus = options.eventBus;\n this.id = options.id;\n this.pageColors = options.pageColors || null;\n this.renderingQueue = options.renderingQueue;\n this.enableOptimizedPartialRendering =\n options.enableOptimizedPartialRendering ?? false;\n this.enableSelectionRendering =\n options.enableSelectionRendering !== false &&\n FeatureTest.isBackdropFilterSupported;\n this.imagesRightClickMinSize = options.imagesRightClickMinSize ?? -1;\n this.minDurationToUpdateCanvas = options.minDurationToUpdateCanvas ?? 500;\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 // Display the canvas as it has been drawn.\n this.#startTime = 0;\n this.#showCanvas?.(false);\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 this.#startTime = Date.now();\n break;\n case RenderingStates.INITIAL:\n case RenderingStates.FINISHED:\n this.div.classList.remove(\"loadingIcon\", \"loading\");\n this.#startTime = 0;\n break;\n }\n }\n\n _createCanvas(onShow, hideUntilComplete = false) {\n const { pageColors } = this;\n const hasHCM = !!(pageColors?.background && pageColors?.foreground);\n const prevCanvas = this.canvas;\n\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\n // have a final flash we just display it once all the drawing is done.\n const updateOnFirstShow = !prevCanvas && !hasHCM && !hideUntilComplete;\n\n let canvas = (this.canvas = document.createElement(\"canvas\"));\n\n this.#showCanvas = isLastShow => {\n if (updateOnFirstShow) {\n let tempCanvas = this.#tempCanvas;\n if (!isLastShow && this.minDurationToUpdateCanvas > 0) {\n // We draw on the canvas at 60fps (in using `requestAnimationFrame`),\n // so if the canvas is large, updating it at 60fps can be a way too\n // much and can cause some serious performance issues.\n // To avoid that we only update the canvas every\n // `this.#minDurationToUpdateCanvas` ms.\n\n if (Date.now() - this.#startTime < this.minDurationToUpdateCanvas) {\n return;\n }\n if (!tempCanvas) {\n tempCanvas = this.#tempCanvas = canvas;\n canvas = this.canvas = canvas.cloneNode(false);\n onShow(canvas);\n }\n }\n\n if (tempCanvas) {\n const ctx = canvas.getContext(\"2d\", {\n alpha: false,\n });\n ctx.drawImage(tempCanvas, 0, 0);\n if (isLastShow) {\n this.#resetTempCanvas();\n } else {\n this.#startTime = Date.now();\n }\n return;\n }\n\n // Don't add the canvas until the first draw callback, or until\n // drawing is complete when `!this.renderingQueue`, to prevent black\n // flickering.\n onShow(canvas);\n this.#showCanvas = null;\n return;\n }\n if (!isLastShow) {\n return;\n }\n\n if (prevCanvas) {\n prevCanvas.replaceWith(canvas);\n prevCanvas.width = prevCanvas.height = 0;\n } else {\n onShow(canvas);\n }\n };\n\n return { canvas, prevCanvas };\n }\n\n #renderContinueCallback = cont => {\n this.#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 _resetCanvas() {\n const { canvas } = this;\n if (!canvas) {\n return;\n }\n canvas.remove();\n canvas.width = canvas.height = 0;\n this.canvas = null;\n this.#resetTempCanvas();\n }\n\n #resetTempCanvas() {\n if (this.#tempCanvas) {\n this.#tempCanvas.width = this.#tempCanvas.height = 0;\n this.#tempCanvas = null;\n }\n }\n\n async _drawCanvas(options, onCancel, onFinish) {\n const renderTask = (this.renderTask = this.pdfPage.render(options));\n renderTask.onContinue = this.#renderContinueCallback;\n renderTask.onError = error => {\n if (error instanceof RenderingCancelledException) {\n onCancel();\n this.#renderError = null;\n }\n };\n\n let error = null;\n try {\n await renderTask.promise;\n this.#showCanvas?.(true);\n } catch (e) {\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 (e instanceof RenderingCancelledException) {\n return;\n }\n error = e;\n\n this.#showCanvas?.(true);\n } finally {\n this.#renderError = error;\n\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 if (this.enableOptimizedPartialRendering) {\n this.recordedBBoxes ??= renderTask.recordedBBoxes;\n }\n if (this.imagesRightClickMinSize !== -1) {\n this.imageCoordinates ??= this.pdfPage.imageCoordinates;\n }\n }\n }\n this.renderingState = RenderingStates.FINISHED;\n\n onFinish(renderTask);\n\n if (error) {\n throw error;\n }\n }\n\n cancelRendering({ cancelExtraDelay = 0 } = {}) {\n if (this.renderTask) {\n this.renderTask.cancel(cancelExtraDelay);\n this.renderTask = null;\n }\n this.resume = null;\n }\n\n dispatchPageRender() {\n this.eventBus.dispatch(\"pagerender\", {\n source: this,\n pageNumber: this.id,\n });\n }\n\n dispatchPageRendered(cssTransform, isDetailView) {\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform,\n isDetailView,\n timestamp: performance.now(),\n error: this.#renderError,\n });\n }\n}\n\nexport { BasePDFPageView };\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 { DrawLayer } from \"pdfjs-lib\";\n\n/**\n * @typedef DrawLayerBuilderOptions\n * Configuration for {@linkcode DrawLayerBuilder}.\n * @property {number} pageIndex\n * Zero-based page index.\n * @property {Element | null} [textLayer]\n * Text layer element (optional).\n * @property {Object | null} [filterFactory]\n * Filter factory used to style selections (optional).\n * @property {Object | null} [pageColors]\n * Page foreground/background colors for HCM (optional).\n */\n\n/**\n * @typedef {Object} DrawLayerBuilderRenderOptions\n * @property {string} [intent] - The default value is \"display\".\n */\n\nclass DrawLayerBuilder {\n #drawLayer = null;\n\n /**\n * @param {DrawLayerBuilderOptions} options\n * Configuration.\n * @returns\n * Instance.\n */\n constructor(options) {\n this.pageIndex = options.pageIndex;\n this.textLayer = options.textLayer || null;\n this.filterFactory = options.filterFactory || null;\n this.pageColors = options.pageColors || null;\n }\n\n /**\n * @param {DrawLayerBuilderRenderOptions} options\n * @returns {Promise<void>}\n */\n async render({ intent = \"display\" }) {\n if (intent !== \"display\" || this.#drawLayer || this._cancelled) {\n return;\n }\n this.#drawLayer = new DrawLayer({\n pageIndex: this.pageIndex,\n textLayer: this.textLayer,\n filterFactory: this.filterFactory,\n pageColors: this.pageColors,\n });\n }\n\n cancel() {\n this._cancelled = true;\n\n this.#drawLayer?.destroy();\n this.#drawLayer = null;\n }\n\n setParent(parent) {\n this.#drawLayer?.setParent(parent);\n }\n\n getDrawLayer() {\n return this.#drawLayer;\n }\n}\n\nexport { DrawLayerBuilder };\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 { BasePDFPageView } from \"./base_pdf_page_view.js\";\nimport { OutputScale } from \"pdfjs-lib\";\nimport { RenderingStates } from \"./renderable_view.js\";\n\nclass PDFPageDetailView extends BasePDFPageView {\n #detailArea = null;\n\n /**\n * @type {boolean} True when the last rendering attempt of the view was\n * cancelled due to a `.reset()` call. This will happen when\n * the visible area changes so much during the rendering that\n * we need to cancel the rendering and start over.\n */\n renderingCancelled = false;\n\n constructor({ pageView }) {\n super(pageView);\n\n this.pageView = pageView;\n this.renderingId = \"detail\" + this.id;\n\n this.div = pageView.div;\n }\n\n setPdfPage(pdfPage) {\n this.pageView.setPdfPage(pdfPage);\n }\n\n get pdfPage() {\n return this.pageView.pdfPage;\n }\n\n get renderingState() {\n return super.renderingState;\n }\n\n set renderingState(state) {\n this.renderingCancelled = false;\n super.renderingState = state;\n }\n\n reset({ keepCanvas = false } = {}) {\n const renderingCancelled =\n this.renderingCancelled ||\n this.renderingState === RenderingStates.RUNNING ||\n this.renderingState === RenderingStates.PAUSED;\n this.cancelRendering();\n this.renderingState = RenderingStates.INITIAL;\n this.renderingCancelled = renderingCancelled;\n\n if (!keepCanvas) {\n this._resetCanvas();\n }\n }\n\n #shouldRenderDifferentArea(visibleArea) {\n if (!this.#detailArea) {\n return true;\n }\n\n const minDetailX = this.#detailArea.minX;\n const minDetailY = this.#detailArea.minY;\n const maxDetailX = this.#detailArea.width + minDetailX;\n const maxDetailY = this.#detailArea.height + minDetailY;\n\n if (\n visibleArea.minX < minDetailX ||\n visibleArea.minY < minDetailY ||\n visibleArea.maxX > maxDetailX ||\n visibleArea.maxY > maxDetailY\n ) {\n return true;\n }\n\n const {\n width: maxWidth,\n height: maxHeight,\n scale,\n } = this.pageView.viewport;\n\n if (this.#detailArea.scale !== scale) {\n return true;\n }\n\n const paddingLeftSize = visibleArea.minX - minDetailX;\n const paddingRightSize = maxDetailX - visibleArea.maxX;\n const paddingTopSize = visibleArea.minY - minDetailY;\n const paddingBottomSize = maxDetailY - visibleArea.maxY;\n\n // If the user is moving in any direction such that the remaining area\n // rendered outside of the screen is less than MOVEMENT_THRESHOLD of the\n // padding we render on each side, trigger a re-render. This is so that if\n // the user then keeps scrolling in that direction, we have a chance of\n // finishing rendering the new detail before they get past the rendered\n // area.\n\n const MOVEMENT_THRESHOLD = 0.5;\n const ratio = (1 + MOVEMENT_THRESHOLD) / MOVEMENT_THRESHOLD;\n\n if (\n (minDetailX > 0 && paddingRightSize / paddingLeftSize > ratio) ||\n (maxDetailX < maxWidth && paddingLeftSize / paddingRightSize > ratio) ||\n (minDetailY > 0 && paddingBottomSize / paddingTopSize > ratio) ||\n (maxDetailY < maxHeight && paddingTopSize / paddingBottomSize > ratio)\n ) {\n return true;\n }\n\n return false;\n }\n\n update({ visibleArea = null, underlyingViewUpdated = false } = {}) {\n if (underlyingViewUpdated) {\n this.cancelRendering();\n this.renderingState = RenderingStates.INITIAL;\n return;\n }\n\n if (!this.#shouldRenderDifferentArea(visibleArea)) {\n return;\n }\n\n const { viewport, maxCanvasPixels, capCanvasAreaFactor } = this.pageView;\n\n const visibleWidth = visibleArea.maxX - visibleArea.minX;\n const visibleHeight = visibleArea.maxY - visibleArea.minY;\n\n // \"overflowScale\" represents which percentage of the width and of the\n // height the detail area extends outside of the visible area. We want to\n // draw a larger area so that we don't have to constantly re-draw while\n // scrolling. The detail area's dimensions thus become\n // visibleLength * (2 * overflowScale + 1).\n // We default to adding a whole height/length of detail area on each side,\n // but we can reduce it to make sure that we stay within the maxCanvasPixels\n // limit.\n const visiblePixels =\n visibleWidth * visibleHeight * OutputScale.pixelRatio ** 2;\n const maxDetailToVisibleLinearRatio = Math.sqrt(\n OutputScale.capPixels(maxCanvasPixels, capCanvasAreaFactor) /\n visiblePixels\n );\n const maxOverflowScale = (maxDetailToVisibleLinearRatio - 1) / 2;\n let overflowScale = Math.min(1, maxOverflowScale);\n if (overflowScale < 0) {\n overflowScale = 0;\n // In this case, we render a detail view that is exactly as big as the\n // visible area, but we ignore the .maxCanvasPixels limit.\n // TODO: We should probably instead give up and not render the detail view\n // in this case. It's quite rare to hit it though, because usually\n // .maxCanvasPixels will at least have enough pixels to cover the visible\n // screen.\n }\n\n const overflowWidth = visibleWidth * overflowScale;\n const overflowHeight = visibleHeight * overflowScale;\n\n const minX = Math.max(0, visibleArea.minX - overflowWidth);\n const maxX = Math.min(viewport.width, visibleArea.maxX + overflowWidth);\n const minY = Math.max(0, visibleArea.minY - overflowHeight);\n const maxY = Math.min(viewport.height, visibleArea.maxY + overflowHeight);\n const width = maxX - minX;\n const height = maxY - minY;\n\n this.#detailArea = { minX, minY, width, height, scale: viewport.scale };\n\n this.reset({ keepCanvas: true });\n }\n\n _getRenderingContext(canvas, transform) {\n const baseContext = this.pageView._getRenderingContext(\n canvas,\n transform,\n false\n );\n const recordedBBoxes = this.pdfPage.recordedBBoxes;\n\n if (!recordedBBoxes || !this.enableOptimizedPartialRendering) {\n return baseContext;\n }\n\n const {\n viewport: { width: vWidth, height: vHeight },\n } = this.pageView;\n const {\n width: aWidth,\n height: aHeight,\n minX: aMinX,\n minY: aMinY,\n } = this.#detailArea;\n\n const detailMinX = aMinX / vWidth;\n const detailMinY = aMinY / vHeight;\n const detailMaxX = (aMinX + aWidth) / vWidth;\n const detailMaxY = (aMinY + aHeight) / vHeight;\n\n return {\n ...baseContext,\n operationsFilter(index) {\n if (recordedBBoxes.isEmpty(index)) {\n return false;\n }\n return (\n recordedBBoxes.minX(index) <= detailMaxX &&\n recordedBBoxes.maxX(index) >= detailMinX &&\n recordedBBoxes.minY(index) <= detailMaxY &&\n recordedBBoxes.maxY(index) >= detailMinY\n );\n },\n };\n }\n\n async draw() {\n // The PDFPageView might have already dropped this PDFPageDetailView. In\n // that case, simply do nothing.\n if (this.pageView.detailView !== this) {\n return undefined;\n }\n\n // If there is already the lower resolution canvas behind,\n // we don't show the new one until when it's fully ready.\n const hideUntilComplete =\n this.pageView.renderingState === RenderingStates.FINISHED ||\n this.renderingState === RenderingStates.FINISHED;\n\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, pdfPage, viewport } = this.pageView;\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 const canvasWrapper = this.pageView._ensureCanvasWrapper();\n\n const { canvas, prevCanvas } = this._createCanvas(newCanvas => {\n // If there is already the background canvas, inject this new canvas\n // after it. We cannot simply use .append because all canvases must\n // be before the SVG elements used for drawings.\n if (canvasWrapper.firstElementChild?.tagName === \"CANVAS\") {\n canvasWrapper.firstElementChild.after(newCanvas);\n } else {\n canvasWrapper.prepend(newCanvas);\n }\n }, hideUntilComplete);\n canvas.ariaHidden = true;\n if (this.enableOptimizedPartialRendering) {\n canvas.className = \"detailView\";\n }\n\n const { width, height } = viewport;\n\n const area = this.#detailArea;\n\n const { pixelRatio } = OutputScale;\n const transform = [\n pixelRatio,\n 0,\n 0,\n pixelRatio,\n -area.minX * pixelRatio,\n -area.minY * pixelRatio,\n ];\n\n canvas.width = area.width * pixelRatio;\n canvas.height = area.height * pixelRatio;\n const { style } = canvas;\n style.width = `${(area.width * 100) / width}%`;\n style.height = `${(area.height * 100) / height}%`;\n style.top = `${(area.minY * 100) / height}%`;\n style.left = `${(area.minX * 100) / width}%`;\n\n const renderingPromise = this._drawCanvas(\n this._getRenderingContext(canvas, transform),\n () => {\n // If the rendering is cancelled, keep the old canvas visible.\n this.canvas?.remove();\n this.canvas = prevCanvas;\n },\n () => {\n this.pageView._refreshAnnotationLayer();\n this.dispatchPageRendered(\n /* cssTransform */ false,\n /* isDetailView */ true\n );\n }\n );\n\n div.setAttribute(\"data-loaded\", true);\n\n this.dispatchPageRender();\n\n return renderingPromise;\n }\n}\n\nexport { PDFPageDetailView };\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\nimport { FeatureTest, makeMap, shadow } from \"pdfjs-lib\";\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: \"rowgroup\",\n TBody: \"rowgroup\",\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 MathMLElements = new Set([\n \"math\",\n \"merror\",\n \"mfrac\",\n \"mi\",\n \"mmultiscripts\",\n \"mn\",\n \"mo\",\n \"mover\",\n \"mpadded\",\n \"mprescripts\",\n \"mroot\",\n \"mrow\",\n \"ms\",\n \"mspace\",\n \"msqrt\",\n \"mstyle\",\n \"msub\",\n \"msubsup\",\n \"msup\",\n \"mtable\",\n \"mtd\",\n \"mtext\",\n \"mtr\",\n \"munder\",\n \"munderover\",\n \"semantics\",\n]);\nconst MathMLNamespace = \"http://www.w3.org/1998/Math/MathML\";\n\nclass MathMLSanitizer {\n static get sanitizer() {\n // From https://w3c.github.io/mathml-docs/mathml-safe-list.\n\n return shadow(\n this,\n \"sanitizer\",\n FeatureTest.isSanitizerSupported\n ? new Sanitizer({\n elements: Array.from(MathMLElements.keys(), name => ({\n name,\n namespace: MathMLNamespace,\n })),\n replaceWithChildrenElements: [\n {\n name: \"maction\",\n namespace: MathMLNamespace,\n },\n ],\n attributes: [\n \"dir\",\n \"displaystyle\",\n \"mathbackground\",\n \"mathcolor\",\n \"mathsize\",\n \"scriptlevel\",\n \"encoding\",\n \"display\",\n \"linethickness\",\n \"intent\",\n \"arg\",\n \"form\",\n \"fence\",\n \"separator\",\n \"lspace\",\n \"rspace\",\n \"stretchy\",\n \"symmetric\",\n \"maxsize\",\n \"minsize\",\n \"largeop\",\n \"movablelimits\",\n \"width\",\n \"height\",\n \"depth\",\n \"voffset\",\n \"accent\",\n \"accentunder\",\n \"columnspan\",\n \"rowspan\",\n ],\n comments: false,\n })\n : null\n );\n }\n}\n\nconst HEADING_PATTERN = /^H(\\d+)$/;\n\n/**\n * @typedef {Object} StructTreeLayerBuilderOptions\n * @property {PDFPageProxy} pdfPage\n * @property {Object} rawDims\n */\n\nclass StructTreeLayerBuilder {\n #promise;\n\n #treeDom = null;\n\n #treePromise;\n\n #elementAttributes = new Map();\n\n #rawDims;\n\n #elementsToAddToTextLayer = null;\n\n #elementsToHideInTextLayer = null;\n\n #elementsToStealFromTextLayer = null;\n\n /**\n * @param {StructTreeLayerBuilderOptions} options\n */\n constructor(pdfPage, rawDims) {\n this.#promise = pdfPage.getStructTree();\n this.#rawDims = rawDims;\n }\n\n /**\n * @returns {Promise<void>}\n */\n async render() {\n if (this.#treePromise) {\n return this.#treePromise;\n }\n const { promise, resolve, reject } = Promise.withResolvers();\n this.#treePromise = promise;\n\n try {\n this.#treeDom = this.#walk(await this.#promise);\n } catch (ex) {\n reject(ex);\n }\n this.#promise = null;\n\n this.#treeDom?.classList.add(\"structTree\");\n resolve(this.#treeDom);\n\n return promise;\n }\n\n async getAriaAttributes(annotationId) {\n try {\n await this.render();\n return this.#elementAttributes.get(annotationId);\n } catch {\n // If the structTree cannot be fetched, parsed, and/or rendered,\n // ensure that e.g. the AnnotationLayer won't break completely.\n }\n return null;\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 // Don't add the label in the struct tree layer but on the annotation\n // in the annotation layer.\n let added = false;\n const label = removeNullCharacters(alt);\n for (const child of structElement.children) {\n if (child.type === \"annotation\") {\n this.#elementAttributes\n .getOrInsertComputed(child.id, makeMap)\n .set(\"aria-label\", label);\n added = true;\n }\n }\n if (!added) {\n htmlElement.setAttribute(\"aria-label\", label);\n }\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 #addImageInTextLayer(node, element) {\n const { alt, bbox, children } = node;\n const child = children?.[0];\n if (!this.#rawDims || !alt || !bbox || child?.type !== \"content\") {\n return false;\n }\n\n const { id } = child;\n if (!id) {\n return false;\n }\n\n // We cannot add the created element to the text layer immediately, as the\n // text layer might not be ready yet. Instead, we store the element and add\n // it later in `addElementsToTextLayer`.\n\n element.setAttribute(\"aria-owns\", id);\n const img = document.createElement(\"span\");\n (this.#elementsToAddToTextLayer ||= new Map()).set(id, img);\n img.setAttribute(\"role\", \"img\");\n img.setAttribute(\"aria-label\", removeNullCharacters(alt));\n\n const { pageHeight, pageX, pageY } = this.#rawDims;\n const calc = \"calc(var(--total-scale-factor) *\";\n const { style } = img;\n style.width = `${calc}${bbox[2] - bbox[0]}px)`;\n style.height = `${calc}${bbox[3] - bbox[1]}px)`;\n style.left = `${calc}${bbox[0] - pageX}px)`;\n style.top = `${calc}${pageHeight - bbox[3] + pageY}px)`;\n\n return true;\n }\n\n updateTextLayer() {\n if (this.#elementsToAddToTextLayer) {\n for (const [id, img] of this.#elementsToAddToTextLayer) {\n document.getElementById(id)?.append(img);\n }\n this.#elementsToAddToTextLayer.clear();\n this.#elementsToAddToTextLayer = null;\n }\n if (this.#elementsToHideInTextLayer) {\n for (const id of this.#elementsToHideInTextLayer) {\n const elem = document.getElementById(id);\n if (elem) {\n elem.ariaHidden = true;\n }\n }\n this.#elementsToHideInTextLayer.length = 0;\n this.#elementsToHideInTextLayer = null;\n }\n if (this.#elementsToStealFromTextLayer) {\n for (\n let i = 0, ii = this.#elementsToStealFromTextLayer.length;\n i < ii;\n i += 2\n ) {\n const element = this.#elementsToStealFromTextLayer[i];\n const ids = this.#elementsToStealFromTextLayer[i + 1];\n let textContent = \"\";\n for (const id of ids) {\n const elem = document.getElementById(id);\n if (elem) {\n textContent += elem.textContent.trim() || \"\";\n // Aria-hide the element in order to avoid duplicate reading of the\n // math content by screen readers.\n elem.ariaHidden = \"true\";\n }\n }\n if (textContent) {\n element.textContent = textContent;\n }\n }\n this.#elementsToStealFromTextLayer.length = 0;\n this.#elementsToStealFromTextLayer = null;\n }\n }\n\n #collectIds(node, ids) {\n if (!node) {\n return;\n }\n if (\"id\" in node) {\n ids.push(node.id);\n }\n for (const kid of node.children || []) {\n this.#collectIds(kid, ids);\n }\n }\n\n #walk(node, parentNodes = []) {\n if (!node) {\n return null;\n }\n\n let element;\n let visitChildren = true;\n if (\"role\" in node) {\n const { role } = node;\n if (MathMLElements.has(role)) {\n element = document.createElementNS(MathMLNamespace, role);\n const ids = [];\n (this.#elementsToStealFromTextLayer ||= []).push(element, ids);\n for (const { type, id } of node.children || []) {\n if (type === \"content\" && id) {\n ids.push(id);\n }\n }\n } else {\n element = document.createElement(\"span\");\n }\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(\n \"role\",\n role === \"TH\" &&\n parentNodes.at(-1)?.role === \"TR\" &&\n parentNodes.at(-2)?.role === \"TBody\"\n ? \"rowheader\" // TH inside TR itself in TBody is a rowheader.\n : PDF_ROLE_TO_HTML_ROLE[role]\n );\n }\n if (role === \"Figure\" && this.#addImageInTextLayer(node, element)) {\n return element;\n }\n if (role === \"Formula\") {\n if (node.mathML && MathMLSanitizer.sanitizer) {\n visitChildren = false;\n element.setHTML(node.mathML, {\n sanitizer: MathMLSanitizer.sanitizer,\n });\n // Hide all the corresponding content elements in the text layer in\n // order to avoid screen readers reading both the MathML and the\n // text content.\n this.#collectIds(node, (this.#elementsToHideInTextLayer ||= []));\n // For now, we don't want to keep the alt text if there's valid\n // MathML (see https://github.com/w3c/mathml-aam/issues/37).\n // TODO: Revisit this decision in the future.\n delete node.alt;\n }\n if (\n !node.mathML &&\n node.children.length === 1 &&\n node.children[0].role !== \"math\"\n ) {\n element = document.createElementNS(MathMLNamespace, \"math\");\n delete node.alt;\n }\n }\n }\n\n element ||= document.createElement(\"span\");\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 if (visitChildren) {\n parentNodes.push(node);\n for (const kid of node.children) {\n element.append(this.#walk(kid, parentNodes));\n }\n parentNodes.pop();\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?.length) {\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?.length) {\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 index = binarySearchFirstItem(\n children,\n node =>\n TextAccessibilityManager.#compareElementPositions(element, node) < 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\nimport { internalOpt } from \"./internal_evt.js\";\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 #eventAC = null;\n\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.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\n if (!this.#eventAC) {\n this.#eventAC = new AbortController();\n\n this.eventBus.on(\n \"updatetextlayermatches\",\n evt => {\n if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {\n this._updateMatches();\n }\n },\n { signal: this.#eventAC.signal, ...internalOpt }\n );\n }\n this._updateMatches();\n }\n\n disable() {\n if (!this.enabled) {\n return;\n }\n this.enabled = false;\n\n this.#eventAC?.abort();\n this.#eventAC = 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\n if (className.includes(\"selected\")) {\n return span;\n }\n return null;\n }\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 selectedSpan = null;\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 selectedSpan = appendTextToDiv(\n begin.divIdx,\n begin.offset,\n end.offset,\n \"highlight\" + highlightSuffix\n );\n } else {\n selectedSpan = 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: selectedSpan,\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/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/page_viewport\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/text_layer_images.js\").TextLayerImages} TextLayerImages */\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, stopEvent, TextLayer } from \"pdfjs-lib\";\nimport { removeNullCharacters } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} TextLayerBuilderOptions\n * @property {PDFPageProxy} pdfPage\n * @property {TextHighlighter} [highlighter] - Optional object that will handle\n * highlighting text from the find controller.\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {boolean} [enablePermissions]\n * @property {function} [onAppend]\n * @property {AbortSignal} [abortSignal]\n */\n\n/**\n * @typedef {Object} TextLayerBuilderRenderOptions\n * @property {PageViewport} viewport\n * @property {TextLayerImages} images\n * @property {Object} [textContentParams]\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 #abortSignal = null;\n\n #enablePermissions = false;\n\n #onAppend = null;\n\n #renderingDone = false;\n\n #textLayer = null;\n\n static #textLayers = new Map();\n\n static #selectionChangeAC = null;\n\n /**\n * @param {TextLayerBuilderOptions} options\n */\n constructor({\n pdfPage,\n highlighter = null,\n accessibilityManager = null,\n enablePermissions = false,\n onAppend = null,\n abortSignal = null,\n }) {\n this.pdfPage = pdfPage;\n this.highlighter = highlighter;\n this.accessibilityManager = accessibilityManager;\n this.#enablePermissions = enablePermissions === true;\n this.#onAppend = onAppend;\n this.#abortSignal = abortSignal;\n\n this.div = document.createElement(\"div\");\n this.div.tabIndex = 0;\n this.div.className = \"textLayer\";\n }\n\n /**\n * Renders the text layer.\n * @param {TextLayerBuilderRenderOptions} options\n * @returns {Promise<void>}\n */\n async render({ viewport, images, textContentParams = null }) {\n if (this.#renderingDone && this.#textLayer) {\n this.#textLayer.update({\n viewport,\n onBefore: this.hide.bind(this),\n });\n this.show();\n return;\n }\n\n this.cancel();\n this.#textLayer = new TextLayer({\n textContentSource: this.pdfPage.streamTextContent(\n textContentParams || {\n includeMarkedContent: true,\n disableNormalization: true,\n }\n ),\n images,\n container: this.div,\n viewport,\n });\n\n const { textDivs, textContentItemsStr } = this.#textLayer;\n this.highlighter?.setTextMapping(textDivs, textContentItemsStr);\n this.accessibilityManager?.setTextMapping(textDivs);\n\n await this.#textLayer.render();\n this.#renderingDone = true;\n\n const endOfContent = document.createElement(\"div\");\n endOfContent.className = \"endOfContent\";\n this.div.append(endOfContent);\n\n this.#bindMouse(endOfContent);\n // Ensure that the textLayer is appended to the DOM *before* handling\n // e.g. a pending search operation.\n this.#onAppend?.(this.div);\n this.highlighter?.enable();\n this.accessibilityManager?.enable();\n }\n\n hide() {\n if (!this.div.hidden && this.#renderingDone) {\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 this.#textLayer?.cancel();\n this.#textLayer = null;\n this.#renderingDone = false;\n this.div.replaceChildren();\n\n this.highlighter?.disable();\n this.accessibilityManager?.disable();\n TextLayerBuilder.#removeGlobalSelectionListener(this.div);\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(end) {\n const { div } = this;\n const abortSignal = this.#abortSignal;\n const opts = abortSignal ? { signal: abortSignal } : null;\n\n div.addEventListener(\n \"mousedown\",\n () => {\n div.classList.add(\"selecting\");\n },\n opts\n );\n\n div.addEventListener(\n \"copy\",\n 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 stopEvent(event);\n },\n opts\n );\n\n TextLayerBuilder.#textLayers.set(div, end);\n TextLayerBuilder.#enableGlobalSelectionListener(abortSignal);\n }\n\n static #removeGlobalSelectionListener(textLayerDiv) {\n this.#textLayers.delete(textLayerDiv);\n\n if (this.#textLayers.size === 0) {\n this.#selectionChangeAC?.abort();\n this.#selectionChangeAC = null;\n }\n }\n\n static #enableGlobalSelectionListener(globalAbortSignal) {\n if (this.#selectionChangeAC) {\n // document-level event listeners already installed\n return;\n }\n this.#selectionChangeAC = new AbortController();\n const signal = globalAbortSignal\n ? AbortSignal.any([this.#selectionChangeAC.signal, globalAbortSignal])\n : this.#selectionChangeAC.signal;\n\n const reset = (end, textLayer) => {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n textLayer.append(end);\n end.style.width = \"\";\n end.style.height = \"\";\n }\n textLayer.classList.remove(\"selecting\");\n };\n\n let isPointerDown = false;\n document.addEventListener(\n \"pointerdown\",\n () => {\n isPointerDown = true;\n },\n { signal }\n );\n document.addEventListener(\n \"pointerup\",\n () => {\n isPointerDown = false;\n this.#textLayers.forEach(reset);\n },\n { signal }\n );\n window.addEventListener(\n \"blur\",\n () => {\n isPointerDown = false;\n this.#textLayers.forEach(reset);\n },\n { signal }\n );\n document.addEventListener(\n \"keyup\",\n () => {\n if (!isPointerDown) {\n this.#textLayers.forEach(reset);\n }\n },\n { signal }\n );\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n // eslint-disable-next-line no-var\n var isFirefoxOrModernChromium, prevRange;\n }\n\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = document.getSelection();\n if (selection.rangeCount === 0) {\n this.#textLayers.forEach(reset);\n return;\n }\n\n // Even though the spec says that .rangeCount should be 0 or 1, Firefox\n // creates multiple ranges when selecting across multiple pages.\n // Make sure to collect all the .textLayer elements where the selection\n // is happening.\n const activeTextLayers = new Set();\n for (let i = 0; i < selection.rangeCount; i++) {\n const range = selection.getRangeAt(i);\n for (const textLayerDiv of this.#textLayers.keys()) {\n if (\n !activeTextLayers.has(textLayerDiv) &&\n range.intersectsNode(textLayerDiv)\n ) {\n activeTextLayers.add(textLayerDiv);\n }\n }\n }\n\n for (const [textLayerDiv, endDiv] of this.#textLayers) {\n if (activeTextLayers.has(textLayerDiv)) {\n textLayerDiv.classList.add(\"selecting\");\n } else {\n reset(endDiv, textLayerDiv);\n }\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return;\n }\n if (isFirefoxOrModernChromium === undefined) {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) {\n isFirefoxOrModernChromium =\n getComputedStyle(\n this.#textLayers.values().next().value\n ).getPropertyValue(\"-moz-user-select\") === \"none\";\n }\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\")) ||\n !isFirefoxOrModernChromium\n ) {\n // navigator.userAgentData is only available in secure contexts\n const chromiumVersion = navigator.userAgentData\n ? navigator.userAgentData.brands.find(\n ({ brand }) => brand === \"Chromium\"\n )?.version\n : /\\bChrome\\/(\\d+)\\b/.exec(navigator.userAgent)?.[1];\n\n isFirefoxOrModernChromium =\n !!chromiumVersion && parseInt(chromiumVersion, 10) >= 148;\n }\n }\n if (isFirefoxOrModernChromium) {\n return;\n }\n\n // In browsers other than Firefox or Chromium 148+, when hovering over\n // an empty space (thus, on .endOfContent), the selection will expand to\n // cover all the text between the current selection and .endOfContent.\n // By moving .endOfContent to right after (or before, depending on which\n // side of the selection the user is moving), we limit the selection\n // jump to at most cover the entirety of the <span> where the selection\n // is being modified.\n const range = selection.getRangeAt(0);\n const modifyStart =\n prevRange &&\n (range.compareBoundaryPoints(Range.END_TO_END, prevRange) === 0 ||\n range.compareBoundaryPoints(Range.START_TO_END, prevRange) === 0);\n let anchor = modifyStart ? range.startContainer : range.endContainer;\n if (anchor.nodeType === Node.TEXT_NODE) {\n anchor = anchor.parentNode;\n }\n if (anchor.classList?.contains(\"highlight\")) {\n anchor = anchor.parentNode;\n }\n if (!modifyStart && range.endOffset === 0) {\n do {\n while (!anchor.previousSibling) {\n anchor = anchor.parentNode;\n }\n anchor = anchor.previousSibling;\n } while (!anchor.childNodes.length);\n }\n\n const parentTextLayer = anchor.parentElement?.closest(\".textLayer\");\n const endDiv = this.#textLayers.get(parentTextLayer);\n if (endDiv) {\n endDiv.style.width = parentTextLayer.style.width;\n endDiv.style.height = parentTextLayer.style.height;\n endDiv.style.userSelect = \"text\";\n anchor.parentElement.insertBefore(\n endDiv,\n modifyStart ? anchor : anchor.nextSibling\n );\n }\n\n prevRange = range.cloneRange();\n },\n { signal }\n );\n }\n}\n\nexport { TextLayerBuilder };\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/page_viewport\").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// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n/** @typedef {import(\"./comment_manager.js\").CommentManager} CommentManager */\n/** @typedef {import(\"./l10n.js\").L10n} L10n */\n\nimport {\n AbortException,\n AnnotationMode,\n OutputScale,\n PixelsPerInch,\n setLayerDimensions,\n shadow,\n TextLayerImages,\n} from \"pdfjs-lib\";\nimport {\n approximateFraction,\n calcRound,\n DEFAULT_SCALE,\n floorToDivide,\n TextLayerMode,\n} from \"./ui_utils.js\";\nimport { AnnotationEditorLayerBuilder } from \"./annotation_editor_layer_builder.js\";\nimport { AnnotationLayerBuilder } from \"./annotation_layer_builder.js\";\nimport { AppOptions } from \"./app_options.js\";\nimport { Autolinker } from \"./autolinker.js\";\nimport { BasePDFPageView } from \"./base_pdf_page_view.js\";\nimport { DrawLayerBuilder } from \"./draw_layer_builder.js\";\nimport { GenericL10n } from \"web-null_l10n\";\nimport { PDFPageDetailView } from \"./pdf_page_detail_view.js\";\nimport { RenderingStates } from \"./renderable_view.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 {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 * 8192 (32 mega-pixels).\n * @property {number} [maxCanvasDim] - The maximum supported canvas dimension,\n * in either width or height. Use `-1` for no limit.\n * The default value is 32767.\n * @property {number} [capCanvasAreaFactor] - Cap the canvas area to the\n * viewport increased by the value in percent. Use `-1` for no limit.\n * The default value is 200%.\n * @property {boolean} [enableDetailCanvas] - When enabled, if the rendered\n * pages would need a canvas that is larger than `maxCanvasPixels` or\n * `maxCanvasDim`, it will draw a second canvas on top of the CSS-zoomed one,\n * that only renders the part of the page that is close to the viewport.\n * The default value is `true`.\n * @property {number} [imagesRightClickMinSize] - All images whose width and\n * height are at least this value (in pixels) will be lazily inserted in the\n * dom to allow right-clicking and saving them. Use `-1` to disable this.\n * @property {boolean} [enableSelectionRendering] - When enabled, renders text\n * selections in the draw layer.\n * The default value is `true`.\n * @property {boolean} [enableOptimizedPartialRendering] - When enabled, PDF\n * rendering will keep track of which areas of the page each PDF operation\n * affects. Then, when rendering a partial page (if `enableDetailCanvas` is\n * enabled), it will only run through the operations that affect that portion.\n * 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 * @property {L10n} [l10n] - Localization service.\n * @property {Object} [layerProperties] - The object that is used to lookup\n * the necessary layer-properties.\n * @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from\n * text that look like URLs. The default value is `true`.\n * @property {CommentManager} [commentManager] - The comment manager instance.\n * to.\n * @property {AbortSignal} [abortSignal]\n */\n\nconst DEFAULT_LAYER_PROPERTIES =\n typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"COMPONENTS\")\n ? null\n : {\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\nconst LAYERS_ORDER = new Map([\n [\"canvasWrapper\", 0],\n [\"textLayer\", 1],\n [\"annotationLayer\", 2],\n [\"annotationEditorLayer\", 3],\n [\"xfaLayer\", 3],\n]);\n\nclass PDFPageView extends BasePDFPageView {\n #abortSignal = null;\n\n #annotationMode = AnnotationMode.ENABLE_FORMS;\n\n #canvasWrapper = null;\n\n #commentManager = null;\n\n #enableAutoLinking = true;\n\n #hasRestrictedScaling = false;\n\n #isEditing = false;\n\n #layerProperties = null;\n\n #needsRestrictedScaling = false;\n\n #originalViewport = null;\n\n #previousRotation = null;\n\n #scaleRoundX = 1;\n\n #scaleRoundY = 1;\n\n #textLayerMode = TextLayerMode.ENABLE;\n\n #userUnit = 1;\n\n #useThumbnailCanvas = {\n directDrawing: true,\n initialOptionalContent: true,\n regularAnnotations: true,\n };\n\n #layers = [null, null, null, null];\n\n /**\n * @param {PDFPageViewOptions} options\n */\n constructor(options) {\n super(options);\n\n const { container, defaultViewport } = options;\n\n this.renderingId = \"page\" + this.id;\n this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES;\n this.#abortSignal = options.abortSignal || null;\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.enableDetailCanvas = options.enableDetailCanvas ?? true;\n this.maxCanvasPixels =\n options.maxCanvasPixels ?? AppOptions.get(\"maxCanvasPixels\");\n this.maxCanvasDim = options.maxCanvasDim || AppOptions.get(\"maxCanvasDim\");\n this.capCanvasAreaFactor =\n options.capCanvasAreaFactor ?? AppOptions.get(\"capCanvasAreaFactor\");\n this.#enableAutoLinking = options.enableAutoLinking !== false;\n this.#commentManager = options.commentManager || null;\n\n this.l10n = options.l10n;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.l10n ||= new GenericL10n();\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this._isStandalone = !this.renderingQueue?.hasViewer();\n this._container = container;\n }\n\n this._annotationCanvasMap = null;\n\n this.annotationLayer = null;\n this.annotationEditorLayer = null;\n this.textLayer = null;\n this.xfaLayer = null;\n this.structTreeLayer = null;\n this.drawLayer = null;\n\n this.detailView = 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 div.setAttribute(\"data-l10n-id\", \"pdfjs-page-landmark\");\n div.setAttribute(\"data-l10n-args\", JSON.stringify({ page: this.id }));\n this.div = div;\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 if (this.pageColors?.background) {\n container?.style.setProperty(\n \"--page-bg-color\",\n this.pageColors.background\n );\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 // Ensure that Fluent is connected in e.g. the COMPONENTS build.\n if (!options.l10n) {\n this.l10n.translate(this.div);\n }\n }\n }\n\n clone(id) {\n const clone = new PDFPageView({\n container: null,\n eventBus: this.eventBus,\n pagesColors: this.pageColors,\n renderingQueue: this.renderingQueue,\n enableOptimizedPartialRendering: this.enableOptimizedPartialRendering,\n minDurationToUpdateCanvas: this.minDurationToUpdateCanvas,\n defaultViewport: this.viewport,\n id,\n layerProperties: this.#layerProperties,\n abortSignal: this.#abortSignal,\n scale: this.scale,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n textLayerMode: this.#textLayerMode,\n annotationMode: this.#annotationMode,\n imageResourcesPath: this.imageResourcesPath,\n enableDetailCanvas: this.enableDetailCanvas,\n maxCanvasPixels: this.maxCanvasPixels,\n maxCanvasDim: this.maxCanvasDim,\n capCanvasAreaFactor: this.capCanvasAreaFactor,\n enableAutoLinking: this.#enableAutoLinking,\n commentManager: this.#commentManager,\n l10n: this.l10n,\n });\n clone.setPdfPage(this.pdfPage.clone(id - 1));\n return clone;\n }\n\n #addLayer(div, name) {\n const pos = LAYERS_ORDER.get(name);\n const oldDiv = this.#layers[pos];\n this.#layers[pos] = div;\n if (oldDiv) {\n oldDiv.replaceWith(div);\n return;\n }\n for (let i = pos - 1; i >= 0; i--) {\n const layer = this.#layers[i];\n if (layer) {\n layer.after(div);\n return;\n }\n }\n this.div.prepend(div);\n }\n\n #setDimensions() {\n const { div, viewport } = this;\n\n if (viewport.userUnit !== this.#userUnit) {\n if (viewport.userUnit !== 1) {\n div.style.setProperty(\"--user-unit\", viewport.userUnit);\n } else {\n div.style.removeProperty(\"--user-unit\");\n }\n this.#userUnit = viewport.userUnit;\n }\n if (this.pdfPage) {\n if (this.#previousRotation === viewport.rotation) {\n return;\n }\n this.#previousRotation = viewport.rotation;\n }\n\n setLayerDimensions(\n div,\n viewport,\n /* mustFlip = */ true,\n /* mustRotate = */ false\n );\n }\n\n updatePageNumber(newPageNumber) {\n const oldPageNumber = this.id;\n\n if (oldPageNumber !== newPageNumber) {\n this.id = newPageNumber;\n this.renderingId = `page${newPageNumber}`;\n if (this.pdfPage) {\n this.pdfPage.pageNumber = newPageNumber;\n }\n // TODO: do we set the page label ?\n this.setPageLabel(this.pageLabel);\n const { div } = this;\n div.setAttribute(\"data-page-number\", newPageNumber);\n div.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ page: newPageNumber })\n );\n this._textHighlighter.pageIdx = newPageNumber - 1;\n }\n // Don't update the page index for the draw layer, since it's just used as\n // an identifier.\n\n // Page mutations clear the editor layer map; restore unchanged pages too.\n this.#layerProperties.annotationEditorUIManager?.updatePageIndex(\n oldPageNumber - 1,\n newPageNumber - 1\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-highlight-filter\",\n pdfPage.filterFactory.addHighlightHCMFilter(\n \"highlight\",\n \"CanvasText\",\n \"Canvas\",\n \"HighlightText\",\n \"Highlight\"\n )\n );\n this._container?.style.setProperty(\n \"--hcm-highlight-selected-filter\",\n pdfPage.filterFactory.addHighlightHCMFilter(\n \"highlight_selected\",\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 deleteMe(isCut) {\n if (isCut) {\n this.div.remove();\n return;\n }\n this.destroy();\n this.#layerProperties.annotationEditorUIManager?.deletePage(this.id);\n }\n\n hasEditableAnnotations() {\n return !!this.annotationLayer?.hasEditableAnnotations();\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 #dispatchLayerRendered(name, error) {\n this.eventBus.dispatch(name, {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n\n async #renderAnnotationLayer(textLayerPromise = null) {\n const { annotationLayer, textLayer } = this;\n\n let error = null;\n try {\n await this.annotationLayer.render({\n viewport: this.viewport,\n intent: \"display\",\n structTreeLayer: this.structTreeLayer,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n });\n } catch (ex) {\n console.error(\"#renderAnnotationLayer:\", ex);\n error = ex;\n } finally {\n this.#dispatchLayerRendered(\"annotationlayerrendered\", error);\n }\n\n if (this.#enableAutoLinking && textLayerPromise) {\n this.#injectLinkAnnotations(textLayerPromise, annotationLayer, textLayer);\n }\n }\n\n // The detail view re-renders checkbox/radio appearances at a higher\n // resolution into the shared `annotationCanvasMap`; move them into the\n // annotation layer so they replace the lower-resolution ones. This only\n // consumes pending canvases (no re-render), and is a no-op until their\n // elements exist, so it's safe to call while the layer is still rendering.\n _refreshAnnotationLayer() {\n if (this._annotationCanvasMap?.size) {\n this.annotationLayer?.refreshCanvases();\n }\n }\n\n async #renderAnnotationEditorLayer() {\n let error = null;\n try {\n await this.annotationEditorLayer.render({\n viewport: this.viewport,\n intent: \"display\",\n });\n } catch (ex) {\n console.error(\"#renderAnnotationEditorLayer:\", ex);\n error = ex;\n } finally {\n this.#dispatchLayerRendered(\"annotationeditorlayerrendered\", error);\n }\n }\n\n async #renderDrawLayer() {\n try {\n await this.drawLayer.render({\n intent: \"display\",\n });\n } catch (ex) {\n console.error(\"#renderDrawLayer:\", ex);\n }\n }\n\n async #renderXfaLayer() {\n let error = null;\n try {\n const result = await this.xfaLayer.render({\n viewport: this.viewport,\n intent: \"display\",\n });\n if (result?.textDivs && this._textHighlighter) {\n // Given that the following method fetches the text asynchronously we\n // can invoke it *before* appending the xfaLayer to the DOM (below),\n // since a pending search-highlight/scroll operation thus won't run\n // until after the xfaLayer is available in the viewer.\n this.#buildXfaTextContentItems(result.textDivs);\n }\n } catch (ex) {\n console.error(\"#renderXfaLayer:\", ex);\n error = ex;\n } finally {\n if (this.xfaLayer?.div) {\n // Pause translation when inserting the xfaLayer in the DOM.\n this.l10n.pause();\n this.#addLayer(this.xfaLayer.div, \"xfaLayer\");\n this.l10n.resume();\n }\n this.#dispatchLayerRendered(\"xfalayerrendered\", error);\n }\n }\n\n async #renderTextLayer() {\n let error = null;\n try {\n await this.textLayer.render({\n viewport: this.viewport,\n images: this.imageCoordinates\n ? new TextLayerImages(\n this.imagesRightClickMinSize,\n this.imageCoordinates,\n this.viewport,\n () => this.canvas\n )\n : null,\n });\n } catch (ex) {\n if (ex instanceof AbortException) {\n return;\n }\n console.error(\"#renderTextLayer:\", ex);\n error = ex;\n }\n this.#dispatchLayerRendered(\"textlayerrendered\", error);\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 const treeDom = await this.structTreeLayer?.render();\n if (treeDom) {\n this.l10n.pause();\n this.structTreeLayer?.updateTextLayer();\n if (this.canvas && treeDom.parentNode !== this.canvas) {\n // Pause translation when inserting the structTree in the DOM.\n this.canvas.append(treeDom);\n }\n this.l10n.resume();\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 async #injectLinkAnnotations(textLayerPromise, annotationLayer, textLayer) {\n let error = null;\n try {\n await textLayerPromise;\n\n if (\n annotationLayer !== this.annotationLayer ||\n textLayer !== this.textLayer\n ) {\n return; // Rendering was cancelled while the textLayerPromise resolved.\n }\n await annotationLayer.injectLinkAnnotations(\n Autolinker.processLinks(this)\n );\n } catch (ex) {\n console.error(\"#injectLinkAnnotations:\", ex);\n error = ex;\n }\n this.#dispatchLayerRendered(\"linkannotationsadded\", error);\n }\n\n _resetCanvas() {\n super._resetCanvas();\n this.#originalViewport = null;\n }\n\n reset({\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false,\n keepTextLayer = false,\n keepCanvasWrapper = false,\n preserveDetailViewState = false,\n } = {}) {\n const keepPdfBugGroups = this.pdfPage?._pdfBug ?? 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 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 canvasWrapperNode = (keepCanvasWrapper && this.#canvasWrapper) || null;\n for (let i = childNodes.length - 1; i >= 0; i--) {\n const node = childNodes[i];\n switch (node) {\n case annotationLayerNode:\n case annotationEditorLayerNode:\n case xfaLayerNode:\n case textLayerNode:\n case canvasWrapperNode:\n continue;\n }\n if (keepPdfBugGroups && node.classList.contains(\"pdfBugGroupsLayer\")) {\n continue;\n }\n node.remove();\n const layerIndex = this.#layers.indexOf(node);\n if (layerIndex >= 0) {\n this.#layers[layerIndex] = null;\n }\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 (!keepCanvasWrapper && this.#canvasWrapper) {\n this.#canvasWrapper = null;\n this._resetCanvas();\n }\n\n if (!preserveDetailViewState) {\n this.detailView?.reset({ keepCanvas: keepCanvasWrapper });\n\n // If we are keeping the canvas around we must also keep the `detailView`\n // object, so that next time we need a detail view we'll update the\n // existing canvas rather than creating a new one.\n if (!keepCanvasWrapper) {\n this.detailView = null;\n }\n }\n }\n\n toggleEditingMode(isEditing) {\n // The page can be invisible, consequently there's no annotation layer and\n // we can't know if there are editable annotations.\n // So to avoid any issue when the page is rendered the #isEditing flag must\n // be set.\n this.#isEditing = isEditing;\n if (!this.hasEditableAnnotations()) {\n return;\n }\n this.reset({\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true,\n keepTextLayer: true,\n keepCanvasWrapper: true,\n });\n }\n\n updateVisibleArea(visibleArea) {\n if (this.enableDetailCanvas) {\n if (\n this.#needsRestrictedScaling &&\n this.maxCanvasPixels > 0 &&\n visibleArea\n ) {\n this.detailView ??= new PDFPageDetailView({\n pageView: this,\n enableOptimizedPartialRendering: this.enableOptimizedPartialRendering,\n imagesRightClickMinSize: -1,\n });\n this.detailView.update({ visibleArea });\n } else if (this.detailView) {\n this.detailView.reset();\n this.detailView = null;\n }\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 this.#computeScale();\n\n if (this.canvas) {\n const onlyCssZoom =\n this.#hasRestrictedScaling && this.#needsRestrictedScaling;\n const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;\n\n if (postponeDrawing || onlyCssZoom) {\n if (\n postponeDrawing &&\n !onlyCssZoom &&\n this.renderingState !== RenderingStates.FINISHED\n ) {\n this.cancelRendering({\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 redrawAnnotationLayer: true,\n redrawAnnotationEditorLayer: true,\n redrawXfaLayer: true,\n redrawTextLayer: !postponeDrawing,\n hideTextLayer: postponeDrawing,\n });\n\n // The \"pagerendered\"-event will be dispatched once the actual\n // rendering is done, hence don't dispatch it here as well.\n if (!postponeDrawing) {\n this.detailView?.update({ underlyingViewUpdated: true });\n\n this.dispatchPageRendered(\n /* cssTransform */ true,\n /* isDetailView */ false\n );\n }\n return;\n }\n }\n this.cssTransform({});\n this.reset({\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true,\n keepTextLayer: true,\n keepCanvasWrapper: true,\n // It will be reset by the .update call below\n preserveDetailViewState: true,\n });\n\n this.detailView?.update({ underlyingViewUpdated: true });\n }\n\n #computeScale() {\n const { width, height } = this.viewport;\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.#needsRestrictedScaling = true;\n } else {\n this.#needsRestrictedScaling = outputScale.limitCanvas(\n width,\n height,\n this.maxCanvasPixels,\n this.maxCanvasDim,\n this.capCanvasAreaFactor\n );\n if (this.#needsRestrictedScaling && this.enableDetailCanvas) {\n // If we are going to have a high-res detail view, further reduce\n // the canvas resolution to improve rendering performance.\n // When enableOptimizedPartialRendering is enabled the factor can be\n // higher since less data will be rendered and it's more acceptable to\n // have a lower quality (the canvas is exposed less time to the user).\n const factor = this.enableOptimizedPartialRendering ? 4 : 2;\n outputScale.sx /= factor;\n outputScale.sy /= factor;\n }\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 super.cancelRendering({ cancelExtraDelay });\n\n if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) {\n this.textLayer.cancel();\n this.textLayer = 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 (this.structTreeLayer && !this.textLayer) {\n this.structTreeLayer = null;\n }\n if (\n this.annotationEditorLayer &&\n (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)\n ) {\n if (this.drawLayer) {\n this.drawLayer.cancel();\n this.drawLayer = null;\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 redrawAnnotationLayer = false,\n redrawAnnotationEditorLayer = false,\n redrawXfaLayer = false,\n redrawTextLayer = false,\n hideTextLayer = false,\n }) {\n const { canvas } = this;\n if (!canvas) {\n return;\n }\n\n const originalViewport = this.#originalViewport;\n if (this.viewport !== originalViewport) {\n // The canvas may have been originally rotated; rotate relative to that.\n const relativeRotation =\n (360 + this.viewport.rotation - originalViewport.rotation) % 360;\n if (relativeRotation === 90 || relativeRotation === 270) {\n const { width, height } = this.viewport;\n // Scale x and y because of the rotation.\n const scaleX = height / width;\n const scaleY = width / height;\n canvas.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX},${scaleY})`;\n } else {\n canvas.style.transform =\n relativeRotation === 0 ? \"\" : `rotate(${relativeRotation}deg)`;\n }\n }\n\n if (redrawAnnotationLayer && this.annotationLayer) {\n this.#renderAnnotationLayer();\n }\n if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {\n if (this.drawLayer) {\n this.#renderDrawLayer();\n }\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 // Wrap the canvas so that if it has a CSS transform for high DPI the\n // overflow will be hidden in Firefox.\n _ensureCanvasWrapper() {\n let canvasWrapper = this.#canvasWrapper;\n if (!canvasWrapper) {\n canvasWrapper = this.#canvasWrapper = document.createElement(\"div\");\n canvasWrapper.classList.add(\"canvasWrapper\");\n this.#addLayer(canvasWrapper, \"canvasWrapper\");\n }\n return canvasWrapper;\n }\n\n _getRenderingContext(canvas, transform, recordOperations, recordImages) {\n return {\n canvas,\n transform,\n viewport: this.viewport,\n annotationMode: this.#annotationMode,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n pageColors: this.pageColors,\n isEditing: this.#isEditing,\n recordOperations,\n recordImages,\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, 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 const canvasWrapper = this._ensureCanvasWrapper();\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 pdfPage,\n highlighter: this._textHighlighter,\n accessibilityManager: this._accessibilityManager,\n enablePermissions:\n this.#textLayerMode === TextLayerMode.ENABLE_PERMISSIONS,\n onAppend: textLayerDiv => {\n // Pause translation when inserting the textLayer in the DOM.\n this.l10n.pause();\n this.#addLayer(textLayerDiv, \"textLayer\");\n this.l10n.resume();\n },\n abortSignal: this.#abortSignal,\n });\n if (this.enableSelectionRendering) {\n this.textLayer.div.classList.add(\"selectionRendering\");\n }\n }\n\n if (\n !this.annotationLayer &&\n this.#annotationMode !== AnnotationMode.DISABLE\n ) {\n const {\n annotationStorage,\n annotationEditorUIManager,\n downloadManager,\n enableComment,\n enableScripting,\n fieldObjectsPromise,\n hasJSActionsPromise,\n linkService,\n } = this.#layerProperties;\n\n this._annotationCanvasMap ||= new Map();\n this.annotationLayer = new AnnotationLayerBuilder({\n pdfPage,\n annotationStorage,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.#annotationMode === AnnotationMode.ENABLE_FORMS,\n linkService,\n downloadManager,\n enableComment,\n enableScripting,\n hasJSActionsPromise,\n fieldObjectsPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n accessibilityManager: this._accessibilityManager,\n annotationEditorUIManager,\n commentManager: this.#commentManager,\n onAppend: annotationLayerDiv => {\n this.#addLayer(annotationLayerDiv, \"annotationLayer\");\n },\n });\n }\n\n const { width, height } = viewport;\n this.#originalViewport = viewport;\n\n const { canvas, prevCanvas } = this._createCanvas(newCanvas => {\n // Always inject the canvas as the first element in the wrapper.\n canvasWrapper.prepend(newCanvas);\n });\n canvas.setAttribute(\"role\", \"presentation\");\n\n if (!this.outputScale) {\n this.#computeScale();\n }\n const { outputScale } = this;\n this.#hasRestrictedScaling = this.#needsRestrictedScaling;\n\n const sfx = approximateFraction(outputScale.sx);\n const sfy = approximateFraction(outputScale.sy);\n\n const canvasWidth = (canvas.width = floorToDivide(\n calcRound(width * outputScale.sx),\n sfx[0]\n ));\n const canvasHeight = (canvas.height = floorToDivide(\n calcRound(height * outputScale.sy),\n sfy[0]\n ));\n const pageWidth = floorToDivide(calcRound(width), sfx[1]);\n const pageHeight = floorToDivide(calcRound(height), sfy[1]);\n outputScale.sx = canvasWidth / pageWidth;\n outputScale.sy = canvasHeight / pageHeight;\n\n if (this.#scaleRoundX !== sfx[1]) {\n div.style.setProperty(\"--scale-round-x\", `${sfx[1]}px`);\n this.#scaleRoundX = sfx[1];\n }\n if (this.#scaleRoundY !== sfy[1]) {\n div.style.setProperty(\"--scale-round-y\", `${sfy[1]}px`);\n this.#scaleRoundY = sfy[1];\n }\n\n const recordBBoxes =\n this.enableOptimizedPartialRendering &&\n this.#hasRestrictedScaling &&\n !this.recordedBBoxes;\n\n const recordImages =\n this.imagesRightClickMinSize !== -1 && !this.imageCoordinates;\n\n // Rendering area\n const transform = outputScale.scaled\n ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0]\n : null;\n const resultPromise = this._drawCanvas(\n this._getRenderingContext(canvas, transform, recordBBoxes, recordImages),\n () => {\n prevCanvas?.remove();\n this._resetCanvas();\n },\n renderTask => {\n // Ensure that the thumbnails won't become partially (or fully) blank,\n // for documents that contain interactive form elements.\n this.#useThumbnailCanvas.regularAnnotations =\n !renderTask.separateAnnots;\n\n this.dispatchPageRendered(\n /* cssTransform */ false,\n /* isDetailView */ false\n );\n }\n ).then(async () => {\n if (this.renderingState !== RenderingStates.FINISHED) {\n // The rendering has been cancelled.\n return;\n }\n this.structTreeLayer ||= new StructTreeLayerBuilder(\n pdfPage,\n viewport.rawDims\n );\n\n const textLayerPromise = this.textLayer ? this.#renderTextLayer() : null;\n\n if (this.annotationLayer) {\n await this.#renderAnnotationLayer(textLayerPromise);\n }\n\n this.drawLayer ||= new DrawLayerBuilder({\n pageIndex: this.id,\n textLayer: this.enableSelectionRendering ? this.textLayer?.div : null,\n filterFactory: this.pdfPage?.filterFactory,\n pageColors: this.pageColors,\n });\n await this.#renderDrawLayer();\n this.drawLayer.setParent(canvasWrapper);\n\n const { annotationEditorUIManager } = this.#layerProperties;\n\n if (!annotationEditorUIManager) {\n return;\n }\n if (\n this.annotationLayer ||\n this.#annotationMode === AnnotationMode.DISABLE\n ) {\n this.annotationEditorLayer ||= new AnnotationEditorLayerBuilder({\n uiManager: annotationEditorUIManager,\n pageIndex: this.id - 1,\n l10n,\n structTreeLayer: this.structTreeLayer,\n accessibilityManager: this._accessibilityManager,\n annotationLayer: this.annotationLayer?.annotationLayer,\n textLayer: this.textLayer,\n drawLayer: this.drawLayer.getDrawLayer(),\n onAppend: annotationEditorLayerDiv => {\n this.#addLayer(annotationEditorLayerDiv, \"annotationEditorLayer\");\n },\n });\n this.#renderAnnotationEditorLayer();\n }\n });\n\n if (pdfPage.isPureXfa) {\n if (!this.xfaLayer) {\n const { annotationStorage, linkService } = this.#layerProperties;\n\n this.xfaLayer = new XfaLayerBuilder({\n pdfPage,\n annotationStorage,\n linkService,\n });\n }\n this.#renderXfaLayer();\n }\n\n div.setAttribute(\"data-loaded\", true);\n\n this.dispatchPageRender();\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 this.div.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ page: this.pageLabel ?? this.id })\n );\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 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/page_viewport\").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// 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/** @typedef {import(\"./pdf_link_service.js\").PDFLinkService} PDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./base_download_manager.js\").BaseDownloadManager} BaseDownloadManager */\n/** @typedef {import(\"./l10n.js\").L10n} L10n */\n\nimport {\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationMode,\n makeArr,\n MathClamp,\n PermissionFlag,\n PixelsPerInch,\n shadow,\n stopEvent,\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 SCROLLBAR_PADDING,\n scrollIntoView,\n ScrollMode,\n SpreadMode,\n TextLayerMode,\n UNKNOWN_SCALE,\n VERTICAL_PADDING,\n watchScroll,\n} from \"./ui_utils.js\";\nimport { GenericL10n } from \"web-null_l10n\";\nimport { internalOpt } from \"./internal_evt.js\";\nimport { PDFPageView } from \"./pdf_page_view.js\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { RenderingStates } from \"./renderable_view.js\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\n\nconst DEFAULT_CACHE_SIZE = 10;\n\nconst PagesCountLimit = {\n FORCE_SCROLL_MODE_PAGE: 10000,\n FORCE_LAZY_PAGE_INIT: 5000,\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 {PDFLinkService} [linkService] - The navigation/linking service.\n * @property {BaseDownloadManager} [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} [annotationEditorHighlightColors] - A comma separated list\n * of colors to propose to highlight some text in the pdf.\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 {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 * 8192 (32 mega-pixels).\n * @property {number} [maxCanvasDim] - The maximum supported canvas dimension,\n * in either width or height. Use `-1` for no limit.\n * The default value is 32767.\n * @property {number} [capCanvasAreaFactor] - Cap the canvas area to the\n * viewport increased by the value in percent. Use `-1` for no limit.\n * The default value is 200%.\n * @property {boolean} [enableDetailCanvas] - When enabled, if the rendered\n * pages would need a canvas that is larger than `maxCanvasPixels` or\n * `maxCanvasDim`, it will draw a second canvas on top of the CSS-zoomed one,\n * that only renders the part of the page that is close to the viewport.\n * The default value is `true`.\n * @property {boolean} [enableSelectionRendering] - Enables rendering of text\n * selections in the draw layer.\n * The default value is `true`.\n * @property {number} [imagesRightClickMinSize] - All images whose width and\n * height are at least this value (in pixels) will be lazily inserted in the\n * dom to allow right-clicking and saving them. Use `-1` to disable this.\n * @property {boolean} [enableOptimizedPartialRendering] - When enabled, PDF\n * rendering will keep track of which areas of the page each PDF operation\n * affects. Then, when rendering a partial page (if `enableDetailCanvas` is\n * enabled), it will only run through the operations that affect that portion.\n * @property {L10n} [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 * @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture.\n * The default value is `true`.\n * @property {boolean} [enableAutoLinking] - Enable creation of hyperlinks from\n * text that look like URLs. The default value is `true`.\n * @property {number} [minDurationToUpdateCanvas] - Minimum duration to wait\n * before updating the canvas. The default value is `500`.\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 #annotationEditorHighlightColors = null;\n\n #annotationEditorMode = AnnotationEditorType.NONE;\n\n #annotationEditorUIManager = null;\n\n #annotationMode = AnnotationMode.ENABLE_FORMS;\n\n #commentManager = null;\n\n #containerTopLeft = null;\n\n #editorUndoBar = null;\n\n #enableHighlightFloatingButton = false;\n\n #enablePermissions = false;\n\n #enableUpdatedAddImage = false;\n\n #enableNewAltTextWhenAddingImage = false;\n\n #enableAutoLinking = true;\n\n #abortSignal = null;\n\n #eventAC = null;\n\n #minDurationToUpdateCanvas = 0;\n\n #mlManager = null;\n\n #printingAllowed = true;\n\n #scrollTimeoutId = null;\n\n #switchAnnotationEditorModeAC = null;\n\n #switchAnnotationEditorModeTimeoutId = null;\n\n #copyAllInProgress = false;\n\n #hiddenCopyElement = null;\n\n #previousContainerHeight = 0;\n\n #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this));\n\n #scrollModePageState = null;\n\n #scaleTimeoutId = null;\n\n #signatureManager = null;\n\n #supportsPinchToZoom = true;\n\n #textLayerMode = TextLayerMode.ENABLE;\n\n #viewerAlert = null;\n\n #copiedPageViews = null;\n\n #savedPageViews = null;\n\n #deletedPageNumbers = null;\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\n this.container = options.container;\n this.viewer = options.viewer || options.container.firstElementChild;\n this.#viewerAlert = options.viewerAlert || null;\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 this.#commentManager = options.commentManager || null;\n this.#signatureManager = options.signatureManager || null;\n this.#editorUndoBar = options.editorUndoBar || 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.#annotationEditorHighlightColors =\n options.annotationEditorHighlightColors || null;\n this.#enableHighlightFloatingButton =\n options.enableHighlightFloatingButton === true;\n this.#enableUpdatedAddImage = options.enableUpdatedAddImage === true;\n this.#enableNewAltTextWhenAddingImage =\n options.enableNewAltTextWhenAddingImage === true;\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 this.maxCanvasPixels = options.maxCanvasPixels;\n this.maxCanvasDim = options.maxCanvasDim;\n this.capCanvasAreaFactor = options.capCanvasAreaFactor;\n this.enableDetailCanvas = options.enableDetailCanvas ?? true;\n this.enableOptimizedPartialRendering =\n options.enableOptimizedPartialRendering ?? false;\n this.enableSelectionRendering = options.enableSelectionRendering !== false;\n this.imagesRightClickMinSize = options.imagesRightClickMinSize ?? -1;\n this.l10n = options.l10n;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.l10n ||= new GenericL10n();\n }\n this.#enablePermissions = options.enablePermissions || false;\n this.pageColors = options.pageColors || null;\n this.#mlManager = options.mlManager || null;\n this.#supportsPinchToZoom = options.supportsPinchToZoom !== false;\n this.#enableAutoLinking = options.enableAutoLinking !== false;\n this.#minDurationToUpdateCanvas = options.minDurationToUpdateCanvas ?? 500;\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 const { abortSignal } = options;\n this.#abortSignal = abortSignal || null;\n abortSignal?.addEventListener(\n \"abort\",\n () => {\n this.#resizeObserver.disconnect();\n this.#resizeObserver = null;\n },\n { once: true }\n );\n\n this.scroll = watchScroll(\n this.container,\n this._scrollUpdate.bind(this),\n abortSignal\n );\n this.presentationModeState = PresentationModeState.UNKNOWN;\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(\n \"thumbnailrendered\",\n ({ pageNumber, pdfPage }) => {\n const pageView = this._pages[pageNumber - 1];\n if (!this.#buffer.has(pageView)) {\n pdfPage?.cleanup();\n }\n },\n internalOpt\n );\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n !options.l10n\n ) {\n // Ensure that Fluent is connected in e.g. the COMPONENTS build.\n this.l10n.translate(this.container);\n }\n }\n\n get printingAllowed() {\n return this.#printingAllowed;\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 this._pages.every(pageView => pageView?.pdfPage);\n }\n\n /**\n * Clear text selections within the viewer.\n */\n clearSelection() {\n const selection = document.getSelection();\n if (!selection || selection.isCollapsed) {\n return;\n }\n\n for (let i = 0, ii = selection.rangeCount; i < ii; i++) {\n if (selection.getRangeAt(i).intersectsNode(this.viewer)) {\n // `empty()` is non-standard; `removeAllRanges()` is the standard API.\n selection.removeAllRanges?.();\n selection.empty?.();\n return;\n }\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 if (this._currentPageNumber !== val) {\n this.clearSelection();\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 if (this._currentPageNumber !== page) {\n this.clearSelection();\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.clearSelection();\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 get _layerProperties() {\n const self = this;\n return shadow(this, \"_layerProperties\", {\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 enableComment() {\n return !!self.#commentManager;\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 #setPrintingAllowed(isAllowed) {\n this.#printingAllowed = isAllowed;\n this.eventBus.dispatch(\"printingallowed\", { source: this, isAllowed });\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 this.#setPrintingAllowed(true);\n return params;\n }\n\n this.#setPrintingAllowed(\n permissions.includes(PermissionFlag.PRINT_HIGH_QUALITY) ||\n permissions.includes(PermissionFlag.PRINT)\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 async #onePageRenderedOrForceFetch(signal) {\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;\n }\n\n // Handle the window/tab becoming inactive *after* rendering has started;\n // fixes (another part of) bug 1746213.\n const hiddenCapability = Promise.withResolvers(),\n ac = new AbortController();\n document.addEventListener(\n \"visibilitychange\",\n () => {\n if (document.visibilityState === \"hidden\") {\n hiddenCapability.resolve();\n }\n },\n { signal: AbortSignal.any([signal, ac.signal]) }\n );\n\n await Promise.race([\n this._onePageRenderedCapability.promise,\n hiddenCapability.promise,\n ]);\n ac.abort(); // Remove the \"visibilitychange\" listener immediately.\n }\n\n async getAllText(interruptSignal = null) {\n const texts = [];\n const buffer = [];\n for (\n let pageNum = 1, pagesCount = this.pdfDocument.numPages;\n pageNum <= pagesCount;\n ++pageNum\n ) {\n if (interruptSignal?.aborted) {\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.#copyAllInProgress ||\n textLayerMode === TextLayerMode.ENABLE_PERMISSIONS\n ) {\n stopEvent(event);\n return;\n }\n this.#copyAllInProgress = 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 { classList } = this.viewer;\n classList.add(\"copyAll\");\n\n const keydownAC = new AbortController(),\n interruptAC = new AbortController();\n window.addEventListener(\n \"keydown\",\n ev => {\n if (ev.key === \"Escape\") {\n interruptAC.abort();\n }\n },\n { signal: keydownAC.signal }\n );\n\n this.getAllText(interruptAC.signal)\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.#copyAllInProgress = false;\n keydownAC.abort();\n classList.remove(\"copyAll\");\n });\n\n stopEvent(event);\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 this.#annotationEditorUIManager?.destroy();\n this.#annotationEditorUIManager = null;\n\n this.#annotationEditorMode = AnnotationEditorType.NONE;\n this.#printingAllowed = true;\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 intent: \"display\",\n });\n const permissionsPromise = this.#enablePermissions\n ? pdfDocument.getPermissions()\n : Promise.resolve();\n\n const { eventBus, pageColors, viewer } = this;\n\n this.#eventAC = new AbortController();\n const { signal } = this.#eventAC;\n const evtOpts = { signal, ...internalOpt };\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 eventBus.dispatch(\"scrollmodechanged\", { source: this, mode });\n }\n\n this._pagesCapability.promise.then(\n () => {\n eventBus.dispatch(\"pagesloaded\", { source: this, pagesCount });\n },\n () => {\n /* Prevent \"Uncaught (in promise)\"-messages in the console. */\n }\n );\n\n const 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 eventBus.on(\"pagerender\", onBeforeDraw, evtOpts);\n\n const onAfterDraw = evt => {\n if (evt.cssTransform || evt.isDetailView) {\n return;\n }\n this._onePageRenderedCapability.resolve({ timestamp: evt.timestamp });\n\n eventBus.off(\"pagerendered\", onAfterDraw); // Remove immediately.\n };\n eventBus.on(\"pagerendered\", onAfterDraw, evtOpts);\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 element.style.cssText =\n \"position:absolute;top:0;left:0;width:0;height:0;display:none\";\n 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 viewer,\n this.#viewerAlert,\n this.#altTextManager,\n this.#commentManager,\n this.#signatureManager,\n eventBus,\n pdfDocument,\n pageColors,\n this.#annotationEditorHighlightColors,\n this.#enableHighlightFloatingButton,\n this.#enableUpdatedAddImage,\n this.#enableNewAltTextWhenAddingImage,\n this.#mlManager,\n this.#editorUndoBar,\n this.#supportsPinchToZoom\n );\n eventBus.dispatch(\"annotationeditoruimanager\", {\n source: this,\n uiManager: this.#annotationEditorUIManager,\n });\n if (mode !== AnnotationEditorType.NONE) {\n this.#preloadEditingData(mode);\n this.#annotationEditorUIManager.updateMode(mode);\n }\n } else {\n console.error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n }\n\n const viewerElement =\n this._scrollMode === ScrollMode.PAGE ? null : 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 viewer.style.setProperty(\"--scale-factor\", viewport.scale);\n\n if (pageColors?.background) {\n viewer.style.setProperty(\"--page-bg-color\", pageColors.background);\n }\n if (\n pageColors?.foreground === \"CanvasText\" ||\n pageColors?.background === \"Canvas\"\n ) {\n viewer.style.setProperty(\n \"--hcm-highlight-filter\",\n pdfDocument.filterFactory.addHighlightHCMFilter(\n \"highlight\",\n \"CanvasText\",\n \"Canvas\",\n \"HighlightText\",\n \"Highlight\"\n )\n );\n viewer.style.setProperty(\n \"--hcm-highlight-selected-filter\",\n pdfDocument.filterFactory.addHighlightHCMFilter(\n \"highlight_selected\",\n \"CanvasText\",\n \"Canvas\",\n \"HighlightText\",\n \"ButtonText\"\n )\n );\n }\n\n for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n const pageView = new PDFPageView({\n container: viewerElement,\n 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 maxCanvasPixels: this.maxCanvasPixels,\n maxCanvasDim: this.maxCanvasDim,\n capCanvasAreaFactor: this.capCanvasAreaFactor,\n enableDetailCanvas: this.enableDetailCanvas,\n enableOptimizedPartialRendering:\n this.enableOptimizedPartialRendering,\n enableSelectionRendering: this.enableSelectionRendering,\n imagesRightClickMinSize: this.imagesRightClickMinSize,\n pageColors,\n l10n: this.l10n,\n layerProperties: this._layerProperties,\n enableAutoLinking: this.#enableAutoLinking,\n minDurationToUpdateCanvas: this.#minDurationToUpdateCanvas,\n commentManager: this.#commentManager,\n abortSignal: this.#abortSignal,\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 this._pages[0]?.setPdfPage(firstPdfPage);\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 eventBus.on(\n \"annotationeditorlayerrendered\",\n evt => {\n if (this.#annotationEditorUIManager) {\n // Ensure that the Editor buttons, in the toolbar, are updated.\n eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode: this.#annotationEditorMode,\n });\n }\n },\n { once: true, signal, ...internalOpt }\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(signal).then(async () => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the first page rendered.\n }\n this.findController?.setDocument(pdfDocument); // Enable searching.\n this._scriptingManager?.setDocument(pdfDocument); // Enable scripting.\n\n if (this.#hiddenCopyElement) {\n document.addEventListener(\n \"copy\",\n this.#copyCallback.bind(this, textLayerMode),\n { signal }\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 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 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 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 onPagesEdited({ pagesMapper, type, hasBeenCut, pageNumbers }) {\n if (type === \"copy\") {\n this.#copiedPageViews = new Map();\n for (const pageNum of pageNumbers) {\n this.#copiedPageViews.set(pageNum, this._pages[pageNum - 1]);\n }\n return;\n }\n\n if (type === \"cancelCopy\") {\n this.#copiedPageViews = null;\n return;\n }\n\n const isCut = type === \"cut\";\n if (isCut || type === \"delete\") {\n this.#savedPageViews = this._pages;\n this.#deletedPageNumbers = pageNumbers;\n }\n\n if (type === \"cancelDelete\") {\n this.#deletedPageNumbers = null;\n if (!this.#savedPageViews) {\n return;\n }\n const viewerElement =\n this._scrollMode === ScrollMode.PAGE ? null : this.viewer;\n if (viewerElement) {\n this.#annotationEditorUIManager?.startUpdatePages();\n const fragment = document.createDocumentFragment();\n for (let i = 0, ii = this.#savedPageViews.length; i < ii; i++) {\n const page = this.#savedPageViews[i];\n page.updatePageNumber(i + 1);\n fragment.append(page.div);\n }\n viewerElement.replaceChildren(fragment);\n this.#annotationEditorUIManager?.endUpdatePages();\n }\n this._pages = this.#savedPageViews;\n this.#savedPageViews = null;\n return;\n }\n\n if (type === \"cleanSavedData\") {\n if (this.#deletedPageNumbers) {\n if (this.#savedPageViews) {\n for (const pageNum of this.#deletedPageNumbers) {\n this.#savedPageViews[pageNum - 1].deleteMe();\n }\n this.#savedPageViews = null;\n }\n this.#deletedPageNumbers = null;\n }\n return;\n }\n\n this._currentPageNumber = 0;\n const prevPages = this._pages;\n const newPages = (this._pages = []);\n\n this.#annotationEditorUIManager?.startUpdatePages();\n\n for (let i = 1, ii = pagesMapper.pagesNumber; i <= ii; i++) {\n const prevPageNumber = pagesMapper.getPrevPageNumber(i);\n if (prevPageNumber < 0) {\n let page = this.#copiedPageViews.get(-prevPageNumber);\n if (hasBeenCut) {\n page.updatePageNumber(i);\n } else {\n this.#annotationEditorUIManager?.clonePage(\n -prevPageNumber - 1,\n i - 1\n );\n page = page.clone(i);\n }\n newPages.push(page);\n continue;\n }\n const page = prevPages[prevPageNumber - 1];\n newPages.push(page);\n page.updatePageNumber(i);\n }\n\n this.#annotationEditorUIManager?.endUpdatePages();\n\n if (type === \"paste\") {\n this.#copiedPageViews = null;\n }\n\n const viewerElement =\n this._scrollMode === ScrollMode.PAGE ? null : this.viewer;\n if (viewerElement) {\n const fragment = document.createDocumentFragment();\n for (const { div } of newPages) {\n fragment.append(div);\n }\n viewerElement.replaceChildren(fragment);\n }\n\n setTimeout(() => {\n this.forceRendering();\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 = Promise.withResolvers();\n this._onePageRenderedCapability = Promise.withResolvers();\n this._pagesCapability = Promise.withResolvers();\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 this.#eventAC?.abort();\n this.#eventAC = 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 this.#hiddenCopyElement?.remove();\n this.#hiddenCopyElement = null;\n\n this.#cleanupTimeouts();\n this.#cleanupSwitchAnnotationEditorMode();\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\n if (this.#scrollTimeoutId) {\n clearTimeout(this.#scrollTimeoutId);\n }\n this.#scrollTimeoutId = setTimeout(() => {\n this.#scrollTimeoutId = null;\n this.update();\n }, 100);\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, origin = null }\n ) {\n this.clearSelection();\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 const previousScale = this._currentScale;\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 if (Array.isArray(origin)) {\n // If the origin of the scaling transform is specified, preserve its\n // location on screen. If not specified, scaling will fix the top-left\n // corner of the visible PDF area.\n const scaleDiff = newScale / previousScale - 1;\n const [top, left] = this.containerTopLeft;\n this.container.scrollLeft += (origin[0] - left) * scaleDiff;\n this.container.scrollTop += (origin[1] - top) * scaleDiff;\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 * @property {string} [center] - Center the view on the specified coordinates.\n * The default value is `null`. Possible values are: `null` (don't center),\n * `horizontal`, `vertical` and `both`.\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 center = null,\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 (center) {\n if (center === \"both\" || center === \"vertical\") {\n top -=\n (this.container.clientHeight -\n Math.abs(boundingRect[1][1] - boundingRect[0][1])) /\n 2;\n }\n if (center === \"both\" || center === \"horizontal\") {\n left -=\n (this.container.clientWidth -\n Math.abs(boundingRect[1][0] - boundingRect[0][0])) /\n 2;\n }\n } else 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 for (const { view, visibleArea } of visiblePages) {\n view.updateVisibleArea(visibleArea);\n }\n for (const view of this.#buffer) {\n if (!visible.ids.has(view.id)) {\n view.updateVisibleArea(null);\n }\n }\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 currentPageNumber = 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 === currentPageNumber && isSimpleLayout) {\n stillFullyVisible = true;\n break;\n }\n }\n this._setCurrentPageNumber(\n stillFullyVisible ? this._currentPageNumber : 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 #switchToEditAnnotationMode() {\n const visible = this._getVisiblePages();\n const pagesToRefresh = [];\n const { ids, views } = visible;\n for (const page of views) {\n const { view } = page;\n if (!view.hasEditableAnnotations()) {\n ids.delete(view.id);\n continue;\n }\n pagesToRefresh.push(page);\n }\n\n if (pagesToRefresh.length === 0) {\n return null;\n }\n this.renderingQueue.renderHighestPriority({\n first: pagesToRefresh[0],\n last: pagesToRefresh.at(-1),\n views: pagesToRefresh,\n ids,\n });\n\n return ids;\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 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 ignoreDetailViews =\n // If we are zooming, do not re-render the detail views. Re-renders on\n // zoom happen with a delay, and once the rendering happens it will also\n // trigger rendering of the detail views.\n this.#scaleTimeoutId !== null ||\n // If we are scrolling and the rendering of a detail view was just\n // cancelled, it's because the user is scrolling too quickly and so\n // we constantly need to re-render a different area.\n // Don't attempt to re-render it: this will be done once the user\n // stops scrolling.\n (this.#scrollTimeoutId !== null &&\n visiblePages.views.some(page => page.detailView?.renderingCancelled));\n\n const pageView = this.renderingQueue.getHighestPriority(\n visiblePages,\n this._pages,\n scrollAhead,\n preRenderExtra,\n ignoreDetailViews\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({ intent: \"display\" });\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.clearSelection();\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.clearSelection();\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 #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 pageLayout.getOrInsertComputed(y, makeArr).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 * @property {Array} [origin] x and y coordinates of the scale\n * transformation origin.\n */\n\n /**\n * Changes the current zoom level by the specified amount.\n * @param {ChangeScaleOptions} [options]\n */\n updateScale({ drawingDelay, scaleFactor = null, steps = null, origin }) {\n if (steps === null && scaleFactor === null) {\n throw new Error(\n \"Invalid updateScale options: either `steps` or `scaleFactor` must be provided.\"\n );\n }\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 if (steps) {\n const delta = steps > 0 ? DEFAULT_SCALE_DELTA : 1 / DEFAULT_SCALE_DELTA;\n const round = steps > 0 ? Math.ceil : Math.floor;\n steps = Math.abs(steps);\n do {\n newScale = round((newScale * delta).toFixed(2) * 10) / 10;\n } while (--steps > 0);\n }\n newScale = MathClamp(newScale, MIN_SCALE, MAX_SCALE);\n this.#setScale(newScale, { noScroll: false, drawingDelay, origin });\n }\n\n /**\n * Increase the current zoom level one, or more, times.\n * @param {ChangeScaleOptions} [options]\n */\n increaseScale(options = {}) {\n this.updateScale({ ...options, steps: options.steps ?? 1 });\n }\n\n /**\n * Decrease the current zoom level one, or more, times.\n * @param {ChangeScaleOptions} [options]\n */\n decreaseScale(options = {}) {\n this.updateScale({ ...options, steps: -(options.steps ?? 1) });\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 #cleanupTimeouts() {\n if (this.#scaleTimeoutId !== null) {\n clearTimeout(this.#scaleTimeoutId);\n this.#scaleTimeoutId = null;\n }\n if (this.#scrollTimeoutId !== null) {\n clearTimeout(this.#scrollTimeoutId);\n this.#scrollTimeoutId = null;\n }\n }\n\n #cleanupSwitchAnnotationEditorMode() {\n this.#switchAnnotationEditorModeAC?.abort();\n this.#switchAnnotationEditorModeAC = null;\n\n if (this.#switchAnnotationEditorModeTimeoutId !== null) {\n clearTimeout(this.#switchAnnotationEditorModeTimeoutId);\n this.#switchAnnotationEditorModeTimeoutId = null;\n }\n }\n\n #preloadEditingData(mode) {\n switch (mode) {\n case AnnotationEditorType.STAMP:\n this.#mlManager?.loadModel(\"altText\");\n break;\n case AnnotationEditorType.SIGNATURE:\n // Start to load the signature data.\n this.#signatureManager?.loadSignatures();\n break;\n }\n }\n\n get annotationEditorMode() {\n return this.#annotationEditorUIManager\n ? this.#annotationEditorMode\n : AnnotationEditorType.DISABLE;\n }\n\n /**\n * @typedef {Object} AnnotationEditorModeOptions\n * @property {number} mode - The editor mode (none, FreeText, ink, ...).\n * @property {string|null} [editId] - ID of the existing annotation to edit.\n * @property {boolean} [isFromKeyboard] - True if the mode change is due to a\n * keyboard action.\n * @property {boolean} [mustEnterInEditMode] - True if the editor must enter\n * edit mode.\n * @property {boolean} [editComment] - True if the editor must enter\n * comment edit mode.\n */\n\n /**\n * @param {AnnotationEditorModeOptions} options\n */\n set annotationEditorMode({\n mode,\n editId = null,\n isFromKeyboard = false,\n mustEnterInEditMode = false,\n editComment = false,\n }) {\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.#preloadEditingData(mode);\n\n const { eventBus, pdfDocument } = this;\n const updater = async () => {\n this.#cleanupSwitchAnnotationEditorMode();\n this.#annotationEditorMode = mode;\n await this.#annotationEditorUIManager.updateMode(\n mode,\n editId,\n /* isFromUser = */ true,\n isFromKeyboard,\n mustEnterInEditMode,\n editComment\n );\n if (\n mode !== this.#annotationEditorMode ||\n pdfDocument !== this.pdfDocument\n ) {\n // Since `updateMode` is async, the active mode could have changed.\n return;\n }\n eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode,\n });\n };\n\n if (\n mode === AnnotationEditorType.NONE ||\n this.#annotationEditorMode === AnnotationEditorType.NONE\n ) {\n const isEditing = mode !== AnnotationEditorType.NONE;\n if (!isEditing) {\n this.pdfDocument.annotationStorage.resetModifiedIds();\n }\n // We need to cleanup whatever pages being rendered.\n this.cleanup();\n for (const pageView of this._pages) {\n pageView.toggleEditingMode(isEditing);\n }\n // We must call #switchToEditAnnotationMode unconditionally to ensure that\n // page is rendered if it's useful or not.\n const idsToRefresh = this.#switchToEditAnnotationMode();\n if (isEditing && idsToRefresh) {\n // We're editing so we must switch to editing mode when the rendering is\n // done.\n this.#cleanupSwitchAnnotationEditorMode();\n this.#switchAnnotationEditorModeAC = new AbortController();\n const signal = AbortSignal.any([\n this.#eventAC.signal,\n this.#switchAnnotationEditorModeAC.signal,\n ]);\n\n eventBus.on(\n \"pagerendered\",\n ({ pageNumber }) => {\n idsToRefresh.delete(pageNumber);\n if (idsToRefresh.size === 0) {\n this.#switchAnnotationEditorModeTimeoutId = setTimeout(\n updater,\n 0\n );\n }\n },\n { signal, ...internalOpt }\n );\n return;\n }\n }\n updater();\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 this.#cleanupTimeouts();\n\n if (!noUpdate) {\n this.update();\n }\n }\n}\n\nexport { PagesCountLimit, PDFPageViewBuffer, PDFViewer };\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(\"./event_utils.js\").EventBus} EventBus */\n\nimport {\n CursorTool,\n ScrollMode,\n SpreadMode,\n toggleCheckedBtn,\n toggleExpandedBtn,\n} from \"./ui_utils.js\";\nimport { internalOpt } from \"./internal_evt.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} imageAltTextSettingsButton - Button for opening\n * the image alt-text settings dialog.\n * @property {HTMLButtonElement} documentPropertiesButton - Button for opening\n * the document properties dialog.\n */\n\nclass SecondaryToolbar {\n #opts;\n\n /**\n * @param {SecondaryToolbarOptions} options\n * @param {EventBus} eventBus\n */\n constructor(options, eventBus) {\n this.#opts = options;\n const 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.imageAltTextSettingsButton,\n eventName: \"imagealttextsettings\",\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 buttons.push({\n element: options.openFileButton,\n eventName: \"openfile\",\n close: true,\n });\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.#bindListeners(buttons);\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(\"switchcursortool\", { source: this, reset: true });\n this.#scrollModeChanged({ mode: ScrollMode.VERTICAL });\n this.#spreadModeChanged({ mode: SpreadMode.NONE });\n }\n\n #updateUIState() {\n const {\n firstPageButton,\n lastPageButton,\n pageRotateCwButton,\n pageRotateCcwButton,\n } = this.#opts;\n\n firstPageButton.disabled = this.pageNumber <= 1;\n lastPageButton.disabled = this.pageNumber >= this.pagesCount;\n pageRotateCwButton.disabled = this.pagesCount === 0;\n pageRotateCcwButton.disabled = this.pagesCount === 0;\n }\n\n #bindListeners(buttons) {\n const { eventBus } = this;\n const { toggleButton } = this.#opts;\n // Button to toggle the visibility of the secondary toolbar.\n toggleButton.addEventListener(\"click\", this.toggle.bind(this));\n\n // All items within the secondary toolbar.\n for (const { element, eventName, close, eventDetails } of buttons) {\n element.addEventListener(\"click\", evt => {\n if (eventName !== null) {\n eventBus.dispatch(eventName, { source: this, ...eventDetails });\n }\n if (close) {\n this.close();\n }\n eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"buttons\",\n data: { id: element.id },\n },\n });\n });\n }\n\n eventBus.on(\n \"cursortoolchanged\",\n this.#cursorToolChanged.bind(this),\n internalOpt\n );\n eventBus.on(\n \"scrollmodechanged\",\n this.#scrollModeChanged.bind(this),\n internalOpt\n );\n eventBus.on(\n \"spreadmodechanged\",\n this.#spreadModeChanged.bind(this),\n internalOpt\n );\n }\n\n #cursorToolChanged({ tool, disabled }) {\n const { cursorSelectToolButton, cursorHandToolButton } = this.#opts;\n\n toggleCheckedBtn(cursorSelectToolButton, tool === CursorTool.SELECT);\n toggleCheckedBtn(cursorHandToolButton, tool === CursorTool.HAND);\n\n cursorSelectToolButton.disabled = disabled;\n cursorHandToolButton.disabled = disabled;\n }\n\n #scrollModeChanged({ mode }) {\n const {\n scrollPageButton,\n scrollVerticalButton,\n scrollHorizontalButton,\n scrollWrappedButton,\n spreadNoneButton,\n spreadOddButton,\n spreadEvenButton,\n } = this.#opts;\n\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\n #spreadModeChanged({ mode }) {\n const { spreadNoneButton, spreadOddButton, spreadEvenButton } = this.#opts;\n\n toggleCheckedBtn(spreadNoneButton, mode === SpreadMode.NONE);\n toggleCheckedBtn(spreadOddButton, mode === SpreadMode.ODD);\n toggleCheckedBtn(spreadEvenButton, mode === SpreadMode.EVEN);\n }\n\n open() {\n if (this.opened) {\n return;\n }\n this.opened = true;\n\n const { toggleButton, toolbar } = this.#opts;\n toggleExpandedBtn(toggleButton, true, toolbar);\n }\n\n close() {\n if (!this.opened) {\n return;\n }\n this.opened = false;\n\n const { toggleButton, toolbar } = this.#opts;\n toggleExpandedBtn(toggleButton, false, 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 2025 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 AnnotationEditorParamsType,\n DOMSVGFactory,\n noContextMenu,\n SignatureExtractor,\n stopEvent,\n SupportedImageMimeTypes,\n} from \"pdfjs-lib\";\nimport { internalOpt } from \"./internal_evt.js\";\n\n// Default height of the added signature in page coordinates.\nconst DEFAULT_HEIGHT_IN_PAGE = 40;\n\nclass SignatureManager {\n #addButton;\n\n #tabsToAltText = null;\n\n #clearButton;\n\n #clearDescription;\n\n #currentEditor;\n\n #description;\n\n #dialog;\n\n #drawCurves = null;\n\n #drawPlaceholder;\n\n #drawPath = null;\n\n #drawPathString = \"\";\n\n #drawPoints = null;\n\n #drawSVG;\n\n #drawThickness;\n\n #errorBar;\n\n #errorDescription;\n\n #errorTitle;\n\n #extractedSignatureData = null;\n\n #imagePath = null;\n\n #imagePicker;\n\n #imagePickerLink;\n\n #imagePlaceholder;\n\n #imageSVG;\n\n #saveCheckbox;\n\n #saveContainer;\n\n #tabButtons;\n\n #addSignatureToolbarButton;\n\n #loadSignaturesPromise = null;\n\n #typeInput;\n\n #currentTab = null;\n\n #currentTabAC = null;\n\n #hasDescriptionChanged = false;\n\n #eventBus;\n\n #isStorageFull = false;\n\n #l10n;\n\n #overlayManager;\n\n #editDescriptionDialog;\n\n #signatureStorage;\n\n #uiManager = null;\n\n static #l10nDescription = null;\n\n constructor(\n {\n dialog,\n panels,\n typeButton,\n typeInput,\n drawButton,\n drawPlaceholder,\n drawSVG,\n drawThickness,\n imageButton,\n imageSVG,\n imagePlaceholder,\n imagePicker,\n imagePickerLink,\n description,\n clearButton,\n cancelButton,\n addButton,\n errorCloseButton,\n errorBar,\n errorTitle,\n errorDescription,\n saveCheckbox,\n saveContainer,\n },\n editSignatureElements,\n addSignatureToolbarButton,\n overlayManager,\n l10n,\n signatureStorage,\n eventBus\n ) {\n this.#addButton = addButton;\n this.#clearButton = clearButton;\n this.#clearDescription = description.lastElementChild;\n this.#description = description.firstElementChild;\n this.#dialog = dialog;\n this.#drawSVG = drawSVG;\n this.#drawPlaceholder = drawPlaceholder;\n this.#drawThickness = drawThickness;\n this.#errorBar = errorBar;\n this.#errorTitle = errorTitle;\n this.#errorDescription = errorDescription;\n this.#imageSVG = imageSVG;\n this.#imagePlaceholder = imagePlaceholder;\n this.#imagePicker = imagePicker;\n this.#imagePickerLink = imagePickerLink;\n this.#overlayManager = overlayManager;\n this.#saveCheckbox = saveCheckbox;\n this.#saveContainer = saveContainer;\n this.#addSignatureToolbarButton = addSignatureToolbarButton;\n this.#typeInput = typeInput;\n this.#l10n = l10n;\n this.#signatureStorage = signatureStorage;\n this.#eventBus = eventBus;\n this.#editDescriptionDialog = new EditDescriptionDialog(\n editSignatureElements,\n overlayManager\n );\n\n SignatureManager.#l10nDescription ||= Object.freeze({\n signature: \"pdfjs-editor-add-signature-description-default-when-drawing\",\n errorUploadTitle: \"pdfjs-editor-add-signature-image-upload-error-title\",\n errorUploadDescription:\n \"pdfjs-editor-add-signature-image-upload-error-description\",\n errorNoDataTitle: \"pdfjs-editor-add-signature-image-no-data-error-title\",\n errorNoDataDescription:\n \"pdfjs-editor-add-signature-image-no-data-error-description\",\n });\n\n dialog.addEventListener(\"close\", this.#close.bind(this));\n dialog.addEventListener(\"contextmenu\", e => {\n const { target } = e;\n if (target !== this.#typeInput && target !== this.#description) {\n e.preventDefault();\n }\n });\n dialog.addEventListener(\"drop\", e => {\n stopEvent(e);\n });\n cancelButton.addEventListener(\"click\", this.#cancel.bind(this));\n addButton.addEventListener(\"click\", this.#add.bind(this));\n clearButton.addEventListener(\n \"click\",\n () => {\n this.#reportTelemetry({\n type: \"signature\",\n action: \"pdfjs.signature.clear\",\n data: {\n type: this.#currentTab,\n },\n });\n this.#initTab(null);\n },\n { passive: true }\n );\n this.#description.addEventListener(\n \"input\",\n () => {\n this.#clearDescription.disabled = this.#description.value === \"\";\n },\n { passive: true }\n );\n this.#clearDescription.addEventListener(\n \"click\",\n () => {\n this.#description.value = \"\";\n this.#clearDescription.disabled = true;\n },\n { passive: true }\n );\n errorCloseButton.addEventListener(\n \"click\",\n () => {\n errorBar.hidden = true;\n },\n { passive: true }\n );\n\n this.#initTabButtons(typeButton, drawButton, imageButton, panels);\n imagePicker.accept = SupportedImageMimeTypes.join(\",\");\n\n eventBus.on(\n \"storedsignatureschanged\",\n this.#signaturesChanged.bind(this),\n internalOpt\n );\n\n overlayManager.register(dialog);\n }\n\n #initTabButtons(typeButton, drawButton, imageButton, panels) {\n const buttons = (this.#tabButtons = new Map([\n [\"type\", typeButton],\n [\"draw\", drawButton],\n [\"image\", imageButton],\n ]));\n const tabCallback = e => {\n for (const [name, button] of buttons) {\n if (button === e.target) {\n button.setAttribute(\"aria-selected\", true);\n button.setAttribute(\"tabindex\", 0);\n panels.setAttribute(\"data-selected\", name);\n this.#initTab(name);\n } else {\n button.setAttribute(\"aria-selected\", false);\n // Only the active tab is focusable: the others can be\n // reached by keyboard navigation (left/right arrows).\n button.setAttribute(\"tabindex\", -1);\n }\n }\n };\n\n const buttonsArray = Array.from(buttons.values());\n for (let i = 0, ii = buttonsArray.length; i < ii; i++) {\n const button = buttonsArray[i];\n button.addEventListener(\"click\", tabCallback, { passive: true });\n button.addEventListener(\n \"keydown\",\n ({ key }) => {\n if (key !== \"ArrowLeft\" && key !== \"ArrowRight\") {\n return;\n }\n buttonsArray[i + (key === \"ArrowLeft\" ? -1 : 1)]?.focus();\n },\n { passive: true }\n );\n }\n }\n\n #resetCommon() {\n this.#hasDescriptionChanged = false;\n this.#description.value = \"\";\n if (this.#currentTab) {\n this.#tabsToAltText.get(this.#currentTab).value = \"\";\n }\n }\n\n #resetTab(name) {\n switch (name) {\n case \"type\":\n this.#typeInput.value = \"\";\n break;\n case \"draw\":\n this.#drawCurves = null;\n this.#drawPoints = null;\n this.#drawPathString = \"\";\n this.#drawPath?.remove();\n this.#drawPath = null;\n this.#drawPlaceholder.hidden = false;\n this.#drawThickness.value = 1;\n break;\n case \"image\":\n this.#imagePlaceholder.hidden = false;\n this.#imagePath?.remove();\n this.#imagePath = null;\n break;\n }\n }\n\n #initTab(name) {\n if (name && this.#currentTab === name) {\n return;\n }\n if (this.#currentTab) {\n this.#tabsToAltText.get(this.#currentTab).value = this.#description.value;\n }\n if (name) {\n this.#currentTab = name;\n }\n\n this.#errorBar.hidden = true;\n const reset = !name;\n if (reset) {\n this.#resetCommon();\n } else {\n this.#description.value = this.#tabsToAltText.get(this.#currentTab).value;\n }\n this.#clearDescription.disabled = this.#description.value === \"\";\n this.#currentTabAC?.abort();\n this.#currentTabAC = new AbortController();\n switch (this.#currentTab) {\n case \"type\":\n this.#initTypeTab(reset);\n break;\n case \"draw\":\n this.#initDrawTab(reset);\n break;\n case \"image\":\n this.#initImageTab(reset);\n break;\n }\n }\n\n #disableButtons(value) {\n if (!value || !this.#isStorageFull) {\n this.#saveCheckbox.disabled = !value;\n }\n this.#clearButton.disabled =\n this.#addButton.disabled =\n this.#description.disabled =\n !value;\n }\n\n #initTypeTab(reset) {\n if (reset) {\n this.#resetTab(\"type\");\n }\n\n this.#disableButtons(this.#typeInput.value);\n\n const { signal } = this.#currentTabAC;\n const options = { passive: true, signal };\n this.#typeInput.addEventListener(\n \"input\",\n () => {\n const { value } = this.#typeInput;\n if (!this.#hasDescriptionChanged) {\n this.#tabsToAltText.get(\"type\").default = this.#description.value =\n value;\n this.#clearDescription.disabled = value === \"\";\n }\n this.#disableButtons(value);\n },\n options\n );\n this.#description.addEventListener(\n \"input\",\n () => {\n this.#hasDescriptionChanged =\n this.#typeInput.value !== this.#description.value;\n },\n options\n );\n }\n\n #initDrawTab(reset) {\n if (reset) {\n this.#resetTab(\"draw\");\n }\n\n this.#disableButtons(this.#drawPath);\n\n const { signal } = this.#currentTabAC;\n const options = { signal };\n let currentPointerId = NaN;\n const drawCallback = e => {\n const { pointerId } = e;\n if (!isNaN(currentPointerId) && currentPointerId !== pointerId) {\n return;\n }\n currentPointerId = pointerId;\n e.preventDefault();\n this.#drawSVG.setPointerCapture(pointerId);\n\n const { width: drawWidth, height: drawHeight } =\n this.#drawSVG.getBoundingClientRect();\n let { offsetX, offsetY } = e;\n offsetX = Math.round(offsetX);\n offsetY = Math.round(offsetY);\n if (e.target === this.#drawPlaceholder) {\n this.#drawPlaceholder.hidden = true;\n }\n if (!this.#drawCurves) {\n this.#drawCurves = {\n width: drawWidth,\n height: drawHeight,\n thickness: parseInt(this.#drawThickness.value, 10),\n curves: [],\n };\n this.#disableButtons(true);\n\n const svgFactory = new DOMSVGFactory();\n const path = (this.#drawPath = svgFactory.createElement(\"path\"));\n path.setAttribute(\"stroke-width\", this.#drawThickness.value);\n this.#drawSVG.append(path);\n this.#drawSVG.addEventListener(\"pointerdown\", drawCallback, options);\n this.#drawPlaceholder.removeEventListener(\"pointerdown\", drawCallback);\n if (this.#description.value === \"\") {\n this.#l10n\n .get(SignatureManager.#l10nDescription.signature)\n .then(description => {\n this.#tabsToAltText.get(\"draw\").default = description;\n this.#description.value ||= description;\n this.#clearDescription.disabled = this.#description.value === \"\";\n });\n }\n }\n\n this.#drawPoints = [offsetX, offsetY];\n this.#drawCurves.curves.push({ points: this.#drawPoints });\n this.#drawPathString += `M ${offsetX} ${offsetY}`;\n this.#drawPath.setAttribute(\"d\", this.#drawPathString);\n\n const finishDrawAC = new AbortController();\n const listenerDrawOptions = {\n signal: AbortSignal.any([signal, finishDrawAC.signal]),\n };\n this.#drawSVG.addEventListener(\n \"contextmenu\",\n noContextMenu,\n listenerDrawOptions\n );\n this.#drawSVG.addEventListener(\n \"pointermove\",\n evt => {\n evt.preventDefault();\n let { offsetX: x, offsetY: y } = evt;\n x = Math.round(x);\n y = Math.round(y);\n const drawPoints = this.#drawPoints;\n if (\n x < 0 ||\n y < 0 ||\n x > drawWidth ||\n y > drawHeight ||\n (x === drawPoints.at(-2) && y === drawPoints.at(-1))\n ) {\n return;\n }\n if (drawPoints.length >= 4) {\n const [x1, y1, x2, y2] = drawPoints.slice(-4);\n this.#drawPathString += `C${(x1 + 5 * x2) / 6} ${(y1 + 5 * y2) / 6} ${(5 * x2 + x) / 6} ${(5 * y2 + y) / 6} ${(x2 + x) / 2} ${(y2 + y) / 2}`;\n } else {\n this.#drawPathString += `L${x} ${y}`;\n }\n drawPoints.push(x, y);\n this.#drawPath.setAttribute(\"d\", this.#drawPathString);\n },\n listenerDrawOptions\n );\n this.#drawSVG.addEventListener(\n \"pointerup\",\n evt => {\n const { pointerId: pId } = evt;\n if (!isNaN(currentPointerId) && currentPointerId !== pId) {\n return;\n }\n currentPointerId = NaN;\n evt.preventDefault();\n this.#drawSVG.releasePointerCapture(pId);\n finishDrawAC.abort();\n if (this.#drawPoints.length === 2) {\n this.#drawPathString += `L${this.#drawPoints[0]} ${this.#drawPoints[1]}`;\n this.#drawPath.setAttribute(\"d\", this.#drawPathString);\n }\n },\n listenerDrawOptions\n );\n };\n if (this.#drawCurves) {\n this.#drawSVG.addEventListener(\"pointerdown\", drawCallback, options);\n } else {\n this.#drawPlaceholder.addEventListener(\n \"pointerdown\",\n drawCallback,\n options\n );\n }\n this.#drawThickness.addEventListener(\n \"input\",\n () => {\n const { value: thickness } = this.#drawThickness;\n this.#drawThickness.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ thickness })\n );\n if (!this.#drawCurves) {\n return;\n }\n this.#drawPath.setAttribute(\"stroke-width\", thickness);\n this.#drawCurves.thickness = thickness;\n },\n options\n );\n }\n\n #showError(type) {\n this.#errorTitle.setAttribute(\n \"data-l10n-id\",\n SignatureManager.#l10nDescription[`error${type}Title`]\n );\n this.#errorDescription.setAttribute(\n \"data-l10n-id\",\n SignatureManager.#l10nDescription[`error${type}Description`]\n );\n this.#errorBar.hidden = false;\n }\n\n #initImageTab(reset) {\n if (reset) {\n this.#resetTab(\"image\");\n }\n\n this.#disableButtons(this.#imagePath);\n\n const { signal } = this.#currentTabAC;\n const options = { signal };\n const passiveOptions = { passive: true, signal };\n this.#imagePickerLink.addEventListener(\n \"keydown\",\n e => {\n const { key } = e;\n if (key === \"Enter\" || key === \" \") {\n stopEvent(e);\n this.#imagePicker.click();\n }\n },\n options\n );\n this.#imagePicker.addEventListener(\n \"click\",\n () => {\n this.#dialog.classList.toggle(\"waiting\", true);\n },\n passiveOptions\n );\n this.#imagePicker.addEventListener(\n \"change\",\n async () => {\n const file = this.#imagePicker.files?.[0];\n if (!file || !SupportedImageMimeTypes.includes(file.type)) {\n this.#showError(\"Upload\");\n this.#dialog.classList.toggle(\"waiting\", false);\n return;\n }\n await this.#extractSignature(file);\n },\n passiveOptions\n );\n this.#imagePicker.addEventListener(\n \"cancel\",\n () => {\n this.#dialog.classList.toggle(\"waiting\", false);\n },\n passiveOptions\n );\n this.#imagePlaceholder.addEventListener(\n \"dragover\",\n e => {\n const { dataTransfer } = e;\n for (const { type } of dataTransfer.items) {\n if (!SupportedImageMimeTypes.includes(type)) {\n continue;\n }\n dataTransfer.dropEffect =\n dataTransfer.effectAllowed === \"copy\" ? \"copy\" : \"move\";\n stopEvent(e);\n return;\n }\n dataTransfer.dropEffect = \"none\";\n },\n options\n );\n this.#imagePlaceholder.addEventListener(\n \"drop\",\n e => {\n const {\n dataTransfer: { files },\n } = e;\n if (!files?.length) {\n return;\n }\n for (const file of files) {\n if (SupportedImageMimeTypes.includes(file.type)) {\n this.#extractSignature(file);\n break;\n }\n }\n stopEvent(e);\n this.#dialog.classList.toggle(\"waiting\", true);\n },\n options\n );\n }\n\n async #extractSignature(file) {\n let data;\n try {\n data = await this.#uiManager.imageManager.getFromFile(file);\n } catch (e) {\n console.error(\"SignatureManager.#extractSignature.\", e);\n }\n if (!data) {\n this.#showError(\"Upload\");\n this.#dialog.classList.toggle(\"waiting\", false);\n return;\n }\n\n const lineData = (this.#extractedSignatureData =\n this.#currentEditor.getFromImage(data.bitmap));\n if (!lineData) {\n this.#showError(\"NoData\");\n this.#dialog.classList.toggle(\"waiting\", false);\n return;\n }\n const { outline } = lineData;\n\n this.#imagePlaceholder.hidden = true;\n this.#disableButtons(true);\n\n const svgFactory = new DOMSVGFactory();\n const path = (this.#imagePath = svgFactory.createElement(\"path\"));\n this.#imageSVG.setAttribute(\"viewBox\", outline.viewBox);\n this.#imageSVG.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\n this.#imageSVG.append(path);\n path.setAttribute(\"d\", outline.toSVGPath());\n this.#tabsToAltText.get(\"image\").default = file.name;\n if (this.#description.value === \"\") {\n this.#description.value = file.name || \"\";\n this.#clearDescription.disabled = this.#description.value === \"\";\n }\n\n this.#dialog.classList.toggle(\"waiting\", false);\n }\n\n #getOutlineForType() {\n return this.#currentEditor.getFromText(\n this.#typeInput.value,\n window.getComputedStyle(this.#typeInput)\n );\n }\n\n #getOutlineForDraw() {\n const { width, height } = this.#drawSVG.getBoundingClientRect();\n return this.#currentEditor.getDrawnSignature(\n this.#drawCurves,\n width,\n height\n );\n }\n\n #reportTelemetry(data) {\n this.#eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n data,\n },\n });\n }\n\n #addToolbarButton(signatureData, uuid, description) {\n const { curves, areContours, thickness, width, height } = signatureData;\n const maxDim = Math.max(width, height);\n const outlineData = SignatureExtractor.processDrawnLines({\n lines: {\n curves,\n thickness,\n width,\n height,\n },\n pageWidth: maxDim,\n pageHeight: maxDim,\n rotation: 0,\n innerMargin: 0,\n mustSmooth: false,\n areContours,\n });\n if (!outlineData) {\n return;\n }\n\n const { outline } = outlineData;\n const svgFactory = new DOMSVGFactory();\n\n const div = document.createElement(\"div\");\n const button = document.createElement(\"button\");\n\n button.addEventListener(\"click\", () => {\n this.#eventBus.dispatch(\"switchannotationeditorparams\", {\n source: this,\n type: AnnotationEditorParamsType.CREATE,\n value: {\n signatureData: {\n lines: {\n curves,\n thickness,\n width,\n height,\n },\n mustSmooth: false,\n areContours,\n description,\n uuid,\n heightInPage: DEFAULT_HEIGHT_IN_PAGE,\n },\n },\n });\n });\n div.append(button);\n div.classList.add(\"toolbarAddSignatureButtonContainer\");\n\n const svg = svgFactory.create(1, 1, true);\n button.append(svg);\n\n const span = document.createElement(\"span\");\n span.ariaHidden = true;\n button.append(span);\n\n button.classList.add(\"toolbarAddSignatureButton\");\n button.type = \"button\";\n span.textContent = description;\n button.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-add-saved-signature-button\"\n );\n button.setAttribute(\"data-l10n-args\", JSON.stringify({ description }));\n button.tabIndex = 0;\n\n const path = svgFactory.createElement(\"path\");\n svg.append(path);\n svg.setAttribute(\"viewBox\", outline.viewBox);\n svg.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\n if (areContours) {\n path.classList.add(\"contours\");\n }\n path.setAttribute(\"d\", outline.toSVGPath());\n\n const deleteButton = document.createElement(\"button\");\n div.append(deleteButton);\n deleteButton.classList.add(\"toolbarButton\", \"deleteButton\");\n deleteButton.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-delete-signature-button1\"\n );\n deleteButton.type = \"button\";\n deleteButton.tabIndex = 0;\n deleteButton.addEventListener(\"click\", async () => {\n if (await this.#signatureStorage.delete(uuid)) {\n div.remove();\n this.#reportTelemetry({\n type: \"signature\",\n action: \"pdfjs.signature.delete_saved\",\n data: {\n savedCount: await this.#signatureStorage.size(),\n },\n });\n }\n });\n const deleteSpan = document.createElement(\"span\");\n deleteButton.append(deleteSpan);\n deleteSpan.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-delete-signature-button-label1\"\n );\n\n this.#addSignatureToolbarButton.before(div);\n }\n\n async #signaturesChanged() {\n const parent = this.#addSignatureToolbarButton.parentElement;\n while (parent.firstElementChild !== this.#addSignatureToolbarButton) {\n parent.firstElementChild.remove();\n }\n this.#loadSignaturesPromise = null;\n await this.loadSignatures(/* reload = */ true);\n }\n\n getSignature(params) {\n return this.open(params);\n }\n\n async loadSignatures(reload = false) {\n if (\n !this.#addSignatureToolbarButton ||\n (!reload && this.#addSignatureToolbarButton.previousElementSibling) ||\n !this.#signatureStorage\n ) {\n return;\n }\n\n if (!this.#loadSignaturesPromise) {\n // The first call of loadSignatures() starts loading the signatures.\n // The second one will wait until the signatures are loaded in the DOM.\n this.#loadSignaturesPromise = this.#signatureStorage\n .getAll()\n .then(async signatures => [\n signatures,\n await Promise.all(\n Array.from(signatures.values(), ({ signatureData }) =>\n SignatureExtractor.decompressSignature(signatureData)\n )\n ),\n ]);\n if (!reload) {\n return;\n }\n }\n const [signatures, signaturesData] = await this.#loadSignaturesPromise;\n this.#loadSignaturesPromise = null;\n\n let i = 0;\n for (const [uuid, { description }] of signatures) {\n const data = signaturesData[i++];\n if (!data) {\n continue;\n }\n data.curves = data.outlines.map(points => ({ points }));\n delete data.outlines;\n this.#addToolbarButton(data, uuid, description);\n }\n }\n\n async renderEditButton(editor) {\n const button = document.createElement(\"button\");\n button.classList.add(\"altText\", \"editDescription\");\n button.tabIndex = 0;\n if (editor.description) {\n button.title = editor.description;\n }\n const span = document.createElement(\"span\");\n button.append(span);\n span.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-editor-add-signature-edit-button-label\"\n );\n button.addEventListener(\n \"click\",\n () => {\n this.#editDescriptionDialog.open(editor);\n },\n { passive: true }\n );\n return button;\n }\n\n async open({ uiManager, editor }) {\n this.#tabsToAltText ||= new Map(\n this.#tabButtons.keys().map(name => [name, { value: \"\", default: \"\" }])\n );\n this.#uiManager = uiManager;\n this.#currentEditor = editor;\n this.#uiManager.removeEditListeners();\n\n const isStorageFull = (this.#isStorageFull =\n await this.#signatureStorage.isFull());\n this.#saveContainer.classList.toggle(\"fullStorage\", isStorageFull);\n this.#saveCheckbox.checked = !isStorageFull;\n\n await this.#overlayManager.open(this.#dialog);\n\n const tabType = this.#tabButtons.get(\"type\");\n tabType.focus();\n tabType.click();\n }\n\n #cancel() {\n this.#finish();\n }\n\n #finish() {\n this.#overlayManager.closeIfActive(this.#dialog);\n }\n\n #close() {\n if (this.#currentEditor._drawId === null) {\n this.#currentEditor.remove();\n }\n this.#uiManager?.addEditListeners();\n this.#currentTabAC?.abort();\n this.#currentTabAC = null;\n this.#uiManager = null;\n this.#currentEditor = null;\n\n this.#resetCommon();\n for (const [name] of this.#tabButtons) {\n this.#resetTab(name);\n }\n this.#disableButtons(false);\n this.#currentTab = null;\n this.#tabsToAltText = null;\n }\n\n async #add() {\n let data;\n const type = this.#currentTab;\n switch (type) {\n case \"type\":\n data = this.#getOutlineForType();\n break;\n case \"draw\":\n data = this.#getOutlineForDraw();\n break;\n case \"image\":\n data = this.#extractedSignatureData;\n break;\n }\n let uuid = null;\n const description = this.#description.value;\n if (this.#saveCheckbox.checked) {\n const { newCurves, areContours, thickness, width, height } = data;\n const signatureData = await SignatureExtractor.compressSignature({\n outlines: newCurves,\n areContours,\n thickness,\n width,\n height,\n });\n uuid = await this.#signatureStorage.create({\n description,\n signatureData,\n });\n if (uuid) {\n this.#addToolbarButton(\n {\n curves: newCurves.map(points => ({ points })),\n areContours,\n thickness,\n width,\n height,\n },\n uuid,\n description\n );\n } else {\n console.warn(\"SignatureManager.add: cannot save the signature.\");\n }\n }\n\n const altText = this.#tabsToAltText.get(type);\n this.#reportTelemetry({\n type: \"signature\",\n action: \"pdfjs.signature.created\",\n data: {\n type,\n saved: !!uuid,\n savedCount: await this.#signatureStorage.size(),\n descriptionChanged: description !== altText.default,\n },\n });\n\n this.#currentEditor.addSignature(\n data,\n DEFAULT_HEIGHT_IN_PAGE,\n this.#description.value,\n uuid\n );\n\n this.#finish();\n }\n\n destroy() {\n this.#uiManager = null;\n this.#finish();\n }\n}\n\nclass EditDescriptionDialog {\n #currentEditor;\n\n #previousDescription;\n\n #description;\n\n #dialog;\n\n #overlayManager;\n\n #signatureSVG;\n\n #uiManager;\n\n constructor(\n { dialog, description, cancelButton, updateButton, editSignatureView },\n overlayManager\n ) {\n const descriptionInput = (this.#description =\n description.firstElementChild);\n this.#signatureSVG = editSignatureView;\n this.#dialog = dialog;\n this.#overlayManager = overlayManager;\n\n dialog.addEventListener(\"close\", this.#close.bind(this));\n dialog.addEventListener(\"contextmenu\", e => {\n if (e.target !== this.#description) {\n e.preventDefault();\n }\n });\n cancelButton.addEventListener(\"click\", this.#cancel.bind(this));\n updateButton.addEventListener(\"click\", this.#update.bind(this));\n\n const clearDescription = description.lastElementChild;\n clearDescription.addEventListener(\"click\", () => {\n descriptionInput.value = \"\";\n clearDescription.disabled = true;\n updateButton.disabled = this.#previousDescription === \"\";\n });\n descriptionInput.addEventListener(\n \"input\",\n () => {\n const { value } = descriptionInput;\n clearDescription.disabled = value === \"\";\n updateButton.disabled = value === this.#previousDescription;\n editSignatureView.setAttribute(\"aria-label\", value);\n },\n { passive: true }\n );\n\n overlayManager.register(dialog);\n }\n\n async open(editor) {\n this.#uiManager = editor._uiManager;\n this.#currentEditor = editor;\n this.#previousDescription = this.#description.value = editor.description;\n this.#description.dispatchEvent(new Event(\"input\"));\n this.#uiManager.removeEditListeners();\n const { areContours, outline } = editor.getSignaturePreview();\n const svgFactory = new DOMSVGFactory();\n const path = svgFactory.createElement(\"path\");\n this.#signatureSVG.append(path);\n this.#signatureSVG.setAttribute(\"viewBox\", outline.viewBox);\n path.setAttribute(\"d\", outline.toSVGPath());\n if (areContours) {\n path.classList.add(\"contours\");\n }\n\n await this.#overlayManager.open(this.#dialog);\n }\n\n async #update() {\n // The description has been changed because the button isn't disabled.\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.signature.edit_description\",\n data: {\n hasBeenChanged: true,\n },\n });\n this.#currentEditor.description = this.#description.value;\n this.#finish();\n }\n\n #cancel() {\n this.#currentEditor._reportTelemetry({\n action: \"pdfjs.signature.edit_description\",\n data: {\n hasBeenChanged: false,\n },\n });\n this.#finish();\n }\n\n #finish() {\n this.#overlayManager.closeIfActive(this.#dialog);\n }\n\n #close() {\n this.#uiManager?.addEditListeners();\n this.#uiManager = null;\n this.#currentEditor = null;\n this.#signatureSVG.firstElementChild.remove();\n }\n}\n\nexport { SignatureManager };\n","/* Copyright 2026 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, makeArr, PDFDateString } from \"pdfjs-lib\";\n\n// Per-status descriptor keyed by the status code returned by the verifier.\n// `priority` drives worst-status aggregation, `severity` drives the banner\n// colour bucket, and the two Fluent IDs are the explicit strings used by\n// the banner / status rows (no `${status}` template construction so the\n// IDs are greppable).\n// The status row only ever shows one of three distinct strings: the\n// signature crypto verified, the signature is invalid, or the format is\n// unsupported. Cert chain issues (untrusted / expired / revoked) live\n// on the cert row, so those statuses still report \"Signature verified\"\n// on the status row.\nconst STATUS_ROW_VERIFIED =\n \"pdfjs-digital-signature-properties-status-verified\";\nconst STATUS_ROW_INVALID = \"pdfjs-digital-signature-properties-status-invalid\";\nconst STATUS_ROW_UNKNOWN = \"pdfjs-digital-signature-properties-status-unknown\";\n\nconst STATUS_INFO = {\n verified: {\n priority: 0,\n severity: \"verified\",\n bannerId: \"pdfjs-digital-signature-properties-banner-verified\",\n statusId: STATUS_ROW_VERIFIED,\n },\n unknown: {\n priority: 1,\n severity: \"error\",\n bannerId: \"pdfjs-digital-signature-properties-banner-unknown\",\n statusId: STATUS_ROW_UNKNOWN,\n },\n untrusted: {\n priority: 2,\n severity: \"warn\",\n bannerId: \"pdfjs-digital-signature-properties-banner-untrusted\",\n statusId: STATUS_ROW_VERIFIED,\n },\n expired: {\n priority: 3,\n severity: \"warn\",\n bannerId: \"pdfjs-digital-signature-properties-banner-expired\",\n statusId: STATUS_ROW_VERIFIED,\n },\n revoked: {\n priority: 4,\n severity: \"error\",\n bannerId: \"pdfjs-digital-signature-properties-banner-revoked\",\n statusId: STATUS_ROW_VERIFIED,\n },\n invalid: {\n priority: 5,\n severity: \"error\",\n bannerId: \"pdfjs-digital-signature-properties-banner-invalid\",\n statusId: STATUS_ROW_INVALID,\n },\n};\n\nconst CERT_L10N_IDS = {\n trusted: \"pdfjs-digital-signature-properties-certificate-trusted\",\n unknown: \"pdfjs-digital-signature-properties-certificate-unknown\",\n untrusted: \"pdfjs-digital-signature-properties-certificate-untrusted\",\n expired: \"pdfjs-digital-signature-properties-certificate-expired\",\n revoked: \"pdfjs-digital-signature-properties-certificate-revoked\",\n};\n\nconst CERT_EXPIRED_WITH_DATE_L10N_ID =\n \"pdfjs-digital-signature-properties-certificate-expired-with-date\";\n\n// For an `untrusted` certificate, pick the most specific Fluent label.\n// When the error code matches one of the recognised cases we have a\n// structured \"Certificate: <reason> (<issuer>)\" string; otherwise we\n// fall back to the bare \"Certificate: Untrusted\".\nfunction untrustedCertLabel(errorCode, issuerCN) {\n const code = (errorCode || \"\").toUpperCase();\n const args = issuerCN ? { issuer: issuerCN } : null;\n if (code.includes(\"UNKNOWN_ISSUER\") && args) {\n return {\n id: \"pdfjs-digital-signature-properties-certificate-untrusted-unknown-issuer\",\n args,\n };\n }\n if (code.includes(\"SELF_SIGNED\") && args) {\n return {\n id: \"pdfjs-digital-signature-properties-certificate-untrusted-self-signed\",\n args,\n };\n }\n if (code.includes(\"UNTRUSTED_ISSUER\") && args) {\n return {\n id: \"pdfjs-digital-signature-properties-certificate-untrusted-untrusted-issuer\",\n args,\n };\n }\n return {\n id: \"pdfjs-digital-signature-properties-certificate-untrusted\",\n args: null,\n };\n}\n\n// For an `expired` certificate: NSS may have flagged either the leaf\n// (SEC_ERROR_EXPIRED_CERTIFICATE) or any issuer up the chain\n// (SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE). We want the parenthetical\n// to show the date that actually expired, so walk leaf + chain and\n// return the first notAfter that is already in the past as a Date.\n// If nothing is in the past we return null and the caller renders the\n// generic \"Certificate: Expired\" label without a date.\nfunction expirationDateForCert(cert) {\n if (!cert) {\n return null;\n }\n const now = Date.now();\n const entries =\n Array.isArray(cert.chain) && cert.chain.length ? cert.chain : [cert];\n // Return the first past notAfter in the chain — that's the cert that\n // actually caused the \"expired\" verdict. We deliberately do NOT fall\n // back to a future date if no past date is found: NSS sometimes does\n // not surface the expired issuer in `signerCertificate.issuer`, in\n // which case the chain only has the leaf with a still-valid notAfter.\n // Showing that as \"Expired (Jan 1, 2027)\" would be misleading, so the\n // caller renders the dateless label instead.\n for (const entry of entries) {\n if (typeof entry?.notAfter !== \"string\" || !entry.notAfter) {\n continue;\n }\n const date = new Date(entry.notAfter);\n const ts = date.getTime();\n if (Number.isFinite(ts) && ts < now) {\n return date;\n }\n }\n return null;\n}\n\nclass SignaturePropertiesManager {\n #appConfig;\n\n #verifier;\n\n #eventBus;\n\n #signatures = [];\n\n #results = new Map(); // signatureId -> VerificationResult\n\n #pendingVerify = new Set(); // signatureId set, in-flight\n\n #isOpen = false;\n\n #isLoading = false;\n\n // Set whenever state changes while the panel is closed, so that opening it\n // forces a fresh render. While the panel is hidden, building the list /\n // banner DOM is pure churn — only the toolbar button is visible, and that\n // is updated via #updateButtonState().\n #needsRender = false;\n\n #pdfDocument = null;\n\n constructor({ appConfig, verifier, eventBus }) {\n this.#appConfig = appConfig;\n this.#verifier = verifier;\n this.#eventBus = eventBus;\n\n const button = appConfig.signaturePropertiesButton;\n // Loading dots: three real spans (hidden by `.toolbarButton > span`)\n // that the `state-loading` CSS modifier turns into pulsing circles\n // with staggered `animation-delay`. Real elements (not gradient\n // keyframes) let each dot animate independently.\n for (let i = 0; i < 3; i++) {\n const dot = document.createElement(\"span\");\n dot.className = \"loadingDot\";\n button.append(dot);\n }\n button.addEventListener(\"click\", () => {\n this.#toggle();\n });\n }\n\n /**\n * @returns {boolean} `true` while the doorhanger is visible.\n */\n get isOpen() {\n return this.#isOpen;\n }\n\n /**\n * Close the doorhanger if it is open. The viewer's existing Escape\n * handler and outside-click logic call this — the manager doesn't\n * register its own document-level listeners.\n */\n close() {\n if (this.#isOpen) {\n this.#close();\n }\n }\n\n /**\n * @param {Element} target Click target. The viewer's outside-click\n * handler uses this to decide whether to close the panel.\n * @returns {boolean} `true` if the click is outside both the toolbar\n * button and the doorhanger and the panel should be closed.\n */\n shouldCloseOnClick(target) {\n if (!this.#isOpen) {\n return false;\n }\n return !(\n this.#appConfig.signaturePropertiesButton.contains(target) ||\n this.#appConfig.signaturePropertiesPanel.contains(target)\n );\n }\n\n async setDocument(pdfDocument) {\n if (this.#pdfDocument) {\n this.#signatures = [];\n this.#results.clear();\n this.#pendingVerify.clear();\n this.#needsRender = false;\n this.#hideButton();\n this.#close();\n this.#updateButtonState();\n }\n this.#pdfDocument = pdfDocument;\n\n if (!pdfDocument) {\n return;\n }\n this.#isLoading = true;\n this.#render();\n\n let signatures;\n try {\n signatures = await pdfDocument.getSignatures();\n } catch (ex) {\n console.warn(\"getSignatures failed:\", ex);\n }\n if (pdfDocument !== this.#pdfDocument) {\n return;\n }\n this.#signatures = signatures || [];\n this.#isLoading = false;\n\n if (this.#signatures.length === 0) {\n this.#hideButton();\n return;\n }\n this.#showButton();\n\n // Seed each signature with an \"unknown\" placeholder result so the\n // banner / badge / cards have something to render while the worker\n // verifies them in the background.\n for (const sig of this.#signatures) {\n this.#results.set(sig.id, {\n status: \"unknown\",\n errorCode: null,\n message: null,\n certificate: null,\n documentModifiedAfterSigning: !sig.coversWholeDocument,\n modificationsAfterSignature: sig.modificationsAfterSignature,\n });\n }\n this.#render();\n this.#updateButtonState();\n // Kick off verification automatically — the toolbar button reflects the\n // aggregate state and updates as each signature resolves.\n for (const sig of this.#signatures) {\n this.#verify(sig, pdfDocument);\n }\n }\n\n #showButton() {\n const root = this.#appConfig.signaturePropertiesButton.parentElement;\n if (root) {\n root.hidden = false;\n }\n // The separator only makes sense when our toolbar group is visible.\n const sep = this.#appConfig.signaturePropertiesSeparator;\n if (sep) {\n sep.hidden = false;\n }\n }\n\n #hideButton() {\n const root = this.#appConfig.signaturePropertiesButton.parentElement;\n if (root) {\n root.hidden = true;\n }\n const sep = this.#appConfig.signaturePropertiesSeparator;\n if (sep) {\n sep.hidden = true;\n }\n }\n\n #toggle() {\n if (this.#isOpen) {\n this.#close();\n } else {\n this.#open();\n }\n }\n\n #open() {\n this.#isOpen = true;\n // Close any other open editor doorhanger (Ink, FreeText, Highlight, …)\n // and the find bar / secondary toolbar via global onClick — same pattern\n // the Comment doorhanger uses.\n this.#eventBus?.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode: AnnotationEditorType.NONE,\n });\n this.#eventBus?.dispatch(\"findbarclose\", { source: this });\n this.#appConfig.signaturePropertiesPanel.classList.remove(\"hidden\");\n this.#appConfig.signaturePropertiesButton.setAttribute(\n \"aria-expanded\",\n \"true\"\n );\n if (this.#needsRender) {\n this.#render();\n }\n }\n\n #close() {\n this.#isOpen = false;\n this.#appConfig.signaturePropertiesPanel.classList.add(\"hidden\");\n this.#appConfig.signaturePropertiesButton.setAttribute(\n \"aria-expanded\",\n \"false\"\n );\n }\n\n get #worst() {\n let worst = \"verified\";\n for (const r of this.#results.values()) {\n if (\n r?.status &&\n STATUS_INFO[r.status].priority > STATUS_INFO[worst].priority\n ) {\n worst = r.status;\n }\n }\n return worst;\n }\n\n get #bannerState() {\n if (this.#results.size === 0) {\n return { worst: \"unknown\", severity: \"error\", count: 0 };\n }\n const worst = this.#worst;\n let count = 0;\n // Count how many signatures are at the worst level — this drives the\n // singular/plural variant of the banner message.\n for (const r of this.#results.values()) {\n if (r?.status === worst) {\n count++;\n }\n }\n return { worst, severity: STATUS_INFO[worst].severity, count };\n }\n\n #render() {\n if (!this.#isOpen) {\n // Defer DOM work until the user actually opens the panel.\n this.#needsRender = true;\n return;\n }\n this.#needsRender = false;\n const list = this.#appConfig.signaturePropertiesList;\n const banner = this.#appConfig.signaturePropertiesBanner;\n const fragment = document.createDocumentFragment();\n\n if (this.#isLoading) {\n // The worker call that populates `#signatures` resolves in tens of\n // milliseconds — fast enough that we'd rather show nothing than\n // flash a placeholder. The toolbar button's loading-dot animation\n // already conveys \"work in progress\".\n banner.hidden = true;\n list.replaceChildren();\n return;\n }\n\n // Banner.\n const { worst, severity, count } = this.#bannerState;\n banner.replaceChildren();\n banner.hidden = false;\n banner.className = `sigBanner ${severity}`;\n banner.setAttribute(\"data-l10n-id\", STATUS_INFO[worst].bannerId);\n banner.setAttribute(\"data-l10n-args\", JSON.stringify({ count }));\n\n // Group sub-signatures under their parent.\n const byParent = new Map();\n const topLevel = [];\n for (const sig of this.#signatures) {\n if (sig.parentId) {\n byParent.getOrInsertComputed(sig.parentId, makeArr).push(sig);\n } else {\n topLevel.push(sig);\n }\n }\n\n // Green icons are reserved for the top-level card when *every*\n // signature in the document is verified. Anywhere else (any\n // sub-signature, or a top-level when something further down is\n // expired/untrusted/etc.) keeps the muted grey check.\n const everythingFine = severity === \"verified\";\n\n for (const sig of topLevel) {\n fragment.append(\n this.#renderCard(sig, byParent, /* depth = */ 0, everythingFine)\n );\n }\n list.replaceChildren(fragment);\n }\n\n #renderCard(sig, byParent, depth, everythingFine) {\n const subs = byParent.get(sig.id) || [];\n const li = document.createElement(\"li\");\n li.classList.add(\"sigCard\");\n if (depth === 0 && everythingFine) {\n li.classList.add(\"sigCard--top-allfine\");\n }\n\n const result = this.#results.get(sig.id);\n\n const subjectCN = result?.certificate?.subjectCN;\n if (subjectCN) {\n const signer = document.createElement(\"div\");\n signer.className = \"signer\";\n signer.textContent = subjectCN;\n li.append(signer);\n }\n\n // Status row.\n const statusRow = document.createElement(\"div\");\n statusRow.classList.add(\"row\", `status--${result.status}`);\n const statusLabel = document.createElement(\"span\");\n statusLabel.setAttribute(\n \"data-l10n-id\",\n STATUS_INFO[result.status].statusId\n );\n statusRow.append(statusLabel);\n li.append(statusRow);\n\n if (result.status === \"invalid\" && result.message) {\n const reason = document.createElement(\"div\");\n reason.className = \"detail\";\n reason.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-digital-signature-properties-reason\"\n );\n reason.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ reason: result.message })\n );\n li.append(reason);\n }\n\n // Certificate row — skipped when the signature itself is invalid:\n // NSS doesn't return a signerCertificate in that case, so the row\n // would be empty noise next to the more informative \"Reason: …\"\n // line.\n const cert = result.certificate;\n let certKind = \"unknown\";\n if (cert) {\n switch (result.status) {\n case \"verified\":\n certKind = \"trusted\";\n break;\n case \"expired\":\n certKind = \"expired\";\n break;\n case \"revoked\":\n certKind = \"revoked\";\n break;\n case \"untrusted\":\n certKind = \"untrusted\";\n break;\n default:\n certKind = \"unknown\";\n }\n }\n if (result.status !== \"invalid\") {\n const certRow = document.createElement(\"div\");\n certRow.classList.add(\"row\", `cert--${certKind}`);\n const certLabel = document.createElement(\"span\");\n let l10nId = CERT_L10N_IDS[certKind];\n let l10nArgs = null;\n if (cert?.issuerCN && certKind === \"trusted\") {\n l10nArgs = { issuer: cert.issuerCN };\n } else if (certKind === \"expired\") {\n // For expired, the parenthetical is the expiration date itself\n // (could be the leaf or any issuer up the chain). Pass a Date\n // through Fluent so the viewer locale formats it, not the\n // browser locale.\n const date = expirationDateForCert(cert);\n if (date) {\n l10nId = CERT_EXPIRED_WITH_DATE_L10N_ID;\n l10nArgs = { dateObj: date.valueOf() };\n }\n } else if (certKind === \"untrusted\") {\n const label = untrustedCertLabel(result.errorCode, cert?.issuerCN);\n l10nId = label.id;\n l10nArgs = label.args;\n }\n certLabel.setAttribute(\"data-l10n-id\", l10nId);\n if (l10nArgs) {\n certLabel.setAttribute(\"data-l10n-args\", JSON.stringify(l10nArgs));\n }\n certRow.append(certLabel);\n li.append(certRow);\n }\n\n if (result.status === \"untrusted\" && result.message) {\n const detail = document.createElement(\"div\");\n detail.className = \"detail\";\n detail.textContent = result.message;\n li.append(detail);\n }\n if (result.status === \"expired\" && result.message) {\n const detail = document.createElement(\"div\");\n detail.className = \"detail\";\n detail.textContent = result.message;\n li.append(detail);\n }\n\n const signingDate = PDFDateString.toDateObject(sig.signingTime);\n if (signingDate) {\n const ts = document.createElement(\"div\");\n ts.className = \"detail\";\n ts.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-digital-signature-properties-timestamp\"\n );\n ts.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ dateObj: signingDate.valueOf() })\n );\n li.append(ts);\n }\n\n if (cert && typeof this.#verifier?.viewCertificate === \"function\") {\n const viewCert = document.createElement(\"button\");\n viewCert.className = \"viewCert\";\n viewCert.type = \"button\";\n viewCert.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-digital-signature-properties-view-certificate\"\n );\n viewCert.addEventListener(\"click\", e => {\n e.stopPropagation();\n this.#verifier.viewCertificate(cert);\n });\n li.append(viewCert);\n }\n\n if (subs.length > 0) {\n const subList = document.createElement(\"ul\");\n subList.classList.add(\"signaturePropertiesList\", \"nested\");\n for (const sub of subs) {\n subList.append(\n this.#renderCard(sub, byParent, depth + 1, everythingFine)\n );\n }\n\n if (depth === 0) {\n // Only the top-level card gets the collapsible header. Deeper\n // signatures are always rendered inline; the nested border + indent\n // already shows the parent→child relationship.\n const details = document.createElement(\"details\");\n details.className = \"subSignatures\";\n details.open = true;\n const summary = document.createElement(\"summary\");\n summary.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-digital-signature-properties-sub-signatures\"\n );\n summary.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ count: this.#countDescendants(sig.id, byParent) })\n );\n details.append(summary);\n details.append(subList);\n li.append(details);\n } else {\n li.append(subList);\n }\n }\n\n // Note: per-card progress is already conveyed via the toolbar\n // button's loading-dot animation (state-loading class) — we used to\n // drop an additional pulsing bar at the bottom of each in-flight\n // card but it was visual noise without clear meaning.\n\n return li;\n }\n\n #countDescendants(id, byParent) {\n const direct = byParent.get(id);\n if (!direct) {\n return 0;\n }\n let total = direct.length;\n for (const sub of direct) {\n total += this.#countDescendants(sub.id, byParent);\n }\n return total;\n }\n\n async #verify(signature, pdfDocument) {\n if (!this.#verifier || this.#pendingVerify.has(signature.id)) {\n return;\n }\n this.#pendingVerify.add(signature.id);\n this.#render();\n\n let result;\n try {\n // Fetch the signature's byte payload (pkcs7 + signed-data spans)\n // lazily, one signature at a time, so the bytes never sit in main\n // thread memory for the document's lifetime. `bytes` goes out of\n // scope as soon as the verifier returns.\n const bytes = await pdfDocument.getSignatureData(signature.id);\n if (pdfDocument !== this.#pdfDocument) {\n return;\n }\n if (!bytes) {\n throw new Error(\"missing signature data\");\n }\n result = await this.#verifier.verify({ ...signature, ...bytes });\n } catch (ex) {\n console.warn(\"signature verify failed:\", ex);\n result = {\n status: \"unknown\",\n errorCode: \"BRIDGE_ERROR\",\n message: ex?.message ?? null,\n certificate: null,\n documentModifiedAfterSigning: !signature.coversWholeDocument,\n modificationsAfterSignature: signature.modificationsAfterSignature,\n };\n }\n this.#pendingVerify.delete(signature.id);\n if (pdfDocument !== this.#pdfDocument) {\n // The user switched documents while this verify was in flight; the\n // result belongs to a defunct load and would corrupt the new doc.\n return;\n }\n this.#results.set(signature.id, result);\n this.#render();\n this.#updateButtonState();\n }\n\n #updateButtonState() {\n const button = this.#appConfig.signaturePropertiesButton;\n button.classList.remove(\n \"state-loading\",\n \"state-verified\",\n \"state-warn\",\n \"state-error\"\n );\n if (this.#signatures.length === 0) {\n return;\n }\n if (this.#pendingVerify.size > 0) {\n button.classList.add(\"state-loading\");\n return;\n }\n switch (this.#worst) {\n case \"invalid\":\n case \"revoked\":\n case \"unknown\":\n // `unknown` means the verifier completed but could not give a\n // definitive answer (unsupported subfilter, bridge error,\n // CMS NOT_YET_ATTEMPTED). Treat that as a verification failure\n // — the loading dots are reserved for the in-flight case\n // handled above.\n button.classList.add(\"state-error\");\n break;\n case \"expired\":\n case \"untrusted\":\n button.classList.add(\"state-warn\");\n break;\n default:\n button.classList.add(\"state-verified\");\n }\n }\n}\n\nexport { SignaturePropertiesManager };\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\n/** @typedef {import(\"./event_utils.js\").EventBus} EventBus */\n\nimport { AnnotationEditorType, ColorPicker, noContextMenu } from \"pdfjs-lib\";\nimport {\n DEFAULT_SCALE,\n DEFAULT_SCALE_VALUE,\n MAX_SCALE,\n MIN_SCALE,\n toggleExpandedBtn,\n} from \"./ui_utils.js\";\nimport { internalOpt } from \"./internal_evt.js\";\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} editorFreeTextButton - Button to switch to\n * FreeText editing.\n * @property {HTMLButtonElement} download - Button to download the document.\n */\n\nclass Toolbar {\n #colorPicker = null;\n\n #opts;\n\n /**\n * @param {ToolbarOptions} options\n * @param {EventBus} eventBus\n * @param {number} toolbarDensity - The toolbar density value.\n * The possible values are:\n * - 0 (default) - The regular toolbar size.\n * - 1 (compact) - The small toolbar size.\n * - 2 (touch) - The large toolbar size.\n */\n constructor(options, eventBus, toolbarDensity = 0) {\n this.#opts = options;\n this.eventBus = eventBus;\n const 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.editorCommentButton,\n eventName: \"switchannotationeditormode\",\n eventDetails: {\n get mode() {\n const { classList } = options.editorCommentButton;\n return classList.contains(\"toggled\")\n ? AnnotationEditorType.NONE\n : AnnotationEditorType.POPUP;\n },\n },\n },\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.editorHighlightButton,\n eventName: \"switchannotationeditormode\",\n eventDetails: {\n get mode() {\n const { classList } = options.editorHighlightButton;\n return classList.contains(\"toggled\")\n ? AnnotationEditorType.NONE\n : AnnotationEditorType.HIGHLIGHT;\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 telemetry: {\n type: \"editing\",\n data: { action: \"pdfjs.image.icon_click\" },\n },\n },\n {\n element: options.editorSignatureButton,\n eventName: \"switchannotationeditormode\",\n eventDetails: {\n get mode() {\n const { classList } = options.editorSignatureButton;\n return classList.contains(\"toggled\")\n ? AnnotationEditorType.NONE\n : AnnotationEditorType.SIGNATURE;\n },\n },\n },\n ];\n\n // Bind the event listeners for click and various other actions.\n this.#bindListeners(buttons);\n\n this.#updateToolbarDensity({ value: toolbarDensity });\n this.reset();\n }\n\n #updateToolbarDensity({ value }) {\n let name = \"normal\";\n switch (value) {\n case 1:\n name = \"compact\";\n break;\n case 2:\n name = \"touch\";\n break;\n }\n document.documentElement.setAttribute(\"data-toolbar-density\", name);\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.#colorPicker = null;\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.#editorModeChanged({ mode: AnnotationEditorType.DISABLE });\n }\n\n #bindListeners(buttons) {\n const { eventBus } = this;\n const {\n editorHighlightColorPicker,\n editorHighlightButton,\n pageNumber,\n scaleSelect,\n } = this.#opts;\n const self = this;\n\n // The buttons within the toolbar.\n for (const { element, eventName, eventDetails, telemetry } of buttons) {\n element.addEventListener(\"click\", evt => {\n if (eventName !== null) {\n eventBus.dispatch(eventName, {\n source: this,\n ...eventDetails,\n // evt.detail is the number of clicks.\n isFromKeyboard: evt.detail === 0,\n });\n }\n if (telemetry) {\n eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: telemetry,\n });\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 eventBus.dispatch(\"pagenumberchanged\", {\n source: self,\n value: this.value,\n });\n });\n eventBus.on(\n \"pagesedited\",\n ({ pagesMapper }) => {\n const pagesCount = pagesMapper.pagesNumber;\n if (pagesCount !== this.pagesCount) {\n this.setPagesCount(pagesCount, this.hasPageLabels);\n }\n },\n internalOpt\n );\n\n scaleSelect.addEventListener(\"change\", function () {\n if (this.value === \"custom\") {\n return;\n }\n 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 ({ 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 eventBus.on(\n \"annotationeditormodechanged\",\n this.#editorModeChanged.bind(this),\n internalOpt\n );\n eventBus.on(\n \"showannotationeditorui\",\n ({ mode }) => {\n switch (mode) {\n case AnnotationEditorType.HIGHLIGHT:\n editorHighlightButton.click();\n break;\n }\n },\n internalOpt\n );\n eventBus.on(\n \"toolbardensity\",\n this.#updateToolbarDensity.bind(this),\n internalOpt\n );\n\n if (editorHighlightColorPicker) {\n eventBus.on(\n \"annotationeditoruimanager\",\n ({ uiManager }) => {\n const cp = (this.#colorPicker = new ColorPicker({ uiManager }));\n uiManager.setMainHighlightColorPicker(cp);\n editorHighlightColorPicker.append(cp.renderMainDropdown());\n },\n internalOpt\n );\n\n eventBus.on(\n \"mainhighlightcolorpickerupdatecolor\",\n ({ value }) => {\n this.#colorPicker?.updateColor(value);\n },\n internalOpt\n );\n }\n }\n\n #editorModeChanged({ mode }) {\n const {\n editorCommentButton,\n editorCommentParamsToolbar,\n editorFreeTextButton,\n editorFreeTextParamsToolbar,\n editorHighlightButton,\n editorHighlightParamsToolbar,\n editorInkButton,\n editorInkParamsToolbar,\n editorStampButton,\n editorStampParamsToolbar,\n editorSignatureButton,\n editorSignatureParamsToolbar,\n } = this.#opts;\n\n toggleExpandedBtn(\n editorCommentButton,\n mode === AnnotationEditorType.POPUP,\n editorCommentParamsToolbar\n );\n toggleExpandedBtn(\n editorFreeTextButton,\n mode === AnnotationEditorType.FREETEXT,\n editorFreeTextParamsToolbar\n );\n toggleExpandedBtn(\n editorHighlightButton,\n mode === AnnotationEditorType.HIGHLIGHT,\n editorHighlightParamsToolbar\n );\n toggleExpandedBtn(\n editorInkButton,\n mode === AnnotationEditorType.INK,\n editorInkParamsToolbar\n );\n toggleExpandedBtn(\n editorStampButton,\n mode === AnnotationEditorType.STAMP,\n editorStampParamsToolbar\n );\n toggleExpandedBtn(\n editorSignatureButton,\n mode === AnnotationEditorType.SIGNATURE,\n editorSignatureParamsToolbar\n );\n\n editorCommentButton.disabled =\n editorFreeTextButton.disabled =\n editorHighlightButton.disabled =\n editorInkButton.disabled =\n editorStampButton.disabled =\n editorSignatureButton.disabled =\n mode === AnnotationEditorType.DISABLE;\n }\n\n #updateUIState(resetNumPages = false) {\n const { pageNumber, pagesCount, pageScaleValue, pageScale } = this;\n const opts = this.#opts;\n\n if (resetNumPages) {\n if (this.hasPageLabels) {\n opts.pageNumber.type = \"text\";\n\n opts.numPages.setAttribute(\"data-l10n-id\", \"pdfjs-page-of-pages\");\n } else {\n opts.pageNumber.type = \"number\";\n\n opts.numPages.setAttribute(\"data-l10n-id\", \"pdfjs-of-pages\");\n opts.numPages.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ pagesCount })\n );\n }\n opts.pageNumber.max = pagesCount;\n }\n\n if (this.hasPageLabels) {\n opts.pageNumber.value = this.pageLabel;\n\n opts.numPages.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ pageNumber, pagesCount })\n );\n } else {\n opts.pageNumber.value = pageNumber;\n }\n\n opts.previous.disabled = pageNumber <= 1;\n opts.next.disabled = pageNumber >= pagesCount;\n\n opts.zoomOut.disabled = pageScale <= MIN_SCALE;\n opts.zoomIn.disabled = pageScale >= MAX_SCALE;\n\n let predefinedValueFound = false;\n for (const option of opts.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 opts.customScaleOption.selected = true;\n opts.customScaleOption.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({\n scale: Math.round(pageScale * 10000) / 100,\n })\n );\n }\n }\n\n updateLoadingIndicatorState(loading = false) {\n const { pageNumber } = this.#opts;\n pageNumber.classList.toggle(\"loading\", loading);\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 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\n/** @typedef {import(\"./event_utils.js\").EventBus} EventBus */\n\nimport {\n docStyle,\n PresentationModeState,\n SidebarView,\n toggleExpandedBtn,\n toggleSelectedBtn,\n} from \"./ui_utils.js\";\nimport { internalOpt } from \"./internal_evt.js\";\nimport { Menu } from \"./menu.js\";\nimport { Sidebar } from \"./sidebar.js\";\n\nconst SIDEBAR_WIDTH_VAR = \"--viewsManager-width\";\nconst SIDEBAR_RESIZING_CLASS = \"viewsManagerResizing\";\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 {L10n} 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 {HTMLButtonElement} currentOutlineItemButton - The button used to\n * find the current outline item.\n */\n\nclass ViewsManager extends Sidebar {\n static #l10nDescription = null;\n\n #hasAnimations = !window.matchMedia(\"(prefers-reduced-motion: reduce)\")\n .matches;\n\n /**\n * @param {PDFSidebarOptions} options\n */\n constructor({\n elements: {\n outerContainer,\n sidebarContainer,\n toggleButton,\n resizer,\n thumbnailButton,\n outlineButton,\n attachmentsButton,\n layersButton,\n thumbnailsView,\n outlinesView,\n attachmentsView,\n layersView,\n viewsManagerAddFile: { button: viewsManagerAddFileButton },\n viewsManagerCurrentOutlineButton,\n viewsManagerSelectorButton,\n viewsManagerSelectorOptions,\n viewsManagerHeaderLabel,\n viewsManagerStatus,\n },\n eventBus,\n l10n,\n enableMerge = false,\n enableSplitMerge = false,\n globalAbortSignal,\n }) {\n super(\n {\n sidebar: sidebarContainer,\n resizer,\n toggleButton,\n },\n l10n.getDirection() === \"ltr\",\n /* isResizerOnTheLeft = */ false,\n globalAbortSignal\n );\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 = outerContainer;\n this.sidebarContainer = sidebarContainer;\n this.toggleButton = toggleButton;\n this.resizer = resizer;\n\n this.thumbnailButton = thumbnailButton;\n this.outlineButton = outlineButton;\n this.attachmentsButton = attachmentsButton;\n this.layersButton = layersButton;\n\n this.thumbnailsView = thumbnailsView;\n this.outlinesView = outlinesView;\n this.attachmentsView = attachmentsView;\n this.layersView = layersView;\n\n this.viewsManagerAddFileButton = viewsManagerAddFileButton;\n this.viewsManagerCurrentOutlineButton = viewsManagerCurrentOutlineButton;\n this.viewsManagerHeaderLabel = viewsManagerHeaderLabel;\n this.viewsManagerStatus = viewsManagerStatus;\n\n this.eventBus = eventBus;\n\n if (!enableSplitMerge) {\n viewsManagerStatus.hidden = true;\n }\n this._enableSplitMerge = enableSplitMerge;\n this._enableMerge = enableMerge;\n if (!enableMerge) {\n viewsManagerAddFileButton.hidden = true;\n }\n\n this.menu = new Menu(\n viewsManagerSelectorOptions,\n viewsManagerSelectorButton,\n [thumbnailButton, outlineButton, attachmentsButton, layersButton]\n );\n\n ViewsManager.#l10nDescription ||= Object.freeze({\n pagesTitle: \"pdfjs-views-manager-pages-title\",\n outlinesTitle: \"pdfjs-views-manager-outlines-title1\",\n attachmentsTitle: \"pdfjs-views-manager-attachments-title\",\n layersTitle: \"pdfjs-views-manager-layers-title1\",\n notificationButton: \"pdfjs-toggle-views-manager-notification-button\",\n toggleButton: \"pdfjs-toggle-views-manager-button1\",\n });\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 =\n this.attachmentsButton.disabled =\n this.layersButton.disabled =\n false;\n this.viewsManagerCurrentOutlineButton.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 let titleL10nId = null;\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 titleL10nId = \"pagesTitle\";\n if (this.isOpen && isViewChanged) {\n forceRendering = true;\n }\n break;\n case SidebarView.OUTLINE:\n titleL10nId = \"outlinesTitle\";\n if (this.outlineButton.disabled) {\n return;\n }\n break;\n case SidebarView.ATTACHMENTS:\n titleL10nId = \"attachmentsTitle\";\n if (this.attachmentsButton.disabled) {\n return;\n }\n break;\n case SidebarView.LAYERS:\n titleL10nId = \"layersTitle\";\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\n this.viewsManagerStatus.hidden =\n !this._enableSplitMerge || view !== SidebarView.THUMBS;\n this.viewsManagerAddFileButton.hidden =\n !this._enableMerge || view !== SidebarView.THUMBS;\n this.viewsManagerCurrentOutlineButton.hidden = view !== SidebarView.OUTLINE;\n this.viewsManagerHeaderLabel.setAttribute(\n \"data-l10n-id\",\n ViewsManager.#l10nDescription[titleL10nId] || \"\"\n );\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 toggleSelectedBtn(\n this.thumbnailButton,\n view === SidebarView.THUMBS,\n this.thumbnailsView\n );\n toggleSelectedBtn(\n this.outlineButton,\n view === SidebarView.OUTLINE,\n this.outlinesView\n );\n toggleSelectedBtn(\n this.attachmentsButton,\n view === SidebarView.ATTACHMENTS,\n this.attachmentsView\n );\n toggleSelectedBtn(\n this.layersButton,\n view === SidebarView.LAYERS,\n this.layersView\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 this.onResizing(this.width);\n this._sidebar.hidden = false;\n toggleExpandedBtn(this.toggleButton, true);\n this.switchView(this.active);\n\n if (this.#hasAnimations) {\n // Changing `hidden` above may cause a reflow which would prevent the\n // CSS transition from being applied correctly, so we need to delay\n // adding the relevant CSS classes.\n queueMicrotask(() => {\n this.outerContainer.classList.add(\n \"viewsManagerMoving\",\n \"viewsManagerOpen\"\n );\n });\n } else {\n this.outerContainer.classList.add(\"viewsManagerOpen\");\n this.eventBus.dispatch(\"resize\", { source: this });\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(evt = null) {\n if (!this.isOpen) {\n return;\n }\n this.isOpen = false;\n this._sidebar.hidden = true;\n toggleExpandedBtn(this.toggleButton, false);\n\n this.outerContainer.classList.add(\"viewsManagerMoving\");\n this.outerContainer.classList.remove(\"viewsManagerOpen\");\n\n this.onToggled();\n this.#dispatchEvent();\n\n if (evt?.detail > 0) {\n // Remove focus from the toggleButton if it's clicked (see issue 17361).\n this.toggleButton.blur();\n }\n }\n\n toggle(evt = null) {\n super.toggle();\n if (this.isOpen) {\n this.close(evt);\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 ViewsManager.#l10nDescription.notificationButton\n );\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(\n \"data-l10n-id\",\n ViewsManager.#l10nDescription.toggleButton\n );\n }\n }\n\n #addEventListeners() {\n const { eventBus, outerContainer } = this;\n\n if (this.#hasAnimations) {\n this.sidebarContainer.addEventListener(\"transitionend\", evt => {\n if (evt.target === this.sidebarContainer) {\n outerContainer.classList.remove(\"viewsManagerMoving\");\n // Ensure that rendering is triggered after opening/closing the\n // sidebar.\n eventBus.dispatch(\"resize\", { source: this });\n }\n });\n }\n\n this.viewsManagerHeaderLabel.addEventListener(\"dblclick\", e => {\n if (this.active === SidebarView.OUTLINE) {\n eventBus.dispatch(\"toggleoutlinetree\", { source: this });\n return;\n }\n if (this.active === SidebarView.LAYERS) {\n eventBus.dispatch(\"resetlayers\", { source: this });\n }\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\n this.attachmentsButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.ATTACHMENTS);\n });\n\n this.layersButton.addEventListener(\"click\", () => {\n this.switchView(SidebarView.LAYERS);\n });\n\n // Buttons for view-specific options.\n this.viewsManagerCurrentOutlineButton.addEventListener(\"click\", () => {\n 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 eventBus.on(\n \"outlineloaded\",\n evt => {\n onTreeLoaded(evt.outlineCount, this.outlineButton, SidebarView.OUTLINE);\n\n evt.currentOutlineItemPromise.then(enabled => {\n if (!this.isInitialViewSet) {\n return;\n }\n this.viewsManagerCurrentOutlineButton.disabled = !enabled;\n });\n },\n internalOpt\n );\n\n eventBus.on(\n \"attachmentsloaded\",\n evt => {\n onTreeLoaded(\n evt.attachmentsCount,\n this.attachmentsButton,\n SidebarView.ATTACHMENTS\n );\n },\n internalOpt\n );\n\n eventBus.on(\n \"layersloaded\",\n evt => {\n onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS);\n },\n internalOpt\n );\n\n // Update the thumbnailViewer, if visible, when exiting presentation mode.\n eventBus.on(\n \"presentationmodechanged\",\n evt => {\n if (\n evt.state === PresentationModeState.NORMAL &&\n this.visibleView === SidebarView.THUMBS\n ) {\n this.onUpdateThumbnails();\n }\n },\n internalOpt\n );\n }\n\n onStartResizing() {\n this.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);\n }\n\n onStopResizing() {\n this.eventBus.dispatch(\"resize\", { source: this });\n this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);\n }\n\n onResizing(newWidth) {\n docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${newWidth}px`);\n }\n}\n\nexport { ViewsManager };\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/api.js\").PDFDocumentProxy} PDFDocumentProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/api.js\").PDFDocumentLoadingTask} PDFDocumentLoadingTask */\n\nimport {\n animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n AutoPrintRegExp,\n CursorTool,\n DEFAULT_SCALE_VALUE,\n docStyle,\n getActiveOrFocusedElement,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n normalizeWheelEventDirection,\n parseQueryString,\n ProgressBar,\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 OutputScale,\n PDFWorker,\n ResponseException,\n shadow,\n stopEvent,\n TouchManager,\n updateUrlHash,\n version,\n} from \"pdfjs-lib\";\nimport { AppOptions, OptionKind } from \"./app_options.js\";\nimport { EventBus, FirefoxEventBus } from \"./event_utils.js\";\nimport { ExternalServices, initCom, MLManager } from \"web-external_services\";\nimport {\n ImageAltTextSettings,\n NewAltTextManager,\n} from \"web-new_alt_text_manager\";\nimport { LinkTarget, PDFLinkService } from \"./pdf_link_service.js\";\nimport { AltTextManager } from \"web-alt_text_manager\";\nimport { AnnotationEditorParams } from \"web-annotation_editor_params\";\nimport { CaretBrowsingMode } from \"./caret_browsing.js\";\nimport { CommentManager } from \"./comment_manager.js\";\nimport { DownloadManager } from \"web-download_manager\";\nimport { EditorUndoBar } from \"./editor_undo_bar.js\";\nimport { internalOpt } from \"./internal_evt.js\";\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 { PDFPrintServiceFactory } from \"web-print_service\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { PDFScriptingManager } from \"./pdf_scripting_manager.js\";\nimport { PdfTextExtractor } from \"./pdf_text_extractor.js\";\nimport { PDFThumbnailViewer } from \"web-pdf_thumbnail_viewer\";\nimport { PDFViewer } from \"./pdf_viewer.js\";\nimport { Preferences } from \"web-preferences\";\nimport { RenderingStates } from \"./renderable_view.js\";\nimport { SecondaryToolbar } from \"web-secondary_toolbar\";\nimport { SignatureManager } from \"web-signature_manager\";\nimport { SignaturePropertiesManager } from \"web-digital_signature_properties_manager\";\nimport { Toolbar } from \"web-toolbar\";\nimport { ViewHistory } from \"./view_history.js\";\nimport { ViewsManager } from \"web-views_manager\";\n\nconst FORCE_PAGES_LOADED_TIMEOUT = 10000; // ms\n\nconst ViewOnLoad = {\n UNKNOWN: -1,\n PREVIOUS: 0, // Default value.\n INITIAL: 1,\n};\n\nconst PDFViewerApplication = {\n initialBookmark: document.location.hash.substring(1),\n _initializedCapability: {\n ...Promise.withResolvers(),\n settled: false,\n },\n appConfig: null,\n /** @type {PDFDocumentProxy} */\n pdfDocument: null,\n /** @type {PDFDocumentLoadingTask} */\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 {PdfTextExtractor|null} */\n pdfTextExtractor: null,\n /** @type {PDFHistory} */\n pdfHistory: null,\n /** @type {ViewsManager} */\n viewsManager: 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: new Preferences(),\n /** @type {Toolbar} */\n toolbar: null,\n /** @type {SecondaryToolbar} */\n secondaryToolbar: null,\n /** @type {EventBus} */\n eventBus: null,\n /** @type {L10n} */\n l10n: null,\n /** @type {AnnotationEditorParams} */\n annotationEditorParams: null,\n /** @type {SignaturePropertiesManager|null} */\n signaturePropertiesManager: null,\n /** @type {ImageAltTextSettings} */\n imageAltTextSettings: null,\n isInitialViewSet: false,\n isViewerEmbedded: window.parent !== window,\n url: \"\",\n baseUrl: \"\",\n mlManager: null,\n _downloadUrl: \"\",\n _eventBusAC: null,\n _windowAC: null,\n _globalAbortController: new AbortController(),\n documentInfo: null,\n metadata: null,\n _contentDispositionFilename: null,\n _contentLength: null,\n _saveInProgress: false,\n _wheelUnusedTicks: 0,\n _wheelUnusedFactor: 1,\n _touchManager: null,\n _touchUnusedTicks: 0,\n _touchUnusedFactor: 1,\n _PDFBug: null,\n _hasAnnotationEditors: false,\n _title: document.title,\n _printAnnotationStoragePromise: null,\n _isCtrlKeyDown: false,\n _caretBrowsing: null,\n _isScrolling: false,\n editorUndoBar: null,\n _printPermissionPromise: null,\n\n // Called once when the document is loaded.\n async initialize(appConfig) {\n this.appConfig = appConfig;\n\n // Ensure that `Preferences`, and indirectly `AppOptions`, have initialized\n // before creating e.g. the various viewer components.\n try {\n await this.preferences.initializedPromise;\n } catch (ex) {\n console.error(\"initialize:\", ex);\n }\n if (AppOptions.get(\"pdfBugEnabled\")) {\n await this._parseHashParams();\n }\n\n let mode;\n switch (AppOptions.get(\"viewerCssTheme\")) {\n case 1:\n mode = \"light\";\n break;\n case 2:\n mode = \"dark\";\n break;\n }\n if (mode) {\n docStyle.setProperty(\"color-scheme\", mode);\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n if (AppOptions.get(\"enableFakeMLManager\")) {\n this.mlManager =\n MLManager.getFakeMLManager?.({\n enableGuessAltText: AppOptions.get(\"enableGuessAltText\"),\n enableAltTextModelDownload: AppOptions.get(\n \"enableAltTextModelDownload\"\n ),\n }) || null;\n }\n } else if (PDFJSDev.test(\"MOZCENTRAL\")) {\n if (AppOptions.get(\"enableAltText\")) {\n // We want to load the image-to-text AI engine as soon as possible.\n this.mlManager = new MLManager({\n enableGuessAltText: AppOptions.get(\"enableGuessAltText\"),\n enableAltTextModelDownload: AppOptions.get(\n \"enableAltTextModelDownload\"\n ),\n altTextLearnMoreUrl: AppOptions.get(\"altTextLearnMoreUrl\"),\n });\n }\n }\n\n // Ensure that the `L10n`-instance has been initialized before creating\n // e.g. the various viewer components.\n this.l10n = await this.externalServices.createL10n();\n document.getElementsByTagName(\"html\")[0].dir = this.l10n.getDirection();\n // Connect Fluent, when necessary, and translate what we already have.\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n this.l10n.translate(appConfig.appContainer || document.documentElement);\n }\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 this._initializedCapability.settled = true;\n this._initializedCapability.resolve();\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 const loadPDFBug = async () => {\n if (this._PDFBug) {\n return;\n }\n const { PDFBug } =\n typeof PDFJSDev === \"undefined\"\n ? await import(AppOptions.get(\"debuggerSrc\")) // eslint-disable-line no-unsanitized/method\n : await __raw_import__(AppOptions.get(\"debuggerSrc\"));\n\n this._PDFBug = PDFBug;\n };\n\n // Parameters that need to be handled manually.\n if (params.get(\"disableworker\") === \"true\") {\n try {\n GlobalWorkerOptions.workerSrc ||= AppOptions.get(\"workerSrc\");\n\n typeof PDFJSDev === \"undefined\" // eslint-disable-line no-unused-expressions\n ? await import(\"pdfjs/pdf.worker.js\")\n : await __raw_import__(PDFWorker.workerSrc);\n\n // Ensure that the \"fake\" worker won't be ignored.\n AppOptions.set(\"workerPort\", null);\n } catch (ex) {\n console.error(\"_parseHashParams:\", ex);\n }\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();\n this._PDFBug.loadCSS();\n } catch (ex) {\n console.error(\"_parseHashParams:\", ex);\n }\n break;\n }\n }\n if (params.has(\"pdfbug\")) {\n const enabled = params.get(\"pdfbug\").split(\",\");\n try {\n await loadPDFBug();\n this._PDFBug.init(mainContainer, enabled);\n } catch (ex) {\n console.error(\"_parseHashParams:\", ex);\n }\n\n const debugOpts = { pdfBug: true, fontExtraProperties: true };\n if (globalThis.StepperManager?.enabled) {\n debugOpts.minDurationToUpdateCanvas = 0;\n }\n AppOptions.setAll(debugOpts);\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(\"localeProperties\", { lang: params.get(\"locale\") });\n }\n\n // Parameters that can be handled automatically.\n const opts = {\n disableAutoFetch: x => x === \"true\",\n disableFontFace: x => x === \"true\",\n disableHistory: x => x === \"true\",\n disableRange: x => x === \"true\",\n disableStream: x => x === \"true\",\n verbosity: x => x | 0,\n };\n\n // Set some specific preferences for tests.\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n Object.assign(opts, {\n capCanvasAreaFactor: x => parseInt(x, 10),\n docBaseUrl: x => x,\n enableAltText: x => x === \"true\",\n enableAutoLinking: x => x === \"true\",\n enableComment: x => x === \"true\",\n enableFakeMLManager: x => x === \"true\",\n enableGuessAltText: x => x === \"true\",\n enableNewBadge: x => x === \"true\",\n enablePermissions: x => x === \"true\",\n enableMerge: x => x === \"true\",\n enableSelectionRendering: x => x === \"true\",\n enableSplitMerge: x => x === \"true\",\n enableUpdatedAddImage: x => x === \"true\",\n highlightEditorColors: x => x,\n imagesRightClickMinSize: x => parseInt(x, 10),\n maxCanvasPixels: x => parseInt(x, 10),\n spreadModeOnLoad: x => parseInt(x, 10),\n supportsCaretBrowsingMode: x => x === \"true\",\n supportsDownloading: x => x === \"true\",\n viewerCssTheme: x => parseInt(x, 10),\n forcePageColors: x => x === \"true\",\n pageColorsBackground: x => x,\n pageColorsForeground: x => x,\n sidebarViewOnLoad: x => parseInt(x, 10),\n });\n }\n\n for (const name in opts) {\n const check = opts[name],\n key = name.toLowerCase();\n\n if (params.has(key)) {\n AppOptions.set(name, check(params.get(key)));\n }\n }\n },\n\n /**\n * @private\n */\n async _initializeViewerComponents() {\n const { appConfig, externalServices, l10n, mlManager } = this;\n const abortSignal = this._globalAbortController.signal;\n\n const eventBus =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? new FirefoxEventBus(\n AppOptions.get(\"allowedGlobalEvents\"),\n externalServices,\n AppOptions.get(\"isInAutomation\")\n )\n : new EventBus();\n this.eventBus = AppOptions.eventBus = eventBus;\n\n mlManager?.setEventBus(eventBus, abortSignal);\n\n const overlayManager = (this.overlayManager = new OverlayManager());\n\n const renderingQueue = (this.pdfRenderingQueue = new PDFRenderingQueue());\n renderingQueue.onIdle = this._cleanup.bind(this);\n\n const linkService = (this.pdfLinkService = new PDFLinkService({\n eventBus,\n externalLinkTarget: AppOptions.get(\"externalLinkTarget\"),\n externalLinkRel: AppOptions.get(\"externalLinkRel\"),\n ignoreDestinationZoom: AppOptions.get(\"ignoreDestinationZoom\"),\n }));\n\n const supportsDownloading = AppOptions.get(\"supportsDownloading\");\n const downloadManager = (this.downloadManager = supportsDownloading\n ? new DownloadManager()\n : null);\n if (appConfig.secondaryToolbar?.downloadButton) {\n appConfig.secondaryToolbar.downloadButton.hidden = !supportsDownloading;\n }\n if (appConfig.toolbar?.download) {\n appConfig.toolbar.download.hidden = !supportsDownloading;\n }\n\n const findController = (this.findController = new PDFFindController({\n linkService,\n eventBus,\n updateMatchesCountOnProgress:\n typeof PDFJSDev === \"undefined\"\n ? !window.isGECKOVIEW\n : !PDFJSDev.test(\"GECKOVIEW\"),\n }));\n\n const pdfScriptingManager = (this.pdfScriptingManager =\n new PDFScriptingManager({\n eventBus,\n externalServices,\n docProperties: this._scriptingDocProperties.bind(this),\n }));\n\n const container = appConfig.mainContainer,\n viewer = appConfig.viewerContainer;\n const annotationEditorMode = AppOptions.get(\"annotationEditorMode\");\n const hasForcedColors =\n AppOptions.get(\"forcePageColors\") ||\n window.matchMedia(\"(forced-colors: active)\").matches;\n const pageColors = hasForcedColors\n ? {\n background: AppOptions.get(\"pageColorsBackground\"),\n foreground: AppOptions.get(\"pageColorsForeground\"),\n }\n : null;\n const enableMerge = AppOptions.get(\"enableMerge\");\n const enableSplitMerge = AppOptions.get(\"enableSplitMerge\");\n\n let altTextManager;\n if (AppOptions.get(\"enableUpdatedAddImage\")) {\n altTextManager = appConfig.newAltTextDialog\n ? new NewAltTextManager(\n appConfig.newAltTextDialog,\n overlayManager,\n eventBus\n )\n : null;\n } else {\n altTextManager = appConfig.altTextDialog\n ? new AltTextManager(\n appConfig.altTextDialog,\n container,\n overlayManager,\n eventBus\n )\n : null;\n }\n\n if (appConfig.editorUndoBar) {\n this.editorUndoBar = new EditorUndoBar(appConfig.editorUndoBar, eventBus);\n }\n\n if (\n (typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"MOZCENTRAL && !GECKOVIEW\")) &&\n !this.isViewerEmbedded &&\n appConfig.featuresNotification &&\n !AppOptions.get(\"featuresNotificationDismissed\")\n ) {\n const { featuresNotification } = appConfig;\n customElements.whenDefined(\"pdf-features-notification\").then(() => {\n if (AppOptions.get(\"featuresNotificationDismissed\")) {\n return;\n }\n\n featuresNotification.addEventListener(\n \"click\",\n event => {\n if (!event.target.closest(\".cta\")) {\n return;\n }\n event.preventDefault();\n externalServices.openAboutPdfFeatures();\n },\n { signal: abortSignal }\n );\n\n const barResizeObserver = new ResizeObserver(entries => {\n const box = entries[0]?.borderBoxSize?.[0];\n const height = box\n ? box.blockSize\n : (entries[0]?.contentRect.height ?? 0);\n docStyle.setProperty(\"--pfn-bar-height\", `${Math.ceil(height)}px`);\n });\n barResizeObserver.observe(featuresNotification);\n\n const hideBar = () => {\n barResizeObserver.disconnect();\n docStyle.setProperty(\"--pfn-bar-height\", \"0px\");\n featuresNotification.hidden = true;\n };\n featuresNotification.addEventListener(\n \"pdf-features-notification:dismissed\",\n () => {\n hideBar();\n this.preferences.set(\"featuresNotificationDismissed\", true);\n },\n { once: true }\n );\n eventBus.on(\n \"featuresnotificationdismissed\",\n ({ value }) => {\n if (value) {\n hideBar();\n }\n },\n { signal: abortSignal, ...internalOpt }\n );\n featuresNotification.show();\n });\n }\n\n const signatureManager =\n AppOptions.get(\"enableSignatureEditor\") && appConfig.addSignatureDialog\n ? new SignatureManager(\n appConfig.addSignatureDialog,\n appConfig.editSignatureDialog,\n appConfig.annotationEditorParams?.editorSignatureAddSignature ||\n null,\n overlayManager,\n l10n,\n externalServices.createSignatureStorage(eventBus, abortSignal),\n eventBus\n )\n : null;\n\n const commentManager =\n AppOptions.get(\"enableComment\") && appConfig.editCommentDialog\n ? new CommentManager(\n appConfig.editCommentDialog,\n {\n learnMoreUrl: AppOptions.get(\"commentLearnMoreUrl\"),\n sidebar:\n appConfig.annotationEditorParams?.editorCommentsSidebar || null,\n sidebarResizer:\n appConfig.annotationEditorParams\n ?.editorCommentsSidebarResizer || null,\n commentsList:\n appConfig.annotationEditorParams?.editorCommentsSidebarList ||\n null,\n commentCount:\n appConfig.annotationEditorParams?.editorCommentsSidebarCount ||\n null,\n sidebarTitle:\n appConfig.annotationEditorParams?.editorCommentsSidebarTitle ||\n null,\n closeButton:\n appConfig.annotationEditorParams\n ?.editorCommentsSidebarCloseButton || null,\n commentToolbarButton:\n appConfig.toolbar?.editorCommentButton || null,\n },\n eventBus,\n linkService,\n overlayManager,\n /* ltr = */ l10n.getDirection() === \"ltr\",\n hasForcedColors,\n abortSignal\n )\n : null;\n\n const maxCanvasPixels = AppOptions.get(\"maxCanvasPixels\"),\n maxCanvasDim = AppOptions.get(\"maxCanvasDim\"),\n capCanvasAreaFactor = AppOptions.get(\"capCanvasAreaFactor\");\n const pdfViewer = (this.pdfViewer = new PDFViewer({\n container,\n viewer,\n viewerAlert: appConfig.viewerAlert,\n eventBus,\n renderingQueue,\n linkService,\n downloadManager,\n altTextManager,\n commentManager,\n signatureManager,\n editorUndoBar: this.editorUndoBar,\n findController,\n scriptingManager:\n AppOptions.get(\"enableScripting\") && pdfScriptingManager,\n l10n,\n textLayerMode: AppOptions.get(\"textLayerMode\"),\n annotationMode: AppOptions.get(\"annotationMode\"),\n annotationEditorMode,\n annotationEditorHighlightColors: AppOptions.get(\"highlightEditorColors\"),\n enableHighlightFloatingButton: AppOptions.get(\n \"enableHighlightFloatingButton\"\n ),\n enableUpdatedAddImage: AppOptions.get(\"enableUpdatedAddImage\"),\n enableNewAltTextWhenAddingImage: AppOptions.get(\n \"enableNewAltTextWhenAddingImage\"\n ),\n imageResourcesPath: AppOptions.get(\"imageResourcesPath\"),\n enablePrintAutoRotate: AppOptions.get(\"enablePrintAutoRotate\"),\n maxCanvasPixels,\n maxCanvasDim,\n capCanvasAreaFactor,\n enableDetailCanvas: AppOptions.get(\"enableDetailCanvas\"),\n enablePermissions: AppOptions.get(\"enablePermissions\"),\n enableOptimizedPartialRendering: AppOptions.get(\n \"enableOptimizedPartialRendering\"\n ),\n enableSelectionRendering: AppOptions.get(\"enableSelectionRendering\"),\n imagesRightClickMinSize: AppOptions.get(\"imagesRightClickMinSize\"),\n pageColors,\n mlManager,\n abortSignal,\n supportsPinchToZoom: this.supportsPinchToZoom,\n enableAutoLinking: AppOptions.get(\"enableAutoLinking\"),\n minDurationToUpdateCanvas: AppOptions.get(\"minDurationToUpdateCanvas\"),\n }));\n\n renderingQueue.setViewer(pdfViewer);\n linkService.setViewer(pdfViewer);\n pdfScriptingManager.setViewer(pdfViewer);\n\n if (appConfig.viewsManager?.thumbnailsView) {\n const { viewsManager } = appConfig;\n this.pdfThumbnailViewer = new PDFThumbnailViewer({\n container: viewsManager.thumbnailsView,\n eventBus,\n renderingQueue,\n linkService,\n maxCanvasPixels,\n maxCanvasDim,\n pageColors,\n abortSignal,\n enableSplitMerge,\n enableMerge,\n enableNewBadge: AppOptions.get(\"enableNewBadge\"),\n statusBar: viewsManager.viewsManagerStatusBar,\n undoBar: viewsManager.viewsManagerUndoBar,\n manageMenu: viewsManager.manageMenu,\n waitingBar: viewsManager.viewsManagerWaitingBar,\n addFileComponent: viewsManager.viewsManagerAddFile,\n });\n renderingQueue.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,\n eventBus,\n });\n linkService.setHistory(this.pdfHistory);\n }\n\n if (!this.supportsIntegratedFind && appConfig.findBar) {\n this.findBar = new PDFFindBar(\n appConfig.findBar,\n appConfig.principalContainer,\n eventBus\n );\n }\n\n if (appConfig.annotationEditorParams) {\n if (annotationEditorMode !== AnnotationEditorType.DISABLE) {\n const editorSignatureButton = appConfig.toolbar?.editorSignatureButton;\n if (editorSignatureButton && AppOptions.get(\"enableSignatureEditor\")) {\n editorSignatureButton.parentElement.hidden = false;\n }\n const editorCommentButton = appConfig.toolbar?.editorCommentButton;\n if (editorCommentButton && AppOptions.get(\"enableComment\")) {\n editorCommentButton.parentElement.hidden = false;\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 (mlManager && appConfig.secondaryToolbar?.imageAltTextSettingsButton) {\n this.imageAltTextSettings = new ImageAltTextSettings(\n appConfig.altTextSettingsDialog,\n overlayManager,\n eventBus,\n mlManager\n );\n }\n\n if (appConfig.documentProperties) {\n this.pdfDocumentProperties = new PDFDocumentProperties(\n appConfig.documentProperties,\n overlayManager,\n eventBus,\n l10n,\n /* fileNameLookup = */ () => this._docFilename,\n /* titleLookup = */ () => this._docTitle\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 const nimbusData = JSON.parse(\n AppOptions.get(\"nimbusDataStr\") || \"null\"\n );\n this.toolbar = new Toolbar(appConfig.toolbar, eventBus, nimbusData);\n } else {\n this.toolbar = new Toolbar(\n appConfig.toolbar,\n eventBus,\n AppOptions.get(\"toolbarDensity\")\n );\n }\n }\n\n if (appConfig.secondaryToolbar) {\n if (AppOptions.get(\"enableAltText\")) {\n appConfig.secondaryToolbar.imageAltTextSettingsButton?.classList.remove(\n \"hidden\"\n );\n appConfig.secondaryToolbar.imageAltTextSettingsSeparator?.classList.remove(\n \"hidden\"\n );\n }\n\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 overlayManager,\n this.isViewerEmbedded\n );\n }\n\n if (appConfig.viewsManager?.outlinesView) {\n this.pdfOutlineViewer = new PDFOutlineViewer({\n container: appConfig.viewsManager.outlinesView,\n eventBus,\n l10n,\n linkService,\n downloadManager,\n });\n }\n\n if (appConfig.viewsManager?.attachmentsView) {\n this.pdfAttachmentViewer = new PDFAttachmentViewer({\n container: appConfig.viewsManager.attachmentsView,\n eventBus,\n l10n,\n downloadManager,\n linkService,\n });\n }\n\n if (appConfig.viewsManager?.layersView) {\n this.pdfLayerViewer = new PDFLayerViewer({\n container: appConfig.viewsManager.layersView,\n eventBus,\n l10n,\n });\n }\n\n if (appConfig.viewsManager) {\n this.viewsManager = new ViewsManager({\n elements: appConfig.viewsManager,\n eventBus,\n l10n,\n enableMerge,\n enableSplitMerge,\n globalAbortSignal: abortSignal,\n });\n this.viewsManager.onToggled = this.forceRendering.bind(this);\n this.viewsManager.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 if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"TESTING || MOZCENTRAL\")\n ) {\n this.pdfTextExtractor = new PdfTextExtractor(\n externalServices,\n pdfViewer,\n eventBus\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 try {\n file = new URL(file).href;\n } catch {\n file = encodeURIComponent(file).replaceAll(\"%2F\", \"/\");\n }\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 = (this._openFileInput = document.createElement(\"input\"));\n fileInput.id = \"fileInput\";\n fileInput.hidden = true;\n fileInput.type = \"file\";\n fileInput.value = null;\n document.body.append(fileInput);\n\n fileInput.addEventListener(\"change\", function (evt) {\n const { files } = evt.target;\n if (!files?.length) {\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 for (const item of evt.dataTransfer.items) {\n if (item.type === \"application/pdf\") {\n evt.dataTransfer.dropEffect =\n evt.dataTransfer.effectAllowed === \"copy\" ? \"copy\" : \"move\";\n stopEvent(evt);\n return;\n }\n }\n });\n appConfig.mainContainer.addEventListener(\"drop\", function (evt) {\n if (evt.dataTransfer.files?.[0].type !== \"application/pdf\") {\n return;\n }\n stopEvent(evt);\n eventBus.dispatch(\"fileinputchange\", {\n source: this,\n fileInput: evt.dataTransfer,\n });\n });\n }\n\n if (!AppOptions.get(\"supportsDocumentFonts\")) {\n AppOptions.set(\"disableFontFace\", true);\n this.l10n.get(\"pdfjs-web-fonts-disabled\").then(msg => {\n console.warn(msg);\n });\n }\n\n const togglePrintingButtons = visible => {\n appConfig.toolbar?.print?.classList.toggle(\"hidden\", !visible);\n appConfig.secondaryToolbar?.printButton.classList.toggle(\n \"hidden\",\n !visible\n );\n };\n if (!this.supportsPrinting) {\n togglePrintingButtons(false);\n } else {\n eventBus.on(\n \"printingallowed\",\n ({ isAllowed }) => togglePrintingButtons(isAllowed),\n internalOpt\n );\n }\n\n if (!this.supportsFullscreen) {\n appConfig.secondaryToolbar?.presentationModeButton.classList.add(\n \"hidden\"\n );\n }\n\n if (this.supportsIntegratedFind) {\n appConfig.findBar?.toggleButton?.classList.add(\"hidden\");\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.setTitleUsingUrl(file, /* downloadUrl = */ file);\n\n this.externalServices.initPassiveLoading();\n } else {\n throw new Error(\"Not implemented: run\");\n }\n },\n\n get externalServices() {\n return shadow(this, \"externalServices\", new ExternalServices());\n },\n\n get initialized() {\n return this._initializedCapability.settled;\n },\n\n get initializedPromise() {\n return this._initializedCapability.promise;\n },\n\n updateZoom(steps, scaleFactor, origin) {\n if (this.pdfViewer.isInPresentationMode) {\n return;\n }\n this.pdfViewer.updateScale({\n drawingDelay: AppOptions.get(\"defaultZoomDelay\"),\n steps,\n scaleFactor,\n origin,\n });\n },\n\n zoomIn() {\n this.updateZoom(1);\n },\n\n zoomOut() {\n this.updateZoom(-1);\n },\n\n zoomReset() {\n if (this.pdfViewer.isInPresentationMode) {\n return;\n }\n this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;\n },\n\n touchPinchCallback(origin, prevDistance, distance) {\n if (this.supportsPinchToZoom) {\n const newScaleFactor = this._accumulateFactor(\n this.pdfViewer.currentScale,\n distance / prevDistance,\n \"_touchUnusedFactor\"\n );\n this.updateZoom(null, newScaleFactor, origin);\n } else {\n const PIXELS_PER_LINE_SCALE = 30;\n const ticks = this._accumulateTicks(\n (distance - prevDistance) / PIXELS_PER_LINE_SCALE,\n \"_touchUnusedTicks\"\n );\n this.updateZoom(ticks, null, origin);\n }\n },\n\n touchPinchEndCallback() {\n this._touchUnusedTicks = 0;\n this._touchUnusedFactor = 1;\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 shadow(\n this,\n \"supportsPrinting\",\n AppOptions.get(\"supportsPrinting\") &&\n PDFPrintServiceFactory.supportsPrinting\n );\n },\n\n get supportsFullscreen() {\n return shadow(this, \"supportsFullscreen\", document.fullscreenEnabled);\n },\n\n get supportsPinchToZoom() {\n return shadow(\n this,\n \"supportsPinchToZoom\",\n AppOptions.get(\"supportsPinchToZoom\")\n );\n },\n\n get supportsIntegratedFind() {\n return shadow(\n this,\n \"supportsIntegratedFind\",\n AppOptions.get(\"supportsIntegratedFind\")\n );\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 supportsMouseWheelZoomCtrlKey() {\n return shadow(\n this,\n \"supportsMouseWheelZoomCtrlKey\",\n AppOptions.get(\"supportsMouseWheelZoomCtrlKey\")\n );\n },\n\n get supportsMouseWheelZoomMetaKey() {\n return shadow(\n this,\n \"supportsMouseWheelZoomMetaKey\",\n AppOptions.get(\"supportsMouseWheelZoomMetaKey\")\n );\n },\n\n get supportsCaretBrowsingMode() {\n return AppOptions.get(\"supportsCaretBrowsingMode\");\n },\n\n moveCaret(isUp, select) {\n this._caretBrowsing ||= new CaretBrowsingMode(\n this._globalAbortController.signal,\n this.appConfig.mainContainer,\n this.appConfig.viewerContainer,\n this.appConfig.toolbar?.container\n );\n this._caretBrowsing.moveCaret(isUp, select);\n },\n\n setTitleUsingUrl(url = \"\", downloadUrl = null) {\n this.url = url;\n this.baseUrl =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? updateUrlHash(url, \"\", /* allowRel = */ true)\n : updateUrlHash(url, \"\");\n if (downloadUrl) {\n this._downloadUrl =\n // eslint-disable-next-line no-nested-ternary\n downloadUrl === url\n ? this.baseUrl\n : typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")\n ? updateUrlHash(downloadUrl, \"\", /* allowRel = */ true)\n : updateUrlHash(downloadUrl, \"\");\n }\n if (isDataScheme(url)) {\n this._hideViewBookmark();\n } else if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"MOZCENTRAL || CHROME\")\n ) {\n AppOptions.set(\"docBaseUrl\", this.baseUrl);\n }\n\n let title = getPdfFilenameFromUrl(url, \"\");\n if (!title) {\n try {\n title = decodeURIComponent(getFilenameFromUrl(url));\n } catch {\n // decodeURIComponent may throw URIError.\n }\n }\n this.setTitle(title || url); // Always fallback to the raw URL.\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 hasChangesIndicator =\n this._hasChanges() && !this.pdfRenderingQueue.printing;\n document.title = `${hasChangesIndicator ? \"* \" : \"\"}${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 get _docTitle() {\n const { documentInfo, metadata } = this;\n\n const title = metadata?.get(\"dc:title\");\n if (title) {\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 (title !== \"Untitled\" && !/[\\uFFF0-\\uFFFF]/.test(title)) {\n return title;\n }\n }\n return documentInfo.Title;\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\" ||\n PDFJSDev.test(\"GENERIC && !TESTING\")) &&\n this._hasChanges() &&\n this._annotationStorageModified\n ) {\n try {\n // Trigger saving, to prevent data loss in forms; see issue 12257.\n await this.downloadOrSave();\n } catch {\n // Ignoring errors, to ensure that document closing won't break.\n }\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"COVERAGE\")) {\n // Collect coverage data from the worker before the document is closed.\n //\n // Note that `PDFViewerApplication.open` may be invoked multiple times\n // during an integration-test (see e.g. the \"Merge PDF\" tests).\n const handler = this.pdfDocument?._transport?.messageHandler;\n if (handler) {\n try {\n const workerCoverage = await handler.sendWithPromise(\n \"GetWorkerCoverage\",\n null\n );\n (window.__worker_coverage__ ??= []).push(workerCoverage);\n } catch {}\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 this.signaturePropertiesManager?.setDocument(null);\n }\n this.pdfLinkService.externalLinkEnabled = true;\n this.store = null;\n this.isInitialViewSet = 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.viewsManager?.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 (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 (args.data && isPdfFile(args.filename)) {\n this._contentDispositionFilename = args.filename;\n } else 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\n // Set the necessary API parameters, using all the available options.\n const apiParams = AppOptions.getAll(OptionKind.API);\n const loadingTask = getDocument({\n ...apiParams,\n ...args,\n });\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 = evt => this.progress(evt.percent);\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 if (this.loadingBar) {\n // Avoid the \"indeterminate\" loadingBar being displayed on error.\n this.loadingBar.percent ||= 0;\n }\n\n let key = \"pdfjs-loading-error\";\n if (reason instanceof InvalidPDFException) {\n key = \"pdfjs-invalid-file-error\";\n } else if (reason instanceof ResponseException) {\n key = reason.missing\n ? \"pdfjs-missing-file-error\"\n : \"pdfjs-unexpected-response-error\";\n }\n return this._documentError(key, { message: reason.message }).then(\n () => {\n throw reason;\n }\n );\n }\n );\n },\n\n async download() {\n if (!this.downloadManager) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.eventBus.dispatch(\"downloadskipped\", { source: this });\n }\n return;\n }\n\n let data;\n try {\n data = await (this.pdfDocument\n ? this.pdfDocument.getData()\n : this.pdfLoadingTask.getData());\n } catch {\n // When the PDF document isn't ready, simply download using the URL.\n }\n this.downloadManager.download(data, this._downloadUrl, this._docFilename);\n },\n\n async save() {\n if (!this.downloadManager) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.eventBus.dispatch(\"downloadskipped\", { source: this });\n }\n return;\n }\n\n if (this._saveInProgress) {\n return;\n }\n this._saveInProgress = true;\n await this.pdfScriptingManager.dispatchWillSave();\n\n try {\n const data = await this.pdfDocument.saveDocument();\n this.downloadManager.download(data, this._downloadUrl, this._docFilename);\n } catch (reason) {\n // When the PDF document isn't ready, fallback to a \"regular\" download.\n console.error(`Error when saving the document:`, reason);\n await this.download();\n } finally {\n await this.pdfScriptingManager.dispatchDidSave();\n this._saveInProgress = false;\n }\n\n const editorStats = this.pdfDocument?.annotationStorage.editorStats;\n if (editorStats) {\n this.externalServices.reportTelemetry({\n type: \"editing\",\n data: {\n type: \"save\",\n stats: editorStats,\n },\n });\n }\n },\n\n async downloadOrSave() {\n if (!this.downloadManager) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.eventBus.dispatch(\"downloadskipped\", { source: this });\n }\n return;\n }\n this.pdfViewer._layerProperties.annotationEditorUIManager?.endCurrentEditing();\n\n // In the Firefox case, this method MUST always trigger a download.\n // When the user is closing a modified and unsaved document, we display a\n // prompt asking for saving or not. In case they save, we must wait for\n // saving to complete before closing the tab.\n // So in case this function does not trigger a download, we must trigger a\n // a message and change PdfjsChild.sys.mjs to take it into account.\n const { classList } = this.appConfig.appContainer;\n classList.add(\"wait\");\n\n if (this.pdfThumbnailViewer?.hasStructuralChanges()) {\n this.externalServices.reportTelemetry({\n type: \"pageOrganization\",\n data: { action: \"save\" },\n });\n await this.onSavePages({\n data: this.pdfThumbnailViewer.getStructuralChanges(),\n });\n } else {\n await (this.pdfDocument?.annotationStorage.size > 0\n ? this.save()\n : this.download());\n }\n delete this._mergedDocumentNeedsSaving;\n this.setTitle();\n classList.remove(\"wait\");\n },\n\n /**\n * Report the error; used for errors affecting loading and/or parsing of\n * the entire PDF document.\n */\n async _documentError(key, moreInfo = null) {\n this._unblockDocumentLoadEvent();\n\n const message = await this._otherError(\n key || \"pdfjs-loading-error\",\n moreInfo\n );\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} key - The localization key for the error.\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 * @returns {string} A (localized) error message that is human readable.\n */\n async _otherError(key, moreInfo = null) {\n const message = await this.l10n.get(key);\n\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 return message;\n },\n\n progress(percent) {\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 (!this.loadingBar || 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 this._printPermissionPromise = new Promise(resolve => {\n this.eventBus.on(\n \"printingallowed\",\n ({ isAllowed }) => {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"MOZCENTRAL\") &&\n !isAllowed\n ) {\n window.print = () => {\n console.warn(\"Printing is not allowed.\");\n };\n }\n resolve(isAllowed);\n },\n { once: true, ...internalOpt }\n );\n });\n\n pdfDocument.getDownloadInfo().then(({ length }) => {\n this._contentLength = length; // Ensure that the correct length is used.\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 = updateUrlHash(location, \"\");\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?.get(\"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\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._documentError(\"pdfjs-loading-error\", { message: reason.message });\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, {\n once: true,\n ...internalOpt,\n });\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, {\n once: true,\n ...internalOpt,\n });\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?.get(\"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 {\n info,\n metadata,\n contentDispositionFilename,\n contentLength,\n hasStructTree,\n } = await pdfDocument.getMetadata();\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the metadata resolved.\n }\n this.externalServices.reportTelemetry({\n type: \"taggedPDF\",\n data: hasStructTree,\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 `${(metadata?.get(\"pdf:producer\") || info.Producer || \"-\").trim()} / ` +\n `${(metadata?.get(\"xmp:creatortool\") || info.Creator || \"-\").trim()}` +\n `] (PDF.js: ${version || \"?\"} [${build || \"?\"}])`\n );\n const pdfTitle = this._docTitle;\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 const success = this._maybeInitSignatureProperties(pdfDocument);\n if (!success) {\n console.warn(\"Warning: Digital signatures validation is not supported\");\n }\n }\n\n this.eventBus.dispatch(\"metadataloaded\", { source: this });\n },\n\n /**\n * @private\n * @returns {boolean} `true` when signature verification was wired up;\n * `false` when the runtime doesn't expose a verifier (everything\n * except the Firefox build) or the option is turned off.\n */\n _maybeInitSignatureProperties(pdfDocument) {\n if (!AppOptions.get(\"enableSignatureVerification\")) {\n return false;\n }\n const verifier = this.externalServices.createSignatureVerifier();\n if (!verifier) {\n return false;\n }\n if (pdfDocument !== this.pdfDocument) {\n // Don't warn about a previous document.\n return true;\n }\n this.signaturePropertiesManager ??= new SignaturePropertiesManager({\n appConfig: this.appConfig.toolbar,\n verifier,\n eventBus: this.eventBus,\n });\n this.signaturePropertiesManager.setDocument(pdfDocument);\n return true;\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:\n viewOnLoad === ViewOnLoad.INITIAL || !!this._mergedDocumentNeedsSaving,\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 _hasChanges() {\n return (\n this.pdfDocument?.annotationStorage.size > 0 ||\n this.pdfThumbnailViewer?.hasStructuralChanges() ||\n this._mergedDocumentNeedsSaving === true\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 if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this._annotationStorageModified = true;\n }\n };\n annotationStorage.onResetModified = () => {\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 },\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.viewsManager?.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 // 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 * @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 /* keepLoadedFonts = */ AppOptions.get(\"fontExtraProperties\")\n );\n },\n\n forceRendering() {\n this.pdfRenderingQueue.printing = !!this.printService;\n this.pdfRenderingQueue.isThumbnailViewEnabled =\n this.viewsManager?.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(() => this.pdfDocument?.annotationStorage.print);\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 || !this.pdfViewer.printingAllowed) {\n this._otherError(\"pdfjs-printing-not-supported\");\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(\"pdfjs-printing-not-ready\").then(msg => {\n // eslint-disable-next-line no-alert\n window.alert(msg);\n });\n return;\n }\n\n this.printService = PDFPrintServiceFactory.createPrintService({\n pdfDocument: this.pdfDocument,\n pagesOverview: this.pdfViewer.getPagesOverview(),\n printContainer: this.appConfig.printContainer,\n printResolution: AppOptions.get(\"printResolution\"),\n printAnnotationStoragePromise: this._printAnnotationStoragePromise,\n });\n this.forceRendering();\n // Disable the editor-indicator during printing (fixes bug 1790552).\n this.setTitle();\n\n this.printService.layout();\n\n if (this._hasAnnotationEditors) {\n this.externalServices.reportTelemetry({\n type: \"editing\",\n data: {\n type: \"print\",\n stats: this.pdfDocument?.annotationStorage.editorStats,\n },\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 async triggerPrinting() {\n if (this.supportsPrinting && (await this._printPermissionPromise)) {\n window.print();\n }\n },\n\n bindEvents() {\n if (this._eventBusAC) {\n return;\n }\n const ac = (this._eventBusAC = new AbortController());\n const opts = { signal: ac.signal, ...internalOpt };\n\n const {\n eventBus,\n externalServices,\n pdfDocumentProperties,\n pdfViewer,\n preferences,\n } = this;\n\n eventBus.on(\"resize\", onResize.bind(this), opts);\n eventBus.on(\"hashchange\", onHashchange.bind(this), opts);\n eventBus.on(\"beforeprint\", this.beforePrint.bind(this), opts);\n eventBus.on(\"afterprint\", this.afterPrint.bind(this), opts);\n eventBus.on(\"pagerender\", onPageRender.bind(this), opts);\n eventBus.on(\"pagerendered\", onPageRendered.bind(this), opts);\n eventBus.on(\"updateviewarea\", onUpdateViewarea.bind(this), opts);\n eventBus.on(\"pagechanging\", onPageChanging.bind(this), opts);\n eventBus.on(\"scalechanging\", onScaleChanging.bind(this), opts);\n eventBus.on(\"rotationchanging\", onRotationChanging.bind(this), opts);\n eventBus.on(\"sidebarviewchanged\", onSidebarViewChanged.bind(this), opts);\n eventBus.on(\"pagemode\", onPageMode.bind(this), opts);\n eventBus.on(\"namedaction\", onNamedAction.bind(this), opts);\n eventBus.on(\n \"presentationmodechanged\",\n evt => (pdfViewer.presentationModeState = evt.state),\n opts\n );\n eventBus.on(\n \"presentationmode\",\n this.requestPresentationMode.bind(this),\n opts\n );\n eventBus.on(\n \"switchannotationeditormode\",\n evt => (pdfViewer.annotationEditorMode = evt),\n opts\n );\n eventBus.on(\"print\", this.triggerPrinting.bind(this), opts);\n eventBus.on(\"download\", this.downloadOrSave.bind(this), opts);\n eventBus.on(\"firstpage\", () => (this.page = 1), opts);\n eventBus.on(\"lastpage\", () => (this.page = this.pagesCount), opts);\n eventBus.on(\"nextpage\", () => pdfViewer.nextPage(), opts);\n eventBus.on(\"previouspage\", () => pdfViewer.previousPage(), opts);\n eventBus.on(\"zoomin\", this.zoomIn.bind(this), opts);\n eventBus.on(\"zoomout\", this.zoomOut.bind(this), opts);\n eventBus.on(\"zoomreset\", this.zoomReset.bind(this), opts);\n eventBus.on(\"pagenumberchanged\", onPageNumberChanged.bind(this), opts);\n eventBus.on(\n \"scalechanged\",\n evt => (pdfViewer.currentScaleValue = evt.value),\n opts\n );\n eventBus.on(\"rotatecw\", this.rotatePages.bind(this, 90), opts);\n eventBus.on(\"rotateccw\", this.rotatePages.bind(this, -90), opts);\n eventBus.on(\n \"optionalcontentconfig\",\n evt => (pdfViewer.optionalContentConfigPromise = evt.promise),\n opts\n );\n eventBus.on(\n \"switchscrollmode\",\n evt => (pdfViewer.scrollMode = evt.mode),\n opts\n );\n eventBus.on(\n \"scrollmodechanged\",\n onViewerModesChanged.bind(this, \"scrollMode\"),\n opts\n );\n eventBus.on(\n \"switchspreadmode\",\n evt => (pdfViewer.spreadMode = evt.mode),\n opts\n );\n eventBus.on(\n \"spreadmodechanged\",\n onViewerModesChanged.bind(this, \"spreadMode\"),\n opts\n );\n eventBus.on(\n \"imagealttextsettings\",\n onImageAltTextSettings.bind(this),\n opts\n );\n eventBus.on(\n \"documentproperties\",\n () => pdfDocumentProperties?.open(),\n opts\n );\n eventBus.on(\"findfromurlhash\", onFindFromUrlHash.bind(this), opts);\n eventBus.on(\n \"updatefindmatchescount\",\n onUpdateFindMatchesCount.bind(this),\n opts\n );\n eventBus.on(\n \"updatefindcontrolstate\",\n onUpdateFindControlState.bind(this),\n opts\n );\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n eventBus.on(\"fileinputchange\", onFileInputChange.bind(this), opts);\n eventBus.on(\"openfile\", onOpenFile.bind(this), opts);\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n eventBus.on(\n \"editingstateschanged\",\n evt => externalServices.updateEditorStates(evt),\n opts\n );\n eventBus.on(\n \"reporttelemetry\",\n evt => externalServices.reportTelemetry(evt.details),\n opts\n );\n }\n if (\n typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"TESTING || MOZCENTRAL\")\n ) {\n eventBus.on(\n \"setpreference\",\n evt => preferences.set(evt.name, evt.value),\n opts\n );\n }\n eventBus.on(\"pagesedited\", this.onPagesEdited.bind(this), opts);\n eventBus.on(\"saveextractedpages\", this.onSavePages.bind(this), opts);\n eventBus.on(\"saveandload\", this.onSaveAndLoad.bind(this), opts);\n },\n\n bindWindowEvents() {\n if (this._windowAC) {\n return;\n }\n this._windowAC = new AbortController();\n\n const {\n eventBus,\n appConfig: { mainContainer },\n pdfViewer,\n _windowAC: { signal },\n } = this;\n\n this._touchManager = new TouchManager({\n container: window,\n isPinchingDisabled: () => pdfViewer.isInPresentationMode,\n isPinchingStopped: () => this.overlayManager?.active,\n onPinching: this.touchPinchCallback.bind(this),\n onPinchEnd: this.touchPinchEndCallback.bind(this),\n signal,\n });\n\n function addWindowResolutionChange(evt = null) {\n if (evt) {\n pdfViewer.refresh();\n }\n const mediaQueryList = window.matchMedia(\n `(resolution: ${OutputScale.pixelRatio}dppx)`\n );\n mediaQueryList.addEventListener(\"change\", addWindowResolutionChange, {\n once: true,\n signal,\n });\n }\n addWindowResolutionChange();\n\n window.addEventListener(\"wheel\", onWheel.bind(this), {\n passive: false,\n signal,\n });\n window.addEventListener(\"click\", onClick.bind(this), { signal });\n window.addEventListener(\"keydown\", onKeyDown.bind(this), { signal });\n window.addEventListener(\"keyup\", onKeyUp.bind(this), { signal });\n window.addEventListener(\n \"resize\",\n () => eventBus.dispatch(\"resize\", { source: window }),\n { signal }\n );\n window.addEventListener(\n \"hashchange\",\n () => {\n eventBus.dispatch(\"hashchange\", {\n source: window,\n hash: document.location.hash.substring(1),\n });\n },\n { signal }\n );\n window.addEventListener(\n \"beforeprint\",\n () => eventBus.dispatch(\"beforeprint\", { source: window }),\n { signal }\n );\n window.addEventListener(\n \"afterprint\",\n () => eventBus.dispatch(\"afterprint\", { source: window }),\n { signal }\n );\n window.addEventListener(\n \"updatefromsandbox\",\n evt => {\n eventBus.dispatch(\"updatefromsandbox\", {\n source: window,\n detail: evt.detail,\n });\n },\n { signal }\n );\n window.addEventListener(\"beforeunload\", onBeforeUnload.bind(this), {\n signal,\n });\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n !(\"onscrollend\" in document.documentElement)\n ) {\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n // Using the values lastScrollTop and lastScrollLeft is a workaround to\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1881974.\n // TODO: remove them once the bug is fixed.\n ({ scrollTop: this._lastScrollTop, scrollLeft: this._lastScrollLeft } =\n mainContainer);\n }\n\n let scrollendTimeoutID, scrollAbortController;\n const scrollend = () => {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n ({ scrollTop: this._lastScrollTop, scrollLeft: this._lastScrollLeft } =\n mainContainer);\n }\n clearTimeout(scrollendTimeoutID);\n if (this._isScrolling) {\n scrollAbortController.abort();\n scrollAbortController = null;\n this._isScrolling = false;\n }\n };\n const scroll = () => {\n if (this._isCtrlKeyDown) {\n return;\n }\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n this._lastScrollTop === mainContainer.scrollTop &&\n this._lastScrollLeft === mainContainer.scrollLeft\n ) {\n return;\n }\n\n if (!this._isScrolling) {\n scrollAbortController = new AbortController();\n const abortSignal = AbortSignal.any([\n scrollAbortController.signal,\n signal,\n ]);\n\n mainContainer.addEventListener(\"scrollend\", scrollend, {\n signal: abortSignal,\n });\n mainContainer.addEventListener(\"blur\", scrollend, {\n signal: abortSignal,\n });\n this._isScrolling = true;\n }\n clearTimeout(scrollendTimeoutID);\n // Why 100 ? Because of:\n // https://developer.chrome.com/blog/scrollend-a-new-javascript-event\n // Maybe we could find a better value... ideally the `scrollend` event\n // should be correctly fired.\n scrollendTimeoutID = setTimeout(scrollend, 100);\n };\n mainContainer.addEventListener(\"scroll\", scroll, {\n passive: true,\n signal,\n });\n },\n\n unbindEvents() {\n this._eventBusAC?.abort();\n this._eventBusAC = null;\n },\n\n unbindWindowEvents() {\n this._windowAC?.abort();\n this._windowAC = null;\n this._touchManager = null;\n },\n\n /**\n * @ignore\n */\n async testingClose() {\n this.unbindEvents();\n this.unbindWindowEvents();\n\n this._globalAbortController?.abort();\n this._globalAbortController = null;\n\n this.findBar?.close();\n\n await Promise.all([this.l10n?.destroy(), this.close()]);\n },\n\n onPagesEdited(data) {\n this.pdfViewer.onPagesEdited(data);\n },\n\n async onSavePages({ data: extractParams }) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n return;\n }\n if (!this.downloadManager) {\n return;\n }\n if (!this.pdfDocument) {\n return;\n }\n const modifiedPdfBytes = await this.pdfDocument.extractPages(extractParams);\n if (!modifiedPdfBytes) {\n console.error(\n \"Something wrong happened when saving the edited PDF.\\nPlease file a bug.\"\n );\n return;\n }\n this.downloadManager.download(\n modifiedPdfBytes,\n this._downloadUrl,\n this._docFilename\n );\n },\n\n async onSaveAndLoad({ data: extractParams }) {\n if (!this.pdfDocument) {\n return;\n }\n const modifiedPdfBytes = await this.pdfDocument.extractPages(extractParams);\n if (!modifiedPdfBytes) {\n console.error(\n \"Something wrong happened when saving the edited PDF.\\nPlease file a bug.\"\n );\n return;\n }\n this._mergedDocumentNeedsSaving = true;\n\n this.open({\n data: modifiedPdfBytes,\n filename: this._docFilename,\n });\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 /**\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\ninitCom(PDFViewerApplication);\nPDFPrintServiceFactory.initGlobals(PDFViewerApplication);\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n const HOSTED_VIEWER_ORIGINS = new Set([\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 const viewerOrigin = URL.parse(window.location)?.origin || \"null\";\n if (HOSTED_VIEWER_ORIGINS.has(viewerOrigin)) {\n // Hosted or local viewer, allow for any file locations\n return;\n }\n const fileOrigin = URL.parse(file, window.location)?.origin;\n if (fileOrigin === viewerOrigin) {\n return;\n }\n const ex = new Error(\"file origin does not match viewer's\");\n\n PDFViewerApplication._documentError(\"pdfjs-loading-error\", {\n message: ex.message,\n });\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 throw ex;\n };\n\n // eslint-disable-next-line no-var\n var onFileInputChange = function (evt) {\n if (this.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 this.open({\n url: URL.createObjectURL(file),\n originalUrl: encodeURIComponent(file.name),\n });\n };\n\n // eslint-disable-next-line no-var\n var onOpenFile = function (evt) {\n this._openFileInput?.click();\n };\n}\n\nfunction onPageRender({ 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 === this.page) {\n this.toolbar?.updateLoadingIndicatorState(true);\n }\n}\n\nfunction onPageRendered({ pageNumber, isDetailView, 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 === this.page) {\n this.toolbar?.updateLoadingIndicatorState(false);\n }\n\n // Use the rendered page to set the corresponding thumbnail image.\n if (!isDetailView && this.viewsManager?.visibleView === SidebarView.THUMBS) {\n const pageView = this.pdfViewer.getPageView(/* index = */ pageNumber - 1);\n const thumbnailView = this.pdfThumbnailViewer?.getThumbnail(\n /* index = */ pageNumber - 1\n );\n if (pageView) {\n thumbnailView?.setImage(pageView);\n }\n }\n\n if (error) {\n this._otherError(\"pdfjs-rendering-error\", error);\n }\n}\n\nfunction onPageMode({ 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 this.viewsManager?.switchView(view, /* forceOpen = */ true);\n}\n\nfunction onNamedAction(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 this.appConfig.toolbar?.pageNumber.select();\n break;\n\n case \"Find\":\n if (!this.supportsIntegratedFind) {\n this.findBar?.toggle();\n }\n break;\n\n case \"Print\":\n this.triggerPrinting();\n break;\n\n case \"SaveAs\":\n this.downloadOrSave();\n break;\n }\n}\n\nfunction onSidebarViewChanged({ view }) {\n this.pdfRenderingQueue.isThumbnailViewEnabled = view === SidebarView.THUMBS;\n\n if (this.isInitialViewSet) {\n // Only update the storage when the document has been loaded *and* rendered.\n this.store?.set(\"sidebarView\", view).catch(() => {\n // Unable to write to storage.\n });\n }\n}\n\nfunction onUpdateViewarea({ location }) {\n if (this.isInitialViewSet) {\n // Only update the storage when the document has been loaded *and* rendered.\n this.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 (this.appConfig.secondaryToolbar) {\n this.appConfig.secondaryToolbar.viewBookmarkButton.href =\n this.pdfLinkService.getAnchorUrl(location.pdfOpenParams);\n }\n}\n\nfunction onViewerModesChanged(name, evt) {\n if (this.isInitialViewSet && !this.pdfViewer.isInPresentationMode) {\n // Only update the storage when the document has been loaded *and* rendered.\n this.store?.set(name, evt.mode).catch(() => {\n // Unable to write to storage.\n });\n }\n}\n\nfunction onResize() {\n const { pdfDocument, pdfViewer, pdfRenderingQueue } = this;\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 onHashchange(evt) {\n const hash = evt.hash;\n if (!hash) {\n return;\n }\n if (!this.isInitialViewSet) {\n this.initialBookmark = hash;\n } else if (!this.pdfHistory?.popStateInProgress) {\n this.pdfLinkService.setHash(hash);\n }\n}\n\nfunction onPageNumberChanged(evt) {\n const { pdfViewer } = this;\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 this.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 this.toolbar?.setPageNumber(\n pdfViewer.currentPageNumber,\n pdfViewer.currentPageLabel\n );\n }\n}\n\nfunction onImageAltTextSettings() {\n this.imageAltTextSettings?.open({\n enableGuessAltText: AppOptions.get(\"enableGuessAltText\"),\n enableNewAltTextWhenAddingImage: AppOptions.get(\n \"enableNewAltTextWhenAddingImage\"\n ),\n });\n}\n\nfunction onFindFromUrlHash(evt) {\n this.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 onUpdateFindMatchesCount({ matchesCount }) {\n if (this.supportsIntegratedFind) {\n this.externalServices.updateFindMatchesCount(matchesCount);\n } else {\n this.findBar?.updateResultsCount(matchesCount);\n }\n}\n\nfunction onUpdateFindControlState({\n state,\n previous,\n entireWord,\n matchesCount,\n rawQuery,\n}) {\n if (this.supportsIntegratedFind) {\n this.externalServices.updateFindControlState({\n result: state,\n findPrevious: previous,\n entireWord,\n matchesCount,\n rawQuery,\n });\n } else {\n this.findBar?.updateUIState(state, previous, matchesCount);\n }\n}\n\nfunction onScaleChanging(evt) {\n this.toolbar?.setPageScale(evt.presetValue, evt.scale);\n\n this.pdfViewer.update();\n}\n\nfunction onRotationChanging(evt) {\n if (this.pdfThumbnailViewer) {\n this.pdfThumbnailViewer.pagesRotation = evt.pagesRotation;\n }\n\n this.forceRendering();\n // Ensure that the active page doesn't change during rotation.\n this.pdfViewer.currentPageNumber = evt.pageNumber;\n}\n\nfunction onPageChanging({ pageNumber, pageLabel }) {\n this.toolbar?.setPageNumber(pageNumber, pageLabel);\n this.secondaryToolbar?.setPageNumber(pageNumber);\n\n if (this.viewsManager?.visibleView === SidebarView.THUMBS) {\n this.pdfThumbnailViewer?.scrollThumbnailIntoView(pageNumber);\n }\n\n // Show/hide the loading indicator in the page number input element.\n const currentPage = this.pdfViewer.getPageView(/* index = */ pageNumber - 1);\n this.toolbar?.updateLoadingIndicatorState(\n currentPage?.renderingState === RenderingStates.RUNNING\n );\n}\n\nfunction onWheel(evt) {\n const {\n pdfViewer,\n supportsMouseWheelZoomCtrlKey,\n supportsMouseWheelZoomMetaKey,\n supportsPinchToZoom,\n } = this;\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 !this._isCtrlKeyDown &&\n deltaMode === WheelEvent.DOM_DELTA_PIXEL &&\n evt.deltaX === 0 &&\n (Math.abs(scaleFactor - 1) < 0.05 || isBuiltInMac) &&\n evt.deltaZ === 0;\n const origin = [evt.clientX, evt.clientY];\n\n if (\n isPinchToZoom ||\n (evt.ctrlKey && supportsMouseWheelZoomCtrlKey) ||\n (evt.metaKey && supportsMouseWheelZoomMetaKey)\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 this._isScrolling ||\n document.visibilityState === \"hidden\" ||\n this.overlayManager.active\n ) {\n return;\n }\n\n if (isPinchToZoom && supportsPinchToZoom) {\n scaleFactor = this._accumulateFactor(\n pdfViewer.currentScale,\n scaleFactor,\n \"_wheelUnusedFactor\"\n );\n this.updateZoom(null, scaleFactor, origin);\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 //\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 =\n Math.abs(delta) >= 1\n ? Math.sign(delta)\n : this._accumulateTicks(delta, \"_wheelUnusedTicks\");\n } else {\n // pixel-based devices\n const PIXELS_PER_LINE_SCALE = 30;\n ticks = this._accumulateTicks(\n delta / PIXELS_PER_LINE_SCALE,\n \"_wheelUnusedTicks\"\n );\n }\n\n this.updateZoom(ticks, null, origin);\n }\n }\n}\n\nfunction closeSecondaryToolbar({ target }) {\n if (!this.secondaryToolbar?.isOpen) {\n return;\n }\n const { toolbar, secondaryToolbar } = this.appConfig;\n if (\n this.pdfViewer.containsElement(target) ||\n (toolbar?.container.contains(target) &&\n !secondaryToolbar?.toolbar.contains(target) &&\n // TODO: change the `contains` for an equality check when the bug:\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1921984\n // is fixed.\n !secondaryToolbar?.toggleButton.contains(target))\n ) {\n this.secondaryToolbar.close();\n }\n}\n\nfunction closeEditorUndoBar(evt) {\n if (!this.editorUndoBar?.isOpen) {\n return;\n }\n if (this.appConfig.secondaryToolbar?.toolbar.contains(evt.target)) {\n this.editorUndoBar.hide();\n }\n}\n\nfunction closeSignatureProperties({ target }) {\n if (this.signaturePropertiesManager?.shouldCloseOnClick(target)) {\n this.signaturePropertiesManager.close();\n }\n}\n\nfunction onBeforeUnload(evt) {\n if (this._hasChanges()) {\n evt.preventDefault();\n evt.returnValue = \"\";\n return false;\n }\n return true;\n}\n\nfunction onClick(evt) {\n closeSecondaryToolbar.call(this, evt);\n closeEditorUndoBar.call(this, evt);\n closeSignatureProperties.call(this, evt);\n}\n\nfunction onKeyUp(evt) {\n // evt.ctrlKey is false hence we use evt.key.\n if (evt.key === \"Control\") {\n this._isCtrlKeyDown = false;\n }\n}\n\nfunction onKeyDown(evt) {\n this._isCtrlKeyDown = evt.key === \"Control\";\n\n if (\n this.editorUndoBar?.isOpen &&\n evt.keyCode !== 9 &&\n evt.keyCode !== 16 &&\n !(\n (evt.keyCode === 13 || evt.keyCode === 32) &&\n getActiveOrFocusedElement() === this.appConfig.editorUndoBar.undoButton\n )\n ) {\n // Hide undo bar on keypress except for Shift, Tab, Shift+Tab.\n // Also avoid hiding if the undo button is triggered.\n this.editorUndoBar.hide();\n }\n\n if (this.overlayManager.active) {\n return;\n }\n const { eventBus, pdfViewer } = this;\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 (!this.supportsIntegratedFind && !evt.shiftKey) {\n this.findBar?.open();\n handled = true;\n }\n break;\n case 71: // g\n if (!this.supportsIntegratedFind) {\n const { state } = this.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 this.zoomIn();\n handled = true;\n break;\n case 173: // FF/Mac '-'\n case 109: // FF '-'\n case 189: // Chrome '-'\n this.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(() => {\n // ... and resetting the scale after browser adjusts its scale\n this.zoomReset();\n });\n handled = false;\n }\n break;\n\n case 38: // up arrow\n if (isViewerInPresentationMode || this.page > 1) {\n this.page = 1;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n case 40: // down arrow\n if (isViewerInPresentationMode || this.page < this.pagesCount) {\n this.page = this.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 this.requestPresentationMode();\n handled = true;\n this.externalServices.reportTelemetry({\n type: \"buttons\",\n data: { id: \"presentationModeKeyboard\" },\n });\n break;\n case 71: // g\n // focuses input#pageNumber field\n if (this.appConfig.toolbar) {\n this.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 (curElementTagName === \"BUTTON\" && evt.keyCode === /* Space = */ 32) ||\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 if (this.supportsCaretBrowsingMode) {\n this.moveCaret(/* isUp = */ true, /* select = */ false);\n handled = true;\n break;\n }\n /* falls through */\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 if (this.supportsCaretBrowsingMode) {\n return;\n }\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 (this.secondaryToolbar?.isOpen) {\n this.secondaryToolbar.close();\n handled = true;\n }\n if (this.signaturePropertiesManager?.isOpen) {\n this.signaturePropertiesManager.close();\n handled = true;\n }\n if (!this.supportsIntegratedFind && this.findBar?.opened) {\n this.findBar.close();\n handled = true;\n }\n break;\n case 40: // down arrow\n if (this.supportsCaretBrowsingMode) {\n this.moveCaret(/* isUp = */ false, /* select = */ false);\n handled = true;\n break;\n }\n /* falls through */\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 32: // spacebar\n if (!isViewerInPresentationMode) {\n turnOnlyIfPageFit = true;\n }\n turnPage = 1;\n break;\n case 39: // right arrow\n if (this.supportsCaretBrowsingMode) {\n return;\n }\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 || this.page > 1) {\n this.page = 1;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n case 35: // end\n if (isViewerInPresentationMode || this.page < this.pagesCount) {\n this.page = this.pagesCount;\n handled = true;\n ensureViewerFocused = true;\n }\n break;\n\n case 83: // 's'\n this.pdfCursorTools?.switchTool(CursorTool.SELECT);\n break;\n case 72: // 'h'\n this.pdfCursorTools?.switchTool(CursorTool.HAND);\n break;\n\n case 82: // 'r'\n this.rotatePages(90);\n break;\n\n case 115: // F4\n this.viewsManager?.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 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 38: // up arrow\n this.moveCaret(/* isUp = */ true, /* select = */ true);\n handled = true;\n break;\n case 40: // down arrow\n this.moveCaret(/* isUp = */ false, /* select = */ true);\n handled = true;\n break;\n case 82: // 'r'\n this.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\nexport { PDFViewerApplication };\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 { ScrollMode, SpreadMode } from \"./ui_utils.js\";\nimport { AppOptions } from \"./app_options.js\";\nimport { LinkTarget } from \"./pdf_link_service.js\";\nimport { PDFViewerApplication } from \"./app.js\";\nimport { RenderingStates } from \"./renderable_view.js\";\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 principalContainer: document.getElementById(\"mainContainer\"),\n mainContainer: document.getElementById(\"viewerContainer\"),\n viewerContainer: document.getElementById(\"viewer\"),\n viewerAlert: document.getElementById(\"viewer-alert\"),\n toolbar: {\n container: document.getElementById(\"toolbarContainer\"),\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(\"zoomInButton\"),\n zoomOut: document.getElementById(\"zoomOutButton\"),\n print: document.getElementById(\"printButton\"),\n editorCommentButton: document.getElementById(\"editorCommentButton\"),\n editorCommentParamsToolbar: document.getElementById(\n \"editorCommentParamsToolbar\"\n ),\n editorFreeTextButton: document.getElementById(\"editorFreeTextButton\"),\n editorFreeTextParamsToolbar: document.getElementById(\n \"editorFreeTextParamsToolbar\"\n ),\n editorHighlightButton: document.getElementById(\"editorHighlightButton\"),\n editorHighlightParamsToolbar: document.getElementById(\n \"editorHighlightParamsToolbar\"\n ),\n editorHighlightColorPicker: document.getElementById(\n \"editorHighlightColorPicker\"\n ),\n editorInkButton: document.getElementById(\"editorInkButton\"),\n editorInkParamsToolbar: document.getElementById(\"editorInkParamsToolbar\"),\n editorStampButton: document.getElementById(\"editorStampButton\"),\n editorStampParamsToolbar: document.getElementById(\n \"editorStampParamsToolbar\"\n ),\n editorSignatureButton: document.getElementById(\"editorSignatureButton\"),\n editorSignatureParamsToolbar: document.getElementById(\n \"editorSignatureParamsToolbar\"\n ),\n signaturePropertiesButton: document.getElementById(\n \"signaturePropertiesButton\"\n ),\n signaturePropertiesPanel: document.getElementById(\n \"signaturePropertiesPanel\"\n ),\n signaturePropertiesContainer: document.getElementById(\n \"signaturePropertiesContainer\"\n ),\n signaturePropertiesBanner: document.getElementById(\n \"signaturePropertiesBanner\"\n ),\n signaturePropertiesList: document.getElementById(\n \"signaturePropertiesList\"\n ),\n signaturePropertiesSeparator: document.getElementById(\n \"signaturePropertiesSeparator\"\n ),\n download: document.getElementById(\"downloadButton\"),\n },\n secondaryToolbar: {\n toolbar: document.getElementById(\"secondaryToolbar\"),\n toggleButton: document.getElementById(\"secondaryToolbarToggleButton\"),\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 imageAltTextSettingsButton: document.getElementById(\n \"imageAltTextSettings\"\n ),\n imageAltTextSettingsSeparator: document.getElementById(\n \"imageAltTextSettingsSeparator\"\n ),\n documentPropertiesButton: document.getElementById(\"documentProperties\"),\n },\n viewsManager: {\n outerContainer: document.getElementById(\"outerContainer\"),\n toggleButton: document.getElementById(\"viewsManagerToggleButton\"),\n sidebarContainer: document.getElementById(\"viewsManager\"),\n resizer: document.getElementById(\"viewsManagerResizer\"),\n thumbnailButton: document.getElementById(\"thumbnailsViewMenu\"),\n outlineButton: document.getElementById(\"outlinesViewMenu\"),\n attachmentsButton: document.getElementById(\"attachmentsViewMenu\"),\n layersButton: document.getElementById(\"layersViewMenu\"),\n viewsManagerSelectorButton: document.getElementById(\n \"viewsManagerSelectorButton\"\n ),\n viewsManagerSelectorOptions: document.getElementById(\n \"viewsManagerSelectorOptions\"\n ),\n thumbnailsView: document.getElementById(\"thumbnailsView\"),\n outlinesView: document.getElementById(\"outlinesView\"),\n attachmentsView: document.getElementById(\"attachmentsView\"),\n layersView: document.getElementById(\"layersView\"),\n viewsManagerAddFile: {\n button: document.getElementById(\"viewsManagerAddFileButton\"),\n picker: document.getElementById(\"viewsManagerAddFilePicker\"),\n },\n viewsManagerCurrentOutlineButton: document.getElementById(\n \"viewsManagerCurrentOutlineButton\"\n ),\n viewsManagerHeaderLabel: document.getElementById(\n \"viewsManagerHeaderLabel\"\n ),\n viewsManagerStatus: document.getElementById(\"viewsManagerStatus\"),\n viewsManagerStatusBar: {\n viewsManagerStatusAction: document.getElementById(\n \"viewsManagerStatusAction\"\n ),\n viewsManagerStatusActionDeselectButton: document.getElementById(\n \"viewsManagerStatusActionDeselectButton\"\n ),\n viewsManagerStatusActionLabel: document.getElementById(\n \"viewsManagerStatusActionLabel\"\n ),\n },\n viewsManagerUndoBar: {\n viewsManagerStatusUndo: document.getElementById(\n \"viewsManagerStatusUndo\"\n ),\n viewsManagerStatusUndoLabel: document.getElementById(\n \"viewsManagerStatusUndoLabel\"\n ),\n viewsManagerStatusUndoButton: document.getElementById(\n \"viewsManagerStatusUndoButton\"\n ),\n viewsManagerStatusUndoCloseButton: document.getElementById(\n \"viewsManagerStatusUndoCloseButton\"\n ),\n },\n viewsManagerWaitingBar: {\n container: document.getElementById(\"viewsManagerStatusWaiting\"),\n closeButton: document.getElementById(\n \"viewsManagerStatusWaitingCloseButton\"\n ),\n label: document.getElementById(\"viewsManagerStatusWaitingLabel\"),\n },\n manageMenu: {\n button: document.getElementById(\"viewsManagerStatusActionButton\"),\n menu: document.getElementById(\"viewsManagerStatusActionOptions\"),\n copy: document.getElementById(\"viewsManagerStatusActionCopy\"),\n cut: document.getElementById(\"viewsManagerStatusActionCut\"),\n delete: document.getElementById(\"viewsManagerStatusActionDelete\"),\n exportSelected: document.getElementById(\n \"viewsManagerStatusActionExport\"\n ),\n },\n },\n findBar: {\n bar: document.getElementById(\"findbar\"),\n toggleButton: document.getElementById(\"viewFindButton\"),\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(\"findPreviousButton\"),\n findNextButton: document.getElementById(\"findNextButton\"),\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 newAltTextDialog: {\n dialog: document.getElementById(\"newAltTextDialog\"),\n title: document.getElementById(\"newAltTextTitle\"),\n descriptionContainer: document.getElementById(\n \"newAltTextDescriptionContainer\"\n ),\n textarea: document.getElementById(\"newAltTextDescriptionTextarea\"),\n disclaimer: document.getElementById(\"newAltTextDisclaimer\"),\n learnMore: document.getElementById(\"newAltTextLearnMore\"),\n imagePreview: document.getElementById(\"newAltTextImagePreview\"),\n createAutomatically: document.getElementById(\n \"newAltTextCreateAutomatically\"\n ),\n createAutomaticallyButton: document.getElementById(\n \"newAltTextCreateAutomaticallyButton\"\n ),\n downloadModel: document.getElementById(\"newAltTextDownloadModel\"),\n downloadModelDescription: document.getElementById(\n \"newAltTextDownloadModelDescription\"\n ),\n error: document.getElementById(\"newAltTextError\"),\n errorCloseButton: document.getElementById(\"newAltTextCloseButton\"),\n cancelButton: document.getElementById(\"newAltTextCancel\"),\n notNowButton: document.getElementById(\"newAltTextNotNow\"),\n saveButton: document.getElementById(\"newAltTextSave\"),\n },\n altTextSettingsDialog: {\n dialog: document.getElementById(\"altTextSettingsDialog\"),\n createModelButton: document.getElementById(\"createModelButton\"),\n learnMore: document.getElementById(\"altTextSettingsLearnMore\"),\n showAltTextDialogButton: document.getElementById(\n \"showAltTextDialogButton\"\n ),\n altTextSettingsCloseButton: document.getElementById(\n \"altTextSettingsCloseButton\"\n ),\n closeButton: document.getElementById(\"altTextSettingsCloseButton\"),\n },\n addSignatureDialog: {\n dialog: document.getElementById(\"addSignatureDialog\"),\n panels: document.getElementById(\"addSignatureActionContainer\"),\n typeButton: document.getElementById(\"addSignatureTypeButton\"),\n typeInput: document.getElementById(\"addSignatureTypeInput\"),\n drawButton: document.getElementById(\"addSignatureDrawButton\"),\n drawSVG: document.getElementById(\"addSignatureDraw\"),\n drawPlaceholder: document.getElementById(\"addSignatureDrawPlaceholder\"),\n drawThickness: document.getElementById(\"addSignatureDrawThickness\"),\n imageButton: document.getElementById(\"addSignatureImageButton\"),\n imageSVG: document.getElementById(\"addSignatureImage\"),\n imagePlaceholder: document.getElementById(\"addSignatureImagePlaceholder\"),\n imagePicker: document.getElementById(\"addSignatureFilePicker\"),\n imagePickerLink: document.getElementById(\"addSignatureImageBrowse\"),\n description: document.getElementById(\"addSignatureDescription\"),\n clearButton: document.getElementById(\"clearSignatureButton\"),\n saveContainer: document.getElementById(\"addSignatureSaveContainer\"),\n saveCheckbox: document.getElementById(\"addSignatureSaveCheckbox\"),\n errorBar: document.getElementById(\"addSignatureError\"),\n errorTitle: document.getElementById(\"addSignatureErrorTitle\"),\n errorDescription: document.getElementById(\"addSignatureErrorDescription\"),\n errorCloseButton: document.getElementById(\"addSignatureErrorCloseButton\"),\n cancelButton: document.getElementById(\"addSignatureCancelButton\"),\n addButton: document.getElementById(\"addSignatureAddButton\"),\n },\n editSignatureDialog: {\n dialog: document.getElementById(\"editSignatureDescriptionDialog\"),\n description: document.getElementById(\"editSignatureDescription\"),\n editSignatureView: document.getElementById(\"editSignatureView\"),\n cancelButton: document.getElementById(\"editSignatureCancelButton\"),\n updateButton: document.getElementById(\"editSignatureUpdateButton\"),\n },\n annotationEditorParams: {\n editorCommentsSidebar: document.getElementById(\"editorCommentsSidebar\"),\n editorCommentsSidebarCount: document.getElementById(\n \"editorCommentsSidebarCount\"\n ),\n editorCommentsSidebarTitle: document.getElementById(\n \"editorCommentsSidebarTitle\"\n ),\n editorCommentsSidebarCloseButton: document.getElementById(\n \"editorCommentsSidebarCloseButton\"\n ),\n editorCommentsSidebarList: document.getElementById(\n \"editorCommentsSidebarList\"\n ),\n editorCommentsSidebarResizer: document.getElementById(\n \"editorCommentsSidebarResizer\"\n ),\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 editorSignatureAddSignature: document.getElementById(\n \"editorSignatureAddSignature\"\n ),\n editorFreeHighlightThickness: document.getElementById(\n \"editorFreeHighlightThickness\"\n ),\n editorHighlightShowAll: document.getElementById(\"editorHighlightShowAll\"),\n },\n printContainer: document.getElementById(\"printContainer\"),\n editorUndoBar: {\n container: document.getElementById(\"editorUndoBar\"),\n message: document.getElementById(\"editorUndoBarMessage\"),\n undoButton: document.getElementById(\"editorUndoBarUndoButton\"),\n closeButton: document.getElementById(\"editorUndoBarCloseButton\"),\n },\n ...(typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"MOZCENTRAL && !GECKOVIEW\")\n ? {\n featuresNotification: document.getElementById(\n \"pdfFeaturesNotification\"\n ),\n }\n : {}),\n editCommentDialog: {\n dialog: document.getElementById(\"commentManagerDialog\"),\n toolbar: document.getElementById(\"commentManagerToolbar\"),\n title: document.getElementById(\"commentManagerTitle\"),\n textInput: document.getElementById(\"commentManagerTextInput\"),\n cancelButton: document.getElementById(\"commentManagerCancelButton\"),\n saveButton: document.getElementById(\"commentManagerSaveButton\"),\n },\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":[],"sourceRoot":""} |