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ACA;UACA;UACA;UACA;UACA;UACA;UACA,CAAC;UACD;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA,EAAE;UACF;UACA,sGAAsG;UACtG;UACA;UACA;UACA;UACA;UACA;UACA;UACA,GAAG;UACH;UACA;UACA;UACA;UACA;UACA,GAAG;UACH;UACA,EAAE;UACF;UACA;;;;;UChEA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA;;;;;UCPA;;;;;SEAA;SACA;SACA;SACA","sources":["webpack://pdf.js/src/shared/scripting_utils.js","webpack://pdf.js/src/display/annotation_layer.js","webpack://pdf.js/src/display/annotation_storage.js","webpack://pdf.js/src/display/api.js","webpack://pdf.js/src/display/base_factory.js","webpack://pdf.js/src/display/pattern_helper.js","webpack://pdf.js/src/shared/image_utils.js","webpack://pdf.js/src/display/canvas.js","webpack://pdf.js/src/display/display_utils.js","webpack://pdf.js/src/display/draw_layer.js","webpack://pdf.js/src/display/editor/freetext.js","webpack://pdf.js/src/display/editor/ink.js","webpack://pdf.js/src/display/editor/stamp.js","webpack://pdf.js/src/display/editor/annotation_editor_layer.js","webpack://pdf.js/src/display/editor/toolbar.js","webpack://pdf.js/src/display/editor/editor.js","webpack://pdf.js/src/display/editor/outliner.js","webpack://pdf.js/src/display/editor/tools.js","webpack://pdf.js/src/display/fetch_stream.js","webpack://pdf.js/src/display/font_loader.js","webpack://pdf.js/src/display/metadata.js","webpack://pdf.js/src/display/network.js","webpack://pdf.js/src/display/content_disposition.js","webpack://pdf.js/src/display/network_utils.js","webpack://pdf.js/src/display/node_stream.js","webpack://pdf.js/src/display/node_utils.js","webpack://pdf.js/src/display/optional_content_config.js","webpack://pdf.js/src/display/text_layer.js","webpack://pdf.js/src/display/transport_stream.js","webpack://pdf.js/src/display/worker_options.js","webpack://pdf.js/src/display/xfa_layer.js","webpack://pdf.js/src/display/xfa_text.js","webpack://pdf.js/src/pdf.js","webpack://pdf.js/src/shared/message_handler.js","webpack://pdf.js/src/shared/murmurhash3.js","webpack://pdf.js/src/shared/util.js","webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/webpack/runtime/async module","webpack://pdf.js/webpack/runtime/define property getters","webpack://pdf.js/webpack/runtime/hasOwnProperty shorthand","webpack://pdf.js/webpack/before-startup","webpack://pdf.js/webpack/startup","webpack://pdf.js/webpack/after-startup"],"sourcesContent":["/* 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/**\n * PLEASE NOTE: This file is currently imported in both the `../display/` and\n * `../scripting_api/` folders, hence be EXTREMELY careful about\n * introducing any dependencies here since that can lead to an\n * unexpected/unnecessary size increase of the *built* files.\n */\n\nfunction makeColorComp(n) {\n return Math.floor(Math.max(0, Math.min(1, n)) * 255)\n .toString(16)\n .padStart(2, \"0\");\n}\n\nfunction scaleAndClamp(x) {\n return Math.max(0, Math.min(255, 255 * x));\n}\n\n// PDF specifications section 10.3\nclass ColorConverters {\n static CMYK_G([c, y, m, k]) {\n return [\"G\", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];\n }\n\n static G_CMYK([g]) {\n return [\"CMYK\", 0, 0, 0, 1 - g];\n }\n\n static G_RGB([g]) {\n return [\"RGB\", g, g, g];\n }\n\n static G_rgb([g]) {\n g = scaleAndClamp(g);\n return [g, g, g];\n }\n\n static G_HTML([g]) {\n const G = makeColorComp(g);\n return `#${G}${G}${G}`;\n }\n\n static RGB_G([r, g, b]) {\n return [\"G\", 0.3 * r + 0.59 * g + 0.11 * b];\n }\n\n static RGB_rgb(color) {\n return color.map(scaleAndClamp);\n }\n\n static RGB_HTML(color) {\n return `#${color.map(makeColorComp).join(\"\")}`;\n }\n\n static T_HTML() {\n return \"#00000000\";\n }\n\n static T_rgb() {\n return [null];\n }\n\n static CMYK_RGB([c, y, m, k]) {\n return [\n \"RGB\",\n 1 - Math.min(1, c + k),\n 1 - Math.min(1, m + k),\n 1 - Math.min(1, y + k),\n ];\n }\n\n static CMYK_rgb([c, y, m, k]) {\n return [\n scaleAndClamp(1 - Math.min(1, c + k)),\n scaleAndClamp(1 - Math.min(1, m + k)),\n scaleAndClamp(1 - Math.min(1, y + k)),\n ];\n }\n\n static CMYK_HTML(components) {\n const rgb = this.CMYK_RGB(components).slice(1);\n return this.RGB_HTML(rgb);\n }\n\n static RGB_CMYK([r, g, b]) {\n const c = 1 - r;\n const m = 1 - g;\n const y = 1 - b;\n const k = Math.min(c, m, y);\n return [\"CMYK\", c, m, y, k];\n }\n}\n\nexport { ColorConverters };\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(\"./api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport {\n AnnotationBorderStyleType,\n AnnotationEditorType,\n AnnotationPrefix,\n AnnotationType,\n FeatureTest,\n LINE_FACTOR,\n shadow,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n DOMSVGFactory,\n getFilenameFromUrl,\n PDFDateString,\n setLayerDimensions,\n} from \"./display_utils.js\";\nimport { AnnotationStorage } from \"./annotation_storage.js\";\nimport { ColorConverters } from \"../shared/scripting_utils.js\";\nimport { XfaLayer } from \"./xfa_layer.js\";\n\nconst DEFAULT_TAB_INDEX = 1000;\nconst DEFAULT_FONT_SIZE = 9;\nconst GetElementsByNameSet = new WeakSet();\n\nfunction getRectDims(rect) {\n return {\n width: rect[2] - rect[0],\n height: rect[3] - rect[1],\n };\n}\n\n/**\n * @typedef {Object} AnnotationElementParameters\n * @property {Object} data\n * @property {HTMLDivElement} layer\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} [downloadManager]\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 {Object} svgFactory\n * @property {boolean} [enableScripting]\n * @property {boolean} [hasJSActions]\n * @property {Object} [fieldObjects]\n */\n\nclass AnnotationElementFactory {\n /**\n * @param {AnnotationElementParameters} parameters\n * @returns {AnnotationElement}\n */\n static create(parameters) {\n const subtype = parameters.data.annotationType;\n\n switch (subtype) {\n case AnnotationType.LINK:\n return new LinkAnnotationElement(parameters);\n\n case AnnotationType.TEXT:\n return new TextAnnotationElement(parameters);\n\n case AnnotationType.WIDGET:\n const fieldType = parameters.data.fieldType;\n\n switch (fieldType) {\n case \"Tx\":\n return new TextWidgetAnnotationElement(parameters);\n case \"Btn\":\n if (parameters.data.radioButton) {\n return new RadioButtonWidgetAnnotationElement(parameters);\n } else if (parameters.data.checkBox) {\n return new CheckboxWidgetAnnotationElement(parameters);\n }\n return new PushButtonWidgetAnnotationElement(parameters);\n case \"Ch\":\n return new ChoiceWidgetAnnotationElement(parameters);\n case \"Sig\":\n return new SignatureWidgetAnnotationElement(parameters);\n }\n return new WidgetAnnotationElement(parameters);\n\n case AnnotationType.POPUP:\n return new PopupAnnotationElement(parameters);\n\n case AnnotationType.FREETEXT:\n return new FreeTextAnnotationElement(parameters);\n\n case AnnotationType.LINE:\n return new LineAnnotationElement(parameters);\n\n case AnnotationType.SQUARE:\n return new SquareAnnotationElement(parameters);\n\n case AnnotationType.CIRCLE:\n return new CircleAnnotationElement(parameters);\n\n case AnnotationType.POLYLINE:\n return new PolylineAnnotationElement(parameters);\n\n case AnnotationType.CARET:\n return new CaretAnnotationElement(parameters);\n\n case AnnotationType.INK:\n return new InkAnnotationElement(parameters);\n\n case AnnotationType.POLYGON:\n return new PolygonAnnotationElement(parameters);\n\n case AnnotationType.HIGHLIGHT:\n return new HighlightAnnotationElement(parameters);\n\n case AnnotationType.UNDERLINE:\n return new UnderlineAnnotationElement(parameters);\n\n case AnnotationType.SQUIGGLY:\n return new SquigglyAnnotationElement(parameters);\n\n case AnnotationType.STRIKEOUT:\n return new StrikeOutAnnotationElement(parameters);\n\n case AnnotationType.STAMP:\n return new StampAnnotationElement(parameters);\n\n case AnnotationType.FILEATTACHMENT:\n return new FileAttachmentAnnotationElement(parameters);\n\n default:\n return new AnnotationElement(parameters);\n }\n }\n}\n\nclass AnnotationElement {\n #hasBorder = false;\n\n constructor(\n parameters,\n {\n isRenderable = false,\n ignoreBorder = false,\n createQuadrilaterals = false,\n } = {}\n ) {\n this.isRenderable = isRenderable;\n this.data = parameters.data;\n this.layer = parameters.layer;\n this.linkService = parameters.linkService;\n this.downloadManager = parameters.downloadManager;\n this.imageResourcesPath = parameters.imageResourcesPath;\n this.renderForms = parameters.renderForms;\n this.svgFactory = parameters.svgFactory;\n this.annotationStorage = parameters.annotationStorage;\n this.enableScripting = parameters.enableScripting;\n this.hasJSActions = parameters.hasJSActions;\n this._fieldObjects = parameters.fieldObjects;\n this.parent = parameters.parent;\n\n if (isRenderable) {\n this.container = this._createContainer(ignoreBorder);\n }\n if (createQuadrilaterals) {\n this._createQuadrilaterals();\n }\n }\n\n static _hasPopupData({ titleObj, contentsObj, richText }) {\n return !!(titleObj?.str || contentsObj?.str || richText?.str);\n }\n\n get hasPopupData() {\n return AnnotationElement._hasPopupData(this.data);\n }\n\n /**\n * Create an empty container for the annotation's HTML element.\n *\n * @private\n * @param {boolean} ignoreBorder\n * @memberof AnnotationElement\n * @returns {HTMLElement} A section element.\n */\n _createContainer(ignoreBorder) {\n const {\n data,\n parent: { page, viewport },\n } = this;\n\n const container = document.createElement(\"section\");\n container.setAttribute(\"data-annotation-id\", data.id);\n if (!(this instanceof WidgetAnnotationElement)) {\n container.tabIndex = DEFAULT_TAB_INDEX;\n }\n\n // The accessibility manager will move the annotation in the DOM in\n // order to match the visual ordering.\n // But if an annotation is above an other one, then we must draw it\n // after the other one whatever the order is in the DOM, hence the\n // use of the z-index.\n container.style.zIndex = this.parent.zIndex++;\n\n if (this.data.popupRef) {\n container.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n\n if (data.noRotate) {\n container.classList.add(\"norotate\");\n }\n\n const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n\n if (!data.rect || this instanceof PopupAnnotationElement) {\n const { rotation } = data;\n if (!data.hasOwnCanvas && rotation !== 0) {\n this.setRotation(rotation, container);\n }\n return container;\n }\n\n const { width, height } = getRectDims(data.rect);\n\n // Do *not* modify `data.rect`, since that will corrupt the annotation\n // position on subsequent calls to `_createContainer` (see issue 6804).\n const rect = Util.normalizeRect([\n data.rect[0],\n page.view[3] - data.rect[1] + page.view[1],\n data.rect[2],\n page.view[3] - data.rect[3] + page.view[1],\n ]);\n\n if (!ignoreBorder && data.borderStyle.width > 0) {\n container.style.borderWidth = `${data.borderStyle.width}px`;\n\n const horizontalRadius = data.borderStyle.horizontalCornerRadius;\n const verticalRadius = data.borderStyle.verticalCornerRadius;\n if (horizontalRadius > 0 || verticalRadius > 0) {\n const radius = `calc(${horizontalRadius}px * var(--scale-factor)) / calc(${verticalRadius}px * var(--scale-factor))`;\n container.style.borderRadius = radius;\n } else if (this instanceof RadioButtonWidgetAnnotationElement) {\n const radius = `calc(${width}px * var(--scale-factor)) / calc(${height}px * var(--scale-factor))`;\n container.style.borderRadius = radius;\n }\n\n switch (data.borderStyle.style) {\n case AnnotationBorderStyleType.SOLID:\n container.style.borderStyle = \"solid\";\n break;\n\n case AnnotationBorderStyleType.DASHED:\n container.style.borderStyle = \"dashed\";\n break;\n\n case AnnotationBorderStyleType.BEVELED:\n warn(\"Unimplemented border style: beveled\");\n break;\n\n case AnnotationBorderStyleType.INSET:\n warn(\"Unimplemented border style: inset\");\n break;\n\n case AnnotationBorderStyleType.UNDERLINE:\n container.style.borderBottomStyle = \"solid\";\n break;\n\n default:\n break;\n }\n\n const borderColor = data.borderColor || null;\n if (borderColor) {\n this.#hasBorder = true;\n container.style.borderColor = Util.makeHexColor(\n borderColor[0] | 0,\n borderColor[1] | 0,\n borderColor[2] | 0\n );\n } else {\n // Transparent (invisible) border, so do not draw it at all.\n container.style.borderWidth = 0;\n }\n }\n\n container.style.left = `${(100 * (rect[0] - pageX)) / pageWidth}%`;\n container.style.top = `${(100 * (rect[1] - pageY)) / pageHeight}%`;\n\n const { rotation } = data;\n if (data.hasOwnCanvas || rotation === 0) {\n container.style.width = `${(100 * width) / pageWidth}%`;\n container.style.height = `${(100 * height) / pageHeight}%`;\n } else {\n this.setRotation(rotation, container);\n }\n\n return container;\n }\n\n setRotation(angle, container = this.container) {\n if (!this.data.rect) {\n return;\n }\n const { pageWidth, pageHeight } = this.parent.viewport.rawDims;\n const { width, height } = getRectDims(this.data.rect);\n\n let elementWidth, elementHeight;\n if (angle % 180 === 0) {\n elementWidth = (100 * width) / pageWidth;\n elementHeight = (100 * height) / pageHeight;\n } else {\n elementWidth = (100 * height) / pageWidth;\n elementHeight = (100 * width) / pageHeight;\n }\n\n container.style.width = `${elementWidth}%`;\n container.style.height = `${elementHeight}%`;\n\n container.setAttribute(\"data-main-rotation\", (360 - angle) % 360);\n }\n\n get _commonActions() {\n const setColor = (jsName, styleName, event) => {\n const color = event.detail[jsName];\n const colorType = color[0];\n const colorArray = color.slice(1);\n event.target.style[styleName] =\n ColorConverters[`${colorType}_HTML`](colorArray);\n this.annotationStorage.setValue(this.data.id, {\n [styleName]: ColorConverters[`${colorType}_rgb`](colorArray),\n });\n };\n\n return shadow(this, \"_commonActions\", {\n display: event => {\n const { display } = event.detail;\n // See scripting/constants.js for the values of `Display`.\n // 0 = visible, 1 = hidden, 2 = noPrint and 3 = noView.\n const hidden = display % 2 === 1;\n this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n noView: hidden,\n noPrint: display === 1 || display === 2,\n });\n },\n print: event => {\n this.annotationStorage.setValue(this.data.id, {\n noPrint: !event.detail.print,\n });\n },\n hidden: event => {\n const { hidden } = event.detail;\n this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n noPrint: hidden,\n noView: hidden,\n });\n },\n focus: event => {\n setTimeout(() => event.target.focus({ preventScroll: false }), 0);\n },\n userName: event => {\n // tooltip\n event.target.title = event.detail.userName;\n },\n readonly: event => {\n event.target.disabled = event.detail.readonly;\n },\n required: event => {\n this._setRequired(event.target, event.detail.required);\n },\n bgColor: event => {\n setColor(\"bgColor\", \"backgroundColor\", event);\n },\n fillColor: event => {\n setColor(\"fillColor\", \"backgroundColor\", event);\n },\n fgColor: event => {\n setColor(\"fgColor\", \"color\", event);\n },\n textColor: event => {\n setColor(\"textColor\", \"color\", event);\n },\n borderColor: event => {\n setColor(\"borderColor\", \"borderColor\", event);\n },\n strokeColor: event => {\n setColor(\"strokeColor\", \"borderColor\", event);\n },\n rotation: event => {\n const angle = event.detail.rotation;\n this.setRotation(angle);\n this.annotationStorage.setValue(this.data.id, {\n rotation: angle,\n });\n },\n });\n }\n\n _dispatchEventFromSandbox(actions, jsEvent) {\n const commonActions = this._commonActions;\n for (const name of Object.keys(jsEvent.detail)) {\n const action = actions[name] || commonActions[name];\n action?.(jsEvent);\n }\n }\n\n _setDefaultPropertiesFromJS(element) {\n if (!this.enableScripting) {\n return;\n }\n\n // Some properties may have been updated thanks to JS.\n const storedData = this.annotationStorage.getRawValue(this.data.id);\n if (!storedData) {\n return;\n }\n\n const commonActions = this._commonActions;\n for (const [actionName, detail] of Object.entries(storedData)) {\n const action = commonActions[actionName];\n if (action) {\n const eventProxy = {\n detail: {\n [actionName]: detail,\n },\n target: element,\n };\n action(eventProxy);\n // The action has been consumed: no need to keep it.\n delete storedData[actionName];\n }\n }\n }\n\n /**\n * Create quadrilaterals from the annotation's quadpoints.\n *\n * @private\n * @memberof AnnotationElement\n */\n _createQuadrilaterals() {\n if (!this.container) {\n return;\n }\n const { quadPoints } = this.data;\n if (!quadPoints) {\n return;\n }\n\n const [rectBlX, rectBlY, rectTrX, rectTrY] = this.data.rect;\n\n if (quadPoints.length === 1) {\n const [, { x: trX, y: trY }, { x: blX, y: blY }] = quadPoints[0];\n if (\n rectTrX === trX &&\n rectTrY === trY &&\n rectBlX === blX &&\n rectBlY === blY\n ) {\n // The quadpoints cover the whole annotation rectangle, so no need to\n // create a quadrilateral.\n return;\n }\n }\n\n const { style } = this.container;\n let svgBuffer;\n if (this.#hasBorder) {\n const { borderColor, borderWidth } = style;\n style.borderWidth = 0;\n svgBuffer = [\n \"url('data:image/svg+xml;utf8,\",\n `<svg xmlns=\"http://www.w3.org/2000/svg\"`,\n ` preserveAspectRatio=\"none\" viewBox=\"0 0 1 1\">`,\n `<g fill=\"transparent\" stroke=\"${borderColor}\" stroke-width=\"${borderWidth}\">`,\n ];\n this.container.classList.add(\"hasBorder\");\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.container.classList.add(\"hasClipPath\");\n }\n\n const width = rectTrX - rectBlX;\n const height = rectTrY - rectBlY;\n\n const { svgFactory } = this;\n const svg = svgFactory.createElement(\"svg\");\n svg.classList.add(\"quadrilateralsContainer\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n const defs = svgFactory.createElement(\"defs\");\n svg.append(defs);\n const clipPath = svgFactory.createElement(\"clipPath\");\n const id = `clippath_${this.data.id}`;\n clipPath.setAttribute(\"id\", id);\n clipPath.setAttribute(\"clipPathUnits\", \"objectBoundingBox\");\n defs.append(clipPath);\n\n for (const [, { x: trX, y: trY }, { x: blX, y: blY }] of quadPoints) {\n const rect = svgFactory.createElement(\"rect\");\n const x = (blX - rectBlX) / width;\n const y = (rectTrY - trY) / height;\n const rectWidth = (trX - blX) / width;\n const rectHeight = (trY - blY) / height;\n rect.setAttribute(\"x\", x);\n rect.setAttribute(\"y\", y);\n rect.setAttribute(\"width\", rectWidth);\n rect.setAttribute(\"height\", rectHeight);\n clipPath.append(rect);\n svgBuffer?.push(\n `<rect vector-effect=\"non-scaling-stroke\" x=\"${x}\" y=\"${y}\" width=\"${rectWidth}\" height=\"${rectHeight}\"/>`\n );\n }\n\n if (this.#hasBorder) {\n svgBuffer.push(`</g></svg>')`);\n style.backgroundImage = svgBuffer.join(\"\");\n }\n\n this.container.append(svg);\n this.container.style.clipPath = `url(#${id})`;\n }\n\n /**\n * Create a popup for the annotation's HTML element. This is used for\n * annotations that do not have a Popup entry in the dictionary, but\n * are of a type that works with popups (such as Highlight annotations).\n *\n * @private\n * @memberof AnnotationElement\n */\n _createPopup() {\n const { container, data } = this;\n container.setAttribute(\"aria-haspopup\", \"dialog\");\n\n const popup = new PopupAnnotationElement({\n data: {\n color: data.color,\n titleObj: data.titleObj,\n modificationDate: data.modificationDate,\n contentsObj: data.contentsObj,\n richText: data.richText,\n parentRect: data.rect,\n borderStyle: 0,\n id: `popup_${data.id}`,\n rotation: data.rotation,\n },\n parent: this.parent,\n elements: [this],\n });\n this.parent.div.append(popup.render());\n }\n\n /**\n * Render the annotation's HTML element(s).\n *\n * @public\n * @memberof AnnotationElement\n */\n render() {\n unreachable(\"Abstract method `AnnotationElement.render` called\");\n }\n\n /**\n * @private\n * @returns {Array}\n */\n _getElementsByName(name, skipId = null) {\n const fields = [];\n\n if (this._fieldObjects) {\n const fieldObj = this._fieldObjects[name];\n if (fieldObj) {\n for (const { page, id, exportValues } of fieldObj) {\n if (page === -1) {\n continue;\n }\n if (id === skipId) {\n continue;\n }\n const exportValue =\n typeof exportValues === \"string\" ? exportValues : null;\n\n const domElement = document.querySelector(\n `[data-element-id=\"${id}\"]`\n );\n if (domElement && !GetElementsByNameSet.has(domElement)) {\n warn(`_getElementsByName - element not allowed: ${id}`);\n continue;\n }\n fields.push({ id, exportValue, domElement });\n }\n }\n return fields;\n }\n // Fallback to a regular DOM lookup, to ensure that the standalone\n // viewer components won't break.\n for (const domElement of document.getElementsByName(name)) {\n const { exportValue } = domElement;\n const id = domElement.getAttribute(\"data-element-id\");\n if (id === skipId) {\n continue;\n }\n if (!GetElementsByNameSet.has(domElement)) {\n continue;\n }\n fields.push({ id, exportValue, domElement });\n }\n return fields;\n }\n\n show() {\n if (this.container) {\n this.container.hidden = false;\n }\n this.popup?.maybeShow();\n }\n\n hide() {\n if (this.container) {\n this.container.hidden = true;\n }\n this.popup?.forceHide();\n }\n\n /**\n * Get the HTML element(s) which can trigger a popup when clicked or hovered.\n *\n * @public\n * @memberof AnnotationElement\n * @returns {Array<HTMLElement>|HTMLElement} An array of elements or an\n * element.\n */\n getElementsToTriggerPopup() {\n return this.container;\n }\n\n addHighlightArea() {\n const triggers = this.getElementsToTriggerPopup();\n if (Array.isArray(triggers)) {\n for (const element of triggers) {\n element.classList.add(\"highlightArea\");\n }\n } else {\n triggers.classList.add(\"highlightArea\");\n }\n }\n\n get _isEditable() {\n return false;\n }\n\n _editOnDoubleClick() {\n if (!this._isEditable) {\n return;\n }\n const {\n annotationEditorType: mode,\n data: { id: editId },\n } = this;\n this.container.addEventListener(\"dblclick\", () => {\n this.linkService.eventBus?.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode,\n editId,\n });\n });\n }\n}\n\nclass LinkAnnotationElement extends AnnotationElement {\n constructor(parameters, options = null) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: !!options?.ignoreBorder,\n createQuadrilaterals: true,\n });\n this.isTooltipOnly = parameters.data.isTooltipOnly;\n }\n\n render() {\n const { data, linkService } = this;\n const link = document.createElement(\"a\");\n link.setAttribute(\"data-element-id\", data.id);\n let isBound = false;\n\n if (data.url) {\n linkService.addLinkAttributes(link, data.url, data.newWindow);\n isBound = true;\n } else if (data.action) {\n this._bindNamedAction(link, data.action);\n isBound = true;\n } else if (data.attachment) {\n this.#bindAttachment(link, data.attachment, data.attachmentDest);\n isBound = true;\n } else if (data.setOCGState) {\n this.#bindSetOCGState(link, data.setOCGState);\n isBound = true;\n } else if (data.dest) {\n this._bindLink(link, data.dest);\n isBound = true;\n } else {\n if (\n data.actions &&\n (data.actions.Action ||\n data.actions[\"Mouse Up\"] ||\n data.actions[\"Mouse Down\"]) &&\n this.enableScripting &&\n this.hasJSActions\n ) {\n this._bindJSAction(link, data);\n isBound = true;\n }\n\n if (data.resetForm) {\n this._bindResetFormAction(link, data.resetForm);\n isBound = true;\n } else if (this.isTooltipOnly && !isBound) {\n this._bindLink(link, \"\");\n isBound = true;\n }\n }\n\n this.container.classList.add(\"linkAnnotation\");\n if (isBound) {\n this.container.append(link);\n }\n\n return this.container;\n }\n\n #setInternalLink() {\n this.container.setAttribute(\"data-internal-link\", \"\");\n }\n\n /**\n * Bind internal links to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} destination\n * @memberof LinkAnnotationElement\n */\n _bindLink(link, destination) {\n link.href = this.linkService.getDestinationHash(destination);\n link.onclick = () => {\n if (destination) {\n this.linkService.goToDestination(destination);\n }\n return false;\n };\n if (destination || destination === /* isTooltipOnly = */ \"\") {\n this.#setInternalLink();\n }\n }\n\n /**\n * Bind named actions to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} action\n * @memberof LinkAnnotationElement\n */\n _bindNamedAction(link, action) {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.linkService.executeNamedAction(action);\n return false;\n };\n this.#setInternalLink();\n }\n\n /**\n * Bind attachments to the link element.\n * @param {Object} link\n * @param {Object} attachment\n * @param {str} [dest]\n */\n #bindAttachment(link, attachment, dest = null) {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.downloadManager?.openOrDownloadData(\n attachment.content,\n attachment.filename,\n dest\n );\n return false;\n };\n this.#setInternalLink();\n }\n\n /**\n * Bind SetOCGState actions to the link element.\n * @param {Object} link\n * @param {Object} action\n */\n #bindSetOCGState(link, action) {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.linkService.executeSetOCGState(action);\n return false;\n };\n this.#setInternalLink();\n }\n\n /**\n * Bind JS actions to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} data\n * @memberof LinkAnnotationElement\n */\n _bindJSAction(link, data) {\n link.href = this.linkService.getAnchorUrl(\"\");\n const map = new Map([\n [\"Action\", \"onclick\"],\n [\"Mouse Up\", \"onmouseup\"],\n [\"Mouse Down\", \"onmousedown\"],\n ]);\n for (const name of Object.keys(data.actions)) {\n const jsName = map.get(name);\n if (!jsName) {\n continue;\n }\n link[jsName] = () => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: data.id,\n name,\n },\n });\n return false;\n };\n }\n\n if (!link.onclick) {\n link.onclick = () => false;\n }\n this.#setInternalLink();\n }\n\n _bindResetFormAction(link, resetForm) {\n const otherClickAction = link.onclick;\n if (!otherClickAction) {\n link.href = this.linkService.getAnchorUrl(\"\");\n }\n this.#setInternalLink();\n\n if (!this._fieldObjects) {\n warn(\n `_bindResetFormAction - \"resetForm\" action not supported, ` +\n \"ensure that the `fieldObjects` parameter is provided.\"\n );\n if (!otherClickAction) {\n link.onclick = () => false;\n }\n return;\n }\n\n link.onclick = () => {\n otherClickAction?.();\n\n const {\n fields: resetFormFields,\n refs: resetFormRefs,\n include,\n } = resetForm;\n\n const allFields = [];\n if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) {\n const fieldIds = new Set(resetFormRefs);\n for (const fieldName of resetFormFields) {\n const fields = this._fieldObjects[fieldName] || [];\n for (const { id } of fields) {\n fieldIds.add(id);\n }\n }\n for (const fields of Object.values(this._fieldObjects)) {\n for (const field of fields) {\n if (fieldIds.has(field.id) === include) {\n allFields.push(field);\n }\n }\n }\n } else {\n for (const fields of Object.values(this._fieldObjects)) {\n allFields.push(...fields);\n }\n }\n\n const storage = this.annotationStorage;\n const allIds = [];\n for (const field of allFields) {\n const { id } = field;\n allIds.push(id);\n switch (field.type) {\n case \"text\": {\n const value = field.defaultValue || \"\";\n storage.setValue(id, { value });\n break;\n }\n case \"checkbox\":\n case \"radiobutton\": {\n const value = field.defaultValue === field.exportValues;\n storage.setValue(id, { value });\n break;\n }\n case \"combobox\":\n case \"listbox\": {\n const value = field.defaultValue || \"\";\n storage.setValue(id, { value });\n break;\n }\n default:\n continue;\n }\n\n const domElement = document.querySelector(`[data-element-id=\"${id}\"]`);\n if (!domElement) {\n continue;\n } else if (!GetElementsByNameSet.has(domElement)) {\n warn(`_bindResetFormAction - element not allowed: ${id}`);\n continue;\n }\n domElement.dispatchEvent(new Event(\"resetform\"));\n }\n\n if (this.enableScripting) {\n // Update the values in the sandbox.\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: \"app\",\n ids: allIds,\n name: \"ResetForm\",\n },\n });\n }\n\n return false;\n };\n }\n}\n\nclass TextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true });\n }\n\n render() {\n this.container.classList.add(\"textAnnotation\");\n\n const image = document.createElement(\"img\");\n image.src =\n this.imageResourcesPath +\n \"annotation-\" +\n this.data.name.toLowerCase() +\n \".svg\";\n image.setAttribute(\"data-l10n-id\", \"pdfjs-text-annotation-type\");\n image.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({ type: this.data.name })\n );\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.append(image);\n return this.container;\n }\n}\n\nclass WidgetAnnotationElement extends AnnotationElement {\n render() {\n // Show only the container for unsupported field types.\n if (this.data.alternativeText) {\n this.container.title = this.data.alternativeText;\n }\n\n return this.container;\n }\n\n showElementAndHideCanvas(element) {\n if (this.data.hasOwnCanvas) {\n if (element.previousSibling?.nodeName === \"CANVAS\") {\n element.previousSibling.hidden = true;\n }\n element.hidden = false;\n }\n }\n\n _getKeyModifier(event) {\n return FeatureTest.platform.isMac ? event.metaKey : event.ctrlKey;\n }\n\n _setEventListener(element, elementData, baseName, eventName, valueGetter) {\n if (baseName.includes(\"mouse\")) {\n // Mouse events\n element.addEventListener(baseName, event => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: this.data.id,\n name: eventName,\n value: valueGetter(event),\n shift: event.shiftKey,\n modifier: this._getKeyModifier(event),\n },\n });\n });\n } else {\n // Non-mouse events\n element.addEventListener(baseName, event => {\n if (baseName === \"blur\") {\n if (!elementData.focused || !event.relatedTarget) {\n return;\n }\n elementData.focused = false;\n } else if (baseName === \"focus\") {\n if (elementData.focused) {\n return;\n }\n elementData.focused = true;\n }\n\n if (!valueGetter) {\n return;\n }\n\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: this.data.id,\n name: eventName,\n value: valueGetter(event),\n },\n });\n });\n }\n }\n\n _setEventListeners(element, elementData, names, getter) {\n for (const [baseName, eventName] of names) {\n if (eventName === \"Action\" || this.data.actions?.[eventName]) {\n if (eventName === \"Focus\" || eventName === \"Blur\") {\n elementData ||= { focused: false };\n }\n this._setEventListener(\n element,\n elementData,\n baseName,\n eventName,\n getter\n );\n if (eventName === \"Focus\" && !this.data.actions?.Blur) {\n // Ensure that elementData will have the correct value.\n this._setEventListener(element, elementData, \"blur\", \"Blur\", null);\n } else if (eventName === \"Blur\" && !this.data.actions?.Focus) {\n this._setEventListener(element, elementData, \"focus\", \"Focus\", null);\n }\n }\n }\n }\n\n _setBackgroundColor(element) {\n const color = this.data.backgroundColor || null;\n element.style.backgroundColor =\n color === null\n ? \"transparent\"\n : Util.makeHexColor(color[0], color[1], color[2]);\n }\n\n /**\n * Apply text styles to the text in the element.\n *\n * @private\n * @param {HTMLDivElement} element\n * @memberof TextWidgetAnnotationElement\n */\n _setTextStyle(element) {\n const TEXT_ALIGNMENT = [\"left\", \"center\", \"right\"];\n const { fontColor } = this.data.defaultAppearanceData;\n const fontSize =\n this.data.defaultAppearanceData.fontSize || DEFAULT_FONT_SIZE;\n\n const style = element.style;\n\n // TODO: If the font-size is zero, calculate it based on the height and\n // width of the element.\n // Not setting `style.fontSize` will use the default font-size for now.\n\n // We don't use the font, as specified in the PDF document, for the <input>\n // element. Hence using the original `fontSize` could look bad, which is why\n // it's instead based on the field height.\n // If the height is \"big\" then it could lead to a too big font size\n // so in this case use the one we've in the pdf (hence the min).\n let computedFontSize;\n const BORDER_SIZE = 2;\n const roundToOneDecimal = x => Math.round(10 * x) / 10;\n if (this.data.multiLine) {\n const height = Math.abs(\n this.data.rect[3] - this.data.rect[1] - BORDER_SIZE\n );\n const numberOfLines = Math.round(height / (LINE_FACTOR * fontSize)) || 1;\n const lineHeight = height / numberOfLines;\n computedFontSize = Math.min(\n fontSize,\n roundToOneDecimal(lineHeight / LINE_FACTOR)\n );\n } else {\n const height = Math.abs(\n this.data.rect[3] - this.data.rect[1] - BORDER_SIZE\n );\n computedFontSize = Math.min(\n fontSize,\n roundToOneDecimal(height / LINE_FACTOR)\n );\n }\n style.fontSize = `calc(${computedFontSize}px * var(--scale-factor))`;\n\n style.color = Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]);\n\n if (this.data.textAlignment !== null) {\n style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment];\n }\n }\n\n _setRequired(element, isRequired) {\n if (isRequired) {\n element.setAttribute(\"required\", true);\n } else {\n element.removeAttribute(\"required\");\n }\n element.setAttribute(\"aria-required\", isRequired);\n }\n}\n\nclass TextWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n const isRenderable =\n parameters.renderForms ||\n parameters.data.hasOwnCanvas ||\n (!parameters.data.hasAppearance && !!parameters.data.fieldValue);\n super(parameters, { isRenderable });\n }\n\n setPropertyOnSiblings(base, key, value, keyInStorage) {\n const storage = this.annotationStorage;\n for (const element of this._getElementsByName(\n base.name,\n /* skipId = */ base.id\n )) {\n if (element.domElement) {\n element.domElement[key] = value;\n }\n storage.setValue(element.id, { [keyInStorage]: value });\n }\n }\n\n render() {\n const storage = this.annotationStorage;\n const id = this.data.id;\n\n this.container.classList.add(\"textWidgetAnnotation\");\n\n let element = null;\n if (this.renderForms) {\n // NOTE: We cannot set the values using `element.value` below, since it\n // prevents the AnnotationLayer rasterizer in `test/driver.js`\n // from parsing the elements correctly for the reference tests.\n const storedData = storage.getValue(id, {\n value: this.data.fieldValue,\n });\n let textContent = storedData.value || \"\";\n const maxLen = storage.getValue(id, {\n charLimit: this.data.maxLen,\n }).charLimit;\n if (maxLen && textContent.length > maxLen) {\n textContent = textContent.slice(0, maxLen);\n }\n\n let fieldFormattedValues =\n storedData.formattedValue || this.data.textContent?.join(\"\\n\") || null;\n if (fieldFormattedValues && this.data.comb) {\n fieldFormattedValues = fieldFormattedValues.replaceAll(/\\s+/g, \"\");\n }\n\n const elementData = {\n userValue: textContent,\n formattedValue: fieldFormattedValues,\n lastCommittedValue: null,\n commitKey: 1,\n focused: false,\n };\n\n if (this.data.multiLine) {\n element = document.createElement(\"textarea\");\n element.textContent = fieldFormattedValues ?? textContent;\n if (this.data.doNotScroll) {\n element.style.overflowY = \"hidden\";\n }\n } else {\n element = document.createElement(\"input\");\n element.type = \"text\";\n element.setAttribute(\"value\", fieldFormattedValues ?? textContent);\n if (this.data.doNotScroll) {\n element.style.overflowX = \"hidden\";\n }\n }\n if (this.data.hasOwnCanvas) {\n element.hidden = true;\n }\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = this.data.readOnly;\n element.name = this.data.fieldName;\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n this._setRequired(element, this.data.required);\n\n if (maxLen) {\n element.maxLength = maxLen;\n }\n\n element.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n this.setPropertyOnSiblings(\n element,\n \"value\",\n event.target.value,\n \"value\"\n );\n elementData.formattedValue = null;\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = this.data.defaultFieldValue ?? \"\";\n element.value = elementData.userValue = defaultValue;\n elementData.formattedValue = null;\n });\n\n let blurListener = event => {\n const { formattedValue } = elementData;\n if (formattedValue !== null && formattedValue !== undefined) {\n event.target.value = formattedValue;\n }\n // Reset the cursor position to the start of the field (issue 12359).\n event.target.scrollLeft = 0;\n };\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"focus\", event => {\n if (elementData.focused) {\n return;\n }\n const { target } = event;\n if (elementData.userValue) {\n target.value = elementData.userValue;\n }\n elementData.lastCommittedValue = target.value;\n elementData.commitKey = 1;\n if (!this.data.actions?.Focus) {\n elementData.focused = true;\n }\n });\n\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n this.showElementAndHideCanvas(jsEvent.target);\n const actions = {\n value(event) {\n elementData.userValue = event.detail.value ?? \"\";\n storage.setValue(id, { value: elementData.userValue.toString() });\n event.target.value = elementData.userValue;\n },\n formattedValue(event) {\n const { formattedValue } = event.detail;\n elementData.formattedValue = formattedValue;\n if (\n formattedValue !== null &&\n formattedValue !== undefined &&\n event.target !== document.activeElement\n ) {\n // Input hasn't the focus so display formatted string\n event.target.value = formattedValue;\n }\n storage.setValue(id, {\n formattedValue,\n });\n },\n selRange(event) {\n event.target.setSelectionRange(...event.detail.selRange);\n },\n charLimit: event => {\n const { charLimit } = event.detail;\n const { target } = event;\n if (charLimit === 0) {\n target.removeAttribute(\"maxLength\");\n return;\n }\n\n target.setAttribute(\"maxLength\", charLimit);\n let value = elementData.userValue;\n if (!value || value.length <= charLimit) {\n return;\n }\n value = value.slice(0, charLimit);\n target.value = elementData.userValue = value;\n storage.setValue(id, { value });\n\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey: 1,\n selStart: target.selectionStart,\n selEnd: target.selectionEnd,\n },\n });\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n // Even if the field hasn't any actions\n // leaving it can still trigger some actions with Calculate\n element.addEventListener(\"keydown\", event => {\n elementData.commitKey = 1;\n // If the key is one of Escape, Enter then the data are committed.\n // If we've a Tab then data will be committed on blur.\n let commitKey = -1;\n if (event.key === \"Escape\") {\n commitKey = 0;\n } else if (event.key === \"Enter\" && !this.data.multiLine) {\n // When we've a multiline field, \"Enter\" key is a key as the other\n // hence we don't commit the data (Acrobat behaves the same way)\n // (see issue #15627).\n commitKey = 2;\n } else if (event.key === \"Tab\") {\n elementData.commitKey = 3;\n }\n if (commitKey === -1) {\n return;\n }\n const { value } = event.target;\n if (elementData.lastCommittedValue === value) {\n return;\n }\n elementData.lastCommittedValue = value;\n // Save the entered value\n elementData.userValue = value;\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd,\n },\n });\n });\n const _blurListener = blurListener;\n blurListener = null;\n element.addEventListener(\"blur\", event => {\n if (!elementData.focused || !event.relatedTarget) {\n return;\n }\n if (!this.data.actions?.Blur) {\n elementData.focused = false;\n }\n const { value } = event.target;\n elementData.userValue = value;\n if (elementData.lastCommittedValue !== value) {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey: elementData.commitKey,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd,\n },\n });\n }\n _blurListener(event);\n });\n\n if (this.data.actions?.Keystroke) {\n element.addEventListener(\"beforeinput\", event => {\n elementData.lastCommittedValue = null;\n const { data, target } = event;\n const { value, selectionStart, selectionEnd } = target;\n\n let selStart = selectionStart,\n selEnd = selectionEnd;\n\n switch (event.inputType) {\n // https://rawgit.com/w3c/input-events/v1/index.html#interface-InputEvent-Attributes\n case \"deleteWordBackward\": {\n const match = value\n .substring(0, selectionStart)\n .match(/\\w*[^\\w]*$/);\n if (match) {\n selStart -= match[0].length;\n }\n break;\n }\n case \"deleteWordForward\": {\n const match = value\n .substring(selectionStart)\n .match(/^[^\\w]*\\w*/);\n if (match) {\n selEnd += match[0].length;\n }\n break;\n }\n case \"deleteContentBackward\":\n if (selectionStart === selectionEnd) {\n selStart -= 1;\n }\n break;\n case \"deleteContentForward\":\n if (selectionStart === selectionEnd) {\n selEnd += 1;\n }\n break;\n }\n\n // We handle the event ourselves.\n event.preventDefault();\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n change: data || \"\",\n willCommit: false,\n selStart,\n selEnd,\n },\n });\n });\n }\n\n this._setEventListeners(\n element,\n elementData,\n [\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.value\n );\n }\n\n if (blurListener) {\n element.addEventListener(\"blur\", blurListener);\n }\n\n if (this.data.comb) {\n const fieldWidth = this.data.rect[2] - this.data.rect[0];\n const combWidth = fieldWidth / maxLen;\n\n element.classList.add(\"comb\");\n element.style.letterSpacing = `calc(${combWidth}px * var(--scale-factor) - 1ch)`;\n }\n } else {\n element = document.createElement(\"div\");\n element.textContent = this.data.fieldValue;\n element.style.verticalAlign = \"middle\";\n element.style.display = \"table-cell\";\n\n if (this.data.hasOwnCanvas) {\n element.hidden = true;\n }\n }\n\n this._setTextStyle(element);\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n}\n\nclass SignatureWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: !!parameters.data.hasOwnCanvas });\n }\n}\n\nclass CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n const storage = this.annotationStorage;\n const data = this.data;\n const id = data.id;\n let value = storage.getValue(id, {\n value: data.exportValue === data.fieldValue,\n }).value;\n if (typeof value === \"string\") {\n // The value has been changed through js and set in annotationStorage.\n value = value !== \"Off\";\n storage.setValue(id, { value });\n }\n\n this.container.classList.add(\"buttonWidgetAnnotation\", \"checkBox\");\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = data.readOnly;\n this._setRequired(element, this.data.required);\n element.type = \"checkbox\";\n element.name = data.fieldName;\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n element.setAttribute(\"exportValue\", data.exportValue);\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n element.addEventListener(\"change\", event => {\n const { name, checked } = event.target;\n for (const checkbox of this._getElementsByName(name, /* skipId = */ id)) {\n const curChecked = checked && checkbox.exportValue === data.exportValue;\n if (checkbox.domElement) {\n checkbox.domElement.checked = curChecked;\n }\n storage.setValue(checkbox.id, { value: curChecked });\n }\n storage.setValue(id, { value: checked });\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = data.defaultFieldValue || \"Off\";\n event.target.checked = defaultValue === data.exportValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n event.target.checked = event.detail.value !== \"Off\";\n storage.setValue(id, { value: event.target.checked });\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n this._setEventListeners(\n element,\n null,\n [\n [\"change\", \"Validate\"],\n [\"change\", \"Action\"],\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.checked\n );\n }\n\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n}\n\nclass RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n this.container.classList.add(\"buttonWidgetAnnotation\", \"radioButton\");\n const storage = this.annotationStorage;\n const data = this.data;\n const id = data.id;\n let value = storage.getValue(id, {\n value: data.fieldValue === data.buttonValue,\n }).value;\n if (typeof value === \"string\") {\n // The value has been changed through js and set in annotationStorage.\n value = value !== data.buttonValue;\n storage.setValue(id, { value });\n }\n\n if (value) {\n // It's possible that multiple radio buttons are checked.\n // So if this one is checked we just reset the other ones.\n // (see bug 1864136). Then when the other ones will be rendered they will\n // unchecked (because of their value in the storage).\n // Consequently, the first checked radio button will be the only checked\n // one.\n for (const radio of this._getElementsByName(\n data.fieldName,\n /* skipId = */ id\n )) {\n storage.setValue(radio.id, { value: false });\n }\n }\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = data.readOnly;\n this._setRequired(element, this.data.required);\n element.type = \"radio\";\n element.name = data.fieldName;\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n element.addEventListener(\"change\", event => {\n const { name, checked } = event.target;\n for (const radio of this._getElementsByName(name, /* skipId = */ id)) {\n storage.setValue(radio.id, { value: false });\n }\n storage.setValue(id, { value: checked });\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = data.defaultFieldValue;\n event.target.checked =\n defaultValue !== null &&\n defaultValue !== undefined &&\n defaultValue === data.buttonValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n const pdfButtonValue = data.buttonValue;\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value: event => {\n const checked = pdfButtonValue === event.detail.value;\n for (const radio of this._getElementsByName(event.target.name)) {\n const curChecked = checked && radio.id === id;\n if (radio.domElement) {\n radio.domElement.checked = curChecked;\n }\n storage.setValue(radio.id, { value: curChecked });\n }\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n this._setEventListeners(\n element,\n null,\n [\n [\"change\", \"Validate\"],\n [\"change\", \"Action\"],\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.checked\n );\n }\n\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n}\n\nclass PushButtonWidgetAnnotationElement extends LinkAnnotationElement {\n constructor(parameters) {\n super(parameters, { ignoreBorder: parameters.data.hasAppearance });\n }\n\n render() {\n // The rendering and functionality of a push button widget annotation is\n // equal to that of a link annotation, but may have more functionality, such\n // as performing actions on form fields (resetting, submitting, et cetera).\n const container = super.render();\n container.classList.add(\"buttonWidgetAnnotation\", \"pushButton\");\n\n if (this.data.alternativeText) {\n container.title = this.data.alternativeText;\n }\n\n const linkElement = container.lastChild;\n if (this.enableScripting && this.hasJSActions && linkElement) {\n this._setDefaultPropertiesFromJS(linkElement);\n\n linkElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n this._dispatchEventFromSandbox({}, jsEvent);\n });\n }\n\n return container;\n }\n}\n\nclass ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n this.container.classList.add(\"choiceWidgetAnnotation\");\n const storage = this.annotationStorage;\n const id = this.data.id;\n\n const storedData = storage.getValue(id, {\n value: this.data.fieldValue,\n });\n\n const selectElement = document.createElement(\"select\");\n GetElementsByNameSet.add(selectElement);\n selectElement.setAttribute(\"data-element-id\", id);\n\n selectElement.disabled = this.data.readOnly;\n this._setRequired(selectElement, this.data.required);\n selectElement.name = this.data.fieldName;\n selectElement.tabIndex = DEFAULT_TAB_INDEX;\n\n let addAnEmptyEntry = this.data.combo && this.data.options.length > 0;\n\n if (!this.data.combo) {\n // List boxes have a size and (optionally) multiple selection.\n selectElement.size = this.data.options.length;\n if (this.data.multiSelect) {\n selectElement.multiple = true;\n }\n }\n\n selectElement.addEventListener(\"resetform\", event => {\n const defaultValue = this.data.defaultFieldValue;\n for (const option of selectElement.options) {\n option.selected = option.value === defaultValue;\n }\n });\n\n // Insert the options into the choice field.\n for (const option of this.data.options) {\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = option.displayValue;\n optionElement.value = option.exportValue;\n if (storedData.value.includes(option.exportValue)) {\n optionElement.setAttribute(\"selected\", true);\n addAnEmptyEntry = false;\n }\n selectElement.append(optionElement);\n }\n\n let removeEmptyEntry = null;\n if (addAnEmptyEntry) {\n const noneOptionElement = document.createElement(\"option\");\n noneOptionElement.value = \" \";\n noneOptionElement.setAttribute(\"hidden\", true);\n noneOptionElement.setAttribute(\"selected\", true);\n selectElement.prepend(noneOptionElement);\n\n removeEmptyEntry = () => {\n noneOptionElement.remove();\n selectElement.removeEventListener(\"input\", removeEmptyEntry);\n removeEmptyEntry = null;\n };\n selectElement.addEventListener(\"input\", removeEmptyEntry);\n }\n\n const getValue = isExport => {\n const name = isExport ? \"value\" : \"textContent\";\n const { options, multiple } = selectElement;\n if (!multiple) {\n return options.selectedIndex === -1\n ? null\n : options[options.selectedIndex][name];\n }\n return Array.prototype.filter\n .call(options, option => option.selected)\n .map(option => option[name]);\n };\n\n let selectedValues = getValue(/* isExport */ false);\n\n const getItems = event => {\n const options = event.target.options;\n return Array.prototype.map.call(options, option => {\n return { displayValue: option.textContent, exportValue: option.value };\n });\n };\n\n if (this.enableScripting && this.hasJSActions) {\n selectElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n removeEmptyEntry?.();\n const value = event.detail.value;\n const values = new Set(Array.isArray(value) ? value : [value]);\n for (const option of selectElement.options) {\n option.selected = values.has(option.value);\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n multipleSelection(event) {\n selectElement.multiple = true;\n },\n remove(event) {\n const options = selectElement.options;\n const index = event.detail.remove;\n options[index].selected = false;\n selectElement.remove(index);\n if (options.length > 0) {\n const i = Array.prototype.findIndex.call(\n options,\n option => option.selected\n );\n if (i === -1) {\n options[0].selected = true;\n }\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n clear(event) {\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n storage.setValue(id, { value: null, items: [] });\n selectedValues = getValue(/* isExport */ false);\n },\n insert(event) {\n const { index, displayValue, exportValue } = event.detail.insert;\n const selectChild = selectElement.children[index];\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n\n if (selectChild) {\n selectChild.before(optionElement);\n } else {\n selectElement.append(optionElement);\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n items(event) {\n const { items } = event.detail;\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n for (const item of items) {\n const { displayValue, exportValue } = item;\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n selectElement.append(optionElement);\n }\n if (selectElement.options.length > 0) {\n selectElement.options[0].selected = true;\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n indices(event) {\n const indices = new Set(event.detail.indices);\n for (const option of event.target.options) {\n option.selected = indices.has(option.index);\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n editable(event) {\n event.target.disabled = !event.detail.editable;\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n selectElement.addEventListener(\"input\", event => {\n const exportValue = getValue(/* isExport */ true);\n storage.setValue(id, { value: exportValue });\n\n event.preventDefault();\n\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value: selectedValues,\n changeEx: exportValue,\n willCommit: false,\n commitKey: 1,\n keyDown: false,\n },\n });\n });\n\n this._setEventListeners(\n selectElement,\n null,\n [\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n [\"input\", \"Action\"],\n [\"input\", \"Validate\"],\n ],\n event => event.target.value\n );\n } else {\n selectElement.addEventListener(\"input\", function (event) {\n storage.setValue(id, { value: getValue(/* isExport */ true) });\n });\n }\n\n if (this.data.combo) {\n this._setTextStyle(selectElement);\n } else {\n // Just use the default font size...\n // it's a bit hard to guess what is a good size.\n }\n this._setBackgroundColor(selectElement);\n this._setDefaultPropertiesFromJS(selectElement);\n\n this.container.append(selectElement);\n return this.container;\n }\n}\n\nclass PopupAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const { data, elements } = parameters;\n super(parameters, { isRenderable: AnnotationElement._hasPopupData(data) });\n this.elements = elements;\n }\n\n render() {\n this.container.classList.add(\"popupAnnotation\");\n\n const popup = new PopupElement({\n container: this.container,\n color: this.data.color,\n titleObj: this.data.titleObj,\n modificationDate: this.data.modificationDate,\n contentsObj: this.data.contentsObj,\n richText: this.data.richText,\n rect: this.data.rect,\n parentRect: this.data.parentRect || null,\n parent: this.parent,\n elements: this.elements,\n open: this.data.open,\n });\n\n const elementIds = [];\n for (const element of this.elements) {\n element.popup = popup;\n elementIds.push(element.data.id);\n element.addHighlightArea();\n }\n\n this.container.setAttribute(\n \"aria-controls\",\n elementIds.map(id => `${AnnotationPrefix}${id}`).join(\",\")\n );\n\n return this.container;\n }\n}\n\nclass PopupElement {\n #boundKeyDown = this.#keyDown.bind(this);\n\n #boundHide = this.#hide.bind(this);\n\n #boundShow = this.#show.bind(this);\n\n #boundToggle = this.#toggle.bind(this);\n\n #color = null;\n\n #container = null;\n\n #contentsObj = null;\n\n #dateObj = null;\n\n #elements = null;\n\n #parent = null;\n\n #parentRect = null;\n\n #pinned = false;\n\n #popup = null;\n\n #rect = null;\n\n #richText = null;\n\n #titleObj = null;\n\n #wasVisible = false;\n\n constructor({\n container,\n color,\n elements,\n titleObj,\n modificationDate,\n contentsObj,\n richText,\n parent,\n rect,\n parentRect,\n open,\n }) {\n this.#container = container;\n this.#titleObj = titleObj;\n this.#contentsObj = contentsObj;\n this.#richText = richText;\n this.#parent = parent;\n this.#color = color;\n this.#rect = rect;\n this.#parentRect = parentRect;\n this.#elements = elements;\n\n // The modification date is shown in the popup instead of the creation\n // date if it is available and can be parsed correctly, which is\n // consistent with other viewers such as Adobe Acrobat.\n this.#dateObj = PDFDateString.toDateObject(modificationDate);\n\n this.trigger = elements.flatMap(e => e.getElementsToTriggerPopup());\n // Attach the event listeners to the trigger element.\n for (const element of this.trigger) {\n element.addEventListener(\"click\", this.#boundToggle);\n element.addEventListener(\"mouseenter\", this.#boundShow);\n element.addEventListener(\"mouseleave\", this.#boundHide);\n element.classList.add(\"popupTriggerArea\");\n }\n\n // Attach the event listener to toggle the popup with the keyboard.\n for (const element of elements) {\n element.container?.addEventListener(\"keydown\", this.#boundKeyDown);\n }\n\n this.#container.hidden = true;\n if (open) {\n this.#toggle();\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n // Since the popup is lazily created, we need to ensure that it'll be\n // created and displayed during reference tests.\n this.#parent.popupShow.push(async () => {\n if (this.#container.hidden) {\n this.#show();\n }\n });\n }\n }\n\n render() {\n if (this.#popup) {\n return;\n }\n\n const {\n page: { view },\n viewport: {\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n },\n } = this.#parent;\n const popup = (this.#popup = document.createElement(\"div\"));\n popup.className = \"popup\";\n\n if (this.#color) {\n const baseColor = (popup.style.outlineColor = Util.makeHexColor(\n ...this.#color\n ));\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n CSS.supports(\"background-color\", \"color-mix(in srgb, red 30%, white)\")\n ) {\n popup.style.backgroundColor = `color-mix(in srgb, ${baseColor} 30%, white)`;\n } else {\n // color-mix isn't supported in some browsers hence this version.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color-mix#browser_compatibility\n // TODO: Use color-mix when it's supported everywhere.\n // Enlighten the color.\n const BACKGROUND_ENLIGHT = 0.7;\n popup.style.backgroundColor = Util.makeHexColor(\n ...this.#color.map(c =>\n Math.floor(BACKGROUND_ENLIGHT * (255 - c) + c)\n )\n );\n }\n }\n\n const header = document.createElement(\"span\");\n header.className = \"header\";\n const title = document.createElement(\"h1\");\n header.append(title);\n ({ dir: title.dir, str: title.textContent } = this.#titleObj);\n popup.append(header);\n\n if (this.#dateObj) {\n const modificationDate = document.createElement(\"span\");\n modificationDate.classList.add(\"popupDate\");\n modificationDate.setAttribute(\n \"data-l10n-id\",\n \"pdfjs-annotation-date-string\"\n );\n modificationDate.setAttribute(\n \"data-l10n-args\",\n JSON.stringify({\n date: this.#dateObj.toLocaleDateString(),\n time: this.#dateObj.toLocaleTimeString(),\n })\n );\n header.append(modificationDate);\n }\n\n const contentsObj = this.#contentsObj;\n const richText = this.#richText;\n if (\n richText?.str &&\n (!contentsObj?.str || contentsObj.str === richText.str)\n ) {\n XfaLayer.render({\n xfaHtml: richText.html,\n intent: \"richText\",\n div: popup,\n });\n popup.lastChild.classList.add(\"richText\", \"popupContent\");\n } else {\n const contents = this._formatContents(contentsObj);\n popup.append(contents);\n }\n\n let useParentRect = !!this.#parentRect;\n let rect = useParentRect ? this.#parentRect : this.#rect;\n for (const element of this.#elements) {\n if (!rect || Util.intersect(element.data.rect, rect) !== null) {\n rect = element.data.rect;\n useParentRect = true;\n break;\n }\n }\n\n const normalizedRect = Util.normalizeRect([\n rect[0],\n view[3] - rect[1] + view[1],\n rect[2],\n view[3] - rect[3] + view[1],\n ]);\n\n const HORIZONTAL_SPACE_AFTER_ANNOTATION = 5;\n const parentWidth = useParentRect\n ? rect[2] - rect[0] + HORIZONTAL_SPACE_AFTER_ANNOTATION\n : 0;\n const popupLeft = normalizedRect[0] + parentWidth;\n const popupTop = normalizedRect[1];\n\n const { style } = this.#container;\n style.left = `${(100 * (popupLeft - pageX)) / pageWidth}%`;\n style.top = `${(100 * (popupTop - pageY)) / pageHeight}%`;\n\n this.#container.append(popup);\n }\n\n /**\n * Format the contents of the popup by adding newlines where necessary.\n *\n * @private\n * @param {Object<string, string>} contentsObj\n * @memberof PopupElement\n * @returns {HTMLParagraphElement}\n */\n _formatContents({ str, dir }) {\n const p = document.createElement(\"p\");\n p.classList.add(\"popupContent\");\n p.dir = dir;\n const lines = str.split(/(?:\\r\\n?|\\n)/);\n for (let i = 0, ii = lines.length; i < ii; ++i) {\n const line = lines[i];\n p.append(document.createTextNode(line));\n if (i < ii - 1) {\n p.append(document.createElement(\"br\"));\n }\n }\n return p;\n }\n\n #keyDown(event) {\n if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) {\n return;\n }\n\n if (event.key === \"Enter\" || (event.key === \"Escape\" && this.#pinned)) {\n this.#toggle();\n }\n }\n\n /**\n * Toggle the visibility of the popup.\n */\n #toggle() {\n this.#pinned = !this.#pinned;\n if (this.#pinned) {\n this.#show();\n this.#container.addEventListener(\"click\", this.#boundToggle);\n this.#container.addEventListener(\"keydown\", this.#boundKeyDown);\n } else {\n this.#hide();\n this.#container.removeEventListener(\"click\", this.#boundToggle);\n this.#container.removeEventListener(\"keydown\", this.#boundKeyDown);\n }\n }\n\n /**\n * Show the popup.\n */\n #show() {\n if (!this.#popup) {\n this.render();\n }\n if (!this.isVisible) {\n this.#container.hidden = false;\n this.#container.style.zIndex =\n parseInt(this.#container.style.zIndex) + 1000;\n } else if (this.#pinned) {\n this.#container.classList.add(\"focused\");\n }\n }\n\n /**\n * Hide the popup.\n */\n #hide() {\n this.#container.classList.remove(\"focused\");\n if (this.#pinned || !this.isVisible) {\n return;\n }\n this.#container.hidden = true;\n this.#container.style.zIndex =\n parseInt(this.#container.style.zIndex) - 1000;\n }\n\n forceHide() {\n this.#wasVisible = this.isVisible;\n if (!this.#wasVisible) {\n return;\n }\n this.#container.hidden = true;\n }\n\n maybeShow() {\n if (!this.#wasVisible) {\n return;\n }\n this.#wasVisible = false;\n this.#container.hidden = false;\n }\n\n get isVisible() {\n return this.#container.hidden === false;\n }\n}\n\nclass FreeTextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n this.textContent = parameters.data.textContent;\n this.textPosition = parameters.data.textPosition;\n this.annotationEditorType = AnnotationEditorType.FREETEXT;\n }\n\n render() {\n this.container.classList.add(\"freeTextAnnotation\");\n\n if (this.textContent) {\n const content = document.createElement(\"div\");\n content.classList.add(\"annotationTextContent\");\n content.setAttribute(\"role\", \"comment\");\n for (const line of this.textContent) {\n const lineSpan = document.createElement(\"span\");\n lineSpan.textContent = line;\n content.append(lineSpan);\n }\n this.container.append(content);\n }\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this._editOnDoubleClick();\n\n return this.container;\n }\n\n get _isEditable() {\n return this.data.hasOwnCanvas;\n }\n}\n\nclass LineAnnotationElement extends AnnotationElement {\n #line = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"lineAnnotation\");\n\n // Create an invisible line with the same starting and ending coordinates\n // that acts as the trigger for the popup. Only the line itself should\n // trigger the popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n // PDF coordinates are calculated from a bottom left origin, so transform\n // the line coordinates to a top left origin for the SVG element.\n const line = (this.#line = this.svgFactory.createElement(\"svg:line\"));\n line.setAttribute(\"x1\", data.rect[2] - data.lineCoordinates[0]);\n line.setAttribute(\"y1\", data.rect[3] - data.lineCoordinates[1]);\n line.setAttribute(\"x2\", data.rect[2] - data.lineCoordinates[2]);\n line.setAttribute(\"y2\", data.rect[3] - data.lineCoordinates[3]);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n line.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n line.setAttribute(\"stroke\", \"transparent\");\n line.setAttribute(\"fill\", \"transparent\");\n\n svg.append(line);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the line instead\n // of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#line;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass SquareAnnotationElement extends AnnotationElement {\n #square = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"squareAnnotation\");\n\n // Create an invisible square with the same rectangle that acts as the\n // trigger for the popup. Only the square itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n // The browser draws half of the borders inside the square and half of\n // the borders outside the square by default. This behavior cannot be\n // changed programmatically, so correct for that here.\n const borderWidth = data.borderStyle.width;\n const square = (this.#square = this.svgFactory.createElement(\"svg:rect\"));\n square.setAttribute(\"x\", borderWidth / 2);\n square.setAttribute(\"y\", borderWidth / 2);\n square.setAttribute(\"width\", width - borderWidth);\n square.setAttribute(\"height\", height - borderWidth);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n square.setAttribute(\"stroke-width\", borderWidth || 1);\n square.setAttribute(\"stroke\", \"transparent\");\n square.setAttribute(\"fill\", \"transparent\");\n\n svg.append(square);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the square instead\n // of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#square;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass CircleAnnotationElement extends AnnotationElement {\n #circle = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"circleAnnotation\");\n\n // Create an invisible circle with the same ellipse that acts as the\n // trigger for the popup. Only the circle itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n // The browser draws half of the borders inside the circle and half of\n // the borders outside the circle by default. This behavior cannot be\n // changed programmatically, so correct for that here.\n const borderWidth = data.borderStyle.width;\n const circle = (this.#circle =\n this.svgFactory.createElement(\"svg:ellipse\"));\n circle.setAttribute(\"cx\", width / 2);\n circle.setAttribute(\"cy\", height / 2);\n circle.setAttribute(\"rx\", width / 2 - borderWidth / 2);\n circle.setAttribute(\"ry\", height / 2 - borderWidth / 2);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n circle.setAttribute(\"stroke-width\", borderWidth || 1);\n circle.setAttribute(\"stroke\", \"transparent\");\n circle.setAttribute(\"fill\", \"transparent\");\n\n svg.append(circle);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the circle instead\n // of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#circle;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass PolylineAnnotationElement extends AnnotationElement {\n #polyline = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n\n this.containerClassName = \"polylineAnnotation\";\n this.svgElementName = \"svg:polyline\";\n }\n\n render() {\n this.container.classList.add(this.containerClassName);\n\n // Create an invisible polyline with the same points that acts as the\n // trigger for the popup. Only the polyline itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n // Convert the vertices array to a single points string that the SVG\n // polyline element expects (\"x1,y1 x2,y2 ...\"). PDF coordinates are\n // calculated from a bottom left origin, so transform the polyline\n // coordinates to a top left origin for the SVG element.\n let points = [];\n for (const coordinate of data.vertices) {\n const x = coordinate.x - data.rect[0];\n const y = data.rect[3] - coordinate.y;\n points.push(x + \",\" + y);\n }\n points = points.join(\" \");\n\n const polyline = (this.#polyline = this.svgFactory.createElement(\n this.svgElementName\n ));\n polyline.setAttribute(\"points\", points);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n svg.append(polyline);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the polyline\n // instead of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#polyline;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass PolygonAnnotationElement extends PolylineAnnotationElement {\n constructor(parameters) {\n // Polygons are specific forms of polylines, so reuse their logic.\n super(parameters);\n\n this.containerClassName = \"polygonAnnotation\";\n this.svgElementName = \"svg:polygon\";\n }\n}\n\nclass CaretAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"caretAnnotation\");\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n return this.container;\n }\n}\n\nclass InkAnnotationElement extends AnnotationElement {\n #polylines = [];\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n\n this.containerClassName = \"inkAnnotation\";\n\n // Use the polyline SVG element since it allows us to use coordinates\n // directly and to draw both straight lines and curves.\n this.svgElementName = \"svg:polyline\";\n this.annotationEditorType = AnnotationEditorType.INK;\n }\n\n render() {\n this.container.classList.add(this.containerClassName);\n\n // Create an invisible polyline with the same points that acts as the\n // trigger for the popup.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n for (const inkList of data.inkLists) {\n // Convert the ink list to a single points string that the SVG\n // polyline element expects (\"x1,y1 x2,y2 ...\"). PDF coordinates are\n // calculated from a bottom left origin, so transform the polyline\n // coordinates to a top left origin for the SVG element.\n let points = [];\n for (const coordinate of inkList) {\n const x = coordinate.x - data.rect[0];\n const y = data.rect[3] - coordinate.y;\n points.push(`${x},${y}`);\n }\n points = points.join(\" \");\n\n const polyline = this.svgFactory.createElement(this.svgElementName);\n this.#polylines.push(polyline);\n polyline.setAttribute(\"points\", points);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n // Create the popup ourselves so that we can bind it to the polyline\n // instead of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n svg.append(polyline);\n }\n\n this.container.append(svg);\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#polylines;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass HighlightAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"highlightAnnotation\");\n return this.container;\n }\n}\n\nclass UnderlineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"underlineAnnotation\");\n return this.container;\n }\n}\n\nclass SquigglyAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"squigglyAnnotation\");\n return this.container;\n }\n}\n\nclass StrikeOutAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"strikeoutAnnotation\");\n return this.container;\n }\n}\n\nclass StampAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"stampAnnotation\");\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n return this.container;\n }\n}\n\nclass FileAttachmentAnnotationElement extends AnnotationElement {\n #trigger = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true });\n\n const { filename, content } = this.data.file;\n this.filename = getFilenameFromUrl(filename, /* onlyStripPath = */ true);\n this.content = content;\n\n this.linkService.eventBus?.dispatch(\"fileattachmentannotation\", {\n source: this,\n filename,\n content,\n });\n }\n\n render() {\n this.container.classList.add(\"fileAttachmentAnnotation\");\n\n const { container, data } = this;\n let trigger;\n if (data.hasAppearance || data.fillAlpha === 0) {\n trigger = document.createElement(\"div\");\n } else {\n // Unfortunately it seems that it's not clearly specified exactly what\n // names are actually valid, since Table 184 contains:\n // Conforming readers shall provide predefined icon appearances for at\n // least the following standard names: GraphPushPin, PaperclipTag.\n // Additional names may be supported as well. Default value: PushPin.\n trigger = document.createElement(\"img\");\n trigger.src = `${this.imageResourcesPath}annotation-${\n /paperclip/i.test(data.name) ? \"paperclip\" : \"pushpin\"\n }.svg`;\n\n if (data.fillAlpha && data.fillAlpha < 1) {\n trigger.style = `filter: opacity(${Math.round(\n data.fillAlpha * 100\n )}%);`;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.container.classList.add(\"hasFillAlpha\");\n }\n }\n }\n trigger.addEventListener(\"dblclick\", this.#download.bind(this));\n this.#trigger = trigger;\n\n const { isMac } = FeatureTest.platform;\n container.addEventListener(\"keydown\", evt => {\n if (evt.key === \"Enter\" && (isMac ? evt.metaKey : evt.ctrlKey)) {\n this.#download();\n }\n });\n\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n } else {\n trigger.classList.add(\"popupTriggerArea\");\n }\n\n container.append(trigger);\n return container;\n }\n\n getElementsToTriggerPopup() {\n return this.#trigger;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n\n /**\n * Download the file attachment associated with this annotation.\n */\n #download() {\n this.downloadManager?.openOrDownloadData(this.content, this.filename);\n }\n}\n\n/**\n * @typedef {Object} AnnotationLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {Array} annotations\n * @property {PDFPageProxy} page\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\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 {boolean} [enableScripting] - Enable embedded script execution.\n * @property {boolean} [hasJSActions] - Some fields have JS actions.\n * The default value is `false`.\n * @property {Object<string, Array<Object>> | null} [fieldObjects]\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]\n * @property {TextAccessibilityManager} [accessibilityManager]\n */\n\n/**\n * Manage the layer containing all the annotations.\n */\nclass AnnotationLayer {\n #accessibilityManager = null;\n\n #annotationCanvasMap = null;\n\n #editableAnnotations = new Map();\n\n constructor({\n div,\n accessibilityManager,\n annotationCanvasMap,\n page,\n viewport,\n }) {\n this.div = div;\n this.#accessibilityManager = accessibilityManager;\n this.#annotationCanvasMap = annotationCanvasMap;\n this.page = page;\n this.viewport = viewport;\n this.zIndex = 0;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"showPopups\", {\n value: async () => {\n for (const show of this.popupShow) {\n await show();\n }\n },\n });\n this.popupShow = [];\n }\n }\n\n #appendElement(element, id) {\n const contentElement = element.firstChild || element;\n contentElement.id = `${AnnotationPrefix}${id}`;\n\n this.div.append(element);\n this.#accessibilityManager?.moveElementInDOM(\n this.div,\n element,\n contentElement,\n /* isRemovable = */ false\n );\n }\n\n /**\n * Render a new annotation layer with all annotation elements.\n *\n * @param {AnnotationLayerParameters} params\n * @memberof AnnotationLayer\n */\n async render(params) {\n const { annotations } = params;\n const layer = this.div;\n setLayerDimensions(layer, this.viewport);\n\n const popupToElements = new Map();\n const elementParams = {\n data: null,\n layer,\n linkService: params.linkService,\n downloadManager: params.downloadManager,\n imageResourcesPath: params.imageResourcesPath || \"\",\n renderForms: params.renderForms !== false,\n svgFactory: new DOMSVGFactory(),\n annotationStorage: params.annotationStorage || new AnnotationStorage(),\n enableScripting: params.enableScripting === true,\n hasJSActions: params.hasJSActions,\n fieldObjects: params.fieldObjects,\n parent: this,\n elements: null,\n };\n\n for (const data of annotations) {\n if (data.noHTML) {\n continue;\n }\n const isPopupAnnotation = data.annotationType === AnnotationType.POPUP;\n if (!isPopupAnnotation) {\n const { width, height } = getRectDims(data.rect);\n if (width <= 0 || height <= 0) {\n continue; // Ignore empty annotations.\n }\n } else {\n const elements = popupToElements.get(data.id);\n if (!elements) {\n // Ignore popup annotations without a corresponding annotation.\n continue;\n }\n elementParams.elements = elements;\n }\n elementParams.data = data;\n const element = AnnotationElementFactory.create(elementParams);\n\n if (!element.isRenderable) {\n continue;\n }\n\n if (!isPopupAnnotation && data.popupRef) {\n const elements = popupToElements.get(data.popupRef);\n if (!elements) {\n popupToElements.set(data.popupRef, [element]);\n } else {\n elements.push(element);\n }\n }\n\n if (element.annotationEditorType > 0) {\n this.#editableAnnotations.set(element.data.id, element);\n }\n\n const rendered = element.render();\n if (data.hidden) {\n rendered.style.visibility = \"hidden\";\n }\n this.#appendElement(rendered, data.id);\n }\n\n this.#setAnnotationCanvasMap();\n }\n\n /**\n * Update the annotation elements on existing annotation layer.\n *\n * @param {AnnotationLayerParameters} viewport\n * @memberof AnnotationLayer\n */\n update({ viewport }) {\n const layer = this.div;\n this.viewport = viewport;\n setLayerDimensions(layer, { rotation: viewport.rotation });\n\n this.#setAnnotationCanvasMap();\n layer.hidden = false;\n }\n\n #setAnnotationCanvasMap() {\n if (!this.#annotationCanvasMap) {\n return;\n }\n const layer = this.div;\n for (const [id, canvas] of this.#annotationCanvasMap) {\n const element = layer.querySelector(`[data-annotation-id=\"${id}\"]`);\n if (!element) {\n continue;\n }\n\n const { firstChild } = element;\n if (!firstChild) {\n element.append(canvas);\n } else if (firstChild.nodeName === \"CANVAS\") {\n firstChild.replaceWith(canvas);\n } else {\n firstChild.before(canvas);\n }\n }\n this.#annotationCanvasMap.clear();\n }\n\n getEditableAnnotations() {\n return Array.from(this.#editableAnnotations.values());\n }\n\n getEditableAnnotation(id) {\n return this.#editableAnnotations.get(id);\n }\n}\n\nexport {\n AnnotationLayer,\n FreeTextAnnotationElement,\n InkAnnotationElement,\n StampAnnotationElement,\n};\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap, unreachable } from \"../shared/util.js\";\nimport { AnnotationEditor } from \"./editor/editor.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst SerializableEmpty = Object.freeze({\n map: null,\n hash: \"\",\n transfer: undefined,\n});\n\n/**\n * Key/value storage for annotation data in forms.\n */\nclass AnnotationStorage {\n #modified = false;\n\n #storage = new Map();\n\n constructor() {\n // Callbacks to signal when the modification state is set or reset.\n // This is used by the viewer to only bind on `beforeunload` if forms\n // are actually edited to prevent doing so unconditionally since that\n // can have undesirable effects.\n this.onSetModified = null;\n this.onResetModified = null;\n this.onAnnotationEditor = null;\n }\n\n /**\n * Get the value for a given key if it exists, or return the default value.\n * @param {string} key\n * @param {Object} defaultValue\n * @returns {Object}\n */\n getValue(key, defaultValue) {\n const value = this.#storage.get(key);\n if (value === undefined) {\n return defaultValue;\n }\n\n return Object.assign(defaultValue, value);\n }\n\n /**\n * Get the value for a given key.\n * @param {string} key\n * @returns {Object}\n */\n getRawValue(key) {\n return this.#storage.get(key);\n }\n\n /**\n * Remove a value from the storage.\n * @param {string} key\n */\n remove(key) {\n this.#storage.delete(key);\n\n if (this.#storage.size === 0) {\n this.resetModified();\n }\n\n if (typeof this.onAnnotationEditor === \"function\") {\n for (const value of this.#storage.values()) {\n if (value instanceof AnnotationEditor) {\n return;\n }\n }\n this.onAnnotationEditor(null);\n }\n }\n\n /**\n * Set the value for a given key\n * @param {string} key\n * @param {Object} value\n */\n setValue(key, value) {\n const obj = this.#storage.get(key);\n let modified = false;\n if (obj !== undefined) {\n for (const [entry, val] of Object.entries(value)) {\n if (obj[entry] !== val) {\n modified = true;\n obj[entry] = val;\n }\n }\n } else {\n modified = true;\n this.#storage.set(key, value);\n }\n if (modified) {\n this.#setModified();\n }\n\n if (\n value instanceof AnnotationEditor &&\n typeof this.onAnnotationEditor === \"function\"\n ) {\n this.onAnnotationEditor(value.constructor._type);\n }\n }\n\n /**\n * Check if the storage contains the given key.\n * @param {string} key\n * @returns {boolean}\n */\n has(key) {\n return this.#storage.has(key);\n }\n\n /**\n * @returns {Object | null}\n */\n getAll() {\n return this.#storage.size > 0 ? objectFromMap(this.#storage) : null;\n }\n\n /**\n * @param {Object} obj\n */\n setAll(obj) {\n for (const [key, val] of Object.entries(obj)) {\n this.setValue(key, val);\n }\n }\n\n get size() {\n return this.#storage.size;\n }\n\n #setModified() {\n if (!this.#modified) {\n this.#modified = true;\n if (typeof this.onSetModified === \"function\") {\n this.onSetModified();\n }\n }\n }\n\n resetModified() {\n if (this.#modified) {\n this.#modified = false;\n if (typeof this.onResetModified === \"function\") {\n this.onResetModified();\n }\n }\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n get print() {\n return new PrintAnnotationStorage(this);\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n if (this.#storage.size === 0) {\n return SerializableEmpty;\n }\n const map = new Map(),\n hash = new MurmurHash3_64(),\n transfer = [];\n const context = Object.create(null);\n let hasBitmap = false;\n\n for (const [key, val] of this.#storage) {\n const serialized =\n val instanceof AnnotationEditor\n ? val.serialize(/* isForCopying = */ false, context)\n : val;\n if (serialized) {\n map.set(key, serialized);\n\n hash.update(`${key}:${JSON.stringify(serialized)}`);\n hasBitmap ||= !!serialized.bitmap;\n }\n }\n\n if (hasBitmap) {\n // We must transfer the bitmap data separately, since it can be changed\n // during serialization with SVG images.\n for (const value of map.values()) {\n if (value.bitmap) {\n transfer.push(value.bitmap);\n }\n }\n }\n\n return map.size > 0\n ? { map, hash: hash.hexdigest(), transfer }\n : SerializableEmpty;\n }\n}\n\n/**\n * A special `AnnotationStorage` for use during printing, where the serializable\n * data is *frozen* upon initialization, to prevent scripting from modifying its\n * contents. (Necessary since printing is triggered synchronously in browsers.)\n */\nclass PrintAnnotationStorage extends AnnotationStorage {\n #serializable;\n\n constructor(parent) {\n super();\n const { map, hash, transfer } = parent.serializable;\n // Create a *copy* of the data, since Objects are passed by reference in JS.\n const clone = structuredClone(map, transfer ? { transfer } : null);\n\n this.#serializable = { map: clone, hash, transfer };\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n // eslint-disable-next-line getter-return\n get print() {\n unreachable(\"Should not call PrintAnnotationStorage.print\");\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n return this.#serializable;\n }\n}\n\nexport { AnnotationStorage, PrintAnnotationStorage, SerializableEmpty };\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/**\n * @module pdfjsLib\n */\n\nimport {\n AbortException,\n AnnotationMode,\n assert,\n getVerbosityLevel,\n info,\n InvalidPDFException,\n isArrayBuffer,\n isNodeJS,\n MAX_IMAGE_SIZE_TO_CACHE,\n MissingPDFException,\n PasswordException,\n PromiseCapability,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n stringToBytes,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport {\n AnnotationStorage,\n PrintAnnotationStorage,\n SerializableEmpty,\n} from \"./annotation_storage.js\";\nimport {\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMFilterFactory,\n DOMStandardFontDataFactory,\n isDataScheme,\n isValidFetchUrl,\n PageViewport,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodeStandardFontDataFactory,\n} from \"display-node_utils\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { MessageHandler } from \"../shared/message_handler.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { PDFFetchStream } from \"display-fetch_stream\";\nimport { PDFNetworkStream } from \"display-network\";\nimport { PDFNodeStream } from \"display-node_stream\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\nconst DELAYED_CLEANUP_TIMEOUT = 5000; // ms\n\nconst DefaultCanvasFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCanvasFactory\n : DOMCanvasFactory;\nconst DefaultCMapReaderFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCMapReaderFactory\n : DOMCMapReaderFactory;\nconst DefaultFilterFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeFilterFactory\n : DOMFilterFactory;\nconst DefaultStandardFontDataFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeStandardFontDataFactory\n : DOMStandardFontDataFactory;\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n * Int16Array | Uint16Array |\n * Int32Array | Uint32Array | Float32Array |\n * Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef { TypedArray | ArrayBuffer | Array<number> | string } BinaryData\n */\n\n/**\n * @typedef {Object} RefProxy\n * @property {number} num\n * @property {number} gen\n */\n\n/**\n * Document initialization / loading parameters object.\n *\n * @typedef {Object} DocumentInitParameters\n * @property {string | URL} [url] - The URL of the PDF.\n * @property {BinaryData} [data] - Binary PDF data.\n * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\n *\n * NOTE: If TypedArrays are used they will generally be transferred to the\n * worker-thread. This will help reduce main-thread memory usage, however\n * it will take ownership of the TypedArrays.\n * @property {Object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n * cross-site Access-Control requests should be made using credentials such\n * as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {number} [length] - The PDF file length. It's used for progress\n * reports and range requests operations.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n * transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n * per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE}.\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n * parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n * from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n * attempting to recover valid absolute URLs for annotations, and outline\n * items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n * located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n * packed or not. The default value is `true`.\n * @property {Object} [CMapReaderFactory] - The factory that will be used when\n * reading built-in CMap files. Providing a custom factory is useful for\n * environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMCMapReaderFactory}.\n * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't\n * embedded in the PDF document will fallback to a system font.\n * The default value is `true` in web environments and `false` in Node.js;\n * unless `disableFontFace === true` in which case this defaults to `false`\n * regardless of the environment (to prevent completely broken fonts).\n * @property {string} [standardFontDataUrl] - The URL where the standard font\n * files are located. Include the trailing slash.\n * @property {Object} [StandardFontDataFactory] - The factory that will be used\n * when reading the standard font files. Providing a custom factory is useful\n * for environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMStandardFontDataFactory}.\n * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the\n * worker-thread when reading CMap and standard font files. When `true`,\n * the `CMapReaderFactory` and `StandardFontDataFactory` options are ignored.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n * PDF data cannot be successfully parsed, instead of attempting to recover\n * whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n * pixels, i.e. width * height. Images above this value will not be rendered.\n * Use -1 for no limit, which is also the default value.\n * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings\n * as JavaScript. Primarily used to improve performance of font rendering, and\n * when parsing PDF functions. The default value is `true`.\n * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use\n * `OffscreenCanvas` in the worker. Primarily used to improve performance of\n * image conversion/rendering.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {number} [canvasMaxAreaInBytes] - The integer value is used to\n * know when an image must be resized (uses `OffscreenCanvas` in the worker).\n * If it's -1 then a possibly slow algorithm is used to guess the max value.\n * @property {boolean} [disableFontFace] - By default fonts are converted to\n * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n * If disabled, fonts will be rendered using a built-in font renderer that\n * constructs the glyphs with primitive path commands.\n * The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n * which are unused during rendering of PDF documents, when exporting the\n * parsed font data from the worker-thread. This may be useful for debugging\n * purposes (and backwards compatibility), but note that it will lead to\n * increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n * The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n * context to create elements with and to load resources, such as fonts,\n * into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n * files. When enabled, and if the server supports partial content requests,\n * then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n * By default PDF.js attempts to load PDF files in chunks. The default value\n * is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n * data. When range requests are enabled PDF.js will automatically keep\n * fetching more data even if it isn't needed to display the current page.\n * The default value is `false`.\n *\n * NOTE: It is also necessary to disable streaming, see above, in order for\n * disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n * (see `web/debugger.js`). The default value is `false`.\n * @property {Object} [canvasFactory] - The factory instance that will be used\n * when creating canvases. The default value is {new DOMCanvasFactory()}.\n * @property {Object} [filterFactory] - A factory instance that will be used\n * to create SVG filters when rendering some images on the main canvas.\n */\n\n/**\n * This is the main entry point for loading a PDF and interacting with it.\n *\n * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or\n * XHR as fallback) is used, which means it must follow same origin rules,\n * e.g. no cross-domain requests without CORS.\n *\n * @param {string | URL | TypedArray | ArrayBuffer | DocumentInitParameters}\n * src - Can be a URL where a PDF file is located, a typed array (Uint8Array)\n * already populated with data, or a parameter object.\n * @returns {PDFDocumentLoadingTask}\n */\nfunction getDocument(src) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (typeof src === \"string\" || src instanceof URL) {\n src = { url: src };\n } else if (isArrayBuffer(src)) {\n src = { data: src };\n }\n }\n if (typeof src !== \"object\") {\n throw new Error(\"Invalid parameter in getDocument, need parameter object.\");\n }\n if (!src.url && !src.data && !src.range) {\n throw new Error(\n \"Invalid parameter object: need either .data, .range or .url\"\n );\n }\n const task = new PDFDocumentLoadingTask();\n const { docId } = task;\n\n const url = src.url ? getUrlProp(src.url) : null;\n const data = src.data ? getDataProp(src.data) : null;\n const httpHeaders = src.httpHeaders || null;\n const withCredentials = src.withCredentials === true;\n const password = src.password ?? null;\n const rangeTransport =\n src.range instanceof PDFDataRangeTransport ? src.range : null;\n const rangeChunkSize =\n Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0\n ? src.rangeChunkSize\n : DEFAULT_RANGE_CHUNK_SIZE;\n let worker = src.worker instanceof PDFWorker ? src.worker : null;\n const verbosity = src.verbosity;\n // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n // URLs anyway. We want to avoid sending them to the worker-thread, since\n // they contain the *entire* PDF document and can thus be arbitrarily long.\n const docBaseUrl =\n typeof src.docBaseUrl === \"string\" && !isDataScheme(src.docBaseUrl)\n ? src.docBaseUrl\n : null;\n const cMapUrl = typeof src.cMapUrl === \"string\" ? src.cMapUrl : null;\n const cMapPacked = src.cMapPacked !== false;\n const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory;\n const standardFontDataUrl =\n typeof src.standardFontDataUrl === \"string\"\n ? src.standardFontDataUrl\n : null;\n const StandardFontDataFactory =\n src.StandardFontDataFactory || DefaultStandardFontDataFactory;\n const ignoreErrors = src.stopAtErrors !== true;\n const maxImageSize =\n Number.isInteger(src.maxImageSize) && src.maxImageSize > -1\n ? src.maxImageSize\n : -1;\n const isEvalSupported = src.isEvalSupported !== false;\n const isOffscreenCanvasSupported =\n typeof src.isOffscreenCanvasSupported === \"boolean\"\n ? src.isOffscreenCanvasSupported\n : !isNodeJS;\n const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes)\n ? src.canvasMaxAreaInBytes\n : -1;\n const disableFontFace =\n typeof src.disableFontFace === \"boolean\" ? src.disableFontFace : isNodeJS;\n const fontExtraProperties = src.fontExtraProperties === true;\n const enableXfa = src.enableXfa === true;\n const ownerDocument = src.ownerDocument || globalThis.document;\n const disableRange = src.disableRange === true;\n const disableStream = src.disableStream === true;\n const disableAutoFetch = src.disableAutoFetch === true;\n const pdfBug = src.pdfBug === true;\n\n // Parameters whose default values depend on other parameters.\n const length = rangeTransport ? rangeTransport.length : src.length ?? NaN;\n const useSystemFonts =\n typeof src.useSystemFonts === \"boolean\"\n ? src.useSystemFonts\n : !isNodeJS && !disableFontFace;\n const useWorkerFetch =\n typeof src.useWorkerFetch === \"boolean\"\n ? src.useWorkerFetch\n : (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (CMapReaderFactory === DOMCMapReaderFactory &&\n StandardFontDataFactory === DOMStandardFontDataFactory &&\n cMapUrl &&\n standardFontDataUrl &&\n isValidFetchUrl(cMapUrl, document.baseURI) &&\n isValidFetchUrl(standardFontDataUrl, document.baseURI));\n const canvasFactory =\n src.canvasFactory || new DefaultCanvasFactory({ ownerDocument });\n const filterFactory =\n src.filterFactory || new DefaultFilterFactory({ docId, ownerDocument });\n\n // Parameters only intended for development/testing purposes.\n const styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? src.styleElement\n : null;\n\n // Set the main-thread verbosity level.\n setVerbosityLevel(verbosity);\n\n // Ensure that the various factories can be initialized, when necessary,\n // since the user may provide *custom* ones.\n const transportFactory = {\n canvasFactory,\n filterFactory,\n };\n if (!useWorkerFetch) {\n transportFactory.cMapReaderFactory = new CMapReaderFactory({\n baseUrl: cMapUrl,\n isCompressed: cMapPacked,\n });\n transportFactory.standardFontDataFactory = new StandardFontDataFactory({\n baseUrl: standardFontDataUrl,\n });\n }\n\n if (!worker) {\n const workerParams = {\n verbosity,\n port: GlobalWorkerOptions.workerPort,\n };\n // Worker was not provided -- creating and owning our own. If message port\n // is specified in global worker options, using it.\n worker = workerParams.port\n ? PDFWorker.fromPort(workerParams)\n : new PDFWorker(workerParams);\n task._worker = worker;\n }\n\n const fetchDocParams = {\n docId,\n apiVersion:\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null,\n data,\n password,\n disableAutoFetch,\n rangeChunkSize,\n length,\n docBaseUrl,\n enableXfa,\n evaluatorOptions: {\n maxImageSize,\n disableFontFace,\n ignoreErrors,\n isEvalSupported,\n isOffscreenCanvasSupported,\n canvasMaxAreaInBytes,\n fontExtraProperties,\n useSystemFonts,\n cMapUrl: useWorkerFetch ? cMapUrl : null,\n standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null,\n },\n };\n const transportParams = {\n ignoreErrors,\n isEvalSupported,\n disableFontFace,\n fontExtraProperties,\n enableXfa,\n ownerDocument,\n disableAutoFetch,\n pdfBug,\n styleElement,\n };\n\n worker.promise\n .then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const workerIdPromise = _fetchDocument(worker, fetchDocParams);\n const networkStreamPromise = new Promise(function (resolve) {\n let networkStream;\n if (rangeTransport) {\n networkStream = new PDFDataTransportStream(\n {\n length,\n initialData: rangeTransport.initialData,\n progressiveDone: rangeTransport.progressiveDone,\n contentDispositionFilename:\n rangeTransport.contentDispositionFilename,\n disableRange,\n disableStream,\n },\n rangeTransport\n );\n } else if (!data) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: createPDFNetworkStream\");\n }\n const createPDFNetworkStream = params => {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ) {\n return new PDFNodeStream(params);\n }\n return isValidFetchUrl(params.url)\n ? new PDFFetchStream(params)\n : new PDFNetworkStream(params);\n };\n\n networkStream = createPDFNetworkStream({\n url,\n length,\n httpHeaders,\n withCredentials,\n rangeChunkSize,\n disableRange,\n disableStream,\n });\n }\n resolve(networkStream);\n });\n\n return Promise.all([workerIdPromise, networkStreamPromise]).then(\n function ([workerId, networkStream]) {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const messageHandler = new MessageHandler(\n docId,\n workerId,\n worker.port\n );\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n transportParams,\n transportFactory\n );\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n }\n );\n })\n .catch(task._capability.reject);\n\n return task;\n}\n\n/**\n * Starts fetching of specified PDF document/data.\n *\n * @param {PDFWorker} worker\n * @param {Object} source\n * @returns {Promise<string>} A promise that is resolved when the worker ID of\n * the `MessageHandler` is known.\n * @private\n */\nasync function _fetchDocument(worker, source) {\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n const workerId = await worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n source,\n source.data ? [source.data.buffer] : null\n );\n\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n return workerId;\n}\n\nfunction getUrlProp(val) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return null; // The 'url' is unused with `PDFDataRangeTransport`.\n }\n if (val instanceof URL) {\n return val.href;\n }\n try {\n // The full path is required in the 'url' field.\n return new URL(val, window.location).href;\n } catch {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof val === \"string\"\n ) {\n return val; // Use the url as-is in Node.js environments.\n }\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n}\n\nfunction getDataProp(val) {\n // Converting string or array-like data to Uint8Array.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n val instanceof Buffer // eslint-disable-line no-undef\n ) {\n throw new Error(\n \"Please provide binary data as `Uint8Array`, rather than `Buffer`.\"\n );\n }\n if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) {\n // Use the data as-is when it's already a Uint8Array that completely\n // \"utilizes\" its underlying ArrayBuffer, to prevent any possible\n // issues when transferring it to the worker-thread.\n return val;\n }\n if (typeof val === \"string\") {\n return stringToBytes(val);\n }\n if ((typeof val === \"object\" && !isNaN(val?.length)) || isArrayBuffer(val)) {\n return new Uint8Array(val);\n }\n throw new Error(\n \"Invalid PDF binary data: either TypedArray, \" +\n \"string, or array-like object is expected in the data property.\"\n );\n}\n\n/**\n * @typedef {Object} OnProgressParameters\n * @property {number} loaded - Currently loaded number of bytes.\n * @property {number} total - Total number of bytes in the PDF file.\n */\n\n/**\n * The loading task controls the operations required to load a PDF document\n * (such as network requests) and provides a way to listen for completion,\n * after which individual pages can be rendered.\n */\nclass PDFDocumentLoadingTask {\n static #docId = 0;\n\n constructor() {\n this._capability = new PromiseCapability();\n this._transport = null;\n this._worker = null;\n\n /**\n * Unique identifier for the document loading task.\n * @type {string}\n */\n this.docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n /**\n * Whether the loading task is destroyed or not.\n * @type {boolean}\n */\n this.destroyed = false;\n\n /**\n * Callback to request a password if a wrong or no password was provided.\n * The callback receives two parameters: a function that should be called\n * with the new password, and a reason (see {@link PasswordResponses}).\n * @type {function}\n */\n this.onPassword = null;\n\n /**\n * Callback to be able to monitor the loading progress of the PDF file\n * (necessary to implement e.g. a loading bar).\n * The callback receives an {@link OnProgressParameters} argument.\n * @type {function}\n */\n this.onProgress = null;\n }\n\n /**\n * Promise for document loading task completion.\n * @type {Promise<PDFDocumentProxy>}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Abort all network requests and destroy the worker.\n * @returns {Promise<void>} A promise that is resolved when destruction is\n * completed.\n */\n async destroy() {\n this.destroyed = true;\n try {\n if (this._worker?.port) {\n this._worker._pendingDestroy = true;\n }\n await this._transport?.destroy();\n } catch (ex) {\n if (this._worker?.port) {\n delete this._worker._pendingDestroy;\n }\n throw ex;\n }\n\n this._transport = null;\n if (this._worker) {\n this._worker.destroy();\n this._worker = null;\n }\n }\n}\n\n/**\n * Abstract class to support range requests file loading.\n *\n * NOTE: The TypedArrays passed to the constructor and relevant methods below\n * will generally be transferred to the worker-thread. This will help reduce\n * main-thread memory usage, however it will take ownership of the TypedArrays.\n */\nclass PDFDataRangeTransport {\n /**\n * @param {number} length\n * @param {Uint8Array|null} initialData\n * @param {boolean} [progressiveDone]\n * @param {string} [contentDispositionFilename]\n */\n constructor(\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n\n this._rangeListeners = [];\n this._progressListeners = [];\n this._progressiveReadListeners = [];\n this._progressiveDoneListeners = [];\n this._readyCapability = new PromiseCapability();\n }\n\n /**\n * @param {function} listener\n */\n addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n\n /**\n * @param {number} begin\n * @param {Uint8Array|null} chunk\n */\n onDataRange(begin, chunk) {\n for (const listener of this._rangeListeners) {\n listener(begin, chunk);\n }\n }\n\n /**\n * @param {number} loaded\n * @param {number|undefined} total\n */\n onDataProgress(loaded, total) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressListeners) {\n listener(loaded, total);\n }\n });\n }\n\n /**\n * @param {Uint8Array|null} chunk\n */\n onDataProgressiveRead(chunk) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveReadListeners) {\n listener(chunk);\n }\n });\n }\n\n onDataProgressiveDone() {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveDoneListeners) {\n listener();\n }\n });\n }\n\n transportReady() {\n this._readyCapability.resolve();\n }\n\n /**\n * @param {number} begin\n * @param {number} end\n */\n requestDataRange(begin, end) {\n unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => {\n return this._transport.getXFADatasets();\n },\n });\n Object.defineProperty(this, \"getXRefPrevValue\", {\n value: () => {\n return this._transport.getXRefPrevValue();\n },\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex => {\n return this._transport.getAnnotArray(pageIndex);\n },\n });\n }\n }\n\n /**\n * @type {AnnotationStorage} Storage for annotation data in forms.\n */\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array<string, string|null>} A (not guaranteed to be) unique ID to\n * identify the PDF document.\n * NOTE: The first element will always be defined for all PDF documents,\n * whereas the second element is only defined for *modified* PDF documents.\n */\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n *\n * @type {Object | null} An object representing a HTML tree structure\n * to render the XFA, or `null` when no XFA form exists.\n */\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n /**\n * @param {number} pageNumber - The page number to get. The first page is 1.\n * @returns {Promise<PDFPageProxy>} A promise that is resolved with\n * a {@link PDFPageProxy} object.\n */\n getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {Promise<number>} A promise that is resolved with the page index,\n * starting from zero, that is associated with the reference.\n */\n getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n\n /**\n * @returns {Promise<Object<string, Array<any>>>} A promise that is resolved\n * with a mapping from named destinations to references.\n *\n * This can be slow for large documents. Use `getDestination` instead.\n */\n getDestinations() {\n return this._transport.getDestinations();\n }\n\n /**\n * @param {string} id - The named destination to get.\n * @returns {Promise<Array<any> | null>} A promise that is resolved with all\n * information of the given named destination, or `null` when the named\n * destination is not present in the PDF file.\n */\n getDestination(id) {\n return this._transport.getDestination(id);\n }\n\n /**\n * @returns {Promise<Array<string> | null>} A promise that is resolved with\n * an {Array} containing the page labels that correspond to the page\n * indexes, or `null` when no page labels are present in the PDF file.\n */\n getPageLabels() {\n return this._transport.getPageLabels();\n }\n\n /**\n * @returns {Promise<string>} A promise that is resolved with a {string}\n * containing the page layout name.\n */\n getPageLayout() {\n return this._transport.getPageLayout();\n }\n\n /**\n * @returns {Promise<string>} A promise that is resolved with a {string}\n * containing the page mode name.\n */\n getPageMode() {\n return this._transport.getPageMode();\n }\n\n /**\n * @returns {Promise<Object | null>} A promise that is resolved with an\n * {Object} containing the viewer preferences, or `null` when no viewer\n * preferences are present in the PDF file.\n */\n getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n\n /**\n * @returns {Promise<any | null>} A promise that is resolved with an {Array}\n * containing the destination, or `null` when no open action is present\n * in the PDF.\n */\n getOpenAction() {\n return this._transport.getOpenAction();\n }\n\n /**\n * @returns {Promise<any>} A promise that is resolved with a lookup table\n * for mapping named attachments to their content.\n */\n getAttachments() {\n return this._transport.getAttachments();\n }\n\n /**\n * @returns {Promise<Object | null>} A promise that is resolved with\n * an {Object} with the JavaScript actions:\n * - from the name tree.\n * - from A or AA entries in the catalog dictionary.\n * , or `null` if no JavaScript exists.\n */\n getJSActions() {\n return this._transport.getDocJSActions();\n }\n\n /**\n * @typedef {Object} OutlineNode\n * @property {string} title\n * @property {boolean} bold\n * @property {boolean} italic\n * @property {Uint8ClampedArray} color - The color in RGB format to use for\n * display purposes.\n * @property {string | Array<any> | null} dest\n * @property {string | null} url\n * @property {string | undefined} unsafeUrl\n * @property {boolean | undefined} newWindow\n * @property {number | undefined} count\n * @property {Array<OutlineNode>} items\n */\n\n /**\n * @returns {Promise<Array<OutlineNode>>} A promise that is resolved with an\n * {Array} that is a tree outline (if it has one) of the PDF file.\n */\n getOutline() {\n return this._transport.getOutline();\n }\n\n /**\n * @returns {Promise<OptionalContentConfig>} A promise that is resolved with\n * an {@link OptionalContentConfig} that contains all the optional content\n * groups (assuming that the document has any).\n */\n getOptionalContentConfig() {\n return this._transport.getOptionalContentConfig();\n }\n\n /**\n * @returns {Promise<Array<number> | null>} A promise that is resolved with\n * an {Array} that contains the permission flags for the PDF document, or\n * `null` when no permissions are present in the PDF file.\n */\n getPermissions() {\n return this._transport.getPermissions();\n }\n\n /**\n * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is\n * resolved with an {Object} that has `info` and `metadata` properties.\n * `info` is an {Object} filled with anything available in the information\n * dictionary and similarly `metadata` is a {Metadata} object with\n * information from the metadata section of the PDF.\n */\n getMetadata() {\n return this._transport.getMetadata();\n }\n\n /**\n * @typedef {Object} MarkInfo\n * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.\n * @property {boolean} Marked\n * @property {boolean} UserProperties\n * @property {boolean} Suspects\n */\n\n /**\n * @returns {Promise<MarkInfo | null>} A promise that is resolved with\n * a {MarkInfo} object that contains the MarkInfo flags for the PDF\n * document, or `null` when no MarkInfo values are present in the PDF file.\n */\n getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n\n /**\n * @returns {Promise<Uint8Array>} A promise that is resolved with a\n * {Uint8Array} containing the raw data of the PDF document.\n */\n getData() {\n return this._transport.getData();\n }\n\n /**\n * @returns {Promise<Uint8Array>} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n saveDocument() {\n return this._transport.saveDocument();\n }\n\n /**\n * @returns {Promise<{ length: number }>} A promise that is resolved when the\n * document's data is loaded. It is resolved with an {Object} that contains\n * the `length` property that indicates size of the PDF data in bytes.\n */\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n /**\n * Cleans up resources allocated by the document on both the main and worker\n * threads.\n *\n * NOTE: Do not, under any circumstances, call this method when rendering is\n * currently ongoing since that may lead to rendering errors.\n *\n * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n * NOTE: This will increase persistent memory usage, hence don't use this\n * option unless absolutely necessary. The default value is `false`.\n * @returns {Promise} A promise that is resolved when clean-up has finished.\n */\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n /**\n * Destroys the current document instance and terminates the worker.\n */\n destroy() {\n return this.loadingTask.destroy();\n }\n\n /**\n * @type {DocumentInitParameters} A subset of the current\n * {DocumentInitParameters}, which are needed in the viewer.\n */\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n /**\n * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n */\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n /**\n * @returns {Promise<Object<string, Array<Object>> | null>} A promise that is\n * resolved with an {Object} containing /AcroForm field data for the JS\n * sandbox, or `null` when no field data is present in the PDF file.\n */\n getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n\n /**\n * @returns {Promise<boolean>} A promise that is resolved with `true`\n * if some /AcroForm fields have JavaScript actions.\n */\n hasJSActions() {\n return this._transport.hasJSActions();\n }\n\n /**\n * @returns {Promise<Array<string> | null>} A promise that is resolved with an\n * {Array<string>} containing IDs of annotations that have a calculation\n * action, or `null` when no such annotations are present in the PDF file.\n */\n getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n}\n\n/**\n * Page getViewport parameters.\n *\n * @typedef {Object} GetViewportParameters\n * @property {number} scale - The desired scale of the viewport.\n * @property {number} [rotation] - The desired rotation, in degrees, of\n * the viewport. If omitted it defaults to the page rotation.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be\n * flipped. The default value is `false`.\n */\n\n/**\n * Page getTextContent parameters.\n *\n * @typedef {Object} getTextContentParameters\n * @property {boolean} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n * @property {boolean} [disableNormalization] - When true the text is *not*\n * normalized in the worker-thread. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array<TextItem | TextMarkedContent>} items - Array of\n * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n * items are included when includeMarkedContent is true.\n * @property {Object<string, TextStyle>} styles - {@link TextStyle} objects,\n * indexed by font name.\n */\n\n/**\n * Page text content part.\n *\n * @typedef {Object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array<any>} transform - Transformation matrix.\n * @property {number} width - Width in device space.\n * @property {number} height - Height in device space.\n * @property {string} fontName - Font name used by PDF.js for converted font.\n * @property {boolean} hasEOL - Indicating if the text content is followed by a\n * line-break.\n */\n\n/**\n * Page text marked content part.\n *\n * @typedef {Object} TextMarkedContent\n * @property {string} type - Either 'beginMarkedContent',\n * 'beginMarkedContentProps', or 'endMarkedContent'.\n * @property {string} id - The marked content identifier. Only used for type\n * 'beginMarkedContentProps'.\n */\n\n/**\n * Text style.\n *\n * @typedef {Object} TextStyle\n * @property {number} ascent - Font ascent.\n * @property {number} descent - Font descent.\n * @property {boolean} vertical - Whether or not the text is in vertical mode.\n * @property {string} fontFamily - The possible font family.\n */\n\n/**\n * Page annotation parameters.\n *\n * @typedef {Object} GetAnnotationsParameters\n * @property {string} [intent] - Determines the annotations that are fetched,\n * can be 'display' (viewable annotations), 'print' (printable annotations),\n * or 'any' (all annotations). The default value is 'display'.\n */\n\n/**\n * Page render parameters.\n *\n * @typedef {Object} RenderParameters\n * @property {CanvasRenderingContext2D} canvasContext - A 2D context of a DOM\n * Canvas object.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n * the `PDFPageProxy.getViewport` method.\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are rendered\n * onto the canvas, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {Array<any>} [transform] - Additional transform, applied just\n * before viewport transform.\n * @property {CanvasGradient | CanvasPattern | string} [background] - Background\n * to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * <color> value, a `CanvasGradient` object (a linear or radial gradient) or\n * a `CanvasPattern` object (a repetitive image). The default value is\n * 'rgb(255,255,255)'.\n *\n * NOTE: This option may be partially, or completely, ignored when the\n * `pageColors`-option is used.\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 {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -\n * A promise that should resolve with an {@link OptionalContentConfig}\n * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,\n * the configuration will be fetched automatically with the default visibility\n * states set.\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some\n * annotation ids with canvases used to render them.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Page getOperatorList parameters.\n *\n * @typedef {Object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n * in the operatorList, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n *\n * @typedef {Object} StructTreeNode\n * @property {Array<StructTreeNode | StructTreeContent>} children - Array of\n * {@link StructTreeNode} and {@link StructTreeContent} objects.\n * @property {string} role - element's role, already mapped if a role map exists\n * in the PDF.\n */\n\n/**\n * Structure tree content.\n *\n * @typedef {Object} StructTreeContent\n * @property {string} type - either \"content\" for page and stream structure\n * elements or \"object\" for object references.\n * @property {string} id - unique id that will map to the text layer.\n */\n\n/**\n * PDF page operator list.\n *\n * @typedef {Object} PDFOperatorList\n * @property {Array<number>} fnArray - Array containing the operator functions.\n * @property {Array<any>} argsArray - Array containing the arguments of the\n * functions.\n */\n\n/**\n * Proxy to a `PDFPage` in the worker thread.\n */\nclass PDFPageProxy {\n #delayedCleanupTimeout = null;\n\n #pendingCleanup = false;\n\n constructor(pageIndex, pageInfo, transport, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._transport = transport;\n this._stats = pdfBug ? new StatTimer() : null;\n this._pdfBug = pdfBug;\n /** @type {PDFObjects} */\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n\n this._maybeCleanupAfterRender = false;\n this._intentStates = new Map();\n this.destroyed = false;\n }\n\n /**\n * @type {number} Page number of the page. First page is 1.\n */\n get pageNumber() {\n return this._pageIndex + 1;\n }\n\n /**\n * @type {number} The number of degrees the page is rotated clockwise.\n */\n get rotate() {\n return this._pageInfo.rotate;\n }\n\n /**\n * @type {RefProxy | null} The reference that points to this page.\n */\n get ref() {\n return this._pageInfo.ref;\n }\n\n /**\n * @type {number} The default size of units in 1/72nds of an inch.\n */\n get userUnit() {\n return this._pageInfo.userUnit;\n }\n\n /**\n * @type {Array<number>} An array of the visible portion of the PDF page in\n * user space units [x1, y1, x2, y2].\n */\n get view() {\n return this._pageInfo.view;\n }\n\n /**\n * @param {GetViewportParameters} params - Viewport parameters.\n * @returns {PageViewport} Contains 'width' and 'height' properties\n * along with transforms required for rendering.\n */\n getViewport({\n scale,\n rotation = this.rotate,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.view,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * @param {GetAnnotationsParameters} params - Annotation parameters.\n * @returns {Promise<Array<any>>} A promise that is resolved with an\n * {Array} of the annotation objects.\n */\n getAnnotations({ intent = \"display\" } = {}) {\n const intentArgs = this._transport.getRenderingIntent(intent);\n\n return this._transport.getAnnotations(\n this._pageIndex,\n intentArgs.renderingIntent\n );\n }\n\n /**\n * @returns {Promise<Object>} A promise that is resolved with an\n * {Object} with JS actions.\n */\n getJSActions() {\n return this._transport.getPageJSActions(this._pageIndex);\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * @returns {Promise<Object | null>} A promise that is resolved with\n * an {Object} with a fake DOM object (a tree structure where elements\n * are {Object} with a name, attributes (class, style, ...), value and\n * children, very similar to a HTML DOM tree), or `null` if no XFA exists.\n */\n async getXfa() {\n return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n }\n\n /**\n * Begins the process of rendering a page to the desired context.\n *\n * @param {RenderParameters} params - Page render parameters.\n * @returns {RenderTask} An object that contains a promise that is\n * resolved when the page finishes rendering.\n */\n render({\n canvasContext,\n viewport,\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n transform = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n printAnnotationStorage = null,\n }) {\n this._stats?.time(\"Overall\");\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage\n );\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render...\n this.#pendingCleanup = false;\n // ... and ensure that a delayed cleanup is always aborted.\n this.#abortDelayedCleanup();\n\n if (!optionalContentConfigPromise) {\n optionalContentConfigPromise = this._transport.getOptionalContentConfig();\n }\n\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const intentPrint = !!(\n intentArgs.renderingIntent & RenderingIntentFlag.PRINT\n );\n\n // If there's no displayReadyCapability yet, then the operatorList\n // was never requested before. Make the request and create the promise.\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = new PromiseCapability();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n // Attempt to reduce memory usage during *printing*, by always running\n // cleanup immediately once rendering has finished.\n if (this._maybeCleanupAfterRender || intentPrint) {\n this.#pendingCleanup = true;\n }\n this.#tryCleanup(/* delayed = */ !intentPrint);\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n this._abortOperatorList({\n intentState,\n reason: error instanceof Error ? error : new Error(error),\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n\n this._stats?.timeEnd(\"Rendering\");\n this._stats?.timeEnd(\"Overall\");\n };\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n // Only include the required properties, and *not* the entire object.\n params: {\n canvasContext,\n viewport,\n transform,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: this._transport.canvasFactory,\n filterFactory: this._transport.filterFactory,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors,\n });\n\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n\n Promise.all([\n intentState.displayReadyCapability.promise,\n optionalContentConfigPromise,\n ])\n .then(([transparency, optionalContentConfig]) => {\n if (this.destroyed) {\n complete();\n return;\n }\n this._stats?.time(\"Rendering\");\n\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig,\n });\n internalRenderTask.operatorListChanged();\n })\n .catch(complete);\n\n return renderTask;\n }\n\n /**\n * @param {GetOperatorListParameters} params - Page getOperatorList\n * parameters.\n * @returns {Promise<PDFOperatorList>} A promise resolved with an\n * {@link PDFOperatorList} object that represents the page's operator list.\n */\n getOperatorList({\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n } = {}) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\"Not implemented: getOperatorList\");\n }\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n /* isOpList = */ true\n );\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = new PromiseCapability();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n return intentState.opListReadCapability.promise;\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {ReadableStream} Stream for reading text content chunks.\n */\n streamTextContent({\n includeMarkedContent = false,\n disableNormalization = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageIndex: this._pageIndex,\n includeMarkedContent: includeMarkedContent === true,\n disableNormalization: disableNormalization === true,\n },\n {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size(textContent) {\n return textContent.items.length;\n },\n }\n );\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {Promise<TextContent>} A promise that is resolved with a\n * {@link TextContent} object that represents the page's text content.\n */\n getTextContent(params = {}) {\n if (this._transport._htmlForXfa) {\n // TODO: We need to revisit this once the XFA foreground patch lands and\n // only do this for non-foreground XFA.\n return this.getXfa().then(xfa => {\n return XfaText.textContent(xfa);\n });\n }\n const readableStream = this.streamTextContent(params);\n\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function ({ value, done }) {\n if (done) {\n resolve(textContent);\n return;\n }\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n pump();\n }, reject);\n }\n\n const reader = readableStream.getReader();\n const textContent = {\n items: [],\n styles: Object.create(null),\n };\n pump();\n });\n }\n\n /**\n * @returns {Promise<StructTreeNode>} A promise that is resolved with a\n * {@link StructTreeNode} object that represents the page's structure tree,\n * or `null` when no structure tree is present for the current page.\n */\n getStructTree() {\n return this._transport.getStructTree(this._pageIndex);\n }\n\n /**\n * Destroys the page object.\n * @private\n */\n _destroy() {\n this.destroyed = true;\n\n const waitOn = [];\n for (const intentState of this._intentStates.values()) {\n this._abortOperatorList({\n intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true,\n });\n\n if (intentState.opListReadCapability) {\n // Avoid errors below, since the renderTasks are just stubs.\n continue;\n }\n for (const internalRenderTask of intentState.renderTasks) {\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n }\n this.objs.clear();\n this.#pendingCleanup = false;\n this.#abortDelayedCleanup();\n\n return Promise.all(waitOn);\n }\n\n /**\n * Cleans up resources allocated by the page.\n *\n * @param {boolean} [resetStats] - Reset page stats, if enabled.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n cleanup(resetStats = false) {\n this.#pendingCleanup = true;\n const success = this.#tryCleanup(/* delayed = */ false);\n\n if (resetStats && success) {\n this._stats &&= new StatTimer();\n }\n return success;\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @param {boolean} [delayed] - Delay the cleanup, to e.g. improve zooming\n * performance in documents with large images.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n #tryCleanup(delayed = false) {\n this.#abortDelayedCleanup();\n\n if (!this.#pendingCleanup || this.destroyed) {\n return false;\n }\n if (delayed) {\n this.#delayedCleanupTimeout = setTimeout(() => {\n this.#delayedCleanupTimeout = null;\n this.#tryCleanup(/* delayed = */ false);\n }, DELAYED_CLEANUP_TIMEOUT);\n\n return false;\n }\n for (const { renderTasks, operatorList } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n this._intentStates.clear();\n this.objs.clear();\n this.#pendingCleanup = false;\n return true;\n }\n\n #abortDelayedCleanup() {\n if (this.#delayedCleanupTimeout) {\n clearTimeout(this.#delayedCleanupTimeout);\n this.#delayedCleanupTimeout = null;\n }\n }\n\n /**\n * @private\n */\n _startRenderPage(transparency, cacheKey) {\n const intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n return; // Rendering was cancelled.\n }\n this._stats?.timeEnd(\"Page Request\");\n\n // TODO Refactor RenderPageRequest to separate rendering\n // and operator list logic\n intentState.displayReadyCapability?.resolve(transparency);\n }\n\n /**\n * @private\n */\n _renderPageChunk(operatorListChunk, intentState) {\n // Add the new chunk to the current operator list.\n for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots;\n\n // Notify all the rendering tasks there are more operators to be consumed.\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n if (operatorListChunk.lastChunk) {\n this.#tryCleanup(/* delayed = */ true);\n }\n }\n\n /**\n * @private\n */\n _pumpOperatorList({\n renderingIntent,\n cacheKey,\n annotationStorageSerializable,\n }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n const { map, transfer } = annotationStorageSerializable;\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage: map,\n },\n transfer\n );\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(\n ({ value, done }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this._renderPageChunk(value, intentState);\n pump();\n },\n reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n if (intentState.operatorList) {\n // Mark operator list as complete.\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n this.#tryCleanup(/* delayed = */ true);\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n }\n );\n };\n pump();\n }\n\n /**\n * @private\n */\n _abortOperatorList({ intentState, reason, force = false }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\n }\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n if (!force) {\n // Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.\n // multiple render() calls on the same canvas, won't break all rendering.\n if (intentState.renderTasks.size > 0) {\n return;\n }\n // Don't immediately abort parsing on the worker-thread when rendering is\n // cancelled, since that will unnecessarily delay re-rendering when (for\n // partially parsed pages) e.g. zooming/rotation occurs in the viewer.\n if (reason instanceof RenderingCancelledException) {\n let delay = RENDERING_CANCELLED_TIMEOUT;\n if (reason.extraDelay > 0 && reason.extraDelay < /* ms = */ 1000) {\n // Above, we prevent the total delay from becoming arbitrarily large.\n delay += reason.extraDelay;\n }\n\n intentState.streamReaderCancelTimeout = setTimeout(() => {\n intentState.streamReaderCancelTimeout = null;\n this._abortOperatorList({ intentState, reason, force: true });\n }, delay);\n return;\n }\n }\n intentState.streamReader\n .cancel(new AbortException(reason.message))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n // Remove the current `intentState`, since a cancelled `getOperatorList`\n // call on the worker-thread cannot be re-started...\n for (const [curCacheKey, curIntentState] of this._intentStates) {\n if (curIntentState === intentState) {\n this._intentStates.delete(curCacheKey);\n break;\n }\n }\n // ... and force clean-up to ensure that any old state is always removed.\n this.cleanup();\n }\n\n /**\n * @type {StatTimer | null} Returns page stats, if enabled; returns `null`\n * otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\nclass LoopbackPort {\n #listeners = new Set();\n\n #deferred = Promise.resolve();\n\n postMessage(obj, transfer) {\n const event = {\n data: structuredClone(obj, transfer ? { transfer } : null),\n };\n\n this.#deferred.then(() => {\n for (const listener of this.#listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener) {\n this.#listeners.add(listener);\n }\n\n removeEventListener(name, listener) {\n this.#listeners.delete(listener);\n }\n\n terminate() {\n this.#listeners.clear();\n }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Worker} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n * the constants from {@link VerbosityLevel} should be used.\n */\n\nconst PDFWorkerUtil = {\n isWorkerDisabled: false,\n fakeWorkerId: 0,\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (isNodeJS) {\n // Workers aren't supported in Node.js, force-disabling them there.\n PDFWorkerUtil.isWorkerDisabled = true;\n\n GlobalWorkerOptions.workerSrc ||= PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.mjs\";\n }\n\n // Check if URLs have the same origin. For non-HTTP based URLs, returns false.\n PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) {\n let base;\n try {\n base = new URL(baseUrl);\n if (!base.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n } catch {\n return false;\n }\n\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n PDFWorkerUtil.createCDNWrapper = function (url) {\n // We will rely on blob URL's property to specify origin.\n // We want this function to fail in case if createObjectURL or Blob do not\n // exist or fail for some reason -- our Worker creation will fail anyway.\n const wrapper = `await import(\"${url}\");`;\n return URL.createObjectURL(\n new Blob([wrapper], { type: \"text/javascript\" })\n );\n };\n}\n\n/**\n * PDF.js web worker abstraction that controls the instantiation of PDF\n * documents. Message handlers are used to pass information from the main\n * thread to the worker thread and vice versa. If the creation of a web\n * worker is not possible, a \"fake\" worker will be used instead.\n *\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\nclass PDFWorker {\n static #workerPorts;\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n this._readyCapability = new PromiseCapability();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n port\n ) {\n if (PDFWorker.#workerPorts?.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n (PDFWorker.#workerPorts ||= new WeakMap()).set(port, this);\n this._initializeFromPort(port);\n return;\n }\n this._initialize();\n }\n\n /**\n * Promise for worker initialization completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this._readyCapability.promise;\n }\n\n /**\n * The current `workerPort`, when it exists.\n * @type {Worker}\n */\n get port() {\n return this._port;\n }\n\n /**\n * The current MessageHandler-instance.\n * @type {MessageHandler}\n */\n get messageHandler() {\n return this._messageHandler;\n }\n\n _initializeFromPort(port) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _initializeFromPort\");\n }\n this._port = port;\n this._messageHandler = new MessageHandler(\"main\", \"worker\", port);\n this._messageHandler.on(\"ready\", function () {\n // Ignoring \"ready\" event -- MessageHandler should already be initialized\n // and ready to accept messages.\n });\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n this._messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n }\n\n _initialize() {\n // If worker support isn't disabled explicit and the browser has worker\n // support, create a new web worker and test if it/the browser fulfills\n // all requirements to run parts of pdf.js in a web worker.\n // Right now, the requirement is, that an Uint8Array is still an\n // Uint8Array as it arrives on the worker. (Chrome added this with v.15.)\n if (\n !PDFWorkerUtil.isWorkerDisabled &&\n !PDFWorker.#mainThreadWorkerMessageHandler\n ) {\n let { workerSrc } = PDFWorker;\n\n try {\n // Wraps workerSrc path into blob URL, if the former does not belong\n // to the same origin.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n !PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)\n ) {\n workerSrc = PDFWorkerUtil.createCDNWrapper(\n new URL(workerSrc, window.location).href\n );\n }\n\n const worker = new Worker(workerSrc, { type: \"module\" });\n const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n const terminateEarly = () => {\n worker.removeEventListener(\"error\", onWorkerError);\n messageHandler.destroy();\n worker.terminate();\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n } else {\n // Fall back to fake worker if the termination is caused by an\n // error (e.g. NetworkError / SecurityError).\n this._setupFakeWorker();\n }\n };\n\n const onWorkerError = () => {\n if (!this._webWorker) {\n // Worker failed to initialize due to an error. Clean up and fall\n // back to the fake worker.\n terminateEarly();\n }\n };\n worker.addEventListener(\"error\", onWorkerError);\n\n messageHandler.on(\"test\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n if (data) {\n this._messageHandler = messageHandler;\n this._port = worker;\n this._webWorker = worker;\n\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n } else {\n this._setupFakeWorker();\n messageHandler.destroy();\n worker.terminate();\n }\n });\n\n messageHandler.on(\"ready\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n try {\n sendTest();\n } catch {\n // We need fallback to a faked worker.\n this._setupFakeWorker();\n }\n });\n\n const sendTest = () => {\n const testObj = new Uint8Array();\n // Ensure that we can use `postMessage` transfers.\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n };\n\n // It might take time for the worker to initialize. We will try to send\n // the \"test\" message immediately, and once the \"ready\" message arrives.\n // The worker shall process only the first received \"test\" message.\n sendTest();\n return;\n } catch {\n info(\"The worker has been disabled.\");\n }\n }\n // Either workers are disabled, not supported or have thrown an exception.\n // Thus, we fallback to a faked worker.\n this._setupFakeWorker();\n }\n\n _setupFakeWorker() {\n if (!PDFWorkerUtil.isWorkerDisabled) {\n warn(\"Setting up fake worker.\");\n PDFWorkerUtil.isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal\n .then(WorkerMessageHandler => {\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n return;\n }\n const port = new LoopbackPort();\n this._port = port;\n\n // All fake workers use the same port, making id unique.\n const id = `fake${PDFWorkerUtil.fakeWorkerId++}`;\n\n // If the main thread is our worker, setup the handling for the\n // messages -- the main thread sends to it self.\n const workerHandler = new MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n\n const messageHandler = new MessageHandler(id, id + \"_worker\", port);\n this._messageHandler = messageHandler;\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n })\n .catch(reason => {\n this._readyCapability.reject(\n new Error(`Setting up fake worker failed: \"${reason.message}\".`)\n );\n });\n }\n\n /**\n * Destroys the worker instance.\n */\n destroy() {\n this.destroyed = true;\n if (this._webWorker) {\n // We need to terminate only web worker created resource.\n this._webWorker.terminate();\n this._webWorker = null;\n }\n PDFWorker.#workerPorts?.delete(this._port);\n this._port = null;\n if (this._messageHandler) {\n this._messageHandler.destroy();\n this._messageHandler = null;\n }\n }\n\n /**\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\n static fromPort(params) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: fromPort\");\n }\n if (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n const cachedPort = this.#workerPorts?.get(params.port);\n if (cachedPort) {\n if (cachedPort._pendingDestroy) {\n throw new Error(\n \"PDFWorker.fromPort - the worker is being destroyed.\\n\" +\n \"Please remember to await `PDFDocumentLoadingTask.destroy()`-calls.\"\n );\n }\n return cachedPort;\n }\n return new PDFWorker(params);\n }\n\n /**\n * The current `workerSrc`, when it exists.\n * @type {string}\n */\n static get workerSrc() {\n if (GlobalWorkerOptions.workerSrc) {\n return GlobalWorkerOptions.workerSrc;\n }\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get #mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n if (this.#mainThreadWorkerMessageHandler) {\n // The worker was already loaded using e.g. a `<script>` tag.\n return this.#mainThreadWorkerMessageHandler;\n }\n const worker =\n typeof PDFJSDev === \"undefined\"\n ? await import(\"pdfjs/pdf.worker.js\")\n : await import(/* webpackIgnore: true */ this.workerSrc);\n return worker.WorkerMessageHandler;\n };\n\n return shadow(this, \"_setupFakeWorkerGlobal\", loader());\n }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass WorkerTransport {\n #methodPromises = new Map();\n\n #pageCache = new Map();\n\n #pagePromises = new Map();\n\n #passwordCapability = null;\n\n constructor(messageHandler, loadingTask, networkStream, params, factory) {\n this.messageHandler = messageHandler;\n this.loadingTask = loadingTask;\n this.commonObjs = new PDFObjects();\n this.fontLoader = new FontLoader({\n ownerDocument: params.ownerDocument,\n styleElement: params.styleElement,\n });\n this._params = params;\n\n this.canvasFactory = factory.canvasFactory;\n this.filterFactory = factory.filterFactory;\n this.cMapReaderFactory = factory.cMapReaderFactory;\n this.standardFontDataFactory = factory.standardFontDataFactory;\n\n this.destroyed = false;\n this.destroyCapability = null;\n\n this._networkStream = networkStream;\n this._fullReader = null;\n this._lastProgress = null;\n this.downloadInfoCapability = new PromiseCapability();\n\n this.setupMessageHandler();\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => {\n return this.messageHandler.sendWithPromise(\"GetXFADatasets\", null);\n },\n });\n Object.defineProperty(this, \"getXRefPrevValue\", {\n value: () => {\n return this.messageHandler.sendWithPromise(\"GetXRefPrevValue\", null);\n },\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex => {\n return this.messageHandler.sendWithPromise(\"GetAnnotArray\", {\n pageIndex,\n });\n },\n });\n }\n }\n\n #cacheSimpleMethod(name, data = null) {\n const cachedPromise = this.#methodPromises.get(name);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler.sendWithPromise(name, data);\n\n this.#methodPromises.set(name, promise);\n return promise;\n }\n\n get annotationStorage() {\n return shadow(this, \"annotationStorage\", new AnnotationStorage());\n }\n\n getRenderingIntent(\n intent,\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n isOpList = false\n ) {\n let renderingIntent = RenderingIntentFlag.DISPLAY; // Default value.\n let annotationStorageSerializable = SerializableEmpty;\n\n switch (intent) {\n case \"any\":\n renderingIntent = RenderingIntentFlag.ANY;\n break;\n case \"display\":\n break;\n case \"print\":\n renderingIntent = RenderingIntentFlag.PRINT;\n break;\n default:\n warn(`getRenderingIntent - invalid intent: ${intent}`);\n }\n\n switch (annotationMode) {\n case AnnotationMode.DISABLE:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_DISABLE;\n break;\n case AnnotationMode.ENABLE:\n break;\n case AnnotationMode.ENABLE_FORMS:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_FORMS;\n break;\n case AnnotationMode.ENABLE_STORAGE:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_STORAGE;\n\n const annotationStorage =\n renderingIntent & RenderingIntentFlag.PRINT &&\n printAnnotationStorage instanceof PrintAnnotationStorage\n ? printAnnotationStorage\n : this.annotationStorage;\n\n annotationStorageSerializable = annotationStorage.serializable;\n break;\n default:\n warn(`getRenderingIntent - invalid annotationMode: ${annotationMode}`);\n }\n\n if (isOpList) {\n renderingIntent += RenderingIntentFlag.OPLIST;\n }\n\n return {\n renderingIntent,\n cacheKey: `${renderingIntent}_${annotationStorageSerializable.hash}`,\n annotationStorageSerializable,\n };\n }\n\n destroy() {\n if (this.destroyCapability) {\n return this.destroyCapability.promise;\n }\n\n this.destroyed = true;\n this.destroyCapability = new PromiseCapability();\n\n this.#passwordCapability?.reject(\n new Error(\"Worker was destroyed during onPassword callback\")\n );\n\n const waitOn = [];\n // We need to wait for all renderings to be completed, e.g.\n // timeout/rAF can take a long time.\n for (const page of this.#pageCache.values()) {\n waitOn.push(page._destroy());\n }\n this.#pageCache.clear();\n this.#pagePromises.clear();\n // Allow `AnnotationStorage`-related clean-up when destroying the document.\n if (this.hasOwnProperty(\"annotationStorage\")) {\n this.annotationStorage.resetModified();\n }\n // We also need to wait for the worker to finish its long running tasks.\n const terminated = this.messageHandler.sendWithPromise(\"Terminate\", null);\n waitOn.push(terminated);\n\n Promise.all(waitOn).then(() => {\n this.commonObjs.clear();\n this.fontLoader.clear();\n this.#methodPromises.clear();\n this.filterFactory.destroy();\n\n this._networkStream?.cancelAllRequests(\n new AbortException(\"Worker was terminated.\")\n );\n\n if (this.messageHandler) {\n this.messageHandler.destroy();\n this.messageHandler = null;\n }\n this.destroyCapability.resolve();\n }, this.destroyCapability.reject);\n return this.destroyCapability.promise;\n }\n\n setupMessageHandler() {\n const { messageHandler, loadingTask } = this;\n\n messageHandler.on(\"GetReader\", (data, sink) => {\n assert(\n this._networkStream,\n \"GetReader - no `IPDFStream` instance available.\"\n );\n this._fullReader = this._networkStream.getFullReader();\n this._fullReader.onProgress = evt => {\n this._lastProgress = {\n loaded: evt.loaded,\n total: evt.total,\n };\n };\n sink.onPull = () => {\n this._fullReader\n .read()\n .then(function ({ value, done }) {\n if (done) {\n sink.close();\n return;\n }\n assert(\n value instanceof ArrayBuffer,\n \"GetReader - expected an ArrayBuffer.\"\n );\n // Enqueue data chunk into sink, and transfer it\n // to other side as `Transferable` object.\n sink.enqueue(new Uint8Array(value), 1, [value]);\n })\n .catch(reason => {\n sink.error(reason);\n });\n };\n\n sink.onCancel = reason => {\n this._fullReader.cancel(reason);\n\n sink.ready.catch(readyReason => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n throw readyReason;\n });\n };\n });\n\n messageHandler.on(\"ReaderHeadersReady\", data => {\n const headersCapability = new PromiseCapability();\n const fullReader = this._fullReader;\n fullReader.headersReady.then(() => {\n // If stream or range are disabled, it's our only way to report\n // loading progress.\n if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) {\n if (this._lastProgress) {\n loadingTask.onProgress?.(this._lastProgress);\n }\n fullReader.onProgress = evt => {\n loadingTask.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n };\n }\n\n headersCapability.resolve({\n isStreamingSupported: fullReader.isStreamingSupported,\n isRangeSupported: fullReader.isRangeSupported,\n contentLength: fullReader.contentLength,\n });\n }, headersCapability.reject);\n\n return headersCapability.promise;\n });\n\n messageHandler.on(\"GetRangeReader\", (data, sink) => {\n assert(\n this._networkStream,\n \"GetRangeReader - no `IPDFStream` instance available.\"\n );\n const rangeReader = this._networkStream.getRangeReader(\n data.begin,\n data.end\n );\n\n // When streaming is enabled, it's possible that the data requested here\n // has already been fetched via the `_fullRequestReader` implementation.\n // However, given that the PDF data is loaded asynchronously on the\n // main-thread and then sent via `postMessage` to the worker-thread,\n // it may not have been available during parsing (hence the attempt to\n // use range requests here).\n //\n // To avoid wasting time and resources here, we'll thus *not* dispatch\n // range requests if the data was already loaded but has not been sent to\n // the worker-thread yet (which will happen via the `_fullRequestReader`).\n if (!rangeReader) {\n sink.close();\n return;\n }\n\n sink.onPull = () => {\n rangeReader\n .read()\n .then(function ({ value, done }) {\n if (done) {\n sink.close();\n return;\n }\n assert(\n value instanceof ArrayBuffer,\n \"GetRangeReader - expected an ArrayBuffer.\"\n );\n sink.enqueue(new Uint8Array(value), 1, [value]);\n })\n .catch(reason => {\n sink.error(reason);\n });\n };\n\n sink.onCancel = reason => {\n rangeReader.cancel(reason);\n\n sink.ready.catch(readyReason => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n throw readyReason;\n });\n };\n });\n\n messageHandler.on(\"GetDoc\", ({ pdfInfo }) => {\n this._numPages = pdfInfo.numPages;\n this._htmlForXfa = pdfInfo.htmlForXfa;\n delete pdfInfo.htmlForXfa;\n loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this));\n });\n\n messageHandler.on(\"DocException\", function (ex) {\n let reason;\n switch (ex.name) {\n case \"PasswordException\":\n reason = new PasswordException(ex.message, ex.code);\n break;\n case \"InvalidPDFException\":\n reason = new InvalidPDFException(ex.message);\n break;\n case \"MissingPDFException\":\n reason = new MissingPDFException(ex.message);\n break;\n case \"UnexpectedResponseException\":\n reason = new UnexpectedResponseException(ex.message, ex.status);\n break;\n case \"UnknownErrorException\":\n reason = new UnknownErrorException(ex.message, ex.details);\n break;\n default:\n unreachable(\"DocException - expected a valid Error.\");\n }\n loadingTask._capability.reject(reason);\n });\n\n messageHandler.on(\"PasswordRequest\", exception => {\n this.#passwordCapability = new PromiseCapability();\n\n if (loadingTask.onPassword) {\n const updatePassword = password => {\n if (password instanceof Error) {\n this.#passwordCapability.reject(password);\n } else {\n this.#passwordCapability.resolve({ password });\n }\n };\n try {\n loadingTask.onPassword(updatePassword, exception.code);\n } catch (ex) {\n this.#passwordCapability.reject(ex);\n }\n } else {\n this.#passwordCapability.reject(\n new PasswordException(exception.message, exception.code)\n );\n }\n return this.#passwordCapability.promise;\n });\n\n messageHandler.on(\"DataLoaded\", data => {\n // For consistency: Ensure that progress is always reported when the\n // entire PDF file has been loaded, regardless of how it was fetched.\n loadingTask.onProgress?.({\n loaded: data.length,\n total: data.length,\n });\n\n this.downloadInfoCapability.resolve(data);\n });\n\n messageHandler.on(\"StartRenderPage\", data => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n\n const page = this.#pageCache.get(data.pageIndex);\n page._startRenderPage(data.transparency, data.cacheKey);\n });\n\n messageHandler.on(\"commonobj\", ([id, type, exportedData]) => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n\n if (this.commonObjs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Font\":\n const params = this._params;\n\n if (\"error\" in exportedData) {\n const exportedError = exportedData.error;\n warn(`Error during font loading: ${exportedError}`);\n this.commonObjs.resolve(id, exportedError);\n break;\n }\n\n const inspectFont =\n params.pdfBug && globalThis.FontInspector?.enabled\n ? (font, url) => globalThis.FontInspector.fontAdded(font, url)\n : null;\n const font = new FontFaceObject(exportedData, {\n isEvalSupported: params.isEvalSupported,\n disableFontFace: params.disableFontFace,\n ignoreErrors: params.ignoreErrors,\n inspectFont,\n });\n\n this.fontLoader\n .bind(font)\n .catch(reason => {\n return messageHandler.sendWithPromise(\"FontFallback\", { id });\n })\n .finally(() => {\n if (!params.fontExtraProperties && font.data) {\n // Immediately release the `font.data` property once the font\n // has been attached to the DOM, since it's no longer needed,\n // rather than waiting for a `PDFDocumentProxy.cleanup` call.\n // Since `font.data` could be very large, e.g. in some cases\n // multiple megabytes, this will help reduce memory usage.\n font.data = null;\n }\n this.commonObjs.resolve(id, font);\n });\n break;\n case \"FontPath\":\n case \"Image\":\n case \"Pattern\":\n this.commonObjs.resolve(id, exportedData);\n break;\n default:\n throw new Error(`Got unknown common object type ${type}`);\n }\n });\n\n messageHandler.on(\"obj\", ([id, pageIndex, type, imageData]) => {\n if (this.destroyed) {\n // Ignore any pending requests if the worker was terminated.\n return;\n }\n\n const pageProxy = this.#pageCache.get(pageIndex);\n if (pageProxy.objs.has(id)) {\n return;\n }\n // Don't store data *after* cleanup has successfully run, see bug 1854145.\n if (pageProxy._intentStates.size === 0) {\n imageData?.bitmap?.close(); // Release any `ImageBitmap` data.\n return;\n }\n\n switch (type) {\n case \"Image\":\n pageProxy.objs.resolve(id, imageData);\n\n // Heuristic that will allow us not to store large data.\n if (imageData) {\n let length;\n if (imageData.bitmap) {\n const { width, height } = imageData;\n length = width * height * 4;\n } else {\n length = imageData.data?.length || 0;\n }\n\n if (length > MAX_IMAGE_SIZE_TO_CACHE) {\n pageProxy._maybeCleanupAfterRender = true;\n }\n }\n break;\n case \"Pattern\":\n pageProxy.objs.resolve(id, imageData);\n break;\n default:\n throw new Error(`Got unknown object type ${type}`);\n }\n });\n\n messageHandler.on(\"DocProgress\", data => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n loadingTask.onProgress?.({\n loaded: data.loaded,\n total: data.total,\n });\n });\n\n messageHandler.on(\"FetchBuiltInCMap\", data => {\n if (this.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n if (!this.cMapReaderFactory) {\n return Promise.reject(\n new Error(\n \"CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.\"\n )\n );\n }\n return this.cMapReaderFactory.fetch(data);\n });\n\n messageHandler.on(\"FetchStandardFontData\", data => {\n if (this.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n if (!this.standardFontDataFactory) {\n return Promise.reject(\n new Error(\n \"StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.\"\n )\n );\n }\n return this.standardFontDataFactory.fetch(data);\n });\n }\n\n getData() {\n return this.messageHandler.sendWithPromise(\"GetData\", null);\n }\n\n saveDocument() {\n if (this.annotationStorage.size <= 0) {\n warn(\n \"saveDocument called while `annotationStorage` is empty, \" +\n \"please use the getData-method instead.\"\n );\n }\n const { map, transfer } = this.annotationStorage.serializable;\n\n return this.messageHandler\n .sendWithPromise(\n \"SaveDocument\",\n {\n isPureXfa: !!this._htmlForXfa,\n numPages: this._numPages,\n annotationStorage: map,\n filename: this._fullReader?.filename ?? null,\n },\n transfer\n )\n .finally(() => {\n this.annotationStorage.resetModified();\n });\n }\n\n getPage(pageNumber) {\n if (\n !Number.isInteger(pageNumber) ||\n pageNumber <= 0 ||\n pageNumber > this._numPages\n ) {\n return Promise.reject(new Error(\"Invalid page request.\"));\n }\n\n const pageIndex = pageNumber - 1,\n cachedPromise = this.#pagePromises.get(pageIndex);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler\n .sendWithPromise(\"GetPage\", {\n pageIndex,\n })\n .then(pageInfo => {\n if (this.destroyed) {\n throw new Error(\"Transport destroyed\");\n }\n const page = new PDFPageProxy(\n pageIndex,\n pageInfo,\n this,\n this._params.pdfBug\n );\n this.#pageCache.set(pageIndex, page);\n return page;\n });\n this.#pagePromises.set(pageIndex, promise);\n return promise;\n }\n\n getPageIndex(ref) {\n if (\n typeof ref !== \"object\" ||\n ref === null ||\n !Number.isInteger(ref.num) ||\n ref.num < 0 ||\n !Number.isInteger(ref.gen) ||\n ref.gen < 0\n ) {\n return Promise.reject(new Error(\"Invalid pageIndex request.\"));\n }\n return this.messageHandler.sendWithPromise(\"GetPageIndex\", {\n num: ref.num,\n gen: ref.gen,\n });\n }\n\n getAnnotations(pageIndex, intent) {\n return this.messageHandler.sendWithPromise(\"GetAnnotations\", {\n pageIndex,\n intent,\n });\n }\n\n getFieldObjects() {\n return this.#cacheSimpleMethod(\"GetFieldObjects\");\n }\n\n hasJSActions() {\n return this.#cacheSimpleMethod(\"HasJSActions\");\n }\n\n getCalculationOrderIds() {\n return this.messageHandler.sendWithPromise(\"GetCalculationOrderIds\", null);\n }\n\n getDestinations() {\n return this.messageHandler.sendWithPromise(\"GetDestinations\", null);\n }\n\n getDestination(id) {\n if (typeof id !== \"string\") {\n return Promise.reject(new Error(\"Invalid destination request.\"));\n }\n return this.messageHandler.sendWithPromise(\"GetDestination\", {\n id,\n });\n }\n\n getPageLabels() {\n return this.messageHandler.sendWithPromise(\"GetPageLabels\", null);\n }\n\n getPageLayout() {\n return this.messageHandler.sendWithPromise(\"GetPageLayout\", null);\n }\n\n getPageMode() {\n return this.messageHandler.sendWithPromise(\"GetPageMode\", null);\n }\n\n getViewerPreferences() {\n return this.messageHandler.sendWithPromise(\"GetViewerPreferences\", null);\n }\n\n getOpenAction() {\n return this.messageHandler.sendWithPromise(\"GetOpenAction\", null);\n }\n\n getAttachments() {\n return this.messageHandler.sendWithPromise(\"GetAttachments\", null);\n }\n\n getDocJSActions() {\n return this.#cacheSimpleMethod(\"GetDocJSActions\");\n }\n\n getPageJSActions(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetPageJSActions\", {\n pageIndex,\n });\n }\n\n getStructTree(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetStructTree\", {\n pageIndex,\n });\n }\n\n getOutline() {\n return this.messageHandler.sendWithPromise(\"GetOutline\", null);\n }\n\n getOptionalContentConfig() {\n return this.messageHandler\n .sendWithPromise(\"GetOptionalContentConfig\", null)\n .then(results => {\n return new OptionalContentConfig(results);\n });\n }\n\n getPermissions() {\n return this.messageHandler.sendWithPromise(\"GetPermissions\", null);\n }\n\n getMetadata() {\n const name = \"GetMetadata\",\n cachedPromise = this.#methodPromises.get(name);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler\n .sendWithPromise(name, null)\n .then(results => {\n return {\n info: results[0],\n metadata: results[1] ? new Metadata(results[1]) : null,\n contentDispositionFilename: this._fullReader?.filename ?? null,\n contentLength: this._fullReader?.contentLength ?? null,\n };\n });\n this.#methodPromises.set(name, promise);\n return promise;\n }\n\n getMarkInfo() {\n return this.messageHandler.sendWithPromise(\"GetMarkInfo\", null);\n }\n\n async startCleanup(keepLoadedFonts = false) {\n if (this.destroyed) {\n return; // No need to manually clean-up when destruction has started.\n }\n await this.messageHandler.sendWithPromise(\"Cleanup\", null);\n\n for (const page of this.#pageCache.values()) {\n const cleanupSuccessful = page.cleanup();\n\n if (!cleanupSuccessful) {\n throw new Error(\n `startCleanup: Page ${page.pageNumber} is currently rendering.`\n );\n }\n }\n this.commonObjs.clear();\n if (!keepLoadedFonts) {\n this.fontLoader.clear();\n }\n this.#methodPromises.clear();\n this.filterFactory.destroy(/* keepHCM = */ true);\n }\n\n get loadingParams() {\n const { disableAutoFetch, enableXfa } = this._params;\n return shadow(this, \"loadingParams\", {\n disableAutoFetch,\n enableXfa,\n });\n }\n}\n\n/**\n * A PDF document and page is built of many objects. E.g. there are objects for\n * fonts, images, rendering code, etc. These objects may get processed inside of\n * a worker. This class implements some basic methods to manage these objects.\n */\nclass PDFObjects {\n #objs = Object.create(null);\n\n /**\n * Ensures there is an object defined for `objId`.\n *\n * @param {string} objId\n * @returns {Object}\n */\n #ensureObj(objId) {\n return (this.#objs[objId] ||= {\n capability: new PromiseCapability(),\n data: null,\n });\n }\n\n /**\n * If called *without* callback, this returns the data of `objId` but the\n * object needs to be resolved. If it isn't, this method throws.\n *\n * If called *with* a callback, the callback is called with the data of the\n * object once the object is resolved. That means, if you call this method\n * and the object is already resolved, the callback gets called right away.\n *\n * @param {string} objId\n * @param {function} [callback]\n * @returns {any}\n */\n get(objId, callback = null) {\n // If there is a callback, then the get can be async and the object is\n // not required to be resolved right now.\n if (callback) {\n const obj = this.#ensureObj(objId);\n obj.capability.promise.then(() => callback(obj.data));\n return null;\n }\n // If there isn't a callback, the user expects to get the resolved data\n // directly.\n const obj = this.#objs[objId];\n // If there isn't an object yet or the object isn't resolved, then the\n // data isn't ready yet!\n if (!obj?.capability.settled) {\n throw new Error(`Requesting object that isn't resolved yet ${objId}.`);\n }\n return obj.data;\n }\n\n /**\n * @param {string} objId\n * @returns {boolean}\n */\n has(objId) {\n const obj = this.#objs[objId];\n return obj?.capability.settled || false;\n }\n\n /**\n * Resolves the object `objId` with optional `data`.\n *\n * @param {string} objId\n * @param {any} [data]\n */\n resolve(objId, data = null) {\n const obj = this.#ensureObj(objId);\n obj.data = data;\n obj.capability.resolve();\n }\n\n clear() {\n for (const objId in this.#objs) {\n const { data } = this.#objs[objId];\n data?.bitmap?.close(); // Release any `ImageBitmap` data.\n }\n this.#objs = Object.create(null);\n }\n}\n\n/**\n * Allows controlling of the rendering tasks.\n */\nclass RenderTask {\n #internalRenderTask = null;\n\n constructor(internalRenderTask) {\n this.#internalRenderTask = internalRenderTask;\n\n /**\n * Callback for incremental rendering -- a function that will be called\n * each time the rendering is paused. To continue rendering call the\n * function that is the first argument to the callback.\n * @type {function}\n */\n this.onContinue = null;\n }\n\n /**\n * Promise for rendering task completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this.#internalRenderTask.capability.promise;\n }\n\n /**\n * Cancels the rendering task. If the task is currently rendering it will\n * not be cancelled until graphics pauses with a timeout. The promise that\n * this object extends will be rejected when cancelled.\n *\n * @param {number} [extraDelay]\n */\n cancel(extraDelay = 0) {\n this.#internalRenderTask.cancel(/* error = */ null, extraDelay);\n }\n\n /**\n * Whether form fields are rendered separately from the main operatorList.\n * @type {boolean}\n */\n get separateAnnots() {\n const { separateAnnots } = this.#internalRenderTask.operatorList;\n if (!separateAnnots) {\n return false;\n }\n const { annotationCanvasMap } = this.#internalRenderTask;\n return (\n separateAnnots.form ||\n (separateAnnots.canvas && annotationCanvasMap?.size > 0)\n );\n }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass InternalRenderTask {\n static #canvasInUse = new WeakSet();\n\n constructor({\n callback,\n params,\n objs,\n commonObjs,\n annotationCanvasMap,\n operatorList,\n pageIndex,\n canvasFactory,\n filterFactory,\n useRequestAnimationFrame = false,\n pdfBug = false,\n pageColors = null,\n }) {\n this.callback = callback;\n this.params = params;\n this.objs = objs;\n this.commonObjs = commonObjs;\n this.annotationCanvasMap = annotationCanvasMap;\n this.operatorListIdx = null;\n this.operatorList = operatorList;\n this._pageIndex = pageIndex;\n this.canvasFactory = canvasFactory;\n this.filterFactory = filterFactory;\n this._pdfBug = pdfBug;\n this.pageColors = pageColors;\n\n this.running = false;\n this.graphicsReadyCallback = null;\n this.graphicsReady = false;\n this._useRequestAnimationFrame =\n useRequestAnimationFrame === true && typeof window !== \"undefined\";\n this.cancelled = false;\n this.capability = new PromiseCapability();\n this.task = new RenderTask(this);\n // caching this-bound methods\n this._cancelBound = this.cancel.bind(this);\n this._continueBound = this._continue.bind(this);\n this._scheduleNextBound = this._scheduleNext.bind(this);\n this._nextBound = this._next.bind(this);\n this._canvas = params.canvasContext.canvas;\n }\n\n get completed() {\n return this.capability.promise.catch(function () {\n // Ignoring errors, since we only want to know when rendering is\n // no longer pending.\n });\n }\n\n initializeGraphics({ transparency = false, optionalContentConfig }) {\n if (this.cancelled) {\n return;\n }\n if (this._canvas) {\n if (InternalRenderTask.#canvasInUse.has(this._canvas)) {\n throw new Error(\n \"Cannot use the same canvas during multiple render() operations. \" +\n \"Use different canvas or ensure previous operations were \" +\n \"cancelled or completed.\"\n );\n }\n InternalRenderTask.#canvasInUse.add(this._canvas);\n }\n\n if (this._pdfBug && globalThis.StepperManager?.enabled) {\n this.stepper = globalThis.StepperManager.create(this._pageIndex);\n this.stepper.init(this.operatorList);\n this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint();\n }\n const { canvasContext, viewport, transform, background } = this.params;\n\n this.gfx = new CanvasGraphics(\n canvasContext,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n { optionalContentConfig },\n this.annotationCanvasMap,\n this.pageColors\n );\n this.gfx.beginDrawing({\n transform,\n viewport,\n transparency,\n background,\n });\n this.operatorListIdx = 0;\n this.graphicsReady = true;\n this.graphicsReadyCallback?.();\n }\n\n cancel(error = null, extraDelay = 0) {\n this.running = false;\n this.cancelled = true;\n this.gfx?.endDrawing();\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n\n this.callback(\n error ||\n new RenderingCancelledException(\n `Rendering cancelled, page ${this._pageIndex + 1}`,\n extraDelay\n )\n );\n }\n\n operatorListChanged() {\n if (!this.graphicsReady) {\n this.graphicsReadyCallback ||= this._continueBound;\n return;\n }\n this.stepper?.updateOperatorList(this.operatorList);\n\n if (this.running) {\n return;\n }\n this._continue();\n }\n\n _continue() {\n this.running = true;\n if (this.cancelled) {\n return;\n }\n if (this.task.onContinue) {\n this.task.onContinue(this._scheduleNextBound);\n } else {\n this._scheduleNext();\n }\n }\n\n _scheduleNext() {\n if (this._useRequestAnimationFrame) {\n window.requestAnimationFrame(() => {\n this._nextBound().catch(this._cancelBound);\n });\n } else {\n Promise.resolve().then(this._nextBound).catch(this._cancelBound);\n }\n }\n\n async _next() {\n if (this.cancelled) {\n return;\n }\n this.operatorListIdx = this.gfx.executeOperatorList(\n this.operatorList,\n this.operatorListIdx,\n this._continueBound,\n this.stepper\n );\n if (this.operatorListIdx === this.operatorList.argsArray.length) {\n this.running = false;\n if (this.operatorList.lastChunk) {\n this.gfx.endDrawing();\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n\n this.callback();\n }\n }\n }\n}\n\n/** @type {string} */\nconst version =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : null;\n/** @type {string} */\nconst build =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : null;\n\nexport {\n build,\n DefaultCanvasFactory,\n DefaultCMapReaderFactory,\n DefaultFilterFactory,\n DefaultStandardFontDataFactory,\n getDocument,\n LoopbackPort,\n PDFDataRangeTransport,\n PDFDocumentLoadingTask,\n PDFDocumentProxy,\n PDFPageProxy,\n PDFWorker,\n PDFWorkerUtil,\n RenderTask,\n version,\n};\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\nimport { CMapCompressionType, unreachable } from \"../shared/util.js\";\n\nclass BaseFilterFactory {\n constructor() {\n if (this.constructor === BaseFilterFactory) {\n unreachable(\"Cannot initialize BaseFilterFactory.\");\n }\n }\n\n addFilter(maps) {\n return \"none\";\n }\n\n addHCMFilter(fgColor, bgColor) {\n return \"none\";\n }\n\n addHighlightHCMFilter(fgColor, bgColor, newFgColor, newBgColor) {\n return \"none\";\n }\n\n destroy(keepHCM = false) {}\n}\n\nclass BaseCanvasFactory {\n constructor() {\n if (this.constructor === BaseCanvasFactory) {\n unreachable(\"Cannot initialize BaseCanvasFactory.\");\n }\n }\n\n create(width, height) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n const canvas = this._createCanvas(width, height);\n return {\n canvas,\n context: canvas.getContext(\"2d\"),\n };\n }\n\n reset(canvasAndContext, width, height) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n canvasAndContext.canvas.width = width;\n canvasAndContext.canvas.height = height;\n }\n\n destroy(canvasAndContext) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n // Zeroing the width and height cause Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n canvasAndContext.canvas.width = 0;\n canvasAndContext.canvas.height = 0;\n canvasAndContext.canvas = null;\n canvasAndContext.context = null;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n unreachable(\"Abstract method `_createCanvas` called.\");\n }\n}\n\nclass BaseCMapReaderFactory {\n constructor({ baseUrl = null, isCompressed = true }) {\n if (this.constructor === BaseCMapReaderFactory) {\n unreachable(\"Cannot initialize BaseCMapReaderFactory.\");\n }\n this.baseUrl = baseUrl;\n this.isCompressed = isCompressed;\n }\n\n async fetch({ name }) {\n if (!this.baseUrl) {\n throw new Error(\n 'The CMap \"baseUrl\" parameter must be specified, ensure that ' +\n 'the \"cMapUrl\" and \"cMapPacked\" API parameters are provided.'\n );\n }\n if (!name) {\n throw new Error(\"CMap name must be specified.\");\n }\n const url = this.baseUrl + name + (this.isCompressed ? \".bcmap\" : \"\");\n const compressionType = this.isCompressed\n ? CMapCompressionType.BINARY\n : CMapCompressionType.NONE;\n\n return this._fetchData(url, compressionType).catch(reason => {\n throw new Error(\n `Unable to load ${this.isCompressed ? \"binary \" : \"\"}CMap at: ${url}`\n );\n });\n }\n\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n unreachable(\"Abstract method `_fetchData` called.\");\n }\n}\n\nclass BaseStandardFontDataFactory {\n constructor({ baseUrl = null }) {\n if (this.constructor === BaseStandardFontDataFactory) {\n unreachable(\"Cannot initialize BaseStandardFontDataFactory.\");\n }\n this.baseUrl = baseUrl;\n }\n\n async fetch({ filename }) {\n if (!this.baseUrl) {\n throw new Error(\n 'The standard font \"baseUrl\" parameter must be specified, ensure that ' +\n 'the \"standardFontDataUrl\" API parameter is provided.'\n );\n }\n if (!filename) {\n throw new Error(\"Font filename must be specified.\");\n }\n const url = `${this.baseUrl}${filename}`;\n\n return this._fetchData(url).catch(reason => {\n throw new Error(`Unable to load font data at: ${url}`);\n });\n }\n\n /**\n * @ignore\n */\n _fetchData(url) {\n unreachable(\"Abstract method `_fetchData` called.\");\n }\n}\n\nclass BaseSVGFactory {\n constructor() {\n if (this.constructor === BaseSVGFactory) {\n unreachable(\"Cannot initialize BaseSVGFactory.\");\n }\n }\n\n create(width, height, skipDimensions = false) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid SVG dimensions\");\n }\n const svg = this._createSVG(\"svg:svg\");\n svg.setAttribute(\"version\", \"1.1\");\n\n if (!skipDimensions) {\n svg.setAttribute(\"width\", `${width}px`);\n svg.setAttribute(\"height\", `${height}px`);\n }\n\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n svg.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n\n return svg;\n }\n\n createElement(type) {\n if (typeof type !== \"string\") {\n throw new Error(\"Invalid SVG element type\");\n }\n return this._createSVG(type);\n }\n\n /**\n * @ignore\n */\n _createSVG(type) {\n unreachable(\"Abstract method `_createSVG` called.\");\n }\n}\n\nexport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n BaseSVGFactory,\n};\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\nimport { FormatError, info, unreachable, Util } from \"../shared/util.js\";\nimport { getCurrentTransform } from \"./display_utils.js\";\n\nconst PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\",\n};\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox) {\n return;\n }\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n const region = new Path2D();\n region.rect(bbox[0], bbox[1], width, height);\n ctx.clip(region);\n}\n\nclass BaseShadingPattern {\n constructor() {\n if (this.constructor === BaseShadingPattern) {\n unreachable(\"Cannot initialize BaseShadingPattern.\");\n }\n }\n\n getPattern() {\n unreachable(\"Abstract method `getPattern` called.\");\n }\n}\n\nclass RadialAxialShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._type = IR[1];\n this._bbox = IR[2];\n this._colorStops = IR[3];\n this._p0 = IR[4];\n this._p1 = IR[5];\n this._r0 = IR[6];\n this._r1 = IR[7];\n this.matrix = null;\n }\n\n _createGradient(ctx) {\n let grad;\n if (this._type === \"axial\") {\n grad = ctx.createLinearGradient(\n this._p0[0],\n this._p0[1],\n this._p1[0],\n this._p1[1]\n );\n } else if (this._type === \"radial\") {\n grad = ctx.createRadialGradient(\n this._p0[0],\n this._p0[1],\n this._r0,\n this._p1[0],\n this._p1[1],\n this._r1\n );\n }\n\n for (const colorStop of this._colorStops) {\n grad.addColorStop(colorStop[0], colorStop[1]);\n }\n return grad;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n let pattern;\n if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n const ownerBBox = owner.current.getClippedPathBoundingBox(\n pathType,\n getCurrentTransform(ctx)\n ) || [0, 0, 0, 0];\n // Create a canvas that is only as big as the current path. This doesn't\n // allow us to cache the pattern, but it generally creates much smaller\n // canvases and saves memory use. See bug 1722807 for an example.\n const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;\n const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n width,\n height,\n true\n );\n\n const tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.beginPath();\n tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n // Non shading fill patterns are positioned relative to the base transform\n // (usually the page's initial transform), but we may have created a\n // smaller canvas based on the path, so we must account for the shift.\n tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]);\n inverse = Util.transform(inverse, [\n 1,\n 0,\n 0,\n 1,\n ownerBBox[0],\n ownerBBox[1],\n ]);\n\n tmpCtx.transform(...owner.baseTransform);\n if (this.matrix) {\n tmpCtx.transform(...this.matrix);\n }\n applyBoundingBox(tmpCtx, this._bbox);\n\n tmpCtx.fillStyle = this._createGradient(tmpCtx);\n tmpCtx.fill();\n\n pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n const domMatrix = new DOMMatrix(inverse);\n pattern.setTransform(domMatrix);\n } else {\n // Shading fills are applied relative to the current matrix which is also\n // how canvas gradients work, so there's no need to do anything special\n // here.\n applyBoundingBox(ctx, this._bbox);\n pattern = this._createGradient(ctx);\n }\n return pattern;\n }\n}\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n // Very basic Gouraud-shaded triangle rasterization algorithm.\n const coords = context.coords,\n colors = context.colors;\n const bytes = data.data,\n rowSize = data.width * 4;\n let tmp;\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n if (coords[p2 + 1] > coords[p3 + 1]) {\n tmp = p2;\n p2 = p3;\n p3 = tmp;\n tmp = c2;\n c2 = c3;\n c3 = tmp;\n }\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n const x1 = (coords[p1] + context.offsetX) * context.scaleX;\n const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;\n const x2 = (coords[p2] + context.offsetX) * context.scaleX;\n const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;\n const x3 = (coords[p3] + context.offsetX) * context.scaleX;\n const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;\n if (y1 >= y3) {\n return;\n }\n const c1r = colors[c1],\n c1g = colors[c1 + 1],\n c1b = colors[c1 + 2];\n const c2r = colors[c2],\n c2g = colors[c2 + 1],\n c2b = colors[c2 + 2];\n const c3r = colors[c3],\n c3g = colors[c3 + 1],\n c3b = colors[c3 + 2];\n\n const minY = Math.round(y1),\n maxY = Math.round(y3);\n let xa, car, cag, cab;\n let xb, cbr, cbg, cbb;\n for (let y = minY; y <= maxY; y++) {\n if (y < y2) {\n const k = y < y1 ? 0 : (y1 - y) / (y1 - y2);\n xa = x1 - (x1 - x2) * k;\n car = c1r - (c1r - c2r) * k;\n cag = c1g - (c1g - c2g) * k;\n cab = c1b - (c1b - c2b) * k;\n } else {\n let k;\n if (y > y3) {\n k = 1;\n } else if (y2 === y3) {\n k = 0;\n } else {\n k = (y2 - y) / (y2 - y3);\n }\n xa = x2 - (x2 - x3) * k;\n car = c2r - (c2r - c3r) * k;\n cag = c2g - (c2g - c3g) * k;\n cab = c2b - (c2b - c3b) * k;\n }\n\n let k;\n if (y < y1) {\n k = 0;\n } else if (y > y3) {\n k = 1;\n } else {\n k = (y1 - y) / (y1 - y3);\n }\n xb = x1 - (x1 - x3) * k;\n cbr = c1r - (c1r - c3r) * k;\n cbg = c1g - (c1g - c3g) * k;\n cbb = c1b - (c1b - c3b) * k;\n const x1_ = Math.round(Math.min(xa, xb));\n const x2_ = Math.round(Math.max(xa, xb));\n let j = rowSize * y + x1_ * 4;\n for (let x = x1_; x <= x2_; x++) {\n k = (xa - x) / (xa - xb);\n if (k < 0) {\n k = 0;\n } else if (k > 1) {\n k = 1;\n }\n bytes[j++] = (car - (car - cbr) * k) | 0;\n bytes[j++] = (cag - (cag - cbg) * k) | 0;\n bytes[j++] = (cab - (cab - cbb) * k) | 0;\n bytes[j++] = 255;\n }\n }\n}\n\nfunction drawFigure(data, figure, context) {\n const ps = figure.coords;\n const cs = figure.colors;\n let i, ii;\n switch (figure.type) {\n case \"lattice\":\n const verticesPerRow = figure.verticesPerRow;\n const rows = Math.floor(ps.length / verticesPerRow) - 1;\n const cols = verticesPerRow - 1;\n for (i = 0; i < rows; i++) {\n let q = i * verticesPerRow;\n for (let j = 0; j < cols; j++, q++) {\n drawTriangle(\n data,\n context,\n ps[q],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n drawTriangle(\n data,\n context,\n ps[q + verticesPerRow + 1],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q + verticesPerRow + 1],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n }\n }\n break;\n case \"triangles\":\n for (i = 0, ii = ps.length; i < ii; i += 3) {\n drawTriangle(\n data,\n context,\n ps[i],\n ps[i + 1],\n ps[i + 2],\n cs[i],\n cs[i + 1],\n cs[i + 2]\n );\n }\n break;\n default:\n throw new Error(\"illegal figure\");\n }\n}\n\nclass MeshShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._coords = IR[2];\n this._colors = IR[3];\n this._figures = IR[4];\n this._bounds = IR[5];\n this._bbox = IR[7];\n this._background = IR[8];\n this.matrix = null;\n }\n\n _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) {\n // we will increase scale on some weird factor to let antialiasing take\n // care of \"rough\" edges\n const EXPECTED_SCALE = 1.1;\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n const MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough\n // We need to keep transparent border around our pattern for fill():\n // createPattern with 'no-repeat' will bleed edges across entire area.\n const BORDER_SIZE = 2;\n\n const offsetX = Math.floor(this._bounds[0]);\n const offsetY = Math.floor(this._bounds[1]);\n const boundsWidth = Math.ceil(this._bounds[2]) - offsetX;\n const boundsHeight = Math.ceil(this._bounds[3]) - offsetY;\n\n const width = Math.min(\n Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n );\n const height = Math.min(\n Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n );\n const scaleX = boundsWidth / width;\n const scaleY = boundsHeight / height;\n\n const context = {\n coords: this._coords,\n colors: this._colors,\n offsetX: -offsetX,\n offsetY: -offsetY,\n scaleX: 1 / scaleX,\n scaleY: 1 / scaleY,\n };\n\n const paddedWidth = width + BORDER_SIZE * 2;\n const paddedHeight = height + BORDER_SIZE * 2;\n\n const tmpCanvas = cachedCanvases.getCanvas(\n \"mesh\",\n paddedWidth,\n paddedHeight,\n false\n );\n const tmpCtx = tmpCanvas.context;\n\n const data = tmpCtx.createImageData(width, height);\n if (backgroundColor) {\n const bytes = data.data;\n for (let i = 0, ii = bytes.length; i < ii; i += 4) {\n bytes[i] = backgroundColor[0];\n bytes[i + 1] = backgroundColor[1];\n bytes[i + 2] = backgroundColor[2];\n bytes[i + 3] = 255;\n }\n }\n for (const figure of this._figures) {\n drawFigure(data, figure, context);\n }\n tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE);\n const canvas = tmpCanvas.canvas;\n\n return {\n canvas,\n offsetX: offsetX - BORDER_SIZE * scaleX,\n offsetY: offsetY - BORDER_SIZE * scaleY,\n scaleX,\n scaleY,\n };\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n applyBoundingBox(ctx, this._bbox);\n let scale;\n if (pathType === PathType.SHADING) {\n scale = Util.singularValueDecompose2dScale(getCurrentTransform(ctx));\n } else {\n // Obtain scale from matrix and current transformation matrix.\n scale = Util.singularValueDecompose2dScale(owner.baseTransform);\n if (this.matrix) {\n const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]];\n }\n }\n\n // Rasterizing on the main thread since sending/queue large canvases\n // might cause OOM.\n const temporaryPatternCanvas = this._createMeshCanvas(\n scale,\n pathType === PathType.SHADING ? null : this._background,\n owner.cachedCanvases\n );\n\n if (pathType !== PathType.SHADING) {\n ctx.setTransform(...owner.baseTransform);\n if (this.matrix) {\n ctx.transform(...this.matrix);\n }\n }\n\n ctx.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n\n return ctx.createPattern(temporaryPatternCanvas.canvas, \"no-repeat\");\n }\n}\n\nclass DummyShadingPattern extends BaseShadingPattern {\n getPattern() {\n return \"hotpink\";\n }\n}\n\nfunction getShadingPattern(IR) {\n switch (IR[0]) {\n case \"RadialAxial\":\n return new RadialAxialShadingPattern(IR);\n case \"Mesh\":\n return new MeshShadingPattern(IR);\n case \"Dummy\":\n return new DummyShadingPattern();\n }\n throw new Error(`Unknown IR type: ${IR[0]}`);\n}\n\nconst PaintType = {\n COLORED: 1,\n UNCOLORED: 2,\n};\n\nclass TilingPattern {\n // 10in @ 300dpi shall be enough.\n static MAX_PATTERN_SIZE = 3000;\n\n constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) {\n this.operatorList = IR[2];\n this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];\n this.bbox = IR[4];\n this.xstep = IR[5];\n this.ystep = IR[6];\n this.paintType = IR[7];\n this.tilingType = IR[8];\n this.color = color;\n this.ctx = ctx;\n this.canvasGraphicsFactory = canvasGraphicsFactory;\n this.baseTransform = baseTransform;\n }\n\n createPatternCanvas(owner) {\n const operatorList = this.operatorList;\n const bbox = this.bbox;\n const xstep = this.xstep;\n const ystep = this.ystep;\n const paintType = this.paintType;\n const tilingType = this.tilingType;\n const color = this.color;\n const canvasGraphicsFactory = this.canvasGraphicsFactory;\n\n info(\"TilingType: \" + tilingType);\n\n // A tiling pattern as defined by PDF spec 8.7.2 is a cell whose size is\n // described by bbox, and may repeat regularly by shifting the cell by\n // xstep and ystep.\n // Because the HTML5 canvas API does not support pattern repetition with\n // gaps in between, we use the xstep/ystep instead of the bbox's size.\n //\n // This has the following consequences (similarly for ystep):\n //\n // - If xstep is the same as bbox, then there is no observable difference.\n //\n // - If xstep is larger than bbox, then the pattern canvas is partially\n // empty: the area bounded by bbox is painted, the outside area is void.\n //\n // - If xstep is smaller than bbox, then the pixels between xstep and the\n // bbox boundary will be missing. This is INCORRECT behavior.\n // \"Figures on adjacent tiles should not overlap\" (PDF spec 8.7.3.1),\n // but overlapping cells without common pixels are still valid.\n // TODO: Fix the implementation, to allow this scenario to be painted\n // correctly.\n\n const x0 = bbox[0],\n y0 = bbox[1],\n x1 = bbox[2],\n y1 = bbox[3];\n\n // Obtain scale from matrix and current transformation matrix.\n const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n const curMatrixScale = Util.singularValueDecompose2dScale(\n this.baseTransform\n );\n const combinedScale = [\n matrixScale[0] * curMatrixScale[0],\n matrixScale[1] * curMatrixScale[1],\n ];\n\n // Use width and height values that are as close as possible to the end\n // result when the pattern is used. Too low value makes the pattern look\n // blurry. Too large value makes it look too crispy.\n const dimx = this.getSizeAndScale(\n xstep,\n this.ctx.canvas.width,\n combinedScale[0]\n );\n const dimy = this.getSizeAndScale(\n ystep,\n this.ctx.canvas.height,\n combinedScale[1]\n );\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n dimx.size,\n dimy.size,\n true\n );\n const tmpCtx = tmpCanvas.context;\n const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);\n graphics.groupLevel = owner.groupLevel;\n\n this.setFillAndStrokeStyleToContext(graphics, paintType, color);\n\n let adjustedX0 = x0;\n let adjustedY0 = y0;\n let adjustedX1 = x1;\n let adjustedY1 = y1;\n // Some bounding boxes have negative x0/y0 coordinates which will cause the\n // some of the drawing to be off of the canvas. To avoid this shift the\n // bounding box over.\n if (x0 < 0) {\n adjustedX0 = 0;\n adjustedX1 += Math.abs(x0);\n }\n if (y0 < 0) {\n adjustedY0 = 0;\n adjustedY1 += Math.abs(y0);\n }\n tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0));\n graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);\n\n // To match CanvasGraphics beginDrawing we must save the context here or\n // else we end up with unbalanced save/restores.\n tmpCtx.save();\n\n this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1);\n\n graphics.baseTransform = getCurrentTransform(graphics.ctx);\n\n graphics.executeOperatorList(operatorList);\n\n graphics.endDrawing();\n\n return {\n canvas: tmpCanvas.canvas,\n scaleX: dimx.scale,\n scaleY: dimy.scale,\n offsetX: adjustedX0,\n offsetY: adjustedY0,\n };\n }\n\n getSizeAndScale(step, realOutputSize, scale) {\n // xstep / ystep may be negative -- normalize.\n step = Math.abs(step);\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n // Use the destination canvas's size if it is bigger than the hard-coded\n // limit of MAX_PATTERN_SIZE to avoid clipping patterns that cover the\n // whole canvas.\n const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);\n let size = Math.ceil(step * scale);\n if (size >= maxSize) {\n size = maxSize;\n } else {\n scale = size / step;\n }\n return { scale, size };\n }\n\n clipBbox(graphics, x0, y0, x1, y1) {\n const bboxWidth = x1 - x0;\n const bboxHeight = y1 - y0;\n graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);\n graphics.current.updateRectMinMax(getCurrentTransform(graphics.ctx), [\n x0,\n y0,\n x1,\n y1,\n ]);\n graphics.clip();\n graphics.endPath();\n }\n\n setFillAndStrokeStyleToContext(graphics, paintType, color) {\n const context = graphics.ctx,\n current = graphics.current;\n switch (paintType) {\n case PaintType.COLORED:\n const ctx = this.ctx;\n context.fillStyle = ctx.fillStyle;\n context.strokeStyle = ctx.strokeStyle;\n current.fillColor = ctx.fillStyle;\n current.strokeColor = ctx.strokeStyle;\n break;\n case PaintType.UNCOLORED:\n const cssColor = Util.makeHexColor(color[0], color[1], color[2]);\n context.fillStyle = cssColor;\n context.strokeStyle = cssColor;\n // Set color needed by image masks (fixes issues 3226 and 8741).\n current.fillColor = cssColor;\n current.strokeColor = cssColor;\n break;\n default:\n throw new FormatError(`Unsupported paint type: ${paintType}`);\n }\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n // PDF spec 8.7.2 NOTE 1: pattern's matrix is relative to initial matrix.\n let matrix = inverse;\n if (pathType !== PathType.SHADING) {\n matrix = Util.transform(matrix, owner.baseTransform);\n if (this.matrix) {\n matrix = Util.transform(matrix, this.matrix);\n }\n }\n\n const temporaryPatternCanvas = this.createPatternCanvas(owner);\n\n let domMatrix = new DOMMatrix(matrix);\n // Rescale and so that the ctx.createPattern call generates a pattern with\n // the desired size.\n domMatrix = domMatrix.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n domMatrix = domMatrix.scale(\n 1 / temporaryPatternCanvas.scaleX,\n 1 / temporaryPatternCanvas.scaleY\n );\n\n const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n pattern.setTransform(domMatrix);\n\n return pattern;\n }\n}\n\nexport { getShadingPattern, PathType, TilingPattern };\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 { FeatureTest, ImageKind } from \"./util.js\";\n\nfunction convertToRGBA(params) {\n switch (params.kind) {\n case ImageKind.GRAYSCALE_1BPP:\n return convertBlackAndWhiteToRGBA(params);\n case ImageKind.RGB_24BPP:\n return convertRGBToRGBA(params);\n }\n\n return null;\n}\n\nfunction convertBlackAndWhiteToRGBA({\n src,\n srcPos = 0,\n dest,\n width,\n height,\n nonBlackColor = 0xffffffff,\n inverseDecode = false,\n}) {\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n const [zeroMapping, oneMapping] = inverseDecode\n ? [nonBlackColor, black]\n : [black, nonBlackColor];\n const widthInSource = width >> 3;\n const widthRemainder = width & 7;\n const srcLength = src.length;\n dest = new Uint32Array(dest.buffer);\n let destPos = 0;\n\n for (let i = 0; i < height; i++) {\n for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {\n const elem = srcPos < srcLength ? src[srcPos] : 255;\n dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;\n }\n if (widthRemainder === 0) {\n continue;\n }\n const elem = srcPos < srcLength ? src[srcPos++] : 255;\n for (let j = 0; j < widthRemainder; j++) {\n dest[destPos++] = elem & (1 << (7 - j)) ? oneMapping : zeroMapping;\n }\n }\n return { srcPos, destPos };\n}\n\nfunction convertRGBToRGBA({\n src,\n srcPos = 0,\n dest,\n destPos = 0,\n width,\n height,\n}) {\n let i = 0;\n const len32 = src.length >> 2;\n const src32 = new Uint32Array(src.buffer, srcPos, len32);\n\n if (FeatureTest.isLittleEndian) {\n // It's a way faster to do the shuffle manually instead of working\n // component by component with some Uint8 arrays.\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R2B1G1R1\n const s2 = src32[i + 1]; // G3R3B2G2\n const s3 = src32[i + 2]; // B4G4R4B3\n\n dest[destPos] = s1 | 0xff000000;\n dest[destPos + 1] = (s1 >>> 24) | (s2 << 8) | 0xff000000;\n dest[destPos + 2] = (s2 >>> 16) | (s3 << 16) | 0xff000000;\n dest[destPos + 3] = (s3 >>> 8) | 0xff000000;\n }\n\n for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n dest[destPos++] =\n src[j] | (src[j + 1] << 8) | (src[j + 2] << 16) | 0xff000000;\n }\n } else {\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R1G1B1R2\n const s2 = src32[i + 1]; // G2B2R3G3\n const s3 = src32[i + 2]; // B3R4G4B4\n\n dest[destPos] = s1 | 0xff;\n dest[destPos + 1] = (s1 << 24) | (s2 >>> 8) | 0xff;\n dest[destPos + 2] = (s2 << 16) | (s3 >>> 16) | 0xff;\n dest[destPos + 3] = (s3 << 8) | 0xff;\n }\n\n for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n dest[destPos++] =\n (src[j] << 24) | (src[j + 1] << 16) | (src[j + 2] << 8) | 0xff;\n }\n }\n\n return { srcPos, destPos };\n}\n\nfunction grayToRGBA(src, dest) {\n if (FeatureTest.isLittleEndian) {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x10101) | 0xff000000;\n }\n } else {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x1010100) | 0x000000ff;\n }\n }\n}\n\nexport { convertBlackAndWhiteToRGBA, convertToRGBA, grayToRGBA };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n isNodeJS,\n OPS,\n shadow,\n TextRenderingMode,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n getCurrentTransform,\n getCurrentTransformInverse,\n PixelsPerInch,\n} from \"./display_utils.js\";\nimport {\n getShadingPattern,\n PathType,\n TilingPattern,\n} from \"./pattern_helper.js\";\nimport { convertBlackAndWhiteToRGBA } from \"../shared/image_utils.js\";\n\n// <canvas> contexts store most of the state we need natively.\n// However, PDF needs a bit more state, which we store here.\n// Minimal font size that would be used during canvas fillText operations.\nconst MIN_FONT_SIZE = 16;\n// Maximum font size that would be used during canvas fillText operations.\nconst MAX_FONT_SIZE = 100;\nconst MAX_GROUP_SIZE = 4096;\n\n// Defines the time the `executeOperatorList`-method is going to be executing\n// before it stops and schedules a continue of execution.\nconst EXECUTION_TIME = 15; // ms\n// Defines the number of steps before checking the execution time.\nconst EXECUTION_STEPS = 10;\n\n// To disable Type3 compilation, set the value to `-1`.\nconst MAX_SIZE_TO_COMPILE = 1000;\n\nconst FULL_CHUNK_HEIGHT = 16;\n\n/**\n * Overrides certain methods on a 2d ctx so that when they are called they\n * will also call the same method on the destCtx. The methods that are\n * overridden are all the transformation state modifiers, path creation, and\n * save/restore. We only forward these specific methods because they are the\n * only state modifiers that we cannot copy over when we switch contexts.\n *\n * To remove mirroring call `ctx._removeMirroring()`.\n *\n * @param {Object} ctx - The 2d canvas context that will duplicate its calls on\n * the destCtx.\n * @param {Object} destCtx - The 2d canvas context that will receive the\n * forwarded calls.\n */\nfunction mirrorContextOperations(ctx, destCtx) {\n if (ctx._removeMirroring) {\n throw new Error(\"Context is already forwarding operations.\");\n }\n ctx.__originalSave = ctx.save;\n ctx.__originalRestore = ctx.restore;\n ctx.__originalRotate = ctx.rotate;\n ctx.__originalScale = ctx.scale;\n ctx.__originalTranslate = ctx.translate;\n ctx.__originalTransform = ctx.transform;\n ctx.__originalSetTransform = ctx.setTransform;\n ctx.__originalResetTransform = ctx.resetTransform;\n ctx.__originalClip = ctx.clip;\n ctx.__originalMoveTo = ctx.moveTo;\n ctx.__originalLineTo = ctx.lineTo;\n ctx.__originalBezierCurveTo = ctx.bezierCurveTo;\n ctx.__originalRect = ctx.rect;\n ctx.__originalClosePath = ctx.closePath;\n ctx.__originalBeginPath = ctx.beginPath;\n\n ctx._removeMirroring = () => {\n ctx.save = ctx.__originalSave;\n ctx.restore = ctx.__originalRestore;\n ctx.rotate = ctx.__originalRotate;\n ctx.scale = ctx.__originalScale;\n ctx.translate = ctx.__originalTranslate;\n ctx.transform = ctx.__originalTransform;\n ctx.setTransform = ctx.__originalSetTransform;\n ctx.resetTransform = ctx.__originalResetTransform;\n\n ctx.clip = ctx.__originalClip;\n ctx.moveTo = ctx.__originalMoveTo;\n ctx.lineTo = ctx.__originalLineTo;\n ctx.bezierCurveTo = ctx.__originalBezierCurveTo;\n ctx.rect = ctx.__originalRect;\n ctx.closePath = ctx.__originalClosePath;\n ctx.beginPath = ctx.__originalBeginPath;\n delete ctx._removeMirroring;\n };\n\n ctx.save = function ctxSave() {\n destCtx.save();\n this.__originalSave();\n };\n\n ctx.restore = function ctxRestore() {\n destCtx.restore();\n this.__originalRestore();\n };\n\n ctx.translate = function ctxTranslate(x, y) {\n destCtx.translate(x, y);\n this.__originalTranslate(x, y);\n };\n\n ctx.scale = function ctxScale(x, y) {\n destCtx.scale(x, y);\n this.__originalScale(x, y);\n };\n\n ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n destCtx.transform(a, b, c, d, e, f);\n this.__originalTransform(a, b, c, d, e, f);\n };\n\n ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n destCtx.setTransform(a, b, c, d, e, f);\n this.__originalSetTransform(a, b, c, d, e, f);\n };\n\n ctx.resetTransform = function ctxResetTransform() {\n destCtx.resetTransform();\n this.__originalResetTransform();\n };\n\n ctx.rotate = function ctxRotate(angle) {\n destCtx.rotate(angle);\n this.__originalRotate(angle);\n };\n\n ctx.clip = function ctxRotate(rule) {\n destCtx.clip(rule);\n this.__originalClip(rule);\n };\n\n ctx.moveTo = function (x, y) {\n destCtx.moveTo(x, y);\n this.__originalMoveTo(x, y);\n };\n\n ctx.lineTo = function (x, y) {\n destCtx.lineTo(x, y);\n this.__originalLineTo(x, y);\n };\n\n ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n\n ctx.rect = function (x, y, width, height) {\n destCtx.rect(x, y, width, height);\n this.__originalRect(x, y, width, height);\n };\n\n ctx.closePath = function () {\n destCtx.closePath();\n this.__originalClosePath();\n };\n\n ctx.beginPath = function () {\n destCtx.beginPath();\n this.__originalBeginPath();\n };\n}\n\nclass CachedCanvases {\n constructor(canvasFactory) {\n this.canvasFactory = canvasFactory;\n this.cache = Object.create(null);\n }\n\n getCanvas(id, width, height) {\n let canvasEntry;\n if (this.cache[id] !== undefined) {\n canvasEntry = this.cache[id];\n this.canvasFactory.reset(canvasEntry, width, height);\n } else {\n canvasEntry = this.canvasFactory.create(width, height);\n this.cache[id] = canvasEntry;\n }\n return canvasEntry;\n }\n\n delete(id) {\n delete this.cache[id];\n }\n\n clear() {\n for (const id in this.cache) {\n const canvasEntry = this.cache[id];\n this.canvasFactory.destroy(canvasEntry);\n delete this.cache[id];\n }\n }\n}\n\nfunction drawImageAtIntegerCoords(\n ctx,\n srcImg,\n srcX,\n srcY,\n srcW,\n srcH,\n destX,\n destY,\n destW,\n destH\n) {\n const [a, b, c, d, tx, ty] = getCurrentTransform(ctx);\n if (b === 0 && c === 0) {\n // top-left corner is at (X, Y) and\n // bottom-right one is at (X + width, Y + height).\n\n // If leftX is 4.321 then it's rounded to 4.\n // If width is 10.432 then it's rounded to 11 because\n // rightX = leftX + width = 14.753 which is rounded to 15\n // so after rounding the total width is 11 (15 - 4).\n // It's why we can't just floor/ceil uniformly, it just depends\n // on the values we've.\n\n const tlX = destX * a + tx;\n const rTlX = Math.round(tlX);\n const tlY = destY * d + ty;\n const rTlY = Math.round(tlY);\n const brX = (destX + destW) * a + tx;\n\n // Some pdf contains images with 1x1 images so in case of 0-width after\n // scaling we must fallback on 1 to be sure there is something.\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destY + destH) * d + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n // We must apply a transformation in order to apply it on the image itself.\n // For example if a == 1 && d == -1, it means that the image itself is\n // mirrored w.r.t. the x-axis.\n ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rWidth, rHeight];\n }\n\n if (a === 0 && d === 0) {\n // This path is taken in issue9462.pdf (page 3).\n const tlX = destY * c + tx;\n const rTlX = Math.round(tlX);\n const tlY = destX * b + ty;\n const rTlY = Math.round(tlY);\n const brX = (destY + destH) * c + tx;\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destX + destW) * b + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rHeight, rWidth];\n }\n\n // Not a scale matrix so let the render handle the case without rounding.\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n\n const scaleX = Math.hypot(a, b);\n const scaleY = Math.hypot(c, d);\n return [scaleX * destW, scaleY * destH];\n}\n\nfunction compileType3Glyph(imgData) {\n const { width, height } = imgData;\n if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) {\n return null;\n }\n\n const POINT_TO_PROCESS_LIMIT = 1000;\n const POINT_TYPES = new Uint8Array([\n 0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0,\n ]);\n\n const width1 = width + 1;\n let points = new Uint8Array(width1 * (height + 1));\n let i, j, j0;\n\n // decodes bit-packed mask data\n const lineSize = (width + 7) & ~7;\n let data = new Uint8Array(lineSize * height),\n pos = 0;\n for (const elem of imgData.data) {\n let mask = 128;\n while (mask > 0) {\n data[pos++] = elem & mask ? 0 : 255;\n mask >>= 1;\n }\n }\n\n // finding interesting points: every point is located between mask pixels,\n // so there will be points of the (width + 1)x(height + 1) grid. Every point\n // will have flags assigned based on neighboring mask pixels:\n // 4 | 8\n // --P--\n // 2 | 1\n // We are interested only in points with the flags:\n // - outside corners: 1, 2, 4, 8;\n // - inside corners: 7, 11, 13, 14;\n // - and, intersections: 5, 10.\n let count = 0;\n pos = 0;\n if (data[pos] !== 0) {\n points[0] = 1;\n ++count;\n }\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j] = data[pos] ? 2 : 1;\n ++count;\n }\n pos++;\n }\n if (data[pos] !== 0) {\n points[j] = 2;\n ++count;\n }\n for (i = 1; i < height; i++) {\n pos = i * lineSize;\n j0 = i * width1;\n if (data[pos - lineSize] !== data[pos]) {\n points[j0] = data[pos] ? 1 : 8;\n ++count;\n }\n // 'sum' is the position of the current pixel configuration in the 'TYPES'\n // array (in order 8-1-2-4, so we can use '>>2' to shift the column).\n let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0);\n for (j = 1; j < width; j++) {\n sum =\n (sum >> 2) +\n (data[pos + 1] ? 4 : 0) +\n (data[pos - lineSize + 1] ? 8 : 0);\n if (POINT_TYPES[sum]) {\n points[j0 + j] = POINT_TYPES[sum];\n ++count;\n }\n pos++;\n }\n if (data[pos - lineSize] !== data[pos]) {\n points[j0 + j] = data[pos] ? 2 : 4;\n ++count;\n }\n\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n }\n\n pos = lineSize * (height - 1);\n j0 = i * width1;\n if (data[pos] !== 0) {\n points[j0] = 8;\n ++count;\n }\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j0 + j] = data[pos] ? 4 : 8;\n ++count;\n }\n pos++;\n }\n if (data[pos] !== 0) {\n points[j0 + j] = 4;\n ++count;\n }\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n\n // building outlines\n const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);\n const path = new Path2D();\n\n for (i = 0; count && i <= height; i++) {\n let p = i * width1;\n const end = p + width;\n while (p < end && !points[p]) {\n p++;\n }\n if (p === end) {\n continue;\n }\n path.moveTo(p % width1, i);\n\n const p0 = p;\n let type = points[p];\n do {\n const step = steps[type];\n do {\n p += step;\n } while (!points[p]);\n\n const pp = points[p];\n if (pp !== 5 && pp !== 10) {\n // set new direction\n type = pp;\n // delete mark\n points[p] = 0;\n } else {\n // type is 5 or 10, ie, a crossing\n // set new direction\n type = pp & ((0x33 * type) >> 4);\n // set new type for \"future hit\"\n points[p] &= (type >> 2) | (type << 2);\n }\n path.lineTo(p % width1, (p / width1) | 0);\n\n if (!points[p]) {\n --count;\n }\n } while (p0 !== p);\n --i;\n }\n\n // Immediately release the, potentially large, `Uint8Array`s after parsing.\n data = null;\n points = null;\n\n const drawOutline = function (c) {\n c.save();\n // the path shall be painted in [0..1]x[0..1] space\n c.scale(1 / width, -1 / height);\n c.translate(0, -height);\n c.fill(path);\n c.beginPath();\n c.restore();\n };\n\n return drawOutline;\n}\n\nclass CanvasExtraState {\n constructor(width, height) {\n // Are soft masks and alpha values shapes or opacities?\n this.alphaIsShape = false;\n this.fontSize = 0;\n this.fontSizeScale = 1;\n this.textMatrix = IDENTITY_MATRIX;\n this.textMatrixScale = 1;\n this.fontMatrix = FONT_IDENTITY_MATRIX;\n this.leading = 0;\n // Current point (in user coordinates)\n this.x = 0;\n this.y = 0;\n // Start of text line (in text coordinates)\n this.lineX = 0;\n this.lineY = 0;\n // Character and word spacing\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRenderingMode = TextRenderingMode.FILL;\n this.textRise = 0;\n // Default fore and background colors\n this.fillColor = \"#000000\";\n this.strokeColor = \"#000000\";\n this.patternFill = false;\n // Note: fill alpha applies to all non-stroking operations\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.activeSMask = null;\n this.transferMaps = \"none\";\n\n this.startNewPathAndClipBox([0, 0, width, height]);\n }\n\n clone() {\n const clone = Object.create(this);\n clone.clipBox = this.clipBox.slice();\n return clone;\n }\n\n setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n\n updatePathMinMax(transform, x, y) {\n [x, y] = Util.applyTransform([x, y], transform);\n this.minX = Math.min(this.minX, x);\n this.minY = Math.min(this.minY, y);\n this.maxX = Math.max(this.maxX, x);\n this.maxY = Math.max(this.maxY, y);\n }\n\n updateRectMinMax(transform, rect) {\n const p1 = Util.applyTransform(rect, transform);\n const p2 = Util.applyTransform(rect.slice(2), transform);\n const p3 = Util.applyTransform([rect[0], rect[3]], transform);\n const p4 = Util.applyTransform([rect[2], rect[1]], transform);\n\n this.minX = Math.min(this.minX, p1[0], p2[0], p3[0], p4[0]);\n this.minY = Math.min(this.minY, p1[1], p2[1], p3[1], p4[1]);\n this.maxX = Math.max(this.maxX, p1[0], p2[0], p3[0], p4[0]);\n this.maxY = Math.max(this.maxY, p1[1], p2[1], p3[1], p4[1]);\n }\n\n updateScalingPathMinMax(transform, minMax) {\n Util.scaleMinMax(transform, minMax);\n this.minX = Math.min(this.minX, minMax[0]);\n this.maxX = Math.max(this.maxX, minMax[1]);\n this.minY = Math.min(this.minY, minMax[2]);\n this.maxY = Math.max(this.maxY, minMax[3]);\n }\n\n updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n const box = Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3);\n if (minMax) {\n minMax[0] = Math.min(minMax[0], box[0], box[2]);\n minMax[1] = Math.max(minMax[1], box[0], box[2]);\n minMax[2] = Math.min(minMax[2], box[1], box[3]);\n minMax[3] = Math.max(minMax[3], box[1], box[3]);\n return;\n }\n this.updateRectMinMax(transform, box);\n }\n\n getPathBoundingBox(pathType = PathType.FILL, transform = null) {\n const box = [this.minX, this.minY, this.maxX, this.maxY];\n if (pathType === PathType.STROKE) {\n if (!transform) {\n unreachable(\"Stroke bounding box must include transform.\");\n }\n // Stroked paths can be outside of the path bounding box by 1/2 the line\n // width.\n const scale = Util.singularValueDecompose2dScale(transform);\n const xStrokePad = (scale[0] * this.lineWidth) / 2;\n const yStrokePad = (scale[1] * this.lineWidth) / 2;\n box[0] -= xStrokePad;\n box[1] -= yStrokePad;\n box[2] += xStrokePad;\n box[3] += yStrokePad;\n }\n return box;\n }\n\n updateClipFromPath() {\n const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox());\n this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);\n }\n\n isEmptyClip() {\n return this.minX === Infinity;\n }\n\n startNewPathAndClipBox(box) {\n this.clipBox = box;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = 0;\n this.maxY = 0;\n }\n\n getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {\n return Util.intersect(\n this.clipBox,\n this.getPathBoundingBox(pathType, transform)\n );\n }\n}\n\nfunction putBinaryImageData(ctx, imgData) {\n if (typeof ImageData !== \"undefined\" && imgData instanceof ImageData) {\n ctx.putImageData(imgData, 0, 0);\n return;\n }\n\n // Put the image data to the canvas in chunks, rather than putting the\n // whole image at once. This saves JS memory, because the ImageData object\n // is smaller. It also possibly saves C++ memory within the implementation\n // of putImageData(). (E.g. in Firefox we make two short-lived copies of\n // the data passed to putImageData()). |n| shouldn't be too small, however,\n // because too many putImageData() calls will slow things down.\n //\n // Note: as written, if the last chunk is partial, the putImageData() call\n // will (conceptually) put pixels past the bounds of the canvas. But\n // that's ok; any such pixels are ignored.\n\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0,\n destPos;\n const src = imgData.data;\n const dest = chunkImgData.data;\n let i, j, thisChunkHeight, elemsInThisChunk;\n\n // There are multiple forms in which the pixel data can be passed, and\n // imgData.kind tells us which one this is.\n if (imgData.kind === ImageKind.GRAYSCALE_1BPP) {\n // Grayscale, 1 bit per pixel (i.e. black-and-white).\n const srcLength = src.byteLength;\n const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);\n const dest32DataLength = dest32.length;\n const fullSrcDiff = (width + 7) >> 3;\n const white = 0xffffffff;\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n\n for (i = 0; i < totalChunks; i++) {\n thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n destPos = 0;\n for (j = 0; j < thisChunkHeight; j++) {\n const srcDiff = srcLength - srcPos;\n let k = 0;\n const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;\n const kEndUnrolled = kEnd & ~7;\n let mask = 0;\n let srcByte = 0;\n for (; k < kEndUnrolled; k += 8) {\n srcByte = src[srcPos++];\n dest32[destPos++] = srcByte & 128 ? white : black;\n dest32[destPos++] = srcByte & 64 ? white : black;\n dest32[destPos++] = srcByte & 32 ? white : black;\n dest32[destPos++] = srcByte & 16 ? white : black;\n dest32[destPos++] = srcByte & 8 ? white : black;\n dest32[destPos++] = srcByte & 4 ? white : black;\n dest32[destPos++] = srcByte & 2 ? white : black;\n dest32[destPos++] = srcByte & 1 ? white : black;\n }\n for (; k < kEnd; k++) {\n if (mask === 0) {\n srcByte = src[srcPos++];\n mask = 128;\n }\n\n dest32[destPos++] = srcByte & mask ? white : black;\n mask >>= 1;\n }\n }\n // We ran out of input. Make all remaining pixels transparent.\n while (destPos < dest32DataLength) {\n dest32[destPos++] = 0;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else if (imgData.kind === ImageKind.RGBA_32BPP) {\n // RGBA, 32-bits per pixel.\n j = 0;\n elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n for (i = 0; i < fullChunks; i++) {\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n srcPos += elemsInThisChunk;\n\n ctx.putImageData(chunkImgData, 0, j);\n j += FULL_CHUNK_HEIGHT;\n }\n if (i < totalChunks) {\n elemsInThisChunk = width * partialChunkHeight * 4;\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (imgData.kind === ImageKind.RGB_24BPP) {\n // RGB, 24-bits per pixel.\n thisChunkHeight = FULL_CHUNK_HEIGHT;\n elemsInThisChunk = width * thisChunkHeight;\n for (i = 0; i < totalChunks; i++) {\n if (i >= fullChunks) {\n thisChunkHeight = partialChunkHeight;\n elemsInThisChunk = width * thisChunkHeight;\n }\n\n destPos = 0;\n for (j = elemsInThisChunk; j--; ) {\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = 255;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else {\n throw new Error(`bad image kind: ${imgData.kind}`);\n }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n if (imgData.bitmap) {\n // The bitmap has been created in the worker.\n ctx.drawImage(imgData.bitmap, 0, 0);\n return;\n }\n\n // Slow path: OffscreenCanvas isn't available in the worker.\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0;\n const src = imgData.data;\n const dest = chunkImgData.data;\n\n for (let i = 0; i < totalChunks; i++) {\n const thisChunkHeight =\n i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n\n // Expand the mask so it can be used by the canvas. Any required\n // inversion has already been handled.\n\n ({ srcPos } = convertBlackAndWhiteToRGBA({\n src,\n srcPos,\n dest,\n width,\n height: thisChunkHeight,\n nonBlackColor: 0,\n }));\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n const properties = [\n \"strokeStyle\",\n \"fillStyle\",\n \"fillRule\",\n \"globalAlpha\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"globalCompositeOperation\",\n \"font\",\n \"filter\",\n ];\n for (const property of properties) {\n if (sourceCtx[property] !== undefined) {\n destCtx[property] = sourceCtx[property];\n }\n }\n if (sourceCtx.setLineDash !== undefined) {\n destCtx.setLineDash(sourceCtx.getLineDash());\n destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n }\n}\n\nfunction resetCtxToDefault(ctx) {\n ctx.strokeStyle = ctx.fillStyle = \"#000000\";\n ctx.fillRule = \"nonzero\";\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n ctx.lineCap = \"butt\";\n ctx.lineJoin = \"miter\";\n ctx.miterLimit = 10;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.font = \"10px sans-serif\";\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n ctx.lineDashOffset = 0;\n }\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !isNodeJS\n ) {\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n }\n}\n\nfunction composeSMaskBackdrop(bytes, r0, g0, b0) {\n const length = bytes.length;\n for (let i = 3; i < length; i += 4) {\n const alpha = bytes[i];\n if (alpha === 0) {\n bytes[i - 3] = r0;\n bytes[i - 2] = g0;\n bytes[i - 1] = b0;\n } else if (alpha < 255) {\n const alpha_ = 255 - alpha;\n bytes[i - 3] = (bytes[i - 3] * alpha + r0 * alpha_) >> 8;\n bytes[i - 2] = (bytes[i - 2] * alpha + g0 * alpha_) >> 8;\n bytes[i - 1] = (bytes[i - 1] * alpha + b0 * alpha_) >> 8;\n }\n }\n}\n\nfunction composeSMaskAlpha(maskData, layerData, transferMap) {\n const length = maskData.length;\n const scale = 1 / 255;\n for (let i = 3; i < length; i += 4) {\n const alpha = transferMap ? transferMap[maskData[i]] : maskData[i];\n layerData[i] = (layerData[i] * alpha * scale) | 0;\n }\n}\n\nfunction composeSMaskLuminosity(maskData, layerData, transferMap) {\n const length = maskData.length;\n for (let i = 3; i < length; i += 4) {\n const y =\n maskData[i - 3] * 77 + // * 0.3 / 255 * 0x10000\n maskData[i - 2] * 152 + // * 0.59 ....\n maskData[i - 1] * 28; // * 0.11 ....\n layerData[i] = transferMap\n ? (layerData[i] * transferMap[y >> 8]) >> 8\n : (layerData[i] * y) >> 16;\n }\n}\n\nfunction genericComposeSMask(\n maskCtx,\n layerCtx,\n width,\n height,\n subtype,\n backdrop,\n transferMap,\n layerOffsetX,\n layerOffsetY,\n maskOffsetX,\n maskOffsetY\n) {\n const hasBackdrop = !!backdrop;\n const r0 = hasBackdrop ? backdrop[0] : 0;\n const g0 = hasBackdrop ? backdrop[1] : 0;\n const b0 = hasBackdrop ? backdrop[2] : 0;\n\n const composeFn =\n subtype === \"Luminosity\" ? composeSMaskLuminosity : composeSMaskAlpha;\n\n // processing image in chunks to save memory\n const PIXELS_TO_PROCESS = 1048576;\n const chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width));\n for (let row = 0; row < height; row += chunkSize) {\n const chunkHeight = Math.min(chunkSize, height - row);\n const maskData = maskCtx.getImageData(\n layerOffsetX - maskOffsetX,\n row + (layerOffsetY - maskOffsetY),\n width,\n chunkHeight\n );\n const layerData = layerCtx.getImageData(\n layerOffsetX,\n row + layerOffsetY,\n width,\n chunkHeight\n );\n\n if (hasBackdrop) {\n composeSMaskBackdrop(maskData.data, r0, g0, b0);\n }\n composeFn(maskData.data, layerData.data, transferMap);\n\n layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY);\n }\n}\n\nfunction composeSMask(ctx, smask, layerCtx, layerBox) {\n const layerOffsetX = layerBox[0];\n const layerOffsetY = layerBox[1];\n const layerWidth = layerBox[2] - layerOffsetX;\n const layerHeight = layerBox[3] - layerOffsetY;\n if (layerWidth === 0 || layerHeight === 0) {\n return;\n }\n genericComposeSMask(\n smask.context,\n layerCtx,\n layerWidth,\n layerHeight,\n smask.subtype,\n smask.backdrop,\n smask.transferMap,\n layerOffsetX,\n layerOffsetY,\n smask.offsetX,\n smask.offsetY\n );\n ctx.save();\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(layerCtx.canvas, 0, 0);\n ctx.restore();\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n const scale = Util.singularValueDecompose2dScale(transform);\n // Round to a 32bit float so that `<=` check below will pass for numbers that\n // are very close, but not exactly the same 64bit floats.\n scale[0] = Math.fround(scale[0]);\n scale[1] = Math.fround(scale[1]);\n const actualScale = Math.fround(\n (globalThis.devicePixelRatio || 1) * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n if (interpolate !== undefined) {\n // If the value is explicitly set use it.\n return interpolate;\n } else if (scale[0] <= actualScale || scale[1] <= actualScale) {\n // Smooth when downscaling.\n return true;\n }\n // Don't smooth when upscaling.\n return false;\n}\n\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nconst NORMAL_CLIP = {};\nconst EO_CLIP = {};\n\nclass CanvasGraphics {\n constructor(\n canvasCtx,\n commonObjs,\n objs,\n canvasFactory,\n filterFactory,\n { optionalContentConfig, markedContentStack = null },\n annotationCanvasMap,\n pageColors\n ) {\n this.ctx = canvasCtx;\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n this.stateStack = [];\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.res = null;\n this.xobjs = null;\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.canvasFactory = canvasFactory;\n this.filterFactory = filterFactory;\n this.groupStack = [];\n this.processingType3 = null;\n // Patterns are painted relative to the initial page/form transform, see\n // PDF spec 8.7.2 NOTE 1.\n this.baseTransform = null;\n this.baseTransformStack = [];\n this.groupLevel = 0;\n this.smaskStack = [];\n this.smaskCounter = 0;\n this.tempSMask = null;\n this.suspendedCtx = null;\n this.contentVisible = true;\n this.markedContentStack = markedContentStack || [];\n this.optionalContentConfig = optionalContentConfig;\n this.cachedCanvases = new CachedCanvases(this.canvasFactory);\n this.cachedPatterns = new Map();\n this.annotationCanvasMap = annotationCanvasMap;\n this.viewportScale = 1;\n this.outputScaleX = 1;\n this.outputScaleY = 1;\n this.pageColors = pageColors;\n\n this._cachedScaleForStroking = [-1, 0];\n this._cachedGetSinglePixelWidth = null;\n this._cachedBitmapsMap = new Map();\n }\n\n getObject(data, fallback = null) {\n if (typeof data === \"string\") {\n return data.startsWith(\"g_\")\n ? this.commonObjs.get(data)\n : this.objs.get(data);\n }\n return fallback;\n }\n\n beginDrawing({\n transform,\n viewport,\n transparency = false,\n background = null,\n }) {\n // For pdfs that use blend modes we have to clear the canvas else certain\n // blend modes can look wrong since we'd be blending with a white\n // backdrop. The problem with a transparent backdrop though is we then\n // don't get sub pixel anti aliasing on text, creating temporary\n // transparent canvas when we have blend modes.\n const width = this.ctx.canvas.width;\n const height = this.ctx.canvas.height;\n\n const savedFillStyle = this.ctx.fillStyle;\n this.ctx.fillStyle = background || \"#ffffff\";\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.fillStyle = savedFillStyle;\n\n if (transparency) {\n const transparentCanvas = this.cachedCanvases.getCanvas(\n \"transparent\",\n width,\n height\n );\n this.compositeCtx = this.ctx;\n this.transparentCanvas = transparentCanvas.canvas;\n this.ctx = transparentCanvas.context;\n this.ctx.save();\n // The transform can be applied before rendering, transferring it to\n // the new canvas.\n this.ctx.transform(...getCurrentTransform(this.compositeCtx));\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx);\n if (transform) {\n this.ctx.transform(...transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[0];\n }\n this.ctx.transform(...viewport.transform);\n this.viewportScale = viewport.scale;\n\n this.baseTransform = getCurrentTransform(this.ctx);\n }\n\n executeOperatorList(\n operatorList,\n executionStartIdx,\n continueCallback,\n stepper\n ) {\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n let i = executionStartIdx || 0;\n const argsArrayLen = argsArray.length;\n\n // Sometimes the OperatorList to execute is empty.\n if (argsArrayLen === i) {\n return i;\n }\n\n const chunkOperations =\n argsArrayLen - i > EXECUTION_STEPS &&\n typeof continueCallback === \"function\";\n const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;\n let steps = 0;\n\n const commonObjs = this.commonObjs;\n const objs = this.objs;\n let fnId;\n\n while (true) {\n if (stepper !== undefined && i === stepper.nextBreakPoint) {\n stepper.breakIt(i, continueCallback);\n return i;\n }\n\n fnId = fnArray[i];\n\n if (fnId !== OPS.dependency) {\n // eslint-disable-next-line prefer-spread\n this[fnId].apply(this, argsArray[i]);\n } else {\n for (const depObjId of argsArray[i]) {\n const objsPool = depObjId.startsWith(\"g_\") ? commonObjs : objs;\n\n // If the promise isn't resolved yet, add the continueCallback\n // to the promise and bail out.\n if (!objsPool.has(depObjId)) {\n objsPool.get(depObjId, continueCallback);\n return i;\n }\n }\n }\n\n i++;\n\n // If the entire operatorList was executed, stop as were done.\n if (i === argsArrayLen) {\n return i;\n }\n\n // If the execution took longer then a certain amount of time and\n // `continueCallback` is specified, interrupt the execution.\n if (chunkOperations && ++steps > EXECUTION_STEPS) {\n if (Date.now() > endTime) {\n continueCallback();\n return i;\n }\n steps = 0;\n }\n\n // If the operatorList isn't executed completely yet OR the execution\n // time was short enough, do another execution round.\n }\n }\n\n #restoreInitialState() {\n // Finishing all opened operations such as SMask group painting.\n while (this.stateStack.length || this.inSMaskMode) {\n this.restore();\n }\n\n this.ctx.restore();\n\n if (this.transparentCanvas) {\n this.ctx = this.compositeCtx;\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice\n this.ctx.drawImage(this.transparentCanvas, 0, 0);\n this.ctx.restore();\n this.transparentCanvas = null;\n }\n }\n\n endDrawing() {\n this.#restoreInitialState();\n\n this.cachedCanvases.clear();\n this.cachedPatterns.clear();\n\n for (const cache of this._cachedBitmapsMap.values()) {\n for (const canvas of cache.values()) {\n if (\n typeof HTMLCanvasElement !== \"undefined\" &&\n canvas instanceof HTMLCanvasElement\n ) {\n canvas.width = canvas.height = 0;\n }\n }\n cache.clear();\n }\n this._cachedBitmapsMap.clear();\n this.#drawFilter();\n }\n\n #drawFilter() {\n if (this.pageColors) {\n const hcmFilterId = this.filterFactory.addHCMFilter(\n this.pageColors.foreground,\n this.pageColors.background\n );\n if (hcmFilterId !== \"none\") {\n const savedFilter = this.ctx.filter;\n this.ctx.filter = hcmFilterId;\n this.ctx.drawImage(this.ctx.canvas, 0, 0);\n this.ctx.filter = savedFilter;\n }\n }\n }\n\n _scaleImage(img, inverseTransform) {\n // Vertical or horizontal scaling shall not be more than 2 to not lose the\n // pixels during drawImage operation, painting on the temporary canvas(es)\n // that are twice smaller in size.\n const width = img.width;\n const height = img.height;\n let widthScale = Math.max(\n Math.hypot(inverseTransform[0], inverseTransform[1]),\n 1\n );\n let heightScale = Math.max(\n Math.hypot(inverseTransform[2], inverseTransform[3]),\n 1\n );\n\n let paintWidth = width,\n paintHeight = height;\n let tmpCanvasId = \"prescale1\";\n let tmpCanvas, tmpCtx;\n while (\n (widthScale > 2 && paintWidth > 1) ||\n (heightScale > 2 && paintHeight > 1)\n ) {\n let newWidth = paintWidth,\n newHeight = paintHeight;\n if (widthScale > 2 && paintWidth > 1) {\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.ceil(paintWidth / 2);\n newWidth =\n paintWidth >= 16384\n ? Math.floor(paintWidth / 2) - 1 || 1\n : Math.ceil(paintWidth / 2);\n widthScale /= paintWidth / newWidth;\n }\n if (heightScale > 2 && paintHeight > 1) {\n // TODO: see the comment above.\n newHeight =\n paintHeight >= 16384\n ? Math.floor(paintHeight / 2) - 1 || 1\n : Math.ceil(paintHeight) / 2;\n heightScale /= paintHeight / newHeight;\n }\n tmpCanvas = this.cachedCanvases.getCanvas(\n tmpCanvasId,\n newWidth,\n newHeight\n );\n tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, newWidth, newHeight);\n tmpCtx.drawImage(\n img,\n 0,\n 0,\n paintWidth,\n paintHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n img = tmpCanvas.canvas;\n paintWidth = newWidth;\n paintHeight = newHeight;\n tmpCanvasId = tmpCanvasId === \"prescale1\" ? \"prescale2\" : \"prescale1\";\n }\n return {\n img,\n paintWidth,\n paintHeight,\n };\n }\n\n _createMaskCanvas(img) {\n const ctx = this.ctx;\n const { width, height } = img;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n const currentTransform = getCurrentTransform(ctx);\n\n let cache, cacheKey, scaled, maskCanvas;\n if ((img.bitmap || img.data) && img.count > 1) {\n const mainKey = img.bitmap || img.data.buffer;\n // We're reusing the same image several times, so we can cache it.\n // In case we've a pattern fill we just keep the scaled version of\n // the image.\n // Only the scaling part matters, the translation part is just used\n // to compute offsets (but not when filling patterns see #15573).\n // TODO: handle the case of a pattern fill if it's possible.\n cacheKey = JSON.stringify(\n isPatternFill\n ? currentTransform\n : [currentTransform.slice(0, 4), fillColor]\n );\n\n cache = this._cachedBitmapsMap.get(mainKey);\n if (!cache) {\n cache = new Map();\n this._cachedBitmapsMap.set(mainKey, cache);\n }\n const cachedImage = cache.get(cacheKey);\n if (cachedImage && !isPatternFill) {\n const offsetX = Math.round(\n Math.min(currentTransform[0], currentTransform[2]) +\n currentTransform[4]\n );\n const offsetY = Math.round(\n Math.min(currentTransform[1], currentTransform[3]) +\n currentTransform[5]\n );\n return {\n canvas: cachedImage,\n offsetX,\n offsetY,\n };\n }\n scaled = cachedImage;\n }\n\n if (!scaled) {\n maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n putBinaryImageMask(maskCanvas.context, img);\n }\n\n // Create the mask canvas at the size it will be drawn at and also set\n // its transform to match the current transform so if there are any\n // patterns applied they will be applied relative to the correct\n // transform.\n\n let maskToCanvas = Util.transform(currentTransform, [\n 1 / width,\n 0,\n 0,\n -1 / height,\n 0,\n 0,\n ]);\n maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(\n [0, 0, width, height],\n maskToCanvas\n );\n const drawnWidth = Math.round(maxX - minX) || 1;\n const drawnHeight = Math.round(maxY - minY) || 1;\n const fillCanvas = this.cachedCanvases.getCanvas(\n \"fillCanvas\",\n drawnWidth,\n drawnHeight\n );\n const fillCtx = fillCanvas.context;\n\n // The offset will be the top-left cordinate mask.\n // If objToCanvas is [a,b,c,d,e,f] then:\n // - offsetX = min(a, c) + e\n // - offsetY = min(b, d) + f\n const offsetX = minX;\n const offsetY = minY;\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform(...maskToCanvas);\n\n if (!scaled) {\n // Pre-scale if needed to improve image smoothing.\n scaled = this._scaleImage(\n maskCanvas.canvas,\n getCurrentTransformInverse(fillCtx)\n );\n scaled = scaled.img;\n if (cache && isPatternFill) {\n cache.set(cacheKey, scaled);\n }\n }\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(fillCtx),\n img.interpolate\n );\n\n drawImageAtIntegerCoords(\n fillCtx,\n scaled,\n 0,\n 0,\n scaled.width,\n scaled.height,\n 0,\n 0,\n width,\n height\n );\n fillCtx.globalCompositeOperation = \"source-in\";\n\n const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [\n 1,\n 0,\n 0,\n 1,\n -offsetX,\n -offsetY,\n ]);\n fillCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(ctx, this, inverse, PathType.FILL)\n : fillColor;\n\n fillCtx.fillRect(0, 0, width, height);\n\n if (cache && !isPatternFill) {\n // The fill canvas is put in the cache associated to the mask image\n // so we must remove from the cached canvas: it mustn't be used again.\n this.cachedCanvases.delete(\"fillCanvas\");\n cache.set(cacheKey, fillCanvas.canvas);\n }\n\n // Round the offsets to avoid drawing fractional pixels.\n return {\n canvas: fillCanvas.canvas,\n offsetX: Math.round(offsetX),\n offsetY: Math.round(offsetY),\n };\n }\n\n // Graphics state\n setLineWidth(width) {\n if (width !== this.current.lineWidth) {\n this._cachedScaleForStroking[0] = -1;\n }\n this.current.lineWidth = width;\n this.ctx.lineWidth = width;\n }\n\n setLineCap(style) {\n this.ctx.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(style) {\n this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(limit) {\n this.ctx.miterLimit = limit;\n }\n\n setDash(dashArray, dashPhase) {\n const ctx = this.ctx;\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash(dashArray);\n ctx.lineDashOffset = dashPhase;\n }\n }\n\n setRenderingIntent(intent) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setFlatness(flatness) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setGState(states) {\n for (const [key, value] of states) {\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n case \"LC\":\n this.setLineCap(value);\n break;\n case \"LJ\":\n this.setLineJoin(value);\n break;\n case \"ML\":\n this.setMiterLimit(value);\n break;\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n case \"FL\":\n this.setFlatness(value);\n break;\n case \"Font\":\n this.setFont(value[0], value[1]);\n break;\n case \"CA\":\n this.current.strokeAlpha = value;\n break;\n case \"ca\":\n this.current.fillAlpha = value;\n this.ctx.globalAlpha = value;\n break;\n case \"BM\":\n this.ctx.globalCompositeOperation = value;\n break;\n case \"SMask\":\n this.current.activeSMask = value ? this.tempSMask : null;\n this.tempSMask = null;\n this.checkSMaskState();\n break;\n case \"TR\":\n this.ctx.filter = this.current.transferMaps =\n this.filterFactory.addFilter(value);\n break;\n }\n }\n }\n\n get inSMaskMode() {\n return !!this.suspendedCtx;\n }\n\n checkSMaskState() {\n const inSMaskMode = this.inSMaskMode;\n if (this.current.activeSMask && !inSMaskMode) {\n this.beginSMaskMode();\n } else if (!this.current.activeSMask && inSMaskMode) {\n this.endSMaskMode();\n }\n // Else, the state is okay and nothing needs to be done.\n }\n\n /**\n * Soft mask mode takes the current main drawing canvas and replaces it with\n * a temporary canvas. Any drawing operations that happen on the temporary\n * canvas need to be composed with the main canvas that was suspended (see\n * `compose()`). The temporary canvas also duplicates many of its operations\n * on the suspended canvas to keep them in sync, so that when the soft mask\n * mode ends any clipping paths or transformations will still be active and in\n * the right order on the canvas' graphics state stack.\n */\n beginSMaskMode() {\n if (this.inSMaskMode) {\n throw new Error(\"beginSMaskMode called while already in smask mode\");\n }\n const drawnWidth = this.ctx.canvas.width;\n const drawnHeight = this.ctx.canvas.height;\n const cacheId = \"smaskGroupAt\" + this.groupLevel;\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n this.suspendedCtx = this.ctx;\n this.ctx = scratchCanvas.context;\n const ctx = this.ctx;\n ctx.setTransform(...getCurrentTransform(this.suspendedCtx));\n copyCtxState(this.suspendedCtx, ctx);\n mirrorContextOperations(ctx, this.suspendedCtx);\n\n this.setGState([\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n }\n\n endSMaskMode() {\n if (!this.inSMaskMode) {\n throw new Error(\"endSMaskMode called while not in smask mode\");\n }\n // The soft mask is done, now restore the suspended canvas as the main\n // drawing canvas.\n this.ctx._removeMirroring();\n copyCtxState(this.ctx, this.suspendedCtx);\n this.ctx = this.suspendedCtx;\n\n this.suspendedCtx = null;\n }\n\n compose(dirtyBox) {\n if (!this.current.activeSMask) {\n return;\n }\n\n if (!dirtyBox) {\n dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n } else {\n dirtyBox[0] = Math.floor(dirtyBox[0]);\n dirtyBox[1] = Math.floor(dirtyBox[1]);\n dirtyBox[2] = Math.ceil(dirtyBox[2]);\n dirtyBox[3] = Math.ceil(dirtyBox[3]);\n }\n const smask = this.current.activeSMask;\n const suspendedCtx = this.suspendedCtx;\n\n composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);\n // Whatever was drawn has been moved to the suspended canvas, now clear it\n // out of the current canvas.\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.restore();\n }\n\n save() {\n if (this.inSMaskMode) {\n // SMask mode may be turned on/off causing us to lose graphics state.\n // Copy the temporary canvas state to the main(suspended) canvas to keep\n // it in sync.\n copyCtxState(this.ctx, this.suspendedCtx);\n // Don't bother calling save on the temporary canvas since state is not\n // saved there.\n this.suspendedCtx.save();\n } else {\n this.ctx.save();\n }\n const old = this.current;\n this.stateStack.push(old);\n this.current = old.clone();\n }\n\n restore() {\n if (this.stateStack.length === 0 && this.inSMaskMode) {\n this.endSMaskMode();\n }\n if (this.stateStack.length !== 0) {\n this.current = this.stateStack.pop();\n if (this.inSMaskMode) {\n // Graphics state is stored on the main(suspended) canvas. Restore its\n // state then copy it over to the temporary canvas.\n this.suspendedCtx.restore();\n copyCtxState(this.suspendedCtx, this.ctx);\n } else {\n this.ctx.restore();\n }\n this.checkSMaskState();\n\n // Ensure that the clipping path is reset (fixes issue6413.pdf).\n this.pendingClip = null;\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n }\n\n transform(a, b, c, d, e, f) {\n this.ctx.transform(a, b, c, d, e, f);\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n\n // Path\n constructPath(ops, args, minMax) {\n const ctx = this.ctx;\n const current = this.current;\n let x = current.x,\n y = current.y;\n let startX, startY;\n const currentTransform = getCurrentTransform(ctx);\n\n // Most of the time the current transform is a scaling matrix\n // so we don't need to transform points before computing min/max:\n // we can compute min/max first and then smartly \"apply\" the\n // transform (see Util.scaleMinMax).\n // For rectangle, moveTo and lineTo, min/max are computed in the\n // worker (see evaluator.js).\n const isScalingMatrix =\n (currentTransform[0] === 0 && currentTransform[3] === 0) ||\n (currentTransform[1] === 0 && currentTransform[2] === 0);\n const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null;\n\n for (let i = 0, j = 0, ii = ops.length; i < ii; i++) {\n switch (ops[i] | 0) {\n case OPS.rectangle:\n x = args[j++];\n y = args[j++];\n const width = args[j++];\n const height = args[j++];\n\n const xw = x + width;\n const yh = y + height;\n ctx.moveTo(x, y);\n if (width === 0 || height === 0) {\n ctx.lineTo(xw, yh);\n } else {\n ctx.lineTo(xw, y);\n ctx.lineTo(xw, yh);\n ctx.lineTo(x, yh);\n }\n if (!isScalingMatrix) {\n current.updateRectMinMax(currentTransform, [x, y, xw, yh]);\n }\n ctx.closePath();\n break;\n case OPS.moveTo:\n x = args[j++];\n y = args[j++];\n ctx.moveTo(x, y);\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n break;\n case OPS.lineTo:\n x = args[j++];\n y = args[j++];\n ctx.lineTo(x, y);\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n break;\n case OPS.curveTo:\n startX = x;\n startY = y;\n x = args[j + 4];\n y = args[j + 5];\n ctx.bezierCurveTo(\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n x,\n y\n );\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n x,\n y,\n minMaxForBezier\n );\n j += 6;\n break;\n case OPS.curveTo2:\n startX = x;\n startY = y;\n ctx.bezierCurveTo(\n x,\n y,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3]\n );\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n x,\n y,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n minMaxForBezier\n );\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n case OPS.curveTo3:\n startX = x;\n startY = y;\n x = args[j + 2];\n y = args[j + 3];\n ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n args[j],\n args[j + 1],\n x,\n y,\n x,\n y,\n minMaxForBezier\n );\n j += 4;\n break;\n case OPS.closePath:\n ctx.closePath();\n break;\n }\n }\n\n if (isScalingMatrix) {\n current.updateScalingPathMinMax(currentTransform, minMaxForBezier);\n }\n\n current.setCurrentPoint(x, y);\n }\n\n closePath() {\n this.ctx.closePath();\n }\n\n stroke(consumePath = true) {\n const ctx = this.ctx;\n const strokeColor = this.current.strokeColor;\n // For stroke we want to temporarily change the global alpha to the\n // stroking alpha.\n ctx.globalAlpha = this.current.strokeAlpha;\n if (this.contentVisible) {\n if (typeof strokeColor === \"object\" && strokeColor?.getPattern) {\n ctx.save();\n ctx.strokeStyle = strokeColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.STROKE\n );\n this.rescaleAndStroke(/* saveRestore */ false);\n ctx.restore();\n } else {\n this.rescaleAndStroke(/* saveRestore */ true);\n }\n }\n if (consumePath) {\n this.consumePath(this.current.getClippedPathBoundingBox());\n }\n // Restore the global alpha to the fill alpha\n ctx.globalAlpha = this.current.fillAlpha;\n }\n\n closeStroke() {\n this.closePath();\n this.stroke();\n }\n\n fill(consumePath = true) {\n const ctx = this.ctx;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n let needRestore = false;\n\n if (isPatternFill) {\n ctx.save();\n ctx.fillStyle = fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n needRestore = true;\n }\n\n const intersect = this.current.getClippedPathBoundingBox();\n if (this.contentVisible && intersect !== null) {\n if (this.pendingEOFill) {\n ctx.fill(\"evenodd\");\n this.pendingEOFill = false;\n } else {\n ctx.fill();\n }\n }\n\n if (needRestore) {\n ctx.restore();\n }\n if (consumePath) {\n this.consumePath(intersect);\n }\n }\n\n eoFill() {\n this.pendingEOFill = true;\n this.fill();\n }\n\n fillStroke() {\n this.fill(false);\n this.stroke(false);\n\n this.consumePath();\n }\n\n eoFillStroke() {\n this.pendingEOFill = true;\n this.fillStroke();\n }\n\n closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n\n closeEOFillStroke() {\n this.pendingEOFill = true;\n this.closePath();\n this.fillStroke();\n }\n\n endPath() {\n this.consumePath();\n }\n\n // Clipping\n clip() {\n this.pendingClip = NORMAL_CLIP;\n }\n\n eoClip() {\n this.pendingClip = EO_CLIP;\n }\n\n // Text\n beginText() {\n this.current.textMatrix = IDENTITY_MATRIX;\n this.current.textMatrixScale = 1;\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n endText() {\n const paths = this.pendingTextPaths;\n const ctx = this.ctx;\n if (paths === undefined) {\n ctx.beginPath();\n return;\n }\n\n ctx.save();\n ctx.beginPath();\n for (const path of paths) {\n ctx.setTransform(...path.transform);\n ctx.translate(path.x, path.y);\n path.addToPath(ctx, path.fontSize);\n }\n ctx.restore();\n ctx.clip();\n ctx.beginPath();\n delete this.pendingTextPaths;\n }\n\n setCharSpacing(spacing) {\n this.current.charSpacing = spacing;\n }\n\n setWordSpacing(spacing) {\n this.current.wordSpacing = spacing;\n }\n\n setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n\n setLeading(leading) {\n this.current.leading = -leading;\n }\n\n setFont(fontRefName, size) {\n const fontObj = this.commonObjs.get(fontRefName);\n const current = this.current;\n\n if (!fontObj) {\n throw new Error(`Can't find font for ${fontRefName}`);\n }\n current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\n\n // A valid matrix needs all main diagonal elements to be non-zero\n // This also ensures we bypass FF bugzilla bug #719844.\n if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n warn(\"Invalid font matrix for font \" + fontRefName);\n }\n\n // The spec for Tf (setFont) says that 'size' specifies the font 'scale',\n // and in some docs this can be negative (inverted x-y axes).\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n this.current.font = fontObj;\n this.current.fontSize = size;\n\n if (fontObj.isType3Font) {\n return; // we don't need ctx.font for Type3 fonts\n }\n\n const name = fontObj.loadedName || \"sans-serif\";\n const typeface =\n fontObj.systemFontInfo?.css || `\"${name}\", ${fontObj.fallbackName}`;\n\n let bold = \"normal\";\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n // Some font backends cannot handle fonts below certain size.\n // Keeping the font at minimal size and using the fontSizeScale to change\n // the current transformation matrix before the fillText/strokeText.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227\n let browserFontSize = size;\n if (size < MIN_FONT_SIZE) {\n browserFontSize = MIN_FONT_SIZE;\n } else if (size > MAX_FONT_SIZE) {\n browserFontSize = MAX_FONT_SIZE;\n }\n this.current.fontSizeScale = size / browserFontSize;\n\n this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;\n }\n\n setTextRenderingMode(mode) {\n this.current.textRenderingMode = mode;\n }\n\n setTextRise(rise) {\n this.current.textRise = rise;\n }\n\n moveText(x, y) {\n this.current.x = this.current.lineX += x;\n this.current.y = this.current.lineY += y;\n }\n\n setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n this.current.textMatrix = [a, b, c, d, e, f];\n this.current.textMatrixScale = Math.hypot(a, b);\n\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n nextLine() {\n this.moveText(0, this.current.leading);\n }\n\n paintChar(character, x, y, patternTransform) {\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const textRenderingMode = current.textRenderingMode;\n const fontSize = current.fontSize / current.fontSizeScale;\n const fillStrokeMode =\n textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n const isAddToPathSet = !!(\n textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG\n );\n const patternFill = current.patternFill && !font.missingFile;\n\n let addToPath;\n if (font.disableFontFace || isAddToPathSet || patternFill) {\n addToPath = font.getPathGenerator(this.commonObjs, character);\n }\n\n if (font.disableFontFace || patternFill) {\n ctx.save();\n ctx.translate(x, y);\n ctx.beginPath();\n addToPath(ctx, fontSize);\n if (patternTransform) {\n ctx.setTransform(...patternTransform);\n }\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fill();\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.stroke();\n }\n ctx.restore();\n } else {\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fillText(character, x, y);\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.strokeText(character, x, y);\n }\n }\n\n if (isAddToPathSet) {\n const paths = (this.pendingTextPaths ||= []);\n paths.push({\n transform: getCurrentTransform(ctx),\n x,\n y,\n fontSize,\n addToPath,\n });\n }\n }\n\n get isFontSubpixelAAEnabled() {\n // Checks if anti-aliasing is enabled when scaled text is painted.\n // On Windows GDI scaled fonts looks bad.\n const { context: ctx } = this.cachedCanvases.getCanvas(\n \"isFontSubpixelAAEnabled\",\n 10,\n 10\n );\n ctx.scale(1.5, 1);\n ctx.fillText(\"I\", 0, 10);\n const data = ctx.getImageData(0, 0, 10, 10).data;\n let enabled = false;\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] > 0 && data[i] < 255) {\n enabled = true;\n break;\n }\n }\n return shadow(this, \"isFontSubpixelAAEnabled\", enabled);\n }\n\n showText(glyphs) {\n const current = this.current;\n const font = current.font;\n if (font.isType3Font) {\n return this.showType3Text(glyphs);\n }\n\n const fontSize = current.fontSize;\n if (fontSize === 0) {\n return undefined;\n }\n\n const ctx = this.ctx;\n const fontSizeScale = current.fontSizeScale;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const fontDirection = current.fontDirection;\n const textHScale = current.textHScale * fontDirection;\n const glyphsLength = glyphs.length;\n const vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const defaultVMetrics = font.defaultVMetrics;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n\n const simpleFillText =\n current.textRenderingMode === TextRenderingMode.FILL &&\n !font.disableFontFace &&\n !current.patternFill;\n\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y + current.textRise);\n\n if (fontDirection > 0) {\n ctx.scale(textHScale, -1);\n } else {\n ctx.scale(textHScale, 1);\n }\n\n let patternTransform;\n if (current.patternFill) {\n ctx.save();\n const pattern = current.fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n patternTransform = getCurrentTransform(ctx);\n ctx.restore();\n ctx.fillStyle = pattern;\n }\n\n let lineWidth = current.lineWidth;\n const scale = current.textMatrixScale;\n if (scale === 0 || lineWidth === 0) {\n const fillStrokeMode =\n current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n lineWidth = this.getSinglePixelWidth();\n }\n } else {\n lineWidth /= scale;\n }\n\n if (fontSizeScale !== 1.0) {\n ctx.scale(fontSizeScale, fontSizeScale);\n lineWidth /= fontSizeScale;\n }\n\n ctx.lineWidth = lineWidth;\n\n if (font.isInvalidPDFjsFont) {\n const chars = [];\n let width = 0;\n for (const glyph of glyphs) {\n chars.push(glyph.unicode);\n width += glyph.width;\n }\n ctx.fillText(chars.join(\"\"), 0, 0);\n current.x += width * widthAdvanceScale * textHScale;\n ctx.restore();\n this.compose();\n\n return undefined;\n }\n\n let x = 0,\n i;\n for (i = 0; i < glyphsLength; ++i) {\n const glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n x += (spacingDir * glyph * fontSize) / 1000;\n continue;\n }\n\n let restoreNeeded = false;\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n const accent = glyph.accent;\n let scaledX, scaledY;\n let width = glyph.width;\n if (vertical) {\n const vmetric = glyph.vmetric || defaultVMetrics;\n const vx =\n -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (font.remeasure && width > 0) {\n // Some standard fonts may not have the exact width: rescale per\n // character if measured width is greater than expected glyph width\n // and subpixel-aa is enabled, otherwise just center the glyph.\n const measuredWidth =\n ((ctx.measureText(character).width * 1000) / fontSize) *\n fontSizeScale;\n if (width < measuredWidth && this.isFontSubpixelAAEnabled) {\n const characterScaleX = width / measuredWidth;\n restoreNeeded = true;\n ctx.save();\n ctx.scale(characterScaleX, 1);\n scaledX /= characterScaleX;\n } else if (width !== measuredWidth) {\n scaledX +=\n (((width - measuredWidth) / 2000) * fontSize) / fontSizeScale;\n }\n }\n\n // Only attempt to draw the glyph if it is actually in the embedded font\n // file or if there isn't a font file so the fallback font is shown.\n if (this.contentVisible && (glyph.isInFont || font.missingFile)) {\n if (simpleFillText && !accent) {\n // common case\n ctx.fillText(character, scaledX, scaledY);\n } else {\n this.paintChar(character, scaledX, scaledY, patternTransform);\n if (accent) {\n const scaledAccentX =\n scaledX + (fontSize * accent.offset.x) / fontSizeScale;\n const scaledAccentY =\n scaledY - (fontSize * accent.offset.y) / fontSizeScale;\n this.paintChar(\n accent.fontChar,\n scaledAccentX,\n scaledAccentY,\n patternTransform\n );\n }\n }\n }\n\n const charWidth = vertical\n ? width * widthAdvanceScale - spacing * fontDirection\n : width * widthAdvanceScale + spacing * fontDirection;\n x += charWidth;\n\n if (restoreNeeded) {\n ctx.restore();\n }\n }\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n ctx.restore();\n this.compose();\n\n return undefined;\n }\n\n showType3Text(glyphs) {\n // Type3 fonts - each glyph is a \"mini-PDF\"\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n const fontDirection = current.fontDirection;\n const spacingDir = font.vertical ? 1 : -1;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const textHScale = current.textHScale * fontDirection;\n const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;\n const glyphsLength = glyphs.length;\n const isTextInvisible =\n current.textRenderingMode === TextRenderingMode.INVISIBLE;\n let i, glyph, width, spacingLength;\n\n if (isTextInvisible || fontSize === 0) {\n return;\n }\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y);\n\n ctx.scale(textHScale, fontDirection);\n\n for (i = 0; i < glyphsLength; ++i) {\n glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n spacingLength = (spacingDir * glyph * fontSize) / 1000;\n this.ctx.translate(spacingLength, 0);\n current.x += spacingLength * textHScale;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const operatorList = font.charProcOperatorList[glyph.operatorListId];\n if (!operatorList) {\n warn(`Type3 character \"${glyph.operatorListId}\" is not available.`);\n continue;\n }\n if (this.contentVisible) {\n this.processingType3 = glyph;\n this.save();\n ctx.scale(fontSize, fontSize);\n ctx.transform(...fontMatrix);\n this.executeOperatorList(operatorList);\n this.restore();\n }\n\n const transformed = Util.applyTransform([glyph.width, 0], fontMatrix);\n width = transformed[0] * fontSize + spacing;\n\n ctx.translate(width, 0);\n current.x += width * textHScale;\n }\n ctx.restore();\n this.processingType3 = null;\n }\n\n // Type3 fonts\n setCharWidth(xWidth, yWidth) {\n // We can safely ignore this since the width should be the same\n // as the width in the Widths array.\n }\n\n setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {\n this.ctx.rect(llx, lly, urx - llx, ury - lly);\n this.ctx.clip();\n this.endPath();\n }\n\n // Color\n getColorN_Pattern(IR) {\n let pattern;\n if (IR[0] === \"TilingPattern\") {\n const color = IR[1];\n const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);\n const canvasGraphicsFactory = {\n createCanvasGraphics: ctx => {\n return new CanvasGraphics(\n ctx,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n {\n optionalContentConfig: this.optionalContentConfig,\n markedContentStack: this.markedContentStack,\n }\n );\n },\n };\n pattern = new TilingPattern(\n IR,\n color,\n this.ctx,\n canvasGraphicsFactory,\n baseTransform\n );\n } else {\n pattern = this._getPattern(IR[1], IR[2]);\n }\n return pattern;\n }\n\n setStrokeColorN() {\n this.current.strokeColor = this.getColorN_Pattern(arguments);\n }\n\n setFillColorN() {\n this.current.fillColor = this.getColorN_Pattern(arguments);\n this.current.patternFill = true;\n }\n\n setStrokeRGBColor(r, g, b) {\n const color = Util.makeHexColor(r, g, b);\n this.ctx.strokeStyle = color;\n this.current.strokeColor = color;\n }\n\n setFillRGBColor(r, g, b) {\n const color = Util.makeHexColor(r, g, b);\n this.ctx.fillStyle = color;\n this.current.fillColor = color;\n this.current.patternFill = false;\n }\n\n _getPattern(objId, matrix = null) {\n let pattern;\n if (this.cachedPatterns.has(objId)) {\n pattern = this.cachedPatterns.get(objId);\n } else {\n pattern = getShadingPattern(this.getObject(objId));\n this.cachedPatterns.set(objId, pattern);\n }\n if (matrix) {\n pattern.matrix = matrix;\n }\n return pattern;\n }\n\n shadingFill(objId) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n this.save();\n const pattern = this._getPattern(objId);\n ctx.fillStyle = pattern.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.SHADING\n );\n\n const inv = getCurrentTransformInverse(ctx);\n if (inv) {\n const { width, height } = ctx.canvas;\n const [x0, y0, x1, y1] = Util.getAxialAlignedBoundingBox(\n [0, 0, width, height],\n inv\n );\n\n this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);\n } else {\n // HACK to draw the gradient onto an infinite rectangle.\n // PDF gradients are drawn across the entire image while\n // Canvas only allows gradients to be drawn in a rectangle\n // The following bug should allow us to remove this.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=664884\n\n this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n }\n\n this.compose(this.current.getClippedPathBoundingBox());\n this.restore();\n }\n\n // Images\n beginInlineImage() {\n unreachable(\"Should not call beginInlineImage\");\n }\n\n beginImageData() {\n unreachable(\"Should not call beginImageData\");\n }\n\n paintFormXObjectBegin(matrix, bbox) {\n if (!this.contentVisible) {\n return;\n }\n this.save();\n this.baseTransformStack.push(this.baseTransform);\n\n if (Array.isArray(matrix) && matrix.length === 6) {\n this.transform(...matrix);\n }\n\n this.baseTransform = getCurrentTransform(this.ctx);\n\n if (bbox) {\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n this.ctx.rect(bbox[0], bbox[1], width, height);\n this.current.updateRectMinMax(getCurrentTransform(this.ctx), bbox);\n this.clip();\n this.endPath();\n }\n }\n\n paintFormXObjectEnd() {\n if (!this.contentVisible) {\n return;\n }\n this.restore();\n this.baseTransform = this.baseTransformStack.pop();\n }\n\n beginGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save();\n // If there's an active soft mask we don't want it enabled for the group, so\n // clear it out. The mask and suspended canvas will be restored in endGroup.\n if (this.inSMaskMode) {\n this.endSMaskMode();\n this.current.activeSMask = null;\n }\n\n const currentCtx = this.ctx;\n // TODO non-isolated groups - according to Rik at adobe non-isolated\n // group results aren't usually that different and they even have tools\n // that ignore this setting. Notes from Rik on implementing:\n // - When you encounter an transparency group, create a new canvas with\n // the dimensions of the bbox\n // - copy the content from the previous canvas to the new canvas\n // - draw as usual\n // - remove the backdrop alpha:\n // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha\n // value of your transparency group and 'alphaBackdrop' the alpha of the\n // backdrop\n // - remove background color:\n // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew)\n if (!group.isolated) {\n info(\"TODO: Support non-isolated groups.\");\n }\n\n // TODO knockout - supposedly possible with the clever use of compositing\n // modes.\n if (group.knockout) {\n warn(\"Knockout groups not supported.\");\n }\n\n const currentTransform = getCurrentTransform(currentCtx);\n if (group.matrix) {\n currentCtx.transform(...group.matrix);\n }\n if (!group.bbox) {\n throw new Error(\"Bounding box is required.\");\n }\n\n // Based on the current transform figure out how big the bounding box\n // will actually be.\n let bounds = Util.getAxialAlignedBoundingBox(\n group.bbox,\n getCurrentTransform(currentCtx)\n );\n // Clip the bounding box to the current canvas.\n const canvasBounds = [\n 0,\n 0,\n currentCtx.canvas.width,\n currentCtx.canvas.height,\n ];\n bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n // Use ceil in case we're between sizes so we don't create canvas that is\n // too small and make the canvas at least 1x1 pixels.\n const offsetX = Math.floor(bounds[0]);\n const offsetY = Math.floor(bounds[1]);\n let drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n let drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n let scaleX = 1,\n scaleY = 1;\n if (drawnWidth > MAX_GROUP_SIZE) {\n scaleX = drawnWidth / MAX_GROUP_SIZE;\n drawnWidth = MAX_GROUP_SIZE;\n }\n if (drawnHeight > MAX_GROUP_SIZE) {\n scaleY = drawnHeight / MAX_GROUP_SIZE;\n drawnHeight = MAX_GROUP_SIZE;\n }\n\n this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n\n let cacheId = \"groupAt\" + this.groupLevel;\n if (group.smask) {\n // Using two cache entries is case if masks are used one after another.\n cacheId += \"_smask_\" + (this.smaskCounter++ % 2);\n }\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n const groupCtx = scratchCanvas.context;\n\n // Since we created a new canvas that is just the size of the bounding box\n // we have to translate the group ctx.\n groupCtx.scale(1 / scaleX, 1 / scaleY);\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform(...currentTransform);\n\n if (group.smask) {\n // Saving state and cached mask to be used in setGState.\n this.smaskStack.push({\n canvas: scratchCanvas.canvas,\n context: groupCtx,\n offsetX,\n offsetY,\n scaleX,\n scaleY,\n subtype: group.smask.subtype,\n backdrop: group.smask.backdrop,\n transferMap: group.smask.transferMap || null,\n startTransformInverse: null, // used during suspend operation\n });\n } else {\n // Setup the current ctx so when the group is popped we draw it at the\n // right location.\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.translate(offsetX, offsetY);\n currentCtx.scale(scaleX, scaleY);\n currentCtx.save();\n }\n // The transparency group inherits all off the current graphics state\n // except the blend mode, soft mask, and alpha constants.\n copyCtxState(currentCtx, groupCtx);\n this.ctx = groupCtx;\n this.setGState([\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n this.groupStack.push(currentCtx);\n this.groupLevel++;\n }\n\n endGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n this.groupLevel--;\n const groupCtx = this.ctx;\n const ctx = this.groupStack.pop();\n this.ctx = ctx;\n // Turn off image smoothing to avoid sub pixel interpolation which can\n // look kind of blurry for some pdfs.\n this.ctx.imageSmoothingEnabled = false;\n\n if (group.smask) {\n this.tempSMask = this.smaskStack.pop();\n this.restore();\n } else {\n this.ctx.restore();\n const currentMtx = getCurrentTransform(this.ctx);\n this.restore();\n this.ctx.save();\n this.ctx.setTransform(...currentMtx);\n const dirtyBox = Util.getAxialAlignedBoundingBox(\n [0, 0, groupCtx.canvas.width, groupCtx.canvas.height],\n currentMtx\n );\n this.ctx.drawImage(groupCtx.canvas, 0, 0);\n this.ctx.restore();\n this.compose(dirtyBox);\n }\n }\n\n beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {\n // The annotations are drawn just after the page content.\n // The page content drawing can potentially have set a transform,\n // a clipping path, whatever...\n // So in order to have something clean, we restore the initial state.\n this.#restoreInitialState();\n resetCtxToDefault(this.ctx);\n\n this.ctx.save();\n this.save();\n\n if (this.baseTransform) {\n this.ctx.setTransform(...this.baseTransform);\n }\n\n if (Array.isArray(rect) && rect.length === 4) {\n const width = rect[2] - rect[0];\n const height = rect[3] - rect[1];\n\n if (hasOwnCanvas && this.annotationCanvasMap) {\n transform = transform.slice();\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n\n rect = rect.slice();\n rect[0] = rect[1] = 0;\n rect[2] = width;\n rect[3] = height;\n\n const [scaleX, scaleY] = Util.singularValueDecompose2dScale(\n getCurrentTransform(this.ctx)\n );\n const { viewportScale } = this;\n const canvasWidth = Math.ceil(\n width * this.outputScaleX * viewportScale\n );\n const canvasHeight = Math.ceil(\n height * this.outputScaleY * viewportScale\n );\n\n this.annotationCanvas = this.canvasFactory.create(\n canvasWidth,\n canvasHeight\n );\n const { canvas, context } = this.annotationCanvas;\n this.annotationCanvasMap.set(id, canvas);\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.save();\n this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY);\n\n resetCtxToDefault(this.ctx);\n } else {\n resetCtxToDefault(this.ctx);\n\n this.ctx.rect(rect[0], rect[1], width, height);\n this.ctx.clip();\n this.endPath();\n }\n }\n\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n\n this.transform(...transform);\n this.transform(...matrix);\n }\n\n endAnnotation() {\n if (this.annotationCanvas) {\n this.ctx.restore();\n this.#drawFilter();\n\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n }\n\n paintImageMaskXObject(img) {\n if (!this.contentVisible) {\n return;\n }\n const count = img.count;\n img = this.getObject(img.data, img);\n img.count = count;\n\n const ctx = this.ctx;\n const glyph = this.processingType3;\n\n if (glyph) {\n if (glyph.compiled === undefined) {\n glyph.compiled = compileType3Glyph(img);\n }\n\n if (glyph.compiled) {\n glyph.compiled(ctx);\n return;\n }\n }\n const mask = this._createMaskCanvas(img);\n const maskCanvas = mask.canvas;\n\n ctx.save();\n // The mask is drawn with the transform applied. Reset the current\n // transform to draw to the identity.\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectRepeat(\n img,\n scaleX,\n skewX = 0,\n skewY = 0,\n scaleY,\n positions\n ) {\n if (!this.contentVisible) {\n return;\n }\n\n img = this.getObject(img.data, img);\n\n const ctx = this.ctx;\n ctx.save();\n const currentTransform = getCurrentTransform(ctx);\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n const mask = this._createMaskCanvas(img);\n\n ctx.setTransform(\n 1,\n 0,\n 0,\n 1,\n mask.offsetX - currentTransform[4],\n mask.offsetY - currentTransform[5]\n );\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n const trans = Util.transform(currentTransform, [\n scaleX,\n skewX,\n skewY,\n scaleY,\n positions[i],\n positions[i + 1],\n ]);\n\n const [x, y] = Util.applyTransform([0, 0], trans);\n ctx.drawImage(mask.canvas, x, y);\n }\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectGroup(images) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n\n for (const image of images) {\n const { data, width, height, transform } = image;\n\n const maskCanvas = this.cachedCanvases.getCanvas(\n \"maskCanvas\",\n width,\n height\n );\n const maskCtx = maskCanvas.context;\n maskCtx.save();\n\n const img = this.getObject(data, image);\n putBinaryImageMask(maskCtx, img);\n\n maskCtx.globalCompositeOperation = \"source-in\";\n\n maskCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(\n maskCtx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n )\n : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n\n maskCtx.restore();\n\n ctx.save();\n ctx.transform(...transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n maskCanvas.canvas,\n 0,\n 0,\n width,\n height,\n 0,\n -1,\n 1,\n 1\n );\n ctx.restore();\n }\n this.compose();\n }\n\n paintImageXObject(objId) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n this.paintInlineImageXObject(imgData);\n }\n\n paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n const width = imgData.width;\n const height = imgData.height;\n const map = [];\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n map.push({\n transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n }\n this.paintInlineImageXObjectGroup(imgData, map);\n }\n\n applyTransferMapsToCanvas(ctx) {\n if (this.current.transferMaps !== \"none\") {\n ctx.filter = this.current.transferMaps;\n ctx.drawImage(ctx.canvas, 0, 0);\n ctx.filter = \"none\";\n }\n return ctx.canvas;\n }\n\n applyTransferMapsToBitmap(imgData) {\n if (this.current.transferMaps === \"none\") {\n return imgData.bitmap;\n }\n const { bitmap, width, height } = imgData;\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n tmpCtx.filter = this.current.transferMaps;\n tmpCtx.drawImage(bitmap, 0, 0);\n tmpCtx.filter = \"none\";\n\n return tmpCanvas.canvas;\n }\n\n paintInlineImageXObject(imgData) {\n if (!this.contentVisible) {\n return;\n }\n const width = imgData.width;\n const height = imgData.height;\n const ctx = this.ctx;\n\n this.save();\n\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !isNodeJS\n ) {\n // The filter, if any, will be applied in applyTransferMapsToBitmap.\n // It must be applied to the image before rescaling else some artifacts\n // could appear.\n // The final restore will reset it to its value.\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n }\n\n // scale the image to the unit square\n ctx.scale(1 / width, -1 / height);\n\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = this.applyTransferMapsToBitmap(imgData);\n } else if (\n (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement) ||\n !imgData.data\n ) {\n // typeof check is needed due to node.js support, see issue #8489\n imgToPaint = imgData;\n } else {\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n const scaled = this._scaleImage(\n imgToPaint,\n getCurrentTransformInverse(ctx)\n );\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(ctx),\n imgData.interpolate\n );\n\n drawImageAtIntegerCoords(\n ctx,\n scaled.img,\n 0,\n 0,\n scaled.paintWidth,\n scaled.paintHeight,\n 0,\n -height,\n width,\n height\n );\n this.compose();\n this.restore();\n }\n\n paintInlineImageXObjectGroup(imgData, map) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = imgData.bitmap;\n } else {\n const w = imgData.width;\n const h = imgData.height;\n\n const tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", w, h);\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n for (const entry of map) {\n ctx.save();\n ctx.transform(...entry.transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n imgToPaint,\n entry.x,\n entry.y,\n entry.w,\n entry.h,\n 0,\n -1,\n 1,\n 1\n );\n ctx.restore();\n }\n this.compose();\n }\n\n paintSolidColorImageMask() {\n if (!this.contentVisible) {\n return;\n }\n this.ctx.fillRect(0, 0, 1, 1);\n this.compose();\n }\n\n // Marked content\n\n markPoint(tag) {\n // TODO Marked content.\n }\n\n markPointProps(tag, properties) {\n // TODO Marked content.\n }\n\n beginMarkedContent(tag) {\n this.markedContentStack.push({\n visible: true,\n });\n }\n\n beginMarkedContentProps(tag, properties) {\n if (tag === \"OC\") {\n this.markedContentStack.push({\n visible: this.optionalContentConfig.isVisible(properties),\n });\n } else {\n this.markedContentStack.push({\n visible: true,\n });\n }\n this.contentVisible = this.isContentVisible();\n }\n\n endMarkedContent() {\n this.markedContentStack.pop();\n this.contentVisible = this.isContentVisible();\n }\n\n // Compatibility\n\n beginCompat() {\n // TODO ignore undefined operators (should we do that anyway?)\n }\n\n endCompat() {\n // TODO stop ignoring undefined operators\n }\n\n // Helper functions\n\n consumePath(clipBox) {\n const isEmpty = this.current.isEmptyClip();\n if (this.pendingClip) {\n this.current.updateClipFromPath();\n }\n if (!this.pendingClip) {\n this.compose(clipBox);\n }\n const ctx = this.ctx;\n if (this.pendingClip) {\n if (!isEmpty) {\n if (this.pendingClip === EO_CLIP) {\n ctx.clip(\"evenodd\");\n } else {\n ctx.clip();\n }\n }\n this.pendingClip = null;\n }\n this.current.startNewPathAndClipBox(this.current.clipBox);\n ctx.beginPath();\n }\n\n getSinglePixelWidth() {\n if (!this._cachedGetSinglePixelWidth) {\n const m = getCurrentTransform(this.ctx);\n if (m[1] === 0 && m[2] === 0) {\n // Fast path\n this._cachedGetSinglePixelWidth =\n 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));\n } else {\n const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[2]);\n const normY = Math.hypot(m[1], m[3]);\n this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet;\n }\n }\n return this._cachedGetSinglePixelWidth;\n }\n\n getScaleForStroking() {\n // A pixel has thicknessX = thicknessY = 1;\n // A transformed pixel is a parallelogram and the thicknesses\n // corresponds to the heights.\n // The goal of this function is to rescale before setting the\n // lineWidth in order to have both thicknesses greater or equal\n // to 1 after transform.\n if (this._cachedScaleForStroking[0] === -1) {\n const { lineWidth } = this.current;\n const { a, b, c, d } = this.ctx.getTransform();\n let scaleX, scaleY;\n\n if (b === 0 && c === 0) {\n // Fast path\n const normX = Math.abs(a);\n const normY = Math.abs(d);\n if (normX === normY) {\n if (lineWidth === 0) {\n scaleX = scaleY = 1 / normX;\n } else {\n const scaledLineWidth = normX * lineWidth;\n scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1;\n }\n } else if (lineWidth === 0) {\n scaleX = 1 / normX;\n scaleY = 1 / normY;\n } else {\n const scaledXLineWidth = normX * lineWidth;\n const scaledYLineWidth = normY * lineWidth;\n scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;\n scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;\n }\n } else {\n // A pixel (base (x, y)) is transformed by M into a parallelogram:\n // - its area is |det(M)|;\n // - heightY (orthogonal to Mx) has a length: |det(M)| / norm(Mx);\n // - heightX (orthogonal to My) has a length: |det(M)| / norm(My).\n // heightX and heightY are the thicknesses of the transformed pixel\n // and they must be both greater or equal to 1.\n const absDet = Math.abs(a * d - b * c);\n const normX = Math.hypot(a, b);\n const normY = Math.hypot(c, d);\n if (lineWidth === 0) {\n scaleX = normY / absDet;\n scaleY = normX / absDet;\n } else {\n const baseArea = lineWidth * absDet;\n scaleX = normY > baseArea ? normY / baseArea : 1;\n scaleY = normX > baseArea ? normX / baseArea : 1;\n }\n }\n this._cachedScaleForStroking[0] = scaleX;\n this._cachedScaleForStroking[1] = scaleY;\n }\n return this._cachedScaleForStroking;\n }\n\n // Rescale before stroking in order to have a final lineWidth\n // with both thicknesses greater or equal to 1.\n rescaleAndStroke(saveRestore) {\n const { ctx } = this;\n const { lineWidth } = this.current;\n const [scaleX, scaleY] = this.getScaleForStroking();\n\n ctx.lineWidth = lineWidth || 1;\n\n if (scaleX === 1 && scaleY === 1) {\n ctx.stroke();\n return;\n }\n\n const dashes = ctx.getLineDash();\n if (saveRestore) {\n ctx.save();\n }\n\n ctx.scale(scaleX, scaleY);\n\n // How the dashed line is rendered depends on the current transform...\n // so we added a rescale to handle too thin lines and consequently\n // the way the line is dashed will be modified.\n // If scaleX === scaleY, the dashed lines will be rendered correctly\n // else we'll have some bugs (but only with too thin lines).\n // Here we take the max... why not taking the min... or something else.\n // Anyway, as said it's buggy when scaleX !== scaleY.\n if (dashes.length > 0) {\n const scale = Math.max(scaleX, scaleY);\n ctx.setLineDash(dashes.map(x => x / scale));\n ctx.lineDashOffset /= scale;\n }\n\n ctx.stroke();\n\n if (saveRestore) {\n ctx.restore();\n }\n }\n\n isContentVisible() {\n for (let i = this.markedContentStack.length - 1; i >= 0; i--) {\n if (!this.markedContentStack[i].visible) {\n return false;\n }\n }\n return true;\n }\n}\n\nfor (const op in OPS) {\n if (CanvasGraphics.prototype[op] !== undefined) {\n CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];\n }\n}\n\nexport { CanvasGraphics };\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\nimport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n BaseSVGFactory,\n} from \"./base_factory.js\";\nimport {\n BaseException,\n FeatureTest,\n shadow,\n stringToBytes,\n Util,\n warn,\n} from \"../shared/util.js\";\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\nclass PixelsPerInch {\n static CSS = 96.0;\n\n static PDF = 72.0;\n\n static PDF_TO_CSS_UNITS = this.CSS / this.PDF;\n}\n\n/**\n * FilterFactory aims to create some SVG filters we can use when drawing an\n * image (or whatever) on a canvas.\n * Filters aren't applied with ctx.putImageData because it just overwrites the\n * underlying pixels.\n * With these filters, it's possible for example to apply some transfer maps on\n * an image without the need to apply them on the pixel arrays: the renderer\n * does the magic for us.\n */\nclass DOMFilterFactory extends BaseFilterFactory {\n #_cache;\n\n #_defs;\n\n #docId;\n\n #document;\n\n #hcmFilter;\n\n #hcmKey;\n\n #hcmUrl;\n\n #hcmHighlightFilter;\n\n #hcmHighlightKey;\n\n #hcmHighlightUrl;\n\n #id = 0;\n\n constructor({ docId, ownerDocument = globalThis.document } = {}) {\n super();\n this.#docId = docId;\n this.#document = ownerDocument;\n }\n\n get #cache() {\n return (this.#_cache ||= new Map());\n }\n\n get #defs() {\n if (!this.#_defs) {\n const div = this.#document.createElement(\"div\");\n const { style } = div;\n style.visibility = \"hidden\";\n style.contain = \"strict\";\n style.width = style.height = 0;\n style.position = \"absolute\";\n style.top = style.left = 0;\n style.zIndex = -1;\n\n const svg = this.#document.createElementNS(SVG_NS, \"svg\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n this.#_defs = this.#document.createElementNS(SVG_NS, \"defs\");\n div.append(svg);\n svg.append(this.#_defs);\n this.#document.body.append(div);\n }\n return this.#_defs;\n }\n\n addFilter(maps) {\n if (!maps) {\n return \"none\";\n }\n\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(maps);\n if (value) {\n return value;\n }\n\n let tableR, tableG, tableB, key;\n if (maps.length === 1) {\n const mapR = maps[0];\n const buffer = new Array(256);\n for (let i = 0; i < 256; i++) {\n buffer[i] = mapR[i] / 255;\n }\n key = tableR = tableG = tableB = buffer.join(\",\");\n } else {\n const [mapR, mapG, mapB] = maps;\n const bufferR = new Array(256);\n const bufferG = new Array(256);\n const bufferB = new Array(256);\n for (let i = 0; i < 256; i++) {\n bufferR[i] = mapR[i] / 255;\n bufferG[i] = mapG[i] / 255;\n bufferB[i] = mapB[i] / 255;\n }\n tableR = bufferR.join(\",\");\n tableG = bufferG.join(\",\");\n tableB = bufferB.join(\",\");\n key = `${tableR}${tableG}${tableB}`;\n }\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(maps, value);\n return value;\n }\n\n // We create a SVG filter: feComponentTransferElement\n // https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement\n\n const id = `g_${this.#docId}_transfer_map_${this.#id++}`;\n const url = `url(#${id})`;\n this.#cache.set(maps, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapConversion(tableR, tableG, tableB, filter);\n\n return url;\n }\n\n addHCMFilter(fgColor, bgColor) {\n const key = `${fgColor}-${bgColor}`;\n if (this.#hcmKey === key) {\n return this.#hcmUrl;\n }\n\n this.#hcmKey = key;\n this.#hcmUrl = \"none\";\n this.#hcmFilter?.remove();\n\n if (!fgColor || !bgColor) {\n return this.#hcmUrl;\n }\n\n const fgRGB = this.#getRGB(fgColor);\n fgColor = Util.makeHexColor(...fgRGB);\n const bgRGB = this.#getRGB(bgColor);\n bgColor = Util.makeHexColor(...bgRGB);\n this.#defs.style.color = \"\";\n\n if (\n (fgColor === \"#000000\" && bgColor === \"#ffffff\") ||\n fgColor === bgColor\n ) {\n return this.#hcmUrl;\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_Colors_and_Luminance\n //\n // Relative luminance:\n // https://www.w3.org/TR/WCAG20/#relativeluminancedef\n //\n // We compute the rounded luminance of the default background color.\n // Then for every color in the pdf, if its rounded luminance is the\n // same as the background one then it's replaced by the new\n // background color else by the foreground one.\n const map = new Array(256);\n for (let i = 0; i <= 255; i++) {\n const x = i / 255;\n map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n }\n const table = map.join(\",\");\n\n const id = `g_${this.#docId}_hcm_filter`;\n const filter = (this.#hcmHighlightFilter = this.#createFilter(id));\n this.#addTransferMapConversion(table, table, table, filter);\n this.#addGrayConversion(filter);\n\n const getSteps = (c, n) => {\n const start = fgRGB[c] / 255;\n const end = bgRGB[c] / 255;\n const arr = new Array(n + 1);\n for (let i = 0; i <= n; i++) {\n arr[i] = start + (i / n) * (end - start);\n }\n return arr.join(\",\");\n };\n this.#addTransferMapConversion(\n getSteps(0, 5),\n getSteps(1, 5),\n getSteps(2, 5),\n filter\n );\n\n this.#hcmUrl = `url(#${id})`;\n return this.#hcmUrl;\n }\n\n addHighlightHCMFilter(fgColor, bgColor, newFgColor, newBgColor) {\n const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`;\n if (this.#hcmHighlightKey === key) {\n return this.#hcmHighlightUrl;\n }\n\n this.#hcmHighlightKey = key;\n this.#hcmHighlightUrl = \"none\";\n this.#hcmHighlightFilter?.remove();\n\n if (!fgColor || !bgColor) {\n return this.#hcmHighlightUrl;\n }\n\n const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this));\n let fgGray = Math.round(\n 0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]\n );\n let bgGray = Math.round(\n 0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]\n );\n let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(\n this.#getRGB.bind(this)\n );\n if (bgGray < fgGray) {\n [fgGray, bgGray, newFgRGB, newBgRGB] = [\n bgGray,\n fgGray,\n newBgRGB,\n newFgRGB,\n ];\n }\n this.#defs.style.color = \"\";\n\n // Now we can create the filters to highlight some canvas parts.\n // The colors in the pdf will almost be Canvas and CanvasText, hence we\n // want to filter them to finally get Highlight and HighlightText.\n // Since we're in HCM the background color and the foreground color should\n // be really different when converted to grayscale (if they're not then it\n // means that we've a poor contrast). Once the canvas colors are converted\n // to grayscale we can easily map them on their new colors.\n // The grayscale step is important because if we've something like:\n // fgColor = #FF....\n // bgColor = #FF....\n // then we are enable to map the red component on the new red components\n // which can be different.\n\n const getSteps = (fg, bg, n) => {\n const arr = new Array(256);\n const step = (bgGray - fgGray) / n;\n const newStart = fg / 255;\n const newStep = (bg - fg) / (255 * n);\n let prev = 0;\n for (let i = 0; i <= n; i++) {\n const k = Math.round(fgGray + i * step);\n const value = newStart + i * newStep;\n for (let j = prev; j <= k; j++) {\n arr[j] = value;\n }\n prev = k + 1;\n }\n for (let i = prev; i < 256; i++) {\n arr[i] = arr[prev - 1];\n }\n return arr.join(\",\");\n };\n\n const id = `g_${this.#docId}_hcm_highlight_filter`;\n const filter = (this.#hcmHighlightFilter = this.#createFilter(id));\n\n this.#addGrayConversion(filter);\n this.#addTransferMapConversion(\n getSteps(newFgRGB[0], newBgRGB[0], 5),\n getSteps(newFgRGB[1], newBgRGB[1], 5),\n getSteps(newFgRGB[2], newBgRGB[2], 5),\n filter\n );\n\n this.#hcmHighlightUrl = `url(#${id})`;\n return this.#hcmHighlightUrl;\n }\n\n destroy(keepHCM = false) {\n if (keepHCM && (this.#hcmUrl || this.#hcmHighlightUrl)) {\n return;\n }\n if (this.#_defs) {\n this.#_defs.parentNode.parentNode.remove();\n this.#_defs = null;\n }\n if (this.#_cache) {\n this.#_cache.clear();\n this.#_cache = null;\n }\n this.#id = 0;\n }\n\n #addGrayConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #createFilter(id) {\n const filter = this.#document.createElementNS(SVG_NS, \"filter\");\n filter.setAttribute(\"color-interpolation-filters\", \"sRGB\");\n filter.setAttribute(\"id\", id);\n this.#defs.append(filter);\n\n return filter;\n }\n\n #appendFeFunc(feComponentTransfer, func, table) {\n const feFunc = this.#document.createElementNS(SVG_NS, func);\n feFunc.setAttribute(\"type\", \"discrete\");\n feFunc.setAttribute(\"tableValues\", table);\n feComponentTransfer.append(feFunc);\n }\n\n #addTransferMapConversion(rTable, gTable, bTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncR\", rTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncG\", gTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncB\", bTable);\n }\n\n #getRGB(color) {\n this.#defs.style.color = color;\n return getRGB(getComputedStyle(this.#defs).getPropertyValue(\"color\"));\n }\n}\n\nclass DOMCanvasFactory extends BaseCanvasFactory {\n constructor({ ownerDocument = globalThis.document } = {}) {\n super();\n this._document = ownerDocument;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n return canvas;\n }\n}\n\nasync function fetchData(url, type = \"text\") {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n isValidFetchUrl(url, document.baseURI)\n ) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n switch (type) {\n case \"arraybuffer\":\n return response.arrayBuffer();\n case \"blob\":\n return response.blob();\n case \"json\":\n return response.json();\n }\n return response.text();\n }\n\n // The Fetch API is not supported.\n return new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, /* async = */ true);\n request.responseType = type;\n\n request.onreadystatechange = () => {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n if (request.status === 200 || request.status === 0) {\n let data;\n switch (type) {\n case \"arraybuffer\":\n case \"blob\":\n case \"json\":\n data = request.response;\n break;\n default:\n data = request.responseText;\n break;\n }\n if (data) {\n resolve(data);\n return;\n }\n }\n reject(new Error(request.statusText));\n };\n\n request.send(null);\n });\n}\n\nclass DOMCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n return fetchData(\n url,\n /* type = */ this.isCompressed ? \"arraybuffer\" : \"text\"\n ).then(data => {\n return {\n cMapData:\n data instanceof ArrayBuffer\n ? new Uint8Array(data)\n : stringToBytes(data),\n compressionType,\n };\n });\n }\n}\n\nclass DOMStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n _fetchData(url) {\n return fetchData(url, /* type = */ \"arraybuffer\").then(data => {\n return new Uint8Array(data);\n });\n }\n}\n\nclass DOMSVGFactory extends BaseSVGFactory {\n /**\n * @ignore\n */\n _createSVG(type) {\n return document.createElementNS(SVG_NS, type);\n }\n}\n\n/**\n * @typedef {Object} PageViewportParameters\n * @property {Array<number>} viewBox - The xMin, yMin, xMax and\n * yMax coordinates.\n * @property {number} scale - The scale of the viewport.\n * @property {number} rotation - The rotation, in degrees, of the viewport.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The\n * default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The\n * default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * @typedef {Object} PageViewportCloneParameters\n * @property {number} [scale] - The scale, overriding the one in the cloned\n * viewport. The default value is `this.scale`.\n * @property {number} [rotation] - The rotation, in degrees, overriding the one\n * in the cloned viewport. The default value is `this.rotation`.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `this.offsetX`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `this.offsetY`.\n * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * PDF page viewport created based on scale, rotation and offset.\n */\nclass PageViewport {\n /**\n * @param {PageViewportParameters}\n */\n constructor({\n viewBox,\n scale,\n rotation,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n }) {\n this.viewBox = viewBox;\n this.scale = scale;\n this.rotation = rotation;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n\n // creating transform to convert pdf coordinate system to the normal\n // canvas like coordinates taking in account scale and rotation\n const centerX = (viewBox[2] + viewBox[0]) / 2;\n const centerY = (viewBox[3] + viewBox[1]) / 2;\n let rotateA, rotateB, rotateC, rotateD;\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n switch (rotation) {\n case 180:\n rotateA = -1;\n rotateB = 0;\n rotateC = 0;\n rotateD = 1;\n break;\n case 90:\n rotateA = 0;\n rotateB = 1;\n rotateC = 1;\n rotateD = 0;\n break;\n case 270:\n rotateA = 0;\n rotateB = -1;\n rotateC = -1;\n rotateD = 0;\n break;\n case 0:\n rotateA = 1;\n rotateB = 0;\n rotateC = 0;\n rotateD = -1;\n break;\n default:\n throw new Error(\n \"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\"\n );\n }\n\n if (dontFlip) {\n rotateC = -rotateC;\n rotateD = -rotateD;\n }\n\n let offsetCanvasX, offsetCanvasY;\n let width, height;\n if (rotateA === 0) {\n offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n width = (viewBox[3] - viewBox[1]) * scale;\n height = (viewBox[2] - viewBox[0]) * scale;\n } else {\n offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n width = (viewBox[2] - viewBox[0]) * scale;\n height = (viewBox[3] - viewBox[1]) * scale;\n }\n // creating transform for the following operations:\n // translate(-centerX, -centerY), rotate and flip vertically,\n // scale, and translate(offsetCanvasX, offsetCanvasY)\n this.transform = [\n rotateA * scale,\n rotateB * scale,\n rotateC * scale,\n rotateD * scale,\n offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY,\n offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY,\n ];\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * The original, un-scaled, viewport dimensions.\n * @type {Object}\n */\n get rawDims() {\n const { viewBox } = this;\n return shadow(this, \"rawDims\", {\n pageWidth: viewBox[2] - viewBox[0],\n pageHeight: viewBox[3] - viewBox[1],\n pageX: viewBox[0],\n pageY: viewBox[1],\n });\n }\n\n /**\n * Clones viewport, with optional additional properties.\n * @param {PageViewportCloneParameters} [params]\n * @returns {PageViewport} Cloned viewport.\n */\n clone({\n scale = this.scale,\n rotation = this.rotation,\n offsetX = this.offsetX,\n offsetY = this.offsetY,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.viewBox.slice(),\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * Converts PDF point to the viewport coordinates. For examples, useful for\n * converting PDF location into canvas pixel coordinates.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the viewport coordinate space.\n * @see {@link convertToPdfPoint}\n * @see {@link convertToViewportRectangle}\n */\n convertToViewportPoint(x, y) {\n return Util.applyTransform([x, y], this.transform);\n }\n\n /**\n * Converts PDF rectangle to the viewport coordinates.\n * @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.\n * @returns {Array} Array containing corresponding coordinates of the\n * rectangle in the viewport coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToViewportRectangle(rect) {\n const topLeft = Util.applyTransform([rect[0], rect[1]], this.transform);\n const bottomRight = Util.applyTransform([rect[2], rect[3]], this.transform);\n return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];\n }\n\n /**\n * Converts viewport coordinates to the PDF location. For examples, useful\n * for converting canvas pixel location into PDF one.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the PDF coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToPdfPoint(x, y) {\n return Util.applyInverseTransform([x, y], this.transform);\n }\n}\n\nclass RenderingCancelledException extends BaseException {\n constructor(msg, extraDelay = 0) {\n super(msg, \"RenderingCancelledException\");\n this.extraDelay = extraDelay;\n }\n}\n\nfunction isDataScheme(url) {\n const ii = url.length;\n let i = 0;\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\n/**\n * Gets the filename from a given URL.\n * @param {string} url\n * @param {boolean} [onlyStripPath]\n * @returns {string}\n */\nfunction getFilenameFromUrl(url, onlyStripPath = false) {\n if (!onlyStripPath) {\n [url] = url.split(/[#?]/, 1);\n }\n return url.substring(url.lastIndexOf(\"/\") + 1);\n}\n\n/**\n * Returns the filename or guessed filename from the url (see issue 3455).\n * @param {string} url - The original PDF location.\n * @param {string} defaultFilename - The value returned if the filename is\n * unknown, or the protocol is unsupported.\n * @returns {string} Guessed PDF filename.\n */\nfunction getPdfFilenameFromUrl(url, defaultFilename = \"document.pdf\") {\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n if (isDataScheme(url)) {\n warn('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n return defaultFilename;\n }\n const reURI = /^(?:(?:[^:]+:)?\\/\\/[^/]+)?([^?#]*)(\\?[^#]*)?(#.*)?$/;\n // SCHEME HOST 1.PATH 2.QUERY 3.REF\n // Pattern to get last matching NAME.pdf\n const reFilename = /[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n const splitURI = reURI.exec(url);\n let suggestedFilename =\n reFilename.exec(splitURI[1]) ||\n reFilename.exec(splitURI[2]) ||\n reFilename.exec(splitURI[3]);\n if (suggestedFilename) {\n suggestedFilename = suggestedFilename[0];\n if (suggestedFilename.includes(\"%\")) {\n // URL-encoded %2Fpath%2Fto%2Ffile.pdf should be file.pdf\n try {\n suggestedFilename = reFilename.exec(\n decodeURIComponent(suggestedFilename)\n )[0];\n } catch {\n // Possible (extremely rare) errors:\n // URIError \"Malformed URI\", e.g. for \"%AA.pdf\"\n // TypeError \"null has no properties\", e.g. for \"%2F.pdf\"\n }\n }\n }\n return suggestedFilename || defaultFilename;\n}\n\nclass StatTimer {\n started = Object.create(null);\n\n times = [];\n\n time(name) {\n if (name in this.started) {\n warn(`Timer is already running for ${name}`);\n }\n this.started[name] = Date.now();\n }\n\n timeEnd(name) {\n if (!(name in this.started)) {\n warn(`Timer has not been started for ${name}`);\n }\n this.times.push({\n name,\n start: this.started[name],\n end: Date.now(),\n });\n // Remove timer from started so it can be called again.\n delete this.started[name];\n }\n\n toString() {\n // Find the longest name for padding purposes.\n const outBuf = [];\n let longest = 0;\n for (const { name } of this.times) {\n longest = Math.max(name.length, longest);\n }\n for (const { name, start, end } of this.times) {\n outBuf.push(`${name.padEnd(longest)} ${end - start}ms\\n`);\n }\n return outBuf.join(\"\");\n }\n}\n\nfunction isValidFetchUrl(url, baseUrl) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: isValidFetchUrl\");\n }\n try {\n const { protocol } = baseUrl ? new URL(url, baseUrl) : new URL(url);\n // The Fetch API only supports the http/https protocols, and not file/ftp.\n return protocol === \"http:\" || protocol === \"https:\";\n } catch {\n return false; // `new URL()` will throw on incorrect data.\n }\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenu(e) {\n e.preventDefault();\n}\n\n// Deprecated API function -- display regardless of the `verbosity` setting.\nfunction deprecated(details) {\n console.log(\"Deprecated API usage: \" + details);\n}\n\nlet pdfDateStringRegex;\n\nclass PDFDateString {\n /**\n * Convert a PDF date string to a JavaScript `Date` object.\n *\n * The PDF date string format is described in section 7.9.4 of the official\n * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth\n * edition) Adobe describes the same format including a trailing apostrophe.\n * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain\n * them. We ignore all apostrophes as they are not necessary for date parsing.\n *\n * Moreover, Adobe Acrobat doesn't handle changing the date to universal time\n * and doesn't use the user's time zone (effectively ignoring the HH' and mm'\n * parts of the date string).\n *\n * @param {string} input\n * @returns {Date|null}\n */\n static toDateObject(input) {\n if (!input || typeof input !== \"string\") {\n return null;\n }\n\n // Lazily initialize the regular expression.\n pdfDateStringRegex ||= new RegExp(\n \"^D:\" + // Prefix (required)\n \"(\\\\d{4})\" + // Year (required)\n \"(\\\\d{2})?\" + // Month (optional)\n \"(\\\\d{2})?\" + // Day (optional)\n \"(\\\\d{2})?\" + // Hour (optional)\n \"(\\\\d{2})?\" + // Minute (optional)\n \"(\\\\d{2})?\" + // Second (optional)\n \"([Z|+|-])?\" + // Universal time relation (optional)\n \"(\\\\d{2})?\" + // Offset hour (optional)\n \"'?\" + // Splitting apostrophe (optional)\n \"(\\\\d{2})?\" + // Offset minute (optional)\n \"'?\" // Trailing apostrophe (optional)\n );\n\n // Optional fields that don't satisfy the requirements from the regular\n // expression (such as incorrect digit counts or numbers that are out of\n // range) will fall back the defaults from the specification.\n const matches = pdfDateStringRegex.exec(input);\n if (!matches) {\n return null;\n }\n\n // JavaScript's `Date` object expects the month to be between 0 and 11\n // instead of 1 and 12, so we have to correct for that.\n const year = parseInt(matches[1], 10);\n let month = parseInt(matches[2], 10);\n month = month >= 1 && month <= 12 ? month - 1 : 0;\n let day = parseInt(matches[3], 10);\n day = day >= 1 && day <= 31 ? day : 1;\n let hour = parseInt(matches[4], 10);\n hour = hour >= 0 && hour <= 23 ? hour : 0;\n let minute = parseInt(matches[5], 10);\n minute = minute >= 0 && minute <= 59 ? minute : 0;\n let second = parseInt(matches[6], 10);\n second = second >= 0 && second <= 59 ? second : 0;\n const universalTimeRelation = matches[7] || \"Z\";\n let offsetHour = parseInt(matches[8], 10);\n offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;\n let offsetMinute = parseInt(matches[9], 10) || 0;\n offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;\n\n // Universal time relation 'Z' means that the local time is equal to the\n // universal time, whereas the relations '+'/'-' indicate that the local\n // time is later respectively earlier than the universal time. Every date\n // is normalized to universal time.\n if (universalTimeRelation === \"-\") {\n hour += offsetHour;\n minute += offsetMinute;\n } else if (universalTimeRelation === \"+\") {\n hour -= offsetHour;\n minute -= offsetMinute;\n }\n\n return new Date(Date.UTC(year, month, day, hour, minute, second));\n }\n}\n\n/**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n */\nfunction getXfaPageViewport(xfaPage, { scale = 1, rotation = 0 }) {\n const { width, height } = xfaPage.attributes.style;\n const viewBox = [0, 0, parseInt(width), parseInt(height)];\n\n return new PageViewport({\n viewBox,\n scale,\n rotation,\n });\n}\n\nfunction getRGB(color) {\n if (color.startsWith(\"#\")) {\n const colorRGB = parseInt(color.slice(1), 16);\n return [\n (colorRGB & 0xff0000) >> 16,\n (colorRGB & 0x00ff00) >> 8,\n colorRGB & 0x0000ff,\n ];\n }\n\n if (color.startsWith(\"rgb(\")) {\n // getComputedStyle(...).color returns a `rgb(R, G, B)` color.\n return color\n .slice(/* \"rgb(\".length */ 4, -1) // Strip out \"rgb(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x));\n }\n\n if (color.startsWith(\"rgba(\")) {\n return color\n .slice(/* \"rgba(\".length */ 5, -1) // Strip out \"rgba(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x))\n .slice(0, 3);\n }\n\n warn(`Not a valid color format: \"${color}\"`);\n return [0, 0, 0];\n}\n\nfunction getColorValues(colors) {\n const span = document.createElement(\"span\");\n span.style.visibility = \"hidden\";\n document.body.append(span);\n for (const name of colors.keys()) {\n span.style.color = name;\n const computedColor = window.getComputedStyle(span).color;\n colors.set(name, getRGB(computedColor));\n }\n span.remove();\n}\n\nfunction getCurrentTransform(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform();\n return [a, b, c, d, e, f];\n}\n\nfunction getCurrentTransformInverse(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform().invertSelf();\n return [a, b, c, d, e, f];\n}\n\n/**\n * @param {HTMLDivElement} div\n * @param {PageViewport} viewport\n * @param {boolean} mustFlip\n * @param {boolean} mustRotate\n */\nfunction setLayerDimensions(\n div,\n viewport,\n mustFlip = false,\n mustRotate = true\n) {\n if (viewport instanceof PageViewport) {\n const { pageWidth, pageHeight } = viewport.rawDims;\n const { style } = div;\n const useRound = FeatureTest.isCSSRoundSupported;\n\n const w = `var(--scale-factor) * ${pageWidth}px`,\n h = `var(--scale-factor) * ${pageHeight}px`;\n const widthStr = useRound ? `round(${w}, 1px)` : `calc(${w})`,\n heightStr = useRound ? `round(${h}, 1px)` : `calc(${h})`;\n\n if (!mustFlip || viewport.rotation % 180 === 0) {\n style.width = widthStr;\n style.height = heightStr;\n } else {\n style.width = heightStr;\n style.height = widthStr;\n }\n }\n\n if (mustRotate) {\n div.setAttribute(\"data-main-rotation\", viewport.rotation);\n }\n}\n\nexport {\n deprecated,\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMFilterFactory,\n DOMStandardFontDataFactory,\n DOMSVGFactory,\n fetchData,\n getColorValues,\n getCurrentTransform,\n getCurrentTransformInverse,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n isValidFetchUrl,\n noContextMenu,\n PageViewport,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n StatTimer,\n};\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 \"./display_utils.js\";\nimport { shadow } from \"../shared/util.js\";\n\n/**\n * Manage the SVGs drawn on top of the page canvas.\n * It's important to have them directly on top of the canvas because we want to\n * be able to use mix-blend-mode for some of them.\n */\nclass DrawLayer {\n #parent = null;\n\n #id = 0;\n\n #mapping = new Map();\n\n constructor({ pageIndex }) {\n this.pageIndex = pageIndex;\n }\n\n setParent(parent) {\n if (!this.#parent) {\n this.#parent = parent;\n return;\n }\n\n if (this.#parent !== parent) {\n if (this.#mapping.size > 0) {\n for (const root of this.#mapping.values()) {\n root.remove();\n parent.append(root);\n }\n }\n this.#parent = parent;\n }\n }\n\n static get _svgFactory() {\n return shadow(this, \"_svgFactory\", new DOMSVGFactory());\n }\n\n static #setBox(element, { x, y, width, height }) {\n const { style } = element;\n style.top = `${100 * y}%`;\n style.left = `${100 * x}%`;\n style.width = `${100 * width}%`;\n style.height = `${100 * height}%`;\n }\n\n #createSVG(box) {\n const svg = DrawLayer._svgFactory.create(1, 1, /* skipDimensions = */ true);\n this.#parent.append(svg);\n DrawLayer.#setBox(svg, box);\n\n return svg;\n }\n\n highlight({ outlines, box }, color, opacity) {\n const id = this.#id++;\n const root = this.#createSVG(box);\n root.classList.add(\"highlight\");\n const defs = DrawLayer._svgFactory.createElement(\"defs\");\n root.append(defs);\n const path = DrawLayer._svgFactory.createElement(\"path\");\n defs.append(path);\n const pathId = `path_p${this.pageIndex}_${id}`;\n path.setAttribute(\"id\", pathId);\n path.setAttribute(\n \"d\",\n DrawLayer.#extractPathFromHighlightOutlines(outlines)\n );\n\n // Create the clipping path for the editor div.\n const clipPath = DrawLayer._svgFactory.createElement(\"clipPath\");\n defs.append(clipPath);\n const clipPathId = `clip_${pathId}`;\n clipPath.setAttribute(\"id\", clipPathId);\n clipPath.setAttribute(\"clipPathUnits\", \"objectBoundingBox\");\n const clipPathUse = DrawLayer._svgFactory.createElement(\"use\");\n clipPath.append(clipPathUse);\n clipPathUse.setAttribute(\"href\", `#${pathId}`);\n clipPathUse.classList.add(\"clip\");\n\n const use = DrawLayer._svgFactory.createElement(\"use\");\n root.append(use);\n root.setAttribute(\"fill\", color);\n root.setAttribute(\"fill-opacity\", opacity);\n use.setAttribute(\"href\", `#${pathId}`);\n\n this.#mapping.set(id, root);\n\n return { id, clipPathId: `url(#${clipPathId})` };\n }\n\n highlightOutline({ outlines, box }) {\n // We cannot draw the outline directly in the SVG for highlights because\n // it composes with its parent with mix-blend-mode: multiply.\n // But the outline has a different mix-blend-mode, so we need to draw it in\n // its own SVG.\n const id = this.#id++;\n const root = this.#createSVG(box);\n root.classList.add(\"highlightOutline\");\n const defs = DrawLayer._svgFactory.createElement(\"defs\");\n root.append(defs);\n const path = DrawLayer._svgFactory.createElement(\"path\");\n defs.append(path);\n const pathId = `path_p${this.pageIndex}_${id}`;\n path.setAttribute(\"id\", pathId);\n path.setAttribute(\n \"d\",\n DrawLayer.#extractPathFromHighlightOutlines(outlines)\n );\n path.setAttribute(\"vector-effect\", \"non-scaling-stroke\");\n\n const use1 = DrawLayer._svgFactory.createElement(\"use\");\n root.append(use1);\n use1.setAttribute(\"href\", `#${pathId}`);\n const use2 = use1.cloneNode();\n root.append(use2);\n use1.classList.add(\"mainOutline\");\n use2.classList.add(\"secondaryOutline\");\n\n this.#mapping.set(id, root);\n\n return id;\n }\n\n static #extractPathFromHighlightOutlines(polygons) {\n const buffer = [];\n for (const polygon of polygons) {\n let [prevX, prevY] = polygon;\n buffer.push(`M${prevX} ${prevY}`);\n for (let i = 2; i < polygon.length; i += 2) {\n const x = polygon[i];\n const y = polygon[i + 1];\n if (x === prevX) {\n buffer.push(`V${y}`);\n prevY = y;\n } else if (y === prevY) {\n buffer.push(`H${x}`);\n prevX = x;\n }\n }\n buffer.push(\"Z\");\n }\n return buffer.join(\" \");\n }\n\n updateBox(id, box) {\n DrawLayer.#setBox(this.#mapping.get(id), box);\n }\n\n rotate(id, angle) {\n this.#mapping.get(id).setAttribute(\"data-main-rotation\", angle);\n }\n\n changeColor(id, color) {\n this.#mapping.get(id).setAttribute(\"fill\", color);\n }\n\n changeOpacity(id, opacity) {\n this.#mapping.get(id).setAttribute(\"fill-opacity\", opacity);\n }\n\n addClass(id, className) {\n this.#mapping.get(id).classList.add(className);\n }\n\n removeClass(id, className) {\n this.#mapping.get(id).classList.remove(className);\n }\n\n remove(id) {\n this.#mapping.get(id).remove();\n this.#mapping.delete(id);\n }\n\n destroy() {\n this.#parent = null;\n for (const root of this.#mapping.values()) {\n root.remove();\n }\n this.#mapping.clear();\n }\n}\n\nexport { DrawLayer };\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// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorType,\n assert,\n LINE_FACTOR,\n shadow,\n Util,\n} from \"../../shared/util.js\";\nimport {\n AnnotationEditorUIManager,\n bindEvents,\n KeyboardManager,\n} from \"./tools.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { FreeTextAnnotationElement } from \"../annotation_layer.js\";\n\n/**\n * Basic text editor in order to create a FreeTex annotation.\n */\nclass FreeTextEditor extends AnnotationEditor {\n #boundEditorDivBlur = this.editorDivBlur.bind(this);\n\n #boundEditorDivFocus = this.editorDivFocus.bind(this);\n\n #boundEditorDivInput = this.editorDivInput.bind(this);\n\n #boundEditorDivKeydown = this.editorDivKeydown.bind(this);\n\n #color;\n\n #content = \"\";\n\n #editorDivId = `${this.id}-editor`;\n\n #fontSize;\n\n #initialData = null;\n\n static _freeTextDefaultContent = \"\";\n\n static _internalPadding = 0;\n\n static _defaultColor = null;\n\n static _defaultFontSize = 10;\n\n static get _keyboardManager() {\n const proto = FreeTextEditor.prototype;\n\n const arrowChecker = self => self.isEmpty();\n\n const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n // Commit the text in case the user use ctrl+s to save the document.\n // The event must bubble in order to be caught by the viewer.\n // See bug 1831574.\n [\"ctrl+s\", \"mac+meta+s\", \"ctrl+p\", \"mac+meta+p\"],\n proto.commitOrRemove,\n { bubbles: true },\n ],\n [\n [\"ctrl+Enter\", \"mac+meta+Enter\", \"Escape\", \"mac+Escape\"],\n proto.commitOrRemove,\n ],\n [\n [\"ArrowLeft\", \"mac+ArrowLeft\"],\n proto._translateEmpty,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto._translateEmpty,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\", \"mac+ArrowRight\"],\n proto._translateEmpty,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto._translateEmpty,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\", \"mac+ArrowUp\"],\n proto._translateEmpty,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto._translateEmpty,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\", \"mac+ArrowDown\"],\n proto._translateEmpty,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto._translateEmpty,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n static _type = \"freetext\";\n\n static _editorType = AnnotationEditorType.FREETEXT;\n\n constructor(params) {\n super({ ...params, name: \"freeTextEditor\" });\n this.#color =\n params.color ||\n FreeTextEditor._defaultColor ||\n AnnotationEditor._defaultLineColor;\n this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize;\n }\n\n /** @inheritdoc */\n static initialize(l10n) {\n AnnotationEditor.initialize(l10n, {\n strings: [\"pdfjs-free-text-default-content\"],\n });\n const style = getComputedStyle(document.documentElement);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n const lineHeight = parseFloat(\n style.getPropertyValue(\"--freetext-line-height\")\n );\n assert(\n lineHeight === LINE_FACTOR,\n \"Update the CSS variable to agree with the constant.\"\n );\n }\n\n this._internalPadding = parseFloat(\n style.getPropertyValue(\"--freetext-padding\")\n );\n }\n\n /** @inheritdoc */\n static updateDefaultParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.FREETEXT_SIZE:\n FreeTextEditor._defaultFontSize = value;\n break;\n case AnnotationEditorParamsType.FREETEXT_COLOR:\n FreeTextEditor._defaultColor = value;\n break;\n }\n }\n\n /** @inheritdoc */\n updateParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.FREETEXT_SIZE:\n this.#updateFontSize(value);\n break;\n case AnnotationEditorParamsType.FREETEXT_COLOR:\n this.#updateColor(value);\n break;\n }\n }\n\n /** @inheritdoc */\n static get defaultPropertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.FREETEXT_SIZE,\n FreeTextEditor._defaultFontSize,\n ],\n [\n AnnotationEditorParamsType.FREETEXT_COLOR,\n FreeTextEditor._defaultColor || AnnotationEditor._defaultLineColor,\n ],\n ];\n }\n\n /** @inheritdoc */\n get propertiesToUpdate() {\n return [\n [AnnotationEditorParamsType.FREETEXT_SIZE, this.#fontSize],\n [AnnotationEditorParamsType.FREETEXT_COLOR, this.#color],\n ];\n }\n\n /**\n * Update the font size and make this action as undoable.\n * @param {number} fontSize\n */\n #updateFontSize(fontSize) {\n const setFontsize = size => {\n this.editorDiv.style.fontSize = `calc(${size}px * var(--scale-factor))`;\n this.translate(0, -(size - this.#fontSize) * this.parentScale);\n this.#fontSize = size;\n this.#setEditorDimensions();\n };\n const savedFontsize = this.#fontSize;\n this.addCommands({\n cmd: () => {\n setFontsize(fontSize);\n },\n undo: () => {\n setFontsize(savedFontsize);\n },\n mustExec: true,\n type: AnnotationEditorParamsType.FREETEXT_SIZE,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Update the color and make this action undoable.\n * @param {string} color\n */\n #updateColor(color) {\n const savedColor = this.#color;\n this.addCommands({\n cmd: () => {\n this.#color = this.editorDiv.style.color = color;\n },\n undo: () => {\n this.#color = this.editorDiv.style.color = savedColor;\n },\n mustExec: true,\n type: AnnotationEditorParamsType.FREETEXT_COLOR,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Helper to translate the editor with the keyboard when it's empty.\n * @param {number} x in page units.\n * @param {number} y in page units.\n */\n _translateEmpty(x, y) {\n this._uiManager.translateSelectedEditors(x, y, /* noCommit = */ true);\n }\n\n /** @inheritdoc */\n getInitialTranslation() {\n // The start of the base line is where the user clicked.\n const scale = this.parentScale;\n return [\n -FreeTextEditor._internalPadding * scale,\n -(FreeTextEditor._internalPadding + this.#fontSize) * scale,\n ];\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilting it,\n // hence we must add it to its parent.\n this.parent.add(this);\n }\n }\n\n /** @inheritdoc */\n enableEditMode() {\n if (this.isInEditMode()) {\n return;\n }\n\n this.parent.setEditingState(false);\n this.parent.updateToolbar(AnnotationEditorType.FREETEXT);\n super.enableEditMode();\n this.overlayDiv.classList.remove(\"enabled\");\n this.editorDiv.contentEditable = true;\n this._isDraggable = false;\n this.div.removeAttribute(\"aria-activedescendant\");\n this.editorDiv.addEventListener(\"keydown\", this.#boundEditorDivKeydown);\n this.editorDiv.addEventListener(\"focus\", this.#boundEditorDivFocus);\n this.editorDiv.addEventListener(\"blur\", this.#boundEditorDivBlur);\n this.editorDiv.addEventListener(\"input\", this.#boundEditorDivInput);\n }\n\n /** @inheritdoc */\n disableEditMode() {\n if (!this.isInEditMode()) {\n return;\n }\n\n this.parent.setEditingState(true);\n super.disableEditMode();\n this.overlayDiv.classList.add(\"enabled\");\n this.editorDiv.contentEditable = false;\n this.div.setAttribute(\"aria-activedescendant\", this.#editorDivId);\n this._isDraggable = true;\n this.editorDiv.removeEventListener(\"keydown\", this.#boundEditorDivKeydown);\n this.editorDiv.removeEventListener(\"focus\", this.#boundEditorDivFocus);\n this.editorDiv.removeEventListener(\"blur\", this.#boundEditorDivBlur);\n this.editorDiv.removeEventListener(\"input\", this.#boundEditorDivInput);\n\n // On Chrome, the focus is given to <body> when contentEditable is set to\n // false, hence we focus the div.\n this.div.focus({\n preventScroll: true /* See issue #15744 */,\n });\n\n // In case the blur callback hasn't been called.\n this.isEditing = false;\n this.parent.div.classList.add(\"freetextEditing\");\n }\n\n /** @inheritdoc */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n super.focusin(event);\n if (event.target !== this.editorDiv) {\n this.editorDiv.focus();\n }\n }\n\n /** @inheritdoc */\n onceAdded() {\n if (this.width) {\n this.#cheatInitialRect();\n // The editor was created in using ctrl+c.\n return;\n }\n this.enableEditMode();\n this.editorDiv.focus();\n if (this._initialOptions?.isCentered) {\n this.center();\n }\n this._initialOptions = null;\n }\n\n /** @inheritdoc */\n isEmpty() {\n return !this.editorDiv || this.editorDiv.innerText.trim() === \"\";\n }\n\n /** @inheritdoc */\n remove() {\n this.isEditing = false;\n if (this.parent) {\n this.parent.setEditingState(true);\n this.parent.div.classList.add(\"freetextEditing\");\n }\n super.remove();\n }\n\n /**\n * Extract the text from this editor.\n * @returns {string}\n */\n #extractText() {\n const divs = this.editorDiv.getElementsByTagName(\"div\");\n if (divs.length === 0) {\n return this.editorDiv.innerText;\n }\n const buffer = [];\n for (const div of divs) {\n buffer.push(div.innerText.replace(/\\r\\n?|\\n/, \"\"));\n }\n return buffer.join(\"\\n\");\n }\n\n #setEditorDimensions() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n\n let rect;\n if (this.isAttachedToDOM) {\n rect = this.div.getBoundingClientRect();\n } else {\n // This editor isn't on screen but we need to get its dimensions, so\n // we just insert it in the DOM, get its bounding box and then remove it.\n const { currentLayer, div } = this;\n const savedDisplay = div.style.display;\n div.style.display = \"hidden\";\n currentLayer.div.append(this.div);\n rect = div.getBoundingClientRect();\n div.remove();\n div.style.display = savedDisplay;\n }\n\n // The dimensions are relative to the rotation of the page, hence we need to\n // take that into account (see issue #16636).\n if (this.rotation % 180 === this.parentRotation % 180) {\n this.width = rect.width / parentWidth;\n this.height = rect.height / parentHeight;\n } else {\n this.width = rect.height / parentWidth;\n this.height = rect.width / parentHeight;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Commit the content we have in this editor.\n * @returns {undefined}\n */\n commit() {\n if (!this.isInEditMode()) {\n return;\n }\n\n super.commit();\n this.disableEditMode();\n const savedText = this.#content;\n const newText = (this.#content = this.#extractText().trimEnd());\n if (savedText === newText) {\n return;\n }\n\n const setText = text => {\n this.#content = text;\n if (!text) {\n this.remove();\n return;\n }\n this.#setContent();\n this._uiManager.rebuild(this);\n this.#setEditorDimensions();\n };\n this.addCommands({\n cmd: () => {\n setText(newText);\n },\n undo: () => {\n setText(savedText);\n },\n mustExec: false,\n });\n this.#setEditorDimensions();\n }\n\n /** @inheritdoc */\n shouldGetKeyboardEvents() {\n return this.isInEditMode();\n }\n\n /** @inheritdoc */\n enterInEditMode() {\n this.enableEditMode();\n this.editorDiv.focus();\n }\n\n /**\n * ondblclick callback.\n * @param {MouseEvent} event\n */\n dblclick(event) {\n this.enterInEditMode();\n }\n\n /**\n * onkeydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (event.target === this.div && event.key === \"Enter\") {\n this.enterInEditMode();\n // Avoid to add an unwanted new line.\n event.preventDefault();\n }\n }\n\n editorDivKeydown(event) {\n FreeTextEditor._keyboardManager.exec(this, event);\n }\n\n editorDivFocus(event) {\n this.isEditing = true;\n }\n\n editorDivBlur(event) {\n this.isEditing = false;\n }\n\n editorDivInput(event) {\n this.parent.div.classList.toggle(\"freetextEditing\", this.isEmpty());\n }\n\n /** @inheritdoc */\n disableEditing() {\n this.editorDiv.setAttribute(\"role\", \"comment\");\n this.editorDiv.removeAttribute(\"aria-multiline\");\n }\n\n /** @inheritdoc */\n enableEditing() {\n this.editorDiv.setAttribute(\"role\", \"textbox\");\n this.editorDiv.setAttribute(\"aria-multiline\", true);\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this.width) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n this.editorDiv = document.createElement(\"div\");\n this.editorDiv.className = \"internal\";\n\n this.editorDiv.setAttribute(\"id\", this.#editorDivId);\n this.editorDiv.setAttribute(\"data-l10n-id\", \"pdfjs-free-text\");\n this.enableEditing();\n\n AnnotationEditor._l10nPromise\n .get(\"pdfjs-free-text-default-content\")\n .then(msg => this.editorDiv?.setAttribute(\"default-content\", msg));\n this.editorDiv.contentEditable = true;\n\n const { style } = this.editorDiv;\n style.fontSize = `calc(${this.#fontSize}px * var(--scale-factor))`;\n style.color = this.#color;\n\n this.div.append(this.editorDiv);\n\n this.overlayDiv = document.createElement(\"div\");\n this.overlayDiv.classList.add(\"overlay\", \"enabled\");\n this.div.append(this.overlayDiv);\n\n // TODO: implement paste callback.\n // The goal is to sanitize and have something suitable for this\n // editor.\n bindEvents(this, this.div, [\"dblclick\", \"keydown\"]);\n\n if (this.width) {\n // This editor was created in using copy (ctrl+c).\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.annotationElementId) {\n // This stuff is hard to test: if something is changed here, please\n // test with the following PDF file:\n // - freetexts.pdf\n // - rotated_freetexts.pdf\n // Only small variations between the original annotation and its editor\n // are allowed.\n\n // position is the position of the first glyph in the annotation\n // and it's relative to its container.\n const { position } = this.#initialData;\n let [tx, ty] = this.getInitialTranslation();\n [tx, ty] = this.pageTranslationToScreen(tx, ty);\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n let posX, posY;\n switch (this.rotation) {\n case 0:\n posX = baseX + (position[0] - pageX) / pageWidth;\n posY = baseY + this.height - (position[1] - pageY) / pageHeight;\n break;\n case 90:\n posX = baseX + (position[0] - pageX) / pageWidth;\n posY = baseY - (position[1] - pageY) / pageHeight;\n [tx, ty] = [ty, -tx];\n break;\n case 180:\n posX = baseX - this.width + (position[0] - pageX) / pageWidth;\n posY = baseY - (position[1] - pageY) / pageHeight;\n [tx, ty] = [-tx, -ty];\n break;\n case 270:\n posX =\n baseX +\n (position[0] - pageX - this.height * pageHeight) / pageWidth;\n posY =\n baseY +\n (position[1] - pageY - this.width * pageWidth) / pageHeight;\n [tx, ty] = [-ty, tx];\n break;\n }\n this.setAt(posX * parentWidth, posY * parentHeight, tx, ty);\n } else {\n this.setAt(\n baseX * parentWidth,\n baseY * parentHeight,\n this.width * parentWidth,\n this.height * parentHeight\n );\n }\n\n this.#setContent();\n this._isDraggable = true;\n this.editorDiv.contentEditable = false;\n } else {\n this._isDraggable = false;\n this.editorDiv.contentEditable = true;\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.div.setAttribute(\"annotation-id\", this.annotationElementId);\n }\n\n return this.div;\n }\n\n #setContent() {\n this.editorDiv.replaceChildren();\n if (!this.#content) {\n return;\n }\n for (const line of this.#content.split(\"\\n\")) {\n const div = document.createElement(\"div\");\n div.append(\n line ? document.createTextNode(line) : document.createElement(\"br\")\n );\n this.editorDiv.append(div);\n }\n }\n\n /** @inheritdoc */\n get contentDiv() {\n return this.editorDiv;\n }\n\n /** @inheritdoc */\n static deserialize(data, parent, uiManager) {\n let initialData = null;\n if (data instanceof FreeTextAnnotationElement) {\n const {\n data: {\n defaultAppearanceData: { fontSize, fontColor },\n rect,\n rotation,\n id,\n },\n textContent,\n textPosition,\n parent: {\n page: { pageNumber },\n },\n } = data;\n // textContent is supposed to be an array of strings containing each line\n // of text. However, it can be null or empty.\n if (!textContent || textContent.length === 0) {\n // Empty annotation.\n return null;\n }\n initialData = data = {\n annotationType: AnnotationEditorType.FREETEXT,\n color: Array.from(fontColor),\n fontSize,\n value: textContent.join(\"\\n\"),\n position: textPosition,\n pageIndex: pageNumber - 1,\n rect,\n rotation,\n id,\n deleted: false,\n };\n }\n const editor = super.deserialize(data, parent, uiManager);\n\n editor.#fontSize = data.fontSize;\n editor.#color = Util.makeHexColor(...data.color);\n editor.#content = data.value;\n editor.annotationElementId = data.id || null;\n editor.#initialData = initialData;\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false) {\n if (this.isEmpty()) {\n return null;\n }\n\n if (this.deleted) {\n return {\n pageIndex: this.pageIndex,\n id: this.annotationElementId,\n deleted: true,\n };\n }\n\n const padding = FreeTextEditor._internalPadding * this.parentScale;\n const rect = this.getRect(padding, padding);\n const color = AnnotationEditor._colorManager.convert(\n this.isAttachedToDOM\n ? getComputedStyle(this.editorDiv).color\n : this.#color\n );\n\n const serialized = {\n annotationType: AnnotationEditorType.FREETEXT,\n color,\n fontSize: this.#fontSize,\n value: this.#content,\n pageIndex: this.pageIndex,\n rect,\n rotation: this.rotation,\n structTreeParentId: this._structTreeParentId,\n };\n\n if (isForCopying) {\n // Don't add the id when copying because the pasted editor mustn't be\n // linked to an existing annotation.\n return serialized;\n }\n\n if (this.annotationElementId && !this.#hasElementChanged(serialized)) {\n return null;\n }\n\n serialized.id = this.annotationElementId;\n\n return serialized;\n }\n\n #hasElementChanged(serialized) {\n const { value, fontSize, color, rect, pageIndex } = this.#initialData;\n\n return (\n serialized.value !== value ||\n serialized.fontSize !== fontSize ||\n serialized.rect.some((x, i) => Math.abs(x - rect[i]) >= 1) ||\n serialized.color.some((c, i) => c !== color[i]) ||\n serialized.pageIndex !== pageIndex\n );\n }\n\n #cheatInitialRect(delayed = false) {\n // The annotation has a rect but the editor has an other one.\n // When we want to know if the annotation has changed (e.g. has been moved)\n // we must compare the editor initial rect with the current one.\n // So this method is a hack to have a way to compare the real rects.\n if (!this.annotationElementId) {\n return;\n }\n\n this.#setEditorDimensions();\n if (!delayed && (this.width === 0 || this.height === 0)) {\n setTimeout(() => this.#cheatInitialRect(/* delayed = */ true), 0);\n return;\n }\n\n const padding = FreeTextEditor._internalPadding * this.parentScale;\n this.#initialData.rect = this.getRect(padding, padding);\n }\n}\n\nexport { FreeTextEditor };\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 {\n AnnotationEditorParamsType,\n AnnotationEditorType,\n Util,\n} from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { InkAnnotationElement } from \"../annotation_layer.js\";\nimport { noContextMenu } from \"../display_utils.js\";\nimport { opacityToHex } from \"./tools.js\";\n\n/**\n * Basic draw editor in order to generate an Ink annotation.\n */\nclass InkEditor extends AnnotationEditor {\n #baseHeight = 0;\n\n #baseWidth = 0;\n\n #boundCanvasPointermove = this.canvasPointermove.bind(this);\n\n #boundCanvasPointerleave = this.canvasPointerleave.bind(this);\n\n #boundCanvasPointerup = this.canvasPointerup.bind(this);\n\n #boundCanvasPointerdown = this.canvasPointerdown.bind(this);\n\n #canvasContextMenuTimeoutId = null;\n\n #currentPath2D = new Path2D();\n\n #disableEditing = false;\n\n #hasSomethingToDraw = false;\n\n #isCanvasInitialized = false;\n\n #observer = null;\n\n #realWidth = 0;\n\n #realHeight = 0;\n\n #requestFrameCallback = null;\n\n static _defaultColor = null;\n\n static _defaultOpacity = 1;\n\n static _defaultThickness = 1;\n\n static _type = \"ink\";\n\n static _editorType = AnnotationEditorType.INK;\n\n constructor(params) {\n super({ ...params, name: \"inkEditor\" });\n this.color = params.color || null;\n this.thickness = params.thickness || null;\n this.opacity = params.opacity || null;\n this.paths = [];\n this.bezierPath2D = [];\n this.allRawPaths = [];\n this.currentPath = [];\n this.scaleFactor = 1;\n this.translationX = this.translationY = 0;\n this.x = 0;\n this.y = 0;\n this._willKeepAspectRatio = true;\n }\n\n /** @inheritdoc */\n static initialize(l10n) {\n AnnotationEditor.initialize(l10n);\n }\n\n /** @inheritdoc */\n static updateDefaultParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.INK_THICKNESS:\n InkEditor._defaultThickness = value;\n break;\n case AnnotationEditorParamsType.INK_COLOR:\n InkEditor._defaultColor = value;\n break;\n case AnnotationEditorParamsType.INK_OPACITY:\n InkEditor._defaultOpacity = value / 100;\n break;\n }\n }\n\n /** @inheritdoc */\n updateParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.INK_THICKNESS:\n this.#updateThickness(value);\n break;\n case AnnotationEditorParamsType.INK_COLOR:\n this.#updateColor(value);\n break;\n case AnnotationEditorParamsType.INK_OPACITY:\n this.#updateOpacity(value);\n break;\n }\n }\n\n /** @inheritdoc */\n static get defaultPropertiesToUpdate() {\n return [\n [AnnotationEditorParamsType.INK_THICKNESS, InkEditor._defaultThickness],\n [\n AnnotationEditorParamsType.INK_COLOR,\n InkEditor._defaultColor || AnnotationEditor._defaultLineColor,\n ],\n [\n AnnotationEditorParamsType.INK_OPACITY,\n Math.round(InkEditor._defaultOpacity * 100),\n ],\n ];\n }\n\n /** @inheritdoc */\n get propertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.INK_THICKNESS,\n this.thickness || InkEditor._defaultThickness,\n ],\n [\n AnnotationEditorParamsType.INK_COLOR,\n this.color ||\n InkEditor._defaultColor ||\n AnnotationEditor._defaultLineColor,\n ],\n [\n AnnotationEditorParamsType.INK_OPACITY,\n Math.round(100 * (this.opacity ?? InkEditor._defaultOpacity)),\n ],\n ];\n }\n\n /**\n * Update the thickness and make this action undoable.\n * @param {number} thickness\n */\n #updateThickness(thickness) {\n const savedThickness = this.thickness;\n this.addCommands({\n cmd: () => {\n this.thickness = thickness;\n this.#fitToContent();\n },\n undo: () => {\n this.thickness = savedThickness;\n this.#fitToContent();\n },\n mustExec: true,\n type: AnnotationEditorParamsType.INK_THICKNESS,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Update the color and make this action undoable.\n * @param {string} color\n */\n #updateColor(color) {\n const savedColor = this.color;\n this.addCommands({\n cmd: () => {\n this.color = color;\n this.#redraw();\n },\n undo: () => {\n this.color = savedColor;\n this.#redraw();\n },\n mustExec: true,\n type: AnnotationEditorParamsType.INK_COLOR,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Update the opacity and make this action undoable.\n * @param {number} opacity\n */\n #updateOpacity(opacity) {\n opacity /= 100;\n const savedOpacity = this.opacity;\n this.addCommands({\n cmd: () => {\n this.opacity = opacity;\n this.#redraw();\n },\n undo: () => {\n this.opacity = savedOpacity;\n this.#redraw();\n },\n mustExec: true,\n type: AnnotationEditorParamsType.INK_OPACITY,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n if (!this.canvas) {\n this.#createCanvas();\n this.#createObserver();\n }\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilding it,\n // hence we must add it to its parent.\n this.parent.add(this);\n this.#setCanvasDims();\n }\n this.#fitToContent();\n }\n\n /** @inheritdoc */\n remove() {\n if (this.canvas === null) {\n return;\n }\n\n if (!this.isEmpty()) {\n this.commit();\n }\n\n // Destroy the canvas.\n this.canvas.width = this.canvas.height = 0;\n this.canvas.remove();\n this.canvas = null;\n\n if (this.#canvasContextMenuTimeoutId) {\n clearTimeout(this.#canvasContextMenuTimeoutId);\n this.#canvasContextMenuTimeoutId = null;\n }\n\n this.#observer.disconnect();\n this.#observer = null;\n\n super.remove();\n }\n\n setParent(parent) {\n if (!this.parent && parent) {\n // We've a parent hence the rescale will be handled thanks to the\n // ResizeObserver.\n this._uiManager.removeShouldRescale(this);\n } else if (this.parent && parent === null) {\n // The editor is removed from the DOM, hence we handle the rescale thanks\n // to the onScaleChanging callback.\n // This way, it'll be saved/printed correctly.\n this._uiManager.addShouldRescale(this);\n }\n super.setParent(parent);\n }\n\n onScaleChanging() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const width = this.width * parentWidth;\n const height = this.height * parentHeight;\n this.setDimensions(width, height);\n }\n\n /** @inheritdoc */\n enableEditMode() {\n if (this.#disableEditing || this.canvas === null) {\n return;\n }\n\n super.enableEditMode();\n this._isDraggable = false;\n this.canvas.addEventListener(\"pointerdown\", this.#boundCanvasPointerdown);\n }\n\n /** @inheritdoc */\n disableEditMode() {\n if (!this.isInEditMode() || this.canvas === null) {\n return;\n }\n\n super.disableEditMode();\n this._isDraggable = !this.isEmpty();\n this.div.classList.remove(\"editing\");\n\n this.canvas.removeEventListener(\n \"pointerdown\",\n this.#boundCanvasPointerdown\n );\n }\n\n /** @inheritdoc */\n onceAdded() {\n this._isDraggable = !this.isEmpty();\n }\n\n /** @inheritdoc */\n isEmpty() {\n return (\n this.paths.length === 0 ||\n (this.paths.length === 1 && this.paths[0].length === 0)\n );\n }\n\n #getInitialBBox() {\n const {\n parentRotation,\n parentDimensions: [width, height],\n } = this;\n switch (parentRotation) {\n case 90:\n return [0, height, height, width];\n case 180:\n return [width, height, width, height];\n case 270:\n return [width, 0, height, width];\n default:\n return [0, 0, width, height];\n }\n }\n\n /**\n * Set line styles.\n */\n #setStroke() {\n const { ctx, color, opacity, thickness, parentScale, scaleFactor } = this;\n ctx.lineWidth = (thickness * parentScale) / scaleFactor;\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n ctx.miterLimit = 10;\n ctx.strokeStyle = `${color}${opacityToHex(opacity)}`;\n }\n\n /**\n * Start to draw on the canvas.\n * @param {number} x\n * @param {number} y\n */\n #startDrawing(x, y) {\n this.canvas.addEventListener(\"contextmenu\", noContextMenu);\n this.canvas.addEventListener(\"pointerleave\", this.#boundCanvasPointerleave);\n this.canvas.addEventListener(\"pointermove\", this.#boundCanvasPointermove);\n this.canvas.addEventListener(\"pointerup\", this.#boundCanvasPointerup);\n this.canvas.removeEventListener(\n \"pointerdown\",\n this.#boundCanvasPointerdown\n );\n\n this.isEditing = true;\n if (!this.#isCanvasInitialized) {\n this.#isCanvasInitialized = true;\n this.#setCanvasDims();\n this.thickness ||= InkEditor._defaultThickness;\n this.color ||=\n InkEditor._defaultColor || AnnotationEditor._defaultLineColor;\n this.opacity ??= InkEditor._defaultOpacity;\n }\n this.currentPath.push([x, y]);\n this.#hasSomethingToDraw = false;\n this.#setStroke();\n\n this.#requestFrameCallback = () => {\n this.#drawPoints();\n if (this.#requestFrameCallback) {\n window.requestAnimationFrame(this.#requestFrameCallback);\n }\n };\n window.requestAnimationFrame(this.#requestFrameCallback);\n }\n\n /**\n * Draw on the canvas.\n * @param {number} x\n * @param {number} y\n */\n #draw(x, y) {\n const [lastX, lastY] = this.currentPath.at(-1);\n if (this.currentPath.length > 1 && x === lastX && y === lastY) {\n return;\n }\n const currentPath = this.currentPath;\n let path2D = this.#currentPath2D;\n currentPath.push([x, y]);\n this.#hasSomethingToDraw = true;\n\n if (currentPath.length <= 2) {\n path2D.moveTo(...currentPath[0]);\n path2D.lineTo(x, y);\n return;\n }\n\n if (currentPath.length === 3) {\n this.#currentPath2D = path2D = new Path2D();\n path2D.moveTo(...currentPath[0]);\n }\n\n this.#makeBezierCurve(\n path2D,\n ...currentPath.at(-3),\n ...currentPath.at(-2),\n x,\n y\n );\n }\n\n #endPath() {\n if (this.currentPath.length === 0) {\n return;\n }\n const lastPoint = this.currentPath.at(-1);\n this.#currentPath2D.lineTo(...lastPoint);\n }\n\n /**\n * Stop to draw on the canvas.\n * @param {number} x\n * @param {number} y\n */\n #stopDrawing(x, y) {\n this.#requestFrameCallback = null;\n\n x = Math.min(Math.max(x, 0), this.canvas.width);\n y = Math.min(Math.max(y, 0), this.canvas.height);\n\n this.#draw(x, y);\n this.#endPath();\n\n // Interpolate the path entered by the user with some\n // Bezier's curves in order to have a smoother path and\n // to reduce the data size used to draw it in the PDF.\n let bezier;\n if (this.currentPath.length !== 1) {\n bezier = this.#generateBezierPoints();\n } else {\n // We have only one point finally.\n const xy = [x, y];\n bezier = [[xy, xy.slice(), xy.slice(), xy]];\n }\n const path2D = this.#currentPath2D;\n const currentPath = this.currentPath;\n this.currentPath = [];\n this.#currentPath2D = new Path2D();\n\n const cmd = () => {\n this.allRawPaths.push(currentPath);\n this.paths.push(bezier);\n this.bezierPath2D.push(path2D);\n this.rebuild();\n };\n\n const undo = () => {\n this.allRawPaths.pop();\n this.paths.pop();\n this.bezierPath2D.pop();\n if (this.paths.length === 0) {\n this.remove();\n } else {\n if (!this.canvas) {\n this.#createCanvas();\n this.#createObserver();\n }\n this.#fitToContent();\n }\n };\n\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n #drawPoints() {\n if (!this.#hasSomethingToDraw) {\n return;\n }\n this.#hasSomethingToDraw = false;\n\n const thickness = Math.ceil(this.thickness * this.parentScale);\n const lastPoints = this.currentPath.slice(-3);\n const x = lastPoints.map(xy => xy[0]);\n const y = lastPoints.map(xy => xy[1]);\n const xMin = Math.min(...x) - thickness;\n const xMax = Math.max(...x) + thickness;\n const yMin = Math.min(...y) - thickness;\n const yMax = Math.max(...y) + thickness;\n\n const { ctx } = this;\n ctx.save();\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n // In Chrome, the clip() method doesn't work as expected.\n ctx.clearRect(xMin, yMin, xMax - xMin, yMax - yMin);\n ctx.beginPath();\n ctx.rect(xMin, yMin, xMax - xMin, yMax - yMin);\n ctx.clip();\n } else {\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n\n for (const path of this.bezierPath2D) {\n ctx.stroke(path);\n }\n ctx.stroke(this.#currentPath2D);\n\n ctx.restore();\n }\n\n #makeBezierCurve(path2D, x0, y0, x1, y1, x2, y2) {\n const prevX = (x0 + x1) / 2;\n const prevY = (y0 + y1) / 2;\n const x3 = (x1 + x2) / 2;\n const y3 = (y1 + y2) / 2;\n\n path2D.bezierCurveTo(\n prevX + (2 * (x1 - prevX)) / 3,\n prevY + (2 * (y1 - prevY)) / 3,\n x3 + (2 * (x1 - x3)) / 3,\n y3 + (2 * (y1 - y3)) / 3,\n x3,\n y3\n );\n }\n\n #generateBezierPoints() {\n const path = this.currentPath;\n if (path.length <= 2) {\n return [[path[0], path[0], path.at(-1), path.at(-1)]];\n }\n\n const bezierPoints = [];\n let i;\n let [x0, y0] = path[0];\n for (i = 1; i < path.length - 2; i++) {\n const [x1, y1] = path[i];\n const [x2, y2] = path[i + 1];\n const x3 = (x1 + x2) / 2;\n const y3 = (y1 + y2) / 2;\n\n // The quadratic is: [[x0, y0], [x1, y1], [x3, y3]].\n // Convert the quadratic to a cubic\n // (see https://fontforge.org/docs/techref/bezier.html#converting-truetype-to-postscript)\n const control1 = [x0 + (2 * (x1 - x0)) / 3, y0 + (2 * (y1 - y0)) / 3];\n const control2 = [x3 + (2 * (x1 - x3)) / 3, y3 + (2 * (y1 - y3)) / 3];\n\n bezierPoints.push([[x0, y0], control1, control2, [x3, y3]]);\n\n [x0, y0] = [x3, y3];\n }\n\n const [x1, y1] = path[i];\n const [x2, y2] = path[i + 1];\n\n // The quadratic is: [[x0, y0], [x1, y1], [x2, y2]].\n const control1 = [x0 + (2 * (x1 - x0)) / 3, y0 + (2 * (y1 - y0)) / 3];\n const control2 = [x2 + (2 * (x1 - x2)) / 3, y2 + (2 * (y1 - y2)) / 3];\n\n bezierPoints.push([[x0, y0], control1, control2, [x2, y2]]);\n return bezierPoints;\n }\n\n /**\n * Redraw all the paths.\n */\n #redraw() {\n if (this.isEmpty()) {\n this.#updateTransform();\n return;\n }\n this.#setStroke();\n\n const { canvas, ctx } = this;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n this.#updateTransform();\n\n for (const path of this.bezierPath2D) {\n ctx.stroke(path);\n }\n }\n\n /**\n * Commit the curves we have in this editor.\n */\n commit() {\n if (this.#disableEditing) {\n return;\n }\n\n super.commit();\n\n this.isEditing = false;\n this.disableEditMode();\n\n // This editor must be on top of the main ink editor.\n this.setInForeground();\n\n this.#disableEditing = true;\n this.div.classList.add(\"disabled\");\n\n this.#fitToContent(/* firstTime = */ true);\n this.select();\n\n this.parent.addInkEditorIfNeeded(/* isCommitting = */ true);\n\n // When commiting, the position of this editor is changed, hence we must\n // move it to the right position in the DOM.\n this.moveInDOM();\n this.div.focus({\n preventScroll: true /* See issue #15744 */,\n });\n }\n\n /** @inheritdoc */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n super.focusin(event);\n this.enableEditMode();\n }\n\n /**\n * onpointerdown callback for the canvas we're drawing on.\n * @param {PointerEvent} event\n */\n canvasPointerdown(event) {\n if (event.button !== 0 || !this.isInEditMode() || this.#disableEditing) {\n return;\n }\n\n // We want to draw on top of any other editors.\n // Since it's the last child, there's no need to give it a higher z-index.\n this.setInForeground();\n\n event.preventDefault();\n\n if (\n event.pointerType !== \"mouse\" &&\n !this.div.contains(document.activeElement)\n ) {\n this.div.focus({\n preventScroll: true /* See issue #17327 */,\n });\n }\n\n this.#startDrawing(event.offsetX, event.offsetY);\n }\n\n /**\n * onpointermove callback for the canvas we're drawing on.\n * @param {PointerEvent} event\n */\n canvasPointermove(event) {\n event.preventDefault();\n this.#draw(event.offsetX, event.offsetY);\n }\n\n /**\n * onpointerup callback for the canvas we're drawing on.\n * @param {PointerEvent} event\n */\n canvasPointerup(event) {\n event.preventDefault();\n this.#endDrawing(event);\n }\n\n /**\n * onpointerleave callback for the canvas we're drawing on.\n * @param {PointerEvent} event\n */\n canvasPointerleave(event) {\n this.#endDrawing(event);\n }\n\n /**\n * End the drawing.\n * @param {PointerEvent} event\n */\n #endDrawing(event) {\n this.canvas.removeEventListener(\n \"pointerleave\",\n this.#boundCanvasPointerleave\n );\n this.canvas.removeEventListener(\n \"pointermove\",\n this.#boundCanvasPointermove\n );\n this.canvas.removeEventListener(\"pointerup\", this.#boundCanvasPointerup);\n this.canvas.addEventListener(\"pointerdown\", this.#boundCanvasPointerdown);\n\n // Slight delay to avoid the context menu to appear (it can happen on a long\n // tap with a pen).\n if (this.#canvasContextMenuTimeoutId) {\n clearTimeout(this.#canvasContextMenuTimeoutId);\n }\n this.#canvasContextMenuTimeoutId = setTimeout(() => {\n this.#canvasContextMenuTimeoutId = null;\n this.canvas.removeEventListener(\"contextmenu\", noContextMenu);\n }, 10);\n\n this.#stopDrawing(event.offsetX, event.offsetY);\n\n this.addToAnnotationStorage();\n\n // Since the ink editor covers all of the page and we want to be able\n // to select another editor, we just put this one in the background.\n this.setInBackground();\n }\n\n /**\n * Create the canvas element.\n */\n #createCanvas() {\n this.canvas = document.createElement(\"canvas\");\n this.canvas.width = this.canvas.height = 0;\n this.canvas.className = \"inkEditorCanvas\";\n this.canvas.setAttribute(\"data-l10n-id\", \"pdfjs-ink-canvas\");\n\n this.div.append(this.canvas);\n this.ctx = this.canvas.getContext(\"2d\");\n }\n\n /**\n * Create the resize observer.\n */\n #createObserver() {\n this.#observer = new ResizeObserver(entries => {\n const rect = entries[0].contentRect;\n if (rect.width && rect.height) {\n this.setDimensions(rect.width, rect.height);\n }\n });\n this.#observer.observe(this.div);\n }\n\n /** @inheritdoc */\n get isResizable() {\n return !this.isEmpty() && this.#disableEditing;\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this.width) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n\n this.div.setAttribute(\"data-l10n-id\", \"pdfjs-ink\");\n\n const [x, y, w, h] = this.#getInitialBBox();\n this.setAt(x, y, 0, 0);\n this.setDims(w, h);\n\n this.#createCanvas();\n\n if (this.width) {\n // This editor was created in using copy (ctrl+c).\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setAspectRatio(this.width * parentWidth, this.height * parentHeight);\n this.setAt(\n baseX * parentWidth,\n baseY * parentHeight,\n this.width * parentWidth,\n this.height * parentHeight\n );\n this.#isCanvasInitialized = true;\n this.#setCanvasDims();\n this.setDims(this.width * parentWidth, this.height * parentHeight);\n this.#redraw();\n this.div.classList.add(\"disabled\");\n } else {\n this.div.classList.add(\"editing\");\n this.enableEditMode();\n }\n\n this.#createObserver();\n\n return this.div;\n }\n\n #setCanvasDims() {\n if (!this.#isCanvasInitialized) {\n return;\n }\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.canvas.width = Math.ceil(this.width * parentWidth);\n this.canvas.height = Math.ceil(this.height * parentHeight);\n this.#updateTransform();\n }\n\n /**\n * When the dimensions of the div change the inner canvas must\n * renew its dimensions, hence it must redraw its own contents.\n * @param {number} width - the new width of the div\n * @param {number} height - the new height of the div\n * @returns\n */\n setDimensions(width, height) {\n const roundedWidth = Math.round(width);\n const roundedHeight = Math.round(height);\n if (\n this.#realWidth === roundedWidth &&\n this.#realHeight === roundedHeight\n ) {\n return;\n }\n\n this.#realWidth = roundedWidth;\n this.#realHeight = roundedHeight;\n\n this.canvas.style.visibility = \"hidden\";\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.width = width / parentWidth;\n this.height = height / parentHeight;\n this.fixAndSetPosition();\n\n if (this.#disableEditing) {\n this.#setScaleFactor(width, height);\n }\n\n this.#setCanvasDims();\n this.#redraw();\n\n this.canvas.style.visibility = \"visible\";\n\n // For any reason the dimensions couldn't be in percent but in pixels, hence\n // we must fix them.\n this.fixDims();\n }\n\n #setScaleFactor(width, height) {\n const padding = this.#getPadding();\n const scaleFactorW = (width - padding) / this.#baseWidth;\n const scaleFactorH = (height - padding) / this.#baseHeight;\n this.scaleFactor = Math.min(scaleFactorW, scaleFactorH);\n }\n\n /**\n * Update the canvas transform.\n */\n #updateTransform() {\n const padding = this.#getPadding() / 2;\n this.ctx.setTransform(\n this.scaleFactor,\n 0,\n 0,\n this.scaleFactor,\n this.translationX * this.scaleFactor + padding,\n this.translationY * this.scaleFactor + padding\n );\n }\n\n /**\n * Convert into a Path2D.\n * @param {Array<Array<number>>} bezier\n * @returns {Path2D}\n */\n static #buildPath2D(bezier) {\n const path2D = new Path2D();\n for (let i = 0, ii = bezier.length; i < ii; i++) {\n const [first, control1, control2, second] = bezier[i];\n if (i === 0) {\n path2D.moveTo(...first);\n }\n path2D.bezierCurveTo(\n control1[0],\n control1[1],\n control2[0],\n control2[1],\n second[0],\n second[1]\n );\n }\n return path2D;\n }\n\n static #toPDFCoordinates(points, rect, rotation) {\n const [blX, blY, trX, trY] = rect;\n\n switch (rotation) {\n case 0:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] += blX;\n points[i + 1] = trY - points[i + 1];\n }\n break;\n case 90:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n const x = points[i];\n points[i] = points[i + 1] + blX;\n points[i + 1] = x + blY;\n }\n break;\n case 180:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] = trX - points[i];\n points[i + 1] += blY;\n }\n break;\n case 270:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n const x = points[i];\n points[i] = trX - points[i + 1];\n points[i + 1] = trY - x;\n }\n break;\n default:\n throw new Error(\"Invalid rotation\");\n }\n return points;\n }\n\n static #fromPDFCoordinates(points, rect, rotation) {\n const [blX, blY, trX, trY] = rect;\n\n switch (rotation) {\n case 0:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] -= blX;\n points[i + 1] = trY - points[i + 1];\n }\n break;\n case 90:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n const x = points[i];\n points[i] = points[i + 1] - blY;\n points[i + 1] = x - blX;\n }\n break;\n case 180:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] = trX - points[i];\n points[i + 1] -= blY;\n }\n break;\n case 270:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n const x = points[i];\n points[i] = trY - points[i + 1];\n points[i + 1] = trX - x;\n }\n break;\n default:\n throw new Error(\"Invalid rotation\");\n }\n return points;\n }\n\n /**\n * Transform and serialize the paths.\n * @param {number} s - scale factor\n * @param {number} tx - abscissa of the translation\n * @param {number} ty - ordinate of the translation\n * @param {Array<number>} rect - the bounding box of the annotation\n */\n #serializePaths(s, tx, ty, rect) {\n const paths = [];\n const padding = this.thickness / 2;\n const shiftX = s * tx + padding;\n const shiftY = s * ty + padding;\n for (const bezier of this.paths) {\n const buffer = [];\n const points = [];\n for (let j = 0, jj = bezier.length; j < jj; j++) {\n const [first, control1, control2, second] = bezier[j];\n const p10 = s * first[0] + shiftX;\n const p11 = s * first[1] + shiftY;\n const p20 = s * control1[0] + shiftX;\n const p21 = s * control1[1] + shiftY;\n const p30 = s * control2[0] + shiftX;\n const p31 = s * control2[1] + shiftY;\n const p40 = s * second[0] + shiftX;\n const p41 = s * second[1] + shiftY;\n\n if (j === 0) {\n buffer.push(p10, p11);\n points.push(p10, p11);\n }\n buffer.push(p20, p21, p30, p31, p40, p41);\n points.push(p20, p21);\n if (j === jj - 1) {\n points.push(p40, p41);\n }\n }\n paths.push({\n bezier: InkEditor.#toPDFCoordinates(buffer, rect, this.rotation),\n points: InkEditor.#toPDFCoordinates(points, rect, this.rotation),\n });\n }\n\n return paths;\n }\n\n /**\n * Get the bounding box containing all the paths.\n * @returns {Array<number>}\n */\n #getBbox() {\n let xMin = Infinity;\n let xMax = -Infinity;\n let yMin = Infinity;\n let yMax = -Infinity;\n\n for (const path of this.paths) {\n for (const [first, control1, control2, second] of path) {\n const bbox = Util.bezierBoundingBox(\n ...first,\n ...control1,\n ...control2,\n ...second\n );\n xMin = Math.min(xMin, bbox[0]);\n yMin = Math.min(yMin, bbox[1]);\n xMax = Math.max(xMax, bbox[2]);\n yMax = Math.max(yMax, bbox[3]);\n }\n }\n\n return [xMin, yMin, xMax, yMax];\n }\n\n /**\n * The bounding box is computed with null thickness, so we must take\n * it into account for the display.\n * It corresponds to the total padding, hence it should be divided by 2\n * in order to have left/right paddings.\n * @returns {number}\n */\n #getPadding() {\n return this.#disableEditing\n ? Math.ceil(this.thickness * this.parentScale)\n : 0;\n }\n\n /**\n * Set the div position and dimensions in order to fit to\n * the bounding box of the contents.\n * @returns {undefined}\n */\n #fitToContent(firstTime = false) {\n if (this.isEmpty()) {\n return;\n }\n\n if (!this.#disableEditing) {\n this.#redraw();\n return;\n }\n\n const bbox = this.#getBbox();\n const padding = this.#getPadding();\n this.#baseWidth = Math.max(AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]);\n this.#baseHeight = Math.max(AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]);\n\n const width = Math.ceil(padding + this.#baseWidth * this.scaleFactor);\n const height = Math.ceil(padding + this.#baseHeight * this.scaleFactor);\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.width = width / parentWidth;\n this.height = height / parentHeight;\n\n this.setAspectRatio(width, height);\n\n const prevTranslationX = this.translationX;\n const prevTranslationY = this.translationY;\n\n this.translationX = -bbox[0];\n this.translationY = -bbox[1];\n this.#setCanvasDims();\n this.#redraw();\n\n this.#realWidth = width;\n this.#realHeight = height;\n\n this.setDims(width, height);\n const unscaledPadding = firstTime ? padding / this.scaleFactor / 2 : 0;\n this.translate(\n prevTranslationX - this.translationX - unscaledPadding,\n prevTranslationY - this.translationY - unscaledPadding\n );\n }\n\n /** @inheritdoc */\n static deserialize(data, parent, uiManager) {\n if (data instanceof InkAnnotationElement) {\n return null;\n }\n const editor = super.deserialize(data, parent, uiManager);\n\n editor.thickness = data.thickness;\n editor.color = Util.makeHexColor(...data.color);\n editor.opacity = data.opacity;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const width = editor.width * pageWidth;\n const height = editor.height * pageHeight;\n const scaleFactor = editor.parentScale;\n const padding = data.thickness / 2;\n\n editor.#disableEditing = true;\n editor.#realWidth = Math.round(width);\n editor.#realHeight = Math.round(height);\n\n const { paths, rect, rotation } = data;\n\n for (let { bezier } of paths) {\n bezier = InkEditor.#fromPDFCoordinates(bezier, rect, rotation);\n const path = [];\n editor.paths.push(path);\n let p0 = scaleFactor * (bezier[0] - padding);\n let p1 = scaleFactor * (bezier[1] - padding);\n for (let i = 2, ii = bezier.length; i < ii; i += 6) {\n const p10 = scaleFactor * (bezier[i] - padding);\n const p11 = scaleFactor * (bezier[i + 1] - padding);\n const p20 = scaleFactor * (bezier[i + 2] - padding);\n const p21 = scaleFactor * (bezier[i + 3] - padding);\n const p30 = scaleFactor * (bezier[i + 4] - padding);\n const p31 = scaleFactor * (bezier[i + 5] - padding);\n path.push([\n [p0, p1],\n [p10, p11],\n [p20, p21],\n [p30, p31],\n ]);\n p0 = p30;\n p1 = p31;\n }\n const path2D = this.#buildPath2D(path);\n editor.bezierPath2D.push(path2D);\n }\n\n const bbox = editor.#getBbox();\n editor.#baseWidth = Math.max(AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]);\n editor.#baseHeight = Math.max(AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]);\n editor.#setScaleFactor(width, height);\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize() {\n if (this.isEmpty()) {\n return null;\n }\n\n const rect = this.getRect(0, 0);\n const color = AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);\n\n return {\n annotationType: AnnotationEditorType.INK,\n color,\n thickness: this.thickness,\n opacity: this.opacity,\n paths: this.#serializePaths(\n this.scaleFactor / this.parentScale,\n this.translationX,\n this.translationY,\n rect\n ),\n pageIndex: this.pageIndex,\n rect,\n rotation: this.rotation,\n structTreeParentId: this._structTreeParentId,\n };\n }\n}\n\nexport { InkEditor };\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 { AnnotationEditorType, shadow } from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { PixelsPerInch } from \"../display_utils.js\";\nimport { StampAnnotationElement } from \"../annotation_layer.js\";\n\n/**\n * Basic text editor in order to create a FreeTex annotation.\n */\nclass StampEditor extends AnnotationEditor {\n #bitmap = null;\n\n #bitmapId = null;\n\n #bitmapPromise = null;\n\n #bitmapUrl = null;\n\n #bitmapFile = null;\n\n #bitmapFileName = \"\";\n\n #canvas = null;\n\n #observer = null;\n\n #resizeTimeoutId = null;\n\n #isSvg = false;\n\n #hasBeenAddedInUndoStack = false;\n\n static _type = \"stamp\";\n\n static _editorType = AnnotationEditorType.STAMP;\n\n constructor(params) {\n super({ ...params, name: \"stampEditor\" });\n this.#bitmapUrl = params.bitmapUrl;\n this.#bitmapFile = params.bitmapFile;\n }\n\n /** @inheritdoc */\n static initialize(l10n) {\n AnnotationEditor.initialize(l10n);\n }\n\n static get supportedTypes() {\n // See https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types\n // to know which types are supported by the browser.\n const types = [\n \"apng\",\n \"avif\",\n \"bmp\",\n \"gif\",\n \"jpeg\",\n \"png\",\n \"svg+xml\",\n \"webp\",\n \"x-icon\",\n ];\n return shadow(\n this,\n \"supportedTypes\",\n types.map(type => `image/${type}`)\n );\n }\n\n static get supportedTypesStr() {\n return shadow(this, \"supportedTypesStr\", this.supportedTypes.join(\",\"));\n }\n\n /** @inheritdoc */\n static isHandlingMimeForPasting(mime) {\n return this.supportedTypes.includes(mime);\n }\n\n /** @inheritdoc */\n static paste(item, parent) {\n parent.pasteEditor(AnnotationEditorType.STAMP, {\n bitmapFile: item.getAsFile(),\n });\n }\n\n #getBitmapFetched(data, fromId = false) {\n if (!data) {\n this.remove();\n return;\n }\n this.#bitmap = data.bitmap;\n if (!fromId) {\n this.#bitmapId = data.id;\n this.#isSvg = data.isSvg;\n }\n if (data.file) {\n this.#bitmapFileName = data.file.name;\n }\n this.#createCanvas();\n }\n\n #getBitmapDone() {\n this.#bitmapPromise = null;\n this._uiManager.enableWaiting(false);\n if (this.#canvas) {\n this.div.focus();\n }\n }\n\n #getBitmap() {\n if (this.#bitmapId) {\n this._uiManager.enableWaiting(true);\n this._uiManager.imageManager\n .getFromId(this.#bitmapId)\n .then(data => this.#getBitmapFetched(data, /* fromId = */ true))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n if (this.#bitmapUrl) {\n const url = this.#bitmapUrl;\n this.#bitmapUrl = null;\n this._uiManager.enableWaiting(true);\n this.#bitmapPromise = this._uiManager.imageManager\n .getFromUrl(url)\n .then(data => this.#getBitmapFetched(data))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n if (this.#bitmapFile) {\n const file = this.#bitmapFile;\n this.#bitmapFile = null;\n this._uiManager.enableWaiting(true);\n this.#bitmapPromise = this._uiManager.imageManager\n .getFromFile(file)\n .then(data => this.#getBitmapFetched(data))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n const input = document.createElement(\"input\");\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n input.hidden = true;\n input.id = \"stampEditorFileInput\";\n document.body.append(input);\n }\n input.type = \"file\";\n input.accept = StampEditor.supportedTypesStr;\n this.#bitmapPromise = new Promise(resolve => {\n input.addEventListener(\"change\", async () => {\n if (!input.files || input.files.length === 0) {\n this.remove();\n } else {\n this._uiManager.enableWaiting(true);\n const data = await this._uiManager.imageManager.getFromFile(\n input.files[0]\n );\n this.#getBitmapFetched(data);\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n input.remove();\n }\n resolve();\n });\n input.addEventListener(\"cancel\", () => {\n this.remove();\n resolve();\n });\n }).finally(() => this.#getBitmapDone());\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"TESTING\")) {\n input.click();\n }\n }\n\n /** @inheritdoc */\n remove() {\n if (this.#bitmapId) {\n this.#bitmap = null;\n this._uiManager.imageManager.deleteId(this.#bitmapId);\n this.#canvas?.remove();\n this.#canvas = null;\n this.#observer?.disconnect();\n this.#observer = null;\n if (this.#resizeTimeoutId) {\n clearTimeout(this.#resizeTimeoutId);\n this.#resizeTimeoutId = null;\n }\n }\n super.remove();\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n // It's possible to have to rebuild an editor which is not on a visible\n // page.\n if (this.#bitmapId) {\n this.#getBitmap();\n }\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n if (this.#bitmapId) {\n this.#getBitmap();\n }\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilting it,\n // hence we must add it to its parent.\n this.parent.add(this);\n }\n }\n\n /** @inheritdoc */\n onceAdded() {\n this._isDraggable = true;\n this.div.focus();\n }\n\n /** @inheritdoc */\n isEmpty() {\n return !(\n this.#bitmapPromise ||\n this.#bitmap ||\n this.#bitmapUrl ||\n this.#bitmapFile\n );\n }\n\n /** @inheritdoc */\n get isResizable() {\n return true;\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this.width) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n this.div.hidden = true;\n\n if (this.#bitmap) {\n this.#createCanvas();\n } else {\n this.#getBitmap();\n }\n\n if (this.width) {\n // This editor was created in using copy (ctrl+c).\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setAt(\n baseX * parentWidth,\n baseY * parentHeight,\n this.width * parentWidth,\n this.height * parentHeight\n );\n }\n\n return this.div;\n }\n\n #createCanvas() {\n const { div } = this;\n let { width, height } = this.#bitmap;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const MAX_RATIO = 0.75;\n if (this.width) {\n width = this.width * pageWidth;\n height = this.height * pageHeight;\n } else if (\n width > MAX_RATIO * pageWidth ||\n height > MAX_RATIO * pageHeight\n ) {\n // If the the image is too big compared to the page dimensions\n // (more than MAX_RATIO) then we scale it down.\n const factor = Math.min(\n (MAX_RATIO * pageWidth) / width,\n (MAX_RATIO * pageHeight) / height\n );\n width *= factor;\n height *= factor;\n }\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(\n (width * parentWidth) / pageWidth,\n (height * parentHeight) / pageHeight\n );\n\n this._uiManager.enableWaiting(false);\n const canvas = (this.#canvas = document.createElement(\"canvas\"));\n div.append(canvas);\n div.hidden = false;\n this.#drawBitmap(width, height);\n this.#createObserver();\n if (!this.#hasBeenAddedInUndoStack) {\n this.parent.addUndoableEditor(this);\n this.#hasBeenAddedInUndoStack = true;\n }\n\n // There are multiple ways to add an image to the page, so here we just\n // count the number of times an image is added to the page whatever the way\n // is.\n this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n subtype: this.editorType,\n data: {\n action: \"inserted_image\",\n },\n },\n });\n this.addAltTextButton();\n if (this.#bitmapFileName) {\n canvas.setAttribute(\"aria-label\", this.#bitmapFileName);\n }\n }\n\n /**\n * When the dimensions of the div change the inner canvas must\n * renew its dimensions, hence it must redraw its own contents.\n * @param {number} width - the new width of the div\n * @param {number} height - the new height of the div\n * @returns\n */\n #setDimensions(width, height) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.width = width / parentWidth;\n this.height = height / parentHeight;\n this.setDims(width, height);\n if (this._initialOptions?.isCentered) {\n this.center();\n } else {\n this.fixAndSetPosition();\n }\n this._initialOptions = null;\n if (this.#resizeTimeoutId !== null) {\n clearTimeout(this.#resizeTimeoutId);\n }\n // When the user is resizing the editor we just use CSS to scale the image\n // to avoid redrawing it too often.\n // And once the user stops resizing the editor we redraw the image in\n // rescaling it correctly (see this.#scaleBitmap).\n const TIME_TO_WAIT = 200;\n this.#resizeTimeoutId = setTimeout(() => {\n this.#resizeTimeoutId = null;\n this.#drawBitmap(width, height);\n }, TIME_TO_WAIT);\n }\n\n #scaleBitmap(width, height) {\n const { width: bitmapWidth, height: bitmapHeight } = this.#bitmap;\n\n let newWidth = bitmapWidth;\n let newHeight = bitmapHeight;\n let bitmap = this.#bitmap;\n while (newWidth > 2 * width || newHeight > 2 * height) {\n const prevWidth = newWidth;\n const prevHeight = newHeight;\n\n if (newWidth > 2 * width) {\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.ceil(newWidth / 2);\n newWidth =\n newWidth >= 16384\n ? Math.floor(newWidth / 2) - 1\n : Math.ceil(newWidth / 2);\n }\n if (newHeight > 2 * height) {\n newHeight =\n newHeight >= 16384\n ? Math.floor(newHeight / 2) - 1\n : Math.ceil(newHeight / 2);\n }\n\n const offscreen = new OffscreenCanvas(newWidth, newHeight);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n prevWidth,\n prevHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n bitmap = offscreen.transferToImageBitmap();\n }\n\n return bitmap;\n }\n\n #drawBitmap(width, height) {\n width = Math.ceil(width);\n height = Math.ceil(height);\n const canvas = this.#canvas;\n if (!canvas || (canvas.width === width && canvas.height === height)) {\n return;\n }\n canvas.width = width;\n canvas.height = height;\n const bitmap = this.#isSvg\n ? this.#bitmap\n : this.#scaleBitmap(width, height);\n const ctx = canvas.getContext(\"2d\");\n ctx.filter = this._uiManager.hcmFilter;\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n bitmap.width,\n bitmap.height,\n 0,\n 0,\n width,\n height\n );\n }\n\n /** @inheritdoc */\n getImageForAltText() {\n return this.#canvas;\n }\n\n #serializeBitmap(toUrl) {\n if (toUrl) {\n if (this.#isSvg) {\n const url = this._uiManager.imageManager.getSvgUrl(this.#bitmapId);\n if (url) {\n return url;\n }\n }\n // We convert to a data url because it's sync and the url can live in the\n // clipboard.\n const canvas = document.createElement(\"canvas\");\n ({ width: canvas.width, height: canvas.height } = this.#bitmap);\n const ctx = canvas.getContext(\"2d\");\n ctx.drawImage(this.#bitmap, 0, 0);\n\n return canvas.toDataURL();\n }\n\n if (this.#isSvg) {\n const [pageWidth, pageHeight] = this.pageDimensions;\n // Multiply by PixelsPerInch.PDF_TO_CSS_UNITS in order to increase the\n // image resolution when rasterizing it.\n const width = Math.round(\n this.width * pageWidth * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n const height = Math.round(\n this.height * pageHeight * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(\n this.#bitmap,\n 0,\n 0,\n this.#bitmap.width,\n this.#bitmap.height,\n 0,\n 0,\n width,\n height\n );\n return offscreen.transferToImageBitmap();\n }\n\n return structuredClone(this.#bitmap);\n }\n\n /**\n * Create the resize observer.\n */\n #createObserver() {\n this.#observer = new ResizeObserver(entries => {\n const rect = entries[0].contentRect;\n if (rect.width && rect.height) {\n this.#setDimensions(rect.width, rect.height);\n }\n });\n this.#observer.observe(this.div);\n }\n\n /** @inheritdoc */\n static deserialize(data, parent, uiManager) {\n if (data instanceof StampAnnotationElement) {\n return null;\n }\n const editor = super.deserialize(data, parent, uiManager);\n const { rect, bitmapUrl, bitmapId, isSvg, accessibilityData } = data;\n if (bitmapId && uiManager.imageManager.isValidId(bitmapId)) {\n editor.#bitmapId = bitmapId;\n } else {\n editor.#bitmapUrl = bitmapUrl;\n }\n editor.#isSvg = isSvg;\n\n const [parentWidth, parentHeight] = editor.pageDimensions;\n editor.width = (rect[2] - rect[0]) / parentWidth;\n editor.height = (rect[3] - rect[1]) / parentHeight;\n\n if (accessibilityData) {\n editor.altTextData = accessibilityData;\n }\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false, context = null) {\n if (this.isEmpty()) {\n return null;\n }\n\n const serialized = {\n annotationType: AnnotationEditorType.STAMP,\n bitmapId: this.#bitmapId,\n pageIndex: this.pageIndex,\n rect: this.getRect(0, 0),\n rotation: this.rotation,\n isSvg: this.#isSvg,\n structTreeParentId: this._structTreeParentId,\n };\n\n if (isForCopying) {\n // We don't know what's the final destination (this pdf or another one)\n // of this annotation and the clipboard doesn't support ImageBitmaps,\n // hence we serialize the bitmap to a data url.\n serialized.bitmapUrl = this.#serializeBitmap(/* toUrl = */ true);\n serialized.accessibilityData = this.altTextData;\n return serialized;\n }\n\n const { decorative, altText } = this.altTextData;\n if (!decorative && altText) {\n serialized.accessibilityData = { type: \"Figure\", alt: altText };\n }\n\n if (context === null) {\n return serialized;\n }\n\n context.stamps ||= new Map();\n const area = this.#isSvg\n ? (serialized.rect[2] - serialized.rect[0]) *\n (serialized.rect[3] - serialized.rect[1])\n : null;\n if (!context.stamps.has(this.#bitmapId)) {\n // We don't want to have multiple copies of the same bitmap in the\n // annotationMap, hence we only add the bitmap the first time we meet it.\n context.stamps.set(this.#bitmapId, { area, serialized });\n serialized.bitmap = this.#serializeBitmap(/* toUrl = */ false);\n } else if (this.#isSvg) {\n // If we have multiple copies of the same svg but with different sizes,\n // then we want to keep the biggest one.\n const prevData = context.stamps.get(this.#bitmapId);\n if (area > prevData.area) {\n prevData.area = area;\n prevData.serialized.bitmap.close();\n prevData.serialized.bitmap = this.#serializeBitmap(/* toUrl = */ false);\n }\n }\n return serialized;\n }\n}\n\nexport { StampEditor };\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// eslint-disable-next-line max-len\n/** @typedef {import(\"./tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n/** @typedef {import(\"../display_utils.js\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../../web/text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n/** @typedef {import(\"../../../web/interfaces\").IL10n} IL10n */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../annotation_layer.js\").AnnotationLayer} AnnotationLayer */\n\nimport { AnnotationEditorType, FeatureTest } from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { FreeTextEditor } from \"./freetext.js\";\nimport { InkEditor } from \"./ink.js\";\nimport { setLayerDimensions } from \"../display_utils.js\";\nimport { StampEditor } from \"./stamp.js\";\n\n/**\n * @typedef {Object} AnnotationEditorLayerOptions\n * @property {Object} mode\n * @property {HTMLDivElement} div\n * @property {AnnotationEditorUIManager} uiManager\n * @property {boolean} enabled\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {number} pageIndex\n * @property {IL10n} l10n\n * @property {AnnotationLayer} [annotationLayer]\n * @property {PageViewport} viewport\n */\n\n/**\n * @typedef {Object} RenderEditorLayerOptions\n * @property {PageViewport} viewport\n */\n\n/**\n * Manage all the different editors on a page.\n */\nclass AnnotationEditorLayer {\n #accessibilityManager;\n\n #allowClick = false;\n\n #annotationLayer = null;\n\n #boundPointerup = this.pointerup.bind(this);\n\n #boundPointerdown = this.pointerdown.bind(this);\n\n #editorFocusTimeoutId = null;\n\n #editors = new Map();\n\n #hadPointerDown = false;\n\n #isCleaningUp = false;\n\n #isDisabling = false;\n\n #uiManager;\n\n static _initialized = false;\n\n static #editorTypes = new Map(\n [FreeTextEditor, InkEditor, StampEditor].map(type => [\n type._editorType,\n type,\n ])\n );\n\n /**\n * @param {AnnotationEditorLayerOptions} options\n */\n constructor({\n uiManager,\n pageIndex,\n div,\n accessibilityManager,\n annotationLayer,\n viewport,\n l10n,\n }) {\n const editorTypes = [...AnnotationEditorLayer.#editorTypes.values()];\n if (!AnnotationEditorLayer._initialized) {\n AnnotationEditorLayer._initialized = true;\n for (const editorType of editorTypes) {\n editorType.initialize(l10n);\n }\n }\n uiManager.registerEditorTypes(editorTypes);\n\n this.#uiManager = uiManager;\n this.pageIndex = pageIndex;\n this.div = div;\n this.#accessibilityManager = accessibilityManager;\n this.#annotationLayer = annotationLayer;\n this.viewport = viewport;\n\n this.#uiManager.addLayer(this);\n }\n\n get isEmpty() {\n return this.#editors.size === 0;\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {number} mode\n */\n updateToolbar(mode) {\n this.#uiManager.updateToolbar(mode);\n }\n\n /**\n * The mode has changed: it must be updated.\n * @param {number} mode\n */\n updateMode(mode = this.#uiManager.getMode()) {\n this.#cleanup();\n if (mode === AnnotationEditorType.INK) {\n // We always want to an ink editor ready to draw in.\n this.addInkEditorIfNeeded(false);\n this.disableClick();\n } else {\n this.enableClick();\n }\n\n if (mode !== AnnotationEditorType.NONE) {\n const { classList } = this.div;\n for (const editorType of AnnotationEditorLayer.#editorTypes.values()) {\n classList.toggle(\n `${editorType._type}Editing`,\n mode === editorType._editorType\n );\n }\n this.div.hidden = false;\n }\n }\n\n addInkEditorIfNeeded(isCommitting) {\n if (\n !isCommitting &&\n this.#uiManager.getMode() !== AnnotationEditorType.INK\n ) {\n return;\n }\n\n if (!isCommitting) {\n // We're removing an editor but an empty one can already exist so in this\n // case we don't need to create a new one.\n for (const editor of this.#editors.values()) {\n if (editor.isEmpty()) {\n editor.setInBackground();\n return;\n }\n }\n }\n\n const editor = this.#createAndAddNewEditor(\n { offsetX: 0, offsetY: 0 },\n /* isCentered = */ false\n );\n editor.setInBackground();\n }\n\n /**\n * Set the editing state.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n this.#uiManager.setEditingState(isEditing);\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {Object} params\n */\n addCommands(params) {\n this.#uiManager.addCommands(params);\n }\n\n togglePointerEvents(enabled = false) {\n this.div.classList.toggle(\"disabled\", !enabled);\n }\n\n /**\n * Enable pointer events on the main div in order to enable\n * editor creation.\n */\n enable() {\n this.togglePointerEvents(true);\n const annotationElementIds = new Set();\n for (const editor of this.#editors.values()) {\n editor.enableEditing();\n if (editor.annotationElementId) {\n annotationElementIds.add(editor.annotationElementId);\n }\n }\n\n if (!this.#annotationLayer) {\n return;\n }\n\n const editables = this.#annotationLayer.getEditableAnnotations();\n for (const editable of editables) {\n // The element must be hidden whatever its state is.\n editable.hide();\n if (this.#uiManager.isDeletedAnnotationElement(editable.data.id)) {\n continue;\n }\n if (annotationElementIds.has(editable.data.id)) {\n continue;\n }\n const editor = this.deserialize(editable);\n if (!editor) {\n continue;\n }\n this.addOrRebuild(editor);\n editor.enableEditing();\n }\n }\n\n /**\n * Disable editor creation.\n */\n disable() {\n this.#isDisabling = true;\n this.togglePointerEvents(false);\n const hiddenAnnotationIds = new Set();\n for (const editor of this.#editors.values()) {\n editor.disableEditing();\n if (!editor.annotationElementId || editor.serialize() !== null) {\n hiddenAnnotationIds.add(editor.annotationElementId);\n continue;\n }\n this.getEditableAnnotation(editor.annotationElementId)?.show();\n editor.remove();\n }\n\n if (this.#annotationLayer) {\n // Show the annotations that were hidden in enable().\n const editables = this.#annotationLayer.getEditableAnnotations();\n for (const editable of editables) {\n const { id } = editable.data;\n if (\n hiddenAnnotationIds.has(id) ||\n this.#uiManager.isDeletedAnnotationElement(id)\n ) {\n continue;\n }\n editable.show();\n }\n }\n\n this.#cleanup();\n if (this.isEmpty) {\n this.div.hidden = true;\n }\n const { classList } = this.div;\n for (const editorType of AnnotationEditorLayer.#editorTypes.values()) {\n classList.remove(`${editorType._type}Editing`);\n }\n\n this.#isDisabling = false;\n }\n\n getEditableAnnotation(id) {\n return this.#annotationLayer?.getEditableAnnotation(id) || null;\n }\n\n /**\n * Set the current editor.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n const currentActive = this.#uiManager.getActive();\n if (currentActive === editor) {\n return;\n }\n\n this.#uiManager.setActiveEditor(editor);\n }\n\n enableClick() {\n this.div.addEventListener(\"pointerdown\", this.#boundPointerdown);\n this.div.addEventListener(\"pointerup\", this.#boundPointerup);\n }\n\n disableClick() {\n this.div.removeEventListener(\"pointerdown\", this.#boundPointerdown);\n this.div.removeEventListener(\"pointerup\", this.#boundPointerup);\n }\n\n attach(editor) {\n this.#editors.set(editor.id, editor);\n const { annotationElementId } = editor;\n if (\n annotationElementId &&\n this.#uiManager.isDeletedAnnotationElement(annotationElementId)\n ) {\n this.#uiManager.removeDeletedAnnotationElement(editor);\n }\n }\n\n detach(editor) {\n this.#editors.delete(editor.id);\n this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n\n if (!this.#isDisabling && editor.annotationElementId) {\n this.#uiManager.addDeletedAnnotationElement(editor);\n }\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n remove(editor) {\n // Since we can undo a removal we need to keep the\n // parent property as it is, so don't null it!\n\n this.detach(editor);\n this.#uiManager.removeEditor(editor);\n editor.div.remove();\n editor.isAttachedToDOM = false;\n\n if (!this.#isCleaningUp) {\n this.addInkEditorIfNeeded(/* isCommitting = */ false);\n }\n }\n\n /**\n * An editor can have a different parent, for example after having\n * being dragged and droped from a page to another.\n * @param {AnnotationEditor} editor\n */\n changeParent(editor) {\n if (editor.parent === this) {\n return;\n }\n\n if (editor.annotationElementId) {\n this.#uiManager.addDeletedAnnotationElement(editor.annotationElementId);\n AnnotationEditor.deleteAnnotationElement(editor);\n editor.annotationElementId = null;\n }\n\n this.attach(editor);\n editor.parent?.detach(editor);\n editor.setParent(this);\n if (editor.div && editor.isAttachedToDOM) {\n editor.div.remove();\n this.div.append(editor.div);\n }\n }\n\n /**\n * Add a new editor in the current view.\n * @param {AnnotationEditor} editor\n */\n add(editor) {\n this.changeParent(editor);\n this.#uiManager.addEditor(editor);\n this.attach(editor);\n\n if (!editor.isAttachedToDOM) {\n const div = editor.render();\n this.div.append(div);\n editor.isAttachedToDOM = true;\n }\n\n // The editor will be correctly moved into the DOM (see fixAndSetPosition).\n editor.fixAndSetPosition();\n editor.onceAdded();\n this.#uiManager.addToAnnotationStorage(editor);\n }\n\n moveEditorInDOM(editor) {\n if (!editor.isAttachedToDOM) {\n return;\n }\n\n const { activeElement } = document;\n if (editor.div.contains(activeElement) && !this.#editorFocusTimeoutId) {\n // When the div is moved in the DOM the focus can move somewhere else,\n // so we want to be sure that the focus will stay on the editor but we\n // don't want to call any focus callbacks, hence we disable them and only\n // re-enable them when the editor has the focus.\n editor._focusEventsAllowed = false;\n this.#editorFocusTimeoutId = setTimeout(() => {\n this.#editorFocusTimeoutId = null;\n if (!editor.div.contains(document.activeElement)) {\n editor.div.addEventListener(\n \"focusin\",\n () => {\n editor._focusEventsAllowed = true;\n },\n { once: true }\n );\n activeElement.focus();\n } else {\n editor._focusEventsAllowed = true;\n }\n }, 0);\n }\n\n editor._structTreeParentId = this.#accessibilityManager?.moveElementInDOM(\n this.div,\n editor.div,\n editor.contentDiv,\n /* isRemovable = */ true\n );\n }\n\n /**\n * Add or rebuild depending if it has been removed or not.\n * @param {AnnotationEditor} editor\n */\n addOrRebuild(editor) {\n if (editor.needsToBeRebuilt()) {\n editor.parent ||= this;\n editor.rebuild();\n } else {\n this.add(editor);\n }\n }\n\n /**\n * Add a new editor and make this addition undoable.\n * @param {AnnotationEditor} editor\n */\n addUndoableEditor(editor) {\n const cmd = () => editor._uiManager.rebuild(editor);\n const undo = () => {\n editor.remove();\n };\n\n this.addCommands({ cmd, undo, mustExec: false });\n }\n\n /**\n * Get an id for an editor.\n * @returns {string}\n */\n getNextId() {\n return this.#uiManager.getId();\n }\n\n /**\n * Create a new editor\n * @param {Object} params\n * @returns {AnnotationEditor}\n */\n #createNewEditor(params) {\n const editorType = AnnotationEditorLayer.#editorTypes.get(\n this.#uiManager.getMode()\n );\n return editorType ? new editorType.prototype.constructor(params) : null;\n }\n\n /**\n * Paste some content into a new editor.\n * @param {number} mode\n * @param {Object} params\n */\n pasteEditor(mode, params) {\n this.#uiManager.updateToolbar(mode);\n this.#uiManager.updateMode(mode);\n\n const { offsetX, offsetY } = this.#getCenterPoint();\n const id = this.getNextId();\n const editor = this.#createNewEditor({\n parent: this,\n id,\n x: offsetX,\n y: offsetY,\n uiManager: this.#uiManager,\n isCentered: true,\n ...params,\n });\n if (editor) {\n this.add(editor);\n }\n }\n\n /**\n * Create a new editor\n * @param {Object} data\n * @returns {AnnotationEditor | null}\n */\n deserialize(data) {\n return (\n AnnotationEditorLayer.#editorTypes\n .get(data.annotationType ?? data.annotationEditorType)\n ?.deserialize(data, this, this.#uiManager) || null\n );\n }\n\n /**\n * Create and add a new editor.\n * @param {PointerEvent} event\n * @param {boolean} isCentered\n * @returns {AnnotationEditor}\n */\n #createAndAddNewEditor(event, isCentered) {\n const id = this.getNextId();\n const editor = this.#createNewEditor({\n parent: this,\n id,\n x: event.offsetX,\n y: event.offsetY,\n uiManager: this.#uiManager,\n isCentered,\n });\n if (editor) {\n this.add(editor);\n }\n\n return editor;\n }\n\n #getCenterPoint() {\n const { x, y, width, height } = this.div.getBoundingClientRect();\n const tlX = Math.max(0, x);\n const tlY = Math.max(0, y);\n const brX = Math.min(window.innerWidth, x + width);\n const brY = Math.min(window.innerHeight, y + height);\n const centerX = (tlX + brX) / 2 - x;\n const centerY = (tlY + brY) / 2 - y;\n const [offsetX, offsetY] =\n this.viewport.rotation % 180 === 0\n ? [centerX, centerY]\n : [centerY, centerX];\n\n return { offsetX, offsetY };\n }\n\n /**\n * Create and add a new editor.\n */\n addNewEditor() {\n this.#createAndAddNewEditor(\n this.#getCenterPoint(),\n /* isCentered = */ true\n );\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n this.#uiManager.setSelected(editor);\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n this.#uiManager.toggleSelected(editor);\n }\n\n /**\n * Check if the editor is selected.\n * @param {AnnotationEditor} editor\n */\n isSelected(editor) {\n return this.#uiManager.isSelected(editor);\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n this.#uiManager.unselect(editor);\n }\n\n /**\n * Pointerup callback.\n * @param {PointerEvent} event\n */\n pointerup(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Don't create an editor on right click.\n return;\n }\n\n if (event.target !== this.div) {\n return;\n }\n\n if (!this.#hadPointerDown) {\n // It can happen when the user starts a drag inside a text editor\n // and then releases the mouse button outside of it. In such a case\n // we don't want to create a new editor, hence we check that a pointerdown\n // occurred on this div previously.\n return;\n }\n this.#hadPointerDown = false;\n\n if (!this.#allowClick) {\n this.#allowClick = true;\n return;\n }\n\n if (this.#uiManager.getMode() === AnnotationEditorType.STAMP) {\n this.#uiManager.unselectAll();\n return;\n }\n\n this.#createAndAddNewEditor(event, /* isCentered = */ false);\n }\n\n /**\n * Pointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n if (this.#hadPointerDown) {\n // It's possible to have a second pointerdown event before a pointerup one\n // when the user puts a finger on a touchscreen and then add a second one\n // to start a pinch-to-zoom gesture.\n // That said, in case it's possible to have two pointerdown events with\n // a mouse, we don't want to create a new editor in such a case either.\n this.#hadPointerDown = false;\n return;\n }\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Do nothing on right click.\n return;\n }\n\n if (event.target !== this.div) {\n return;\n }\n\n this.#hadPointerDown = true;\n\n const editor = this.#uiManager.getActive();\n this.#allowClick = !editor || editor.isEmpty();\n }\n\n /**\n *\n * @param {AnnotationEditor} editor\n * @param {number} x\n * @param {number} y\n * @returns\n */\n findNewParent(editor, x, y) {\n const layer = this.#uiManager.findParent(x, y);\n if (layer === null || layer === this) {\n return false;\n }\n layer.changeParent(editor);\n return true;\n }\n\n /**\n * Destroy the main editor.\n */\n destroy() {\n if (this.#uiManager.getActive()?.parent === this) {\n // We need to commit the current editor before destroying the layer.\n this.#uiManager.commitOrRemove();\n this.#uiManager.setActiveEditor(null);\n }\n\n if (this.#editorFocusTimeoutId) {\n clearTimeout(this.#editorFocusTimeoutId);\n this.#editorFocusTimeoutId = null;\n }\n\n for (const editor of this.#editors.values()) {\n this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n editor.setParent(null);\n editor.isAttachedToDOM = false;\n editor.div.remove();\n }\n this.div = null;\n this.#editors.clear();\n this.#uiManager.removeLayer(this);\n }\n\n #cleanup() {\n // When we're cleaning up, some editors are removed but we don't want\n // to add a new one which will induce an addition in this.#editors, hence\n // an infinite loop.\n this.#isCleaningUp = true;\n for (const editor of this.#editors.values()) {\n if (editor.isEmpty()) {\n editor.remove();\n }\n }\n this.#isCleaningUp = false;\n }\n\n /**\n * Render the main editor.\n * @param {RenderEditorLayerOptions} parameters\n */\n render({ viewport }) {\n this.viewport = viewport;\n setLayerDimensions(this.div, viewport);\n for (const editor of this.#uiManager.getEditors(this.pageIndex)) {\n this.add(editor);\n }\n this.updateMode();\n }\n\n /**\n * Update the main editor.\n * @param {RenderEditorLayerOptions} parameters\n */\n update({ viewport }) {\n // Editors have their dimensions/positions in percent so to avoid any\n // issues (see #15582), we must commit the current one before changing\n // the viewport.\n this.#uiManager.commitOrRemove();\n\n this.viewport = viewport;\n setLayerDimensions(this.div, { rotation: viewport.rotation });\n this.updateMode();\n }\n\n /**\n * Get page dimensions.\n * @returns {Object} dimensions.\n */\n get pageDimensions() {\n const { pageWidth, pageHeight } = this.viewport.rawDims;\n return [pageWidth, pageHeight];\n }\n}\n\nexport { AnnotationEditorLayer };\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 { noContextMenu } from \"../display_utils.js\";\n\nclass EditorToolbar {\n #toolbar = null;\n\n #editor;\n\n #buttons = null;\n\n constructor(editor) {\n this.#editor = editor;\n }\n\n render() {\n const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n editToolbar.className = \"editToolbar\";\n editToolbar.addEventListener(\"contextmenu\", noContextMenu);\n editToolbar.addEventListener(\"pointerdown\", EditorToolbar.#pointerDown);\n\n const buttons = (this.#buttons = document.createElement(\"div\"));\n buttons.className = \"buttons\";\n editToolbar.append(buttons);\n\n this.#addDeleteButton();\n\n return editToolbar;\n }\n\n static #pointerDown(e) {\n e.stopPropagation();\n }\n\n #focusIn(e) {\n this.#editor._focusEventsAllowed = false;\n e.preventDefault();\n e.stopPropagation();\n }\n\n #focusOut(e) {\n this.#editor._focusEventsAllowed = true;\n e.preventDefault();\n e.stopPropagation();\n }\n\n #addListenersToElement(element) {\n // If we're clicking on a button with the keyboard or with\n // the mouse, we don't want to trigger any focus events on\n // the editor.\n element.addEventListener(\"focusin\", this.#focusIn.bind(this), {\n capture: true,\n });\n element.addEventListener(\"focusout\", this.#focusOut.bind(this), {\n capture: true,\n });\n element.addEventListener(\"contextmenu\", noContextMenu);\n }\n\n hide() {\n this.#toolbar.classList.add(\"hidden\");\n }\n\n show() {\n this.#toolbar.classList.remove(\"hidden\");\n }\n\n #addDeleteButton() {\n const button = document.createElement(\"button\");\n button.className = \"delete\";\n button.tabIndex = 0;\n button.setAttribute(\"data-l10n-id\", \"pdfjs-editor-remove-button\");\n this.#addListenersToElement(button);\n button.addEventListener(\"click\", e => {\n this.#editor._uiManager.delete();\n });\n this.#buttons.append(button);\n }\n\n remove() {\n this.#toolbar.remove();\n }\n}\n\nexport { EditorToolbar };\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// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n KeyboardManager,\n} from \"./tools.js\";\nimport { FeatureTest, shadow, unreachable } from \"../../shared/util.js\";\nimport { EditorToolbar } from \"./toolbar.js\";\nimport { noContextMenu } from \"../display_utils.js\";\n\n/**\n * @typedef {Object} AnnotationEditorParameters\n * @property {AnnotationEditorUIManager} uiManager - the global manager\n * @property {AnnotationEditorLayer} parent - the layer containing this editor\n * @property {string} id - editor id\n * @property {number} x - x-coordinate\n * @property {number} y - y-coordinate\n */\n\n/**\n * Base class for editors.\n */\nclass AnnotationEditor {\n #allResizerDivs = null;\n\n #altText = \"\";\n\n #altTextDecorative = false;\n\n #altTextButton = null;\n\n #altTextTooltip = null;\n\n #altTextTooltipTimeout = null;\n\n #altTextWasFromKeyBoard = false;\n\n #keepAspectRatio = false;\n\n #resizersDiv = null;\n\n #savedDimensions = null;\n\n #boundFocusin = this.focusin.bind(this);\n\n #boundFocusout = this.focusout.bind(this);\n\n #editToolbar = null;\n\n #focusedResizerName = \"\";\n\n #hasBeenClicked = false;\n\n #isEditing = false;\n\n #isInEditMode = false;\n\n #isResizerEnabledForKeyboard = false;\n\n #moveInDOMTimeout = null;\n\n _initialOptions = Object.create(null);\n\n _uiManager = null;\n\n _focusEventsAllowed = true;\n\n _l10nPromise = null;\n\n #isDraggable = false;\n\n #zIndex = AnnotationEditor._zIndex++;\n\n static _borderLineWidth = -1;\n\n static _colorManager = new ColorManager();\n\n static _zIndex = 1;\n\n // When one of the dimensions of an editor is smaller than this value, the\n // button to edit the alt text is visually moved outside of the editor.\n static SMALL_EDITOR_SIZE = 0;\n\n static get _resizerKeyboardManager() {\n const resize = AnnotationEditor.prototype._resizeWithKeyboard;\n const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_resizerKeyboardManager\",\n new KeyboardManager([\n [[\"ArrowLeft\", \"mac+ArrowLeft\"], resize, { args: [-small, 0] }],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n resize,\n { args: [-big, 0] },\n ],\n [[\"ArrowRight\", \"mac+ArrowRight\"], resize, { args: [small, 0] }],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n resize,\n { args: [big, 0] },\n ],\n [[\"ArrowUp\", \"mac+ArrowUp\"], resize, { args: [0, -small] }],\n [[\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"], resize, { args: [0, -big] }],\n [[\"ArrowDown\", \"mac+ArrowDown\"], resize, { args: [0, small] }],\n [[\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"], resize, { args: [0, big] }],\n [\n [\"Escape\", \"mac+Escape\"],\n AnnotationEditor.prototype._stopResizingWithKeyboard,\n ],\n ])\n );\n }\n\n /**\n * @param {AnnotationEditorParameters} parameters\n */\n constructor(parameters) {\n if (this.constructor === AnnotationEditor) {\n unreachable(\"Cannot initialize AnnotationEditor.\");\n }\n\n this.parent = parameters.parent;\n this.id = parameters.id;\n this.width = this.height = null;\n this.pageIndex = parameters.parent.pageIndex;\n this.name = parameters.name;\n this.div = null;\n this._uiManager = parameters.uiManager;\n this.annotationElementId = null;\n this._willKeepAspectRatio = false;\n this._initialOptions.isCentered = parameters.isCentered;\n this._structTreeParentId = null;\n\n const {\n rotation,\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n } = this.parent.viewport;\n\n this.rotation = rotation;\n this.pageRotation =\n (360 + rotation - this._uiManager.viewParameters.rotation) % 360;\n this.pageDimensions = [pageWidth, pageHeight];\n this.pageTranslation = [pageX, pageY];\n\n const [width, height] = this.parentDimensions;\n this.x = parameters.x / width;\n this.y = parameters.y / height;\n\n this.isAttachedToDOM = false;\n this.deleted = false;\n }\n\n get editorType() {\n return Object.getPrototypeOf(this).constructor._type;\n }\n\n static get _defaultLineColor() {\n return shadow(\n this,\n \"_defaultLineColor\",\n this._colorManager.getHexCode(\"CanvasText\")\n );\n }\n\n static deleteAnnotationElement(editor) {\n const fakeEditor = new FakeEditor({\n id: editor.parent.getNextId(),\n parent: editor.parent,\n uiManager: editor._uiManager,\n });\n fakeEditor.annotationElementId = editor.annotationElementId;\n fakeEditor.deleted = true;\n fakeEditor._uiManager.addToAnnotationStorage(fakeEditor);\n }\n\n /**\n * Initialize the l10n stuff for this type of editor.\n * @param {Object} l10n\n */\n static initialize(l10n, options = null) {\n AnnotationEditor._l10nPromise ||= new Map(\n [\n \"pdfjs-editor-alt-text-button-label\",\n \"pdfjs-editor-alt-text-edit-button-label\",\n \"pdfjs-editor-alt-text-decorative-tooltip\",\n \"pdfjs-editor-resizer-label-topLeft\",\n \"pdfjs-editor-resizer-label-topMiddle\",\n \"pdfjs-editor-resizer-label-topRight\",\n \"pdfjs-editor-resizer-label-middleRight\",\n \"pdfjs-editor-resizer-label-bottomRight\",\n \"pdfjs-editor-resizer-label-bottomMiddle\",\n \"pdfjs-editor-resizer-label-bottomLeft\",\n \"pdfjs-editor-resizer-label-middleLeft\",\n ].map(str => [\n str,\n l10n.get(str.replaceAll(/([A-Z])/g, c => `-${c.toLowerCase()}`)),\n ])\n );\n if (options?.strings) {\n for (const str of options.strings) {\n AnnotationEditor._l10nPromise.set(str, l10n.get(str));\n }\n }\n if (AnnotationEditor._borderLineWidth !== -1) {\n return;\n }\n const style = getComputedStyle(document.documentElement);\n AnnotationEditor._borderLineWidth =\n parseFloat(style.getPropertyValue(\"--outline-width\")) || 0;\n }\n\n /**\n * Update the default parameters for this type of editor.\n * @param {number} _type\n * @param {*} _value\n */\n static updateDefaultParams(_type, _value) {}\n\n /**\n * Get the default properties to set in the UI for this type of editor.\n * @returns {Array}\n */\n static get defaultPropertiesToUpdate() {\n return [];\n }\n\n /**\n * Check if this kind of editor is able to handle the given mime type for\n * pasting.\n * @param {string} mime\n * @returns {boolean}\n */\n static isHandlingMimeForPasting(mime) {\n return false;\n }\n\n /**\n * Extract the data from the clipboard item and delegate the creation of the\n * editor to the parent.\n * @param {DataTransferItem} item\n * @param {AnnotationEditorLayer} parent\n */\n static paste(item, parent) {\n unreachable(\"Not implemented\");\n }\n\n /**\n * Get the properties to update in the UI for this editor.\n * @returns {Array}\n */\n get propertiesToUpdate() {\n return [];\n }\n\n get _isDraggable() {\n return this.#isDraggable;\n }\n\n set _isDraggable(value) {\n this.#isDraggable = value;\n this.div?.classList.toggle(\"draggable\", value);\n }\n\n /**\n * @returns {boolean} true if the editor handles the Enter key itself.\n */\n get isEnterHandled() {\n return true;\n }\n\n center() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n switch (this.parentRotation) {\n case 90:\n this.x -= (this.height * pageHeight) / (pageWidth * 2);\n this.y += (this.width * pageWidth) / (pageHeight * 2);\n break;\n case 180:\n this.x += this.width / 2;\n this.y += this.height / 2;\n break;\n case 270:\n this.x += (this.height * pageHeight) / (pageWidth * 2);\n this.y -= (this.width * pageWidth) / (pageHeight * 2);\n break;\n default:\n this.x -= this.width / 2;\n this.y -= this.height / 2;\n break;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {Object} params\n */\n addCommands(params) {\n this._uiManager.addCommands(params);\n }\n\n get currentLayer() {\n return this._uiManager.currentLayer;\n }\n\n /**\n * This editor will be behind the others.\n */\n setInBackground() {\n this.div.style.zIndex = 0;\n }\n\n /**\n * This editor will be in the foreground.\n */\n setInForeground() {\n this.div.style.zIndex = this.#zIndex;\n }\n\n setParent(parent) {\n if (parent !== null) {\n this.pageIndex = parent.pageIndex;\n this.pageDimensions = parent.pageDimensions;\n } else {\n // The editor is being removed from the DOM, so we need to stop resizing.\n this.#stopResizing();\n }\n this.parent = parent;\n }\n\n /**\n * onfocus callback.\n */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n if (!this.#hasBeenClicked) {\n this.parent.setSelected(this);\n } else {\n this.#hasBeenClicked = false;\n }\n }\n\n /**\n * onblur callback.\n * @param {FocusEvent} event\n */\n focusout(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n return;\n }\n\n // In case of focusout, the relatedTarget is the element which\n // is grabbing the focus.\n // So if the related target is an element under the div for this\n // editor, then the editor isn't unactive.\n const target = event.relatedTarget;\n if (target?.closest(`#${this.id}`)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.parent?.isMultipleSelection) {\n this.commitOrRemove();\n }\n }\n\n commitOrRemove() {\n if (this.isEmpty()) {\n this.remove();\n } else {\n this.commit();\n }\n }\n\n /**\n * Commit the data contained in this editor.\n */\n commit() {\n this.addToAnnotationStorage();\n }\n\n addToAnnotationStorage() {\n this._uiManager.addToAnnotationStorage(this);\n }\n\n /**\n * Set the editor position within its parent.\n * @param {number} x\n * @param {number} y\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n */\n setAt(x, y, tx, ty) {\n const [width, height] = this.parentDimensions;\n [tx, ty] = this.screenToPageTranslation(tx, ty);\n\n this.x = (x + tx) / width;\n this.y = (y + ty) / height;\n\n this.fixAndSetPosition();\n }\n\n #translate([width, height], x, y) {\n [x, y] = this.screenToPageTranslation(x, y);\n\n this.x += x / width;\n this.y += y / height;\n\n this.fixAndSetPosition();\n }\n\n /**\n * Translate the editor position within its parent.\n * @param {number} x - x-translation in screen coordinates.\n * @param {number} y - y-translation in screen coordinates.\n */\n translate(x, y) {\n this.#translate(this.parentDimensions, x, y);\n }\n\n /**\n * Translate the editor position within its page and adjust the scroll\n * in order to have the editor in the view.\n * @param {number} x - x-translation in page coordinates.\n * @param {number} y - y-translation in page coordinates.\n */\n translateInPage(x, y) {\n this.#translate(this.pageDimensions, x, y);\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n drag(tx, ty) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.x += tx / parentWidth;\n this.y += ty / parentHeight;\n if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {\n // It's possible to not have a parent: for example, when the user is\n // dragging all the selected editors but this one on a page which has been\n // destroyed.\n // It's why we need to check for it. In such a situation, it isn't really\n // a problem to not find a new parent: it's something which is related to\n // what the user is seeing, hence it depends on how pages are layed out.\n\n // The element will be outside of its parent so change the parent.\n const { x, y } = this.div.getBoundingClientRect();\n if (this.parent.findNewParent(this, x, y)) {\n this.x -= Math.floor(this.x);\n this.y -= Math.floor(this.y);\n }\n }\n\n // The editor can be moved wherever the user wants, so we don't need to fix\n // the position: it'll be done when the user will release the mouse button.\n\n let { x, y } = this;\n const [bx, by] = this.#getBaseTranslation();\n x += bx;\n y += by;\n\n this.div.style.left = `${(100 * x).toFixed(2)}%`;\n this.div.style.top = `${(100 * y).toFixed(2)}%`;\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n #getBaseTranslation() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const { _borderLineWidth } = AnnotationEditor;\n const x = _borderLineWidth / parentWidth;\n const y = _borderLineWidth / parentHeight;\n switch (this.rotation) {\n case 90:\n return [-x, y];\n case 180:\n return [x, y];\n case 270:\n return [x, -y];\n default:\n return [-x, -y];\n }\n }\n\n fixAndSetPosition() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n let { x, y, width, height } = this;\n width *= pageWidth;\n height *= pageHeight;\n x *= pageWidth;\n y *= pageHeight;\n\n switch (this.rotation) {\n case 0:\n x = Math.max(0, Math.min(pageWidth - width, x));\n y = Math.max(0, Math.min(pageHeight - height, y));\n break;\n case 90:\n x = Math.max(0, Math.min(pageWidth - height, x));\n y = Math.min(pageHeight, Math.max(width, y));\n break;\n case 180:\n x = Math.min(pageWidth, Math.max(width, x));\n y = Math.min(pageHeight, Math.max(height, y));\n break;\n case 270:\n x = Math.min(pageWidth, Math.max(height, x));\n y = Math.max(0, Math.min(pageHeight - width, y));\n break;\n }\n\n this.x = x /= pageWidth;\n this.y = y /= pageHeight;\n\n const [bx, by] = this.#getBaseTranslation();\n x += bx;\n y += by;\n\n const { style } = this.div;\n style.left = `${(100 * x).toFixed(2)}%`;\n style.top = `${(100 * y).toFixed(2)}%`;\n\n this.moveInDOM();\n }\n\n static #rotatePoint(x, y, angle) {\n switch (angle) {\n case 90:\n return [y, -x];\n case 180:\n return [-x, -y];\n case 270:\n return [-y, x];\n default:\n return [x, y];\n }\n }\n\n /**\n * Convert a screen translation into a page one.\n * @param {number} x\n * @param {number} y\n */\n screenToPageTranslation(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, this.parentRotation);\n }\n\n /**\n * Convert a page translation into a screen one.\n * @param {number} x\n * @param {number} y\n */\n pageTranslationToScreen(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation);\n }\n\n #getRotationMatrix(rotation) {\n switch (rotation) {\n case 90: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0];\n }\n case 180:\n return [-1, 0, 0, -1];\n case 270: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0];\n }\n default:\n return [1, 0, 0, 1];\n }\n }\n\n get parentScale() {\n return this._uiManager.viewParameters.realScale;\n }\n\n get parentRotation() {\n return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;\n }\n\n get parentDimensions() {\n const {\n parentScale,\n pageDimensions: [pageWidth, pageHeight],\n } = this;\n const scaledWidth = pageWidth * parentScale;\n const scaledHeight = pageHeight * parentScale;\n return FeatureTest.isCSSRoundSupported\n ? [Math.round(scaledWidth), Math.round(scaledHeight)]\n : [scaledWidth, scaledHeight];\n }\n\n /**\n * Set the dimensions of this editor.\n * @param {number} width\n * @param {number} height\n */\n setDims(width, height) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.div.style.width = `${((100 * width) / parentWidth).toFixed(2)}%`;\n if (!this.#keepAspectRatio) {\n this.div.style.height = `${((100 * height) / parentHeight).toFixed(2)}%`;\n }\n this.#altTextButton?.classList.toggle(\n \"small\",\n width < AnnotationEditor.SMALL_EDITOR_SIZE ||\n height < AnnotationEditor.SMALL_EDITOR_SIZE\n );\n }\n\n fixDims() {\n const { style } = this.div;\n const { height, width } = style;\n const widthPercent = width.endsWith(\"%\");\n const heightPercent = !this.#keepAspectRatio && height.endsWith(\"%\");\n if (widthPercent && heightPercent) {\n return;\n }\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (!widthPercent) {\n style.width = `${((100 * parseFloat(width)) / parentWidth).toFixed(2)}%`;\n }\n if (!this.#keepAspectRatio && !heightPercent) {\n style.height = `${((100 * parseFloat(height)) / parentHeight).toFixed(\n 2\n )}%`;\n }\n }\n\n /**\n * Get the translation used to position this editor when it's created.\n * @returns {Array<number>}\n */\n getInitialTranslation() {\n return [0, 0];\n }\n\n #createResizers() {\n if (this.#resizersDiv) {\n return;\n }\n this.#resizersDiv = document.createElement(\"div\");\n this.#resizersDiv.classList.add(\"resizers\");\n // When the resizers are used with the keyboard, they're focusable, hence\n // we want to have them in this order (top left, top middle, top right, ...)\n // in the DOM to have the focus order correct.\n const classes = this._willKeepAspectRatio\n ? [\"topLeft\", \"topRight\", \"bottomRight\", \"bottomLeft\"]\n : [\n \"topLeft\",\n \"topMiddle\",\n \"topRight\",\n \"middleRight\",\n \"bottomRight\",\n \"bottomMiddle\",\n \"bottomLeft\",\n \"middleLeft\",\n ];\n for (const name of classes) {\n const div = document.createElement(\"div\");\n this.#resizersDiv.append(div);\n div.classList.add(\"resizer\", name);\n div.setAttribute(\"data-resizer-name\", name);\n div.addEventListener(\n \"pointerdown\",\n this.#resizerPointerdown.bind(this, name)\n );\n div.addEventListener(\"contextmenu\", noContextMenu);\n div.tabIndex = -1;\n }\n this.div.prepend(this.#resizersDiv);\n }\n\n #resizerPointerdown(name, event) {\n event.preventDefault();\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n return;\n }\n\n this.#toggleAltTextButton(false);\n\n const boundResizerPointermove = this.#resizerPointermove.bind(this, name);\n const savedDraggable = this._isDraggable;\n this._isDraggable = false;\n const pointerMoveOptions = { passive: true, capture: true };\n this.parent.togglePointerEvents(false);\n window.addEventListener(\n \"pointermove\",\n boundResizerPointermove,\n pointerMoveOptions\n );\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const savedParentCursor = this.parent.div.style.cursor;\n const savedCursor = this.div.style.cursor;\n this.div.style.cursor = this.parent.div.style.cursor =\n window.getComputedStyle(event.target).cursor;\n\n const pointerUpCallback = () => {\n this.parent.togglePointerEvents(true);\n this.#toggleAltTextButton(true);\n this._isDraggable = savedDraggable;\n window.removeEventListener(\"pointerup\", pointerUpCallback);\n window.removeEventListener(\"blur\", pointerUpCallback);\n window.removeEventListener(\n \"pointermove\",\n boundResizerPointermove,\n pointerMoveOptions\n );\n this.parent.div.style.cursor = savedParentCursor;\n this.div.style.cursor = savedCursor;\n\n this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);\n };\n window.addEventListener(\"pointerup\", pointerUpCallback);\n // If the user switches to another window (with alt+tab), then we end the\n // resize session.\n window.addEventListener(\"blur\", pointerUpCallback);\n }\n\n #addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight) {\n const newX = this.x;\n const newY = this.y;\n const newWidth = this.width;\n const newHeight = this.height;\n if (\n newX === savedX &&\n newY === savedY &&\n newWidth === savedWidth &&\n newHeight === savedHeight\n ) {\n return;\n }\n\n this.addCommands({\n cmd: () => {\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n },\n undo: () => {\n this.width = savedWidth;\n this.height = savedHeight;\n this.x = savedX;\n this.y = savedY;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * savedWidth, parentHeight * savedHeight);\n this.fixAndSetPosition();\n },\n mustExec: true,\n });\n }\n\n #resizerPointermove(name, event) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n\n // 10000 because we multiply by 100 and use toFixed(2) in fixAndSetPosition.\n // Without rounding, the positions of the corners other than the top left\n // one can be slightly wrong.\n const round = x => Math.round(x * 10000) / 10000;\n const rotationMatrix = this.#getRotationMatrix(this.rotation);\n const transf = (x, y) => [\n rotationMatrix[0] * x + rotationMatrix[2] * y,\n rotationMatrix[1] * x + rotationMatrix[3] * y,\n ];\n const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation);\n const invTransf = (x, y) => [\n invRotationMatrix[0] * x + invRotationMatrix[2] * y,\n invRotationMatrix[1] * x + invRotationMatrix[3] * y,\n ];\n let getPoint;\n let getOpposite;\n let isDiagonal = false;\n let isHorizontal = false;\n\n switch (name) {\n case \"topLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, 0];\n getOpposite = (w, h) => [w, h];\n break;\n case \"topMiddle\":\n getPoint = (w, h) => [w / 2, 0];\n getOpposite = (w, h) => [w / 2, h];\n break;\n case \"topRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, 0];\n getOpposite = (w, h) => [0, h];\n break;\n case \"middleRight\":\n isHorizontal = true;\n getPoint = (w, h) => [w, h / 2];\n getOpposite = (w, h) => [0, h / 2];\n break;\n case \"bottomRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, h];\n getOpposite = (w, h) => [0, 0];\n break;\n case \"bottomMiddle\":\n getPoint = (w, h) => [w / 2, h];\n getOpposite = (w, h) => [w / 2, 0];\n break;\n case \"bottomLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, h];\n getOpposite = (w, h) => [w, 0];\n break;\n case \"middleLeft\":\n isHorizontal = true;\n getPoint = (w, h) => [0, h / 2];\n getOpposite = (w, h) => [w, h / 2];\n break;\n }\n\n const point = getPoint(savedWidth, savedHeight);\n const oppositePoint = getOpposite(savedWidth, savedHeight);\n let transfOppositePoint = transf(...oppositePoint);\n const oppositeX = round(savedX + transfOppositePoint[0]);\n const oppositeY = round(savedY + transfOppositePoint[1]);\n let ratioX = 1;\n let ratioY = 1;\n\n let [deltaX, deltaY] = this.screenToPageTranslation(\n event.movementX,\n event.movementY\n );\n [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight);\n\n if (isDiagonal) {\n const oldDiag = Math.hypot(savedWidth, savedHeight);\n ratioX = ratioY = Math.max(\n Math.min(\n Math.hypot(\n oppositePoint[0] - point[0] - deltaX,\n oppositePoint[1] - point[1] - deltaY\n ) / oldDiag,\n // Avoid the editor to be larger than the page.\n 1 / savedWidth,\n 1 / savedHeight\n ),\n // Avoid the editor to be smaller than the minimum size.\n minWidth / savedWidth,\n minHeight / savedHeight\n );\n } else if (isHorizontal) {\n ratioX =\n Math.max(\n minWidth,\n Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))\n ) / savedWidth;\n } else {\n ratioY =\n Math.max(\n minHeight,\n Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))\n ) / savedHeight;\n }\n\n const newWidth = round(savedWidth * ratioX);\n const newHeight = round(savedHeight * ratioY);\n transfOppositePoint = transf(...getOpposite(newWidth, newHeight));\n const newX = oppositeX - transfOppositePoint[0];\n const newY = oppositeY - transfOppositePoint[1];\n\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n }\n\n async addAltTextButton() {\n if (this.#altTextButton) {\n return;\n }\n const altText = (this.#altTextButton = document.createElement(\"button\"));\n altText.className = \"altText\";\n const msg = await AnnotationEditor._l10nPromise.get(\n \"pdfjs-editor-alt-text-button-label\"\n );\n altText.textContent = msg;\n altText.setAttribute(\"aria-label\", msg);\n altText.tabIndex = \"0\";\n altText.addEventListener(\"contextmenu\", noContextMenu);\n altText.addEventListener(\"pointerdown\", event => event.stopPropagation());\n\n const onClick = event => {\n this.#altTextButton.hidden = true;\n event.preventDefault();\n this._uiManager.editAltText(this);\n };\n altText.addEventListener(\"click\", onClick, { capture: true });\n altText.addEventListener(\"keydown\", event => {\n if (event.target === altText && event.key === \"Enter\") {\n this.#altTextWasFromKeyBoard = true;\n onClick(event);\n }\n });\n this.#setAltTextButtonState();\n this.div.append(altText);\n if (!AnnotationEditor.SMALL_EDITOR_SIZE) {\n // We take the width of the alt text button and we add 40% to it to be\n // sure to have enough space for it.\n const PERCENT = 40;\n AnnotationEditor.SMALL_EDITOR_SIZE = Math.min(\n 128,\n Math.round(altText.getBoundingClientRect().width * (1 + PERCENT / 100))\n );\n }\n }\n\n async #setAltTextButtonState() {\n const button = this.#altTextButton;\n if (!button) {\n return;\n }\n if (!this.#altText && !this.#altTextDecorative) {\n button.classList.remove(\"done\");\n this.#altTextTooltip?.remove();\n return;\n }\n button.classList.add(\"done\");\n\n AnnotationEditor._l10nPromise\n .get(\"pdfjs-editor-alt-text-edit-button-label\")\n .then(msg => {\n button.setAttribute(\"aria-label\", msg);\n });\n let tooltip = this.#altTextTooltip;\n if (!tooltip) {\n this.#altTextTooltip = tooltip = document.createElement(\"span\");\n tooltip.className = \"tooltip\";\n tooltip.setAttribute(\"role\", \"tooltip\");\n const id = (tooltip.id = `alt-text-tooltip-${this.id}`);\n button.setAttribute(\"aria-describedby\", id);\n\n const DELAY_TO_SHOW_TOOLTIP = 100;\n button.addEventListener(\"mouseenter\", () => {\n this.#altTextTooltipTimeout = setTimeout(() => {\n this.#altTextTooltipTimeout = null;\n this.#altTextTooltip.classList.add(\"show\");\n this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n subtype: this.editorType,\n data: {\n action: \"alt_text_tooltip\",\n },\n },\n });\n }, DELAY_TO_SHOW_TOOLTIP);\n });\n button.addEventListener(\"mouseleave\", () => {\n if (this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextTooltip?.classList.remove(\"show\");\n });\n }\n tooltip.innerText = this.#altTextDecorative\n ? await AnnotationEditor._l10nPromise.get(\n \"pdfjs-editor-alt-text-decorative-tooltip\"\n )\n : this.#altText;\n\n if (!tooltip.parentNode) {\n button.append(tooltip);\n }\n\n const element = this.getImageForAltText();\n element?.setAttribute(\"aria-describedby\", tooltip.id);\n }\n\n #toggleAltTextButton(enabled = false) {\n if (!this.#altTextButton) {\n return;\n }\n if (!enabled && this.#altTextTooltipTimeout) {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n }\n this.#altTextButton.disabled = !enabled;\n }\n\n altTextFinish() {\n if (!this.#altTextButton) {\n return;\n }\n this.#altTextButton.hidden = false;\n this.#altTextButton.focus({ focusVisible: this.#altTextWasFromKeyBoard });\n this.#altTextWasFromKeyBoard = false;\n }\n\n addEditToolbar() {\n if (this.#editToolbar || this.#isInEditMode) {\n return;\n }\n this.#editToolbar = new EditorToolbar(this);\n this.div.append(this.#editToolbar.render());\n }\n\n removeEditToolbar() {\n if (!this.#editToolbar) {\n return;\n }\n this.#editToolbar.remove();\n this.#editToolbar = null;\n }\n\n getClientDimensions() {\n return this.div.getBoundingClientRect();\n }\n\n get altTextData() {\n return {\n altText: this.#altText,\n decorative: this.#altTextDecorative,\n };\n }\n\n /**\n * Set the alt text data.\n */\n set altTextData({ altText, decorative }) {\n if (this.#altText === altText && this.#altTextDecorative === decorative) {\n return;\n }\n this.#altText = altText;\n this.#altTextDecorative = decorative;\n this.#setAltTextButtonState();\n }\n\n /**\n * Render this editor in a div.\n * @returns {HTMLDivElement | null}\n */\n render() {\n this.div = document.createElement(\"div\");\n this.div.setAttribute(\"data-editor-rotation\", (360 - this.rotation) % 360);\n this.div.className = this.name;\n this.div.setAttribute(\"id\", this.id);\n this.div.setAttribute(\"tabIndex\", 0);\n\n this.setInForeground();\n\n this.div.addEventListener(\"focusin\", this.#boundFocusin);\n this.div.addEventListener(\"focusout\", this.#boundFocusout);\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.parentRotation % 180 !== 0) {\n this.div.style.maxWidth = `${((100 * parentHeight) / parentWidth).toFixed(\n 2\n )}%`;\n this.div.style.maxHeight = `${(\n (100 * parentWidth) /\n parentHeight\n ).toFixed(2)}%`;\n }\n\n const [tx, ty] = this.getInitialTranslation();\n this.translate(tx, ty);\n\n bindEvents(this, this.div, [\"pointerdown\"]);\n\n return this.div;\n }\n\n /**\n * Onpointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Avoid to focus this editor because of a non-left click.\n event.preventDefault();\n return;\n }\n\n this.#hasBeenClicked = true;\n\n this.#setUpDragSession(event);\n }\n\n #setUpDragSession(event) {\n if (!this._isDraggable) {\n return;\n }\n\n const isSelected = this._uiManager.isSelected(this);\n this._uiManager.setUpDragSession();\n\n let pointerMoveOptions, pointerMoveCallback;\n if (isSelected) {\n pointerMoveOptions = { passive: true, capture: true };\n pointerMoveCallback = e => {\n const [tx, ty] = this.screenToPageTranslation(e.movementX, e.movementY);\n this._uiManager.dragSelectedEditors(tx, ty);\n };\n window.addEventListener(\n \"pointermove\",\n pointerMoveCallback,\n pointerMoveOptions\n );\n }\n\n const pointerUpCallback = () => {\n window.removeEventListener(\"pointerup\", pointerUpCallback);\n window.removeEventListener(\"blur\", pointerUpCallback);\n if (isSelected) {\n window.removeEventListener(\n \"pointermove\",\n pointerMoveCallback,\n pointerMoveOptions\n );\n }\n\n this.#hasBeenClicked = false;\n if (!this._uiManager.endDragSession()) {\n const { isMac } = FeatureTest.platform;\n if (\n (event.ctrlKey && !isMac) ||\n event.shiftKey ||\n (event.metaKey && isMac)\n ) {\n this.parent.toggleSelected(this);\n } else {\n this.parent.setSelected(this);\n }\n }\n };\n window.addEventListener(\"pointerup\", pointerUpCallback);\n // If the user is using alt+tab during the dragging session, the pointerup\n // event could be not fired, but a blur event is fired so we can use it in\n // order to interrupt the dragging session.\n window.addEventListener(\"blur\", pointerUpCallback);\n }\n\n moveInDOM() {\n // Moving the editor in the DOM can be expensive, so we wait a bit before.\n // It's important to not block the UI (for example when changing the font\n // size in a FreeText).\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n }\n this.#moveInDOMTimeout = setTimeout(() => {\n this.#moveInDOMTimeout = null;\n this.parent?.moveEditorInDOM(this);\n }, 0);\n }\n\n _setParentAndPosition(parent, x, y) {\n parent.changeParent(this);\n this.x = x;\n this.y = y;\n this.fixAndSetPosition();\n }\n\n /**\n * Convert the current rect into a page one.\n */\n getRect(tx, ty) {\n const scale = this.parentScale;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n const shiftX = tx / scale;\n const shiftY = ty / scale;\n const x = this.x * pageWidth;\n const y = this.y * pageHeight;\n const width = this.width * pageWidth;\n const height = this.height * pageHeight;\n\n switch (this.rotation) {\n case 0:\n return [\n x + shiftX + pageX,\n pageHeight - y - shiftY - height + pageY,\n x + shiftX + width + pageX,\n pageHeight - y - shiftY + pageY,\n ];\n case 90:\n return [\n x + shiftY + pageX,\n pageHeight - y + shiftX + pageY,\n x + shiftY + height + pageX,\n pageHeight - y + shiftX + width + pageY,\n ];\n case 180:\n return [\n x - shiftX - width + pageX,\n pageHeight - y + shiftY + pageY,\n x - shiftX + pageX,\n pageHeight - y + shiftY + height + pageY,\n ];\n case 270:\n return [\n x - shiftY - height + pageX,\n pageHeight - y - shiftX - width + pageY,\n x - shiftY + pageX,\n pageHeight - y - shiftX + pageY,\n ];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n getRectInCurrentCoords(rect, pageHeight) {\n const [x1, y1, x2, y2] = rect;\n\n const width = x2 - x1;\n const height = y2 - y1;\n\n switch (this.rotation) {\n case 0:\n return [x1, pageHeight - y2, width, height];\n case 90:\n return [x1, pageHeight - y1, height, width];\n case 180:\n return [x2, pageHeight - y1, width, height];\n case 270:\n return [x2, pageHeight - y2, height, width];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n /**\n * Executed once this editor has been rendered.\n */\n onceAdded() {}\n\n /**\n * Check if the editor contains something.\n * @returns {boolean}\n */\n isEmpty() {\n return false;\n }\n\n /**\n * Enable edit mode.\n */\n enableEditMode() {\n this.#isInEditMode = true;\n }\n\n /**\n * Disable edit mode.\n */\n disableEditMode() {\n this.#isInEditMode = false;\n }\n\n /**\n * Check if the editor is edited.\n * @returns {boolean}\n */\n isInEditMode() {\n return this.#isInEditMode;\n }\n\n /**\n * If it returns true, then this editor handles the keyboard\n * events itself.\n * @returns {boolean}\n */\n shouldGetKeyboardEvents() {\n return this.#isResizerEnabledForKeyboard;\n }\n\n /**\n * Check if this editor needs to be rebuilt or not.\n * @returns {boolean}\n */\n needsToBeRebuilt() {\n return this.div && !this.isAttachedToDOM;\n }\n\n /**\n * Rebuild the editor in case it has been removed on undo.\n *\n * To implement in subclasses.\n */\n rebuild() {\n this.div?.addEventListener(\"focusin\", this.#boundFocusin);\n this.div?.addEventListener(\"focusout\", this.#boundFocusout);\n }\n\n /**\n * Serialize the editor.\n * The result of the serialization will be used to construct a\n * new annotation to add to the pdf document.\n *\n * To implement in subclasses.\n * @param {boolean} [isForCopying]\n * @param {Object | null} [context]\n * @returns {Object | null}\n */\n serialize(isForCopying = false, context = null) {\n unreachable(\"An editor must be serializable\");\n }\n\n /**\n * Deserialize the editor.\n * The result of the deserialization is a new editor.\n *\n * @param {Object} data\n * @param {AnnotationEditorLayer} parent\n * @param {AnnotationEditorUIManager} uiManager\n * @returns {AnnotationEditor | null}\n */\n static deserialize(data, parent, uiManager) {\n const editor = new this.prototype.constructor({\n parent,\n id: parent.getNextId(),\n uiManager,\n });\n editor.rotation = data.rotation;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const [x, y, width, height] = editor.getRectInCurrentCoords(\n data.rect,\n pageHeight\n );\n editor.x = x / pageWidth;\n editor.y = y / pageHeight;\n editor.width = width / pageWidth;\n editor.height = height / pageHeight;\n\n return editor;\n }\n\n /**\n * Remove this editor.\n * It's used on ctrl+backspace action.\n */\n remove() {\n this.div.removeEventListener(\"focusin\", this.#boundFocusin);\n this.div.removeEventListener(\"focusout\", this.#boundFocusout);\n\n if (!this.isEmpty()) {\n // The editor is removed but it can be back at some point thanks to\n // undo/redo so we must commit it before.\n this.commit();\n }\n if (this.parent) {\n this.parent.remove(this);\n } else {\n this._uiManager.removeEditor(this);\n }\n\n // The editor is removed so we can remove the alt text button and if it's\n // restored then it's up to the subclass to add it back.\n this.#altTextButton?.remove();\n this.#altTextButton = null;\n this.#altTextTooltip = null;\n if (this.#moveInDOMTimeout) {\n clearTimeout(this.#moveInDOMTimeout);\n this.#moveInDOMTimeout = null;\n }\n this.#stopResizing();\n this.removeEditToolbar();\n }\n\n /**\n * @returns {boolean} true if this editor can be resized.\n */\n get isResizable() {\n return false;\n }\n\n /**\n * Add the resizers to this editor.\n */\n makeResizable() {\n if (this.isResizable) {\n this.#createResizers();\n this.#resizersDiv.classList.remove(\"hidden\");\n bindEvents(this, this.div, [\"keydown\"]);\n }\n }\n\n /**\n * onkeydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (\n !this.isResizable ||\n event.target !== this.div ||\n event.key !== \"Enter\"\n ) {\n return;\n }\n this._uiManager.setSelected(this);\n this.#savedDimensions = {\n savedX: this.x,\n savedY: this.y,\n savedWidth: this.width,\n savedHeight: this.height,\n };\n const children = this.#resizersDiv.children;\n if (!this.#allResizerDivs) {\n this.#allResizerDivs = Array.from(children);\n const boundResizerKeydown = this.#resizerKeydown.bind(this);\n const boundResizerBlur = this.#resizerBlur.bind(this);\n for (const div of this.#allResizerDivs) {\n const name = div.getAttribute(\"data-resizer-name\");\n div.setAttribute(\"role\", \"spinbutton\");\n div.addEventListener(\"keydown\", boundResizerKeydown);\n div.addEventListener(\"blur\", boundResizerBlur);\n div.addEventListener(\"focus\", this.#resizerFocus.bind(this, name));\n AnnotationEditor._l10nPromise\n .get(`pdfjs-editor-resizer-label-${name}`)\n .then(msg => div.setAttribute(\"aria-label\", msg));\n }\n }\n\n // We want to have the resizers in the visual order, so we move the first\n // (top-left) to the right place.\n const first = this.#allResizerDivs[0];\n let firstPosition = 0;\n for (const div of children) {\n if (div === first) {\n break;\n }\n firstPosition++;\n }\n const nextFirstPosition =\n (((360 - this.rotation + this.parentRotation) % 360) / 90) *\n (this.#allResizerDivs.length / 4);\n\n if (nextFirstPosition !== firstPosition) {\n // We need to reorder the resizers in the DOM in order to have the focus\n // on the top-left one.\n if (nextFirstPosition < firstPosition) {\n for (let i = 0; i < firstPosition - nextFirstPosition; i++) {\n this.#resizersDiv.append(this.#resizersDiv.firstChild);\n }\n } else if (nextFirstPosition > firstPosition) {\n for (let i = 0; i < nextFirstPosition - firstPosition; i++) {\n this.#resizersDiv.firstChild.before(this.#resizersDiv.lastChild);\n }\n }\n\n let i = 0;\n for (const child of children) {\n const div = this.#allResizerDivs[i++];\n const name = div.getAttribute(\"data-resizer-name\");\n AnnotationEditor._l10nPromise\n .get(`pdfjs-editor-resizer-label-${name}`)\n .then(msg => child.setAttribute(\"aria-label\", msg));\n }\n }\n\n this.#setResizerTabIndex(0);\n this.#isResizerEnabledForKeyboard = true;\n this.#resizersDiv.firstChild.focus({ focusVisible: true });\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n\n #resizerKeydown(event) {\n AnnotationEditor._resizerKeyboardManager.exec(this, event);\n }\n\n #resizerBlur(event) {\n if (\n this.#isResizerEnabledForKeyboard &&\n event.relatedTarget?.parentNode !== this.#resizersDiv\n ) {\n this.#stopResizing();\n }\n }\n\n #resizerFocus(name) {\n this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : \"\";\n }\n\n #setResizerTabIndex(value) {\n if (!this.#allResizerDivs) {\n return;\n }\n for (const div of this.#allResizerDivs) {\n div.tabIndex = value;\n }\n }\n\n _resizeWithKeyboard(x, y) {\n if (!this.#isResizerEnabledForKeyboard) {\n return;\n }\n this.#resizerPointermove(this.#focusedResizerName, {\n movementX: x,\n movementY: y,\n });\n }\n\n #stopResizing() {\n this.#isResizerEnabledForKeyboard = false;\n this.#setResizerTabIndex(-1);\n if (this.#savedDimensions) {\n const { savedX, savedY, savedWidth, savedHeight } = this.#savedDimensions;\n this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);\n this.#savedDimensions = null;\n }\n }\n\n _stopResizingWithKeyboard() {\n this.#stopResizing();\n this.div.focus();\n }\n\n /**\n * Select this editor.\n */\n select() {\n this.makeResizable();\n this.div?.classList.add(\"selectedEditor\");\n this.addEditToolbar();\n this.#editToolbar?.show();\n }\n\n /**\n * Unselect this editor.\n */\n unselect() {\n this.#resizersDiv?.classList.add(\"hidden\");\n this.div?.classList.remove(\"selectedEditor\");\n if (this.div?.contains(document.activeElement)) {\n // Don't use this.div.blur() because we don't know where the focus will\n // go.\n this._uiManager.currentLayer.div.focus();\n }\n this.#editToolbar?.hide();\n }\n\n /**\n * Update some parameters which have been changed through the UI.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {}\n\n /**\n * When the user disables the editing mode some editors can change some of\n * their properties.\n */\n disableEditing() {\n if (this.#altTextButton) {\n this.#altTextButton.hidden = true;\n }\n }\n\n /**\n * When the user enables the editing mode some editors can change some of\n * their properties.\n */\n enableEditing() {\n if (this.#altTextButton) {\n this.#altTextButton.hidden = false;\n }\n }\n\n /**\n * The editor is about to be edited.\n */\n enterInEditMode() {}\n\n /**\n * @returns {HTMLElement | null} the element requiring an alt text.\n */\n getImageForAltText() {\n return null;\n }\n\n /**\n * Get the div which really contains the displayed content.\n * @returns {HTMLDivElement | undefined}\n */\n get contentDiv() {\n return this.div;\n }\n\n /**\n * If true then the editor is currently edited.\n * @type {boolean}\n */\n get isEditing() {\n return this.#isEditing;\n }\n\n /**\n * When set to true, it means that this editor is currently edited.\n * @param {boolean} value\n */\n set isEditing(value) {\n this.#isEditing = value;\n if (!this.parent) {\n return;\n }\n if (value) {\n this.parent.setSelected(this);\n this.parent.setActiveEditor(this);\n } else {\n this.parent.setActiveEditor(null);\n }\n }\n\n /**\n * Set the aspect ratio to use when resizing.\n * @param {number} width\n * @param {number} height\n */\n setAspectRatio(width, height) {\n this.#keepAspectRatio = true;\n const aspectRatio = width / height;\n const { style } = this.div;\n style.aspectRatio = aspectRatio;\n style.height = \"auto\";\n }\n\n static get MIN_SIZE() {\n return 16;\n }\n}\n\n// This class is used to fake an editor which has been deleted.\nclass FakeEditor extends AnnotationEditor {\n constructor(params) {\n super(params);\n this.annotationElementId = params.annotationElementId;\n this.deleted = true;\n }\n\n serialize() {\n return {\n id: this.annotationElementId,\n deleted: true,\n pageIndex: this.pageIndex,\n };\n }\n}\n\nexport { AnnotationEditor };\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\nclass Outliner {\n #box;\n\n #verticalEdges = [];\n\n #intervals = [];\n\n /**\n * Construct an outliner.\n * @param {Array<Object>} boxes - An array of axis-aligned rectangles.\n * @param {number} borderWidth - The width of the border of the boxes, it\n * allows to make the boxes bigger (or smaller).\n * @param {number} innerMargin - The margin between the boxes and the\n * outlines. It's important to not have a null innerMargin when we want to\n * draw the outline else the stroked outline could be clipped because of its\n * width.\n * @param {boolean} isLTR - true if we're in LTR mode. It's used to determine\n * the last point of the boxes.\n */\n constructor(boxes, borderWidth = 0, innerMargin = 0, isLTR = true) {\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n\n // We round the coordinates to slightly reduce the number of edges in the\n // final outlines.\n const NUMBER_OF_DIGITS = 4;\n const EPSILON = 10 ** -NUMBER_OF_DIGITS;\n\n // The coordinates of the boxes are in the page coordinate system.\n for (const { x, y, width, height } of boxes) {\n const x1 = Math.floor((x - borderWidth) / EPSILON) * EPSILON;\n const x2 = Math.ceil((x + width + borderWidth) / EPSILON) * EPSILON;\n const y1 = Math.floor((y - borderWidth) / EPSILON) * EPSILON;\n const y2 = Math.ceil((y + height + borderWidth) / EPSILON) * EPSILON;\n const left = [x1, y1, y2, true];\n const right = [x2, y1, y2, false];\n this.#verticalEdges.push(left, right);\n\n minX = Math.min(minX, x1);\n maxX = Math.max(maxX, x2);\n minY = Math.min(minY, y1);\n maxY = Math.max(maxY, y2);\n }\n\n const bboxWidth = maxX - minX + 2 * innerMargin;\n const bboxHeight = maxY - minY + 2 * innerMargin;\n const shiftedMinX = minX - innerMargin;\n const shiftedMinY = minY - innerMargin;\n const lastEdge = this.#verticalEdges.at(isLTR ? -1 : -2);\n const lastPoint = [lastEdge[0], lastEdge[2]];\n\n // Convert the coordinates of the edges into box coordinates.\n for (const edge of this.#verticalEdges) {\n const [x, y1, y2] = edge;\n edge[0] = (x - shiftedMinX) / bboxWidth;\n edge[1] = (y1 - shiftedMinY) / bboxHeight;\n edge[2] = (y2 - shiftedMinY) / bboxHeight;\n }\n\n this.#box = {\n x: shiftedMinX,\n y: shiftedMinY,\n width: bboxWidth,\n height: bboxHeight,\n lastPoint,\n };\n }\n\n getOutlines() {\n // We begin to sort lexicographically the vertical edges by their abscissa,\n // and then by their ordinate.\n this.#verticalEdges.sort(\n (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2]\n );\n\n // We're now using a sweep line algorithm to find the outlines.\n // We start with the leftmost vertical edge, and we're going to iterate\n // over all the vertical edges from left to right.\n // Each time we encounter a left edge, we're going to insert the interval\n // [y1, y2] in the set of intervals.\n // This set of intervals is used to break the vertical edges into chunks:\n // we only take the part of the vertical edge that isn't in the union of\n // the intervals.\n const outlineVerticalEdges = [];\n for (const edge of this.#verticalEdges) {\n if (edge[3]) {\n // Left edge.\n outlineVerticalEdges.push(...this.#breakEdge(edge));\n this.#insert(edge);\n } else {\n // Right edge.\n this.#remove(edge);\n outlineVerticalEdges.push(...this.#breakEdge(edge));\n }\n }\n return this.#getOutlines(outlineVerticalEdges);\n }\n\n #getOutlines(outlineVerticalEdges) {\n const edges = [];\n const allEdges = new Set();\n\n for (const edge of outlineVerticalEdges) {\n const [x, y1, y2] = edge;\n edges.push([x, y1, edge], [x, y2, edge]);\n }\n\n // We sort lexicographically the vertices of each edge by their ordinate and\n // by their abscissa.\n // Every pair (v_2i, v_{2i + 1}) of vertices defines a horizontal edge.\n // So for every vertical edge, we're going to add the two vertical edges\n // which are connected to it through a horizontal edge.\n edges.sort((a, b) => a[1] - b[1] || a[0] - b[0]);\n for (let i = 0, ii = edges.length; i < ii; i += 2) {\n const edge1 = edges[i][2];\n const edge2 = edges[i + 1][2];\n edge1.push(edge2);\n edge2.push(edge1);\n allEdges.add(edge1);\n allEdges.add(edge2);\n }\n const outlines = [];\n let outline;\n\n while (allEdges.size > 0) {\n const edge = allEdges.values().next().value;\n let [x, y1, y2, edge1, edge2] = edge;\n allEdges.delete(edge);\n let lastPointX = x;\n let lastPointY = y1;\n\n outline = [x, y2];\n outlines.push(outline);\n\n while (true) {\n let e;\n if (allEdges.has(edge1)) {\n e = edge1;\n } else if (allEdges.has(edge2)) {\n e = edge2;\n } else {\n break;\n }\n\n allEdges.delete(e);\n [x, y1, y2, edge1, edge2] = e;\n\n if (lastPointX !== x) {\n outline.push(lastPointX, lastPointY, x, lastPointY === y1 ? y1 : y2);\n lastPointX = x;\n }\n lastPointY = lastPointY === y1 ? y2 : y1;\n }\n outline.push(lastPointX, lastPointY);\n }\n return { outlines, box: this.#box };\n }\n\n #binarySearch(y) {\n const array = this.#intervals;\n let start = 0;\n let end = array.length - 1;\n\n while (start <= end) {\n const middle = (start + end) >> 1;\n const y1 = array[middle][0];\n if (y1 === y) {\n return middle;\n }\n if (y1 < y) {\n start = middle + 1;\n } else {\n end = middle - 1;\n }\n }\n return end + 1;\n }\n\n #insert([, y1, y2]) {\n const index = this.#binarySearch(y1);\n this.#intervals.splice(index, 0, [y1, y2]);\n }\n\n #remove([, y1, y2]) {\n const index = this.#binarySearch(y1);\n for (let i = index; i < this.#intervals.length; i++) {\n const [start, end] = this.#intervals[i];\n if (start !== y1) {\n break;\n }\n if (start === y1 && end === y2) {\n this.#intervals.splice(i, 1);\n return;\n }\n }\n for (let i = index - 1; i >= 0; i--) {\n const [start, end] = this.#intervals[i];\n if (start !== y1) {\n break;\n }\n if (start === y1 && end === y2) {\n this.#intervals.splice(i, 1);\n return;\n }\n }\n }\n\n #breakEdge(edge) {\n const [x, y1, y2] = edge;\n const results = [[x, y1, y2]];\n const index = this.#binarySearch(y2);\n for (let i = 0; i < index; i++) {\n const [start, end] = this.#intervals[i];\n for (let j = 0, jj = results.length; j < jj; j++) {\n const [, y3, y4] = results[j];\n if (end <= y3 || y4 <= start) {\n // There is no intersection between the interval and the edge, hence\n // we keep it as is.\n continue;\n }\n if (y3 >= start) {\n if (y4 > end) {\n results[j][1] = end;\n } else {\n if (jj === 1) {\n return [];\n }\n // The edge is included in the interval, hence we remove it.\n results.splice(j, 1);\n j--;\n jj--;\n }\n continue;\n }\n results[j][2] = start;\n if (y4 > end) {\n results.push([x, end, y4]);\n }\n }\n }\n return results;\n }\n}\n\nexport { Outliner };\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(\"./editor.js\").AnnotationEditor} AnnotationEditor */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n FeatureTest,\n getUuid,\n shadow,\n Util,\n warn,\n} from \"../../shared/util.js\";\nimport {\n fetchData,\n getColorValues,\n getRGB,\n PixelsPerInch,\n} from \"../display_utils.js\";\n\nfunction bindEvents(obj, element, names) {\n for (const name of names) {\n element.addEventListener(name, obj[name].bind(obj));\n }\n}\n\n/**\n * Convert a number between 0 and 100 into an hex number between 0 and 255.\n * @param {number} opacity\n * @return {string}\n */\nfunction opacityToHex(opacity) {\n return Math.round(Math.min(255, Math.max(1, 255 * opacity)))\n .toString(16)\n .padStart(2, \"0\");\n}\n\n/**\n * Class to create some unique ids for the different editors.\n */\nclass IdManager {\n #id = 0;\n\n /**\n * Get a unique id.\n * @returns {string}\n */\n getId() {\n return `${AnnotationEditorPrefix}${this.#id++}`;\n }\n}\n\n/**\n * Class to manage the images used by the editors.\n * The main idea is to try to minimize the memory used by the images.\n * The images are cached and reused when possible\n * We use a refCounter to know when an image is not used anymore but we need to\n * be able to restore an image after a remove+undo, so we keep a file reference\n * or an url one.\n */\nclass ImageManager {\n #baseId = getUuid();\n\n #id = 0;\n\n #cache = null;\n\n static get _isSVGFittingCanvas() {\n // By default, Firefox doesn't rescale without preserving the aspect ratio\n // when drawing an SVG image on a canvas, see https://bugzilla.mozilla.org/1547776.\n // The \"workaround\" is to append \"svgView(preserveAspectRatio(none))\" to the\n // url, but according to comment #15, it seems that it leads to unexpected\n // behavior in Safari.\n const svg = `data:image/svg+xml;charset=UTF-8,<svg viewBox=\"0 0 1 1\" width=\"1\" height=\"1\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"1\" height=\"1\" style=\"fill:red;\"/></svg>`;\n const canvas = new OffscreenCanvas(1, 3);\n const ctx = canvas.getContext(\"2d\");\n const image = new Image();\n image.src = svg;\n const promise = image.decode().then(() => {\n ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3);\n return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0;\n });\n\n return shadow(this, \"_isSVGFittingCanvas\", promise);\n }\n\n async #get(key, rawData) {\n this.#cache ||= new Map();\n let data = this.#cache.get(key);\n if (data === null) {\n // We already tried to load the image but it failed.\n return null;\n }\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n try {\n data ||= {\n bitmap: null,\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 0,\n isSvg: false,\n };\n let image;\n if (typeof rawData === \"string\") {\n data.url = rawData;\n image = await fetchData(rawData, \"blob\");\n } else {\n image = data.file = rawData;\n }\n\n if (image.type === \"image/svg+xml\") {\n // Unfortunately, createImageBitmap doesn't work with SVG images.\n // (see https://bugzilla.mozilla.org/1841972).\n const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;\n const fileReader = new FileReader();\n const imageElement = new Image();\n const imagePromise = new Promise((resolve, reject) => {\n imageElement.onload = () => {\n data.bitmap = imageElement;\n data.isSvg = true;\n resolve();\n };\n fileReader.onload = async () => {\n const url = (data.svgUrl = fileReader.result);\n // We need to set the preserveAspectRatio to none in order to let\n // the image fits the canvas when resizing.\n imageElement.src = (await mustRemoveAspectRatioPromise)\n ? `${url}#svgView(preserveAspectRatio(none))`\n : url;\n };\n imageElement.onerror = fileReader.onerror = reject;\n });\n fileReader.readAsDataURL(image);\n await imagePromise;\n } else {\n data.bitmap = await createImageBitmap(image);\n }\n data.refCounter = 1;\n } catch (e) {\n console.error(e);\n data = null;\n }\n this.#cache.set(key, data);\n if (data) {\n this.#cache.set(data.id, data);\n }\n return data;\n }\n\n async getFromFile(file) {\n const { lastModified, name, size, type } = file;\n return this.#get(`${lastModified}_${name}_${size}_${type}`, file);\n }\n\n async getFromUrl(url) {\n return this.#get(url, url);\n }\n\n async getFromId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return null;\n }\n if (data.bitmap) {\n data.refCounter += 1;\n return data;\n }\n\n if (data.file) {\n return this.getFromFile(data.file);\n }\n return this.getFromUrl(data.url);\n }\n\n getSvgUrl(id) {\n const data = this.#cache.get(id);\n if (!data?.isSvg) {\n return null;\n }\n return data.svgUrl;\n }\n\n deleteId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return;\n }\n data.refCounter -= 1;\n if (data.refCounter !== 0) {\n return;\n }\n data.bitmap = null;\n }\n\n // We can use the id only if it belongs this manager.\n // We must take care of having the right manager because we can copy/paste\n // some images from other documents, hence it'd be a pity to use an id from an\n // other manager.\n isValidId(id) {\n return id.startsWith(`image_${this.#baseId}_`);\n }\n}\n\n/**\n * Class to handle undo/redo.\n * Commands are just saved in a buffer.\n * If we hit some memory issues we could likely use a circular buffer.\n * It has to be used as a singleton.\n */\nclass CommandManager {\n #commands = [];\n\n #locked = false;\n\n #maxSize;\n\n #position = -1;\n\n constructor(maxSize = 128) {\n this.#maxSize = maxSize;\n }\n\n /**\n * @typedef {Object} addOptions\n * @property {function} cmd\n * @property {function} undo\n * @property {boolean} mustExec\n * @property {number} type\n * @property {boolean} overwriteIfSameType\n * @property {boolean} keepUndo\n */\n\n /**\n * Add a new couple of commands to be used in case of redo/undo.\n * @param {addOptions} options\n */\n add({\n cmd,\n undo,\n mustExec,\n type = NaN,\n overwriteIfSameType = false,\n keepUndo = false,\n }) {\n if (mustExec) {\n cmd();\n }\n\n if (this.#locked) {\n return;\n }\n\n const save = { cmd, undo, type };\n if (this.#position === -1) {\n if (this.#commands.length > 0) {\n // All the commands have been undone and then a new one is added\n // hence we clear the queue.\n this.#commands.length = 0;\n }\n this.#position = 0;\n this.#commands.push(save);\n return;\n }\n\n if (overwriteIfSameType && this.#commands[this.#position].type === type) {\n // For example when we change a color we don't want to\n // be able to undo all the steps, hence we only want to\n // keep the last undoable action in this sequence of actions.\n if (keepUndo) {\n save.undo = this.#commands[this.#position].undo;\n }\n this.#commands[this.#position] = save;\n return;\n }\n\n const next = this.#position + 1;\n if (next === this.#maxSize) {\n this.#commands.splice(0, 1);\n } else {\n this.#position = next;\n if (next < this.#commands.length) {\n this.#commands.splice(next);\n }\n }\n\n this.#commands.push(save);\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n if (this.#position === -1) {\n // Nothing to undo.\n return;\n }\n\n // Avoid to insert something during the undo execution.\n this.#locked = true;\n this.#commands[this.#position].undo();\n this.#locked = false;\n\n this.#position -= 1;\n }\n\n /**\n * Redo the last command.\n */\n redo() {\n if (this.#position < this.#commands.length - 1) {\n this.#position += 1;\n\n // Avoid to insert something during the redo execution.\n this.#locked = true;\n this.#commands[this.#position].cmd();\n this.#locked = false;\n }\n }\n\n /**\n * Check if there is something to undo.\n * @returns {boolean}\n */\n hasSomethingToUndo() {\n return this.#position !== -1;\n }\n\n /**\n * Check if there is something to redo.\n * @returns {boolean}\n */\n hasSomethingToRedo() {\n return this.#position < this.#commands.length - 1;\n }\n\n destroy() {\n this.#commands = null;\n }\n}\n\n/**\n * Class to handle the different keyboards shortcuts we can have on mac or\n * non-mac OSes.\n */\nclass KeyboardManager {\n /**\n * Create a new keyboard manager class.\n * @param {Array<Array>} callbacks - an array containing an array of shortcuts\n * and a callback to call.\n * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.\n */\n constructor(callbacks) {\n this.buffer = [];\n this.callbacks = new Map();\n this.allKeys = new Set();\n\n const { isMac } = FeatureTest.platform;\n for (const [keys, callback, options = {}] of callbacks) {\n for (const key of keys) {\n const isMacKey = key.startsWith(\"mac+\");\n if (isMac && isMacKey) {\n this.callbacks.set(key.slice(4), { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n } else if (!isMac && !isMacKey) {\n this.callbacks.set(key, { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n }\n }\n }\n }\n\n /**\n * Serialize an event into a string in order to match a\n * potential key for a callback.\n * @param {KeyboardEvent} event\n * @returns {string}\n */\n #serialize(event) {\n if (event.altKey) {\n this.buffer.push(\"alt\");\n }\n if (event.ctrlKey) {\n this.buffer.push(\"ctrl\");\n }\n if (event.metaKey) {\n this.buffer.push(\"meta\");\n }\n if (event.shiftKey) {\n this.buffer.push(\"shift\");\n }\n this.buffer.push(event.key);\n const str = this.buffer.join(\"+\");\n this.buffer.length = 0;\n\n return str;\n }\n\n /**\n * Execute a callback, if any, for a given keyboard event.\n * The self is used as `this` in the callback.\n * @param {Object} self\n * @param {KeyboardEvent} event\n * @returns\n */\n exec(self, event) {\n if (!this.allKeys.has(event.key)) {\n return;\n }\n const info = this.callbacks.get(this.#serialize(event));\n if (!info) {\n return;\n }\n const {\n callback,\n options: { bubbles = false, args = [], checker = null },\n } = info;\n\n if (checker && !checker(self, event)) {\n return;\n }\n callback.bind(self, ...args)();\n\n // For example, ctrl+s in a FreeText must be handled by the viewer, hence\n // the event must bubble.\n if (!bubbles) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n}\n\nclass ColorManager {\n static _colorsMapping = new Map([\n [\"CanvasText\", [0, 0, 0]],\n [\"Canvas\", [255, 255, 255]],\n ]);\n\n get _colors() {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ) {\n return shadow(this, \"_colors\", ColorManager._colorsMapping);\n }\n\n const colors = new Map([\n [\"CanvasText\", null],\n [\"Canvas\", null],\n ]);\n getColorValues(colors);\n return shadow(this, \"_colors\", colors);\n }\n\n /**\n * In High Contrast Mode, the color on the screen is not always the\n * real color used in the pdf.\n * For example in some cases white can appear to be black but when saving\n * we want to have white.\n * @param {string} color\n * @returns {Array<number>}\n */\n convert(color) {\n const rgb = getRGB(color);\n if (!window.matchMedia(\"(forced-colors: active)\").matches) {\n return rgb;\n }\n\n for (const [name, RGB] of this._colors) {\n if (RGB.every((x, i) => x === rgb[i])) {\n return ColorManager._colorsMapping.get(name);\n }\n }\n return rgb;\n }\n\n /**\n * An input element must have its color value as a hex string\n * and not as color name.\n * So this function converts a name into an hex string.\n * @param {string} name\n * @returns {string}\n */\n getHexCode(name) {\n const rgb = this._colors.get(name);\n if (!rgb) {\n return name;\n }\n return Util.makeHexColor(...rgb);\n }\n}\n\n/**\n * A pdf has several pages and each of them when it will rendered\n * will have an AnnotationEditorLayer which will contain the some\n * new Annotations associated to an editor in order to modify them.\n *\n * This class is used to manage all the different layers, editors and\n * some action like copy/paste, undo/redo, ...\n */\nclass AnnotationEditorUIManager {\n #activeEditor = null;\n\n #allEditors = new Map();\n\n #allLayers = new Map();\n\n #altTextManager = null;\n\n #annotationStorage = null;\n\n #commandManager = new CommandManager();\n\n #currentPageIndex = 0;\n\n #deletedAnnotationsElementIds = new Set();\n\n #draggingEditors = null;\n\n #editorTypes = null;\n\n #editorsToRescale = new Set();\n\n #filterFactory = null;\n\n #focusMainContainerTimeoutId = null;\n\n #idManager = new IdManager();\n\n #isEnabled = false;\n\n #isWaiting = false;\n\n #lastActiveElement = null;\n\n #mode = AnnotationEditorType.NONE;\n\n #selectedEditors = new Set();\n\n #pageColors = null;\n\n #boundBlur = this.blur.bind(this);\n\n #boundFocus = this.focus.bind(this);\n\n #boundCopy = this.copy.bind(this);\n\n #boundCut = this.cut.bind(this);\n\n #boundPaste = this.paste.bind(this);\n\n #boundKeydown = this.keydown.bind(this);\n\n #boundOnEditingAction = this.onEditingAction.bind(this);\n\n #boundOnPageChanging = this.onPageChanging.bind(this);\n\n #boundOnScaleChanging = this.onScaleChanging.bind(this);\n\n #boundOnRotationChanging = this.onRotationChanging.bind(this);\n\n #previousStates = {\n isEditing: false,\n isEmpty: true,\n hasSomethingToUndo: false,\n hasSomethingToRedo: false,\n hasSelectedEditor: false,\n };\n\n #translation = [0, 0];\n\n #translationTimeoutId = null;\n\n #container = null;\n\n #viewer = null;\n\n static TRANSLATE_SMALL = 1; // page units.\n\n static TRANSLATE_BIG = 10; // page units.\n\n static get _keyboardManager() {\n const proto = AnnotationEditorUIManager.prototype;\n\n const arrowChecker = self => {\n // If the focused element is an input, we don't want to handle the arrow.\n // For example, sliders can be controlled with the arrow keys.\n return (\n self.#container.contains(document.activeElement) &&\n self.hasSomethingToControl()\n );\n };\n\n const textInputChecker = (_self, { target: el }) => {\n if (el instanceof HTMLInputElement) {\n const { type } = el;\n return type !== \"text\" && type !== \"number\";\n }\n return true;\n };\n\n const small = this.TRANSLATE_SMALL;\n const big = this.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n [\"ctrl+a\", \"mac+meta+a\"],\n proto.selectAll,\n { checker: textInputChecker },\n ],\n [[\"ctrl+z\", \"mac+meta+z\"], proto.undo, { checker: textInputChecker }],\n [\n // On mac, depending of the OS version, the event.key is either \"z\" or\n // \"Z\" when the user presses \"meta+shift+z\".\n [\n \"ctrl+y\",\n \"ctrl+shift+z\",\n \"mac+meta+shift+z\",\n \"ctrl+shift+Z\",\n \"mac+meta+shift+Z\",\n ],\n proto.redo,\n { checker: textInputChecker },\n ],\n [\n [\n \"Backspace\",\n \"alt+Backspace\",\n \"ctrl+Backspace\",\n \"shift+Backspace\",\n \"mac+Backspace\",\n \"mac+alt+Backspace\",\n \"mac+ctrl+Backspace\",\n \"Delete\",\n \"ctrl+Delete\",\n \"shift+Delete\",\n \"mac+Delete\",\n ],\n proto.delete,\n { checker: textInputChecker },\n ],\n [\n [\"Enter\", \"mac+Enter\"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: (self, { target: el }) =>\n !(el instanceof HTMLButtonElement) &&\n self.#container.contains(el) &&\n !self.isEnterHandled,\n },\n ],\n [\n [\" \", \"mac+ \"],\n proto.addNewEditorFromKeyboard,\n {\n // Those shortcuts can be used in the toolbar for some other actions\n // like zooming, hence we need to check if the container has the\n // focus.\n checker: self => self.#container.contains(document.activeElement),\n },\n ],\n [[\"Escape\", \"mac+Escape\"], proto.unselectAll],\n [\n [\"ArrowLeft\", \"mac+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\", \"mac+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\", \"mac+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\", \"mac+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n constructor(\n container,\n viewer,\n altTextManager,\n eventBus,\n pdfDocument,\n pageColors\n ) {\n this.#container = container;\n this.#viewer = viewer;\n this.#altTextManager = altTextManager;\n this._eventBus = eventBus;\n this._eventBus._on(\"editingaction\", this.#boundOnEditingAction);\n this._eventBus._on(\"pagechanging\", this.#boundOnPageChanging);\n this._eventBus._on(\"scalechanging\", this.#boundOnScaleChanging);\n this._eventBus._on(\"rotationchanging\", this.#boundOnRotationChanging);\n this.#annotationStorage = pdfDocument.annotationStorage;\n this.#filterFactory = pdfDocument.filterFactory;\n this.#pageColors = pageColors;\n this.viewParameters = {\n realScale: PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: 0,\n };\n }\n\n destroy() {\n this.#removeKeyboardManager();\n this.#removeFocusManager();\n this._eventBus._off(\"editingaction\", this.#boundOnEditingAction);\n this._eventBus._off(\"pagechanging\", this.#boundOnPageChanging);\n this._eventBus._off(\"scalechanging\", this.#boundOnScaleChanging);\n this._eventBus._off(\"rotationchanging\", this.#boundOnRotationChanging);\n for (const layer of this.#allLayers.values()) {\n layer.destroy();\n }\n this.#allLayers.clear();\n this.#allEditors.clear();\n this.#editorsToRescale.clear();\n this.#activeEditor = null;\n this.#selectedEditors.clear();\n this.#commandManager.destroy();\n this.#altTextManager.destroy();\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n this.#focusMainContainerTimeoutId = null;\n }\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n this.#translationTimeoutId = null;\n }\n }\n\n get hcmFilter() {\n return shadow(\n this,\n \"hcmFilter\",\n this.#pageColors\n ? this.#filterFactory.addHCMFilter(\n this.#pageColors.foreground,\n this.#pageColors.background\n )\n : \"none\"\n );\n }\n\n get direction() {\n return shadow(\n this,\n \"direction\",\n getComputedStyle(this.#container).direction\n );\n }\n\n editAltText(editor) {\n this.#altTextManager?.editAltText(this, editor);\n }\n\n onPageChanging({ pageNumber }) {\n this.#currentPageIndex = pageNumber - 1;\n }\n\n focusMainContainer() {\n this.#container.focus();\n }\n\n findParent(x, y) {\n for (const layer of this.#allLayers.values()) {\n const {\n x: layerX,\n y: layerY,\n width,\n height,\n } = layer.div.getBoundingClientRect();\n if (\n x >= layerX &&\n x <= layerX + width &&\n y >= layerY &&\n y <= layerY + height\n ) {\n return layer;\n }\n }\n return null;\n }\n\n disableUserSelect(value = false) {\n this.#viewer.classList.toggle(\"noUserSelect\", value);\n }\n\n addShouldRescale(editor) {\n this.#editorsToRescale.add(editor);\n }\n\n removeShouldRescale(editor) {\n this.#editorsToRescale.delete(editor);\n }\n\n onScaleChanging({ scale }) {\n this.commitOrRemove();\n this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS;\n for (const editor of this.#editorsToRescale) {\n editor.onScaleChanging();\n }\n }\n\n onRotationChanging({ pagesRotation }) {\n this.commitOrRemove();\n this.viewParameters.rotation = pagesRotation;\n }\n\n /**\n * Add an editor in the annotation storage.\n * @param {AnnotationEditor} editor\n */\n addToAnnotationStorage(editor) {\n if (\n !editor.isEmpty() &&\n this.#annotationStorage &&\n !this.#annotationStorage.has(editor.id)\n ) {\n this.#annotationStorage.setValue(editor.id, editor);\n }\n }\n\n #addFocusManager() {\n window.addEventListener(\"focus\", this.#boundFocus);\n window.addEventListener(\"blur\", this.#boundBlur);\n }\n\n #removeFocusManager() {\n window.removeEventListener(\"focus\", this.#boundFocus);\n window.removeEventListener(\"blur\", this.#boundBlur);\n }\n\n blur() {\n if (!this.hasSelection) {\n return;\n }\n // When several editors are selected and the window loses focus, we want to\n // keep the last active element in order to be able to focus it again when\n // the window gets the focus back but we don't want to trigger any focus\n // callbacks else only one editor will be selected.\n const { activeElement } = document;\n for (const editor of this.#selectedEditors) {\n if (editor.div.contains(activeElement)) {\n this.#lastActiveElement = [editor, activeElement];\n editor._focusEventsAllowed = false;\n break;\n }\n }\n }\n\n focus() {\n if (!this.#lastActiveElement) {\n return;\n }\n const [lastEditor, lastActiveElement] = this.#lastActiveElement;\n this.#lastActiveElement = null;\n lastActiveElement.addEventListener(\n \"focusin\",\n () => {\n lastEditor._focusEventsAllowed = true;\n },\n { once: true }\n );\n lastActiveElement.focus();\n }\n\n #addKeyboardManager() {\n // The keyboard events are caught at the container level in order to be able\n // to execute some callbacks even if the current page doesn't have focus.\n window.addEventListener(\"keydown\", this.#boundKeydown);\n }\n\n #removeKeyboardManager() {\n window.removeEventListener(\"keydown\", this.#boundKeydown);\n }\n\n #addCopyPasteListeners() {\n document.addEventListener(\"copy\", this.#boundCopy);\n document.addEventListener(\"cut\", this.#boundCut);\n document.addEventListener(\"paste\", this.#boundPaste);\n }\n\n #removeCopyPasteListeners() {\n document.removeEventListener(\"copy\", this.#boundCopy);\n document.removeEventListener(\"cut\", this.#boundCut);\n document.removeEventListener(\"paste\", this.#boundPaste);\n }\n\n addEditListeners() {\n this.#addKeyboardManager();\n this.#addCopyPasteListeners();\n }\n\n removeEditListeners() {\n this.#removeKeyboardManager();\n this.#removeCopyPasteListeners();\n }\n\n /**\n * Copy callback.\n * @param {ClipboardEvent} event\n */\n copy(event) {\n event.preventDefault();\n\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [];\n for (const editor of this.#selectedEditors) {\n const serialized = editor.serialize(/* isForCopying = */ true);\n if (serialized) {\n editors.push(serialized);\n }\n }\n if (editors.length === 0) {\n return;\n }\n\n event.clipboardData.setData(\"application/pdfjs\", JSON.stringify(editors));\n }\n\n /**\n * Cut callback.\n * @param {ClipboardEvent} event\n */\n cut(event) {\n this.copy(event);\n this.delete();\n }\n\n /**\n * Paste callback.\n * @param {ClipboardEvent} event\n */\n paste(event) {\n event.preventDefault();\n const { clipboardData } = event;\n for (const item of clipboardData.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n return;\n }\n }\n }\n\n let data = clipboardData.getData(\"application/pdfjs\");\n if (!data) {\n return;\n }\n\n try {\n data = JSON.parse(data);\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n return;\n }\n\n if (!Array.isArray(data)) {\n return;\n }\n\n this.unselectAll();\n const layer = this.currentLayer;\n\n try {\n const newEditors = [];\n for (const editor of data) {\n const deserializedEditor = layer.deserialize(editor);\n if (!deserializedEditor) {\n return;\n }\n newEditors.push(deserializedEditor);\n }\n\n const cmd = () => {\n for (const editor of newEditors) {\n this.#addEditorToLayer(editor);\n }\n this.#selectEditors(newEditors);\n };\n const undo = () => {\n for (const editor of newEditors) {\n editor.remove();\n }\n };\n this.addCommands({ cmd, undo, mustExec: true });\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n }\n }\n\n /**\n * Keydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (!this.isEditorHandlingKeyboard) {\n AnnotationEditorUIManager._keyboardManager.exec(this, event);\n }\n }\n\n /**\n * Execute an action for a given name.\n * For example, the user can click on the \"Undo\" entry in the context menu\n * and it'll trigger the undo action.\n * @param {Object} details\n */\n onEditingAction(details) {\n if ([\"undo\", \"redo\", \"delete\", \"selectAll\"].includes(details.name)) {\n this[details.name]();\n }\n }\n\n /**\n * Update the different possible states of this manager, e.g. is there\n * something to undo, redo, ...\n * @param {Object} details\n */\n #dispatchUpdateStates(details) {\n const hasChanged = Object.entries(details).some(\n ([key, value]) => this.#previousStates[key] !== value\n );\n\n if (hasChanged) {\n this._eventBus.dispatch(\"annotationeditorstateschanged\", {\n source: this,\n details: Object.assign(this.#previousStates, details),\n });\n }\n }\n\n #dispatchUpdateUI(details) {\n this._eventBus.dispatch(\"annotationeditorparamschanged\", {\n source: this,\n details,\n });\n }\n\n /**\n * Set the editing state.\n * It can be useful to temporarily disable it when the user is editing a\n * FreeText annotation.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n if (isEditing) {\n this.#addFocusManager();\n this.#addKeyboardManager();\n this.#addCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: this.#mode !== AnnotationEditorType.NONE,\n isEmpty: this.#isEmpty(),\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n hasSelectedEditor: false,\n });\n } else {\n this.#removeFocusManager();\n this.#removeKeyboardManager();\n this.#removeCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: false,\n });\n this.disableUserSelect(false);\n }\n }\n\n registerEditorTypes(types) {\n if (this.#editorTypes) {\n return;\n }\n this.#editorTypes = types;\n for (const editorType of this.#editorTypes) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n }\n\n /**\n * Get an id.\n * @returns {string}\n */\n getId() {\n return this.#idManager.getId();\n }\n\n get currentLayer() {\n return this.#allLayers.get(this.#currentPageIndex);\n }\n\n getLayer(pageIndex) {\n return this.#allLayers.get(pageIndex);\n }\n\n get currentPageIndex() {\n return this.#currentPageIndex;\n }\n\n /**\n * Add a new layer for a page which will contains the editors.\n * @param {AnnotationEditorLayer} layer\n */\n addLayer(layer) {\n this.#allLayers.set(layer.pageIndex, layer);\n if (this.#isEnabled) {\n layer.enable();\n } else {\n layer.disable();\n }\n }\n\n /**\n * Remove a layer.\n * @param {AnnotationEditorLayer} layer\n */\n removeLayer(layer) {\n this.#allLayers.delete(layer.pageIndex);\n }\n\n /**\n * Change the editor mode (None, FreeText, Ink, ...)\n * @param {number} mode\n * @param {string|null} editId\n * @param {boolean} [isFromKeyboard] - true if the mode change is due to a\n * keyboard action.\n */\n updateMode(mode, editId = null, isFromKeyboard = false) {\n if (this.#mode === mode) {\n return;\n }\n this.#mode = mode;\n if (mode === AnnotationEditorType.NONE) {\n this.setEditingState(false);\n this.#disableAll();\n return;\n }\n this.setEditingState(true);\n this.#enableAll();\n this.unselectAll();\n for (const layer of this.#allLayers.values()) {\n layer.updateMode(mode);\n }\n if (!editId && isFromKeyboard) {\n this.addNewEditorFromKeyboard();\n return;\n }\n\n if (!editId) {\n return;\n }\n for (const editor of this.#allEditors.values()) {\n if (editor.annotationElementId === editId) {\n this.setSelected(editor);\n editor.enterInEditMode();\n break;\n }\n }\n }\n\n addNewEditorFromKeyboard() {\n this.currentLayer.addNewEditor();\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {number} mode\n * @returns {undefined}\n */\n updateToolbar(mode) {\n if (mode === this.#mode) {\n return;\n }\n this._eventBus.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode,\n });\n }\n\n /**\n * Update a parameter in the current editor or globally.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {\n if (!this.#editorTypes) {\n return;\n }\n if (type === AnnotationEditorParamsType.CREATE) {\n this.currentLayer.addNewEditor();\n return;\n }\n\n for (const editor of this.#selectedEditors) {\n editor.updateParams(type, value);\n }\n\n for (const editorType of this.#editorTypes) {\n editorType.updateDefaultParams(type, value);\n }\n }\n\n enableWaiting(mustWait = false) {\n if (this.#isWaiting === mustWait) {\n return;\n }\n this.#isWaiting = mustWait;\n for (const layer of this.#allLayers.values()) {\n if (mustWait) {\n layer.disableClick();\n } else {\n layer.enableClick();\n }\n layer.div.classList.toggle(\"waiting\", mustWait);\n }\n }\n\n /**\n * Enable all the layers.\n */\n #enableAll() {\n if (!this.#isEnabled) {\n this.#isEnabled = true;\n for (const layer of this.#allLayers.values()) {\n layer.enable();\n }\n }\n }\n\n /**\n * Disable all the layers.\n */\n #disableAll() {\n this.unselectAll();\n if (this.#isEnabled) {\n this.#isEnabled = false;\n for (const layer of this.#allLayers.values()) {\n layer.disable();\n }\n }\n }\n\n /**\n * Get all the editors belonging to a given page.\n * @param {number} pageIndex\n * @returns {Array<AnnotationEditor>}\n */\n getEditors(pageIndex) {\n const editors = [];\n for (const editor of this.#allEditors.values()) {\n if (editor.pageIndex === pageIndex) {\n editors.push(editor);\n }\n }\n return editors;\n }\n\n /**\n * Get an editor with the given id.\n * @param {string} id\n * @returns {AnnotationEditor}\n */\n getEditor(id) {\n return this.#allEditors.get(id);\n }\n\n /**\n * Add a new editor.\n * @param {AnnotationEditor} editor\n */\n addEditor(editor) {\n this.#allEditors.set(editor.id, editor);\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n removeEditor(editor) {\n if (editor.div.contains(document.activeElement)) {\n if (this.#focusMainContainerTimeoutId) {\n clearTimeout(this.#focusMainContainerTimeoutId);\n }\n this.#focusMainContainerTimeoutId = setTimeout(() => {\n // When the div is removed from DOM the focus can move on the\n // document.body, so we need to move it back to the main container.\n this.focusMainContainer();\n this.#focusMainContainerTimeoutId = null;\n }, 0);\n }\n this.#allEditors.delete(editor.id);\n this.unselect(editor);\n if (\n !editor.annotationElementId ||\n !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)\n ) {\n this.#annotationStorage?.remove(editor.id);\n }\n }\n\n /**\n * The annotation element with the given id has been deleted.\n * @param {AnnotationEditor} editor\n */\n addDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.add(editor.annotationElementId);\n editor.deleted = true;\n }\n\n /**\n * Check if the annotation element with the given id has been deleted.\n * @param {string} annotationElementId\n * @returns {boolean}\n */\n isDeletedAnnotationElement(annotationElementId) {\n return this.#deletedAnnotationsElementIds.has(annotationElementId);\n }\n\n /**\n * The annotation element with the given id have been restored.\n * @param {AnnotationEditor} editor\n */\n removeDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.delete(editor.annotationElementId);\n editor.deleted = false;\n }\n\n /**\n * Add an editor to the layer it belongs to or add it to the global map.\n * @param {AnnotationEditor} editor\n */\n #addEditorToLayer(editor) {\n const layer = this.#allLayers.get(editor.pageIndex);\n if (layer) {\n layer.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n }\n }\n\n /**\n * Set the given editor as the active one.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n if (this.#activeEditor === editor) {\n return;\n }\n\n this.#activeEditor = editor;\n if (editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n if (this.#selectedEditors.has(editor)) {\n this.#selectedEditors.delete(editor);\n editor.unselect();\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n return;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n for (const ed of this.#selectedEditors) {\n if (ed !== editor) {\n ed.unselect();\n }\n }\n this.#selectedEditors.clear();\n\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Check if the editor is selected.\n * @param {AnnotationEditor} editor\n */\n isSelected(editor) {\n return this.#selectedEditors.has(editor);\n }\n\n get firstSelectedEditor() {\n return this.#selectedEditors.values().next().value;\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n editor.unselect();\n this.#selectedEditors.delete(editor);\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n }\n\n get hasSelection() {\n return this.#selectedEditors.size !== 0;\n }\n\n get isEnterHandled() {\n return (\n this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.isEnterHandled\n );\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n this.#commandManager.undo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: true,\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Redo the last undoed command.\n */\n redo() {\n this.#commandManager.redo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Add a command to execute (cmd) and another one to undo it.\n * @param {Object} params\n */\n addCommands(params) {\n this.#commandManager.add(params);\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: false,\n isEmpty: this.#isEmpty(),\n });\n }\n\n #isEmpty() {\n if (this.#allEditors.size === 0) {\n return true;\n }\n\n if (this.#allEditors.size === 1) {\n for (const editor of this.#allEditors.values()) {\n return editor.isEmpty();\n }\n }\n\n return false;\n }\n\n /**\n * Delete the current editor or all.\n */\n delete() {\n this.commitOrRemove();\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [...this.#selectedEditors];\n const cmd = () => {\n for (const editor of editors) {\n editor.remove();\n }\n };\n const undo = () => {\n for (const editor of editors) {\n this.#addEditorToLayer(editor);\n }\n };\n\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n commitOrRemove() {\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n }\n\n hasSomethingToControl() {\n return this.#activeEditor || this.hasSelection;\n }\n\n /**\n * Select the editors.\n * @param {Array<AnnotationEditor>} editors\n */\n #selectEditors(editors) {\n this.#selectedEditors.clear();\n for (const editor of editors) {\n if (editor.isEmpty()) {\n continue;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n }\n this.#dispatchUpdateStates({ hasSelectedEditor: true });\n }\n\n /**\n * Select all the editors.\n */\n selectAll() {\n for (const editor of this.#selectedEditors) {\n editor.commit();\n }\n this.#selectEditors(this.#allEditors.values());\n }\n\n /**\n * Unselect all the selected editors.\n */\n unselectAll() {\n if (this.#activeEditor) {\n // An editor is being edited so just commit it.\n this.#activeEditor.commitOrRemove();\n return;\n }\n\n if (!this.hasSelection) {\n return;\n }\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n this.#dispatchUpdateStates({\n hasSelectedEditor: false,\n });\n }\n\n translateSelectedEditors(x, y, noCommit = false) {\n if (!noCommit) {\n this.commitOrRemove();\n }\n if (!this.hasSelection) {\n return;\n }\n\n this.#translation[0] += x;\n this.#translation[1] += y;\n const [totalX, totalY] = this.#translation;\n const editors = [...this.#selectedEditors];\n\n // We don't want to have an undo/redo for each translation so we wait a bit\n // before adding the command to the command manager.\n const TIME_TO_WAIT = 1000;\n\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n }\n\n this.#translationTimeoutId = setTimeout(() => {\n this.#translationTimeoutId = null;\n this.#translation[0] = this.#translation[1] = 0;\n\n this.addCommands({\n cmd: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(totalX, totalY);\n }\n }\n },\n undo: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(-totalX, -totalY);\n }\n }\n },\n mustExec: false,\n });\n }, TIME_TO_WAIT);\n\n for (const editor of editors) {\n editor.translateInPage(x, y);\n }\n }\n\n /**\n * Set up the drag session for moving the selected editors.\n */\n setUpDragSession() {\n // Note: don't use any references to the editor's parent which can be null\n // if the editor belongs to a destroyed page.\n if (!this.hasSelection) {\n return;\n }\n // Avoid to have spurious text selection in the text layer when dragging.\n this.disableUserSelect(true);\n this.#draggingEditors = new Map();\n for (const editor of this.#selectedEditors) {\n this.#draggingEditors.set(editor, {\n savedX: editor.x,\n savedY: editor.y,\n savedPageIndex: editor.pageIndex,\n newX: 0,\n newY: 0,\n newPageIndex: -1,\n });\n }\n }\n\n /**\n * Ends the drag session.\n * @returns {boolean} true if at least one editor has been moved.\n */\n endDragSession() {\n if (!this.#draggingEditors) {\n return false;\n }\n this.disableUserSelect(false);\n const map = this.#draggingEditors;\n this.#draggingEditors = null;\n let mustBeAddedInUndoStack = false;\n\n for (const [{ x, y, pageIndex }, value] of map) {\n value.newX = x;\n value.newY = y;\n value.newPageIndex = pageIndex;\n mustBeAddedInUndoStack ||=\n x !== value.savedX ||\n y !== value.savedY ||\n pageIndex !== value.savedPageIndex;\n }\n\n if (!mustBeAddedInUndoStack) {\n return false;\n }\n\n const move = (editor, x, y, pageIndex) => {\n if (this.#allEditors.has(editor.id)) {\n // The editor can be undone/redone on a page which is not visible (and\n // which potentially has no annotation editor layer), hence we need to\n // use the pageIndex instead of the parent.\n const parent = this.#allLayers.get(pageIndex);\n if (parent) {\n editor._setParentAndPosition(parent, x, y);\n } else {\n editor.pageIndex = pageIndex;\n editor.x = x;\n editor.y = y;\n }\n }\n };\n\n this.addCommands({\n cmd: () => {\n for (const [editor, { newX, newY, newPageIndex }] of map) {\n move(editor, newX, newY, newPageIndex);\n }\n },\n undo: () => {\n for (const [editor, { savedX, savedY, savedPageIndex }] of map) {\n move(editor, savedX, savedY, savedPageIndex);\n }\n },\n mustExec: true,\n });\n\n return true;\n }\n\n /**\n * Drag the set of selected editors.\n * @param {number} tx\n * @param {number} ty\n */\n dragSelectedEditors(tx, ty) {\n if (!this.#draggingEditors) {\n return;\n }\n for (const editor of this.#draggingEditors.keys()) {\n editor.drag(tx, ty);\n }\n }\n\n /**\n * Rebuild the editor (usually on undo/redo actions) on a potentially\n * non-rendered page.\n * @param {AnnotationEditor} editor\n */\n rebuild(editor) {\n if (editor.parent === null) {\n const parent = this.getLayer(editor.pageIndex);\n if (parent) {\n parent.changeParent(editor);\n parent.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n editor.rebuild();\n }\n } else {\n editor.parent.addOrRebuild(editor);\n }\n }\n\n get isEditorHandlingKeyboard() {\n return (\n this.getActive()?.shouldGetKeyboardEvents() ||\n (this.#selectedEditors.size === 1 &&\n this.firstSelectedEditor.shouldGetKeyboardEvents())\n );\n }\n\n /**\n * Is the current editor the one passed as argument?\n * @param {AnnotationEditor} editor\n * @returns\n */\n isActive(editor) {\n return this.#activeEditor === editor;\n }\n\n /**\n * Get the current active editor.\n * @returns {AnnotationEditor|null}\n */\n getActive() {\n return this.#activeEditor;\n }\n\n /**\n * Get the current editor mode.\n * @returns {number}\n */\n getMode() {\n return this.#mode;\n }\n\n get imageManager() {\n return shadow(this, \"imageManager\", new ImageManager());\n }\n}\n\nexport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n CommandManager,\n KeyboardManager,\n opacityToHex,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AbortException,\n assert,\n PromiseCapability,\n warn,\n} from \"../shared/util.js\";\nimport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n validateResponseStatus,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./fetch_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nfunction createFetchOptions(headers, withCredentials, abortController) {\n return {\n method: \"GET\",\n headers,\n signal: abortController.signal,\n mode: \"cors\",\n credentials: withCredentials ? \"include\" : \"same-origin\",\n redirect: \"follow\",\n };\n}\n\nfunction createHeaders(httpHeaders) {\n const headers = new Headers();\n for (const property in httpHeaders) {\n const value = httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n headers.append(property, value);\n }\n return headers;\n}\n\nfunction getArrayBuffer(val) {\n if (val instanceof Uint8Array) {\n return val.buffer;\n }\n if (val instanceof ArrayBuffer) {\n return val;\n }\n warn(`getArrayBuffer - unexpected data format: ${val}`);\n return new Uint8Array(val).buffer;\n}\n\n/** @implements {IPDFStream} */\nclass PDFFetchStream {\n constructor(source) {\n this.source = source;\n this.isHttp = /^https?:/i.test(source.url);\n this.httpHeaders = (this.isHttp && source.httpHeaders) || {};\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFFetchStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFFetchStreamReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFFetchStreamRangeReader(this, begin, end);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFFetchStreamReader {\n constructor(stream) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n this._filename = null;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._contentLength = source.length;\n this._headersCapability = new PromiseCapability();\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._abortController = new AbortController();\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n\n this._headers = createHeaders(this._stream.httpHeaders);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(\n this._headers,\n this._withCredentials,\n this._abortController\n )\n )\n .then(response => {\n if (!validateResponseStatus(response.status)) {\n throw createResponseStatusError(response.status, url);\n }\n this._reader = response.body.getReader();\n this._headersCapability.resolve();\n\n const getResponseHeader = name => {\n return response.headers.get(name);\n };\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: this._stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n this._isRangeSupported = allowRangeRequests;\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this.cancel(new AbortException(\"Streaming is disabled.\"));\n }\n })\n .catch(this._headersCapability.reject);\n\n this.onProgress = null;\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._headersCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFFetchStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._readCapability = new PromiseCapability();\n this._isStreamingSupported = !source.disableStream;\n\n this._abortController = new AbortController();\n this._headers = createHeaders(this._stream.httpHeaders);\n this._headers.append(\"Range\", `bytes=${begin}-${end - 1}`);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(\n this._headers,\n this._withCredentials,\n this._abortController\n )\n )\n .then(response => {\n if (!validateResponseStatus(response.status)) {\n throw createResponseStatusError(response.status, url);\n }\n this._readCapability.resolve();\n this._reader = response.body.getReader();\n })\n .catch(this._readCapability.reject);\n\n this.onProgress = null;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({ loaded: this._loaded });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\nexport { PDFFetchStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n bytesToString,\n FeatureTest,\n isNodeJS,\n shadow,\n string32,\n unreachable,\n warn,\n} from \"../shared/util.js\";\n\nclass FontLoader {\n #systemFonts = new Set();\n\n constructor({\n ownerDocument = globalThis.document,\n styleElement = null, // For testing only.\n }) {\n this._document = ownerDocument;\n\n this.nativeFontFaces = new Set();\n this.styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? styleElement\n : null;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n this.loadingRequests = [];\n this.loadTestFontId = 0;\n }\n }\n\n addNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.add(nativeFontFace);\n this._document.fonts.add(nativeFontFace);\n }\n\n removeNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.delete(nativeFontFace);\n this._document.fonts.delete(nativeFontFace);\n }\n\n insertRule(rule) {\n if (!this.styleElement) {\n this.styleElement = this._document.createElement(\"style\");\n this._document.documentElement\n .getElementsByTagName(\"head\")[0]\n .append(this.styleElement);\n }\n const styleSheet = this.styleElement.sheet;\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\n }\n\n clear() {\n for (const nativeFontFace of this.nativeFontFaces) {\n this._document.fonts.delete(nativeFontFace);\n }\n this.nativeFontFaces.clear();\n this.#systemFonts.clear();\n\n if (this.styleElement) {\n // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n this.styleElement.remove();\n this.styleElement = null;\n }\n }\n\n async loadSystemFont({ systemFontInfo: info, _inspectFont }) {\n if (!info || this.#systemFonts.has(info.loadedName)) {\n return;\n }\n assert(\n !this.disableFontFace,\n \"loadSystemFont shouldn't be called when `disableFontFace` is set.\"\n );\n\n if (this.isFontLoadingAPISupported) {\n const { loadedName, src, style } = info;\n const fontFace = new FontFace(loadedName, src, style);\n this.addNativeFontFace(fontFace);\n try {\n await fontFace.load();\n this.#systemFonts.add(loadedName);\n _inspectFont?.(info);\n } catch {\n warn(\n `Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`\n );\n\n this.removeNativeFontFace(fontFace);\n }\n return;\n }\n\n unreachable(\n \"Not implemented: loadSystemFont without the Font Loading API.\"\n );\n }\n\n async bind(font) {\n // Add the font to the DOM only once; skip if the font is already loaded.\n if (font.attached || (font.missingFile && !font.systemFontInfo)) {\n return;\n }\n font.attached = true;\n\n if (font.systemFontInfo) {\n await this.loadSystemFont(font);\n return;\n }\n\n if (this.isFontLoadingAPISupported) {\n const nativeFontFace = font.createNativeFontFace();\n if (nativeFontFace) {\n this.addNativeFontFace(nativeFontFace);\n try {\n await nativeFontFace.loaded;\n } catch (ex) {\n warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);\n\n // When font loading failed, fall back to the built-in font renderer.\n font.disableFontFace = true;\n throw ex;\n }\n }\n return; // The font was, asynchronously, loaded.\n }\n\n // !this.isFontLoadingAPISupported\n const rule = font.createFontFaceRule();\n if (rule) {\n this.insertRule(rule);\n\n if (this.isSyncFontLoadingSupported) {\n return; // The font was, synchronously, loaded.\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: async font loading\");\n }\n await new Promise(resolve => {\n const request = this._queueLoadingCallback(resolve);\n this._prepareFontLoadEvent(font, request);\n });\n // The font was, asynchronously, loaded.\n }\n }\n\n get isFontLoadingAPISupported() {\n const hasFonts = !!this._document?.fonts;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n return shadow(\n this,\n \"isFontLoadingAPISupported\",\n hasFonts && !this.styleElement\n );\n }\n return shadow(this, \"isFontLoadingAPISupported\", hasFonts);\n }\n\n get isSyncFontLoadingSupported() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return shadow(this, \"isSyncFontLoadingSupported\", true);\n }\n\n let supported = false;\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) {\n if (isNodeJS) {\n // Node.js - we can pretend that sync font loading is supported.\n supported = true;\n } else if (\n typeof navigator !== \"undefined\" &&\n typeof navigator?.userAgent === \"string\" &&\n // User agent string sniffing is bad, but there is no reliable way to\n // tell if the font is fully loaded and ready to be used with canvas.\n /Mozilla\\/5.0.*?rv:\\d+.*? Gecko/.test(navigator.userAgent)\n ) {\n // Firefox, from version 14, supports synchronous font loading.\n supported = true;\n }\n }\n return shadow(this, \"isSyncFontLoadingSupported\", supported);\n }\n\n _queueLoadingCallback(callback) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _queueLoadingCallback\");\n }\n\n function completeRequest() {\n assert(!request.done, \"completeRequest() cannot be called twice.\");\n request.done = true;\n\n // Sending all completed requests in order of how they were queued.\n while (loadingRequests.length > 0 && loadingRequests[0].done) {\n const otherRequest = loadingRequests.shift();\n setTimeout(otherRequest.callback, 0);\n }\n }\n\n const { loadingRequests } = this;\n const request = {\n done: false,\n complete: completeRequest,\n callback,\n };\n loadingRequests.push(request);\n return request;\n }\n\n get _loadTestFont() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _loadTestFont\");\n }\n\n // This is a CFF font with 1 glyph for '.' that fills its entire width\n // and height.\n const testFont = atob(\n \"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" +\n \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" +\n \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" +\n \"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1\" +\n \"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD\" +\n \"6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM\" +\n \"AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D\" +\n \"IP84AFoDIQAAAAAAAQAAAAAAAAAAACAA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AAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\n );\n return shadow(this, \"_loadTestFont\", testFont);\n }\n\n _prepareFontLoadEvent(font, request) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _prepareFontLoadEvent\");\n }\n\n /** Hack begin */\n // There's currently no event when a font has finished downloading so the\n // following code is a dirty hack to 'guess' when a font is ready.\n // It's assumed fonts are loaded in order, so add a known test font after\n // the desired fonts and then test for the loading of that test font.\n\n function int32(data, offset) {\n return (\n (data.charCodeAt(offset) << 24) |\n (data.charCodeAt(offset + 1) << 16) |\n (data.charCodeAt(offset + 2) << 8) |\n (data.charCodeAt(offset + 3) & 0xff)\n );\n }\n function spliceString(s, offset, remove, insert) {\n const chunk1 = s.substring(0, offset);\n const chunk2 = s.substring(offset + remove);\n return chunk1 + insert + chunk2;\n }\n let i, ii;\n\n // The temporary canvas is used to determine if fonts are loaded.\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext(\"2d\");\n\n let called = 0;\n function isFontReady(name, callback) {\n // With setTimeout clamping this gives the font ~100ms to load.\n if (++called > 30) {\n warn(\"Load test font never loaded.\");\n callback();\n return;\n }\n ctx.font = \"30px \" + name;\n ctx.fillText(\".\", 0, 20);\n const imageData = ctx.getImageData(0, 0, 1, 1);\n if (imageData.data[3] > 0) {\n callback();\n return;\n }\n setTimeout(isFontReady.bind(null, name, callback));\n }\n\n const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`;\n // Chromium seems to cache fonts based on a hash of the actual font data,\n // so the font must be modified for each load test else it will appear to\n // be loaded already.\n // TODO: This could maybe be made faster by avoiding the btoa of the full\n // font by splitting it in chunks before hand and padding the font id.\n let data = this._loadTestFont;\n const COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum)\n data = spliceString(\n data,\n COMMENT_OFFSET,\n loadTestFontId.length,\n loadTestFontId\n );\n // CFF checksum is important for IE, adjusting it\n const CFF_CHECKSUM_OFFSET = 16;\n const XXXX_VALUE = 0x58585858; // the \"comment\" filled with 'X'\n let checksum = int32(data, CFF_CHECKSUM_OFFSET);\n for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0;\n }\n if (i < loadTestFontId.length) {\n // align to 4 bytes boundary\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i)) | 0;\n }\n data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum));\n\n const url = `url(data:font/opentype;base64,${btoa(data)});`;\n const rule = `@font-face {font-family:\"${loadTestFontId}\";src:${url}}`;\n this.insertRule(rule);\n\n const div = this._document.createElement(\"div\");\n div.style.visibility = \"hidden\";\n div.style.width = div.style.height = \"10px\";\n div.style.position = \"absolute\";\n div.style.top = div.style.left = \"0px\";\n\n for (const name of [font.loadedName, loadTestFontId]) {\n const span = this._document.createElement(\"span\");\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.append(span);\n }\n this._document.body.append(div);\n\n isFontReady(loadTestFontId, () => {\n div.remove();\n request.complete();\n });\n /** Hack end */\n }\n}\n\nclass FontFaceObject {\n constructor(\n translatedData,\n {\n isEvalSupported = true,\n disableFontFace = false,\n ignoreErrors = false,\n inspectFont = null,\n }\n ) {\n this.compiledGlyphs = Object.create(null);\n // importing translated data\n for (const i in translatedData) {\n this[i] = translatedData[i];\n }\n this.isEvalSupported = isEvalSupported !== false;\n this.disableFontFace = disableFontFace === true;\n this.ignoreErrors = ignoreErrors === true;\n this._inspectFont = inspectFont;\n }\n\n createNativeFontFace() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n let nativeFontFace;\n if (!this.cssFontInfo) {\n nativeFontFace = new FontFace(this.loadedName, this.data, {});\n } else {\n const css = {\n weight: this.cssFontInfo.fontWeight,\n };\n if (this.cssFontInfo.italicAngle) {\n css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;\n }\n nativeFontFace = new FontFace(\n this.cssFontInfo.fontFamily,\n this.data,\n css\n );\n }\n\n this._inspectFont?.(this);\n return nativeFontFace;\n }\n\n createFontFaceRule() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n const data = bytesToString(this.data);\n // Add the @font-face rule to the document.\n const url = `url(data:${this.mimetype};base64,${btoa(data)});`;\n let rule;\n if (!this.cssFontInfo) {\n rule = `@font-face {font-family:\"${this.loadedName}\";src:${url}}`;\n } else {\n let css = `font-weight: ${this.cssFontInfo.fontWeight};`;\n if (this.cssFontInfo.italicAngle) {\n css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`;\n }\n rule = `@font-face {font-family:\"${this.cssFontInfo.fontFamily}\";${css}src:${url}}`;\n }\n\n this._inspectFont?.(this, url);\n return rule;\n }\n\n getPathGenerator(objs, character) {\n if (this.compiledGlyphs[character] !== undefined) {\n return this.compiledGlyphs[character];\n }\n\n let cmds;\n try {\n cmds = objs.get(this.loadedName + \"_path_\" + character);\n } catch (ex) {\n if (!this.ignoreErrors) {\n throw ex;\n }\n warn(`getPathGenerator - ignoring character: \"${ex}\".`);\n\n return (this.compiledGlyphs[character] = function (c, size) {\n // No-op function, to allow rendering to continue.\n });\n }\n\n // If we can, compile cmds into JS for MAXIMUM SPEED...\n if (this.isEvalSupported && FeatureTest.isEvalSupported) {\n const jsBuf = [];\n for (const current of cmds) {\n const args = current.args !== undefined ? current.args.join(\",\") : \"\";\n jsBuf.push(\"c.\", current.cmd, \"(\", args, \");\\n\");\n }\n // eslint-disable-next-line no-new-func\n return (this.compiledGlyphs[character] = new Function(\n \"c\",\n \"size\",\n jsBuf.join(\"\")\n ));\n }\n // ... but fall back on using Function.prototype.apply() if we're\n // blocked from using eval() for whatever reason (like CSP policies).\n return (this.compiledGlyphs[character] = function (c, size) {\n for (const current of cmds) {\n if (current.cmd === \"scale\") {\n current.args = [size, -size];\n }\n // eslint-disable-next-line prefer-spread\n c[current.cmd].apply(c, current.args);\n }\n });\n }\n}\n\nexport { FontFaceObject, FontLoader };\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 { objectFromMap } from \"../shared/util.js\";\n\nclass Metadata {\n #metadataMap;\n\n #data;\n\n constructor({ parsedData, rawData }) {\n this.#metadataMap = parsedData;\n this.#data = rawData;\n }\n\n getRaw() {\n return this.#data;\n }\n\n get(name) {\n return this.#metadataMap.get(name) ?? null;\n }\n\n getAll() {\n return objectFromMap(this.#metadataMap);\n }\n\n has(name) {\n return this.#metadataMap.has(name);\n }\n}\n\nexport { Metadata };\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 { assert, PromiseCapability, stringToBytes } from \"../shared/util.js\";\nimport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./network.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst OK_RESPONSE = 200;\nconst PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(xhr) {\n const data = xhr.response;\n if (typeof data !== \"string\") {\n return data;\n }\n return stringToBytes(data).buffer;\n}\n\nclass NetworkManager {\n constructor(url, args = {}) {\n this.url = url;\n this.isHttp = /^https?:/i.test(url);\n this.httpHeaders = (this.isHttp && args.httpHeaders) || Object.create(null);\n this.withCredentials = args.withCredentials || false;\n\n this.currXhrId = 0;\n this.pendingRequests = Object.create(null);\n }\n\n requestRange(begin, end, listeners) {\n const args = {\n begin,\n end,\n };\n for (const prop in listeners) {\n args[prop] = listeners[prop];\n }\n return this.request(args);\n }\n\n requestFull(listeners) {\n return this.request(listeners);\n }\n\n request(args) {\n const xhr = new XMLHttpRequest();\n const xhrId = this.currXhrId++;\n const pendingRequest = (this.pendingRequests[xhrId] = { xhr });\n\n xhr.open(\"GET\", this.url);\n xhr.withCredentials = this.withCredentials;\n for (const property in this.httpHeaders) {\n const value = this.httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n xhr.setRequestHeader(property, value);\n }\n if (this.isHttp && \"begin\" in args && \"end\" in args) {\n xhr.setRequestHeader(\"Range\", `bytes=${args.begin}-${args.end - 1}`);\n pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;\n } else {\n pendingRequest.expectedStatus = OK_RESPONSE;\n }\n xhr.responseType = \"arraybuffer\";\n\n if (args.onError) {\n xhr.onerror = function (evt) {\n args.onError(xhr.status);\n };\n }\n xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);\n xhr.onprogress = this.onProgress.bind(this, xhrId);\n\n pendingRequest.onHeadersReceived = args.onHeadersReceived;\n pendingRequest.onDone = args.onDone;\n pendingRequest.onError = args.onError;\n pendingRequest.onProgress = args.onProgress;\n\n xhr.send(null);\n\n return xhrId;\n }\n\n onProgress(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n pendingRequest.onProgress?.(evt);\n }\n\n onStateChange(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n\n const xhr = pendingRequest.xhr;\n if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {\n pendingRequest.onHeadersReceived();\n delete pendingRequest.onHeadersReceived;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (!(xhrId in this.pendingRequests)) {\n // The XHR request might have been aborted in onHeadersReceived()\n // callback, in which case we should abort request.\n return;\n }\n\n delete this.pendingRequests[xhrId];\n\n // Success status == 0 can be on ftp, file and other protocols.\n if (xhr.status === 0 && this.isHttp) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n const xhrStatus = xhr.status || OK_RESPONSE;\n\n // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2:\n // \"A server MAY ignore the Range header\". This means it's possible to\n // get a 200 rather than a 206 response from a range request.\n const ok_response_on_range_request =\n xhrStatus === OK_RESPONSE &&\n pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;\n\n if (\n !ok_response_on_range_request &&\n xhrStatus !== pendingRequest.expectedStatus\n ) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n\n const chunk = getArrayBuffer(xhr);\n if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {\n const rangeHeader = xhr.getResponseHeader(\"Content-Range\");\n const matches = /bytes (\\d+)-(\\d+)\\/(\\d+)/.exec(rangeHeader);\n pendingRequest.onDone({\n begin: parseInt(matches[1], 10),\n chunk,\n });\n } else if (chunk) {\n pendingRequest.onDone({\n begin: 0,\n chunk,\n });\n } else {\n pendingRequest.onError?.(xhr.status);\n }\n }\n\n getRequestXhr(xhrId) {\n return this.pendingRequests[xhrId].xhr;\n }\n\n isPendingRequest(xhrId) {\n return xhrId in this.pendingRequests;\n }\n\n abortRequest(xhrId) {\n const xhr = this.pendingRequests[xhrId].xhr;\n delete this.pendingRequests[xhrId];\n xhr.abort();\n }\n}\n\n/** @implements {IPDFStream} */\nclass PDFNetworkStream {\n constructor(source) {\n this._source = source;\n this._manager = new NetworkManager(source.url, {\n httpHeaders: source.httpHeaders,\n withCredentials: source.withCredentials,\n });\n this._rangeChunkSize = source.rangeChunkSize;\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n _onRangeRequestReaderClosed(reader) {\n const i = this._rangeRequestReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeRequestReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFNetworkStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFNetworkStreamFullRequestReader(\n this._manager,\n this._source\n );\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n const reader = new PDFNetworkStreamRangeRequestReader(\n this._manager,\n begin,\n end\n );\n reader.onClosed = this._onRangeRequestReaderClosed.bind(this);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFNetworkStreamFullRequestReader {\n constructor(manager, source) {\n this._manager = manager;\n\n const args = {\n onHeadersReceived: this._onHeadersReceived.bind(this),\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this),\n };\n this._url = source.url;\n this._fullRequestId = manager.requestFull(args);\n this._headersReceivedCapability = new PromiseCapability();\n this._disableRange = source.disableRange || false;\n this._contentLength = source.length; // Optional\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = false;\n this._isRangeSupported = false;\n\n this._cachedChunks = [];\n this._requests = [];\n this._done = false;\n this._storedError = undefined;\n this._filename = null;\n\n this.onProgress = null;\n }\n\n _onHeadersReceived() {\n const fullRequestXhrId = this._fullRequestId;\n const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);\n\n const getResponseHeader = name => {\n return fullRequestXhr.getResponseHeader(name);\n };\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: this._manager.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n if (allowRangeRequests) {\n this._isRangeSupported = true;\n }\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n\n if (this._isRangeSupported) {\n // NOTE: by cancelling the full request, and then issuing range\n // requests, there will be an issue for sites where you can only\n // request the pdf once. However, if this is the case, then the\n // server should not be returning that it can support range requests.\n this._manager.abortRequest(fullRequestXhrId);\n }\n\n this._headersReceivedCapability.resolve();\n }\n\n _onDone(data) {\n if (data) {\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: data.chunk, done: false });\n } else {\n this._cachedChunks.push(data.chunk);\n }\n }\n this._done = true;\n if (this._cachedChunks.length > 0) {\n return;\n }\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n _onError(status) {\n this._storedError = createResponseStatusError(status, this._url);\n this._headersReceivedCapability.reject(this._storedError);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._cachedChunks.length = 0;\n }\n\n _onProgress(evt) {\n this.onProgress?.({\n loaded: evt.loaded,\n total: evt.lengthComputable ? evt.total : this._contentLength,\n });\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get headersReady() {\n return this._headersReceivedCapability.promise;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._cachedChunks.length > 0) {\n const chunk = this._cachedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = new PromiseCapability();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this._headersReceivedCapability.reject(reason);\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._fullRequestId)) {\n this._manager.abortRequest(this._fullRequestId);\n }\n this._fullRequestReader = null;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFNetworkStreamRangeRequestReader {\n constructor(manager, begin, end) {\n this._manager = manager;\n\n const args = {\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this),\n };\n this._url = manager.url;\n this._requestId = manager.requestRange(begin, end, args);\n this._requests = [];\n this._queuedChunk = null;\n this._done = false;\n this._storedError = undefined;\n\n this.onProgress = null;\n this.onClosed = null;\n }\n\n _close() {\n this.onClosed?.(this);\n }\n\n _onDone(data) {\n const chunk = data.chunk;\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunk = chunk;\n }\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._close();\n }\n\n _onError(status) {\n this._storedError = createResponseStatusError(status, this._url);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._queuedChunk = null;\n }\n\n _onProgress(evt) {\n if (!this.isStreamingSupported) {\n this.onProgress?.({ loaded: evt.loaded });\n }\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._queuedChunk !== null) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = new PromiseCapability();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._requestId)) {\n this._manager.abortRequest(this._requestId);\n }\n this._close();\n }\n}\n\nexport { PDFNetworkStream };\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 { stringToBytes } from \"../shared/util.js\";\n\n// This getFilenameFromContentDispositionHeader function is adapted from\n// https://github.com/Rob--W/open-in-browser/blob/7e2e35a38b8b4e981b11da7b2f01df0149049e92/extension/content-disposition.js\n// with the following changes:\n// - Modified to conform to PDF.js's coding style.\n// - Move return to the end of the function to prevent Babel from dropping the\n// function declarations.\n\n/**\n * Extract file name from the Content-Disposition HTTP response header.\n *\n * @param {string} contentDisposition\n * @returns {string} Filename, if found in the Content-Disposition header.\n */\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n let needsEncodingFixup = true;\n\n // filename*=ext-value (\"ext-value\" from RFC 5987, referenced by RFC 6266).\n let tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = unescape(filename);\n filename = rfc5987decode(filename);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // Continuations (RFC 2231 section 3, referenced by RFC 5987 section 3.1).\n // filename*n*=part\n // filename*n=part\n tmp = rfc2231getparam(contentDisposition);\n if (tmp) {\n // RFC 2047, section\n const filename = rfc2047decode(tmp);\n return fixupEncoding(filename);\n }\n\n // filename=value (RFC 5987, section 4.1).\n tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // After this line there are only function declarations. We cannot put\n // \"return\" here for readability because babel would then drop the function\n // declarations...\n function toParamRegExp(attributePattern, flags) {\n return new RegExp(\n \"(?:^|;)\\\\s*\" +\n attributePattern +\n \"\\\\s*=\\\\s*\" +\n // Captures: value = token | quoted-string\n // (RFC 2616, section 3.6 and referenced by RFC 6266 4.1)\n \"(\" +\n '[^\";\\\\s][^;\\\\s]*' +\n \"|\" +\n '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' +\n \")\",\n flags\n );\n }\n function textdecode(encoding, value) {\n if (encoding) {\n if (!/^[\\x00-\\xFF]+$/.test(value)) {\n return value;\n }\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(value);\n value = decoder.decode(buffer);\n needsEncodingFixup = false;\n } catch {\n // TextDecoder constructor threw - unrecognized encoding.\n }\n }\n return value;\n }\n function fixupEncoding(value) {\n if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n // Maybe multi-byte UTF-8.\n value = textdecode(\"utf-8\", value);\n if (needsEncodingFixup) {\n // Try iso-8859-1 encoding.\n value = textdecode(\"iso-8859-1\", value);\n }\n }\n return value;\n }\n function rfc2231getparam(contentDispositionStr) {\n const matches = [];\n let match;\n // Iterate over all filename*n= and filename*n*= with n being an integer\n // of at least zero. Any non-zero number must not start with '0'.\n const iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n while ((match = iter.exec(contentDispositionStr)) !== null) {\n let [, n, quot, part] = match; // eslint-disable-line prefer-const\n n = parseInt(n, 10);\n if (n in matches) {\n // Ignore anything after the invalid second filename*0.\n if (n === 0) {\n break;\n }\n continue;\n }\n matches[n] = [quot, part];\n }\n const parts = [];\n for (let n = 0; n < matches.length; ++n) {\n if (!(n in matches)) {\n // Numbers must be consecutive. Truncate when there is a hole.\n break;\n }\n let [quot, part] = matches[n]; // eslint-disable-line prefer-const\n part = rfc2616unquote(part);\n if (quot) {\n part = unescape(part);\n if (n === 0) {\n part = rfc5987decode(part);\n }\n }\n parts.push(part);\n }\n return parts.join(\"\");\n }\n function rfc2616unquote(value) {\n if (value.startsWith('\"')) {\n const parts = value.slice(1).split('\\\\\"');\n // Find the first unescaped \" and terminate there.\n for (let i = 0; i < parts.length; ++i) {\n const quotindex = parts[i].indexOf('\"');\n if (quotindex !== -1) {\n parts[i] = parts[i].slice(0, quotindex);\n parts.length = i + 1; // Truncates and stop the iteration.\n }\n parts[i] = parts[i].replaceAll(/\\\\(.)/g, \"$1\");\n }\n value = parts.join('\"');\n }\n return value;\n }\n function rfc5987decode(extvalue) {\n // Decodes \"ext-value\" from RFC 5987.\n const encodingend = extvalue.indexOf(\"'\");\n if (encodingend === -1) {\n // Some servers send \"filename*=\" without encoding 'language' prefix,\n // e.g. in https://github.com/Rob--W/open-in-browser/issues/26\n // Let's accept the value like Firefox (57) (Chrome 62 rejects it).\n return extvalue;\n }\n const encoding = extvalue.slice(0, encodingend);\n const langvalue = extvalue.slice(encodingend + 1);\n // Ignore language (RFC 5987 section 3.2.1, and RFC 6266 section 4.1 ).\n const value = langvalue.replace(/^[^']*'/, \"\");\n return textdecode(encoding, value);\n }\n function rfc2047decode(value) {\n // RFC 2047-decode the result. Firefox tried to drop support for it, but\n // backed out because some servers use it - https://bugzil.la/875615\n // Firefox's condition for decoding is here: https://searchfox.org/mozilla-central/rev/4a590a5a15e35d88a3b23dd6ac3c471cf85b04a8/netwerk/mime/nsMIMEHeaderParamImpl.cpp#742-748\n\n // We are more strict and only recognize RFC 2047-encoding if the value\n // starts with \"=?\", since then it is likely that the full value is\n // RFC 2047-encoded.\n\n // Firefox also decodes words even where RFC 2047 section 5 states:\n // \"An 'encoded-word' MUST NOT appear within a 'quoted-string'.\"\n if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n return value;\n }\n // RFC 2047, section 2.4\n // encoded-word = \"=?\" charset \"?\" encoding \"?\" encoded-text \"?=\"\n // charset = token (but let's restrict to characters that denote a\n // possibly valid encoding).\n // encoding = q or b\n // encoded-text = any printable ASCII character other than ? or space.\n // ... but Firefox permits ? and space.\n return value.replaceAll(\n /=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g,\n function (matches, charset, encoding, text) {\n if (encoding === \"q\" || encoding === \"Q\") {\n // RFC 2047 section 4.2.\n text = text.replaceAll(\"_\", \" \");\n text = text.replaceAll(/=([0-9a-fA-F]{2})/g, function (match, hex) {\n return String.fromCharCode(parseInt(hex, 16));\n });\n return textdecode(charset, text);\n } // else encoding is b or B - base64 (RFC 2047 section 4.1)\n try {\n text = atob(text);\n } catch {}\n return textdecode(charset, text);\n }\n );\n }\n\n return \"\";\n}\n\nexport { getFilenameFromContentDispositionHeader };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n MissingPDFException,\n UnexpectedResponseException,\n} from \"../shared/util.js\";\nimport { getFilenameFromContentDispositionHeader } from \"./content_disposition.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\nfunction validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp,\n rangeChunkSize,\n disableRange,\n}) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(rangeChunkSize) && rangeChunkSize > 0,\n \"rangeChunkSize must be an integer larger than zero.\"\n );\n }\n const returnValues = {\n allowRangeRequests: false,\n suggestedLength: undefined,\n };\n\n const length = parseInt(getResponseHeader(\"Content-Length\"), 10);\n if (!Number.isInteger(length)) {\n return returnValues;\n }\n\n returnValues.suggestedLength = length;\n\n if (length <= 2 * rangeChunkSize) {\n // The file size is smaller than the size of two chunks, so it does not\n // make any sense to abort the request and retry with a range request.\n return returnValues;\n }\n\n if (disableRange || !isHttp) {\n return returnValues;\n }\n if (getResponseHeader(\"Accept-Ranges\") !== \"bytes\") {\n return returnValues;\n }\n\n const contentEncoding = getResponseHeader(\"Content-Encoding\") || \"identity\";\n if (contentEncoding !== \"identity\") {\n return returnValues;\n }\n\n returnValues.allowRangeRequests = true;\n return returnValues;\n}\n\nfunction extractFilenameFromHeader(getResponseHeader) {\n const contentDisposition = getResponseHeader(\"Content-Disposition\");\n if (contentDisposition) {\n let filename = getFilenameFromContentDispositionHeader(contentDisposition);\n if (filename.includes(\"%\")) {\n try {\n filename = decodeURIComponent(filename);\n } catch {}\n }\n if (isPdfFile(filename)) {\n return filename;\n }\n }\n return null;\n}\n\nfunction createResponseStatusError(status, url) {\n if (status === 404 || (status === 0 && url.startsWith(\"file:\"))) {\n return new MissingPDFException('Missing PDF \"' + url + '\".');\n }\n return new UnexpectedResponseException(\n `Unexpected server response (${status}) while retrieving PDF \"${url}\".`,\n status\n );\n}\n\nfunction validateResponseStatus(status) {\n return status === 200 || status === 206;\n}\n\nexport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n validateResponseStatus,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AbortException,\n assert,\n isNodeJS,\n MissingPDFException,\n PromiseCapability,\n} from \"../shared/util.js\";\nimport {\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nlet fs, http, https, url;\nif (isNodeJS) {\n // Native packages.\n fs = await import(/* webpackIgnore: true */ \"fs\");\n http = await import(/* webpackIgnore: true */ \"http\");\n https = await import(/* webpackIgnore: true */ \"https\");\n url = await import(/* webpackIgnore: true */ \"url\");\n}\n\nconst fileUriRegex = /^file:\\/\\/\\/[a-zA-Z]:\\//;\n\nfunction parseUrl(sourceUrl) {\n const parsedUrl = url.parse(sourceUrl);\n if (parsedUrl.protocol === \"file:\" || parsedUrl.host) {\n return parsedUrl;\n }\n // Prepending 'file:///' to Windows absolute path.\n if (/^[a-z]:[/\\\\]/i.test(sourceUrl)) {\n return url.parse(`file:///${sourceUrl}`);\n }\n // Changes protocol to 'file:' if url refers to filesystem.\n if (!parsedUrl.host) {\n parsedUrl.protocol = \"file:\";\n }\n return parsedUrl;\n}\n\nclass PDFNodeStream {\n constructor(source) {\n this.source = source;\n this.url = parseUrl(source.url);\n this.isHttp =\n this.url.protocol === \"http:\" || this.url.protocol === \"https:\";\n // Check if url refers to filesystem.\n this.isFsUrl = this.url.protocol === \"file:\";\n this.httpHeaders = (this.isHttp && source.httpHeaders) || {};\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFNodeStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = this.isFsUrl\n ? new PDFNodeStreamFsFullReader(this)\n : new PDFNodeStreamFullReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(start, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const rangeReader = this.isFsUrl\n ? new PDFNodeStreamFsRangeReader(this, start, end)\n : new PDFNodeStreamRangeReader(this, start, end);\n this._rangeRequestReaders.push(rangeReader);\n return rangeReader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\nclass BaseFullReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n const source = stream.source;\n this._contentLength = source.length; // optional\n this._loaded = 0;\n this._filename = null;\n\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n\n this._readableStream = null;\n this._readCapability = new PromiseCapability();\n this._headersCapability = new PromiseCapability();\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = new PromiseCapability();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readable to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this._error(new AbortException(\"streaming is disabled\"));\n }\n\n // Destroy ReadableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nclass BaseRangeReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n this._loaded = 0;\n this._readableStream = null;\n this._readCapability = new PromiseCapability();\n const source = stream.source;\n this._isStreamingSupported = !source.disableStream;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = new PromiseCapability();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({ loaded: this._loaded });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readableStream to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // Destroy readableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nfunction createRequestOptions(parsedUrl, headers) {\n return {\n protocol: parsedUrl.protocol,\n auth: parsedUrl.auth,\n host: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.path,\n method: \"GET\",\n headers,\n };\n}\n\nclass PDFNodeStreamFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n this._headersCapability.reject(error);\n return;\n }\n this._headersCapability.resolve();\n this._setReadableStream(response);\n\n const getResponseHeader = name => {\n // Make sure that headers name are in lower case, as mentioned\n // here: https://nodejs.org/api/http.html#http_message_headers.\n return this._readableStream.headers[name.toLowerCase()];\n };\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n this._isRangeSupported = allowRangeRequests;\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n };\n\n this._request = null;\n if (this._url.protocol === \"http:\") {\n this._request = http.request(\n createRequestOptions(this._url, stream.httpHeaders),\n handleResponse\n );\n } else {\n this._request = https.request(\n createRequestOptions(this._url, stream.httpHeaders),\n handleResponse\n );\n }\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n this._headersCapability.reject(reason);\n });\n // Note: `request.end(data)` is used to write `data` to request body\n // and notify end of request. But one should always call `request.end()`\n // even if there is no data to write -- (to notify the end of request).\n this._request.end();\n }\n}\n\nclass PDFNodeStreamRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n\n this._httpHeaders = {};\n for (const property in stream.httpHeaders) {\n const value = stream.httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n this._httpHeaders[property] = value;\n }\n this._httpHeaders.Range = `bytes=${start}-${end - 1}`;\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n return;\n }\n this._setReadableStream(response);\n };\n\n this._request = null;\n if (this._url.protocol === \"http:\") {\n this._request = http.request(\n createRequestOptions(this._url, this._httpHeaders),\n handleResponse\n );\n } else {\n this._request = https.request(\n createRequestOptions(this._url, this._httpHeaders),\n handleResponse\n );\n }\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n });\n this._request.end();\n }\n}\n\nclass PDFNodeStreamFsFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n let path = decodeURIComponent(this._url.path);\n\n // Remove the extra slash to get right path from url like `file:///C:/`\n if (fileUriRegex.test(this._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n fs.lstat(path, (error, stat) => {\n if (error) {\n if (error.code === \"ENOENT\") {\n error = new MissingPDFException(`Missing PDF \"${path}\".`);\n }\n this._storedError = error;\n this._headersCapability.reject(error);\n return;\n }\n // Setting right content length.\n this._contentLength = stat.size;\n\n this._setReadableStream(fs.createReadStream(path));\n this._headersCapability.resolve();\n });\n }\n}\n\nclass PDFNodeStreamFsRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n\n let path = decodeURIComponent(this._url.path);\n\n // Remove the extra slash to get right path from url like `file:///C:/`\n if (fileUriRegex.test(this._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n this._setReadableStream(fs.createReadStream(path, { start, end: end - 1 }));\n }\n}\n\nexport { PDFNodeStream };\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 {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n} from \"./base_factory.js\";\nimport { isNodeJS, warn } from \"../shared/util.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_utils.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nlet fs, canvas, path2d_polyfill;\nif (isNodeJS) {\n // Native packages.\n fs = await import(/* webpackIgnore: true */ \"fs\");\n // Optional, third-party, packages.\n try {\n canvas = await import(/* webpackIgnore: true */ \"canvas\");\n } catch {}\n try {\n path2d_polyfill = await import(/* webpackIgnore: true */ \"path2d-polyfill\");\n } catch {}\n}\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"SKIP_BABEL\")) {\n (function checkDOMMatrix() {\n if (globalThis.DOMMatrix || !isNodeJS) {\n return;\n }\n const DOMMatrix = canvas?.DOMMatrix;\n\n if (DOMMatrix) {\n globalThis.DOMMatrix = DOMMatrix;\n } else {\n warn(\"Cannot polyfill `DOMMatrix`, rendering may be broken.\");\n }\n })();\n\n (function checkPath2D() {\n if (globalThis.Path2D || !isNodeJS) {\n return;\n }\n const CanvasRenderingContext2D = canvas?.CanvasRenderingContext2D;\n const polyfillPath2D = path2d_polyfill?.polyfillPath2D;\n\n if (CanvasRenderingContext2D && polyfillPath2D) {\n globalThis.CanvasRenderingContext2D = CanvasRenderingContext2D;\n polyfillPath2D(globalThis);\n } else {\n warn(\"Cannot polyfill `Path2D`, rendering may be broken.\");\n }\n })();\n}\n\nconst fetchData = function (url) {\n return new Promise((resolve, reject) => {\n fs.readFile(url, (error, data) => {\n if (error || !data) {\n reject(new Error(error));\n return;\n }\n resolve(new Uint8Array(data));\n });\n });\n};\n\nclass NodeFilterFactory extends BaseFilterFactory {}\n\nclass NodeCanvasFactory extends BaseCanvasFactory {\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n return canvas.createCanvas(width, height);\n }\n}\n\nclass NodeCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n return fetchData(url).then(data => {\n return { cMapData: data, compressionType };\n });\n }\n}\n\nclass NodeStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n _fetchData(url) {\n return fetchData(url);\n }\n}\n\nexport {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodeStandardFontDataFactory,\n};\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap, unreachable, warn } from \"../shared/util.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst INTERNAL = Symbol(\"INTERNAL\");\n\nclass OptionalContentGroup {\n #visible = true;\n\n constructor(name, intent) {\n this.name = name;\n this.intent = intent;\n }\n\n /**\n * @type {boolean}\n */\n get visible() {\n return this.#visible;\n }\n\n /**\n * @ignore\n */\n _setVisible(internal, visible) {\n if (internal !== INTERNAL) {\n unreachable(\"Internal method `_setVisible` called.\");\n }\n this.#visible = visible;\n }\n}\n\nclass OptionalContentConfig {\n #cachedGetHash = null;\n\n #groups = new Map();\n\n #initialHash = null;\n\n #order = null;\n\n constructor(data) {\n this.name = null;\n this.creator = null;\n\n if (data === null) {\n return;\n }\n this.name = data.name;\n this.creator = data.creator;\n this.#order = data.order;\n for (const group of data.groups) {\n this.#groups.set(\n group.id,\n new OptionalContentGroup(group.name, group.intent)\n );\n }\n\n if (data.baseState === \"OFF\") {\n for (const group of this.#groups.values()) {\n group._setVisible(INTERNAL, false);\n }\n }\n\n for (const on of data.on) {\n this.#groups.get(on)._setVisible(INTERNAL, true);\n }\n\n for (const off of data.off) {\n this.#groups.get(off)._setVisible(INTERNAL, false);\n }\n\n // The following code must always run *last* in the constructor.\n this.#initialHash = this.getHash();\n }\n\n #evaluateVisibilityExpression(array) {\n const length = array.length;\n if (length < 2) {\n return true;\n }\n const operator = array[0];\n for (let i = 1; i < length; i++) {\n const element = array[i];\n let state;\n if (Array.isArray(element)) {\n state = this.#evaluateVisibilityExpression(element);\n } else if (this.#groups.has(element)) {\n state = this.#groups.get(element).visible;\n } else {\n warn(`Optional content group not found: ${element}`);\n return true;\n }\n switch (operator) {\n case \"And\":\n if (!state) {\n return false;\n }\n break;\n case \"Or\":\n if (state) {\n return true;\n }\n break;\n case \"Not\":\n return !state;\n default:\n return true;\n }\n }\n return operator === \"And\";\n }\n\n isVisible(group) {\n if (this.#groups.size === 0) {\n return true;\n }\n if (!group) {\n warn(\"Optional content group not defined.\");\n return true;\n }\n if (group.type === \"OCG\") {\n if (!this.#groups.has(group.id)) {\n warn(`Optional content group not found: ${group.id}`);\n return true;\n }\n return this.#groups.get(group.id).visible;\n } else if (group.type === \"OCMD\") {\n // Per the spec, the expression should be preferred if available.\n if (group.expression) {\n return this.#evaluateVisibilityExpression(group.expression);\n }\n if (!group.policy || group.policy === \"AnyOn\") {\n // Default\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOn\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n } else if (group.policy === \"AnyOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n }\n warn(`Unknown optional content policy ${group.policy}.`);\n return true;\n }\n warn(`Unknown group type ${group.type}.`);\n return true;\n }\n\n setVisibility(id, visible = true) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return;\n }\n this.#groups.get(id)._setVisible(INTERNAL, !!visible);\n\n this.#cachedGetHash = null;\n }\n\n get hasInitialVisibility() {\n return this.#initialHash === null || this.getHash() === this.#initialHash;\n }\n\n getOrder() {\n if (!this.#groups.size) {\n return null;\n }\n if (this.#order) {\n return this.#order.slice();\n }\n return [...this.#groups.keys()];\n }\n\n getGroups() {\n return this.#groups.size > 0 ? objectFromMap(this.#groups) : null;\n }\n\n getGroup(id) {\n return this.#groups.get(id) || null;\n }\n\n getHash() {\n if (this.#cachedGetHash !== null) {\n return this.#cachedGetHash;\n }\n const hash = new MurmurHash3_64();\n\n for (const [id, group] of this.#groups) {\n hash.update(`${id}:${group.visible}`);\n }\n return (this.#cachedGetHash = hash.hexdigest());\n }\n}\n\nexport { OptionalContentConfig };\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(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nimport {\n AbortException,\n FeatureTest,\n PromiseCapability,\n Util,\n} from \"../shared/util.js\";\nimport { setLayerDimensions } from \"./display_utils.js\";\n\n/**\n * Text layer render parameters.\n *\n * @typedef {Object} TextLayerRenderParameters\n * @property {ReadableStream | TextContent} textContentSource - Text content to\n * render, i.e. the value returned by the page's `streamTextContent` or\n * `getTextContent` method.\n * @property {HTMLElement} container - The DOM node that will contain the text\n * runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {Array<HTMLElement>} [textDivs] - HTML elements that correspond to\n * the text items of the textContent input.\n * This is output and shall initially be set to an empty array.\n * @property {WeakMap<HTMLElement,Object>} [textDivProperties] - Some properties\n * weakly mapped to the HTML elements used to render the text.\n * @property {Array<string>} [textContentItemsStr] - Strings that correspond to\n * the `str` property of the text items of the textContent input.\n * This is output and shall initially be set to an empty array.\n * @property {boolean} [isOffscreenCanvasSupported] true if we can use\n * OffscreenCanvas to measure string widths.\n */\n\n/**\n * Text layer update parameters.\n *\n * @typedef {Object} TextLayerUpdateParameters\n * @property {HTMLElement} container - The DOM node that will contain the text\n * runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {Array<HTMLElement>} [textDivs] - HTML elements that correspond to\n * the text items of the textContent input.\n * This is output and shall initially be set to an empty array.\n * @property {WeakMap<HTMLElement,Object>} [textDivProperties] - Some properties\n * weakly mapped to the HTML elements used to render the text.\n * @property {boolean} [isOffscreenCanvasSupported] true if we can use\n * OffscreenCanvas to measure string widths.\n * @property {boolean} [mustRotate] true if the text layer must be rotated.\n * @property {boolean} [mustRescale] true if the text layer contents must be\n * rescaled.\n */\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\nconst DEFAULT_FONT_ASCENT = 0.8;\nconst ascentCache = new Map();\n\nfunction getCtx(size, isOffscreenCanvasSupported) {\n let ctx;\n if (isOffscreenCanvasSupported && FeatureTest.isOffscreenCanvasSupported) {\n ctx = new OffscreenCanvas(size, size).getContext(\"2d\", { alpha: false });\n } else {\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = size;\n ctx = canvas.getContext(\"2d\", { alpha: false });\n }\n\n return ctx;\n}\n\nfunction getAscent(fontFamily, isOffscreenCanvasSupported) {\n const cachedAscent = ascentCache.get(fontFamily);\n if (cachedAscent) {\n return cachedAscent;\n }\n\n const ctx = getCtx(DEFAULT_FONT_SIZE, isOffscreenCanvasSupported);\n\n ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`;\n const metrics = ctx.measureText(\"\");\n\n // Both properties aren't available by default in Firefox.\n let ascent = metrics.fontBoundingBoxAscent;\n let descent = Math.abs(metrics.fontBoundingBoxDescent);\n if (ascent) {\n const ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\n\n ctx.canvas.width = ctx.canvas.height = 0;\n return ratio;\n }\n\n // Try basic heuristic to guess ascent/descent.\n // Draw a g with baseline at 0,0 and then get the line\n // number where a pixel has non-null red component (starting\n // from bottom).\n ctx.strokeStyle = \"red\";\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"g\", 0, 0);\n let pixels = ctx.getImageData(\n 0,\n 0,\n DEFAULT_FONT_SIZE,\n DEFAULT_FONT_SIZE\n ).data;\n descent = 0;\n for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) {\n if (pixels[i] > 0) {\n descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n // Draw an A with baseline at 0,DEFAULT_FONT_SIZE and then get the line\n // number where a pixel has non-null red component (starting\n // from top).\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"A\", 0, DEFAULT_FONT_SIZE);\n pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n ascent = 0;\n for (let i = 0, ii = pixels.length; i < ii; i += 4) {\n if (pixels[i] > 0) {\n ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n ctx.canvas.width = ctx.canvas.height = 0;\n\n if (ascent) {\n const ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n\n ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT);\n return DEFAULT_FONT_ASCENT;\n}\n\nfunction appendText(task, geom, styles) {\n // Initialize all used properties to keep the caches monomorphic.\n const textDiv = document.createElement(\"span\");\n const textDivProperties = {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n fontSize: 0,\n };\n task._textDivs.push(textDiv);\n\n const tx = Util.transform(task._transform, geom.transform);\n let angle = Math.atan2(tx[1], tx[0]);\n const style = styles[geom.fontName];\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n\n const fontFamily =\n (task._fontInspectorEnabled && style.fontSubstitution) || style.fontFamily;\n const fontHeight = Math.hypot(tx[2], tx[3]);\n const fontAscent =\n fontHeight * getAscent(fontFamily, task._isOffscreenCanvasSupported);\n\n let left, top;\n if (angle === 0) {\n left = tx[4];\n top = tx[5] - fontAscent;\n } else {\n left = tx[4] + fontAscent * Math.sin(angle);\n top = tx[5] - fontAscent * Math.cos(angle);\n }\n\n const scaleFactorStr = \"calc(var(--scale-factor)*\";\n const divStyle = textDiv.style;\n // Setting the style properties individually, rather than all at once,\n // should be OK since the `textDiv` isn't appended to the document yet.\n if (task._container === task._rootContainer) {\n divStyle.left = `${((100 * left) / task._pageWidth).toFixed(2)}%`;\n divStyle.top = `${((100 * top) / task._pageHeight).toFixed(2)}%`;\n } else {\n // We're in a marked content span, hence we can't use percents.\n divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`;\n divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`;\n }\n divStyle.fontSize = `${scaleFactorStr}${fontHeight.toFixed(2)}px)`;\n divStyle.fontFamily = fontFamily;\n\n textDivProperties.fontSize = fontHeight;\n\n // Keeps screen readers from pausing on every new text span.\n textDiv.setAttribute(\"role\", \"presentation\");\n\n textDiv.textContent = geom.str;\n // geom.dir may be 'ttb' for vertical texts.\n textDiv.dir = geom.dir;\n\n // `fontName` is only used by the FontInspector, and we only use `dataset`\n // here to make the font name available in the debugger.\n if (task._fontInspectorEnabled) {\n textDiv.dataset.fontName =\n style.fontSubstitutionLoadedName || geom.fontName;\n }\n if (angle !== 0) {\n textDivProperties.angle = angle * (180 / Math.PI);\n }\n // We don't bother scaling single-char text divs, because it has very\n // little effect on text highlighting. This makes scrolling on docs with\n // lots of such divs a lot faster.\n let shouldScaleText = false;\n if (geom.str.length > 1) {\n shouldScaleText = true;\n } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n const absScaleX = Math.abs(geom.transform[0]),\n absScaleY = Math.abs(geom.transform[3]);\n // When the horizontal/vertical scaling differs significantly, also scale\n // even single-char text to improve highlighting (fixes issue11713.pdf).\n if (\n absScaleX !== absScaleY &&\n Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5\n ) {\n shouldScaleText = true;\n }\n }\n if (shouldScaleText) {\n textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width;\n }\n task._textDivProperties.set(textDiv, textDivProperties);\n if (task._isReadableStream) {\n task._layoutText(textDiv);\n }\n}\n\nfunction layout(params) {\n const { div, scale, properties, ctx, prevFontSize, prevFontFamily } = params;\n const { style } = div;\n let transform = \"\";\n if (properties.canvasWidth !== 0 && properties.hasText) {\n const { fontFamily } = style;\n const { canvasWidth, fontSize } = properties;\n\n if (prevFontSize !== fontSize || prevFontFamily !== fontFamily) {\n ctx.font = `${fontSize * scale}px ${fontFamily}`;\n params.prevFontSize = fontSize;\n params.prevFontFamily = fontFamily;\n }\n\n // Only measure the width for multi-char text divs, see `appendText`.\n const { width } = ctx.measureText(div.textContent);\n\n if (width > 0) {\n transform = `scaleX(${(canvasWidth * scale) / width})`;\n }\n }\n if (properties.angle !== 0) {\n transform = `rotate(${properties.angle}deg) ${transform}`;\n }\n if (transform.length > 0) {\n style.transform = transform;\n }\n}\n\nfunction render(task) {\n if (task._canceled) {\n return;\n }\n const textDivs = task._textDivs;\n const capability = task._capability;\n const textDivsLength = textDivs.length;\n\n // No point in rendering many divs as it would make the browser\n // unusable even after the divs are rendered.\n if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) {\n capability.resolve();\n return;\n }\n\n if (!task._isReadableStream) {\n for (const textDiv of textDivs) {\n task._layoutText(textDiv);\n }\n }\n capability.resolve();\n}\n\nclass TextLayerRenderTask {\n constructor({\n textContentSource,\n container,\n viewport,\n textDivs,\n textDivProperties,\n textContentItemsStr,\n isOffscreenCanvasSupported,\n }) {\n this._textContentSource = textContentSource;\n this._isReadableStream = textContentSource instanceof ReadableStream;\n this._container = this._rootContainer = container;\n this._textDivs = textDivs || [];\n this._textContentItemsStr = textContentItemsStr || [];\n this._isOffscreenCanvasSupported = isOffscreenCanvasSupported;\n this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n\n this._reader = null;\n this._textDivProperties = textDivProperties || new WeakMap();\n this._canceled = false;\n this._capability = new PromiseCapability();\n this._layoutTextParams = {\n prevFontSize: null,\n prevFontFamily: null,\n div: null,\n scale: viewport.scale * (globalThis.devicePixelRatio || 1),\n properties: null,\n ctx: getCtx(0, isOffscreenCanvasSupported),\n };\n const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n this._transform = [1, 0, 0, -1, -pageX, pageY + pageHeight];\n this._pageWidth = pageWidth;\n this._pageHeight = pageHeight;\n\n setLayerDimensions(container, viewport);\n\n // Always clean-up the temporary canvas once rendering is no longer pending.\n this._capability.promise\n .finally(() => {\n this._layoutTextParams = null;\n })\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n }\n\n /**\n * Promise for textLayer rendering task completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Cancel rendering of the textLayer.\n */\n cancel() {\n this._canceled = true;\n if (this._reader) {\n this._reader\n .cancel(new AbortException(\"TextLayer task cancelled.\"))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n this._reader = null;\n }\n this._capability.reject(new AbortException(\"TextLayer task cancelled.\"));\n }\n\n /**\n * @private\n */\n _processItems(items, styleCache) {\n for (const item of items) {\n if (item.str === undefined) {\n if (\n item.type === \"beginMarkedContentProps\" ||\n item.type === \"beginMarkedContent\"\n ) {\n const parent = this._container;\n this._container = document.createElement(\"span\");\n this._container.classList.add(\"markedContent\");\n if (item.id !== null) {\n this._container.setAttribute(\"id\", `${item.id}`);\n }\n parent.append(this._container);\n } else if (item.type === \"endMarkedContent\") {\n this._container = this._container.parentNode;\n }\n continue;\n }\n this._textContentItemsStr.push(item.str);\n appendText(this, item, styleCache);\n }\n }\n\n /**\n * @private\n */\n _layoutText(textDiv) {\n const textDivProperties = (this._layoutTextParams.properties =\n this._textDivProperties.get(textDiv));\n this._layoutTextParams.div = textDiv;\n layout(this._layoutTextParams);\n\n if (textDivProperties.hasText) {\n this._container.append(textDiv);\n }\n if (textDivProperties.hasEOL) {\n const br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n this._container.append(br);\n }\n }\n\n /**\n * @private\n */\n _render() {\n const capability = new PromiseCapability();\n let styleCache = Object.create(null);\n\n if (this._isReadableStream) {\n const pump = () => {\n this._reader.read().then(({ value, done }) => {\n if (done) {\n capability.resolve();\n return;\n }\n\n Object.assign(styleCache, value.styles);\n this._processItems(value.items, styleCache);\n pump();\n }, capability.reject);\n };\n\n this._reader = this._textContentSource.getReader();\n pump();\n } else if (this._textContentSource) {\n const { items, styles } = this._textContentSource;\n this._processItems(items, styles);\n capability.resolve();\n } else {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n\n capability.promise.then(() => {\n styleCache = null;\n render(this);\n }, this._capability.reject);\n }\n}\n\n/**\n * @param {TextLayerRenderParameters} params\n * @returns {TextLayerRenderTask}\n */\nfunction renderTextLayer(params) {\n const task = new TextLayerRenderTask(params);\n task._render();\n return task;\n}\n\n/**\n * @param {TextLayerUpdateParameters} params\n * @returns {undefined}\n */\nfunction updateTextLayer({\n container,\n viewport,\n textDivs,\n textDivProperties,\n isOffscreenCanvasSupported,\n mustRotate = true,\n mustRescale = true,\n}) {\n if (mustRotate) {\n setLayerDimensions(container, { rotation: viewport.rotation });\n }\n\n if (mustRescale) {\n const ctx = getCtx(0, isOffscreenCanvasSupported);\n const scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n const params = {\n prevFontSize: null,\n prevFontFamily: null,\n div: null,\n scale,\n properties: null,\n ctx,\n };\n for (const div of textDivs) {\n params.properties = textDivProperties.get(div);\n params.div = div;\n layout(params);\n }\n }\n}\n\nexport { renderTextLayer, TextLayerRenderTask, updateTextLayer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../interfaces\").IPDFStream} IPDFStream */\n/** @typedef {import(\"../interfaces\").IPDFStreamReader} IPDFStreamReader */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../interfaces\").IPDFStreamRangeReader} IPDFStreamRangeReader */\n\nimport { assert, PromiseCapability } from \"../shared/util.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\n/** @implements {IPDFStream} */\nclass PDFDataTransportStream {\n constructor(\n {\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null,\n disableRange = false,\n disableStream = false,\n },\n pdfDataRangeTransport\n ) {\n assert(\n pdfDataRangeTransport,\n 'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.'\n );\n\n this._queuedChunks = [];\n this._progressiveDone = progressiveDone;\n this._contentDispositionFilename = contentDispositionFilename;\n\n if (initialData?.length > 0) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n initialData instanceof Uint8Array &&\n initialData.byteLength === initialData.buffer.byteLength\n ? initialData.buffer\n : new Uint8Array(initialData).buffer;\n this._queuedChunks.push(buffer);\n }\n\n this._pdfDataRangeTransport = pdfDataRangeTransport;\n this._isStreamingSupported = !disableStream;\n this._isRangeSupported = !disableRange;\n this._contentLength = length;\n\n this._fullRequestReader = null;\n this._rangeReaders = [];\n\n this._pdfDataRangeTransport.addRangeListener((begin, chunk) => {\n this._onReceiveData({ begin, chunk });\n });\n\n this._pdfDataRangeTransport.addProgressListener((loaded, total) => {\n this._onProgress({ loaded, total });\n });\n\n this._pdfDataRangeTransport.addProgressiveReadListener(chunk => {\n this._onReceiveData({ chunk });\n });\n\n this._pdfDataRangeTransport.addProgressiveDoneListener(() => {\n this._onProgressiveDone();\n });\n\n this._pdfDataRangeTransport.transportReady();\n }\n\n _onReceiveData({ begin, chunk }) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n chunk instanceof Uint8Array &&\n chunk.byteLength === chunk.buffer.byteLength\n ? chunk.buffer\n : new Uint8Array(chunk).buffer;\n\n if (begin === undefined) {\n if (this._fullRequestReader) {\n this._fullRequestReader._enqueue(buffer);\n } else {\n this._queuedChunks.push(buffer);\n }\n } else {\n const found = this._rangeReaders.some(function (rangeReader) {\n if (rangeReader._begin !== begin) {\n return false;\n }\n rangeReader._enqueue(buffer);\n return true;\n });\n assert(\n found,\n \"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\"\n );\n }\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n _onProgress(evt) {\n if (evt.total === undefined) {\n // Reporting to first range reader, if it exists.\n this._rangeReaders[0]?.onProgress?.({ loaded: evt.loaded });\n } else {\n this._fullRequestReader?.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n }\n }\n\n _onProgressiveDone() {\n this._fullRequestReader?.progressiveDone();\n this._progressiveDone = true;\n }\n\n _removeRangeReader(reader) {\n const i = this._rangeReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFDataTransportStream.getFullReader can only be called once.\"\n );\n const queuedChunks = this._queuedChunks;\n this._queuedChunks = null;\n return new PDFDataTransportStreamReader(\n this,\n queuedChunks,\n this._progressiveDone,\n this._contentDispositionFilename\n );\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFDataTransportStreamRangeReader(this, begin, end);\n this._pdfDataRangeTransport.requestDataRange(begin, end);\n this._rangeReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeReaders.slice(0)) {\n reader.cancel(reason);\n }\n this._pdfDataRangeTransport.abort();\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFDataTransportStreamReader {\n constructor(\n stream,\n queuedChunks,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this._stream = stream;\n this._done = progressiveDone || false;\n this._filename = isPdfFile(contentDispositionFilename)\n ? contentDispositionFilename\n : null;\n this._queuedChunks = queuedChunks || [];\n this._loaded = 0;\n for (const chunk of this._queuedChunks) {\n this._loaded += chunk.byteLength;\n }\n this._requests = [];\n this._headersReady = Promise.resolve();\n stream._fullRequestReader = this;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // Ignore new data.\n }\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunks.push(chunk);\n }\n this._loaded += chunk.byteLength;\n }\n\n get headersReady() {\n return this._headersReady;\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._stream._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._stream._isStreamingSupported;\n }\n\n get contentLength() {\n return this._stream._contentLength;\n }\n\n async read() {\n if (this._queuedChunks.length > 0) {\n const chunk = this._queuedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = new PromiseCapability();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n progressiveDone() {\n if (this._done) {\n return;\n }\n this._done = true;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFDataTransportStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._begin = begin;\n this._end = end;\n this._queuedChunk = null;\n this._requests = [];\n this._done = false;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // ignore new data\n }\n if (this._requests.length === 0) {\n this._queuedChunk = chunk;\n } else {\n const requestsCapability = this._requests.shift();\n requestsCapability.resolve({ value: chunk, done: false });\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n this._done = true;\n this._stream._removeRangeReader(this);\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._queuedChunk) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = new PromiseCapability();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._stream._removeRangeReader(this);\n }\n}\n\nexport { PDFDataTransportStream };\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\n/**\n * @typedef {Object} GlobalWorkerOptionsType\n * @property {Worker | null} workerPort - Defines global port for worker\n * process. Overrides the `workerSrc` option.\n * @property {string} workerSrc - A string containing the path and filename\n * of the worker file.\n *\n * NOTE: The `workerSrc` option should always be set, in order to prevent any\n * issues when using the PDF.js library.\n */\n\n/** @type {GlobalWorkerOptionsType} */\nconst GlobalWorkerOptions = Object.create(null);\n\nGlobalWorkerOptions.workerPort = null;\nGlobalWorkerOptions.workerSrc = \"\";\n\nexport { GlobalWorkerOptions };\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// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_storage\").AnnotationStorage} AnnotationStorage */\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { XfaText } from \"./xfa_text.js\";\n\n/**\n * @typedef {Object} XfaLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {Object} xfaHtml\n * @property {AnnotationStorage} [annotationStorage]\n * @property {IPDFLinkService} linkService\n * @property {string} [intent] - (default value is 'display').\n */\n\nclass XfaLayer {\n static setupStorage(html, id, element, storage, intent) {\n const storedData = storage.getValue(id, { value: null });\n switch (element.name) {\n case \"textarea\":\n if (storedData.value !== null) {\n html.textContent = storedData.value;\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n });\n break;\n case \"input\":\n if (\n element.attributes.type === \"radio\" ||\n element.attributes.type === \"checkbox\"\n ) {\n if (storedData.value === element.attributes.xfaOn) {\n html.setAttribute(\"checked\", true);\n } else if (storedData.value === element.attributes.xfaOff) {\n // The checked attribute may have been set when opening the file,\n // unset through the UI and we're here because of printing.\n html.removeAttribute(\"checked\");\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"change\", event => {\n storage.setValue(id, {\n value: event.target.checked\n ? event.target.getAttribute(\"xfaOn\")\n : event.target.getAttribute(\"xfaOff\"),\n });\n });\n } else {\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n });\n }\n break;\n case \"select\":\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n for (const option of element.children) {\n if (option.attributes.value === storedData.value) {\n option.attributes.selected = true;\n } else if (option.attributes.hasOwnProperty(\"selected\")) {\n delete option.attributes.selected;\n }\n }\n }\n html.addEventListener(\"input\", event => {\n const options = event.target.options;\n const value =\n options.selectedIndex === -1\n ? \"\"\n : options[options.selectedIndex].value;\n storage.setValue(id, { value });\n });\n break;\n }\n }\n\n static setAttributes({ html, element, storage = null, intent, linkService }) {\n const { attributes } = element;\n const isHTMLAnchorElement = html instanceof HTMLAnchorElement;\n\n if (attributes.type === \"radio\") {\n // Avoid to have a radio group when printing with the same as one\n // already displayed.\n attributes.name = `${attributes.name}-${intent}`;\n }\n for (const [key, value] of Object.entries(attributes)) {\n if (value === null || value === undefined) {\n continue;\n }\n\n switch (key) {\n case \"class\":\n if (value.length) {\n html.setAttribute(key, value.join(\" \"));\n }\n break;\n case \"dataId\":\n // We don't need to add dataId in the html object but it can\n // be useful to know its value when writing printing tests:\n // in this case, don't skip dataId to have its value.\n break;\n case \"id\":\n html.setAttribute(\"data-element-id\", value);\n break;\n case \"style\":\n Object.assign(html.style, value);\n break;\n case \"textContent\":\n html.textContent = value;\n break;\n default:\n if (!isHTMLAnchorElement || (key !== \"href\" && key !== \"newWindow\")) {\n html.setAttribute(key, value);\n }\n }\n }\n\n if (isHTMLAnchorElement) {\n linkService.addLinkAttributes(\n html,\n attributes.href,\n attributes.newWindow\n );\n }\n\n // Set the value after the others to be sure to overwrite any other values.\n if (storage && attributes.dataId) {\n this.setupStorage(html, attributes.dataId, element, storage);\n }\n }\n\n /**\n * Render the XFA layer.\n *\n * @param {XfaLayerParameters} parameters\n */\n static render(parameters) {\n const storage = parameters.annotationStorage;\n const linkService = parameters.linkService;\n const root = parameters.xfaHtml;\n const intent = parameters.intent || \"display\";\n const rootHtml = document.createElement(root.name);\n if (root.attributes) {\n this.setAttributes({\n html: rootHtml,\n element: root,\n intent,\n linkService,\n });\n }\n\n const isNotForRichText = intent !== \"richText\";\n const rootDiv = parameters.div;\n rootDiv.append(rootHtml);\n\n if (parameters.viewport) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n rootDiv.style.transform = transform;\n }\n\n // Set defaults.\n if (isNotForRichText) {\n rootDiv.setAttribute(\"class\", \"xfaLayer xfaFont\");\n }\n\n // Text nodes used for the text highlighter.\n const textDivs = [];\n\n // In the rich text context, it's possible to just have a text node without\n // a root element, so we handle this case here (see issue 17215).\n if (root.children.length === 0) {\n if (root.value) {\n const node = document.createTextNode(root.value);\n rootHtml.append(node);\n if (isNotForRichText && XfaText.shouldBuildText(root.name)) {\n textDivs.push(node);\n }\n }\n return { textDivs };\n }\n\n const stack = [[root, -1, rootHtml]];\n\n while (stack.length > 0) {\n const [parent, i, html] = stack.at(-1);\n if (i + 1 === parent.children.length) {\n stack.pop();\n continue;\n }\n\n const child = parent.children[++stack.at(-1)[1]];\n if (child === null) {\n continue;\n }\n\n const { name } = child;\n if (name === \"#text\") {\n const node = document.createTextNode(child.value);\n textDivs.push(node);\n html.append(node);\n continue;\n }\n\n const childHtml = child?.attributes?.xmlns\n ? document.createElementNS(child.attributes.xmlns, name)\n : document.createElement(name);\n\n html.append(childHtml);\n if (child.attributes) {\n this.setAttributes({\n html: childHtml,\n element: child,\n storage,\n intent,\n linkService,\n });\n }\n\n if (child.children?.length > 0) {\n stack.push([child, -1, childHtml]);\n } else if (child.value) {\n const node = document.createTextNode(child.value);\n if (isNotForRichText && XfaText.shouldBuildText(name)) {\n textDivs.push(node);\n }\n childHtml.append(node);\n }\n }\n\n /**\n * TODO: re-enable that stuff once we've JS implementation.\n * See https://bugzilla.mozilla.org/show_bug.cgi?id=1719465.\n *\n * for (const el of rootDiv.querySelectorAll(\n * \".xfaDisabled input, .xfaDisabled textarea\"\n * )) {\n * el.setAttribute(\"disabled\", true);\n * }\n * for (const el of rootDiv.querySelectorAll(\n * \".xfaReadOnly input, .xfaReadOnly textarea\"\n * )) {\n * el.setAttribute(\"readOnly\", true);\n * }\n */\n\n for (const el of rootDiv.querySelectorAll(\n \".xfaNonInteractive input, .xfaNonInteractive textarea\"\n )) {\n el.setAttribute(\"readOnly\", true);\n }\n\n return {\n textDivs,\n };\n }\n\n /**\n * Update the XFA layer.\n *\n * @param {XfaLayerParameters} parameters\n */\n static update(parameters) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n parameters.div.style.transform = transform;\n parameters.div.hidden = false;\n }\n}\n\nexport { XfaLayer };\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(\"./api\").TextContent} TextContent */\n\nclass XfaText {\n /**\n * Walk an XFA tree and create an array of text nodes that is compatible\n * with a regular PDFs TextContent. Currently, only TextItem.str is supported,\n * all other fields and styles haven't been implemented.\n *\n * @param {Object} xfa - An XFA fake DOM object.\n *\n * @returns {TextContent}\n */\n static textContent(xfa) {\n const items = [];\n const output = {\n items,\n styles: Object.create(null),\n };\n function walk(node) {\n if (!node) {\n return;\n }\n let str = null;\n const name = node.name;\n if (name === \"#text\") {\n str = node.value;\n } else if (!XfaText.shouldBuildText(name)) {\n return;\n } else if (node?.attributes?.textContent) {\n str = node.attributes.textContent;\n } else if (node.value) {\n str = node.value;\n }\n if (str !== null) {\n items.push({\n str,\n });\n }\n if (!node.children) {\n return;\n }\n for (const child of node.children) {\n walk(child);\n }\n }\n walk(xfa);\n return output;\n }\n\n /**\n * @param {string} name - DOM node name. (lower case)\n *\n * @returns {boolean} true if the DOM node should have a corresponding text\n * node.\n */\n static shouldBuildText(name) {\n return !(\n name === \"textarea\" ||\n name === \"input\" ||\n name === \"option\" ||\n name === \"select\"\n );\n }\n}\n\nexport { XfaText };\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(\"./display/api\").OnProgressParameters} OnProgressParameters */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/api\").PDFDocumentLoadingTask} PDFDocumentLoadingTask */\n/** @typedef {import(\"./display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./display/api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./display/api\").RenderTask} RenderTask */\n/** @typedef {import(\"./display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/text_layer\").TextLayerRenderTask} TextLayerRenderTask */\n\nimport {\n AbortException,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationMode,\n CMapCompressionType,\n createValidAbsoluteUrl,\n FeatureTest,\n ImageKind,\n InvalidPDFException,\n MissingPDFException,\n normalizeUnicode,\n OPS,\n PasswordResponses,\n PermissionFlag,\n PromiseCapability,\n shadow,\n UnexpectedResponseException,\n Util,\n VerbosityLevel,\n} from \"./shared/util.js\";\nimport {\n build,\n getDocument,\n PDFDataRangeTransport,\n PDFWorker,\n version,\n} from \"./display/api.js\";\nimport {\n DOMSVGFactory,\n fetchData,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n noContextMenu,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n} from \"./display/display_utils.js\";\nimport { renderTextLayer, updateTextLayer } from \"./display/text_layer.js\";\nimport { AnnotationEditorLayer } from \"./display/editor/annotation_editor_layer.js\";\nimport { AnnotationEditorUIManager } from \"./display/editor/tools.js\";\nimport { AnnotationLayer } from \"./display/annotation_layer.js\";\nimport { DrawLayer } from \"./display/draw_layer.js\";\nimport { GlobalWorkerOptions } from \"./display/worker_options.js\";\nimport { Outliner } from \"./display/editor/outliner.js\";\nimport { XfaLayer } from \"./display/xfa_layer.js\";\n\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsVersion =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : void 0;\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsBuild =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : void 0;\n\nexport {\n AbortException,\n AnnotationEditorLayer,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationLayer,\n AnnotationMode,\n build,\n CMapCompressionType,\n createValidAbsoluteUrl,\n DOMSVGFactory,\n DrawLayer,\n FeatureTest,\n fetchData,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getXfaPageViewport,\n GlobalWorkerOptions,\n ImageKind,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n MissingPDFException,\n noContextMenu,\n normalizeUnicode,\n OPS,\n Outliner,\n PasswordResponses,\n PDFDataRangeTransport,\n PDFDateString,\n PDFWorker,\n PermissionFlag,\n PixelsPerInch,\n PromiseCapability,\n RenderingCancelledException,\n renderTextLayer,\n setLayerDimensions,\n shadow,\n UnexpectedResponseException,\n updateTextLayer,\n Util,\n VerbosityLevel,\n version,\n XfaLayer,\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\nimport {\n AbortException,\n assert,\n MissingPDFException,\n PasswordException,\n PromiseCapability,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n} from \"./util.js\";\n\nconst CallbackKind = {\n UNKNOWN: 0,\n DATA: 1,\n ERROR: 2,\n};\n\nconst StreamKind = {\n UNKNOWN: 0,\n CANCEL: 1,\n CANCEL_COMPLETE: 2,\n CLOSE: 3,\n ENQUEUE: 4,\n ERROR: 5,\n PULL: 6,\n PULL_COMPLETE: 7,\n START_COMPLETE: 8,\n};\n\nfunction wrapReason(reason) {\n if (\n !(\n reason instanceof Error ||\n (typeof reason === \"object\" && reason !== null)\n )\n ) {\n unreachable(\n 'wrapReason: Expected \"reason\" to be a (possibly cloned) Error.'\n );\n }\n switch (reason.name) {\n case \"AbortException\":\n return new AbortException(reason.message);\n case \"MissingPDFException\":\n return new MissingPDFException(reason.message);\n case \"PasswordException\":\n return new PasswordException(reason.message, reason.code);\n case \"UnexpectedResponseException\":\n return new UnexpectedResponseException(reason.message, reason.status);\n case \"UnknownErrorException\":\n return new UnknownErrorException(reason.message, reason.details);\n default:\n return new UnknownErrorException(reason.message, reason.toString());\n }\n}\n\nclass MessageHandler {\n constructor(sourceName, targetName, comObj) {\n this.sourceName = sourceName;\n this.targetName = targetName;\n this.comObj = comObj;\n this.callbackId = 1;\n this.streamId = 1;\n this.streamSinks = Object.create(null);\n this.streamControllers = Object.create(null);\n this.callbackCapabilities = Object.create(null);\n this.actionHandler = Object.create(null);\n\n this._onComObjOnMessage = event => {\n const data = event.data;\n if (data.targetName !== this.sourceName) {\n return;\n }\n if (data.stream) {\n this.#processStreamMessage(data);\n return;\n }\n if (data.callback) {\n const callbackId = data.callbackId;\n const capability = this.callbackCapabilities[callbackId];\n if (!capability) {\n throw new Error(`Cannot resolve callback ${callbackId}`);\n }\n delete this.callbackCapabilities[callbackId];\n\n if (data.callback === CallbackKind.DATA) {\n capability.resolve(data.data);\n } else if (data.callback === CallbackKind.ERROR) {\n capability.reject(wrapReason(data.reason));\n } else {\n throw new Error(\"Unexpected callback case\");\n }\n return;\n }\n const action = this.actionHandler[data.action];\n if (!action) {\n throw new Error(`Unknown action from worker: ${data.action}`);\n }\n if (data.callbackId) {\n const cbSourceName = this.sourceName;\n const cbTargetName = data.sourceName;\n\n new Promise(function (resolve) {\n resolve(action(data.data));\n }).then(\n function (result) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.DATA,\n callbackId: data.callbackId,\n data: result,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.ERROR,\n callbackId: data.callbackId,\n reason: wrapReason(reason),\n });\n }\n );\n return;\n }\n if (data.streamId) {\n this.#createStreamSink(data);\n return;\n }\n action(data.data);\n };\n comObj.addEventListener(\"message\", this._onComObjOnMessage);\n }\n\n on(actionName, handler) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof handler === \"function\",\n 'MessageHandler.on: Expected \"handler\" to be a function.'\n );\n }\n const ah = this.actionHandler;\n if (ah[actionName]) {\n throw new Error(`There is already an actionName called \"${actionName}\"`);\n }\n ah[actionName] = handler;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n */\n send(actionName, data, transfers) {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n data,\n },\n transfers\n );\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expects that the other side will callback with the response.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {Promise} Promise to be resolved with response data.\n */\n sendWithPromise(actionName, data, transfers) {\n const callbackId = this.callbackId++;\n const capability = new PromiseCapability();\n this.callbackCapabilities[callbackId] = capability;\n try {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n callbackId,\n data,\n },\n transfers\n );\n } catch (ex) {\n capability.reject(ex);\n }\n return capability.promise;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expect that the other side will callback to signal 'start_complete'.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Object} queueingStrategy - Strategy to signal backpressure based on\n * internal queue.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {ReadableStream} ReadableStream to read data in chunks.\n */\n sendWithStream(actionName, data, queueingStrategy, transfers) {\n const streamId = this.streamId++,\n sourceName = this.sourceName,\n targetName = this.targetName,\n comObj = this.comObj;\n\n return new ReadableStream(\n {\n start: controller => {\n const startCapability = new PromiseCapability();\n this.streamControllers[streamId] = {\n controller,\n startCall: startCapability,\n pullCall: null,\n cancelCall: null,\n isClosed: false,\n };\n comObj.postMessage(\n {\n sourceName,\n targetName,\n action: actionName,\n streamId,\n data,\n desiredSize: controller.desiredSize,\n },\n transfers\n );\n // Return Promise for Async process, to signal success/failure.\n return startCapability.promise;\n },\n\n pull: controller => {\n const pullCapability = new PromiseCapability();\n this.streamControllers[streamId].pullCall = pullCapability;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL,\n streamId,\n desiredSize: controller.desiredSize,\n });\n // Returning Promise will not call \"pull\"\n // again until current pull is resolved.\n return pullCapability.promise;\n },\n\n cancel: reason => {\n assert(reason instanceof Error, \"cancel must have a valid reason\");\n const cancelCapability = new PromiseCapability();\n this.streamControllers[streamId].cancelCall = cancelCapability;\n this.streamControllers[streamId].isClosed = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL,\n streamId,\n reason: wrapReason(reason),\n });\n // Return Promise to signal success or failure.\n return cancelCapability.promise;\n },\n },\n queueingStrategy\n );\n }\n\n #createStreamSink(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const self = this,\n action = this.actionHandler[data.action];\n\n const streamSink = {\n enqueue(chunk, size = 1, transfers) {\n if (this.isCancelled) {\n return;\n }\n const lastDesiredSize = this.desiredSize;\n this.desiredSize -= size;\n // Enqueue decreases the desiredSize property of sink,\n // so when it changes from positive to negative,\n // set ready as unresolved promise.\n if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n this.sinkCapability = new PromiseCapability();\n this.ready = this.sinkCapability.promise;\n }\n comObj.postMessage(\n {\n sourceName,\n targetName,\n stream: StreamKind.ENQUEUE,\n streamId,\n chunk,\n },\n transfers\n );\n },\n\n close() {\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CLOSE,\n streamId,\n });\n delete self.streamSinks[streamId];\n },\n\n error(reason) {\n assert(reason instanceof Error, \"error must have a valid reason\");\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.ERROR,\n streamId,\n reason: wrapReason(reason),\n });\n },\n\n sinkCapability: new PromiseCapability(),\n onPull: null,\n onCancel: null,\n isCancelled: false,\n desiredSize: data.desiredSize,\n ready: null,\n };\n\n streamSink.sinkCapability.resolve();\n streamSink.ready = streamSink.sinkCapability.promise;\n this.streamSinks[streamId] = streamSink;\n\n new Promise(function (resolve) {\n resolve(action(data.data, streamSink));\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n }\n\n #processStreamMessage(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const streamController = this.streamControllers[streamId],\n streamSink = this.streamSinks[streamId];\n\n switch (data.stream) {\n case StreamKind.START_COMPLETE:\n if (data.success) {\n streamController.startCall.resolve();\n } else {\n streamController.startCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL_COMPLETE:\n if (data.success) {\n streamController.pullCall.resolve();\n } else {\n streamController.pullCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL:\n // Ignore any pull after close is called.\n if (!streamSink) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n break;\n }\n // Pull increases the desiredSize property of sink, so when it changes\n // from negative to positive, set ready property as resolved promise.\n if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n streamSink.sinkCapability.resolve();\n }\n // Reset desiredSize property of sink on every pull.\n streamSink.desiredSize = data.desiredSize;\n\n new Promise(function (resolve) {\n resolve(streamSink.onPull?.());\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n break;\n case StreamKind.ENQUEUE:\n assert(streamController, \"enqueue should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.controller.enqueue(data.chunk);\n break;\n case StreamKind.CLOSE:\n assert(streamController, \"close should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.isClosed = true;\n streamController.controller.close();\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.ERROR:\n assert(streamController, \"error should have stream controller\");\n streamController.controller.error(wrapReason(data.reason));\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL_COMPLETE:\n if (data.success) {\n streamController.cancelCall.resolve();\n } else {\n streamController.cancelCall.reject(wrapReason(data.reason));\n }\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL:\n if (!streamSink) {\n break;\n }\n\n new Promise(function (resolve) {\n resolve(streamSink.onCancel?.(wrapReason(data.reason)));\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n streamSink.sinkCapability.reject(wrapReason(data.reason));\n streamSink.isCancelled = true;\n delete this.streamSinks[streamId];\n break;\n default:\n throw new Error(\"Unexpected stream case\");\n }\n }\n\n async #deleteStreamController(streamController, streamId) {\n // Delete the `streamController` only when the start, pull, and cancel\n // capabilities have settled, to prevent `TypeError`s.\n await Promise.allSettled([\n streamController.startCall?.promise,\n streamController.pullCall?.promise,\n streamController.cancelCall?.promise,\n ]);\n delete this.streamControllers[streamId];\n }\n\n destroy() {\n this.comObj.removeEventListener(\"message\", this._onComObjOnMessage);\n }\n}\n\nexport { MessageHandler };\n","/* Copyright 2014 Opera Software ASA\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 * Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.\n * Hashes roughly 100 KB per millisecond on i7 3.4 GHz.\n */\n\nimport { isArrayBuffer } from \"./util.js\";\n\nconst SEED = 0xc3d2e1f0;\n// Workaround for missing math precision in JS.\nconst MASK_HIGH = 0xffff0000;\nconst MASK_LOW = 0xffff;\n\nclass MurmurHash3_64 {\n constructor(seed) {\n this.h1 = seed ? seed & 0xffffffff : SEED;\n this.h2 = seed ? seed & 0xffffffff : SEED;\n }\n\n update(input) {\n let data, length;\n if (typeof input === \"string\") {\n data = new Uint8Array(input.length * 2);\n length = 0;\n for (let i = 0, ii = input.length; i < ii; i++) {\n const code = input.charCodeAt(i);\n if (code <= 0xff) {\n data[length++] = code;\n } else {\n data[length++] = code >>> 8;\n data[length++] = code & 0xff;\n }\n }\n } else if (isArrayBuffer(input)) {\n data = input.slice();\n length = data.byteLength;\n } else {\n throw new Error(\n \"Wrong data format in MurmurHash3_64_update. \" +\n \"Input must be a string or array.\"\n );\n }\n\n const blockCounts = length >> 2;\n const tailLength = length - blockCounts * 4;\n // We don't care about endianness here.\n const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);\n let k1 = 0,\n k2 = 0;\n let h1 = this.h1,\n h2 = this.h2;\n const C1 = 0xcc9e2d51,\n C2 = 0x1b873593;\n const C1_LOW = C1 & MASK_LOW,\n C2_LOW = C2 & MASK_LOW;\n\n for (let i = 0; i < blockCounts; i++) {\n if (i & 1) {\n k1 = dataUint32[i];\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = h1 * 5 + 0xe6546b64;\n } else {\n k2 = dataUint32[i];\n k2 = ((k2 * C1) & MASK_HIGH) | ((k2 * C1_LOW) & MASK_LOW);\n k2 = (k2 << 15) | (k2 >>> 17);\n k2 = ((k2 * C2) & MASK_HIGH) | ((k2 * C2_LOW) & MASK_LOW);\n h2 ^= k2;\n h2 = (h2 << 13) | (h2 >>> 19);\n h2 = h2 * 5 + 0xe6546b64;\n }\n }\n\n k1 = 0;\n\n switch (tailLength) {\n case 3:\n k1 ^= data[blockCounts * 4 + 2] << 16;\n /* falls through */\n case 2:\n k1 ^= data[blockCounts * 4 + 1] << 8;\n /* falls through */\n case 1:\n k1 ^= data[blockCounts * 4];\n /* falls through */\n\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n if (blockCounts & 1) {\n h1 ^= k1;\n } else {\n h2 ^= k1;\n }\n }\n\n this.h1 = h1;\n this.h2 = h2;\n }\n\n hexdigest() {\n let h1 = this.h1,\n h2 = this.h2;\n\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0xed558ccd) & MASK_HIGH) | ((h1 * 0x8ccd) & MASK_LOW);\n h2 =\n ((h2 * 0xff51afd7) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xafd7ed55) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0x1a85ec53) & MASK_HIGH) | ((h1 * 0xec53) & MASK_LOW);\n h2 =\n ((h2 * 0xc4ceb9fe) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xb9fe1a85) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n\n return (\n (h1 >>> 0).toString(16).padStart(8, \"0\") +\n (h2 >>> 0).toString(16).padStart(8, \"0\")\n );\n }\n}\n\nexport { MurmurHash3_64 };\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/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof process === \"object\" &&\n process + \"\" === \"[object process]\" &&\n !process.versions.nw &&\n !(process.versions.electron && process.type && process.type !== \"browser\");\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\nconst MAX_IMAGE_SIZE_TO_CACHE = 10e6; // Ten megabytes.\n\n// Represent the percentage of the height of a single-line field over\n// the font size. Acrobat seems to use this value.\nconst LINE_FACTOR = 1.35;\nconst LINE_DESCENT_FACTOR = 0.35;\nconst BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;\n\n/**\n * Refer to the `WorkerTransport.getRenderingIntent`-method in the API, to see\n * how these flags are being used:\n * - ANY, DISPLAY, and PRINT are the normal rendering intents, note the\n * `PDFPageProxy.{render, getOperatorList, getAnnotations}`-methods.\n * - ANNOTATIONS_FORMS, ANNOTATIONS_STORAGE, ANNOTATIONS_DISABLE control which\n * annotations are rendered onto the canvas (i.e. by being included in the\n * operatorList), note the `PDFPageProxy.{render, getOperatorList}`-methods\n * and their `annotationMode`-option.\n * - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n * `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n SAVE: 0x08,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3,\n};\n\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\n\nconst AnnotationEditorType = {\n DISABLE: -1,\n NONE: 0,\n FREETEXT: 3,\n HIGHLIGHT: 9,\n STAMP: 13,\n INK: 15,\n};\n\nconst AnnotationEditorParamsType = {\n RESIZE: 1,\n CREATE: 2,\n FREETEXT_SIZE: 11,\n FREETEXT_COLOR: 12,\n FREETEXT_OPACITY: 13,\n INK_COLOR: 21,\n INK_THICKNESS: 22,\n INK_OPACITY: 23,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n // PLEASE NOTE: We purposely keep any removed operators commented out, since\n // re-numbering the list would risk breaking third-party users.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n // beginAnnotations: 78,\n // endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n // paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n};\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n switch (url?.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {Object} [options]\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n try {\n if (options && typeof url === \"string\") {\n // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n // Avoid accidentally matching a *relative* URL pointing to a file named\n // e.g. \"www.pdf\" or similar.\n if (dots?.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch {}\n }\n }\n\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch {\n /* `new URL()` will throw on incorrect data. */\n }\n return null;\n}\n\nfunction shadow(obj, prop, value, nonSerializable = false) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n prop in obj,\n `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n );\n }\n Object.defineProperty(obj, prop, {\n value,\n enumerable: !nonSerializable,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message, name) {\n if (this.constructor === BaseException) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n this.message = message;\n this.name = name;\n }\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n\n return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg, \"PasswordException\");\n this.code = code;\n }\n}\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg, \"UnknownErrorException\");\n this.details = details;\n }\n}\n\nclass InvalidPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"InvalidPDFException\");\n }\n}\n\nclass MissingPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"MissingPDFException\");\n }\n}\n\nclass UnexpectedResponseException extends BaseException {\n constructor(msg, status) {\n super(msg, \"UnexpectedResponseException\");\n this.status = status;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n}\n\nfunction bytesToString(bytes) {\n if (typeof bytes !== \"object\" || bytes?.length === undefined) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\nfunction string32(value) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof value === \"number\" && Math.abs(value) < 2 ** 32,\n `string32: Unexpected input \"${value}\".`\n );\n }\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\n// Ensure that the returned Object has a `null` prototype; hence why\n// `Object.fromEntries(...)` is not used.\nfunction objectFromMap(map) {\n const obj = Object.create(null);\n for (const [key, value] of map) {\n obj[key] = value;\n }\n return obj;\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(\"\"); // eslint-disable-line no-new, no-new-func\n return true;\n } catch {\n return false;\n }\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n return shadow(this, \"isLittleEndian\", isLittleEndian());\n }\n\n static get isEvalSupported() {\n return shadow(this, \"isEvalSupported\", isEvalSupported());\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(\n this,\n \"isOffscreenCanvasSupported\",\n typeof OffscreenCanvas !== \"undefined\"\n );\n }\n\n static get platform() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (typeof navigator !== \"undefined\" &&\n typeof navigator?.platform === \"string\")\n ) {\n return shadow(this, \"platform\", {\n isMac: navigator.platform.includes(\"Mac\"),\n });\n }\n return shadow(this, \"platform\", { isMac: false });\n }\n\n static get isCSSRoundSupported() {\n return shadow(\n this,\n \"isCSSRoundSupported\",\n globalThis.CSS?.supports?.(\"width: round(1.5px, 1px)\")\n );\n }\n}\n\nconst hexNumbers = [...Array(256).keys()].map(n =>\n n.toString(16).padStart(2, \"0\")\n);\n\nclass Util {\n static makeHexColor(r, g, b) {\n return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n }\n\n // Apply a scaling matrix to some min/max values.\n // If a scaling factor is negative then min and max must be\n // swaped.\n static scaleMinMax(transform, minMax) {\n let temp;\n if (transform[0]) {\n if (transform[0] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[0];\n minMax[1] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[2];\n minMax[1] *= transform[2];\n }\n minMax[0] += transform[4];\n minMax[1] += transform[4];\n minMax[2] += transform[5];\n minMax[3] += transform[5];\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m) {\n const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n\n static applyInverseTransform(p, m) {\n const d = m[0] * m[3] - m[1] * m[2];\n const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static getAxialAlignedBoundingBox(r, m) {\n const p1 = this.applyTransform(r, m);\n const p2 = this.applyTransform(r.slice(2, 4), m);\n const p3 = this.applyTransform([r[0], r[3]], m);\n const p4 = this.applyTransform([r[2], r[1]], m);\n return [\n Math.min(p1[0], p2[0], p3[0], p4[0]),\n Math.min(p1[1], p2[1], p3[1], p4[1]),\n Math.max(p1[0], p2[0], p3[0], p4[0]),\n Math.max(p1[1], p2[1], p3[1], p4[1]),\n ];\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(m) {\n const transpose = [m[0], m[2], m[1], m[3]];\n\n // Multiply matrix m with its transpose.\n const a = m[0] * transpose[0] + m[1] * transpose[2];\n const b = m[0] * transpose[1] + m[1] * transpose[3];\n const c = m[2] * transpose[0] + m[3] * transpose[2];\n const d = m[2] * transpose[1] + m[3] * transpose[3];\n\n // Solve the second degree polynomial to get roots.\n const first = (a + d) / 2;\n const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;\n const sx = first + second || 1;\n const sy = first - second || 1;\n\n // Scale values are the square roots of the eigenvalues.\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'null'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n const xLow = Math.max(\n Math.min(rect1[0], rect1[2]),\n Math.min(rect2[0], rect2[2])\n );\n const xHigh = Math.min(\n Math.max(rect1[0], rect1[2]),\n Math.max(rect2[0], rect2[2])\n );\n if (xLow > xHigh) {\n return null;\n }\n const yLow = Math.max(\n Math.min(rect1[1], rect1[3]),\n Math.min(rect2[1], rect2[3])\n );\n const yHigh = Math.min(\n Math.max(rect1[1], rect1[3]),\n Math.max(rect2[1], rect2[3])\n );\n if (yLow > yHigh) {\n return null;\n }\n\n return [xLow, yLow, xHigh, yHigh];\n }\n\n // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) {\n const tvalues = [],\n bounds = [[], []];\n let a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n for (let i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = Math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n t1 = (-b + sqrtb2ac) / (2 * a);\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n t2 = (-b - sqrtb2ac) / (2 * a);\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n let j = tvalues.length,\n mt;\n const jlen = j;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] =\n mt * mt * mt * x0 +\n 3 * mt * mt * t * x1 +\n 3 * mt * t * t * x2 +\n t * t * t * x3;\n bounds[1][j] =\n mt * mt * mt * y0 +\n 3 * mt * mt * t * y1 +\n 3 * mt * t * t * y2 +\n t * t * t * y3;\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n return [\n Math.min(...bounds[0]),\n Math.min(...bounds[1]),\n Math.max(...bounds[0]),\n Math.max(...bounds[1]),\n ];\n }\n}\n\nconst PDFStringTranslateTable = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8,\n 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192,\n 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018,\n 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d,\n 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac,\n];\n\nfunction stringToPDFString(str) {\n // See section 7.9.2.2 Text String Type.\n // The string can contain some language codes bracketed with 0x0b,\n // so we must remove them.\n if (str[0] >= \"\\xEF\") {\n let encoding;\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n if (str.length % 2 === 1) {\n str = str.slice(0, -1);\n }\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n if (str.length % 2 === 1) {\n str = str.slice(0, -1);\n }\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(str);\n const decoded = decoder.decode(buffer);\n if (!decoded.includes(\"\\x1b\")) {\n return decoded;\n }\n return decoded.replaceAll(/\\x1b[^\\x1b]*(?:\\x1b|$)/g, \"\");\n } catch (ex) {\n warn(`stringToPDFString: \"${ex}\".`);\n }\n }\n }\n // ISO Latin 1\n const strBuf = [];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const charCode = str.charCodeAt(i);\n if (charCode === 0x1b) {\n // eslint-disable-next-line no-empty\n while (++i < ii && str.charCodeAt(i) !== 0x1b) {}\n continue;\n }\n const code = PDFStringTranslateTable[charCode];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayBuffer(v) {\n return typeof v === \"object\" && v?.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n const buffer = [\n date.getUTCFullYear().toString(),\n (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n date.getUTCDate().toString().padStart(2, \"0\"),\n date.getUTCHours().toString().padStart(2, \"0\"),\n date.getUTCMinutes().toString().padStart(2, \"0\"),\n date.getUTCSeconds().toString().padStart(2, \"0\"),\n ];\n\n return buffer.join(\"\");\n}\n\nclass PromiseCapability {\n #settled = false;\n\n constructor() {\n /**\n * @type {Promise<any>} The Promise object.\n */\n this.promise = new Promise((resolve, reject) => {\n /**\n * @type {function} Fulfills the Promise.\n */\n this.resolve = data => {\n this.#settled = true;\n resolve(data);\n };\n\n /**\n * @type {function} Rejects the Promise.\n */\n this.reject = reason => {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(reason instanceof Error, 'Expected valid \"reason\" argument.');\n }\n this.#settled = true;\n reject(reason);\n };\n });\n }\n\n /**\n * @type {boolean} If the Promise has been fulfilled/rejected.\n */\n get settled() {\n return this.#settled;\n }\n}\n\nlet NormalizeRegex = null;\nlet NormalizationMap = null;\nfunction normalizeUnicode(str) {\n if (!NormalizeRegex) {\n // In order to generate the following regex:\n // - create a PDF containing all the chars in the range 0000-FFFF with\n // a NFKC which is different of the char.\n // - copy and paste all those chars and get the ones where NFKC is\n // required.\n // It appears that most the chars here contain some ligatures.\n NormalizeRegex =\n /([\\u00a0\\u00b5\\u037e\\u0eb3\\u2000-\\u200a\\u202f\\u2126\\ufb00-\\ufb04\\ufb06\\ufb20-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufba1\\ufba4-\\ufba9\\ufbae-\\ufbb1\\ufbd3-\\ufbdc\\ufbde-\\ufbe7\\ufbea-\\ufbf8\\ufbfc-\\ufbfd\\ufc00-\\ufc5d\\ufc64-\\ufcf1\\ufcf5-\\ufd3d\\ufd88\\ufdf4\\ufdfa-\\ufdfb\\ufe71\\ufe77\\ufe79\\ufe7b\\ufe7d]+)|(\\ufb05+)/gu;\n NormalizationMap = new Map([[\"ſt\", \"ſt\"]]);\n }\n return str.replaceAll(NormalizeRegex, (_, p1, p2) => {\n return p1 ? p1.normalize(\"NFKC\") : NormalizationMap.get(p2);\n });\n}\n\nfunction getUuid() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (typeof crypto !== \"undefined\" && typeof crypto?.randomUUID === \"function\")\n ) {\n return crypto.randomUUID();\n }\n const buf = new Uint8Array(32);\n if (\n typeof crypto !== \"undefined\" &&\n typeof crypto?.getRandomValues === \"function\"\n ) {\n crypto.getRandomValues(buf);\n } else {\n for (let i = 0; i < 32; i++) {\n buf[i] = Math.floor(Math.random() * 255);\n }\n }\n return bytesToString(buf);\n}\n\nconst AnnotationPrefix = \"pdfjs_internal_id_\";\n\nexport {\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMode,\n AnnotationPrefix,\n AnnotationReplyType,\n AnnotationType,\n assert,\n BaseException,\n BASELINE_FACTOR,\n bytesToString,\n CMapCompressionType,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FormatError,\n getModificationDate,\n getUuid,\n getVerbosityLevel,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayBuffer,\n isArrayEqual,\n isNodeJS,\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n MAX_IMAGE_SIZE_TO_CACHE,\n MissingPDFException,\n normalizeUnicode,\n objectFromMap,\n objectSize,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n PromiseCapability,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n TextRenderingMode,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var webpackQueues = typeof Symbol === \"function\" ? Symbol(\"webpack queues\") : \"__webpack_queues__\";\nvar webpackExports = typeof Symbol === \"function\" ? Symbol(\"webpack exports\") : \"__webpack_exports__\";\nvar webpackError = typeof Symbol === \"function\" ? Symbol(\"webpack error\") : \"__webpack_error__\";\nvar resolveQueue = (queue) => {\n\tif(queue && queue.d < 1) {\n\t\tqueue.d = 1;\n\t\tqueue.forEach((fn) => (fn.r--));\n\t\tqueue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));\n\t}\n}\nvar wrapDeps = (deps) => (deps.map((dep) => {\n\tif(dep !== null && typeof dep === \"object\") {\n\t\tif(dep[webpackQueues]) return dep;\n\t\tif(dep.then) {\n\t\t\tvar queue = [];\n\t\t\tqueue.d = 0;\n\t\t\tdep.then((r) => {\n\t\t\t\tobj[webpackExports] = r;\n\t\t\t\tresolveQueue(queue);\n\t\t\t}, (e) => {\n\t\t\t\tobj[webpackError] = e;\n\t\t\t\tresolveQueue(queue);\n\t\t\t});\n\t\t\tvar obj = {};\n\t\t\tobj[webpackQueues] = (fn) => (fn(queue));\n\t\t\treturn obj;\n\t\t}\n\t}\n\tvar ret = {};\n\tret[webpackQueues] = x => {};\n\tret[webpackExports] = dep;\n\treturn ret;\n}));\n__webpack_require__.a = (module, body, hasAwait) => {\n\tvar queue;\n\thasAwait && ((queue = []).d = -1);\n\tvar depQueues = new Set();\n\tvar exports = module.exports;\n\tvar currentDeps;\n\tvar outerResolve;\n\tvar reject;\n\tvar promise = new Promise((resolve, rej) => {\n\t\treject = rej;\n\t\touterResolve = resolve;\n\t});\n\tpromise[webpackExports] = exports;\n\tpromise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise[\"catch\"](x => {}));\n\tmodule.exports = promise;\n\tbody((deps) => {\n\t\tcurrentDeps = wrapDeps(deps);\n\t\tvar fn;\n\t\tvar getResult = () => (currentDeps.map((d) => {\n\t\t\tif(d[webpackError]) throw d[webpackError];\n\t\t\treturn d[webpackExports];\n\t\t}))\n\t\tvar promise = new Promise((resolve) => {\n\t\t\tfn = () => (resolve(getResult));\n\t\t\tfn.r = 0;\n\t\t\tvar fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));\n\t\t\tcurrentDeps.map((dep) => (dep[webpackQueues](fnQueue)));\n\t\t});\n\t\treturn fn.r ? promise : getResult();\n\t}, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));\n\tqueue && queue.d < 0 && (queue.d = 0);\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","","// startup\n// Load entry module and return exports\n// This entry module used 'module' so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(907);\n",""],"names":["makeColorComp","n","Math","floor","max","min","toString","padStart","scaleAndClamp","x","ColorConverters","CMYK_G","c","y","m","k","G_CMYK","g","G_RGB","G_rgb","G_HTML","G","RGB_G","r","b","RGB_rgb","color","map","RGB_HTML","join","T_HTML","T_rgb","CMYK_RGB","CMYK_rgb","CMYK_HTML","components","rgb","slice","RGB_CMYK","AnnotationBorderStyleType","AnnotationEditorType","AnnotationPrefix","AnnotationType","FeatureTest","LINE_FACTOR","shadow","unreachable","Util","warn","DOMSVGFactory","getFilenameFromUrl","PDFDateString","setLayerDimensions","AnnotationStorage","XfaLayer","DEFAULT_TAB_INDEX","DEFAULT_FONT_SIZE","GetElementsByNameSet","WeakSet","getRectDims","rect","width","height","AnnotationElementFactory","create","parameters","subtype","data","annotationType","LINK","LinkAnnotationElement","TEXT","TextAnnotationElement","WIDGET","fieldType","TextWidgetAnnotationElement","radioButton","RadioButtonWidgetAnnotationElement","checkBox","CheckboxWidgetAnnotationElement","PushButtonWidgetAnnotationElement","ChoiceWidgetAnnotationElement","SignatureWidgetAnnotationElement","WidgetAnnotationElement","POPUP","PopupAnnotationElement","FREETEXT","FreeTextAnnotationElement","LINE","LineAnnotationElement","SQUARE","SquareAnnotationElement","CIRCLE","CircleAnnotationElement","POLYLINE","PolylineAnnotationElement","CARET","CaretAnnotationElement","INK","InkAnnotationElement","POLYGON","PolygonAnnotationElement","HIGHLIGHT","HighlightAnnotationElement","UNDERLINE","UnderlineAnnotationElement","SQUIGGLY","SquigglyAnnotationElement","STRIKEOUT","StrikeOutAnnotationElement","STAMP","StampAnnotationElement","FILEATTACHMENT","FileAttachmentAnnotationElement","AnnotationElement","hasBorder","constructor","isRenderable","ignoreBorder","createQuadrilaterals","layer","linkService","downloadManager","imageResourcesPath","renderForms","svgFactory","annotationStorage","enableScripting","hasJSActions","_fieldObjects","fieldObjects","parent","container","_createContainer","_createQuadrilaterals","_hasPopupData","titleObj","contentsObj","richText","str","hasPopupData","page","viewport","document","createElement","setAttribute","id","tabIndex","style","zIndex","popupRef","noRotate","classList","add","pageWidth","pageHeight","pageX","pageY","rawDims","rotation","hasOwnCanvas","setRotation","normalizeRect","view","borderStyle","borderWidth","horizontalRadius","horizontalCornerRadius","verticalRadius","verticalCornerRadius","radius","borderRadius","SOLID","DASHED","BEVELED","INSET","borderBottomStyle","borderColor","makeHexColor","left","top","angle","elementWidth","elementHeight","_commonActions","setColor","jsName","styleName","event","detail","colorType","colorArray","target","setValue","display","hidden","visibility","noView","noPrint","print","focus","setTimeout","preventScroll","userName","title","readonly","disabled","required","_setRequired","bgColor","fillColor","fgColor","textColor","strokeColor","_dispatchEventFromSandbox","actions","jsEvent","commonActions","name","Object","keys","action","_setDefaultPropertiesFromJS","element","storedData","getRawValue","actionName","entries","eventProxy","quadPoints","rectBlX","rectBlY","rectTrX","rectTrY","length","trX","trY","blX","blY","svgBuffer","svg","defs","append","clipPath","rectWidth","rectHeight","push","backgroundImage","_createPopup","popup","modificationDate","parentRect","elements","div","render","_getElementsByName","skipId","fields","fieldObj","exportValues","exportValue","domElement","querySelector","has","getElementsByName","getAttribute","show","maybeShow","hide","forceHide","getElementsToTriggerPopup","addHighlightArea","triggers","Array","isArray","_isEditable","_editOnDoubleClick","annotationEditorType","mode","editId","addEventListener","eventBus","dispatch","source","options","isTooltipOnly","link","isBound","url","addLinkAttributes","newWindow","_bindNamedAction","attachment","bindAttachment","attachmentDest","setOCGState","bindSetOCGState","dest","_bindLink","Action","_bindJSAction","resetForm","_bindResetFormAction","setInternalLink","destination","href","getDestinationHash","onclick","goToDestination","getAnchorUrl","executeNamedAction","openOrDownloadData","content","filename","executeSetOCGState","Map","get","otherClickAction","resetFormFields","refs","resetFormRefs","include","allFields","fieldIds","Set","fieldName","values","field","storage","allIds","type","value","defaultValue","dispatchEvent","Event","ids","image","src","toLowerCase","JSON","stringify","alternativeText","showElementAndHideCanvas","previousSibling","nodeName","_getKeyModifier","platform","isMac","metaKey","ctrlKey","_setEventListener","elementData","baseName","eventName","valueGetter","includes","shift","shiftKey","modifier","focused","relatedTarget","_setEventListeners","names","getter","Blur","Focus","_setBackgroundColor","backgroundColor","_setTextStyle","TEXT_ALIGNMENT","fontColor","defaultAppearanceData","fontSize","computedFontSize","BORDER_SIZE","roundToOneDecimal","round","multiLine","abs","numberOfLines","lineHeight","textAlignment","textAlign","isRequired","removeAttribute","hasAppearance","fieldValue","setPropertyOnSiblings","base","key","keyInStorage","getValue","textContent","maxLen","charLimit","fieldFormattedValues","formattedValue","comb","replaceAll","userValue","lastCommittedValue","commitKey","doNotScroll","overflowY","overflowX","readOnly","maxLength","defaultFieldValue","blurListener","undefined","scrollLeft","activeElement","selRange","setSelectionRange","willCommit","selStart","selectionStart","selEnd","selectionEnd","_blurListener","Keystroke","inputType","match","substring","preventDefault","change","fieldWidth","combWidth","letterSpacing","verticalAlign","checked","checkbox","curChecked","buttonValue","radio","pdfButtonValue","linkElement","lastChild","selectElement","addAnEmptyEntry","combo","size","multiSelect","multiple","option","selected","optionElement","displayValue","removeEmptyEntry","noneOptionElement","prepend","remove","removeEventListener","isExport","selectedIndex","prototype","filter","call","selectedValues","getItems","multipleSelection","index","i","findIndex","items","clear","insert","selectChild","children","before","item","indices","editable","changeEx","keyDown","PopupElement","open","elementIds","boundKeyDown","bind","boundHide","boundShow","boundToggle","toggle","dateObj","pinned","wasVisible","toDateObject","trigger","flatMap","e","className","baseColor","outlineColor","CSS","supports","BACKGROUND_ENLIGHT","header","dir","date","toLocaleDateString","time","toLocaleTimeString","xfaHtml","html","intent","contents","_formatContents","useParentRect","intersect","normalizedRect","HORIZONTAL_SPACE_AFTER_ANNOTATION","parentWidth","popupLeft","popupTop","p","lines","split","ii","line","createTextNode","altKey","isVisible","parseInt","textPosition","lineSpan","lineCoordinates","square","circle","polyline","containerClassName","svgElementName","points","coordinate","vertices","polylines","inkList","inkLists","file","fillAlpha","test","download","evt","AnnotationLayer","accessibilityManager","annotationCanvasMap","editableAnnotations","appendElement","contentElement","firstChild","moveElementInDOM","params","annotations","popupToElements","elementParams","noHTML","isPopupAnnotation","set","rendered","setAnnotationCanvasMap","update","canvas","replaceWith","getEditableAnnotations","from","getEditableAnnotation","objectFromMap","AnnotationEditor","MurmurHash3_64","SerializableEmpty","freeze","hash","transfer","modified","onSetModified","onResetModified","onAnnotationEditor","assign","delete","resetModified","obj","entry","val","setModified","_type","getAll","setAll","PrintAnnotationStorage","serializable","context","hasBitmap","serialized","serialize","bitmap","hexdigest","clone","structuredClone","AbortException","AnnotationMode","assert","getVerbosityLevel","info","InvalidPDFException","isArrayBuffer","isNodeJS","MAX_IMAGE_SIZE_TO_CACHE","MissingPDFException","PasswordException","PromiseCapability","RenderingIntentFlag","setVerbosityLevel","stringToBytes","UnexpectedResponseException","UnknownErrorException","DOMCanvasFactory","DOMCMapReaderFactory","DOMFilterFactory","DOMStandardFontDataFactory","isDataScheme","isValidFetchUrl","PageViewport","RenderingCancelledException","StatTimer","FontFaceObject","FontLoader","NodeCanvasFactory","NodeCMapReaderFactory","NodeFilterFactory","NodeStandardFontDataFactory","CanvasGraphics","GlobalWorkerOptions","MessageHandler","Metadata","OptionalContentConfig","PDFDataTransportStream","PDFFetchStream","PDFNetworkStream","PDFNodeStream","XfaText","DEFAULT_RANGE_CHUNK_SIZE","RENDERING_CANCELLED_TIMEOUT","DELAYED_CLEANUP_TIMEOUT","DefaultCanvasFactory","DefaultCMapReaderFactory","DefaultFilterFactory","DefaultStandardFontDataFactory","getDocument","URL","Error","range","task","PDFDocumentLoadingTask","docId","getUrlProp","getDataProp","httpHeaders","withCredentials","password","rangeTransport","PDFDataRangeTransport","rangeChunkSize","Number","isInteger","worker","PDFWorker","verbosity","docBaseUrl","cMapUrl","cMapPacked","CMapReaderFactory","standardFontDataUrl","StandardFontDataFactory","ignoreErrors","stopAtErrors","maxImageSize","isEvalSupported","isOffscreenCanvasSupported","canvasMaxAreaInBytes","disableFontFace","fontExtraProperties","enableXfa","ownerDocument","globalThis","disableRange","disableStream","disableAutoFetch","pdfBug","NaN","useSystemFonts","useWorkerFetch","baseURI","canvasFactory","filterFactory","styleElement","transportFactory","cMapReaderFactory","baseUrl","isCompressed","standardFontDataFactory","workerParams","port","workerPort","fromPort","_worker","fetchDocParams","apiVersion","evaluatorOptions","transportParams","promise","then","destroyed","workerIdPromise","_fetchDocument","networkStreamPromise","Promise","resolve","networkStream","initialData","progressiveDone","contentDispositionFilename","createPDFNetworkStream","all","workerId","messageHandler","transport","WorkerTransport","_transport","send","catch","_capability","reject","sendWithPromise","buffer","window","location","Buffer","Uint8Array","byteLength","isNaN","onPassword","onProgress","destroy","_pendingDestroy","ex","_rangeListeners","_progressListeners","_progressiveReadListeners","_progressiveDoneListeners","_readyCapability","addRangeListener","listener","addProgressListener","addProgressiveReadListener","addProgressiveDoneListener","onDataRange","begin","chunk","onDataProgress","loaded","total","onDataProgressiveRead","onDataProgressiveDone","transportReady","requestDataRange","end","abort","PDFDocumentProxy","pdfInfo","_pdfInfo","numPages","fingerprints","isPureXfa","_htmlForXfa","allXfaHtml","getPage","pageNumber","getPageIndex","ref","getDestinations","getDestination","getPageLabels","getPageLayout","getPageMode","getViewerPreferences","getOpenAction","getAttachments","getJSActions","getDocJSActions","getOutline","getOptionalContentConfig","getPermissions","getMetadata","getMarkInfo","getData","saveDocument","getDownloadInfo","downloadInfoCapability","cleanup","keepLoadedFonts","startCleanup","loadingTask","loadingParams","getFieldObjects","getCalculationOrderIds","PDFPageProxy","delayedCleanupTimeout","pendingCleanup","pageIndex","pageInfo","_pageIndex","_pageInfo","_stats","_pdfBug","commonObjs","objs","PDFObjects","_maybeCleanupAfterRender","_intentStates","rotate","userUnit","getViewport","scale","offsetX","offsetY","dontFlip","viewBox","getAnnotations","intentArgs","getRenderingIntent","renderingIntent","getPageJSActions","getXfa","canvasContext","annotationMode","ENABLE","transform","background","optionalContentConfigPromise","pageColors","printAnnotationStorage","abortDelayedCleanup","intentState","cacheKey","streamReaderCancelTimeout","clearTimeout","intentPrint","PRINT","displayReadyCapability","operatorList","fnArray","argsArray","lastChunk","separateAnnots","_pumpOperatorList","complete","error","renderTasks","internalRenderTask","tryCleanup","capability","_abortOperatorList","reason","timeEnd","InternalRenderTask","callback","useRequestAnimationFrame","renderTask","transparency","optionalContentConfig","initializeGraphics","operatorListChanged","getOperatorList","opListReadCapability","opListTask","streamTextContent","includeMarkedContent","disableNormalization","TEXT_CONTENT_CHUNK_SIZE","sendWithStream","highWaterMark","getTextContent","xfa","readableStream","pump","reader","read","done","styles","getReader","getStructTree","_destroy","waitOn","force","completed","cancel","resetStats","success","delayed","_startRenderPage","_renderPageChunk","operatorListChunk","annotationStorageSerializable","streamReader","delay","extraDelay","message","curCacheKey","curIntentState","stats","LoopbackPort","listeners","deferred","postMessage","terminate","PDFWorkerUtil","isWorkerDisabled","fakeWorkerId","workerSrc","isSameOrigin","otherUrl","origin","other","createCDNWrapper","wrapper","createObjectURL","Blob","workerPorts","_port","_webWorker","_messageHandler","WeakMap","_initializeFromPort","_initialize","on","mainThreadWorkerMessageHandler","Worker","terminateEarly","onWorkerError","_setupFakeWorker","sendTest","testObj","_setupFakeWorkerGlobal","WorkerMessageHandler","workerHandler","setup","cachedPort","pdfjsWorker","loader","__non_webpack_import__","methodPromises","pageCache","pagePromises","passwordCapability","factory","fontLoader","_params","destroyCapability","_networkStream","_fullReader","_lastProgress","setupMessageHandler","cacheSimpleMethod","cachedPromise","isOpList","DISPLAY","ANY","DISABLE","ANNOTATIONS_DISABLE","ENABLE_FORMS","ANNOTATIONS_FORMS","ENABLE_STORAGE","ANNOTATIONS_STORAGE","OPLIST","hasOwnProperty","terminated","cancelAllRequests","sink","getFullReader","onPull","close","ArrayBuffer","enqueue","onCancel","ready","readyReason","headersCapability","fullReader","headersReady","isStreamingSupported","isRangeSupported","contentLength","rangeReader","getRangeReader","_numPages","htmlForXfa","code","status","details","exception","updatePassword","exportedData","exportedError","inspectFont","FontInspector","enabled","font","fontAdded","finally","imageData","pageProxy","fetch","num","gen","results","metadata","cleanupSuccessful","ensureObj","objId","settled","RenderTask","onContinue","form","canvasInUse","operatorListIdx","running","graphicsReadyCallback","graphicsReady","_useRequestAnimationFrame","cancelled","_cancelBound","_continueBound","_continue","_scheduleNextBound","_scheduleNext","_nextBound","_next","_canvas","StepperManager","stepper","init","nextBreakPoint","getNextBreakPoint","gfx","beginDrawing","endDrawing","updateOperatorList","requestAnimationFrame","executeOperatorList","version","build","CMapCompressionType","BaseFilterFactory","addFilter","maps","addHCMFilter","addHighlightHCMFilter","newFgColor","newBgColor","keepHCM","BaseCanvasFactory","_createCanvas","getContext","reset","canvasAndContext","BaseCMapReaderFactory","compressionType","BINARY","NONE","_fetchData","BaseStandardFontDataFactory","BaseSVGFactory","skipDimensions","_createSVG","FormatError","getCurrentTransform","PathType","FILL","STROKE","SHADING","applyBoundingBox","ctx","bbox","region","Path2D","clip","BaseShadingPattern","getPattern","RadialAxialShadingPattern","IR","_bbox","_colorStops","_p0","_p1","_r0","_r1","matrix","_createGradient","grad","createLinearGradient","createRadialGradient","colorStop","addColorStop","owner","inverse","pathType","pattern","ownerBBox","current","getClippedPathBoundingBox","ceil","tmpCanvas","cachedCanvases","getCanvas","tmpCtx","clearRect","beginPath","translate","baseTransform","fillStyle","fill","createPattern","domMatrix","DOMMatrix","setTransform","drawTriangle","p1","p2","p3","c1","c2","c3","coords","colors","bytes","rowSize","tmp","x1","scaleX","y1","scaleY","x2","y2","x3","y3","c1r","c1g","c1b","c2r","c2g","c2b","c3r","c3g","c3b","minY","maxY","xa","car","cag","cab","xb","cbr","cbg","cbb","x1_","x2_","j","drawFigure","figure","ps","cs","verticesPerRow","rows","cols","q","MeshShadingPattern","_coords","_colors","_figures","_bounds","_background","_createMeshCanvas","combinedScale","EXPECTED_SCALE","MAX_PATTERN_SIZE","boundsWidth","boundsHeight","paddedWidth","paddedHeight","createImageData","putImageData","singularValueDecompose2dScale","matrixScale","temporaryPatternCanvas","DummyShadingPattern","getShadingPattern","PaintType","COLORED","UNCOLORED","TilingPattern","canvasGraphicsFactory","xstep","ystep","paintType","tilingType","createPatternCanvas","x0","y0","curMatrixScale","dimx","getSizeAndScale","dimy","graphics","createCanvasGraphics","groupLevel","setFillAndStrokeStyleToContext","adjustedX0","adjustedY0","adjustedX1","adjustedY1","save","clipBbox","step","realOutputSize","maxSize","bboxWidth","bboxHeight","updateRectMinMax","endPath","strokeStyle","cssColor","ImageKind","convertToRGBA","kind","GRAYSCALE_1BPP","convertBlackAndWhiteToRGBA","RGB_24BPP","convertRGBToRGBA","srcPos","nonBlackColor","inverseDecode","black","isLittleEndian","zeroMapping","oneMapping","widthInSource","widthRemainder","srcLength","Uint32Array","destPos","elem","len32","src32","s1","s2","s3","jj","grayToRGBA","FONT_IDENTITY_MATRIX","IDENTITY_MATRIX","OPS","TextRenderingMode","getCurrentTransformInverse","PixelsPerInch","MIN_FONT_SIZE","MAX_FONT_SIZE","MAX_GROUP_SIZE","EXECUTION_TIME","EXECUTION_STEPS","MAX_SIZE_TO_COMPILE","FULL_CHUNK_HEIGHT","mirrorContextOperations","destCtx","_removeMirroring","__originalSave","__originalRestore","restore","__originalRotate","__originalScale","__originalTranslate","__originalTransform","__originalSetTransform","__originalResetTransform","resetTransform","__originalClip","__originalMoveTo","moveTo","__originalLineTo","lineTo","__originalBezierCurveTo","bezierCurveTo","__originalRect","__originalClosePath","closePath","__originalBeginPath","ctxSave","ctxRestore","ctxTranslate","ctxScale","ctxTransform","a","d","f","ctxSetTransform","ctxResetTransform","ctxRotate","rule","cp1x","cp1y","cp2x","cp2y","CachedCanvases","cache","canvasEntry","drawImageAtIntegerCoords","srcImg","srcX","srcY","srcW","srcH","destX","destY","destW","destH","tx","ty","tlX","rTlX","tlY","rTlY","brX","rWidth","brY","rHeight","sign","drawImage","hypot","compileType3Glyph","imgData","POINT_TO_PROCESS_LIMIT","POINT_TYPES","width1","j0","lineSize","pos","mask","count","sum","steps","Int32Array","path","p0","pp","drawOutline","CanvasExtraState","alphaIsShape","fontSizeScale","textMatrix","textMatrixScale","fontMatrix","leading","lineX","lineY","charSpacing","wordSpacing","textHScale","textRenderingMode","textRise","patternFill","strokeAlpha","lineWidth","activeSMask","transferMaps","startNewPathAndClipBox","clipBox","setCurrentPoint","updatePathMinMax","applyTransform","minX","maxX","p4","updateScalingPathMinMax","minMax","scaleMinMax","updateCurvePathMinMax","box","bezierBoundingBox","getPathBoundingBox","xStrokePad","yStrokePad","updateClipFromPath","isEmptyClip","Infinity","putBinaryImageData","ImageData","partialChunkHeight","fullChunks","totalChunks","chunkImgData","thisChunkHeight","elemsInThisChunk","dest32","dest32DataLength","fullSrcDiff","white","srcDiff","kEnd","kEndUnrolled","srcByte","RGBA_32BPP","subarray","putBinaryImageMask","copyCtxState","sourceCtx","properties","property","setLineDash","getLineDash","lineDashOffset","resetCtxToDefault","fillRule","globalAlpha","lineCap","lineJoin","miterLimit","globalCompositeOperation","composeSMaskBackdrop","r0","g0","b0","alpha","alpha_","composeSMaskAlpha","maskData","layerData","transferMap","composeSMaskLuminosity","genericComposeSMask","maskCtx","layerCtx","backdrop","layerOffsetX","layerOffsetY","maskOffsetX","maskOffsetY","hasBackdrop","composeFn","PIXELS_TO_PROCESS","chunkSize","row","chunkHeight","getImageData","composeSMask","smask","layerBox","layerWidth","layerHeight","getImageSmoothingEnabled","interpolate","fround","actualScale","devicePixelRatio","PDF_TO_CSS_UNITS","LINE_CAP_STYLES","LINE_JOIN_STYLES","NORMAL_CLIP","EO_CLIP","canvasCtx","markedContentStack","stateStack","pendingClip","pendingEOFill","res","xobjs","groupStack","processingType3","baseTransformStack","smaskStack","smaskCounter","tempSMask","suspendedCtx","contentVisible","cachedPatterns","viewportScale","outputScaleX","outputScaleY","_cachedScaleForStroking","_cachedGetSinglePixelWidth","_cachedBitmapsMap","getObject","fallback","startsWith","savedFillStyle","fillRect","transparentCanvas","compositeCtx","executionStartIdx","continueCallback","argsArrayLen","chunkOperations","endTime","Date","now","fnId","breakIt","dependency","apply","depObjId","objsPool","restoreInitialState","inSMaskMode","HTMLCanvasElement","drawFilter","hcmFilterId","foreground","savedFilter","_scaleImage","img","inverseTransform","widthScale","heightScale","paintWidth","paintHeight","tmpCanvasId","newWidth","newHeight","_createMaskCanvas","isPatternFill","currentTransform","scaled","maskCanvas","mainKey","cachedImage","maskToCanvas","getAxialAlignedBoundingBox","drawnWidth","drawnHeight","fillCanvas","fillCtx","imageSmoothingEnabled","setLineWidth","setLineCap","setLineJoin","setMiterLimit","limit","setDash","dashArray","dashPhase","setRenderingIntent","setFlatness","flatness","setGState","states","setFont","checkSMaskState","beginSMaskMode","endSMaskMode","cacheId","scratchCanvas","compose","dirtyBox","old","pop","constructPath","ops","args","startX","startY","isScalingMatrix","minMaxForBezier","rectangle","xw","yh","curveTo","curveTo2","curveTo3","stroke","consumePath","rescaleAndStroke","closeStroke","needRestore","eoFill","fillStroke","eoFillStroke","closeFillStroke","closeEOFillStroke","eoClip","beginText","endText","paths","pendingTextPaths","addToPath","setCharSpacing","spacing","setWordSpacing","setHScale","setLeading","fontRefName","fontObj","fontDirection","isType3Font","loadedName","typeface","systemFontInfo","css","fallbackName","bold","italic","browserFontSize","setTextRenderingMode","setTextRise","rise","moveText","setLeadingMoveText","setTextMatrix","nextLine","paintChar","character","patternTransform","fillStrokeMode","FILL_STROKE_MASK","isAddToPathSet","ADD_TO_PATH_FLAG","missingFile","getPathGenerator","FILL_STROKE","fillText","strokeText","isFontSubpixelAAEnabled","showText","glyphs","showType3Text","glyphsLength","vertical","spacingDir","defaultVMetrics","widthAdvanceScale","simpleFillText","getSinglePixelWidth","isInvalidPDFjsFont","chars","glyph","unicode","restoreNeeded","isSpace","fontChar","accent","scaledX","scaledY","vmetric","vx","vy","remeasure","measuredWidth","measureText","characterScaleX","isInFont","scaledAccentX","offset","scaledAccentY","charWidth","isTextInvisible","INVISIBLE","spacingLength","charProcOperatorList","operatorListId","transformed","setCharWidth","xWidth","yWidth","setCharWidthAndBounds","llx","lly","urx","ury","getColorN_Pattern","_getPattern","setStrokeColorN","arguments","setFillColorN","setStrokeRGBColor","setFillRGBColor","shadingFill","inv","beginInlineImage","beginImageData","paintFormXObjectBegin","paintFormXObjectEnd","beginGroup","group","currentCtx","isolated","knockout","bounds","canvasBounds","groupCtx","startTransformInverse","endGroup","currentMtx","beginAnnotation","canvasWidth","canvasHeight","annotationCanvas","savedCtx","endAnnotation","paintImageMaskXObject","compiled","paintImageMaskXObjectRepeat","skewX","skewY","positions","trans","paintImageMaskXObjectGroup","images","paintImageXObject","paintInlineImageXObject","paintImageXObjectRepeat","w","h","paintInlineImageXObjectGroup","applyTransferMapsToCanvas","applyTransferMapsToBitmap","imgToPaint","HTMLElement","paintSolidColorImageMask","markPoint","tag","markPointProps","beginMarkedContent","visible","beginMarkedContentProps","isContentVisible","endMarkedContent","beginCompat","endCompat","isEmpty","absDet","normX","normY","getScaleForStroking","getTransform","scaledLineWidth","scaledXLineWidth","scaledYLineWidth","baseArea","saveRestore","dashes","op","BaseException","SVG_NS","PDF","_cache","_defs","hcmFilter","hcmKey","hcmUrl","hcmHighlightFilter","hcmHighlightKey","hcmHighlightUrl","contain","position","createElementNS","body","tableR","tableG","tableB","mapR","mapG","mapB","bufferR","bufferG","bufferB","createFilter","addTransferMapConversion","fgRGB","getRGB","bgRGB","table","addGrayConversion","getSteps","start","arr","fgGray","bgGray","newFgRGB","newBgRGB","fg","bg","newStart","newStep","prev","parentNode","feColorMatrix","appendFeFunc","feComponentTransfer","func","feFunc","rTable","gTable","bTable","getComputedStyle","getPropertyValue","_document","fetchData","response","ok","statusText","arrayBuffer","blob","json","text","request","XMLHttpRequest","responseType","onreadystatechange","readyState","DONE","responseText","cMapData","centerX","centerY","rotateA","rotateB","rotateC","rotateD","offsetCanvasX","offsetCanvasY","convertToViewportPoint","convertToViewportRectangle","topLeft","bottomRight","convertToPdfPoint","applyInverseTransform","msg","trim","isPdfFile","onlyStripPath","lastIndexOf","getPdfFilenameFromUrl","defaultFilename","reURI","reFilename","splitURI","exec","suggestedFilename","decodeURIComponent","started","times","outBuf","longest","padEnd","protocol","noContextMenu","deprecated","console","log","pdfDateStringRegex","input","RegExp","matches","year","month","day","hour","minute","second","universalTimeRelation","offsetHour","offsetMinute","UTC","getXfaPageViewport","xfaPage","attributes","colorRGB","getColorValues","span","computedColor","invertSelf","mustFlip","mustRotate","useRound","isCSSRoundSupported","widthStr","heightStr","DrawLayer","mapping","setParent","root","_svgFactory","setBox","createSVG","highlight","outlines","opacity","pathId","extractPathFromHighlightOutlines","clipPathId","clipPathUse","use","highlightOutline","use1","use2","cloneNode","polygons","polygon","prevX","prevY","updateBox","changeColor","changeOpacity","addClass","removeClass","AnnotationEditorParamsType","AnnotationEditorUIManager","bindEvents","KeyboardManager","FreeTextEditor","boundEditorDivBlur","editorDivBlur","boundEditorDivFocus","editorDivFocus","boundEditorDivInput","editorDivInput","boundEditorDivKeydown","editorDivKeydown","editorDivId","_freeTextDefaultContent","_internalPadding","_defaultColor","_defaultFontSize","_keyboardManager","proto","arrowChecker","self","small","TRANSLATE_SMALL","big","TRANSLATE_BIG","commitOrRemove","bubbles","_translateEmpty","checker","_editorType","_defaultLineColor","initialize","l10n","strings","documentElement","parseFloat","updateDefaultParams","FREETEXT_SIZE","FREETEXT_COLOR","updateParams","updateFontSize","updateColor","defaultPropertiesToUpdate","propertiesToUpdate","setFontsize","editorDiv","parentScale","setEditorDimensions","savedFontsize","addCommands","cmd","undo","mustExec","overwriteIfSameType","keepUndo","savedColor","_uiManager","translateSelectedEditors","getInitialTranslation","rebuild","isAttachedToDOM","enableEditMode","isInEditMode","setEditingState","updateToolbar","overlayDiv","contentEditable","_isDraggable","disableEditMode","isEditing","focusin","_focusEventsAllowed","onceAdded","cheatInitialRect","_initialOptions","isCentered","center","innerText","extractText","divs","getElementsByTagName","replace","parentHeight","parentDimensions","getBoundingClientRect","currentLayer","savedDisplay","parentRotation","fixAndSetPosition","commit","savedText","newText","trimEnd","setText","setContent","shouldGetKeyboardEvents","enterInEditMode","dblclick","keydown","disableEditing","enableEditing","baseX","baseY","_l10nPromise","annotationElementId","pageTranslationToScreen","pageDimensions","pageTranslation","posX","posY","setAt","replaceChildren","contentDiv","deserialize","uiManager","deleted","editor","isForCopying","padding","getRect","_colorManager","convert","structTreeParentId","_structTreeParentId","hasElementChanged","some","opacityToHex","InkEditor","baseHeight","baseWidth","boundCanvasPointermove","canvasPointermove","boundCanvasPointerleave","canvasPointerleave","boundCanvasPointerup","canvasPointerup","boundCanvasPointerdown","canvasPointerdown","canvasContextMenuTimeoutId","currentPath2D","hasSomethingToDraw","isCanvasInitialized","observer","realWidth","realHeight","requestFrameCallback","_defaultOpacity","_defaultThickness","thickness","bezierPath2D","allRawPaths","currentPath","scaleFactor","translationX","translationY","_willKeepAspectRatio","INK_THICKNESS","INK_COLOR","INK_OPACITY","updateThickness","updateOpacity","savedThickness","fitToContent","redraw","savedOpacity","createCanvas","createObserver","setCanvasDims","disconnect","removeShouldRescale","addShouldRescale","onScaleChanging","setDimensions","getInitialBBox","setStroke","startDrawing","drawPoints","draw","lastX","lastY","at","path2D","makeBezierCurve","lastPoint","stopDrawing","bezier","generateBezierPoints","xy","lastPoints","xMin","xMax","yMin","yMax","bezierPoints","control1","control2","updateTransform","setInForeground","select","addInkEditorIfNeeded","moveInDOM","button","pointerType","contains","addToAnnotationStorage","setInBackground","ResizeObserver","contentRect","observe","isResizable","setDims","setAspectRatio","roundedWidth","roundedHeight","setScaleFactor","fixDims","getPadding","scaleFactorW","scaleFactorH","buildPath2D","first","toPDFCoordinates","fromPDFCoordinates","serializePaths","s","shiftX","shiftY","p10","p11","p20","p21","p30","p31","p40","p41","getBbox","firstTime","MIN_SIZE","prevTranslationX","prevTranslationY","unscaledPadding","StampEditor","bitmapId","bitmapPromise","bitmapUrl","bitmapFile","bitmapFileName","resizeTimeoutId","isSvg","hasBeenAddedInUndoStack","supportedTypes","types","supportedTypesStr","isHandlingMimeForPasting","mime","paste","pasteEditor","getAsFile","getBitmapFetched","fromId","getBitmapDone","enableWaiting","getBitmap","imageManager","getFromId","getFromUrl","getFromFile","accept","files","click","deleteId","MAX_RATIO","factor","drawBitmap","addUndoableEditor","_eventBus","editorType","addAltTextButton","TIME_TO_WAIT","scaleBitmap","bitmapWidth","bitmapHeight","prevWidth","prevHeight","offscreen","OffscreenCanvas","transferToImageBitmap","getImageForAltText","serializeBitmap","toUrl","getSvgUrl","toDataURL","accessibilityData","isValidId","altTextData","decorative","altText","alt","stamps","area","prevData","AnnotationEditorLayer","allowClick","annotationLayer","boundPointerup","pointerup","boundPointerdown","pointerdown","editorFocusTimeoutId","editors","hadPointerDown","isCleaningUp","isDisabling","_initialized","editorTypes","registerEditorTypes","addLayer","updateMode","getMode","disableClick","enableClick","isCommitting","createAndAddNewEditor","togglePointerEvents","enable","annotationElementIds","editables","isDeletedAnnotationElement","addOrRebuild","disable","hiddenAnnotationIds","setActiveEditor","currentActive","getActive","attach","removeDeletedAnnotationElement","detach","removePointerInTextLayer","addDeletedAnnotationElement","removeEditor","changeParent","deleteAnnotationElement","addEditor","moveEditorInDOM","once","needsToBeRebuilt","getNextId","getId","createNewEditor","getCenterPoint","innerWidth","innerHeight","addNewEditor","setSelected","toggleSelected","isSelected","unselect","unselectAll","findNewParent","findParent","removeLayer","getEditors","EditorToolbar","toolbar","buttons","editToolbar","pointerDown","addDeleteButton","stopPropagation","focusIn","focusOut","addListenersToElement","capture","ColorManager","allResizerDivs","altTextDecorative","altTextButton","altTextTooltip","altTextTooltipTimeout","altTextWasFromKeyBoard","keepAspectRatio","resizersDiv","savedDimensions","boundFocusin","boundFocusout","focusout","focusedResizerName","hasBeenClicked","isResizerEnabledForKeyboard","moveInDOMTimeout","isDraggable","_zIndex","_borderLineWidth","SMALL_EDITOR_SIZE","_resizerKeyboardManager","resize","_resizeWithKeyboard","_stopResizingWithKeyboard","pageRotation","viewParameters","getPrototypeOf","getHexCode","fakeEditor","FakeEditor","_value","isEnterHandled","stopResizing","closest","isMultipleSelection","screenToPageTranslation","translateInPage","scrollIntoView","block","drag","bx","by","getBaseTranslation","toFixed","rotatePoint","getRotationMatrix","realScale","scaledWidth","scaledHeight","widthPercent","endsWith","heightPercent","createResizers","classes","resizerPointerdown","toggleAltTextButton","boundResizerPointermove","resizerPointermove","savedDraggable","pointerMoveOptions","passive","savedX","savedY","savedWidth","savedHeight","savedParentCursor","cursor","savedCursor","pointerUpCallback","addResizeToUndoStack","newX","newY","minWidth","minHeight","rotationMatrix","transf","invRotationMatrix","invTransf","getPoint","getOpposite","isDiagonal","isHorizontal","point","oppositePoint","transfOppositePoint","oppositeX","oppositeY","ratioX","ratioY","deltaX","deltaY","movementX","movementY","oldDiag","onClick","editAltText","setAltTextButtonState","PERCENT","tooltip","DELAY_TO_SHOW_TOOLTIP","altTextFinish","focusVisible","addEditToolbar","removeEditToolbar","getClientDimensions","maxWidth","maxHeight","setUpDragSession","pointerMoveCallback","dragSelectedEditors","endDragSession","_setParentAndPosition","getRectInCurrentCoords","makeResizable","boundResizerKeydown","resizerKeydown","boundResizerBlur","resizerBlur","resizerFocus","firstPosition","nextFirstPosition","child","setResizerTabIndex","stopImmediatePropagation","aspectRatio","Outliner","verticalEdges","intervals","boxes","innerMargin","isLTR","NUMBER_OF_DIGITS","EPSILON","right","shiftedMinX","shiftedMinY","lastEdge","edge","getOutlines","sort","outlineVerticalEdges","breakEdge","edges","allEdges","edge1","edge2","outline","next","lastPointX","lastPointY","binarySearch","array","middle","splice","y4","AnnotationEditorPrefix","getUuid","IdManager","ImageManager","baseId","_isSVGFittingCanvas","Image","decode","rawData","refCounter","mustRemoveAspectRatioPromise","fileReader","FileReader","imageElement","imagePromise","onload","svgUrl","result","onerror","readAsDataURL","createImageBitmap","lastModified","CommandManager","commands","locked","redo","hasSomethingToUndo","hasSomethingToRedo","callbacks","allKeys","isMacKey","_colorsMapping","matchMedia","RGB","every","activeEditor","allEditors","allLayers","altTextManager","commandManager","currentPageIndex","deletedAnnotationsElementIds","draggingEditors","editorsToRescale","focusMainContainerTimeoutId","idManager","isEnabled","isWaiting","lastActiveElement","selectedEditors","boundBlur","blur","boundFocus","boundCopy","copy","boundCut","cut","boundPaste","boundKeydown","boundOnEditingAction","onEditingAction","boundOnPageChanging","onPageChanging","boundOnScaleChanging","boundOnRotationChanging","onRotationChanging","previousStates","hasSelectedEditor","translation","translationTimeoutId","viewer","hasSomethingToControl","textInputChecker","_self","el","HTMLInputElement","selectAll","addNewEditorFromKeyboard","HTMLButtonElement","pdfDocument","_on","removeKeyboardManager","removeFocusManager","_off","direction","focusMainContainer","layerX","layerY","disableUserSelect","pagesRotation","addFocusManager","hasSelection","lastEditor","addKeyboardManager","addCopyPasteListeners","removeCopyPasteListeners","addEditListeners","removeEditListeners","clipboardData","setData","parse","newEditors","deserializedEditor","addEditorToLayer","selectEditors","isEditorHandlingKeyboard","dispatchUpdateStates","hasChanged","dispatchUpdateUI","getLayer","isFromKeyboard","disableAll","enableAll","CREATE","mustWait","getEditor","ed","firstSelectedEditor","noCommit","totalX","totalY","savedPageIndex","newPageIndex","mustBeAddedInUndoStack","move","isActive","createResponseStatusError","extractFilenameFromHeader","validateRangeRequestCapabilities","validateResponseStatus","createFetchOptions","headers","abortController","method","signal","credentials","redirect","createHeaders","Headers","getArrayBuffer","isHttp","_fullRequestReader","_rangeRequestReaders","_progressiveDataLength","_loaded","PDFFetchStreamReader","PDFFetchStreamRangeReader","stream","_stream","_reader","_filename","_withCredentials","_contentLength","_headersCapability","_disableRange","_rangeChunkSize","_abortController","AbortController","_isStreamingSupported","_isRangeSupported","_headers","getResponseHeader","allowRangeRequests","suggestedLength","_readCapability","bytesToString","string32","systemFonts","nativeFontFaces","loadingRequests","loadTestFontId","addNativeFontFace","nativeFontFace","fonts","removeNativeFontFace","insertRule","styleSheet","sheet","cssRules","loadSystemFont","_inspectFont","isFontLoadingAPISupported","fontFace","FontFace","load","baseFontName","attached","createNativeFontFace","family","createFontFaceRule","isSyncFontLoadingSupported","_queueLoadingCallback","_prepareFontLoadEvent","hasFonts","supported","navigator","userAgent","completeRequest","otherRequest","_loadTestFont","testFont","atob","int32","charCodeAt","spliceString","chunk1","chunk2","called","isFontReady","COMMENT_OFFSET","CFF_CHECKSUM_OFFSET","XXXX_VALUE","checksum","btoa","fontFamily","translatedData","compiledGlyphs","cssFontInfo","weight","fontWeight","italicAngle","mimetype","cmds","jsBuf","Function","metadataMap","parsedData","getRaw","OK_RESPONSE","PARTIAL_CONTENT_RESPONSE","xhr","NetworkManager","currXhrId","pendingRequests","requestRange","prop","requestFull","xhrId","pendingRequest","setRequestHeader","expectedStatus","onError","onStateChange","onprogress","onHeadersReceived","onDone","xhrStatus","ok_response_on_range_request","rangeHeader","getRequestXhr","isPendingRequest","abortRequest","_source","_manager","_onRangeRequestReaderClosed","indexOf","PDFNetworkStreamFullRequestReader","PDFNetworkStreamRangeRequestReader","onClosed","manager","_onHeadersReceived","_onDone","_onError","_onProgress","_url","_fullRequestId","_headersReceivedCapability","_cachedChunks","_requests","_done","_storedError","fullRequestXhrId","fullRequestXhr","requestCapability","lengthComputable","_requestId","_queuedChunk","_close","getFilenameFromContentDispositionHeader","contentDisposition","needsEncodingFixup","toParamRegExp","rfc2616unquote","unescape","rfc5987decode","rfc2047decode","fixupEncoding","rfc2231getparam","attributePattern","flags","textdecode","encoding","decoder","TextDecoder","fatal","contentDispositionStr","iter","quot","part","parts","quotindex","extvalue","encodingend","langvalue","charset","hex","String","fromCharCode","returnValues","contentEncoding","fs","http","https","fileUriRegex","parseUrl","sourceUrl","parsedUrl","host","isFsUrl","PDFNodeStreamFsFullReader","PDFNodeStreamFullReader","PDFNodeStreamFsRangeReader","PDFNodeStreamRangeReader","BaseFullReader","_readableStream","_error","_setReadableStream","BaseRangeReader","createRequestOptions","auth","hostname","handleResponse","statusCode","_request","_httpHeaders","Range","lstat","stat","createReadStream","path2d_polyfill","readFile","INTERNAL","Symbol","OptionalContentGroup","_setVisible","internal","cachedGetHash","groups","initialHash","order","creator","baseState","off","getHash","evaluateVisibilityExpression","operator","state","expression","policy","setVisibility","hasInitialVisibility","getOrder","getGroups","getGroup","MAX_TEXT_DIVS_TO_RENDER","DEFAULT_FONT_ASCENT","ascentCache","getCtx","getAscent","cachedAscent","metrics","ascent","fontBoundingBoxAscent","descent","fontBoundingBoxDescent","ratio","pixels","appendText","geom","textDiv","textDivProperties","hasText","hasEOL","_textDivs","_transform","atan2","fontName","PI","_fontInspectorEnabled","fontSubstitution","fontHeight","fontAscent","_isOffscreenCanvasSupported","sin","cos","scaleFactorStr","divStyle","_container","_rootContainer","_pageWidth","_pageHeight","dataset","fontSubstitutionLoadedName","shouldScaleText","absScaleX","absScaleY","_textDivProperties","_isReadableStream","_layoutText","layout","prevFontSize","prevFontFamily","_canceled","textDivs","textDivsLength","TextLayerRenderTask","textContentSource","textContentItemsStr","_textContentSource","ReadableStream","_textContentItemsStr","_layoutTextParams","_processItems","styleCache","br","_render","renderTextLayer","updateTextLayer","mustRescale","pdfDataRangeTransport","_queuedChunks","_progressiveDone","_contentDispositionFilename","_pdfDataRangeTransport","_rangeReaders","_onReceiveData","_onProgressiveDone","_enqueue","found","_begin","_removeRangeReader","queuedChunks","PDFDataTransportStreamReader","PDFDataTransportStreamRangeReader","_headersReady","_end","requestsCapability","setupStorage","xfaOn","xfaOff","setAttributes","isHTMLAnchorElement","HTMLAnchorElement","dataId","rootHtml","isNotForRichText","rootDiv","node","shouldBuildText","stack","childHtml","xmlns","querySelectorAll","output","walk","createValidAbsoluteUrl","normalizeUnicode","PasswordResponses","PermissionFlag","VerbosityLevel","pdfjsVersion","pdfjsBuild","CallbackKind","UNKNOWN","DATA","ERROR","StreamKind","CANCEL","CANCEL_COMPLETE","CLOSE","ENQUEUE","PULL","PULL_COMPLETE","START_COMPLETE","wrapReason","sourceName","targetName","comObj","callbackId","streamId","streamSinks","streamControllers","callbackCapabilities","actionHandler","_onComObjOnMessage","processStreamMessage","cbSourceName","cbTargetName","createStreamSink","handler","ah","transfers","queueingStrategy","controller","startCapability","startCall","pullCall","cancelCall","isClosed","desiredSize","pull","pullCapability","cancelCapability","streamSink","isCancelled","lastDesiredSize","sinkCapability","streamController","deleteStreamController","allSettled","SEED","MASK_HIGH","MASK_LOW","seed","h1","h2","blockCounts","tailLength","dataUint32","k1","k2","C1","C2","C1_LOW","C2_LOW","process","versions","nw","electron","LINE_DESCENT_FACTOR","BASELINE_FACTOR","SAVE","RESIZE","FREETEXT_OPACITY","MODIFY_CONTENTS","COPY","MODIFY_ANNOTATIONS","FILL_INTERACTIVE_FORMS","COPY_FOR_ACCESSIBILITY","ASSEMBLE","PRINT_HIGH_QUALITY","FILL_ADD_TO_PATH","STROKE_ADD_TO_PATH","FILL_STROKE_ADD_TO_PATH","ADD_TO_PATH","SOUND","MOVIE","SCREEN","PRINTERMARK","TRAPNET","WATERMARK","THREED","REDACT","AnnotationReplyType","GROUP","REPLY","AnnotationFlag","HIDDEN","NOZOOM","NOROTATE","NOVIEW","READONLY","LOCKED","TOGGLENOVIEW","LOCKEDCONTENTS","AnnotationFieldFlag","REQUIRED","NOEXPORT","MULTILINE","PASSWORD","NOTOGGLETOOFF","RADIO","PUSHBUTTON","COMBO","EDIT","SORT","FILESELECT","MULTISELECT","DONOTSPELLCHECK","DONOTSCROLL","COMB","RICHTEXT","RADIOSINUNISON","COMMITONSELCHANGE","AnnotationActionEventType","E","X","D","U","Fo","Bl","PO","PC","PV","K","F","V","C","DocumentActionEventType","WC","WS","DS","WP","DP","PageActionEventType","O","ERRORS","WARNINGS","INFOS","showSpacedText","nextLineShowText","nextLineSetSpacingShowText","setStrokeColorSpace","setFillColorSpace","setStrokeColor","setFillColor","setStrokeGray","setFillGray","setStrokeCMYKColor","setFillCMYKColor","endInlineImage","paintXObject","NEED_PASSWORD","INCORRECT_PASSWORD","level","cond","_isValidProtocol","addDefaultProtocol","dots","tryConvertEncoding","stringToUTF8String","absoluteUrl","nonSerializable","defineProperty","enumerable","configurable","writable","BaseExceptionClosure","MAX_ARGUMENT_COUNT","strBuf","chunkEnd","objectSize","buffer8","view32","hexNumbers","temp","m1","m2","xt","yt","transpose","sqrt","sx","sy","rect1","rect2","xLow","xHigh","yLow","yHigh","tvalues","t","t1","t2","b2ac","sqrtb2ac","mt","jlen","PDFStringTranslateTable","stringToPDFString","decoded","charCode","charAt","escape","utf8StringToString","encodeURIComponent","v","isArrayEqual","arr1","arr2","getModificationDate","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","NormalizeRegex","NormalizationMap","_","normalize","crypto","randomUUID","buf","getRandomValues","random"],"sourceRoot":""} |